Compare commits

...
841 Commits
Author SHA1 Message Date
nobody 5f2542f763 This commit was manufactured by cvs2svn to create tag 'MCS_0_96'.
svn path=/tags/MCS_0_96/mcs/; revision=29524
2004-06-14 16:35:26 +00:00
Jackson Harper d52b2222e8 * ILParser.jay: Set module names.
svn path=/trunk/mcs/; revision=29523
2004-06-14 16:35:26 +00:00
Sebastien Pouliot 683dc0b3bb 2004-06-14 Sebastien Pouliot <[email protected]>
* SortedListTest.cs: Un-ignored TestCapacity4 test case as it now
	works correctly under Mono.

svn path=/trunk/mcs/; revision=29522
2004-06-14 16:33:13 +00:00
Jackson Harper 4174966eab * CodeGen.cs: Implement setting module names.
svn path=/trunk/mcs/; revision=29521
2004-06-14 16:32:51 +00:00
Sebastien Pouliot 92935b3ee5 2004-06-14 Sebastien Pouliot <[email protected]>
* TimeSpan.cs: Fixed timespan with large values for hours or minutes
	(overflow is only checked for days but can also occurs in hours and
	minutes which uses Int32 when multiplying). The new results match MS
	implementation.

svn path=/trunk/mcs/; revision=29520
2004-06-14 16:31:18 +00:00
Jackson Harper 43f8d7efc0 * PEAPI.cs: Add new constructor so we can explicitly set the
module name.

svn path=/trunk/mcs/; revision=29519
2004-06-14 16:31:17 +00:00
Sebastien Pouliot 0b812daeb3 2004-06-14 Sebastien Pouliot <[email protected]>
* TimeSpanTest.cs: Added more cases with MinValue and MaxValue for
	each parameter of the constructor. Some tests are ignored because
	they are too long to run (but useful when debugging).

svn path=/trunk/mcs/; revision=29517
2004-06-14 16:27:20 +00:00
Paolo Molaro 485e69756c Mon Jun 14 18:38:34 CEST 2004 Paolo Molaro <[email protected]>
* configure.in: better explain that --with-nptl is not related to
	NPTL, but to __thread support. Set sigaltstack support to off by
	default.

svn path=/trunk/mono/; revision=29509
2004-06-14 15:52:52 +00:00
Paolo Molaro d22849413b Mon Jun 14 18:36:08 CEST 2004 Paolo Molaro <[email protected]>
* driver.c: remove NPTL reference in --version output.

svn path=/trunk/mono/; revision=29508
2004-06-14 15:47:31 +00:00
Lluis Sanchez 1f8de5e814 * ArrayList.cs: Avoid endless loop in Insert when the current size is 0.
svn path=/trunk/mcs/; revision=29505
2004-06-14 15:24:22 +00:00
Marek Safar 6f7d6b5613 2004-06-14 Marek Safar <[email protected]>
Fix bug #58254 & cs1555.cs, cs1556.cs

	* driver.cs (MainDriver): Added tests for errors CS1555, CS1556.

svn path=/trunk/mcs/; revision=29499
2004-06-14 14:34:12 +00:00
Atsushi Eno 390f4b60a9 2004-06-14 Atsushi Enomoto <[email protected]>
* XslKey.cs : Key-value search in absolute path search was
	  insufficient.

svn path=/trunk/mcs/; revision=29498
2004-06-14 13:50:17 +00:00
Dick Porter ac70de62f3 2004-06-14 Dick Porter <[email protected]>
* Directory.cs:
	* File.cs: Catch PATH_NOT_FOUND errors in Exists() too.  Fixes bug
	59354.

svn path=/trunk/mcs/; revision=29497
2004-06-14 13:18:13 +00:00
Dick Porter 6ac8ee26f2 2004-06-14 Dick Porter <[email protected]>
* 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.

svn path=/trunk/mono/; revision=29496
2004-06-14 13:09:41 +00:00
Atsushi Eno ee1e56e2a5 2004-06-14 Atsushi Enomoto <[email protected]>
* XmlDocumentNavigator.cs : MoveToNext() should skip concatenating
	  text/cdata/whitespace nodes.

svn path=/trunk/mcs/; revision=29495
2004-06-14 13:07:32 +00:00
Marek Safar 1ff36bc3db 2004-06-14 Marek Safar <[email protected]>
* cs-parser.jay: Added error CS1669 test for indexers.

svn path=/trunk/mcs/; revision=29493
2004-06-14 11:12:52 +00:00
Atsushi Eno 357572721d 2004-06-14 Atsushi Enomoto <[email protected]>
* XmlTextWriterTests.cs : Avoid CR/CRLF testing complexity.

svn path=/trunk/mcs/; revision=29492
2004-06-14 10:40:33 +00:00
Raja R Harinath 0ded9f8e5b (net20bootstrap_response): Remove. This shouldn't
differ from $(response).
(post_process): Remove, now that PLATFORM_CHANGE_SEPARATOR_CMD is
unconditional.
($(cmp_response),$(res_response)): Update.

svn path=/trunk/mcs/; revision=29491
2004-06-14 10:36:00 +00:00
Raja R Harinath 65452698f3 * platforms/linux.make (PLATFORM_CHANGE_SEPARATOR_CMD): Define to 'cat'.
(PLATFORM_TWEAK_CORLIB_SOURCES): Remove.
(platform-check): Avoid bash-ism.
* library.make: Simplify uses of $(patsubst x,y,$(foo)) to $(foo:x=y).
(core_sourcefile): Rename back to ...
(sourcefile): ... this.  Remove creation of redundant intermediate file.
(response): Change test for optimization, now that
PLATFORM_CHANGE_SEPARATOR_CMD is unconditional.  Combine with
platform-exclude handling.
(library_CLEAN_FILES): New variable to specify clean:-able files
close to where they're defined.
(test_response, btest_response): Simplify.
* executable.make (response): Change test for optimization.
(executable_CLEAN_FILES): New define.

Maintainability improvements.  Sorry, I'm still in the scratch-an-itch
mode with the build stuff :-)

svn path=/trunk/mcs/; revision=29490
2004-06-14 10:32:59 +00:00
Atsushi Eno 5c7e0ec021 2004-06-14 Atsushi Enomoto <[email protected]>
* XmlUrlResolverTests.cs : Unlike MS.NET, we treats Unix absolute file
	  URI file:///usr/local/src as correct file path. MS.NET is not aware
	  of such format and parses as "host = usr, path = /local/src".

svn path=/trunk/mcs/; revision=29489
2004-06-14 10:27:43 +00:00
Raja R Harinath 7338308ac1 (all-profiles, clean-profiles): Simplify slightly.
svn path=/trunk/mcs/; revision=29488
2004-06-14 10:21:47 +00:00
Atsushi Eno acb6944ecf 2004-06-14 Atsushi Enomoto <[email protected]>
* FloatingPointFormatter.cs : Recognize '%' and '\u2030' and replace
	  them with matching NumberFormatInfo properties.

svn path=/trunk/mcs/; revision=29487
2004-06-14 10:08:10 +00:00
Atsushi Eno 39782ca42a 2004-06-14 Atsushi Enomoto <[email protected]>
* FloatingPointFormatterTest.cs : Added more permille and percent
	  formatting test.

svn path=/trunk/mcs/; revision=29486
2004-06-14 10:04:48 +00:00
Roopa Wilson d06b28adf0 Removed a space in Test.Sources
svn path=/trunk/mcs/; revision=29485
2004-06-14 09:40:02 +00:00
Atsushi Eno 7e642db6b3 2004-06-14 Atsushi Enomoto <[email protected]>
* FloatingPointFormatterTest.cs : Added Permille formatting test.

svn path=/trunk/mcs/; revision=29484
2004-06-14 08:55:12 +00:00
Atsushi Eno 620e3d84e2 2004-06-14 Atsushi Enomoto <[email protected]>
* Double.cs : Use IFormatProvider.GetFormat() instead of literal '-'.
	* FloatingPointFormatter.cs :
	  Use NumberFormatInfo.NegativeSign. This change saves many XSLT test
	  failures.
	  Format Permille pattern (It is undocumented but actually available,
	  and used in xsl:format-number).

svn path=/trunk/mcs/; revision=29483
2004-06-14 08:54:31 +00:00
Gert Driesen f5d2c69c7a * EmfPlusRecordType.cs: fixed mismatches in enum field values
svn path=/trunk/mcs/; revision=29482
2004-06-14 05:47:33 +00:00
Gert Driesen 6a01fd4110 * DashCap.cs: fixed mismatches in enum field values
* HatchStyle.cs: fixes mismatches in enum field values

svn path=/trunk/mcs/; revision=29481
2004-06-14 05:47:08 +00:00
Raja R Harinath 3e7047c1a5 * Console.cs (Console.Write, Console.WriteLine): Disable __arglist
version with BOOTSTRAP_WITH_OLDLIB.
* String.cs (STring.Concat): Likewise.

svn path=/trunk/mcs/; revision=29477
2004-06-14 04:21:47 +00:00
Atsushi Eno 15742d9ac5 2004-06-14 Atsushi Enomoto <[email protected]>
* CP51932.cs : eliminate Console.WriteLine().

svn path=/trunk/mcs/; revision=29476
2004-06-14 04:14:19 +00:00
Raja R Harinath 9d239e015c (uninstall-local): Fix typo.
svn path=/trunk/mcs/; revision=29474
2004-06-14 03:51:20 +00:00
Gonzalo Paniagua Javier 23fa50da3b 2004-06-14 Gonzalo Paniagua Javier <[email protected]>
* Control.cs: Modified file.

svn path=/trunk/mcs/; revision=29472
2004-06-14 03:36:28 +00:00
Atsushi Eno 75e131ed39 2004-06-14 Atsushi Enomoto <[email protected]>
* HtmlEmitter.cs : Correct URL escape implementation.

svn path=/trunk/mcs/; revision=29470
2004-06-14 03:08:53 +00:00
Atsushi Eno fd1f7cc1c4 2004-06-14 Atsushi Enomoto <[email protected]>
* XmlInputStream.cs : Fixed encoding detection detected in xslt
	  standalone tests. Removed extraneous code.

svn path=/trunk/mcs/; revision=29467
2004-06-14 01:58:22 +00:00
Atsushi Eno 489f4b4823 2004-06-13 Atsushi Enomoto <[email protected]>
* FloatingPointFormatterTest.cs : Added regression for #59890.

svn path=/trunk/mcs/; revision=29465
2004-06-14 01:03:34 +00:00
Atsushi Eno ac4c0085ff 2004-06-13 Atsushi Enomoto <[email protected]>
* FloatingPointFormatter.cs :
	  - Don't format more than 15 fraction digits. Don't report to Pedro
	    directly (removing the error message with his concent).
	  - When format string starts with '.', it means integral part format
	    is not specified. Ignore '.' characters after the first
	    appearance. Fixed bug #59890.
	  - 0.0 is formatted only before the third ';' appearance.

svn path=/trunk/mcs/; revision=29464
2004-06-14 01:02:55 +00:00
Paolo Molaro 294c452fe3 Mon Jun 14 00:27:15 CEST 2004 Paolo Molaro <[email protected]>
* reflection.c: make binaries run on .Net 1.1 by default.

svn path=/trunk/mono/; revision=29462
2004-06-13 21:39:12 +00:00
Gert Driesen 6a39faee00 * IndentedTextWriterTest.cs: added test for IndentedTextWriter
svn path=/trunk/mcs/; revision=29460
2004-06-13 19:04:46 +00:00
Gert Driesen b7a26d1c96 *** empty log message ***
svn path=/trunk/mcs/; revision=29459
2004-06-13 19:04:27 +00:00
Gert Driesen f90dd050d3 * System_test.dll.sources: Added IndentedTextWriterTest to unit
tests

svn path=/trunk/mcs/; revision=29458
2004-06-13 19:02:23 +00:00
Gert Driesen 24b7baffa1 * IndentedTextWriter.cs: have DefaultTabString correspond with
MS.NET (meaning four spaces)

svn path=/trunk/mcs/; revision=29457
2004-06-13 19:00:26 +00:00
Gert Driesen 1f1de514c6 * IsolatedStorage.cs: really mark the storage_scope field private
svn path=/trunk/mcs/; revision=29454
2004-06-13 17:51:09 +00:00
Paolo Molaro 31ba67be62 Sun Jun 13 18:22:40 CEST 2004 Paolo Molaro <[email protected]>
* threadpool.c, threadpool.h: use the correct return type in SetMinThreads ().

svn path=/trunk/mono/; revision=29452
2004-06-13 15:34:56 +00:00
Paolo Molaro 7d170c6f6f Sun Jun 13 17:25:28 CEST 2004 Paolo Molaro <[email protected]>
* aot.c: patch from Patrick Beard ([email protected]) to
	generate valid assembly for the Mach-O assembler.

svn path=/trunk/mono/; revision=29449
2004-06-13 14:41:37 +00:00
Paolo Molaro 988dd3995e Sun Jun 13 16:44:39 CEST 2004 Paolo Molaro <[email protected]>
* marshal.c: keep track of struct size with explicit layout
	(bug #59979).

svn path=/trunk/mono/; revision=29448
2004-06-13 13:57:31 +00:00
Paolo Molaro 53a9117369 Sun Jun 13 15:59:38 CEST 2004 Paolo Molaro <[email protected]>
* driver.c: don't include abcrem in the all optimization specifier
	since it slows down jit compilation too much for now.

svn path=/trunk/mono/; revision=29447
2004-06-13 13:11:04 +00:00
Anirban Bhattacharjee 848239edf4 2004-06-13 Anirban Bhattacharjee <[email protected]>
* mb-parser.jay: Small correction in delegate declaration grammar

svn path=/trunk/mcs/; revision=29444
2004-06-13 07:19:00 +00:00
Anirban Bhattacharjee 11d018d7d3 2004-06-13 Anirban Bhattacharjee <[email protected]>
* mb-parser.jay: modified RemoveHandler function
        * statement.cs: Added RemoveHandler statement class

svn path=/trunk/mcs/; revision=29441
2004-06-13 06:27:14 +00:00
Anirban Bhattacharjee 07f491e2df 2004-06-13 Anirban Bhattacharjee <[email protected]>
* mb-parser.jay: Modified grammar for several syntax of AddressOf operator

svn path=/trunk/mcs/; revision=29439
2004-06-13 05:47:15 +00:00
Martin Baulig 627e504e3a New test.
svn path=/trunk/mcs/; revision=29436
2004-06-13 02:21:43 +00:00
Martin Baulig bbc0c79f0e 2004-06-13 Martin Baulig <[email protected]>
* cs-parser.jay: Don't allow generic attributes.

svn path=/trunk/mcs/; revision=29435
2004-06-13 02:20:09 +00:00
Martin Baulig bfa8742116 This was only for debugging.
svn path=/trunk/mcs/; revision=29434
2004-06-13 02:17:36 +00:00
Martin Baulig 57e772164d 2004-06-13 Martin Baulig <[email protected]>
* gen-57.cs: New test.

svn path=/trunk/mcs/; revision=29432
2004-06-13 02:15:14 +00:00
Martin Baulig 8202a9b73b 2004-06-13 Martin Baulig <[email protected]>
* class.cs (MemberBase.DoDefineBase): New protected method.
	(MemberBase.DoDefine): Compute the `flags' in the new
	DoDefineBase() which must be called first.
	(Method.Define): Call DoDefineBase() first so we have the flags
	when defining the generic method.

	* cs-parser.jay (interface_method_declaration): Support generic methods.

svn path=/trunk/mcs/; revision=29431
2004-06-13 02:13:32 +00:00
Martin Baulig 12a77d21f0 2004-06-13 Martin Baulig <[email protected]>
* decl.cs (TypeName): Removed.
	(MemberName): Removed TypeName and MemberNow; now we just have
	MemberName.

	* cs-parser.jay: Don't distinguish between type arguments and type
	parameters in the grammar and simplified the rules a bit.  The
	reduce/reduce conflicts are now gone (except the one we inherited
	from mcs).

svn path=/trunk/mcs/; revision=29430
2004-06-13 00:42:14 +00:00
Martin Baulig 6439d29011 Ooops.
svn path=/trunk/mcs/; revision=29429
2004-06-13 00:07:49 +00:00
Martin Baulig aa4eb85cfc Moved the marker.
svn path=/trunk/mcs/; revision=29428
2004-06-13 00:05:55 +00:00
Martin Baulig 61d82ce906 **** Merged from MCS ****
svn path=/trunk/mcs/; revision=29427
2004-06-13 00:04:49 +00:00
Atsushi Eno 76e95d00c5 2004-06-13 Atsushi Enomoto <[email protected]>
* XmlTextReader.cs : Character range check is always done. It is only
	  character references for which check is not done when Normalization
	  is false.
	  A bit more kind error message for multiple document element error.
	* XmlTextWriter.cs : Check if character is valid and entitize when
	  it was invalid.

svn path=/trunk/mcs/; revision=29426
2004-06-12 21:55:10 +00:00
Pedro Martínez Juliá 092ed65642 2004-06-12 Pedro Mart�nez Juli� <[email protected]>
* FormsAuthentication.cs: Undo last change.

svn path=/trunk/mcs/; revision=29423
2004-06-12 19:49:16 +00:00
Pedro Martínez Juliá da96842784 2004-06-12 Pedro Mart�nez Juli� <[email protected]>
* FormsAuthentication.cs: go to loginUrl from web.config settings               before try with the default ones.

-- MISTAKE --

svn path=/trunk/mcs/; revision=29422
2004-06-12 19:43:52 +00:00
Pedro Martínez Juliá ec20c001c4 2004-06-12 Pedro Mart�nez Juli� <[email protected]>
* FormsAuthentication.cs: go to loginUrl from web.config settings               before try with the default ones.

svn path=/trunk/mcs/; revision=29421
2004-06-12 19:41:52 +00:00
Martin Baulig 25c9e39e05 2004-06-12 Martin Baulig <[email protected]>
* mono-debug-debugger.c: Comment out a debugging g_message().

svn path=/trunk/mono/; revision=29413
2004-06-12 17:57:09 +00:00
Ben Maurer 97f47f852b 2004-06-12 Ben Maurer <[email protected]>
* 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.

svn path=/trunk/mono/; revision=29410
2004-06-12 15:39:27 +00:00
Paolo Molaro 6869fc3d87 Sat Jun 12 14:15:02 CEST 2004 Paolo Molaro <[email protected]>
* reflection.c, reflection.h: do not free custom attrs that are cached.
	* icall.c: use braces to make code clearer.

svn path=/trunk/mono/; revision=29406
2004-06-12 11:32:35 +00:00
Raja R Harinath ca519aa189 (populate-runtime-subdir): Add _tmpinst directory
to the PATH.

svn path=/trunk/mono/; revision=29404
2004-06-12 09:18:33 +00:00
Gonzalo Paniagua Javier d47da25b78 virtuoso
svn path=/trunk/mono/; revision=29403
2004-06-12 04:15:55 +00:00
Gonzalo Paniagua Javier 46e84593d7 LN_S should be just cp on windows
svn path=/trunk/mono/; revision=29401
2004-06-12 03:16:37 +00:00
Gonzalo Paniagua Javier e980625073 Don't copy Mono.CSharp.Debugger on windows as it's not built
svn path=/trunk/mono/; revision=29400
2004-06-12 03:16:02 +00:00
Gonzalo Paniagua Javier aea4b0b92d 2004-06-12 Gonzalo Paniagua Javier <[email protected]>
* TypeDescriptor.cs: when a component in componentTable is Disposed,
	remove it from the table.

svn path=/trunk/mcs/; revision=29395
2004-06-12 01:20:25 +00:00
Jackson Harper 1bf318303c fix
svn path=/trunk/mono/; revision=29379
2004-06-11 19:24:55 +00:00
Miguel de Icaza 8e6b2dcf63 Version
svn path=/trunk/mono/; revision=29378
2004-06-11 19:22:58 +00:00
Miguel de Icaza e5d116cdfc Version
svn path=/trunk/mcs/; revision=29378
2004-06-11 19:22:58 +00:00
Jackson Harper d6c7ea39cc * runtime/net_2_0/Makefile.am:
* runtime/net_1_1/Makefile.am: Remove signing patches

svn path=/trunk/mono/; revision=29377
2004-06-11 19:18:55 +00:00
Jackson Harper 7db0bfe9b3 Do not sign ziplib, npgsql, or nunit assemblies. Sign mscorlib.
svn path=/trunk/mono/; revision=29374
2004-06-11 19:04:22 +00:00
Martin Baulig 18fea92869 2004-06-11 Martin Baulig <[email protected]>
* gen-56.cs: New test from #58307.

svn path=/trunk/mcs/; revision=29373
2004-06-11 18:51:23 +00:00
Martin Baulig cc1e0a2dde This is a bit of a hack, but works for the moment.
svn path=/trunk/mcs/; revision=29372
2004-06-11 18:48:47 +00:00
Martin Baulig 2fb4189935 2004-06-11 Martin Baulig <[email protected]>
* FieldInfo.cs (Mono_GetGenericFieldDefinition): New method for NET_2_0.

svn path=/trunk/mcs/; revision=29371
2004-06-11 18:47:56 +00:00
Martin Baulig deb18e8253 2004-06-11 Martin Baulig <[email protected]>
* class.h (MonoInflatedField): New type.
	(MonoClassField): Replaced `MonoType *generic_type' with
	`MonoInflatedField *generic_info'.

	* icall.c
	(ves_icall_MonoField_Mono_GetGenericFieldDefinition): New icall.

svn path=/trunk/mono/; revision=29370
2004-06-11 18:46:39 +00:00
Miguel de Icaza d6d643c4fb Remove FIXMEs: they are flagged as TODOs
svn path=/trunk/mcs/; revision=29369
2004-06-11 18:40:10 +00:00
Martin Baulig 3598f4b21b 2004-06-11 Martin Baulig <[email protected]>
* Console.cs (Write, WriteLine): Implemented the varargs versions.

svn path=/trunk/mcs/; revision=29366
2004-06-11 18:00:09 +00:00
Martin Baulig 8dc7f554a9 2004-06-11 Martin Baulig <[email protected]>
* get.c (get_methodref_signature): Include "vararg " in the
	signature of a varargs method.

svn path=/trunk/mono/; revision=29365
2004-06-11 17:59:08 +00:00
Martin Baulig 95b9d403e9 2004-06-11 Martin Baulig <[email protected]>
* reflection.c (mono_image_create_method_token): Correctly encode
	varargs methods.

svn path=/trunk/mono/; revision=29364
2004-06-11 17:58:21 +00:00
Neale Ferguson 9114a0a8eb Further ABI tweeking
svn path=/trunk/mono/; revision=29358
2004-06-11 17:30:30 +00:00
Martin Baulig 0f688c0ac4 2004-06-11 Martin Baulig <[email protected]>
* test-269.cs: Another varargs test.

svn path=/trunk/mcs/; revision=29356
2004-06-11 17:17:31 +00:00
Martin Baulig b249b9955d 2004-06-11 Martin Baulig <[email protected]>
* expression.cs (Invocation.IsParamsMethodApplicable): We need to
	call this twice: for params and varargs methods.

svn path=/trunk/mcs/; revision=29355
2004-06-11 17:15:04 +00:00
Atsushi Eno 05a7152f1a 2004-06-11 Atsushi Enomoto <[email protected]>
* UriTest.cs : Added UnixLocalPath().

svn path=/trunk/mcs/; revision=29353
2004-06-11 16:18:09 +00:00
Atsushi Eno f51909e709 2004-06-11 Atsushi Enomoto <[email protected]>
* Uri.cs :
	  - We don't have to mind '\\'.
	  - Fixed bug #58301. When path starts with "///" and not more than
	    "////" and not "///*:", handle it as unix path and set Host as
	    empty string. In absolute path case, port should not be parsed
	    and LocalPath should start with '/'.
	  - Handle fragment in prior to path.

svn path=/trunk/mcs/; revision=29352
2004-06-11 16:16:55 +00:00
Duncan Mak 6235c7ab97 * IBM.Data.DB2/IBM.Data.DB2.dll.sources:
* Makefile: Add IBM.Data.DB2.

svn path=/trunk/mcs/; revision=29351
2004-06-11 16:08:32 +00:00
Duncan Mak 70cfd6ac44 Add IBM.Data.DB2 to the build
svn path=/trunk/mono/; revision=29350
2004-06-11 16:06:46 +00:00
Jackson Harper 3162253a33 * runtime/net_2_0/Makefile.am:
* runtime/net_1_1/Makefile.am: Sign assemblies before
        installing

svn path=/trunk/mono/; revision=29348
2004-06-11 15:39:44 +00:00
Jackson Harper 1b0c6bf269 * man/mono.1: Add documentation for MONO_GAC_PREFIX.
svn path=/trunk/mono/; revision=29347
2004-06-11 15:12:48 +00:00
Sebastien Pouliot 244a160d6a 2004-06-11 Sebastien Pouliot <[email protected]>
* TimeSpan.cs: Now throw an OverflowException when the timespan is
	over MaxValue or under MinValue.

svn path=/trunk/mcs/; revision=29346
2004-06-11 14:28:55 +00:00
Sebastien Pouliot 886b784e3f 2004-06-11 Sebastien Pouliot <[email protected]>
* TimeSpanTest.cs: Added valid cases to parse MinValue and MaxValue.
	Added invalid cases to parse under MinValue and over MaxValue.

svn path=/trunk/mcs/; revision=29345
2004-06-11 14:22:15 +00:00
Marek Safar f7a0110591 2004-06-11 Marek Safar <[email protected]>
* class.cs:
	(FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.

svn path=/trunk/mcs/; revision=29344
2004-06-11 13:43:46 +00:00
Atsushi Eno 390b27fde2 2004-06-11 Atsushi Enomoto <[email protected]>
* library.make : HAVE_CS_TESTS fixie.

svn path=/trunk/mcs/; revision=29343
2004-06-11 13:21:05 +00:00
Gert Driesen 13cf3092ff * Makefile: also delete System.Design.xml and System.Drawing.Design
assembly in clean target

svn path=/trunk/mono/; revision=29342
2004-06-11 13:08:35 +00:00
Sebastien Pouliot a4b1fa5023 2004-06-11 Sebastien Pouliot <[email protected]>
* DateTime.cs: Added a AddRoundedMilliseconds which use the "old Mono"
	rounding logic which worked for FromOADate (while the newer didn't).

svn path=/trunk/mcs/; revision=29341
2004-06-11 12:43:42 +00:00
Gert Driesen abaf40f801 * mono-api-info.cs: ignore non-public attributes
svn path=/trunk/mcs/; revision=29340
2004-06-11 12:37:23 +00:00
Raja R Harinath 8e8979eb80 (TEST_COMPILE): Use internal mcs to compile the
platform testsuite too.

svn path=/trunk/mcs/; revision=29339
2004-06-11 12:32:32 +00:00
Raja R Harinath 6310986244 * library.make (HAVE_CS_TESTS, HAVE_VB_TESTS): Allow to be
overriden.  Useful if the tests sourcefile is generated.
(TEST_COMPILE, BTEST_COMPILE): Allow these to be customized too.

Support enough features to build mscorlib.dll.
* library.make (core_sourcefile): New renamed from $(sourcefile).
(PLATFORM_excludes): Auto-detecting define that sees if
$(LIBRARY).$(PLATFORM)-excludes file exists.
(sourcefile): New.  Possibly-built file that removes
PLATFORM_excluded files from core_sourcefile.
(test_against, test_dep): New.  Allow the test assembly to be
built against a different library.
(test_lib): Allow makefile to override the name of the test
assembly.
(LIBRARY_INSTALL_DIR): If defined, switch to using $(INSTALL_LIB)
rather than $(gacutil).
(DISTFILES, dist-local): Use core_sourcefile.
(clean-local): Remove sourcefile if it was generated.
(test_lib, btest_lib): Depend on $(test_dep).

svn path=/trunk/mcs/; revision=29338
2004-06-11 12:31:24 +00:00
Gert Driesen 752cbd0583 * corlib_test.dll.sources: added EnumBuilderTest and
FieldBuilderTest to the build

svn path=/trunk/mcs/; revision=29337
2004-06-11 12:30:35 +00:00
Raja R Harinath 31f8ea53dc Remove contents. Any file listed
here has also to be listed in corlib_test.dll.sources.

svn path=/trunk/mcs/; revision=29336
2004-06-11 12:21:13 +00:00
Raja R Harinath 30922fd175 Now 'make bootstrap && make install' should install signed assemblies.
(populate-runtime-subdir): New target.  Does a
controlled "make install" in the 'mcs/' directory to populate the
'runtime' directory.
(fasterstrap): Use it.

svn path=/trunk/mono/; revision=29335
2004-06-11 12:03:28 +00:00
Raja R Harinath b1d4529fd2 Override HAVE_CS_TESTS.
svn path=/trunk/mcs/; revision=29334
2004-06-11 11:57:35 +00:00
Raja R Harinath 0e4de6d47b * library.make (HAVE_CS_TESTS, HAVE_VB_TESTS): Allow to be
overriden.  Useful if the tests sourcefile is generated.

svn path=/trunk/mcs/; revision=29333
2004-06-11 11:56:26 +00:00
Marek Safar 9aa2412813 2004-06-11 Marek Safar <[email protected]>
* 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

svn path=/trunk/mcs/; revision=29332
2004-06-11 11:53:46 +00:00
Gert Driesen 9a2b04af95 * BaseEvent.cs: added missing attribute, removed extra finalizer
* DefaultManagementProjectInstaller.cs: removed extra finalizer
* IgnoreMemberAttribute.cs: removed extra finalizer and GetHashCode
* Instance.cs: removed extra finalizer, added missing attribute
* Instrumentation.cs: removed extra finalizer
* InstumentationClassAttribute.cs: removed extra finalizer, added
missing ctors
* InstrumentationType.cs: fixed enum field values
* InstrumentedAttribute.cs: removed extra finalizer and GetHashCode,
added missing ctors
* ManagedNameAttribute.cs: removed extra finalizer, removed default
ctor, added ctor, added Name property
* ManagementInstaller.cs: removed extra finalizer

svn path=/trunk/mcs/; revision=29329
2004-06-11 11:46:40 +00:00
Raja R Harinath e6a666684e (PLATFORM_TWEAK_CORLIB_SOURCES): Remove.
svn path=/trunk/mcs/; revision=29327
2004-06-11 11:26:43 +00:00
Ravindra 624b36fe83 * run-samples.sh: Added a script to run the samples.
Thanks to Harinath and Sachin for the help.

svn path=/trunk/mcs/; revision=29326
2004-06-11 11:25:31 +00:00
Gert Driesen 52e284c5cf * SoapProtocolImporter.cs: Added stub for missing IsSoapEncodingPresent
method
* MimeContentBinding.cs: removed extra Default attribute from Part

svn path=/trunk/mcs/; revision=29325
2004-06-11 11:21:57 +00:00
Raja R Harinath 21ee4d123f Rewrite to use library.make. Do away with stampfiles.
svn path=/trunk/mcs/; revision=29324
2004-06-11 11:19:18 +00:00
Raja R Harinath 79838acd64 Support enough features to build mscorlib.dll.
* library.make (core_sourcefile): New renamed from $(sourcefile).
(PLATFORM_excludes): Auto-detecting define that sees if
$(LIBRARY).$(PLATFORM)-excludes file exists.
(sourcefile): New.  Possibly-built file that removes
PLATFORM_excluded files from core_sourcefile.
(test_against, test_dep): New.  Allow the test assembly to be
built against a different library.
(test_lib): Allow makefile to override the name of the test
assembly.
(LIBRARY_INSTALL_DIR): If defined, switch to using $(INSTALL_LIB)
rather than $(gacutil).
(DISTFILES, dist-local): Use core_sourcefile.
(clean-local): Remove sourcefile if it was generated.
(test_lib, btest_lib): Depend on $(test_dep).

svn path=/trunk/mcs/; revision=29323
2004-06-11 11:08:56 +00:00
Gert Driesen 7ba625ad00 * IClrObjectFactory.cs: added missing DispId attributes
* IComManagedImportUtil.cs: added missing DispId attributes
* IComSoapIISVRoot.cs: added missing DispId attributes
* IComSoapMetadata.cs: added missing DispId attributes
* IComSoapPublisher.cs: added missing DispId attributes
* IServerWebConfig.cs: added missing DispId attributes
* ISoapClientImport.cs: added missing DispId attributes
* ISoapServerTlb.cs: added missing DispId attributes
* ISoapServerVRoot.cs: added missing DispId attributes
* ISoapUtility.cs: added missing DispId attributes

svn path=/trunk/mcs/; revision=29322
2004-06-11 11:04:40 +00:00
Gert Driesen b981ec7ba1 * ApplicationCrmEnabledAttribute: added missing
svn path=/trunk/mcs/; revision=29321
2004-06-11 11:00:35 +00:00
Gert Driesen da98982d5a * RegistrationHelperTx.cs: added missing attribute on class
* TransactionOption.cs: corrected values of enum fields

svn path=/trunk/mcs/; revision=29320
2004-06-11 10:59:17 +00:00
Paolo Molaro db110f03e5 Playing "fix the build after gert's changes" game.
svn path=/trunk/mcs/; revision=29319
2004-06-11 10:56:02 +00:00
Martin Baulig a856ad10f1 Merged it again :-)
svn path=/trunk/mcs/; revision=29318
2004-06-11 10:53:23 +00:00
Martin Baulig e4f17cb1a8 **** Merged from MCS ****
svn path=/trunk/mcs/; revision=29317
2004-06-11 10:52:31 +00:00
Martin Baulig 70aa3b5140 Moved the marker.
svn path=/trunk/mcs/; revision=29316
2004-06-11 10:41:20 +00:00
Atsushi Eno 39c55d8fa9 2004-06-11 Atsushi Enomoto <[email protected]>
* UriTest.cs : Added InvalidScheme().
	* test-uri-list.txt, test-uri-props.txt :
	  Commented out RFC2396-violent URIs.

svn path=/trunk/mcs/; revision=29315
2004-06-11 10:38:44 +00:00
Atsushi Eno 6c7138f765 2004-06-11 Atsushi Enomoto <[email protected]>
* Uri.cs : Handle Windows UNC. Now we could simplify Parse(). Don't
	  escape windows path twice. Check scheme name as defined in RFC2396.

svn path=/trunk/mcs/; revision=29314
2004-06-11 10:37:11 +00:00
Martin Baulig 15b8709b4b **** Merged from MCS ****
svn path=/trunk/mcs/; revision=29313
2004-06-11 10:37:01 +00:00
Martin Baulig b918e9d187 Ooops, varargs methods are not CLS compliant.
svn path=/trunk/mcs/; revision=29312
2004-06-11 10:36:14 +00:00
Raja R Harinath ab7edb2f50 * Makefile (TEST_SOURCES): Add test-268.
* test-268.cs: New test for #59477.

svn path=/trunk/mcs/; revision=29311
2004-06-11 10:30:40 +00:00
Raja R Harinath 159a311768 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.

svn path=/trunk/mcs/; revision=29310
2004-06-11 10:30:04 +00:00
Gert Driesen efa16e80cc * ComponentEditorForm.cs: CRLF to LF
* ControlDesigner.cs: API signature fix
* DocumentDesigner.cs: API signature fixes, CRLF to LF

svn path=/trunk/mcs/; revision=29309
2004-06-11 10:28:40 +00:00
Gert Driesen 61b38c411e * System.Design.dll.sources: added more stub for classes
in System.Windows.Forms.Design

svn path=/trunk/mcs/; revision=29308
2004-06-11 10:13:52 +00:00
Gert Driesen d80645f689 * AxParameterData.cs: stubbed
* AxWrapperGen.cs: stubbed
* DockEditor.cs: stubbed
* EventHandlerService.cs: stubbed

svn path=/trunk/mcs/; revision=29307
2004-06-11 10:12:38 +00:00
Gert Driesen bc9d9fc161 * ChangeLog: added, and move entries from changelog in System.Design here
* AxParameterData.cs: stubbed
* AxWrapperGen.cs: stubbed
* DockEditor.cs: stubbed
* EventHandlerService.cs: stubbed

svn path=/trunk/mcs/; revision=29306
2004-06-11 10:06:15 +00:00
Marek Safar c474761474 2004-06-11 Marek Safar <[email protected]>
* class.cs:
	(MethodCore.VerifyClsCompliance): Added test for error CS3000.

svn path=/trunk/mcs/; revision=29305
2004-06-11 09:50:00 +00:00
Gert Driesen 5f3c3b8bec * System.Design.dll.sources: added more stubs for classes
in System.Diagnostics.Design, System.Messaging.Design and
System.ServiceProcess.Design

svn path=/trunk/mcs/; revision=29304
2004-06-11 09:43:03 +00:00
Raja R Harinath 8ac07d29d4 (PROGRAM_INSTALL_DIR): New define.
(install-local, uninstall-local): Use it.

svn path=/trunk/mcs/; revision=29303
2004-06-11 09:40:46 +00:00
Gert Driesen 018c0572c9 * ServiceControllerDesigner.cs: stubbed
svn path=/trunk/mcs/; revision=29302
2004-06-11 09:39:12 +00:00
Gert Driesen 03bc97368a * MessageDesigner.cs: stubbed
svn path=/trunk/mcs/; revision=29301
2004-06-11 09:38:45 +00:00
Gert Driesen a397fc051f * LogConverter.cs: stubbed
* ProcessDesigner.cs: stubbed
* ProcessModuleDesigner.cs: stubbed
* ProcessThreadDesigner.cs: stubbed

svn path=/trunk/mcs/; revision=29299
2004-06-11 09:38:14 +00:00
Atsushi Eno 9e8dc5d494 2004-06-11 Atsushi Enomoto <[email protected]>
* Uri.cs : Reverted some changes. '#' should be handled when the input
	  string is NOT raw file path. So handle raw file paths differently.
	  (right now except for Windows UNC).
	  Cache LocalPath and don't compute every time.

svn path=/trunk/mcs/; revision=29297
2004-06-11 09:31:41 +00:00
Atsushi Eno b80ef28d8b 2004-06-11 Atsushi Enomoto <[email protected]>
* test-uri-list.txt,
	  test-uri-props.txt,
	  test-uri-props-manual.txt :
	  Reverted the last change. File URI handling should be common to
	  MS.NET. We have to change the behavior only for Unix file path.
	* UriTest2.cs : Fixed just catch only UriFormatException.

svn path=/trunk/mcs/; revision=29296
2004-06-11 09:31:14 +00:00
Anirban Bhattacharjee bcafb9fb7d 2004-06-11 Anirban Bhattacharjee <[email protected]>
* Makefile: Removed inclusion of rules.make from Makefile for two reasons :
                - This Makefile as of now has no dependency on rules.make what so ever
                - Because of inclusion of INTENAL_MBAS in rules.make it was causing confliction with existing INTERNAL_MBAS in this makefile and causing lots of tests to fail

svn path=/trunk/mcs/; revision=29295
2004-06-11 09:22:59 +00:00
Martin Baulig 4d7c7a1f87 2004-06-11 Martin Baulig <[email protected]>
* String.cs (Concat): Implemented the varargs version.

svn path=/trunk/mcs/; revision=29294
2004-06-11 09:21:55 +00:00
Gert Driesen 40766886ac * Makefile: added reference to System.Data assembly
* System.Design.dll.sources: added new stubbed classes

svn path=/trunk/mcs/; revision=29293
2004-06-11 09:16:27 +00:00
Gert Driesen d2a7bcb568 * CalendarDataBindingHandler.cs: stubbed
* ColorBuilder.cs: stubbed
* ControlParser.cs: stubbed
* ControlPersister.cs: stubbed
* DataBindingCollectionConverter.cs: stubbed
* DataBindingCollectionEditor.cs: stubbed
* DataBindingValueUIHandler.cs: stubbed
* DataFieldConverter.cs: stubbed
* DataMemberConverter.cs: stubbed
* DataSourceConverter.cs: stubbed
* DesignTimeData.cs: stubbed
* HtmlIntrinsicControlDesigner.cs: stubbed
* HyperLinkDataBindingHandler.cs: stubbed
* IControlDesignerBehaviour.cs: stubbed
* IDataSourceProvider.cs: stubbed
* ITemplateEditingFrame.cs: stubbed
* ITemplateEditingService.cs: stubbed
* IWebFormReferenceManager.cs: stubbed
* IWebFormsBuilderUIService.cs: stubbed
* IWebFormsDocumentService.cs: stubbed
* TemplateEditingService.cs: stubbed
* TemplateEditingVerb.cs: stubbed
* TemplatedControlDesigner.cs: stubbed
* TextControlDesigner.cs: stubbed
* TextDataBindingHandler.cs: stubbed
* UrlBuilder.cs: stubbed
* UserControlDesigner.cs: stubbed
* XmlFileEditor.cs: stubbed

svn path=/trunk/mcs/; revision=29292
2004-06-11 09:16:01 +00:00
Paolo Molaro 1934e90228 Fri Jun 11 11:58:22 CEST 2004 Paolo Molaro <[email protected]>
* LocalizableAttribute.cs, DesignerSerializationVisibilityAttribute.cs,
	DesignOnlyAttribute.cs: fix targets for attributes.

svn path=/trunk/mcs/; revision=29291
2004-06-11 09:09:50 +00:00
Marek Safar 993516622e new test
svn path=/trunk/mcs/; revision=29289
2004-06-11 09:07:00 +00:00
Marek Safar 495f81748f 2004-06-11 Marek Safar <[email protected]>
* attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.

svn path=/trunk/mcs/; revision=29288
2004-06-11 09:04:54 +00:00
Martin Baulig 2c9063cff5 2004-06-11 Martin Baulig <[email protected]>
* metadata.c (mono_metadata_parse_method_signature): When parsing
	a MethodDef which has VarArgs, also set sentinelpos if we don't
	have any parameters.

svn path=/trunk/mono/; revision=29287
2004-06-11 08:52:35 +00:00
Gonzalo Paniagua Javier d03b6c7fd4 details, details
svn path=/trunk/mcs/; revision=29286
2004-06-11 08:47:09 +00:00
Martin Baulig a0215f4f60 2004-06-11 Martin Baulig <[email protected]>
* vararg-lib.cs, vararg-exe.cs: New tests.

svn path=/trunk/mcs/; revision=29285
2004-06-11 08:45:14 +00:00
Gonzalo Paniagua Javier d35467e43d 2004-06-11 Gonzalo Paniagua Javier <[email protected]>
* SessionSQLServerHandler.cs:
	* SessionStateServerHandler.cs:
	* ISessionHandler.cs: added new parameter to Init.

	* SessionInProcHandler.cs: use the HttpRuntime cache to store the
	sessions and handle expiration.

	* SessionStateModule.cs: added OnSessionRemoved internal method that is
	called whenever a session expires or is removed.

svn path=/trunk/mcs/; revision=29284
2004-06-11 08:41:50 +00:00
Martin Baulig 208eb653b1 2004-06-11 Martin Baulig <[email protected]>
* Makefile: Enable test-269.

svn path=/trunk/mcs/; revision=29283
2004-06-11 08:40:45 +00:00
Martin Baulig 7595fda6ae 2004-06-08 Martin Baulig <[email protected]>
* Makefile: Enable test-157.

svn path=/trunk/mcs/; revision=29282
2004-06-11 08:39:41 +00:00
Martin Baulig e1f6f29755 2004-06-11 Martin Baulig <[email protected]>
* 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.

svn path=/trunk/mono/; revision=29281
2004-06-11 08:38:42 +00:00
Gonzalo Paniagua Javier 68d1cee6af 2004-06-11 Gonzalo Paniagua Javier <[email protected]>
* AspGenerator.cs:
	* CachingCompiler.cs: use a different prefix when caching compiler
	results or Types.

svn path=/trunk/mcs/; revision=29280
2004-06-11 08:38:21 +00:00
Martin Baulig 0cf6d96c72 2004-06-11 Martin Baulig <[email protected]>
* get.c (get_methodref_signature): If we're a varargs method,
	print "..." for the sentinel followed by the actual types.

svn path=/trunk/mono/; revision=29279
2004-06-11 08:27:49 +00:00
Lluis Sanchez c640eb0920 * StrongNameKeyPair.cs: Catch exception when getting PublicKey to match
MS implementation. Generate the RSA in the constructors.

svn path=/trunk/mcs/; revision=29278
2004-06-11 08:14:54 +00:00
Martin Baulig 54dfc849f1 2004-06-11 Martin Baulig <[email protected]>
* expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
	varargs methods if applicable.

svn path=/trunk/mcs/; revision=29277
2004-06-11 07:59:33 +00:00
Martin Baulig f2aea00df4 2004-06-11 Martin Baulig <[email protected]>
* expression.cs (Invocation.EmitCall): Don't use
	`method.CallingConvention == CallingConventions.VarArgs' since the
	method could also have `CallingConventions.HasThis'.

svn path=/trunk/mcs/; revision=29276
2004-06-11 07:31:11 +00:00
Gert Driesen d006bfbd91 * ArrayEditor.cs: removed extra finalizer
* BinaryEditor.cs: stubbed
* ByteViewer.cs: removed extra finalizer, added missing method
* CollectionEditor.cs: removed extra finalizer
* DateTimeEditor.cs: stubbed
* InheritanceService.cs: removedd extra finalizer
* LocalizationExtenderProvider.cs: added missing attributes,
removed extra finalizer
* ObjectSelectorEditor.cs: stubbed

svn path=/trunk/mcs/; revision=29275
2004-06-11 07:24:46 +00:00
Gert Driesen 8281cecbd7 * System.Configuration.Install.dll.sources: added
stubbed classes

svn path=/trunk/mcs/; revision=29274
2004-06-11 06:51:45 +00:00
Gert Driesen 748ae7b921 * EventLogInstaller.cs: stubbed
* PerformanceCounterInstaller.cs: stubbed

svn path=/trunk/mcs/; revision=29272
2004-06-11 06:41:27 +00:00
Gert Driesen 04de3ac14d * Consts.cs: Replaced by Consts.cs from System.Messaging
svn path=/trunk/mcs/; revision=29271
2004-06-11 06:37:41 +00:00
Gert Driesen 4f5a23f73b * Installer.cs: use Type instead of string argument for
Designer attribute

svn path=/trunk/mcs/; revision=29270
2004-06-11 06:36:21 +00:00
Marek Safar 9badc5a4f9 2004-06-11 Marek Safar <[email protected]>
* class.cs (Event.GetSignatureForError): Implemented.
	Fixed crash in error test cs3010.cs

svn path=/trunk/mcs/; revision=29268
2004-06-11 06:27:01 +00:00
Atsushi Eno 8bcfd7518d 2004-06-11 Atsushi Enomoto <[email protected]>
* IHasXmlParserContext.cs, IHasXmlSchemaInfo.cs : internal.

svn path=/trunk/mcs/; revision=29267
2004-06-11 06:06:04 +00:00
Gert Driesen b8fe1d05d6 * AssemblyInstaller.cs: stubbed
* ManagedInstallerClass.cs: stubbed
* TransactedInstaller.cs: stubbed

svn path=/trunk/mcs/; revision=29266
2004-06-11 06:05:10 +00:00
Atsushi Eno 76e5bd5184 2004-06-11 Atsushi Enomoto <[email protected]>
* XsdValidatingReader.cs : Identity check didn't work fine when
	  reference node appeared in front of the target key node.
	  This fixes bug #59889.

svn path=/trunk/mcs/; revision=29263
2004-06-11 05:24:37 +00:00
Ravindra c00342c67c * gdipFunctions.cs: (GdipCreateSolidFill): Changed one argument
from out int to out IntPtr.
        * SolidBrush.cs: Same.

svn path=/trunk/mcs/; revision=29262
2004-06-11 05:14:51 +00:00
Gert Driesen c575740e28 * SoapAttribute.cs: use protected field to store namespace value,
removed obsolete private field

svn path=/trunk/mcs/; revision=29261
2004-06-11 05:11:27 +00:00
Gert Driesen c4ac3065d5 * LingerOption.cs: marked field private to fix API signature
* MulticastOption.cs: marked field private to fix API signature

svn path=/trunk/mcs/; revision=29260
2004-06-11 05:07:35 +00:00
Gert Driesen 16f9cdccf3 * Information.cs: use Type.Name property instead of Type.get_Name()
accessor method.  This fixes the build on Windows (csc). Reported
as mcs bug #59980.

svn path=/trunk/mcs/; revision=29259
2004-06-11 05:05:17 +00:00
Gonzalo Paniagua Javier 5e98fc70af MONO_CODEDOM_NODELETE is MONO_ASPNET_NODELETE now
svn path=/trunk/mono/; revision=29257
2004-06-11 04:11:12 +00:00
Gonzalo Paniagua Javier d2d2fb9f1f 2004-06-11 Gonzalo Paniagua Javier <[email protected]>
* CSharpCodeCompiler.cs: let the TempFileCollection handle the removal
	of the files if needed.

svn path=/trunk/mcs/; revision=29256
2004-06-11 04:08:44 +00:00
Gonzalo Paniagua Javier 34fbc1363d 2004-06-11 Gonzalo Paniagua Javier <[email protected]>
* BaseCompiler.cs: dynamicBase is now protected. Check
	MONO_ASPNET_NODELETE here.

	* TemplateControlCompiler.cs: if the type is not known but has a
	TypeConverter, invoke ConvertFromString in the generated code.

	* WebServiceCompiler.cs: it used a hardcoded C# compiler, now it gets
	the compiler from the configuration. Also handle MONO_ASPNET_NODELETE.

	* CachingCompiler.cs: updated compilation of web services and simple
	web handlers.

svn path=/trunk/mcs/; revision=29255
2004-06-11 04:03:13 +00:00
Gonzalo Paniagua Javier 22bd2d91e3 2004-06-11 Gonzalo Paniagua Javier <[email protected]>
* HttpUtility.cs: check for control characters in the string to encode
	or decode and return the same string if there are none.

svn path=/trunk/mcs/; revision=29254
2004-06-11 03:56:18 +00:00
Jackson Harper 711c928898 * ILTables.cs: Remove opcodes, these are contained in codegen/IntrTable.cs
* ILTokenizer.cs: Dont refer to ILTables::Opcodes

svn path=/trunk/mcs/; revision=29253
2004-06-11 03:19:38 +00:00
Jackson Harper e2a84ba6f1 * driver.cs: We don't need to check if the canidate is a file in
IsSwitch anymore as some other commandline handling will take care
	of this case.

svn path=/trunk/mcs/; revision=29252
2004-06-11 03:09:39 +00:00
Sebastien Pouliot 2766ba5c23 2004-06-10 Sebastien Pouliot <[email protected]>
* DecimalTest.cs: Added rounding tests for negative values. Added more
	checks to ParseFractions. Removed test TooSmall because it was a bad
	interaction between a buggy corlib (buggy decimal) and the tests (i.e.
	the value was legal).

svn path=/trunk/mcs/; revision=29251
2004-06-11 02:29:25 +00:00
Sebastien Pouliot d6f8209297 2004-06-10 Sebastien Pouliot <[email protected]>
* Decimal.cs: Hacked the Parse method to allow the runtime C code to
	decode it properly (i.e. matching MS results). Fixed the Round method
	for negative decimal numbers (moved code from Math.cs).
	* Math.cs: Now use Decimal class for Round(Decimal,int). Required to
	fix a bug when rounding a negative decimal.

svn path=/trunk/mcs/; revision=29250
2004-06-11 02:22:40 +00:00
Duncan Mak 13d1764537 Add license and copyright to all source files in corlib
svn path=/trunk/mcs/; revision=29249
2004-06-11 02:09:36 +00:00
Gonzalo Paniagua Javier ae7b210e4f 2004-06-11 Gonzalo Paniagua Javier <[email protected]>
* System.Web/HttpApplication.cs: change/restore the IPrincipal in their
	own methods and make them internal.

	* System.Web.Security/DefaultAuthenticationModule.cs: set the IPrincipal
	for this thread once we have a user. Fixes bug #59683.

svn path=/trunk/mcs/; revision=29248
2004-06-11 01:24:35 +00:00
Gonzalo Paniagua Javier 50abbf1102 2004-06-11 Gonzalo Paniagua Javier <[email protected]>
* Thread.cs:
	(CurrentPrincipal): lock on CurrentThread, not typeof (Thread) and set
	the thread IPrincipal if we get it from the AppDomain.

svn path=/trunk/mcs/; revision=29247
2004-06-11 01:18:21 +00:00
Gonzalo Paniagua Javier e07f4c9ecf 2004-06-11 Gonzalo Paniagua Javier <[email protected]>
* AppDomain.cs: set the _principal to null when changing the policy.
	* Console.cs: remove ClsCompliant attribute from a method marked as
	internal and added comment.

svn path=/trunk/mcs/; revision=29246
2004-06-11 01:14:57 +00:00
Jackson Harper 0710cfa2c7 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.

svn path=/trunk/mono/; revision=29245
2004-06-10 23:47:30 +00:00
Gonzalo Paniagua Javier ef045b18a7 fix
svn path=/trunk/mcs/; revision=29244
2004-06-10 23:11:58 +00:00
Lluis Sanchez d2c82b10e3 * AssemblyName.cs: Added missing fields to serialization methods.
* StrongNameKeyPair.cs: Made it compatible with MS serialization.

svn path=/trunk/mcs/; revision=29243
2004-06-10 21:38:02 +00:00
Jackson Harper 334d870393 * assembly.c: Use <path>/lib/mono/gac for the extra paths
lookup.

svn path=/trunk/mono/; revision=29242
2004-06-10 21:33:43 +00:00
Jackson Harper fb83b286bf * ILTokenizingExpcetion.cs: New exception thrown by the tokenizer
if any tokenizing errors occur.
	* ILTokenizer.cs:
	* NumberHelper.cs: Use the new exception.

svn path=/trunk/mcs/; revision=29241
2004-06-10 21:01:19 +00:00
Jackson Harper b0e23daaaf * Driver.cs: Handle tokenization errors with the correct error
message.
	* Report.cs: Print error messages properly. Add an extra \n after
	the assemble file message.
	* ilasm.exe.sources: Add new exception, remove old one.

svn path=/trunk/mcs/; revision=29240
2004-06-10 21:00:18 +00:00
Rafael Teixeira fa240e76af 2004/06/10 Rafael Teixeira <[email protected]>
* typemanager.cs : GetPertinentStandardModules receives the array now with params modifier to help usage
	* ecore.cs : correcting lookup of semi-qualified standard modules members - A little better but not there yet

svn path=/trunk/mcs/; revision=29239
2004-06-10 20:50:52 +00:00
Miguel de Icaza 5dcb517d52 Not yet
svn path=/trunk/mono/; revision=29237
2004-06-10 20:28:39 +00:00
Jackson Harper 237cde59f6 Make the new gacutil the default again.
svn path=/trunk/mcs/; revision=29231
2004-06-10 19:48:34 +00:00
Atsushi Eno b0c427a479 2004-06-10 Atsushi Enomoto <[email protected]>
* UriTest.cs : Should not expect exception for Unix file path.

svn path=/trunk/mcs/; revision=29222
2004-06-10 19:40:17 +00:00
Erik Dasque 1df2fba7ef added new site news item
svn path=/trunk/mono/; revision=29219
2004-06-10 19:29:17 +00:00
Gert Driesen 118ced56b6 * RegexRunner.cs: fixed case mismatch of methods
svn path=/trunk/mcs/; revision=29218
2004-06-10 18:37:54 +00:00
Jackson Harper 7dd96c89dc * errors: This directory will contain assembly files that should
not compile.
	* bad_bytearray.il: A bad bytearray in a .data line. Should give a
	syntax error.

svn path=/trunk/mcs/; revision=29216
2004-06-10 18:28:43 +00:00
Miguel de Icaza 9b8a7570c6 2004-06-10 Miguel de Icaza <[email protected]>
* cs-tokenizer.cs: Change the way we track __arglist to be
	consistent with the other keywords.

svn path=/trunk/mcs/; revision=29215
2004-06-10 18:11:31 +00:00
Gert Driesen 6f3c495f7c * RegexRunner.cs: marked TODO, added missing protected internal
fields, throw NotImplementedException in all methods

svn path=/trunk/mcs/; revision=29214
2004-06-10 18:06:31 +00:00
Atsushi Eno 0c5cf2fac1 2004-06-10 Atsushi Enomoto <[email protected]>
* Uri.cs : Don't escape '#' in file URI paths. This fixes bug #47691.
	  Some code simplification.

svn path=/trunk/mcs/; revision=29213
2004-06-10 18:01:45 +00:00
Gert Driesen dfab5786dd * Publisher.cs: removed extra finalizer to fix public API
signature, renamed private field for serialization compatibility
with MS.NET

svn path=/trunk/mcs/; revision=29212
2004-06-10 17:58:04 +00:00
Atsushi Eno 53479fd53f 2004-06-10 Atsushi Enomoto <[email protected]>
* test-uri-list.txt,
	  test-uri-props.txt,
	  test-uri-props-manual.txt :
	  - Moved '#' containing file URIs to manual test patterns (I think MS
	    disregards '#', as conceptually reported in bug #47691).
	  - Removed URIs that contains "/////" that is ambiguous (is /////cygwin
	    directory '/cygwin', or host 'cygwin' ?).
	* UriTest2.cs : explicitly show what input string is being checked
	  in Assert(). And also surround try...catch and show which URI failed.

svn path=/trunk/mcs/; revision=29211
2004-06-10 17:57:36 +00:00
Gert Driesen 95afd686ee * RegexRunnerFactory.cs: removed comment, no longer throw exception
from ctor
* regex.cs: fixed public API signature by renaming protected
internal fields and adding destructor, added MonoTODO attribute to
fields and method that are not yet implemented, changed not
implemented methods to throw NotImplementedException instead of
Exception, fixed names of field that are serialized

svn path=/trunk/mcs/; revision=29210
2004-06-10 17:53:10 +00:00
Jordi Mas i Hernandez 7ee8b3cfac remove dbg code
svn path=/trunk/mcs/; revision=29209
2004-06-10 17:34:00 +00:00
Paolo Molaro ea50ca4cf6 Thu Jun 10 20:10:16 CEST 2004 Paolo Molaro <[email protected]>
* reflection.c: make the token for a created method match
	the token of the MethodBuilder it was created from
	(IKVM requires this behaviour now).

svn path=/trunk/mono/; revision=29208
2004-06-10 17:23:23 +00:00
Gert Driesen aeed334240 * Encoding.cs: Marked protected internal field as internal to
fix API signature

svn path=/trunk/mcs/; revision=29207
2004-06-10 17:19:58 +00:00
Gert Driesen 2725186677 * SignedXml.cs: API signature fixes
svn path=/trunk/mcs/; revision=29206
2004-06-10 17:19:14 +00:00
Gert Driesen 8899547ace * StrongNameIdentityPermission.cs: removed extra useless finalizer
to fix public API signature

svn path=/trunk/mcs/; revision=29205
2004-06-10 17:03:00 +00:00
Gert Driesen ae23e8d4e5 * ToBase64Transform.cs: Uncomment finalizer to fix public API
signature

svn path=/trunk/mcs/; revision=29204
2004-06-10 17:00:23 +00:00
Lluis Sanchez decadc95bc * SoapAttribute.cs: Added missing protected members.
svn path=/trunk/mcs/; revision=29202
2004-06-10 16:31:35 +00:00
Jackson Harper 90089998a4 * driver.cs: Don't append gacdir to /root. This breaks
everything. Will add another option for doing this if its
	needed.

svn path=/trunk/mcs/; revision=29201
2004-06-10 16:20:32 +00:00
Gert Driesen 164cadff8e * Delegate.cs: marked protected fields private to match public
API of MS.NET, marked DynamicInvokeImpl and GetMethodImpl
protected to fix public API
* Enum.cs: marked ctor protected to match public API of MS.NET
* MulticastDelegate.cs: marked DynamicInvokeImpl protected to
match public API of MS.NET

svn path=/trunk/mcs/; revision=29199
2004-06-10 16:14:13 +00:00
Jordi Mas i Hernandez 6a60709f88 *** empty log message ***
svn path=/trunk/mcs/; revision=29198
2004-06-10 15:24:13 +00:00
Jordi Mas i Hernandez 00a1210909 move samples to the samples dir
svn path=/trunk/mcs/; revision=29197
2004-06-10 15:22:09 +00:00
Lluis Sanchez 21eff991a5 * ThreadTest.cs: Removed Ignore attribute from several threading tests that
failed because of Thread.Abort.

svn path=/trunk/mcs/; revision=29196
2004-06-10 14:59:37 +00:00
Lluis Sanchez 9b32c6e734 i * AssemblyNameTest.cs: AssertEqualsByteArrays(): don't crash if arrays are
empty. TestSerialization(): Use AssertEqualsByteArrays to compare keys.
	  Added messages to the assertions.

svn path=/trunk/mcs/; revision=29195
2004-06-10 14:58:32 +00:00
Lluis Sanchez 7a4f5a1080 * ChannelServices.cs: ExceptionFilterSink should be internal.
svn path=/trunk/mcs/; revision=29194
2004-06-10 14:56:27 +00:00
Rafael Teixeira 245abcf010 2004-06-10 Rafael Teixeira <[email protected]>
* skeleton.cs: oops some uses of changed classes/interfaces also need to become internal.

svn path=/trunk/mcs/; revision=29192
2004-06-10 14:32:47 +00:00
Rafael Teixeira 894f00aad3 Added a TODO comment
svn path=/trunk/mcs/; revision=29191
2004-06-10 14:20:37 +00:00
Jambunathan K abdf16032c Err Object related infrastructure is near complete. This is just a
preliminary commit. Requires more thorough review and test cases.

svn path=/trunk/mcs/; revision=29190
2004-06-10 14:12:47 +00:00
Atsushi Eno d10f558970 2004-06-10 Atsushi Enomoto <[email protected]>
* skelton.cs: make classes/interfaces internal.

svn path=/trunk/mcs/; revision=29189
2004-06-10 14:10:20 +00:00
Jordi Mas i Hernandez f24e0f33fd lock resource creation, cloning, and destroying
svn path=/trunk/mcs/; revision=29188
2004-06-10 13:20:08 +00:00
Paolo Molaro 9d429a6cf4 Thu Jun 10 16:06:42 CEST 2004 Paolo Molaro <[email protected]>
* mini.c, aot.c: memory leak fixes.

svn path=/trunk/mono/; revision=29187
2004-06-10 13:18:01 +00:00
Paolo Molaro 594de034a4 Thu Jun 10 16:02:27 CEST 2004 Paolo Molaro <[email protected]>
* image.c, image.h, appdomain.c, assembly.c, loader.c, metadata.c,
	reflection.c, socket-io.c: leak fixes.

svn path=/trunk/mono/; revision=29186
2004-06-10 13:16:12 +00:00
Gonzalo Paniagua Javier 61638e55ba 2004-06-10 Gonzalo Paniagua Javier <[email protected]>
* Control.cs:
	(ResolveUrl): fixed typo when dealing with relative urls. Closes bug
	#59794.

svn path=/trunk/mcs/; revision=29185
2004-06-10 12:02:57 +00:00
Marek Safar cf5443e16c 2004-06-10 Marek Safar <[email protected]>
* do-test.pl: --expect-error must be at the
	first place (mcs parses options by order).

svn path=/trunk/mcs/; revision=29184
2004-06-10 11:42:13 +00:00
Gonzalo Paniagua Javier 48c30bf3f3 2004-06-10 Gonzalo Paniagua Javier <[email protected]>
* library.make: fixed PLATFORM_CHANGE_SEPARATOR_CHAR on windows.

svn path=/trunk/mcs/; revision=29183
2004-06-10 11:37:25 +00:00
Marek Safar 583660eccb 2004-06-10 Marek Safar <[email protected]>
* do-test.pl: Added simple error logging.
	* Makefile (clean): Remove .dll & .log files

svn path=/trunk/mcs/; revision=29181
2004-06-10 11:12:25 +00:00
Lluis Sanchez c4d8e78767 * SoapMessageFormatter.cs: Don't add the signature to the headers list if
the method is not overloaded, and don't add the LogicalCallContext if
	  it has no info.

svn path=/trunk/mcs/; revision=29180
2004-06-10 11:01:59 +00:00
Lluis Sanchez fa03577b00 * SoapWriter.cs: In SerializeArray, consider 1 a valid id.
svn path=/trunk/mcs/; revision=29179
2004-06-10 10:54:20 +00:00
Umadevi S bbfaf64275 2004-06-10 Umadevi S <[email protected]>
* DataRelation.cs - Constructor
        - The datatypes of the parentcolumn(s) and the childcolumn(s) should match

svn path=/trunk/mcs/; revision=29178
2004-06-10 09:35:58 +00:00
Marek Safar ce6816dd49 CRLF->LF
svn path=/trunk/mcs/; revision=29177
2004-06-10 09:23:07 +00:00
Lluis Sanchez 63a60a1904 * HttpSimpleProtocolImporter.cs: Add needed XmlInclude attributes to the
generated class. Generate the correct data type for input parameters.
	* SoapProtocolImporter.cs: Like in MS.NET, take the first output parameter
	  as the return value of the method. When generating a header variable,
	  use the type name as the base for the variable name, not the part name.

svn path=/trunk/mcs/; revision=29176
2004-06-10 09:10:25 +00:00
Lluis Sanchez caa7ee9da6 * TypeStubManager.cs: Improved locking in GetLogicalTypeInfo().
* WebServiceHandler.cs: Removed unneded methods.

svn path=/trunk/mcs/; revision=29175
2004-06-10 09:09:38 +00:00
Lluis Sanchez e627ca7cb6 * DiscoveryClientProtocol.cs: In DiscoverAny, catch expection of type
DiscoveryException and rethrow the included Exception instead.
	* DiscoveryReference.cs: Added BaseUri property, that returns an uri
	  for the reference, supporting file uris.
	* ContractReference.cs: Use the new property BaseUri to build the import
	  uri.

svn path=/trunk/mcs/; revision=29174
2004-06-10 09:07:24 +00:00
Lluis Sanchez 27659c3160 * Makefile: Fix ms.net api file before the comparison.
* cormissing.xsl: Removed html encoding. Now generates plain text.
	* proxies.net.xml.gz: Updated.
	* services.xml: Updated.
	* wsdlfiles.tar.gz: Updated.
	* wstest.cs: Added option for removing wrong extra classes from ms.net
	  api xml file. Improved checkdiff option.

svn path=/trunk/mcs/; revision=29173
2004-06-10 09:04:47 +00:00
Lluis Sanchez aae87fab03 * MapCodeGenerator.cs, SoapCodeExporter.cs: Generate the same XmlInclude
attributes that MS.NET generates.
	* SerializationCodeGenerator.cs: Avoid duplicate generation of maps in the
	  same reader/writer.
	* XmlCodeExporter.cs: Added support for ignore flag in maps and members.
	* XmlReflectionImporter.cs: Changed GetReflectionMembers to match
	  MS.NET member ordering. Patch by David Taylor.
	* XmlSchemaImporter.cs: When generating a choice member, set the ignore
	  flag. The generated enum must also not be included in the schema.
	* XmlTypeMapMember.cs: Added ignore flag.
	* XmlTypeMapping.cs: The AttributeMembers property now returns the
	  attributes in the correct order.

svn path=/trunk/mcs/; revision=29172
2004-06-10 08:47:59 +00:00
Raja R Harinath 292144245e * 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.

svn path=/trunk/mono/; revision=29171
2004-06-10 08:14:21 +00:00
Alon Gazit 911f16aefc fixed WebControl.LoadViewState().
Creates new attributes state bag only when the current is null.

svn path=/trunk/mcs/; revision=29170
2004-06-10 08:06:32 +00:00
Raja R Harinath 76340d93ab (LIBRARY_COMPILE): Define only if 'USE_BOOT_COMPILE' is
defined.  Don't conflate building a non-Xml temporary System.dll
with building System.dll for bootstrapping mcs.

svn path=/trunk/mcs/; revision=29169
2004-06-10 06:57:46 +00:00
Raja R Harinath 29244a261b 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).

svn path=/trunk/mono/; revision=29168
2004-06-10 06:56:33 +00:00
Atsushi Eno f67f33e172 2004-06-10 Atsushi Enomoto <[email protected]>
* DateTimeTest.cs : added more "common pattern" tests.

svn path=/trunk/mcs/; revision=29167
2004-06-10 06:38:56 +00:00
Atsushi Eno 4347c57e97 2004-06-10 Atsushi Enomoto <[email protected]>
* DateTime.cs : Added more common patterns.

svn path=/trunk/mcs/; revision=29166
2004-06-10 06:35:16 +00:00
Atsushi Eno 97a9b197f8 2004-06-10 Atsushi Enomoto <[email protected]>
* DateTimeTest.cs : Added more milliseconds and pattern recognition
	  tests. Patch by Steven Brown (a bit modified).

svn path=/trunk/mcs/; revision=29165
2004-06-10 06:33:47 +00:00
Atsushi Eno 93ed277f61 2004-06-10 Atsushi Enomoto <[email protected]>
* XmlNodeWriter.cs : it's internal.

svn path=/trunk/mcs/; revision=29164
2004-06-10 06:17:06 +00:00
Anirban Bhattacharjee 4064fd7f1a * mb-parser.jay: Grammar added for RemoveHandler statement
svn path=/trunk/mcs/; revision=29163
2004-06-10 06:12:48 +00:00
Sanja Gupta 3495454571 ChangeLog: Updated ChangeLog.
TestBitmap.cs: Corrected issues from my previous checkin.

svn path=/trunk/mcs/; revision=29162
2004-06-10 06:09:10 +00:00
Umadevi S 4aa10877e8 2004-06-10 Umadevi S <[email protected]>
* DataTableMappingCollection.cs - fixed nunit testcase errors
        IndexOfDataSetTable method

svn path=/trunk/mcs/; revision=29161
2004-06-10 05:53:53 +00:00
Umadevi S bcde523fb0 2004-06-10 Umadevi S <[email protected]>
* Corrected GetTableMappingBySchemaAction for DataTableMappingCollectionTest

svn path=/trunk/mcs/; revision=29160
2004-06-10 05:51:00 +00:00
Gert Driesen ea434cb90f * Image.cs: API signature fixes, meaning DisposeResources is now
private and marked InitFromStream internal

svn path=/trunk/mcs/; revision=29159
2004-06-10 05:45:44 +00:00
Atsushi Eno 1262953080 2004-06-10 Atsushi Enomoto <[email protected]>
* XmlSchemaFacet.cs : Fixed internal protected --> internal.

svn path=/trunk/mcs/; revision=29158
2004-06-10 05:29:42 +00:00
Umadevi S 64433c7db6 2004-06-10 Umadevi S <[email protected]>
* SqlGuidTest.cs - corrected the CompareTo method

svn path=/trunk/mcs/; revision=29156
2004-06-10 03:38:14 +00:00
Anirban Bhattacharjee b564cc3a1d this test is fully functional now
svn path=/trunk/mcs/; revision=29155
2004-06-10 03:09:32 +00:00
Anirban Bhattacharjee 9a4c271be7 * mb-parser.jay:
* expression.cs:
                Added support for statement like
                        delgate_name = AddressOf sub_name

svn path=/trunk/mcs/; revision=29154
2004-06-10 03:01:04 +00:00
Sebastien Pouliot caec2d48ce 2004-06-09 Sebastien Pouliot <[email protected]>
* Decimal.cs: Fixed banker rounding by calling Math.Round. This won't
	be a performance winner (the actual Math code has a note to wait a
	better Decimal implementation) but it returns the correct results
	(without adding new code in corlib or the runtime). Fix #37744.

svn path=/trunk/mcs/; revision=29153
2004-06-10 02:52:56 +00:00
Ravindra 038dc01003 * Makefile: Suppress compiler warning cs:618 for test dll.
svn path=/trunk/mcs/; revision=29152
2004-06-10 02:50:56 +00:00
Sebastien Pouliot d6683688a2 2004-06-09 Sebastien Pouliot <[email protected]>
* DecimalTest.cs: Reactivated test and added new cases for banker
	rounding.

svn path=/trunk/mcs/; revision=29151
2004-06-10 02:44:49 +00:00
Sanja Gupta 1c8e4ce180 ChangeLog: Updated ChangeLog.
TestBmpCodec.cs, TestImageCodecInfo.cs, TestJpedCodec.cs: Removed
        dependency on obsolete class, Assertion from NUnit.

svn path=/trunk/mcs/; revision=29150
2004-06-10 02:42:10 +00:00
Sanja Gupta 3609bff39c ChangeLog: Updated ChangeLog
TestImageFormatConverter.cs, TestStringFormat.cs: Removed
        dependency on obsolete class, Assertion from NUnit.

svn path=/trunk/mcs/; revision=29148
2004-06-10 02:31:48 +00:00
Miguel de Icaza 314485d57d 2004-06-09 Miguel de Icaza <[email protected]>
* codegen.cs: FAQ avoider: turn 1577 into a warning for now until
	tomorrow.

svn path=/trunk/mcs/; revision=29147
2004-06-10 01:45:51 +00:00
Miguel de Icaza 01136d52a7 2004-06-09 Miguel de Icaza <[email protected]>
* codegen.cs: FAQ avoider: turn 1577 into a warning for now until
	tomorrow.

svn path=/trunk/mcs/; revision=29146
2004-06-10 01:45:18 +00:00
Atsushi Eno 137eba09a5 2004-06-09 Atsushi Enomoto <[email protected]>
* UriTest.cs : Added RelativeCtor(), Unescape(), Segments5() and
	  ParseOverride().

svn path=/trunk/mcs/; revision=29145
2004-06-10 00:22:23 +00:00
Atsushi Eno 566144984e 2004-06-09 Atsushi Enomoto <[email protected]>
* Uri.cs :
	  - Now Parse() is properly implemented. If overriden, the overriding
	    Parse() is used _instead of_ this class's parsing logic.
	  - AbsoluteUri does not escape URI string at all.
	  - ToString() should unescape Query. But should not unescape fragment.
	    And all all parts should be unescaped individually to keep ? and #.
	  - In relative .ctor(), handle Windows UNC as an absolute file URI.
	  - In some cases, hosts and paths were not properly escaped in
	    relative .ctor().
	  - Removed unused isWindowsPath.
	  - Escape Query.
	* UriBuilder.cs : Fragment and Query aren't escaped when they are set.

svn path=/trunk/mcs/; revision=29144
2004-06-10 00:20:33 +00:00
Atsushi Eno a2460e676a 2004-06-09 Atsushi Enomoto <[email protected]>
* DateTime.cs :
	  - A bunch of fixes (patch by Steven Brown). Fraction seconds are
	    now represented as double. Strict token check for 'Z'.
	  - Pattern validity check in GetDateTimeFormats(char).
	  - Fixed pattern "yyyy/M/d HH:mm:ss".

svn path=/trunk/mcs/; revision=29143
2004-06-09 23:15:12 +00:00
Miguel de Icaza f1b2eca2da AddBreak
svn path=/trunk/mono/; revision=29142
2004-06-09 23:15:06 +00:00
Sebastien Pouliot a5935eb2e2 2004-06-09 Sebastien Pouliot <[email protected]>
* 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.

svn path=/trunk/mcs/; revision=29141
2004-06-09 23:03:25 +00:00
Miguel de Icaza 50beb484c0 Flush
svn path=/trunk/mono/; revision=29140
2004-06-09 22:48:03 +00:00
Sebastien Pouliot 3686c61283 2004-06-09 Sebastien Pouliot <[email protected]>
* Decimal.cs: Fixed GetHashCode to return different result for X and -X.

svn path=/trunk/mcs/; revision=29139
2004-06-09 22:38:33 +00:00
Duncan Mak 7e1ce1a201 (RegisterObject): Add checks for ArgumentNullException as well.
r=lluis

svn path=/trunk/mcs/; revision=29138
2004-06-09 22:21:22 +00:00
Jackson Harper 62e8923475 Use the old one, there are a few issues that need to be resolved in the new one
svn path=/trunk/mcs/; revision=29137
2004-06-09 20:30:02 +00:00
Miguel de Icaza f879a12f34 API signature fixes
svn path=/trunk/mcs/; revision=29136
2004-06-09 20:15:14 +00:00
Jackson Harper c6e71b5f40 reduce toods crying
svn path=/trunk/mcs/; revision=29135
2004-06-09 19:43:04 +00:00
Gonzalo Paniagua Javier 2b7bb3b74a 2004-06-09 Gonzalo Paniagua Javier <[email protected]>
* HttpContext.cs: reverting Pedro's patch and sending mail with test
	to mono-devel.

svn path=/trunk/mcs/; revision=29134
2004-06-09 19:22:26 +00:00
Gert Driesen 15fcfc0166 * TypeBuilderTest.cs: Added tests for completed/created type
* FieldBuilderTest.cs: Added tests for FieldBuilder (mostly
checking error conditions for now)

* EnumBuilderTest.cs: Added tests for EnumBuilder

* MethodBuilderTest.cs: Added tests for invalid parameter
indexes for created types, added test for GetHashCode

svn path=/trunk/mcs/; revision=29133
2004-06-09 19:21:44 +00:00
Gert Driesen 8f6a62c321 * FieldBuilder.cs: fixed implementation to match MS.NET,
meaning throw InvalidOperationException for methods that
should not be allowed to execute when type has been
created, and throw NotSupportedException for methods and
properties that should not be called on FieldBuilder

svn path=/trunk/mcs/; revision=29132
2004-06-09 19:16:17 +00:00
Sebastien Pouliot e677cd0529 2004-06-09 Sebastien Pouliot <[email protected]>
* Makefile: Don't sign this assembly as it is fully signed during
	compilation (we have the original private key). Thanks to Jackson.

svn path=/trunk/mcs/; revision=29131
2004-06-09 18:58:16 +00:00
Sebastien Pouliot b250033002 2004-06-09 Sebastien Pouliot <[email protected]>
* library.make: Added support to fully sign assemblies when doing a
	"make install" (thanks to Jackson :-).

svn path=/trunk/mcs/; revision=29130
2004-06-09 18:56:21 +00:00
Gert Driesen 4b118ebec5 * MethodBuilder.cs: move check to see if type has already
been created up, to match MS.NET behaviour. Fix GetHashCode
(removed TODO)

svn path=/trunk/mcs/; revision=29129
2004-06-09 18:29:11 +00:00
Martin Baulig b92852c716 This error checking rule was never applied due to a reduce/reduce conflict.
svn path=/trunk/mcs/; revision=29128
2004-06-09 18:14:43 +00:00
Gert Driesen 29a02024d6 * AssemblyNameTests.cs: added tests for AssemblyName.FullName
and serialization of AssemblyName, converted tests to use Assert
class

svn path=/trunk/mcs/; revision=29127
2004-06-09 17:53:12 +00:00
Atsushi Eno 25244c80c2 2004-06-09 Atsushi Enomoto <[email protected]>
* UriBuilderTest.cs : Actually Query() and Fragment() didnt pass under
	  MS.NET.

svn path=/trunk/mcs/; revision=29125
2004-06-09 17:44:22 +00:00
Atsushi Eno 0dc3354b11 2004-06-09 Atsushi Enomoto <[email protected]>
* UriBuilderTest.cs: Please don't hardcode non-ASCII/non-UTF8
	  character in the sources.

svn path=/trunk/mcs/; revision=29124
2004-06-09 17:27:58 +00:00
Duncan Mak 099f56bc86 * BufferedStream.cs (SetLength): Add checks and throw the
appropriate Exceptions here instead.

* FileStream.cs (SetLength): Revert part of my last patch, we're
throwing ObjectDisposedException instead of IOException again.

svn path=/trunk/mcs/; revision=29123
2004-06-09 17:10:54 +00:00
Jackson Harper efd6612d24 * gacutil.exe.sources: Make the new gacutil the default and return
seats to their upright position.

svn path=/trunk/mcs/; revision=29122
2004-06-09 17:01:29 +00:00
Sebastien Pouliot c7579eb05e 2004-06-09 Sebastien Pouliot <[email protected]>
* Decimal.cs: Fixed remainder (and optimized some cases not to call
	unmanaged code). Simplified divide. Removed workaround for bug #59793.

svn path=/trunk/mcs/; revision=29121
2004-06-09 16:58:11 +00:00
Sebastien Pouliot bded94a7d1 2004-06-09 Sebastien Pouliot <[email protected]>
* Decimal.cs: Added tests for remainder, divide and parsing overflow.

svn path=/trunk/mcs/; revision=29120
2004-06-09 16:54:22 +00:00
Atsushi Eno ccbe1a058e 2004-06-09 Atsushi Enomoto <[email protected]>
* XmlNamespaceManager.cs : The error message was improper.
	  Fix for bug #59880.

svn path=/trunk/mcs/; revision=29119
2004-06-09 16:44:01 +00:00
Duncan Mak 70b35ad1a5 * SerializationInfoEnumerator.cs: Instead of using
IDictionaryEnumerator from a Hashtable, use a normal IEnumerator
from the newly added ArrayList in SerializationInfo.

* SerializationInfo.cs: Added an extra ArrayList so that we can
keep the SerializationEntrys added in the order.
(SerializationInfo, AddValue): Throw ArgumentNullException
correctly.

svn path=/trunk/mcs/; revision=29118
2004-06-09 16:26:08 +00:00
Jordi Mas i Hernandez 58d1c25081 simplifies object destruction and fixes
svn path=/trunk/mcs/; revision=29117
2004-06-09 16:14:53 +00:00
Paolo Molaro fa0c15d5b6 Improved vararg test.
svn path=/trunk/mcs/; revision=29115
2004-06-09 15:54:10 +00:00
Paolo Molaro 42cb850ada Wed Jun 9 18:23:59 CEST 2004 Paolo Molaro <[email protected]>
* icall.c: handle sentinel pos in vararg methods in position different
	from 0.

svn path=/trunk/mono/; revision=29114
2004-06-09 15:36:21 +00:00
Pedro Martínez Juliá 0a43522af6 2004-06-09 Pedro Mart�nez Juli� <[email protected]>
* HttpContext: User property returns its own "user" value because
    the context can walk through different Threads. When "User" property
    is changed, change "Thread.CurrentPrincipal" too.

svn path=/trunk/mcs/; revision=29113
2004-06-09 13:27:27 +00:00
Marek Safar 785445af36 new error test
svn path=/trunk/mcs/; revision=29112
2004-06-09 12:50:33 +00:00
Sebastien Pouliot a9e8ff0947 2004-06-09 Sebastien Pouliot <[email protected]>
* StrongNameManager.cs: Fix ToString() when no verificationSettings
	are present (used in sn -Vl).
	* sn.cs: Fixed to match documentation.

svn path=/trunk/mcs/; revision=29111
2004-06-09 12:07:17 +00:00
Sebastien Pouliot 83b82e4e4d 2004-06-09 Sebastien Pouliot <[email protected]>
* sn.1: Updated documentation to match the tool and to include more
	informations about the configuration kept in machine.config.

svn path=/trunk/mono/; revision=29110
2004-06-09 12:04:28 +00:00
Sanja Gupta a010c76173 ChangeLog: Updated ChangeLog
TestImageConverter.cs: Removed dependency on obsolete class,
		      Assertion from NUnit.

svn path=/trunk/mcs/; revision=29109
2004-06-09 11:57:49 +00:00
Marek Safar f5ade4f15c new error test
svn path=/trunk/mcs/; revision=29108
2004-06-09 11:27:07 +00:00
Jordi Mas i Hernandez 32f8bc7e0b added missing destructors
svn path=/trunk/mcs/; revision=29107
2004-06-09 11:06:00 +00:00
Sanja Gupta e7a66d7923 ChangeLog: Updated ChangeLog.
TestBitmap.cs, TestIcon.cs, TestIconConverter.cs: Removed
dependency on obsolete class, Assertion from NUnit.

svn path=/trunk/mcs/; revision=29106
2004-06-09 11:04:48 +00:00
Raja R Harinath 86ef6c503b Do away with stampfiles.
Introduce support for VB test cases.
* library.make (HAVE_CS_TESTS, HAVE_VB_TESTS): New auto-detecting
defines.
(stampfile, test_stampfile): Remove.
(clean-local): Don't mention them.
(test-local, run-test-local, run-test-ondotnet-local):
Make unconditional.
($(makefrag), $(test_makefrag)): Simplify.
($(btest_lib)): New.  Support for VB testcases.

svn path=/trunk/mcs/; revision=29105
2004-06-09 10:57:33 +00:00
Umadevi S 444b551e2d 2004-06-09 Umadevi S <[email protected]>
* Correct Add, InserAt testcases for DataTableMappingCollection

svn path=/trunk/mcs/; revision=29104
2004-06-09 10:32:13 +00:00
Sureshkumar T 0aef1ec5d0 * OdbcDataReader.cs: Removed checking of currentRow in GetName method
svn path=/trunk/mcs/; revision=29103
2004-06-09 10:28:13 +00:00
Umadevi S ef1237f9f7 2004-06-09 Umadevi S <[email protected]>
* DataTableMappingCollection.cs - fixed nunit testcase errors
        - Add, GetByDataSetTable,Insert, Remove, RemoveAt methods.

svn path=/trunk/mcs/; revision=29102
2004-06-09 10:24:01 +00:00
Raja R Harinath fb98cfaf90 Simplify slightly.
svn path=/trunk/mcs/; revision=29101
2004-06-09 10:02:25 +00:00
Gonzalo Paniagua Javier 31fdfdaac3 2004-06-09 Gonzalo Paniagua Javier <[email protected]>
* GlobalizationConfigurationHandler.cs: if no culture given, use the
	default one, not the invariant.

svn path=/trunk/mcs/; revision=29100
2004-06-09 09:51:06 +00:00
Gonzalo Paniagua Javier 6e508a36dd 2004-06-09 Gonzalo Paniagua Javier <[email protected]>
* culture-info-tables.h: freshly generated.

svn path=/trunk/mono/; revision=29099
2004-06-09 09:42:13 +00:00
Gonzalo Paniagua Javier fa3fece5a4 2004-06-09 Gonzalo Paniagua Javier <[email protected]>
* 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".

svn path=/trunk/mono/; revision=29098
2004-06-09 09:40:22 +00:00
Raja R Harinath 06bdfa7a56 (HAVE_CYCLIC_DEP_FILE): New. Used to detect if
System.Xml.dll is present.
(SECOND_PASS): Remove.

svn path=/trunk/mcs/; revision=29097
2004-06-09 09:15:20 +00:00
Umadevi S 859672405a 2004-06-09 Umadevi S <[email protected]>
* Corrected Remove method testcase

svn path=/trunk/mcs/; revision=29096
2004-06-09 09:00:02 +00:00
Umadevi S b92efab743 2004-06-09 Umadevi S <[email protected]>
* DataColumnMappingCollection.cs - fixed nunit testcase errors
        - GetByDataSetColumn,IndexOfDataSetColumn, Remove methods.

svn path=/trunk/mcs/; revision=29095
2004-06-09 08:57:24 +00:00
Raja R Harinath 5f397c7877 Remove stray space.
svn path=/trunk/mcs/; revision=29094
2004-06-09 08:23:01 +00:00
Raja R Harinath 8b7ae3326c Remove trailing empty lines
svn path=/trunk/mcs/; revision=29093
2004-06-09 08:21:21 +00:00
Raja R Harinath 89c949be67 Partial support for writing Visual Basic source files.
* rules.make (USE_MBAS_FLAGS,BASCOMPILE,INTERNAL_MBAS): New.
* config-default.make (MBAS_FLAGS, DEFAULT_MBAS_FLAGS): New.
* profiles/default.make (MBAS): New.

svn path=/trunk/mcs/; revision=29092
2004-06-09 08:19:15 +00:00
Raja R Harinath 8c1fc80fe6 Do away with stampfiles.
* executable.make (stampfile): Remove.
(clean-local): Remove mention of $(stampfile).
(test-local, run-test-local, run-test-ondotnet-local):
Make unconditional.  Add dummy rule to prevent other makefiles
from defining rules on these.
($(PROGRAM)): Depend directly on $(BUILT_SOURCES).
($(makefrag)): Simplify.

svn path=/trunk/mcs/; revision=29091
2004-06-09 08:12:16 +00:00
Raja R Harinath 95c8c4f8f5 (HAS_TEST): Remove.
(run-test-local): Move rules to and depend on ...
(run-cilc-test): ... this.

svn path=/trunk/mcs/; revision=29090
2004-06-09 08:08:22 +00:00
Raja R Harinath d59545c0ca (HAS_TEST): Remove.
(run-test-local): Disable for now.  Move rules to ...
(run-sqlsharp-test): ... this.

svn path=/trunk/mcs/; revision=29089
2004-06-09 08:08:03 +00:00
Raja R Harinath 79a72c3436 (HAS_TEST): Remove.
(run-test-local): Move rule to and depend on ...
(run-mbas-test): ... this.

svn path=/trunk/mcs/; revision=29088
2004-06-09 08:07:39 +00:00
Raja R Harinath da5d64df7e Remove trailing empty lines
svn path=/trunk/mcs/; revision=29087
2004-06-09 08:02:44 +00:00
Marek Safar b4e07fb8fd new error test
svn path=/trunk/mcs/; revision=29086
2004-06-09 07:51:18 +00:00
Gert Driesen 8a112edb56 * CompressedStack.cs: Added finalizer to match public API of
MS.NET

svn path=/trunk/mcs/; revision=29082
2004-06-09 04:56:20 +00:00
Gert Driesen 8f4b677f58 * Context.cs: Added finalizer to match MS.NET
svn path=/trunk/mcs/; revision=29081
2004-06-09 04:54:36 +00:00
Gert Driesen 1383411edd * IsolatedStorage.cs: use private variable for holding scope,
set scope in InitStore method, removed need for extra protected
member (public API fix)
* IsolatedStorageFile.cs: use InitStore to initialize scope

svn path=/trunk/mcs/; revision=29080
2004-06-09 04:48:36 +00:00
Jackson Harper 9ced84c8d8 * AssemblyName.cs (GetAssemblyName): Send a fullpath to the
runtime. This way the codebase is set properly. The codebase is
	using g_filename_to_uri which expects a full path.

svn path=/trunk/mcs/; revision=29079
2004-06-09 04:44:55 +00:00
Jackson Harper 16793ba679 * driver.cs: When checking refs don't bother using an AppDomain
and load the assembly using the code base so we get the right
	one. Print out the name of the non strong named assembly if one is
	referenced.

svn path=/trunk/mcs/; revision=29078
2004-06-09 04:35:47 +00:00
Gonzalo Paniagua Javier 7dcce26259 2004-06-09 Gonzalo Paniagua Javier <[email protected]>
* FileStream.cs: re-enabled ignoring broken pipe errors when reading.
	Fixes bug #59639.

svn path=/trunk/mcs/; revision=29077
2004-06-09 04:10:30 +00:00
Gert Driesen 7fa039a9be * MethodRentalTest.cs: Added check for invalid method size,
fixed tests on MS.NET, Mono-stylized

svn path=/trunk/mcs/; revision=29076
2004-06-09 03:53:52 +00:00
Gert Driesen 77e4340424 * MethodRental.cs: Added check for method size to match MS.NET
svn path=/trunk/mcs/; revision=29075
2004-06-09 03:46:13 +00:00
Sebastien Pouliot 0e862bf888 2004-06-08 Sebastien Pouliot <[email protected]>
* StrongName.cs: Synch with corlib (the new code isn't even compiled)
	in Mono.Security assembly.

svn path=/trunk/mcs/; revision=29074
2004-06-09 00:49:32 +00:00
Sebastien Pouliot d41f63f691 2004-06-08 Sebastien Pouliot <[email protected]>
* StrongName.cs: Added corlib specific code to load configuration
	from machine.config to allow public key token remapping to work
	with (for example) gacutil.
	* StrongNameManager.cs: Now load configuration from machine.config.

svn path=/trunk/mcs/; revision=29073
2004-06-09 00:47:21 +00:00
Gonzalo Paniagua Javier 08ea49abc6 updated with hints on attaching a file
svn path=/trunk/mono/; revision=29072
2004-06-08 23:34:48 +00:00
Duncan Mak 4bcfccc9f6 Use something more portable. Thanks for the suggestion, Gonzalo!
svn path=/trunk/mcs/; revision=29071
2004-06-08 23:23:58 +00:00
Martin Baulig 8f4d2c1f94 2004-06-09 Martin Baulig <[email protected]>
* loader.c (mono_get_method_constrained): Call `mono_class_init
	(constrained_class)'.

svn path=/trunk/mono/; revision=29068
2004-06-08 23:13:08 +00:00
Jordi Mas i Hernandez c881227ce3 compose sample
svn path=/trunk/mcs/; revision=29067
2004-06-08 23:08:08 +00:00
Jordi Mas i Hernandez 5dca3c6e39 SaveAdd wrappers
svn path=/trunk/mcs/; revision=29066
2004-06-08 23:06:16 +00:00
Duncan Mak 1e68e05910 (IsRootDirectory): New helper method for determining if a path is the
root directory. Handles both Unix as well as Windows.
(GetParent): Use IsRootDirectory for the check.

svn path=/trunk/mcs/; revision=29065
2004-06-08 21:29:57 +00:00
Duncan Mak 707853d557 (GetParentOfRootDirectory): Add test for
GetParent from the root directory.

svn path=/trunk/mcs/; revision=29064
2004-06-08 21:29:36 +00:00
Duncan Mak 6fd29319dd Fix embarrassment
svn path=/trunk/mcs/; revision=29063
2004-06-08 20:45:34 +00:00
Duncan Mak ea24ee3d3e Make it work on Windows as well
svn path=/trunk/mcs/; revision=29062
2004-06-08 20:28:52 +00:00
Duncan Mak 3f9d81d821 * File.cs: Fix line endings, took out ^Ms.
* Directory.cs (GetParent): Return null if the specified path is
the root directory.

svn path=/trunk/mcs/; revision=29061
2004-06-08 20:09:19 +00:00
Gert Driesen bbb9f8a37f * icall.c (ves_icall_MonoType_GetEvent): Handle events without
any methods. Fixes #59629.

svn path=/trunk/mono/; revision=29060
2004-06-08 19:50:29 +00:00
Sebastien Pouliot d976d4ee03 2004-06-08 Sebastien Pouliot <[email protected]>
* machine.config: Added strongname token remapping configuration.

svn path=/trunk/mono/; revision=29058
2004-06-08 19:30:12 +00:00
Sebastien Pouliot 60c0e8bee7 2004-06-08 Sebastien Pouliot <[email protected]>
* AssemblyInfo.cs: Updated version number for post beta 2.
	* StrongNameManager.cs: Changed XML format to be compatible with
	machine.config. Made token uppercase.
	* sn.cs: Now load the token remapping configuration from
	machine.config. Fixed some errors in help.

svn path=/trunk/mcs/; revision=29057
2004-06-08 19:26:16 +00:00
Duncan Mak 560c5a0645 (StreamReader):
(Initialize): Add a check that buffer_size must not be less than
or equal to zero.

svn path=/trunk/mcs/; revision=29056
2004-06-08 19:08:03 +00:00
Duncan Mak 6ea3a021d6 Add MacOS X installer.
svn path=/trunk/mono/; revision=29055
2004-06-08 18:41:20 +00:00
Jackson Harper 0cc5c10859 * driver.cs Add install from list and uninstall from list
commands. Allow options to come before commands. Add the /silent
	option so we can shut the tool up. And use returns instead of
	Environment.Exit where appropriate.

svn path=/trunk/mcs/; revision=29054
2004-06-08 18:40:51 +00:00
Duncan Mak 042a130ac1 (RegisterObject): Throw ArgumentOutOfRangeException if the objectID
parameter is less than or equal to zero. This check was missing from
this particular overload.

svn path=/trunk/mcs/; revision=29053
2004-06-08 18:39:04 +00:00
Atsushi Eno af5686ee0d 2004-06-08 Atsushi Enomoto <[email protected]>
* xsd.1 : some additional info.

svn path=/trunk/mono/; revision=29052
2004-06-08 18:30:19 +00:00
Atsushi Eno ec2ecd7275 2004-06-08 Atsushi Enomoto <[email protected]>
* DateTime.cs :
	  - Now re-checked all common format patterns. They should be tried
	    with both current culture and invariant culture. Since '/' covers
	    '-', removed extraneous patterns. Added more common patterns
	    such as "yyyy-MM-dd" and X509Certificate pattern (it is valid
	    only after NET_1_1). Commented out 1 character format patterns.
	  - The format patterns we should try should not be obtained by
	    GetAllDateTimePatterns(). Just use 'd', 'D', 't', 'T', ... (one
	    character patterns), to handle UTC correctly. Examined patterns
	    are changed, to 1) common patterns with specified (or current)
	    culture, 2) common patterns with invariant, 3) The above "one
	    character patterns" with specified (or current) culture.
	  - When trying to parse some kind of patterns such as RFC1123,
	    always use invariant DateTimeFormatInfo so that they can avoid
	    parsing with culture-dependent calendar.
	  - Check "GMT" only when doing Parse(). Don't it when ParseExact().
	  - Removed extraneous '-' case. It is not special one.
	  - When ParseExact(), allow only '/' for '/' pattern character.
	  - When Parse(), allow any non-letter & non-number characters.
	  - When pattern is not fully parsed, reject that format.
	  - Added "exact" parameter to some ParseExact().
	  - RFC1123 pattern is (again) now parsed in local time. I regressed
	    some problems in previous fix.

svn path=/trunk/mcs/; revision=29051
2004-06-08 18:21:54 +00:00
Atsushi Eno 6d3249f6f2 2004-06-08 Atsushi Enomoto <[email protected]>
* culture-info-tables.h: reflecting locale-builder updates.

svn path=/trunk/mono/; revision=29050
2004-06-08 17:58:50 +00:00
Atsushi Eno d1a28d06f5 2004-06-08 Atsushi Enomoto <[email protected]>
* 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.

svn path=/trunk/mono/; revision=29049
2004-06-08 17:57:13 +00:00
Atsushi Eno 93ca27d6be 2004-06-08 Atsushi Enomoto <[email protected]>
* Driver.cs : To make "extra pattern only" xxxFormatLength possible,
	  fill values only when the exact element was available.

svn path=/trunk/mono/; revision=29048
2004-06-08 17:44:37 +00:00
Duncan Mak b747124904 Add mono.snk
svn path=/trunk/mcs/; revision=29046
2004-06-08 17:32:30 +00:00
Atsushi Eno 602d465be5 2004-06-08 Atsushi Enomoto <[email protected]>
* DateTimeTest.cs :
	  - Added TestParse3() (not-allowed pattern example), ParseUtcNonUtc()
	    ("GMT" strings and time adjustment), TimeZoneAdjustment() ('Z'
	    pattern conditions) and CultureIndependentTests() (batch tests for
	    _all_ or almost all cultures).
	  - Added more Z string to X509Certificate test.
	  - Added ParseAllowsQueerString() [not fixed].

svn path=/trunk/mcs/; revision=29045
2004-06-08 17:28:34 +00:00
Lluis Sanchez 36e32abfec * ReadOnlyCollectionBase.cs: Renamed internal variable to make serialization
compatible with MS.NET.

svn path=/trunk/mcs/; revision=29044
2004-06-08 16:33:05 +00:00
Gonzalo Paniagua Javier f7f0210dc1 style and ^Ms in last patch from Alon
svn path=/trunk/mcs/; revision=29043
2004-06-08 15:50:13 +00:00
Gonzalo Paniagua Javier f05b15b50b 2004-06-08 Gonzalo Paniagua Javier <[email protected]>
* HttpRequest.cs: removed extra ^Ms and fixed style of last patch.

svn path=/trunk/mcs/; revision=29042
2004-06-08 15:44:57 +00:00
Paolo Molaro 78bc1fefbb Tue Jun 8 16:37:15 CEST 2004 Paolo Molaro <[email protected]>
* inssel-long32.brg: implemented a few missing ulong cast opcodes.

svn path=/trunk/mono/; revision=29041
2004-06-08 13:49:15 +00:00
Marek Safar 18a52a02d0 2004-06-08 Marek Safar <[email protected]>
* class:
	(Method.ApplyAttributeBuilder): Moved and added conditional
	attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).

	* delegate.cs:
	(DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.

svn path=/trunk/mcs/; revision=29040
2004-06-08 13:43:40 +00:00
Dick Porter e37a61824f 2004-06-08 Dick Porter <[email protected]>
* CultureInfo.cs: Make calendar_data readonly, to match the
	const-ness in the runtime.

svn path=/trunk/mcs/; revision=29039
2004-06-08 13:42:30 +00:00
Dick Porter a7bd34ac55 2004-06-08 Dick Porter <[email protected]>
* object.h:
	* locales.c: Fixed compile warnings, including a real bug in
	CompareInfo_internal_compare.

svn path=/trunk/mono/; revision=29038
2004-06-08 13:40:51 +00:00
Marek Safar d5902eb57e 2004-06-08 Marek Safar <[email protected]>
Fixed #59640
	* class.cs: (EventField.attribute_targets): Changed default target.

svn path=/trunk/mcs/; revision=29037
2004-06-08 13:20:37 +00:00
Dick Porter d6c273362d 2004-06-08 Dick Porter <[email protected]>
* 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.

svn path=/trunk/mono/; revision=29036
2004-06-08 13:10:03 +00:00
Sebastien Pouliot 7662436177 2004-06-08 Sebastien Pouliot <[email protected]>
* Decimal.cs: Fixed cast to integer types to truncate (not round) the
	value.

svn path=/trunk/mcs/; revision=29035
2004-06-08 13:05:03 +00:00
Sebastien Pouliot 5c3bb3d662 2004-06-08 Sebastien Pouliot <[email protected]>
* DecimalTest.cs: Added test case for truncating including indirect
	truncates with cast to integer types.

svn path=/trunk/mcs/; revision=29034
2004-06-08 12:51:36 +00:00
Paolo Molaro 61a93e9316 Tue Jun 8 15:36:30 CEST 2004 Paolo Molaro <[email protected]>
* Makefile.am: remove the -static hack completely, it links in
	statically glib as well.

svn path=/trunk/mono/; revision=29033
2004-06-08 12:48:36 +00:00
Dick Porter 2e1893674c 2004-06-08 Dick Porter <[email protected]>
* 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.

svn path=/trunk/mono/; revision=29031
2004-06-08 12:30:58 +00:00
Anirban Bhattacharjee bfac4f91e3 * mb-parser.jay:
* statement.cs:
                Few exception checks for Event

svn path=/trunk/mcs/; revision=29029
2004-06-08 11:59:29 +00:00
Jordi Mas i Hernandez 3123d99964 Cairo GTK# Mono sample
svn path=/trunk/mcs/; revision=29025
2004-06-08 10:25:56 +00:00
Jordi Mas i Hernandez 8408ea898a Mono.Cairo fixes
svn path=/trunk/mcs/; revision=29024
2004-06-08 10:19:55 +00:00
Umadevi S 033a269ef9 2004-06-08 Umadevi S <[email protected]>
* Corrected the contains testcase to test for invalidcastexception

svn path=/trunk/mcs/; revision=29023
2004-06-08 10:17:16 +00:00
Umadevi S eaabecc4bc 2004-06-08 Umadevi S <[email protected]>
* DataColumnMappingCollection.cs - fixed nunit testcase errors.
        - remove, removeat, contains methods.

svn path=/trunk/mcs/; revision=29022
2004-06-08 10:14:38 +00:00
Zoltan Varga b735fc2576 2004-06-09 Zoltan Varga <[email protected]>
* icall.c (ves_icall_Type_GetEvents_internal): Handle events without
	any methods. Fixes #59629.

svn path=/trunk/mono/; revision=29021
2004-06-08 08:40:52 +00:00
Alon Gazit c11a57d9e8 Changing the implementation of HttpRequest.ServerVariables.
svn path=/trunk/mcs/; revision=29020
2004-06-08 07:24:00 +00:00
Alon Gazit b78bafeecd Adding ServerVariablesCollection.
svn path=/trunk/mcs/; revision=29019
2004-06-08 07:18:34 +00:00
Gonzalo Paniagua Javier 2dbdb5b80f 2004-06-08 Gonzalo Paniagua Javier <[email protected]>
* System.Web.dll.sources: removed CSCompiler.cs

	* System.Web.Compilation/CSCompiler.cs: removed.

	* System.Web.Compilation/CachingCompiler.cs: language independent
	compilation for single files.

	* System.Web.UI/SimpleWebHandlerParser.cs:
	* System.Web.UI/TemplateParser.cs: pass the language when compiling from
	a file.

svn path=/trunk/mcs/; revision=29017
2004-06-08 06:20:11 +00:00
Gonzalo Paniagua Javier 2511627962 2004-06-08 Gonzalo Paniagua Javier <[email protected]>
* BaseCompiler.cs:
	* WebServiceCompiler.cs: adapted to the 'new' CachingCompiler.
	* CachingCompiler.cs: use HttpRuntime.Cache.

svn path=/trunk/mcs/; revision=29016
2004-06-08 05:50:09 +00:00
Anirban Bhattacharjee 643b535a94 a complete set positive tests for invoking event
svn path=/trunk/mcs/; revision=29015
2004-06-08 05:22:46 +00:00
Gonzalo Paniagua Javier b828b4c975 2004-06-08 Gonzalo Paniagua Javier <[email protected]>
* 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.

svn path=/trunk/mono/; revision=29014
2004-06-08 05:17:45 +00:00
Umadevi S e408112803 2004-06-08 Umadevi S <[email protected]>
* SqlGuid.cs - fixed bug 59420. Implemented CompareTo according to MSDN documenation

svn path=/trunk/mcs/; revision=29013
2004-06-08 04:45:30 +00:00
Miguel de Icaza f71a24e7b2 Sort
svn path=/trunk/mono/; revision=29012
2004-06-08 04:06:19 +00:00
Gonzalo Paniagua Javier 6117ef7c7a 2004-06-08 Gonzalo Paniagua Javier <[email protected]>
* SimpleWebHandlerParser.cs: if we have a global.asax, move its
	reference to the end to help mcs loading the assemblies. Fixes bug
	#58768.

	* TemplateParser.cs: same as above. Removed some kludges to workaround
	loading assemblies from bin path that are now in the runtime. Don't
	load the assemblies in bin if not needed, but still reference them
	when compiling.

svn path=/trunk/mcs/; revision=29010
2004-06-08 03:56:25 +00:00
Miguel de Icaza 9d8d381108 Disable 269 until #59750 is fixed
svn path=/trunk/mcs/; revision=29009
2004-06-08 03:46:35 +00:00
Martin Baulig 3678da8073 Improved this test a bit.
svn path=/trunk/mcs/; revision=29008
2004-06-08 03:08:24 +00:00
Martin Baulig 0c77e93acb Reflect latest API changes.
svn path=/trunk/mcs/; revision=29006
2004-06-08 02:58:31 +00:00
Martin Baulig 749271a2c6 2004-06-08 Martin Baulig <[email protected]>
* metadata.c (mono_metadata_signature_alloc): Default
	`sentinelpos' to -1.

	* reflection.c (mono_image_get_array_token): Likewise.

svn path=/trunk/mono/; revision=29005
2004-06-08 02:45:57 +00:00
Martin Baulig 3cd93d228c 2004-06-08 Martin Baulig <[email protected]>
* test-269.cs: New test for varargs methods.

svn path=/trunk/mcs/; revision=29004
2004-06-08 02:34:51 +00:00
Martin Baulig 7da009db81 2004-06-08 Martin Baulig <[email protected]>
* expression.cs (Invocation.EmitCall): Enable varargs methods.

svn path=/trunk/mcs/; revision=29003
2004-06-08 02:30:21 +00:00
Martin Baulig 735998cb27 2004-06-08 Martin Baulig <[email protected]>
* dump.c (dump_table_memberref): Added support for MethodDef
	parents.

svn path=/trunk/mono/; revision=29002
2004-06-08 02:28:45 +00:00
Martin Baulig d2d6aae795 Incremented version number.
svn path=/trunk/mcs/; revision=29001
2004-06-08 02:26:41 +00:00
Martin Baulig 1b05fa056c 2004-06-08 Martin Baulig <[email protected]>
* ILGenerator.cs (TokenGenerator.GetToken): Added overloaded
	version which takes a MethodInfo and a Type[].
	(IlGenerator.EmitCall): When emitting a call to a varargs method,
	use the new GetToken() to pass the optional argument types to the
	runtime.

	* ModuleBuilder.cs (ModuleBuilder.getMethodToken): New interncall.

svn path=/trunk/mcs/; revision=29000
2004-06-08 02:26:17 +00:00
Martin Baulig e62e8cad56 2004-06-08 Martin Baulig <[email protected]>
* 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.

svn path=/trunk/mono/; revision=28999
2004-06-08 02:23:00 +00:00
Duncan Mak 319a9f2994 Fix the brokeness that I introduced earlier
svn path=/trunk/mcs/; revision=28998
2004-06-08 00:30:41 +00:00
Duncan Mak 48eeb710ff * Exception.cs (Source): This can return null.
* ExceptionTest.cs: Added [Test] attributes to the test methods.
(InnerExceptionSource): Test that the InnerException's Source is
null unless it's been set.

svn path=/trunk/mcs/; revision=28997
2004-06-08 00:04:09 +00:00
Duncan Mak 02a60df845 Fix embarrassing typos.
svn path=/trunk/mcs/; revision=28996
2004-06-07 23:09:12 +00:00
Sebastien Pouliot f13be0a060 2004-06-07 Sebastien Pouliot <[email protected]>
* DateTime.cs: Fixed constructor to limit range of milliseconds from
	0,999. Fixed ToType method to work for object, string and DateTime.

svn path=/trunk/mcs/; revision=28995
2004-06-07 23:07:39 +00:00
Sebastien Pouliot 6a5c6409b9 2004-06-07 Sebastien Pouliot <[email protected]>
* DateTimeTest.cs: Added test cases for ToType (conversion) and
	contructors (milliseconds).

svn path=/trunk/mcs/; revision=28994
2004-06-07 23:05:01 +00:00
Duncan Mak 9eb61b41c6 * FileStream.cs (SetLength): The other exceptions have precendence
over ObjectDisposedException, which is not one of the exceptions
listed in the documentation). Also, instead of throwing an
ObjectDisposedException, throw an IOException.

* FileStreamTest.cs (SetLengthWithClosedBaseStream): New test for
checking that the correct exception is thrown when the base stream
is closed.

svn path=/trunk/mcs/; revision=28993
2004-06-07 22:24:05 +00:00
Lluis Sanchez 04f963e7ac * locales.c: Fixed memory leak in Char.ToLower/ToUpper.
svn path=/trunk/mono/; revision=28992
2004-06-07 21:56:33 +00:00
Martin Baulig 951854f640 2004-06-08 Martin Baulig <[email protected]>
* rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".

svn path=/trunk/mcs/; revision=28990
2004-06-07 21:41:54 +00:00
Jackson Harper 4983c84a37 * driver.cs: Add -check_refs option to check if all referenced
assemblies are stron named. Fix some pathing issues when create
	links for packaged. Update todds (C) info.

svn path=/trunk/mcs/; revision=28989
2004-06-07 20:47:56 +00:00
Miguel de Icaza 0d15631806 Flush
svn path=/trunk/mono/; revision=28988
2004-06-07 20:41:56 +00:00
Lluis Sanchez 996c280341 * LeaseManager.cs: In StopManager, nullify the timer variable before
disposing, since Dispose may abort the current thread.

svn path=/trunk/mcs/; revision=28986
2004-06-07 20:05:15 +00:00
Atsushi Eno 46ae83cb6b 2004-06-08 Atsushi Enomoto <[email protected]>
* culture-info-tables.h : Reflecting the latest locale-builder that
	  fixed empty array representation ({} to {0}).

svn path=/trunk/mono/; revision=28985
2004-06-07 19:44:36 +00:00
Atsushi Eno 5041fb195a 2004-06-08 Atsushi Enomoto <[email protected]>
* DateTimeFormatEntry.cs : Use "{0}" for empty array.

svn path=/trunk/mono/; revision=28984
2004-06-07 19:42:23 +00:00
Martin Baulig 5f2722c1ab 2004-06-07 Martin Baulig <[email protected]>
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.

svn path=/trunk/mcs/; revision=28983
2004-06-07 19:09:51 +00:00
Sebastien Pouliot 3860098f96 2004-06-07 Sebastien Pouliot <[email protected]>
* HttpContext.cs: User property now get/set Thread.CurrentPrincipal.
	Fix (at least partially) #59683.

svn path=/trunk/mcs/; revision=28981
2004-06-07 17:56:02 +00:00
Atsushi Eno 057b5cc83b 2004-06-07 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : Length check must be done only when the character
	  sequence is valid (i.e. should not check when it is overlongs).
	  See also TestThrowOnInvalid().

svn path=/trunk/mcs/; revision=28980
2004-06-07 17:54:23 +00:00
Atsushi Eno 8dcd4adc79 2004-06-07 Atsushi Enomoto <[email protected]>
* UTF8EncodingTest.cs : Added TestThrowOnInvalid().

svn path=/trunk/mcs/; revision=28979
2004-06-07 17:53:40 +00:00
Jackson Harper 176131d58d * 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.

svn path=/trunk/mono/; revision=28978
2004-06-07 17:51:30 +00:00
Sebastien Pouliot c685300076 2004-06-07 Sebastien Pouliot <[email protected]>
* DateTime.cs: Fixed FromFileTime for negative values.

svn path=/trunk/mcs/; revision=28977
2004-06-07 17:40:24 +00:00
Sebastien Pouliot 29ef6c0887 2004-06-07 Sebastien Pouliot <[email protected]>
* DateTimeTest.cs: Added test cases for FromFileTime.

svn path=/trunk/mcs/; revision=28976
2004-06-07 17:38:45 +00:00
Atsushi Eno 365aff1294 2004-06-07 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : Added Overlong check to InternalGetCharCount().

svn path=/trunk/mcs/; revision=28975
2004-06-07 17:35:49 +00:00
Sebastien Pouliot 371950d818 2004-06-07 Sebastien Pouliot <[email protected]>
* DateTime.cs: Fixed OLE Automation date conversions: timezone
	insensitive, wrong exception in FromOADate, handling of Min/Max
	values, negative doubles where integer part is negative but
	decimals are positive! Charming format ;-)

svn path=/trunk/mcs/; revision=28973
2004-06-07 16:42:58 +00:00
Sebastien Pouliot 610176186b 2004-06-07 Sebastien Pouliot <[email protected]>
* DateTimeTest.cs: Added new test cases for From|ToOADate (OLE
	Automation date format).

svn path=/trunk/mcs/; revision=28972
2004-06-07 16:38:29 +00:00
Zoltan Varga 73385f7638 2004-06-08 Zoltan Varga <[email protected]>
* reflection.c (mono_reflection_type_from_name): Make a copy of the
	type name before modifying it. Fixes #59405.

svn path=/trunk/mono/; revision=28971
2004-06-07 16:22:02 +00:00
Atsushi Eno 4d06f9db21 2004-06-08 Atsushi Enomoto <[email protected]>
* 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.

svn path=/trunk/mono/; revision=28970
2004-06-07 15:25:36 +00:00
Atsushi Eno b80bb48164 2004-06-08 Atsushi Enomoto <[email protected]>
* 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.

svn path=/trunk/mono/; revision=28969
2004-06-07 15:21:58 +00:00
Atsushi Eno 9f6d841887 2004-06-08 Atsushi Enomoto <[email protected]>
* 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.

svn path=/trunk/mono/; revision=28968
2004-06-07 15:19:26 +00:00
Atsushi Eno b01c7bf7e6 2004-06-07 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : Throw overlongs error only when throwOnInvalid is
	  true. Otherwise just ignore them.

svn path=/trunk/mcs/; revision=28966
2004-06-07 14:25:30 +00:00
Gonzalo Paniagua Javier 15101831e0 2004-06-07 Gonzalo Paniagua Javier <[email protected]>
* System.Web.dll.sources: removing ServerVariablesCollection. It does
	not compile.

	* System.Web/HttpRequest.cs: reverting patch from Alon Gazit. Uses the
	above file that doesn't compile.

svn path=/trunk/mcs/; revision=28965
2004-06-07 14:10:06 +00:00
Gonzalo Paniagua Javier bdc9cd0b33 2004-06-07 Gonzalo Paniagua Javier <[email protected]>
* XmlInputStream.cs: Initialize reads a larger buffer now when trying
	to guess the encoding.

svn path=/trunk/mcs/; revision=28964
2004-06-07 13:52:46 +00:00
Raja R Harinath 78f6c7b235 testcase from 59477
svn path=/trunk/mcs/; revision=28962
2004-06-07 12:35:11 +00:00
Raja R Harinath 1b0107aba9 * cs0038-2.cs: New test, from bug #59477.
* mcs-expect-wrong-error: Add cs0038-1.

svn path=/trunk/mcs/; revision=28961
2004-06-07 12:34:15 +00:00
Alon Gazit 7412e7bb11 this implementation is using a lazy loading mechanism for the server variables.
svn path=/trunk/mcs/; revision=28959
2004-06-07 12:11:06 +00:00
Alon Gazit 95ee9bf391 fixed ParseServerVariables().
using the new implementation of ServerVariablesCollection.

svn path=/trunk/mcs/; revision=28958
2004-06-07 12:10:01 +00:00
Alon Gazit ad0b04add4 added ServerVariablesCollection.
svn path=/trunk/mcs/; revision=28957
2004-06-07 11:55:02 +00:00
Alon Gazit 8a5e2b7bcf using cache to get performance improvement.
svn path=/trunk/mcs/; revision=28956
2004-06-07 11:40:32 +00:00
Alon Gazit 476dc8a213 Changed Page.ProcessPostData().
After the change ,the state of controls that aren't visible is saved
during a postback.

svn path=/trunk/mcs/; revision=28955
2004-06-07 11:24:04 +00:00
Anirban Bhattacharjee e5b875d24b few event related test cases
svn path=/trunk/mcs/; revision=28954
2004-06-07 11:00:34 +00:00
Anirban Bhattacharjee dfb5fd35c3 * mb-parser.jay: Resolved the problem in Sub statement with Handles clause
* class.cs: Added a AddEventHandler function and a EventHandler readonly property. Also modified define of constructor to accommodate Handles clause.
                    If one initialize a event handler as
                        Sub Handler() Handles x.Event
                    The handler will be initialized by the constructor of the corresponding class by calling AddHandler.

svn path=/trunk/mcs/; revision=28953
2004-06-07 10:45:27 +00:00
Jambunathan K a44a9a40ed Created new resource bundlr for VB errors. Implemented almost nearly
fully the Microsoft.VisualBasic.Information class.

svn path=/trunk/mcs/; revision=28950
2004-06-07 08:44:52 +00:00
Zoltan Varga a43fb9484a 2004-06-08 Zoltan Varga <[email protected]>
* icall.c (ves_icall_Type_GetEvents_internal): Handle the case when
	the event has no add and remove methods. Fixes #59629.

svn path=/trunk/mono/; revision=28949
2004-06-07 08:10:18 +00:00
Atsushi Eno a4e5ec25e0 2004-06-07 Atsushi Enomoto <[email protected]>
* RncParser.jay : removed unused code. Fixed LookupNamespace() to
	  pass atomized name always.

svn path=/trunk/mcs/; revision=28948
2004-06-07 07:57:42 +00:00
Gonzalo Paniagua Javier aa47cc4f03 2004-06-07 Gonzalo Paniagua Javier <[email protected]>
* TraceData.cs: fixes nullref in an application that relies on
	r ["Message"] not being null. Closes bug #59679.

svn path=/trunk/mcs/; revision=28946
2004-06-07 04:54:11 +00:00
Gonzalo Paniagua Javier 1ea661c0ad 2004-06-07 Gonzalo Paniagua Javier <[email protected]>
* xmltest.cs: directory name of extracted test cases is lower case.

svn path=/trunk/mcs/; revision=28945
2004-06-07 04:44:26 +00:00
Miguel de Icaza 13f69a2002 2004-06-07 Miguel de Icaza <[email protected]>
* 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.

svn path=/trunk/mcs/; revision=28944
2004-06-07 04:10:19 +00:00
Gonzalo Paniagua Javier 8d79b5bec0 2004-06-07 Gonzalo Paniagua Javier <[email protected]>
* Page.cs: removed obsolete MonoTODO from RegisterOnSubmitStatement.

svn path=/trunk/mcs/; revision=28943
2004-06-07 04:08:16 +00:00
Gonzalo Paniagua Javier ab45d4c0f3 2004-06-07 Gonzalo Paniagua Javier <[email protected]>
* HttpCachePolicy.cs: implemented SetAllowResponseInBrowserHistory.

svn path=/trunk/mcs/; revision=28942
2004-06-07 03:46:57 +00:00
Gonzalo Paniagua Javier a2ae0c940e 2004-06-07 Gonzalo Paniagua Javier <[email protected]>
* HttpRuntime.cs: implemented a 5 simple properties that were TODOs.

svn path=/trunk/mcs/; revision=28941
2004-06-07 01:21:33 +00:00
Gonzalo Paniagua Javier 030c406856 2004-06-07 Gonzalo Paniagua Javier <[email protected]>
* Calendar.cs: implemented OnPreRender and HasWeekSelectors.

svn path=/trunk/mcs/; revision=28940
2004-06-07 00:36:36 +00:00
Sebastien Pouliot c93f8968d4 2004-06-06 Sebastien Pouliot <[email protected]>
* String.cs: Fixed Join in case separator parameter is null.
	* TimeSpan.cs: Cache format errors during parsing and throw
	FormatException only if there was no overflow.

svn path=/trunk/mcs/; revision=28939
2004-06-07 00:03:37 +00:00
Sebastien Pouliot 7418f812b2 2004-06-06 Sebastien Pouliot <[email protected]>
* TimeSpanTest.cs: Added test to verify exception order when a parsed
	string is both invalid (format) and contains an overflow.

svn path=/trunk/mcs/; revision=28938
2004-06-06 23:55:05 +00:00
Gonzalo Paniagua Javier a952b3414f 2004-06-07 Gonzalo Paniagua Javier <[email protected]>
* System.Web/HttpBrowserCapabilities.cs: implemented ClrVersion and
	GetClrVersions.

	* System.Web.Configuration/HttpCapabilitiesBase.cs: set the useragent
	of the new HttpBrowserCapabilities object.

	* System.Web/HttpException.cs: removed MonoTODO.

svn path=/trunk/mcs/; revision=28936
2004-06-06 23:18:11 +00:00
Gonzalo Paniagua Javier 32f421da00 2004-06-07 Gonzalo Paniagua Javier <[email protected]>
* AcceptEncodingModule.cs: don't cause nullref if there's no
	<mono.aspnet> section and the module is loaded.

svn path=/trunk/mcs/; revision=28935
2004-06-06 23:05:48 +00:00
Gonzalo Paniagua Javier 1f0785be03 2004-06-06 Gonzalo Paniagua Javier <[email protected]>
* System/String.cs: Concat (params (string|object) []) now uses
	InternalJoin instead of InternalAllocateStr + InternalStrcpy.
	* Test/System/StringTest.cs: added test for Concat (params) overrides.

svn path=/trunk/mcs/; revision=28932
2004-06-06 20:11:18 +00:00
Atsushi Eno fbd34f4d08 2004-06-06 Atsushi Enomoto <[email protected]>
* XmlDataDocument.cs :
	  - It was not handling SimpleContent. This fixes bug #56951.
	  - It was not converting values into DataType of the DataColumn.

svn path=/trunk/mcs/; revision=28931
2004-06-06 20:08:18 +00:00
Atsushi Eno c9076f36ed 2004-06-06 Atsushi Enomoto <[email protected]>
* XmlSchemaDataImporter.cs : We should fill Namespace for DataTable.

svn path=/trunk/mcs/; revision=28923
2004-06-06 19:49:38 +00:00
Sebastien Pouliot 2936c54e67 2004-06-06 Sebastien Pouliot <[email protected]>
* String.cs: Fixed Join in case separator parameter is null.

svn path=/trunk/mcs/; revision=28919
2004-06-06 18:40:32 +00:00
Sebastien Pouliot bab2504ace 2004-06-06 Sebastien Pouliot <[email protected]>
* StringTest.cs: Added more cases for Join (null separator and null
	values).

svn path=/trunk/mcs/; revision=28918
2004-06-06 18:33:45 +00:00
Gonzalo Paniagua Javier 1ec601054f removed ^M added in the last patch
svn path=/trunk/mcs/; revision=28917
2004-06-06 18:03:54 +00:00
Gert Driesen 73fe091819 * MonoCustomAttrs.cs: fixed issue where an empty array was
returned when GetCustomAttributes was invoked with null
attribute type and there was only one result

svn path=/trunk/mcs/; revision=28916
2004-06-06 17:52:35 +00:00
Gonzalo Paniagua Javier 671f8b5ce6 2004-06-06 Gonzalo Paniagua Javier <[email protected]>
* ChunkStream.cs: added ChunkLeft property.
	* WebConnection.cs:
	(EndRead): when using small byte arrays to read from a chunked stream,
	ensure we've read the chunk size and try to fulfill the request
	completely. fixes bug 59653.

svn path=/trunk/mcs/; revision=28915
2004-06-06 17:41:06 +00:00
Sebastien Pouliot 289f6cd0cc 2004-06-06 Sebastien Pouliot <[email protected]>
* Int16.cs: Fixed ToString(String.Empty) to default ("G").
	* Int32.cs: Fixed ToString(String.Empty) to default ("G").
	* Int64.cs: Fixed ToString(String.Empty) to default ("G").
	* SByte.cs: Fixed ToString(String.Empty) to default ("G").
	* UInt16.cs: Fixed ToString(String.Empty) to default ("G").
	* UInt32.cs: Fixed ToString(String.Empty) to default ("G").
	* UInt64.cs: Fixed ToString(String.Empty) to default ("G").

svn path=/trunk/mcs/; revision=28914
2004-06-06 15:13:39 +00:00
Jambunathan K f333b37b79 Added test case for exercising Regex.Unescape()
Added test cases for exercising \b as a word boundary operator
and as a character class in a regex. Refer bug #58256 for more
information.

svn path=/trunk/mcs/; revision=28913
2004-06-06 15:08:34 +00:00
Jambunathan K 793a40c310 Fixed issues with Regex.Unescape() identified as part of
debugging bug #58256. The original problem reported was about
inconsistency between the way we treat replacement patterns and the
way microsoft treats the replacement patterns in Regex.Replace(). MS
implementation is buggy and doesn't honour escape sequences in the
replacement patterns, even though the SDK claims otherwise.

svn path=/trunk/mcs/; revision=28912
2004-06-06 15:01:33 +00:00
Sebastien Pouliot bcca5ac74e 2004-06-06 Sebastien Pouliot <[email protected]>
* ByteTest.cs: Added tests for default ToString(String.Empty).
	* DoubleTest.cs: Added tests for default ToString(String.Empty).
	* Int16Test.cs: Added tests for default ToString(String.Empty).
	* Int32Test.cs: Added tests for default ToString(String.Empty).
	* Int64Test.cs: Added tests for default ToString(String.Empty).
	* SByteTest.cs: Added tests for default ToString(String.Empty).
	* SingleTest.cs: Added tests for default ToString(String.Empty).
	* UInt16Test.cs: Added tests for default ToString(String.Empty).
	* UInt32Test.cs: Added tests for default ToString(String.Empty).
	* UInt64Test.cs: Added tests for default ToString(String.Empty).

svn path=/trunk/mcs/; revision=28911
2004-06-06 14:59:03 +00:00
Atsushi Eno d4e8a093ba 2004-06-06 Atsushi Enomoto <[email protected]>
* XmlTextWriterTests.cs : Added indentation testcase (it might now
	  work due to CompareInfo.IndexOf() bug).

svn path=/trunk/mcs/; revision=28910
2004-06-06 14:50:43 +00:00
Atsushi Eno adfc9a4885 2004-06-06 Atsushi Enomoto <[email protected]>
* XmlSchema.cs : Make sure to close url-based XmlTextReader.

svn path=/trunk/mcs/; revision=28909
2004-06-06 14:48:43 +00:00
Atsushi Eno fc44269092 2004-06-06 Atsushi Enomoto <[email protected]>
* NameTable.cs : Fixed incorrect hash computation. Thanks to Ben.
	* XmlTextWriter.cs : Fixed remaining LookupNamespace() atom problem
	  shown in xslt standalone tests.

svn path=/trunk/mcs/; revision=28908
2004-06-06 14:47:11 +00:00
Sebastien Pouliot e4a5eaac12 2004-06-06 Sebastien Pouliot <[email protected]>
* Decimal.cs: Fixed ToString(String.Empty) to default ("G").

svn path=/trunk/mcs/; revision=28907
2004-06-06 14:10:29 +00:00
Sebastien Pouliot a869fea963 2004-06-06 Sebastien Pouliot <[email protected]>
* DecimalTest.cs: Added tests for default ToString(). Added tests when
	Decimal is casted to an integer (trunc not rounded). Added tests to
	parse very small values (#59301).

svn path=/trunk/mcs/; revision=28906
2004-06-06 14:09:04 +00:00
Atsushi Eno f6acd54635 2004-06-06 Atsushi Enomoto <[email protected]>
* XmlTextWriter.cs : Improved indenting. For children of a mixed
	  content element, it won't be indented.

svn path=/trunk/mcs/; revision=28905
2004-06-06 10:57:08 +00:00
Atsushi Eno 2f1251e81a 2004-06-06 Atsushi Enomoto <[email protected]>
* XmlDsigXsltTransformTest.cs : Fixed EmbeddedStylesheet() that missed
	  xmlns:xsl declaration.

svn path=/trunk/mcs/; revision=28904
2004-06-06 07:41:18 +00:00
Atsushi Eno acfe8b01c4 2004-06-06 Atsushi Enomoto <[email protected]>
* MsxslScriptTests.cs : Namespace are required (found on fixing
	  XmlTextReader's namespace bugfix).

svn path=/trunk/mcs/; revision=28903
2004-06-06 07:37:24 +00:00
Atsushi Eno 10ba91fbfa 2004-06-06 Atsushi Enomoto <[email protected]>
* XmlTextReaderTests.cs : added some namespace check tests.

svn path=/trunk/mcs/; revision=28902
2004-06-06 07:36:19 +00:00
Atsushi Eno 98c0f22bb9 2004-06-06 Atsushi Enomoto <[email protected]>
* XPathDocument.s : The previous patch is still incomplete to close.

svn path=/trunk/mcs/; revision=28901
2004-06-06 07:34:53 +00:00
Atsushi Eno c818d765cf 2004-06-06 Atsushi Enomoto <[email protected]>
* DTDObjectModel.cs,
	  XmlDocument.cs : Close stream always.
	* XmlNodeReader.cs : don't expect atomized name in LookupNamespace().
	* XmlTextReader.cs : Namespace has was not done. Some tests depends on
	  this failure and to be fixed.

svn path=/trunk/mcs/; revision=28900
2004-06-06 07:32:59 +00:00
Atsushi Eno 7105385bbb 2004-06-06 Atsushi Enomoto <[email protected]>
* XslTransformProcessor.cs : On document() function, close the
	  XmlTextReader opened from uri string.

svn path=/trunk/mcs/; revision=28899
2004-06-06 07:29:20 +00:00
Atsushi Eno 72586a446b 2004-06-06 Atsushi Enomoto <[email protected]>
* DTMXPathDocumentBuilder.cs : Close XmlTextReader strictly. It might
	  raise an error after opening stream and before try-catch.

svn path=/trunk/mcs/; revision=28898
2004-06-06 07:28:04 +00:00
Atsushi Eno 3558a83ed9 2004-06-06 Atsushi Enomoto <[email protected]>
* XsdValidatingReader.cs : Close XmlTextReader more strictly. Exception
	  might be thrown in ctor() *after* stream open and before try-catch.

svn path=/trunk/mcs/; revision=28897
2004-06-06 07:26:41 +00:00
Sebastien Pouliot f3f5b554d8 2004-06-05 Sebastien Pouliot <[email protected]>
* X509CertificateCollection.cs: Fixed Contains which works by value
	(i.e. not by object reference). Fixed Remove for null and unexisting
	elements.

svn path=/trunk/mcs/; revision=28896
2004-06-06 01:17:41 +00:00
Sebastien Pouliot 8d8eeb9459 2004-06-05 Sebastien Pouliot <[email protected]>
* System_test.dll.sources: Added X509CertificateCollectionTest
	to the unit tests.

svn path=/trunk/mcs/; revision=28895
2004-06-06 01:07:18 +00:00
Sebastien Pouliot 6d6d4ec087 2004-06-05 Sebastien Pouliot <[email protected]>
* X509CertificateCollectionTest.cs: New. Unit tests for
	X509CertificateCollection.

svn path=/trunk/mcs/; revision=28894
2004-06-06 01:05:41 +00:00
Miguel de Icaza 24dfe2824d 2004-06-05 Miguel de Icaza <[email protected]>
* gacutil.cs: GetAssemblyInfo might return null now, check for
	that.

	Add try/catch to GetAssemblyInfo.

svn path=/trunk/mcs/; revision=28892
2004-06-06 00:11:26 +00:00
Sebastien Pouliot a897118880 2004-06-05 Sebastien Pouliot <[email protected]>
* HybridDictionary.cs: Fixed Contains for null argument.
	* NameValueCollection.cs: Fixed Set to remove existing values. Fixed
	Add(NVC) to throw same exception as MS implementation.

svn path=/trunk/mcs/; revision=28891
2004-06-05 23:50:40 +00:00
Sebastien Pouliot d497ff12cd 2004-06-05 Sebastien Pouliot <[email protected]>
* HybridDictionaryTest.cs: Added cases with an empty diectionary.
	* NameValueCollectionTest.cs: Added tests to add and replace (set)
	existing values in collection. Added tests for CopyTo.

svn path=/trunk/mcs/; revision=28890
2004-06-05 23:47:06 +00:00
Duncan Mak ee726d601b Add section for Fedora Core 2.
svn path=/trunk/mono/; revision=28889
2004-06-05 22:37:45 +00:00
Miguel de Icaza 6787d64a8f fix
svn path=/trunk/mono/; revision=28888
2004-06-05 20:49:56 +00:00
Sebastien Pouliot 1b53e7d2a9 2004-06-05 Sebastien Pouliot <[email protected]>
* Convert.cs: Fixed the convertion of negative integers (byte, short,
	int and long) into string in a specific base (2, 8, 10 or 16).

svn path=/trunk/mcs/; revision=28887
2004-06-05 20:14:54 +00:00
Sebastien Pouliot 0cfc23582f 2004-06-05 Sebastien Pouliot <[email protected]>
* object.c: Fixed possible integer overflow when allocating large
	strings.

svn path=/trunk/mono/; revision=28886
2004-06-05 19:16:29 +00:00
Atsushi Eno 6f3196bbc7 2004-06-05 Atsushi Enomoto <[email protected]>
* culture-info-tables.h: reflecting locale-builder updates.

svn path=/trunk/mono/; revision=28885
2004-06-05 18:41:35 +00:00
Duncan Mak 1c790e92b8 Take out redundant gtk# listing.
svn path=/trunk/mono/; revision=28884
2004-06-05 18:19:01 +00:00
Atsushi Eno 9ce031fc08 2004-06-05 Atsushi Enomoto <[email protected]>
* en_US.xml : fixed percent pattern.
	* en_ZA.xml : fixed NumberDecimalDigits.
	* id_ID.xml : fixed CurrencyDecimalDigits.
	* ja_JP.xml : added currencySymbol (MS assigns 0x5c).

svn path=/trunk/mono/; revision=28880
2004-06-05 17:37:08 +00:00
Atsushi Eno 8d1b281523 2004-06-05 Atsushi Enomoto <[email protected]>
* 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).

svn path=/trunk/mono/; revision=28879
2004-06-05 17:36:35 +00:00
Gonzalo Paniagua Javier 07f363f435 2004-06-05 Gonzalo Paniagua Javier <[email protected]>
* Page.cs: IsPostBack also returns true when method is GET and we have
	viewstate information in the query string. Fixes bug #58151.

svn path=/trunk/mcs/; revision=28876
2004-06-05 16:06:00 +00:00
Gonzalo Paniagua Javier 1f19ce5b39 2004-06-05 Gonzalo Paniagua Javier <[email protected]>
* SocketTest.cs: added test for Select with empty lists. Changed the
	'bogus' address of EndConnect test.

svn path=/trunk/mcs/; revision=28875
2004-06-05 15:55:37 +00:00
Gonzalo Paniagua Javier 042a08443a 2004-06-05 Gonzalo Paniagua Javier <[email protected]>
* System.Web/TraceContext.cs: don't check if HttpRuntime.TraceManager
	is enabled when writing.

	* System.Web.Compilation/PageCompiler.cs: fixed Trace and add support
	for Buffer.

	* System.Web.UI/Page.cs: removed obsolete TODO. Only check if Trace is
	enabled, not HttpRutime.TraceManager.

	* System.Web.UI/PageParser.cs: for 'trace' we have 2 variables now.
	Added support for 'buffer' attribute.

	Fixes bug #58481.

svn path=/trunk/mcs/; revision=28873
2004-06-05 15:47:26 +00:00
Atsushi Eno 59ab65d504 2004-06-05 Atsushi Enomoto <[email protected]>
* culture-info-tables.h: reflecting locale-builder updates.

svn path=/trunk/mono/; revision=28872
2004-06-05 15:43:40 +00:00
Atsushi Eno 3ced5a2d49 2004-06-05 Atsushi Enomoto <[email protected]>
* 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.

svn path=/trunk/mono/; revision=28871
2004-06-05 15:41:40 +00:00
Atsushi Eno 6f7c7183a5 2004-06-05 Atsushi Enomoto <[email protected]>
* 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.

svn path=/trunk/mono/; revision=28870
2004-06-05 15:39:24 +00:00
Sebastien Pouliot 4e222e016d 2004-06-05 Sebastien Pouliot <[email protected]>
* ConvertTest.cs: Added tests to convert min/max values of integer
	types to strings in all bases.
	* SByteTest.cs: Added test to parse min/max values.

svn path=/trunk/mcs/; revision=28869
2004-06-05 15:36:07 +00:00
Miguel de Icaza 8fde15460e Update
svn path=/trunk/mono/; revision=28868
2004-06-05 15:23:49 +00:00
Atsushi Eno 58eb97f902 2004-06-03 Atsushi Enomoto <[email protected]>
* Driver.cs : Let's ignore DTD that takes most of the running time.

svn path=/trunk/mono/; revision=28867
2004-06-05 15:19:23 +00:00
Gonzalo Paniagua Javier eea376f6d4 2004-06-05 Gonzalo Paniagua Javier <[email protected]>
* monoresgen.cs: fixed format exception in the po reader.

svn path=/trunk/mcs/; revision=28865
2004-06-05 15:07:10 +00:00
Gonzalo Paniagua Javier 552b3e2465 2004-06-05 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: throw ArgumentNullException if all the list are null OR
	empty. Fixes bug #59632.

svn path=/trunk/mcs/; revision=28864
2004-06-05 14:08:42 +00:00
Paolo Molaro 708cf2a532 Sat Jun 5 16:32:33 CEST 2004 Paolo Molaro <[email protected]>
* iltests.il, mini.c: fixed bug#59580 in branch optimization.
	* exceptions.cs: make it compile with new mcs/csc.

svn path=/trunk/mono/; revision=28863
2004-06-05 13:47:16 +00:00
Atsushi Eno 537f8cdcfd 2004-06-05 Atsushi Enomoto <[email protected]>
* Makefile: added target run-test-ondotnet.

svn path=/trunk/mcs/; revision=28862
2004-06-05 12:47:03 +00:00
Gonzalo Paniagua Javier 49ee4cdcf5 revert
svn path=/trunk/mono/; revision=28861
2004-06-05 10:42:37 +00:00
Atsushi Eno f68fd091c5 2004-06-05 Atsushi Enomoto <[email protected]>
* XPathDocument.cs : close self-opened XmlTextReader in .ctor().

svn path=/trunk/mcs/; revision=28860
2004-06-05 08:55:21 +00:00
Gonzalo Paniagua Javier ceb2d47dbb 2004-06-05 Gonzalo Paniagua Javier <[email protected]>
* Binder.cs: don't crash when we have a 'null' argument Type array.
	Allow it for non-value types. Fixed for both, methods and properties.
	Closes bug #58846.

svn path=/trunk/mcs/; revision=28859
2004-06-05 06:36:12 +00:00
Gonzalo Paniagua Javier ed4e55f405 2004-06-05 Gonzalo Paniagua Javier <[email protected]>
* BinderTests.cs: added test for null type in the argument list.

svn path=/trunk/mcs/; revision=28858
2004-06-05 06:31:53 +00:00
Gonzalo Paniagua Javier e6c1f1a629 2004-06-05 Gonzalo Paniagua Javier <[email protected]>
* Calendar.cs: set the title class attribute if we have it. Fixes bug
	53671.

svn path=/trunk/mcs/; revision=28857
2004-06-05 05:59:21 +00:00
Miguel de Icaza b01c679b50 Flush
svn path=/trunk/mono/; revision=28856
2004-06-05 04:20:14 +00:00
Miguel de Icaza e68186a7a4 Try this
svn path=/trunk/mono/; revision=28855
2004-06-05 03:10:24 +00:00
Gonzalo Paniagua Javier ed2667ce2a windows installer is only for win2k and above
svn path=/trunk/mono/; revision=28854
2004-06-05 02:57:20 +00:00
Gonzalo Paniagua Javier c51e1dc747 2004-06-05 Gonzalo Paniagua Javier <[email protected]>
* icall.c: fixed nullref in ves_icall_type_from_name.

svn path=/trunk/mono/; revision=28852
2004-06-05 02:44:38 +00:00
Martin Baulig 07d67f2184 We always need to do this check before calling reflection.
svn path=/trunk/mcs/; revision=28850
2004-06-04 22:12:41 +00:00
Martin Baulig 7312ebdf8a Ignore inflated methods.
svn path=/trunk/mcs/; revision=28847
2004-06-04 19:42:02 +00:00
Martin Baulig 7873e0392f A type parameter can never be optional.
svn path=/trunk/mcs/; revision=28846
2004-06-04 19:37:26 +00:00
Sebastien Pouliot 8dde8bd51f 2004-06-04 Sebastien Pouliot <[email protected]>
* Math.cs: Fixed IEEERemainder to return -0 (0x8000000000000000) when
	the dividend is negative and the result is 0 (remainder).

svn path=/trunk/mcs/; revision=28845
2004-06-04 17:09:16 +00:00
Sebastien Pouliot 245208ba59 2004-06-04 Sebastien Pouliot <[email protected]>
* MathTest.cs: Added another case when dividend is negative and
	there's no remainder (must return negative 0).

svn path=/trunk/mcs/; revision=28844
2004-06-04 16:57:59 +00:00
Sebastien Pouliot e73c7c945f 2004-06-04 Sebastien Pouliot <[email protected]>
* MathTest.cs: Added case to check for negative 0 (double) in
	IEEERemainder.
	* TimeSpanTest.cs: Added more asserts in existing tests cases.
	Added case to check for ToString with MinValue and MaxValue.

svn path=/trunk/mcs/; revision=28840
2004-06-04 16:36:39 +00:00
Jackson Harper 450a82cc05 * ILTokenizer.cs: Handle comments first, handle whitespace in hex
blocks properly.

svn path=/trunk/mcs/; revision=28838
2004-06-04 16:17:20 +00:00
Jackson Harper 50fcab4ce2 * Driver.cs: Do everything using the invariant culture.
svn path=/trunk/mcs/; revision=28837
2004-06-04 16:12:38 +00:00
Atsushi Eno d5a5f5ad9a 2004-06-04 Atsushi Enomoto <[email protected]>
* SignedXml.cs : Complete fix for bug #59545. Support #xpointer(id()).
	  Namespace fixup is required when signing prefixed xml.

svn path=/trunk/mcs/; revision=28835
2004-06-04 12:40:01 +00:00
Anirban Bhattacharjee 55b41cc1b5 * mb-parser.jay: Modified WithEvents grammar
svn path=/trunk/mcs/; revision=28831
2004-06-04 11:19:17 +00:00
Atsushi Eno 493c8f7793 2004-06-04 Atsushi Enomoto <[email protected]>
* Makefile : fixed incorrectly unified corlib-plattest in the
	  previous fix.

svn path=/trunk/mcs/; revision=28830
2004-06-04 10:57:21 +00:00
Sebastien Pouliot c8809a359f 2004-06-04 Sebastien Pouliot <[email protected]>
* corlib_test.dll.sources: Added new file for unit tests.

svn path=/trunk/mcs/; revision=28829
2004-06-04 10:34:09 +00:00
Sachin Kumar 542d5dc43d TODOAttribute.cs: Definition for 'Comment' was defined twice
svn path=/trunk/mcs/; revision=28828
2004-06-04 10:20:43 +00:00
Lluis Sanchez bac90292d1 * Makefile: Changed nunit dll, to make it easier to integrate in the result
web page.
	* wstest.cs: Little fix.

svn path=/trunk/mcs/; revision=28827
2004-06-04 09:23:43 +00:00
Anirban Bhattacharjee 06591e52cf updated test.sources
svn path=/trunk/mcs/; revision=28826
2004-06-04 08:30:35 +00:00
Anirban Bhattacharjee c8ceeb60db more negetive tests for property
svn path=/trunk/mcs/; revision=28825
2004-06-04 08:29:47 +00:00
Atsushi Eno a966e4e229 2004-06-04 Atsushi Enomoto <[email protected]>
* SignedXml.cs : Fix for bug #59545. Handle #xpointer(/) as document.

svn path=/trunk/mcs/; revision=28824
2004-06-04 08:23:43 +00:00
Anirban Bhattacharjee 23dcf44ab3 * class.cs: - NotOverridable modifier support added to Property
- Few overriding related checks put on Property

svn path=/trunk/mcs/; revision=28823
2004-06-04 08:18:23 +00:00
Gert Driesen e97839f916 * mono-api-info.cs: for checking API compatibility, we're only
interested in public interfaces that are implemented by a given
type.  Include protected internal fields and ctors.

svn path=/trunk/mcs/; revision=28821
2004-06-04 05:46:24 +00:00
Gert Driesen 1517677e7f * SqlClientPermission.cs: removed extra CreateInstance
method

svn path=/trunk/mcs/; revision=28820
2004-06-04 05:36:15 +00:00
Gert Driesen bd31f019bb * OleDbDataAdapter.cs: added stub for missing
Dispose override

svn path=/trunk/mcs/; revision=28819
2004-06-04 05:35:48 +00:00
Gert Driesen 58557e401c * OdbcPermission.cs: moved Obsolete attribute to correct
ctor

svn path=/trunk/mcs/; revision=28818
2004-06-04 05:35:23 +00:00
Gert Driesen 76306c9a15 * DataAdapter.cs: added missing protected ctor
* DbDataAdapter.cs: added stub for missing protected ctor
* DbDataPermission.cs: added stubs for missing protected
ctors, added stub for missing Clear method

svn path=/trunk/mcs/; revision=28817
2004-06-04 05:34:58 +00:00
Gert Driesen 8ab8dabc37 * Constraint.cs: marked methods internal to fix public API
* ConstraintCollection.cs: to fix public API, use
DataTable.fInitInProgress to check whether initialization
of DataTable is in progress
* DataColumn.cs: added stubs for missing methods
* DataRowBuilder.cs: marked Table property internal to
fix public API
* DataSet.cs: removed extra empty destructor, marked
OnMergeFailed internal to fix public API
* DataTable.cs: use fInitInProgress field to hold init
status, to match MS.NET
* DataView.cs: added missing attributes on IsOpen

svn path=/trunk/mcs/; revision=28816
2004-06-04 05:34:25 +00:00
Anirban Bhattacharjee 2b6d46ff29 * decl.cs: Check for duplicate member name within same container
svn path=/trunk/mcs/; revision=28814
2004-06-04 04:36:34 +00:00
Gonzalo Paniagua Javier e404b1b70d 2004-06-04 Gonzalo Paniagua Javier <[email protected]>
* System.Web/HttpRequest.cs: added ClientTarget internal property.

	* System.Web.Compilation/PageCompiler.cs: override CreateConstructor
	to add assignment for ClientTarget.

	* System.Web.Configuration/HttpCapabilitiesBase.cs: ClientTarget takes
	precedence over UserAgent.

	* System.Web.UI/Page.cs: implemented ClientTarget.
	* System.Web.UI/PageParser.cs: support for clientTarget and check for
	validity.

svn path=/trunk/mcs/; revision=28811
2004-06-04 04:01:07 +00:00
Anirban Bhattacharjee b0cc28fb7e * class.cs: changed exception number in event grammar
svn path=/trunk/mcs/; revision=28810
2004-06-04 04:00:09 +00:00
Gonzalo Paniagua Javier d371fc1c0a added system.web/clientTarget handler
svn path=/trunk/mono/; revision=28809
2004-06-04 03:52:38 +00:00
Sebastien Pouliot 02520e0ba8 2004-06-03 Sebastien Pouliot <[email protected]>
* Delegate.cs: Fix the NullReferenceException in Combine(Delegate[]).

svn path=/trunk/mcs/; revision=28807
2004-06-04 02:16:39 +00:00
Gonzalo Paniagua Javier e9232610a0 2004-06-04 Gonzalo Paniagua Javier <[email protected]>
* Style.cs: added SetBit.

svn path=/trunk/mcs/; revision=28806
2004-06-04 01:57:37 +00:00
Gonzalo Paniagua Javier 48115ec345 2004-06-04 Gonzalo Paniagua Javier <[email protected]>
* mono-api-diff.cs: fixes event diff when we're missing attributes. Now
	the class status properly shows the attributes under the event.

	* mono-api-info.cs: include protected internal methods.

svn path=/trunk/mcs/; revision=28805
2004-06-04 01:17:07 +00:00
Sebastien Pouliot d6d922a7bf 2004-06-03 Sebastien Pouliot <[email protected]>
* BufferedStreamTest.cs: Modified two tests (using newer helper
	classes) to be more specific and avoid regressions of bugs like
	 #59534.
	* StreamHelperTest.cs: New. Helper classes that provides read-only,
	write-only or non-seekable stream.

svn path=/trunk/mcs/; revision=28804
2004-06-04 01:16:39 +00:00
Martin Baulig d8279f3afc Moved the marker.
svn path=/trunk/mcs/; revision=28803
2004-06-04 00:46:37 +00:00
Martin Baulig e48cdde6c7 **** Merged from MCS ****
svn path=/trunk/mcs/; revision=28802
2004-06-04 00:45:05 +00:00
Martin Baulig 9bf050c846 Put everything back I reverted with the "Reverted everything back until 14:15 this afternoon." commit.
svn path=/trunk/mcs/; revision=28801
2004-06-04 00:00:22 +00:00
Jackson Harper 662104f9ae * PEAPI.cs: Do not null terminate byte arrays when writing to the
blob stream.

svn path=/trunk/mcs/; revision=28797
2004-06-03 21:53:25 +00:00
Atsushi Eno 1cab6db759 2004-06-03 Atsushi Enomoto <[email protected]>
* culture-info-tables.h: reflecting locale-builder updates.

svn path=/trunk/mono/; revision=28795
2004-06-03 21:33:48 +00:00
Atsushi Eno 47444acbd5 2004-06-03 Atsushi Enomoto <[email protected]>
* fr_CH.xml : missing updates.

svn path=/trunk/mono/; revision=28794
2004-06-03 21:28:23 +00:00
Atsushi Eno 9217f85350 2004-06-03 Atsushi Enomoto <[email protected]>
* Driver.cs : {3} is the almost default number for group digits.

svn path=/trunk/mono/; revision=28793
2004-06-03 21:27:21 +00:00
Atsushi Eno e6af507b9f 2004-06-03 Atsushi Enomoto <[email protected]>
* DataSet.cs : Use NameTable.Get() before calling LookupNamespace()
	  in XmlNamespaceManager.

svn path=/trunk/mcs/; revision=28792
2004-06-03 21:12:23 +00:00
Atsushi Eno a29d95c9e9 2004-06-03 Atsushi Enomoto <[email protected]>
* Expression.cs : LookupNamespace() only allows already-atomized names.
	* XPathEditableNavigator.cs : removed incorrect set_OuterXml() and
	  set_InnerXml().

svn path=/trunk/mcs/; revision=28791
2004-06-03 21:05:17 +00:00
Atsushi Eno bba3fd5d13 2004-06-03 Atsushi Enomoto <[email protected]>
* BuiltInDatatype.cs,
	  XmlSchemaFacet.cs,
	  XmlSchemaSimpleTypeRestriction.cs,
	  XmlSchemaXPath.cs : modified some enum const to static readonly
	  (.NET 1.0 does not allow it). Use safe overload of LookupNamespace().

svn path=/trunk/mcs/; revision=28790
2004-06-03 21:03:29 +00:00
Atsushi Eno 1d28c755b8 2004-06-03 Atsushi Enomoto <[email protected]>
* XmlNamespaceManagre.cs : Fixed LookupNamespace() and LookupPrefix().
	  They require that names are *already* atomized.
	* XmlNodeReader.cs,
	  XmlTextWriter.cs : use safe overload of LookupXXX().

svn path=/trunk/mcs/; revision=28789
2004-06-03 21:02:31 +00:00
Atsushi Eno 44184229f2 2004-06-03 Atsushi Enomoto <[email protected]>
* Compiler.cs,
	  GenericOutputter.cs : XmlNamespaceManager.LookupPrefix() allows only
	  atomized names. Fixed XPathNavigatorNsm.LookupNamespace() that
	  should override another overload.

svn path=/trunk/mcs/; revision=28788
2004-06-03 21:01:54 +00:00
Atsushi Eno f0bdee817c 2004-06-03 Atsushi Enomoto <[email protected]>
* XsdValidatingReader.cs : XmlNamespaceManager.LookupPrefix() allows
	  only atomized names.

svn path=/trunk/mcs/; revision=28787
2004-06-03 21:01:11 +00:00
Duncan Mak 710600b689 What happened to this line?
svn path=/trunk/mcs/; revision=28786
2004-06-03 20:30:12 +00:00
Duncan Mak 8ec38e1163 Remove the Description field and use Comment, this makes it consistent
with the other TODOAttributes, and it also fixes the build.

svn path=/trunk/mcs/; revision=28785
2004-06-03 20:27:28 +00:00
Martin Baulig 709dd3c49f 2004-06-03 Martin Baulig <[email protected]>
* generic.cs (ConstructedType.GetMemberAccess): Renamed to
	GetSimpleName() and return a SimpleName.

	* ecore.cs (SimpleName.Arguments): New public field.
	(SimpleName): Added overloaded ctor which takes an additional
	TypeArguments argument.
	(SimpleName.SimpleNameResolve): Added support for generic methods.
	(MethodGroupExpr.ResolveGeneric): New public method.  The code was
	formerly in MemberAccess.DoResolve(), but we also need it in
	SimpleNameResolve().

	* expression.cs (MemberAccess.DoResolve): Use the new
	MethodGroupExpr.ResolveGeneric().

svn path=/trunk/mcs/; revision=28783
2004-06-03 19:15:01 +00:00
Atsushi Eno 0ff3bf221b 2004-06-03 Atsushi Enomoto <[email protected]>
* DataSet.cs : complex table content child was not properly added
	  when it is the only one child in the parent table. Fixed bug #53959.

svn path=/trunk/mcs/; revision=28782
2004-06-03 19:05:45 +00:00
Lluis Sanchez f525911fbf * threads.c: Made Thread.Sleep abortable.
svn path=/trunk/mono/; revision=28781
2004-06-03 19:02:00 +00:00
Gonzalo Paniagua Javier 6b670ae6dd 2004-06-03 Gonzalo Paniagua Javier <[email protected]>
* mono-api-info.cs: we don't want internal members listed.

svn path=/trunk/mcs/; revision=28780
2004-06-03 18:58:34 +00:00
Lluis Sanchez 266f664ca0 * threads.c: Implemented SleepEx.
* threads.h: Fixed SleepEx signature.

svn path=/trunk/mono/; revision=28779
2004-06-03 18:58:23 +00:00
Gonzalo Paniagua Javier 590c7733ba 2004-06-03 Gonzalo Paniagua Javier <[email protected]>
* Cscompmgd/Microsoft.CSharp/TODOAttribute.cs:
	* Microsoft.JScript/Microsoft.JScript/TODOAttribute.cs:
	* Microsoft.Web.Services/Microsoft.Web.Services/TODOAttribute.cs:
	* Mono.Data.MySql/Mono.Data.MySql/TODOAttribute.cs:
	* Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/TODOAttribute.cs:
	* Mono.Data.SybaseClient/Mono.Data.SybaseClient/TODOAttribute.cs:
	* Mono.Data.SybaseClient/Mono.Data.SybaseTypes/TODOAttribute.cs:
	* Mono.Data.Tds/Mono.Data.Tds.Protocol/TODOAttribute.cs:
	* Mono.Data.TdsClient/Mono.Data.TdsClient/TODOAttribute.cs:
	* Mono.Data.TdsClient/Mono.Data.TdsTypes/TODOAttribute.cs:
	* System/Microsoft.Win32/TODOAttribute.cs:
	* System/System/TODOAttribute.cs:
	* System.Data/System.Data/TODOAttribute.cs:
	* System.Data.OracleClient/System.Data.OracleClient/TODOAttribute.cs:
	* System.Design/System.Design/TODOAttribute.cs:
	* System.Design/System.Web.UI.Design.WebControls/TODOAttribute.cs:
	* System.Design/System.Windows.Forms.Design/TODOAttribute.cs:
	* System.DirectoryServices/System.DirectoryServices/TODOAttribute.cs:
	* System.Drawing.Design/Assembly/TODOAttribute.cs:
	* System.Messaging/System.Messaging/MonoTODO.cs:
	* System.Web/System.Web/TODOAttribute.cs:
	* System.Web.Mobile/System.Web.Mobile/TODOAttribute.cs:
	* System.Web.Services/System.Web.Services/TODOAttribute.cs:
	* System.Windows.Forms/System.Resources/ResXResourceReader.cs:
	* System.Windows.Forms/System.Windows.Forms/TODOAttribute.cs:
	* System.Windows.Forms/WINELib/TODOAttribute.cs:
	* System.XML/System.Xml/TODOAttribute.cs:
	Added Comment property.

svn path=/trunk/mcs/; revision=28778
2004-06-03 18:25:00 +00:00
Lluis Sanchez 4379a327a0 * HttpApplication.cs: Clear the http handler list after releasing the
handlers.

svn path=/trunk/mcs/; revision=28777
2004-06-03 18:21:05 +00:00
Gert Driesen f1e3e289da * mono-api-info.cs: also check protected internal members
svn path=/trunk/mcs/; revision=28776
2004-06-03 17:29:45 +00:00
Gonzalo Paniagua Javier d67b6715cd 2004-06-03 Gonzalo Paniagua Javier <[email protected]>
* TemplateControlCompiler.cs: use CodeDelegateCreateExpression instead
	of CodeObjectCreateExpression for the render method delegate. Thanks
	to Jochen Wezel.

svn path=/trunk/mcs/; revision=28775
2004-06-03 17:18:13 +00:00
Gert Driesen 696506a733 * DirectoryEntries.cs: flagged field private to fix public API
* DirectoryEntry.cs: added protected override for Dispose, marked
properties TODO
* DirectoryServicesPermissionEntryCollection.cs: added stubs for
missing protected methods
* PropertyCollection.cs: flagged field private to fix public API
* PropertyValueCollection.cs: removed empty extra methods, added
stub for missing methods to fix public API
* SearchResult.cs: removed unused local variable
* SearchResultCollection.cs: flagged field private to fix public
API, added missing property Dispose method and finalizer

svn path=/trunk/mcs/; revision=28771
2004-06-03 16:39:17 +00:00
Gert Driesen 7329ab8e6b * XmlSerializationReader.cs: added missing protected members
to fix API compatibility with MS.NET
* XmlSerializationWriter.cs: added missing protected members
to fix API compatibility with MS.NET

svn path=/trunk/mcs/; revision=28770
2004-06-03 16:37:47 +00:00
Miguel de Icaza b2a5558df6 2004-06-03 Miguel de Icaza <[email protected]>
* threads.c: When running under valgrind, do not allocate too much
	stack, as Valgrind default is 1 meg.

svn path=/trunk/mono/; revision=28769
2004-06-03 14:54:43 +00:00
Jochen Wezel 75adf4a235 Fixes for Property ReadOnly/WriteOnly, Property Set
svn path=/trunk/mcs/; revision=28766
2004-06-03 13:34:50 +00:00
Ravindra d395910e3f * HatchBrush.cs: Added missing test cases for all the hatch styles.
svn path=/trunk/mcs/; revision=28765
2004-06-03 12:36:51 +00:00
Massimiliano Mantione d767c20648 * cpu-pentium.md basic-float.cs Fixed bug on fpu spills (see bug 54467),
and added relevant test case.

svn path=/trunk/mono/; revision=28764
2004-06-03 12:11:54 +00:00
Paolo Molaro 8f8ff8fba5 Thu Jun 3 14:39:17 CEST 2004 Paolo Molaro <[email protected]>
* configure.in: libc setting for NetBSD (patch from [email protected]).

svn path=/trunk/mono/; revision=28763
2004-06-03 11:53:27 +00:00
Raja R Harinath 81d578bd20 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.

svn path=/trunk/mcs/; revision=28761
2004-06-03 11:36:53 +00:00
Raja R Harinath 8ca370f68e New testcases for bug #50820.
svn path=/trunk/mcs/; revision=28760
2004-06-03 11:32:31 +00:00
Anirban Bhattacharjee 5930670e36 * mb-parser.jay: RaiseEvent grammar fixed to get it working
svn path=/trunk/mcs/; revision=28755
2004-06-03 10:49:22 +00:00
Ravindra 9c05cfea6e * Makefile: Updated. We don't need to define the flag
DECLARE_CDECL_DELEGATES anymore. As we have moved all the
	codecs to libgdiplus.

svn path=/trunk/mcs/; revision=28754
2004-06-03 10:08:47 +00:00
Lluis Sanchez c9e20d512a * Makefile: generate client source file list before compiling the test
suite.

svn path=/trunk/mcs/; revision=28752
2004-06-03 09:42:19 +00:00
Gonzalo Paniagua Javier 05d6416e37 2004-06-03 Gonzalo Paniagua Javier <[email protected]>
* BufferedStream.cs: fixed typo that prevented Read() from working.
	This went out with beta 2. Closes bug #59534.

svn path=/trunk/mcs/; revision=28750
2004-06-03 07:59:04 +00:00
Anirban Bhattacharjee 867b4897f1 * driver.cs: fixed bug - 59540
svn path=/trunk/mcs/; revision=28749
2004-06-03 07:50:36 +00:00
Raja R Harinath 98473fb087 Add. Copied from System/Assembly/Consts.cs.
Unbreak build

svn path=/trunk/mcs/; revision=28748
2004-06-03 07:40:01 +00:00
Gonzalo Paniagua Javier ed2ee874b4 2004-06-03 Gonzalo Paniagua Javier <[email protected]>
* mono-api-info.cs: if we have a TODOAttribute, get the Comment property
	value and store it in attribute 'comment'.

	* mono-api-diff.cs: if we have a 'comment' keep it in the output file.

	* mono-api.xsl: if we have a 'comment' set it as the title attribute
	of the monoTODO gif image.

	Now we can see the MonoTODO comments when browsing the class status
	pages.

svn path=/trunk/mcs/; revision=28747
2004-06-03 07:33:58 +00:00
Marek Safar 8b6353a11b Enabled again
svn path=/trunk/mcs/; revision=28746
2004-06-03 07:18:12 +00:00
Marek Safar a63708b651 2004-06-03 Marek Safar <[email protected]>
* 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.

svn path=/trunk/mcs/; revision=28745
2004-06-03 07:15:04 +00:00
Raja R Harinath ca2f9ecbef Don't sign if BOOTSTRAP_WITH_OLDLIB.
svn path=/trunk/mcs/; revision=28744
2004-06-03 06:22:57 +00:00
Gonzalo Paniagua Javier aa11211a2a 2004-06-03 Gonzalo Paniagua Javier <[email protected]>
* System.Web.Handlers/TraceHandler.cs:
	* System.Web.UI/Control.cs:
	* System.Web.UI/Html32TextWriter.cs:
	* System.Web.UI/HtmlTextWriter.cs:
	* System.Web.UI/SimpleWebHandlerParser.cs:
	* System.Web.UI/TemplateControl.cs:
	* System.Web.UI.WebControls/Calendar.cs:
	* System.Web.UI.WebControls/CompareValidator.cs:
	* System.Web.UI.WebControls/ImageButton.cs:
	* System.Web.UI.WebControls/Style.cs:
	* System.Web.UI.WebControls/WebControl.cs:
	Added protected missing members and attributes.

svn path=/trunk/mcs/; revision=28743
2004-06-03 06:17:31 +00:00
Gonzalo Paniagua Javier de6295ffb3 Fixed link text for mod_mono
svn path=/trunk/mono/; revision=28738
2004-06-03 05:04:57 +00:00
Gonzalo Paniagua Javier aaabec71e5 2004-06-03 Gonzalo Paniagua Javier <[email protected]>
* ObjectStateFormatter.cs: use ObjectFormatter methods instead of
	calling a protected method of another object.

svn path=/trunk/mcs/; revision=28737
2004-06-03 04:57:26 +00:00
Anirban Bhattacharjee 0361e88e46 mb-parser.jay: Improved event declaration grammar
svn path=/trunk/mcs/; revision=28736
2004-06-03 04:54:28 +00:00
Atsushi Eno b03dd37b8f 2004-06-03 Atsushi Enomoto <[email protected]>
* ObjectStateFormatter.cs : csc build fix. Protected Read()/Write()
	  (of other objects) are called in TypeConverterFormatter.

svn path=/trunk/mcs/; revision=28735
2004-06-03 04:35:12 +00:00
Gert Driesen 165f76fa4d * ChangeLog: moved entries to ChangeLog in namespace directories
* Makefile: added extra assembly references
* System.Messaging.dll.sources: added new classes in
System.Messaging.Design namespace

svn path=/trunk/mcs/; revision=28734
2004-06-03 04:10:27 +00:00
Gert Driesen 8ee10bcd61 * ChangeLog: added file
* AccessControlEntry.cs: removed extra finalizer
* AccessControlList.cs: removed extra finalizer
* ActiveXMessageFormatter.cs: removed extra finalizer
* BinaryMessageFormatter.cs: public API fixes
* DefaultPropertiesToSend.cs: public API fixes
* IMessageFormatter.cs: public API fixes
* Message.cs: public API fixes
* MessageEnumerator.cs: public API fixes
* MessagePropertyFilter.cs: public API fixes
* MessageQueue.cs: public API fixes
* MessageQueueAccessControlEntry.cs: public API fixes
* MessageQueueEnumerator.cs: public API fixes
* MessageQueueException.cs: public API fixes
* MessageQueueInstaller.cs: public API fixes
* MessageQueuePermission.cs: public API fixes
* MessageQueuePermissionAttribute.cs: public API fixes
* MessageQueuePermissionEntry.cs: public API fixes
* MessageQueuePermissionEntryCollection.cs: public API
fixes
* MessagingDescriptionAttribute.cs: public API fixes
* PeekCompletedEventArgs.cs: public API fixes
* ReceiveCompletedEventArgs.cs: public API fixes
* Trustee.cs: removed extra finalizer
* XmlMessageFormatter.cs: public API fixes

svn path=/trunk/mcs/; revision=28733
2004-06-03 04:09:37 +00:00
Gert Driesen d56c182f84 * ChangeLog: added file
* MessageFormatterConverter.cs: added file
* MessageQueueConverter.cs: added file
* QueuePathDialog.cs: added file
* QueuePathEditor.cs: added file
* TimeoutConverter.cs: added file

svn path=/trunk/mcs/; revision=28732
2004-06-03 04:07:32 +00:00
Raja R Harinath 40dacb1c19 (Mono.Posix/make-map.exe): Depend on $(the_lib) to pick
the name of the library from library.make.  This should make it
parallel-make-safe.

svn path=/trunk/mcs/; revision=28731
2004-06-03 03:58:44 +00:00
Atsushi Eno 993ca36cce 2004-06-03 Atsushi Enomoto <[email protected]>
* README.makefiles : added description for run-test-ondotnet.

svn path=/trunk/mcs/; revision=28730
2004-06-03 03:46:23 +00:00
Atsushi Eno 4330ae3ebe 2004-06-03 Atsushi Enomoto <[email protected]>
* Makefile : ignore make run-test-ondotnet.

svn path=/trunk/mcs/; revision=28729
2004-06-03 03:31:52 +00:00
Atsushi Eno d98b7f501b 2004-06-03 Atsushi Enomoto <[email protected]>
* Makefile : added run-test-ondotnet support.

svn path=/trunk/mcs/; revision=28728
2004-06-03 03:29:50 +00:00
Gert Driesen b26347d5e3 * mono-api-diff.cs: also report mismatches in protected members
* mono-api-info.cs: fixed issue where counters were not output
for missing attributes if there were no other mismatches

svn path=/trunk/mcs/; revision=28727
2004-06-03 03:28:16 +00:00
Atsushi Eno 5872301b80 2004-06-03 Atsushi Enomoto <[email protected]>
* Makefile : add run-test-ondotnet target support.

svn path=/trunk/mcs/; revision=28726
2004-06-03 03:26:47 +00:00
Atsushi Eno 5b3d33811d 2004-06-03 Atsushi Enomoto <[email protected]>
* Makefile, executable.make, library.make, rules.make :
	  Added new target "run-test-ondotnet" that works what "run-test"
	  used to be on windows (i.e. tests our libs under MS.NET).

svn path=/trunk/mcs/; revision=28725
2004-06-03 03:21:38 +00:00
Sebastien Pouliot 99ce30066f 2004-06-02 Sebastien Pouliot <[email protected]>
* TimeSpan.cs: Fixed overflow issues when delaing with big (days) time
	spans. Fixed parsing when only days are presents in the string (which
	should be illegal according to the documentation but is supported).

svn path=/trunk/mcs/; revision=28724
2004-06-03 00:22:22 +00:00
Gonzalo Paniagua Javier 554f9ec5ca 2004-06-03 Gonzalo Paniagua Javier <[email protected]>
* ObjectStateFormatter.cs: before choosing the binary formatter, check
	if the object type has a TypeConverter that can convert to/from string.
	Fixes bug #59495.

	* Page.cs: call GetViewStateString from outside the WriteLine. This
	allows writing to the Response when getting the string without breaking
	the HTML generated.

svn path=/trunk/mcs/; revision=28721
2004-06-03 00:05:29 +00:00
Lluis Sanchez 8754b186aa * wsdlfiles.tar.gz: New file that contains all test wsdl documents.
* proxies.net.xml.gz: Description of the proxies generated by MS.NET.
	* cormissing.xml: Formatting stuff.

svn path=/trunk/mcs/; revision=28720
2004-06-02 23:52:12 +00:00
Lluis Sanchez deed5ea977 * Makefile: Added new targets for running the tests. Now the generated
proxies are checked against the ones generated by MS.NET.
	* services.xml: Updated service list.
	* wstest.cs: new command checkdiff: generates a xml file using nunit format
	  with all differences between mono generated proxies and MS.NET ones.
	* client/localhost/ConvRpcTest.cs: Fixed url.

svn path=/trunk/mcs/; revision=28719
2004-06-02 23:30:00 +00:00
Ben Maurer 4fc8ad8412 2004-06-02 Ben Maurer <[email protected]>
* expression.cs (ArrayCreationExpression): Make this just an
	`expression'. It can't be a statement, so the code here was
	dead.

svn path=/trunk/mcs/; revision=28718
2004-06-02 21:59:48 +00:00
Miguel de Icaza cb0df43302 Fix
svn path=/trunk/mono/; revision=28717
2004-06-02 21:50:52 +00:00
Peter Dennis Bartok 53b9552dd9 - Fixed bug #59479
svn path=/trunk/mcs/; revision=28713
2004-06-02 18:52:29 +00:00
Sebastien Pouliot 61aa800d02 2004-06-02 Sebastien Pouliot <[email protected]>
* TimeSpanTest.cs: Added tests for overflow checking and parsing
	only days (LAMESPEC).

svn path=/trunk/mcs/; revision=28712
2004-06-02 18:32:36 +00:00
Lluis Sanchez 285cd2dcc8 * XmlSerializationReader.cs: Support schamea instance namespaces other than
the 2001 one when reading the xsi type.
	* MapCodeGenerator.cs: Take into account that the root namespace and element
	  name may have changed from one export to another of the same type. In
	  this case the class attributes need to be regenerated.
	* SoapCodeExporter.cs, XmlCodeExporter.cs: Take the enum name from XmlType,
	  not ElementName. Idem for namespace.
	* XmlReflectionImporter.cs: Set nullable property of XmlTypeMapping.
	* XmlRootAttribute.cs: Default value for nullable is true.
	* XmlSchemaImporter.cs: The root name for a class may change in some
	  scenarios (for example, when the type is initially exported as part of
	  another type and later exported as a root type).
	* XmlSerializationReader.cs: In GetXsiType(), if the type attribute is not
	  found using the standard namespace, try getting the type using
	  the 2000/10 and 1999 namespaces.
	* XmlTypeMapping.cs: Added IsNullable property. Updated SetRoot method.

svn path=/trunk/mcs/; revision=28711
2004-06-02 18:16:39 +00:00
Gonzalo Paniagua Javier 3d1a0acc32 2004-06-02 Gonzalo Paniagua Javier <[email protected]>
* WebConfigurationSettings.cs: when the virtual path is not /, don't
	loop forever trying to read configuration from /. Fixes bug #59480.

svn path=/trunk/mcs/; revision=28710
2004-06-02 18:08:21 +00:00
Sebastien Pouliot 1e3d58625d 2004-05-02 Sebastien Pouliot <[email protected]>
* ResourceManager.cs: Avoid endless recursion when a resource file
	isn't found.

svn path=/trunk/mcs/; revision=28707
2004-06-02 16:27:02 +00:00
Urs C. Muff 095f584130 Fix libintl.a problem, thanks kangaroo
svn path=/trunk/mono/; revision=28706
2004-06-02 15:38:17 +00:00
Gonzalo Paniagua Javier 009cb3ef2e 2004-06-02 Gonzalo Paniagua Javier <[email protected]>
* HtmlTextWriter.cs: render end tag for unknown tags.
	Patch frmo Markus Kr�utner. Fixes bug #59466.

svn path=/trunk/mcs/; revision=28703
2004-06-02 15:09:57 +00:00
Gonzalo Paniagua Javier c7ae11abaa Replace only \n by <br>, not \r\n
svn path=/trunk/mcs/; revision=28702
2004-06-02 14:49:26 +00:00
Gonzalo Paniagua Javier 4fa2d15c15 2004-06-02 Gonzalo Paniagua Javier <[email protected]>
* TraceData.cs: html-encode the messages written to the trace. Fixes
	bug #59431.

svn path=/trunk/mcs/; revision=28701
2004-06-02 14:47:02 +00:00
Gonzalo Paniagua Javier 8342f74320 2004-06-02 Gonzalo Paniagua Javier <[email protected]>
* Binder.cs: default score must be lower than fail_score or we'll get
	an ambiguous match when no indexers given and one single match is found.

svn path=/trunk/mcs/; revision=28698
2004-06-02 14:30:56 +00:00
Gonzalo Paniagua Javier f44b83ff48 2004-06-02 Gonzalo Paniagua Javier <[email protected]>
* BinderTests.cs: one more test for matching a single property. Adapted
	to nunit 2.2 style.

svn path=/trunk/mcs/; revision=28697
2004-06-02 14:29:09 +00:00
Urs C. Muff 20792a1e4e Update to beta2, provided by kangaroo (removed gc 6.3 a 6 dep, since that is included now)
svn path=/trunk/mono/; revision=28696
2004-06-02 13:56:00 +00:00
Miguel de Icaza c640a6dbca Flsuh
svn path=/trunk/mono/; revision=28695
2004-06-02 13:45:21 +00:00
Lluis Sanchez a11fa40df5 * HttpSimpleProtocolImporter.cs: Fixed case of generated methods to match
MS behavior. Always use import input parameters as System.String.
	* ProtocolImporter.cs: Remove _x0020_ from type names.
	* SoapProtocolImporter.cs: Fixed case of generated methods to match
	  MS behavior.

svn path=/trunk/mcs/; revision=28694
2004-06-02 13:43:45 +00:00
Lluis Sanchez 3e5c944d3c * LogicalMethodInfo.cs: Don't crash in GetCustomAttribute if the requested
attribute is not found.

svn path=/trunk/mcs/; revision=28693
2004-06-02 13:42:29 +00:00
Sureshkumar T 1a324291c4 Implemented GetByte method. Fixed bug #58820
svn path=/trunk/mcs/; revision=28691
2004-06-02 08:44:42 +00:00
Umadevi S a8e6fcdf07 * SQLDebugging.cs: added missing attributes, marked ctor
public to match MS.NET

svn path=/trunk/mcs/; revision=28690
2004-06-02 08:20:21 +00:00
Marek Safar 87167c7734 2004-06-02 Marek Safar <[email protected]>
Fixed #59072
	* typemanager.cs (GetFullNameSignature): New method for
	MethodBase types.

svn path=/trunk/mcs/; revision=28689
2004-06-02 08:11:36 +00:00
Marek Safar 9ed88b2d45 2004-06-02 Marek Safar <[email protected]>
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.

svn path=/trunk/mcs/; revision=28688
2004-06-02 07:25:18 +00:00
Umadevi S 09f0d5500b * OleDbParameter.cs: added missing attributes
* OleDbPermission.cs: added missing attributes
       * OleDbConnection.cs: added missing attributes
       * OleDbDataAdapter.cs: added missing attributes

svn path=/trunk/mcs/; revision=28687
2004-06-02 06:13:15 +00:00
Marek Safar 91c45adb65 I forgot include my latest test
svn path=/trunk/mcs/; revision=28686
2004-06-02 05:09:29 +00:00
Umadevi S 01c1457a04 * OdbcParameter.cs: added missing attributes
* OdbcPermission.cs: added missing attributes
       * OdbcConnection.cs: fixes attribute, added missing attributes
       * OdbcInfoMessageEventArgs.cs: removed extra properties, fixed
       API compatibility with MS.NET
       * OdbcCommandBuilder.cs: use correct attributes

svn path=/trunk/mcs/; revision=28684
2004-06-02 05:02:58 +00:00
Duncan Mak bb99ec8eb8 Use the correct yum-repository.
svn path=/trunk/mono/; revision=28683
2004-06-02 04:55:49 +00:00
Martin Baulig 7b6c68d084 2004-06-02 Martin Baulig <[email protected]>
Set version number to 37.

svn path=/trunk/mcs/; revision=28680
2004-06-02 04:45:57 +00:00
Martin Baulig 9f727da8ce 2004-06-02 Martin Baulig <[email protected]>
* mono-debug.h (MONO_DEBUGGER_VERSION): Bumped version to 41.

	* debug-mono-symfile.h: Bumped symbol file version number to 37.

svn path=/trunk/mono/; revision=28679
2004-06-02 04:45:30 +00:00
Umadevi S aba4022c63 * DataColumnMappingCollection.cs: added missing attributes on
indexers

svn path=/trunk/mcs/; revision=28678
2004-06-02 04:33:12 +00:00
Umadevi S a8ff9e76f9 2004-06-02 Umadevi S <[email protected]>
* added System.Data/DataTableTypeConverter to system.data.dll.sources

svn path=/trunk/mcs/; revision=28677
2004-06-02 04:24:43 +00:00
Umadevi S ecb8b65b60 * DataTableTypeConverter.cs: added
* DataView.cs: added missing attribute on Table property
* DataViewManager.cs: moved attribute to correct property
* UniqueConstraint.cs: removed extra ReadOnly attribute from
       IsPrimaryKey property

svn path=/trunk/mcs/; revision=28676
2004-06-02 04:22:28 +00:00
Miguel de Icaza 1f5237f4c2 Flush
svn path=/trunk/mono/; revision=28673
2004-06-02 03:44:33 +00:00
Gonzalo Paniagua Javier b9d4b51646 missing 3 comments
svn path=/trunk/mcs/; revision=28671
2004-06-02 02:59:21 +00:00
Gonzalo Paniagua Javier ea81552b3f 2004-06-02 Gonzalo Paniagua Javier <[email protected]>
* Binder.cs: removed ^Ms. In case of several properties matching, try
	to disambiguate based on the indexer types provider and the conversions
	from those into the ones of the property.

svn path=/trunk/mcs/; revision=28670
2004-06-02 02:49:29 +00:00
Gonzalo Paniagua Javier 48c23a3d48 2004-06-02 Gonzalo Paniagua Javier <[email protected]>
* BinderTests.cs: added more indexers and more SelectProperty tests.

svn path=/trunk/mcs/; revision=28669
2004-06-02 02:43:05 +00:00
Todd Berman fcd6a5179a match mono-rpm-helpers rearranging in mcs
svn path=/trunk/mono/; revision=28668
2004-06-02 02:26:46 +00:00
Todd Berman 4c0f55d680 2004-06-01 Todd Berman <[email protected]>
* all: move stuff around so that it builds properly.
        build system cant handle building two exes from one directory.

svn path=/trunk/mcs/; revision=28667
2004-06-02 02:26:17 +00:00
Sebastien Pouliot d19c09b70a 2004-06-01 Sebastien Pouliot <[email protected]>
* TimeSpan.cs: Fixed exceptions in FromXXX methods as they are
	somewhat different from the documentation.

svn path=/trunk/mcs/; revision=28666
2004-06-02 02:05:57 +00:00
Sebastien Pouliot 924167bbe6 2004-06-01 Sebastien Pouliot <[email protected]>
* TimeSpanTest.cs: Added tests for exceptions in FromXXX methods
	which are very badly documented.

svn path=/trunk/mcs/; revision=28665
2004-06-02 01:43:24 +00:00
Martin Baulig b3be87884e Reverted Ben's latest change, it broke the debugger :-(
svn path=/trunk/mcs/; revision=28656
2004-06-01 20:19:50 +00:00
Todd Berman 457a215edf fixing domain, if someone could push this, that would rock :)
svn path=/trunk/mono/; revision=28655
2004-06-01 20:06:50 +00:00
Marek Safar d12ace09e5 2004-06-01 Marek Safar <[email protected]>
* test-267.cs: New test.

svn path=/trunk/mcs/; revision=28654
2004-06-01 20:06:00 +00:00
Atsushi Eno 4935bfc2a8 2004-06-01 Atsushi Enomoto <[email protected]>
* DataRow.cs : ColumnsChanged event is not required in .ctor().

svn path=/trunk/mcs/; revision=28652
2004-06-01 19:27:03 +00:00
Marek Safar 421ba8f515 2004-06-01 Marek Safar <[email protected]>
* 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.

svn path=/trunk/mcs/; revision=28651
2004-06-01 18:57:19 +00:00
Atsushi Eno fe58e181f1 2004-06-01 Atsushi Enomoto <[email protected]>
* XmlDataReader.cs : type change is required before setting value
	  string to row item.

svn path=/trunk/mcs/; revision=28650
2004-06-01 18:49:14 +00:00
Marek Safar f663a673c7 2004-06-01 Marek Safar <[email protected]>
Fixed bug #59071 & cs0160.cs

	* statement.cs (Try.Resolve): Check here whether order of catch
	clauses matches their dependencies.

svn path=/trunk/mcs/; revision=28648
2004-06-01 18:24:31 +00:00
Gert Driesen 85abe35367 * RemotingServices.cs: Added missing Conditional attribute and
MonoTODO attribute on LogRemotingStage

svn path=/trunk/mcs/; revision=28644
2004-06-01 17:58:08 +00:00
Gert Driesen 6f4501e510 * Assembly.cs: added missing ComVisible attribute on
ImageRuntimeVersion property
* ConstructorInfo.cs: added missing attributes on Invoke
* EventInfo.cs: added missing attributes
* FieldInfo.cs: added missing attributes
* MethodBase.cs: added missing attributes
* PropertyInfo.cs: added missing attributes

svn path=/trunk/mcs/; revision=28642
2004-06-01 17:48:31 +00:00
Gert Driesen 33f3a435b5 forgot to remove conflict indicators
svn path=/trunk/mcs/; revision=28641
2004-06-01 17:47:55 +00:00
Gert Driesen 8860a80e89 * Type.cs: added missing attributes on InvokeMember
svn path=/trunk/mcs/; revision=28640
2004-06-01 17:47:04 +00:00
Atsushi Eno f6e61d103b 2004-06-01 Atsushi Enomoto <[email protected]>
* platforms/win32.make : TEST_RUNTIME should be always mono we can't
	  test our libs against MS.NET runtime. Think about internal call).

svn path=/trunk/mcs/; revision=28628
2004-06-01 14:15:36 +00:00
Miguel de Icaza afe6148ebd 2004-06-01 Miguel de Icaza <[email protected]>
* String.cs: Flag concat with four arguments internal.

svn path=/trunk/mcs/; revision=28625
2004-06-01 13:30:40 +00:00
Ravindra da34629417 Minor correction in Pen.Dispose and SolidBrush.Dispose
svn path=/trunk/mcs/; revision=28624
2004-06-01 12:09:36 +00:00
Sebastien Pouliot c68c1bd6c0 2004-06-01 Sebastien Pouliot <[email protected]>
* SortedList.cs: Fixed case where the initial capacity was set to 0.

svn path=/trunk/mcs/; revision=28623
2004-06-01 12:09:27 +00:00
Sebastien Pouliot a2d18abb30 2004-06-01 Sebastien Pouliot <[email protected]>
* SortedListTest.cs: Added new test when initial capacity is set to 0
	(so it never returns to default, 16, when Capacity is set to 0) unless
	Clear is called. Cleaned up unused SetUp/TearDown.

svn path=/trunk/mcs/; revision=28622
2004-06-01 12:05:49 +00:00
Marek Safar dd7100cbbd 2004-06-01 Marek Safar <[email protected]>
* cs1555.cs,
	* cs1556.cs,
	* cs3000.cs: 3 new error tests.

svn path=/trunk/mcs/; revision=28621
2004-06-01 11:59:37 +00:00
Raja R Harinath 5a6cb5ce83 (monolite-bootstrap): Update.
svn path=/trunk/mono/; revision=28620
2004-06-01 10:02:34 +00:00
Raja R Harinath a90a8752fa (bootstrap,faststrap,fasterstrap): Refactor.
Fix 'faststrap' to be corlib-version-change-safe.
(one-stage-strap,two-stage-strap,three-stage-strap): Remove.

svn path=/trunk/mono/; revision=28619
2004-06-01 09:50:00 +00:00
Lluis Sanchez 2cf46f9f3a 2004-06-01 Gert Driesen <[email protected]>
* DiscoveryReference.cs: Added missing XmlIgnore attribute.

svn path=/trunk/mcs/; revision=28617
2004-06-01 08:59:06 +00:00
Lluis Sanchez d939457bb9 2004-06-01 Gert Driesen <[email protected]>
* HttpSoapWebServiceHandler.cs: Removed unused variables.
	* SoapHeaderAttribute.cs: Added Obsolete attribute.

svn path=/trunk/mcs/; revision=28616
2004-06-01 08:58:32 +00:00
Lluis Sanchez bc88cf65e9 * Binding.cs: removed extra XmlIgnore attribute on ServiceDescription
* Import.cs: removed extra XmlIgnore attribute on ServiceDescription
	* Message.cs: removed extra XmlIgnore attribute on ServiceDescription
	* MessageBinding.cs: removed extra DefaultValue attribute from Name,
	removed extra XmlIgnoreAttribute from OperationBinding
	* MessagePart.cs: removed extra XmlIgnore attribute on Message
	* MimeContentBinding.cs: removed extra DefaultValue attribute on Part
	* Operation.cs: removed extra XmlIgnore attribute on PortType
	* OperationBinding.cs: removed extra XmlIgnore attribute on Binding
	* OperationMessage.cs: removed extra XmlIgnore attribute on Operation
	* Port.cs: removed extra XmlIgnore attribute on Service
	* PortType.cs: removed extra XmlIgnore on ServiceDescription
	* Service.cs: removed extra XmlIgnore on ServiceDescription
	* ServiceDescriptionFormatExtension.cs: removed extra XmlIgnore
	  attribute on Parent
	* SoapHeaderBinding.cs: added XmlElement attribute on Fault
	* HttpSimpleProtocolImporter.cs: removed unused variable
	* ServiceDescriptionImporter.cs: removed unused variable
	* SoapProtocolImporter.cs: removed unused variable

svn path=/trunk/mcs/; revision=28615
2004-06-01 08:49:25 +00:00
Lluis Sanchez 11b23d5c2a * WebServicesConfigurationSectionHandler.cs: removed unused variables
svn path=/trunk/mcs/; revision=28614
2004-06-01 08:48:08 +00:00
Ravindra fdeac5a1d2 Patch from Gert Driesen.
svn path=/trunk/mcs/; revision=28613
2004-06-01 08:29:58 +00:00
Anirban Bhattacharjee 99bc5750c0 test cases for Delegate
svn path=/trunk/mcs/; revision=28612
2004-06-01 06:12:41 +00:00
Gonzalo Paniagua Javier f611271a66 2004-06-01 Gonzalo Paniagua Javier <[email protected]>
* HttpWorkerRequest.cs: the hashtables are now case-insensitive. Thanks
	to Markus Kr�utner.

svn path=/trunk/mcs/; revision=28611
2004-06-01 05:47:02 +00:00
Gonzalo Paniagua Javier ab10994d3d 2004-06-01 Gonzalo Paniagua Javier <[email protected]>
* RegexBugs.cs: added CategoryAndNegated test.

svn path=/trunk/mcs/; revision=28610
2004-06-01 05:45:05 +00:00
Gonzalo Paniagua Javier 4d8d5cc311 2004-06-01 Gonzalo Paniagua Javier <[email protected]>
* syntax.cs: re-applied my patch from 2004-05-27 plus a fix which is
	emitting a Category.All if both a category and its negated value are
	present.

svn path=/trunk/mcs/; revision=28609
2004-06-01 05:43:48 +00:00
Ravindra 46eac4f446 Formatting.
svn path=/trunk/mcs/; revision=28608
2004-06-01 05:10:45 +00:00
Ravindra e21f636e8c * Pen.cs: Added a note on Dispose method.
* Brush.cs: Fixed Dispose method.
	* SolidBrush.cs: Fixed Dispose method.

svn path=/trunk/mcs/; revision=28607
2004-06-01 05:00:16 +00:00
Sebastien Pouliot b1b8611ecf 2004-05-31 Sebastien Pouliot <[email protected]>
* ArrayTest.cs: Fixed array used for some tests. Strangely the tests
	didn't fail on MS runtime ?!?! but they should have!

svn path=/trunk/mcs/; revision=28606
2004-06-01 01:42:38 +00:00
Sebastien Pouliot da69c6c63c 2004-05-31 Sebastien Pouliot <[email protected]>
* PathTest.cs: Fixed ChangeExtension_BadExtension to run only on Windows.

svn path=/trunk/mcs/; revision=28605
2004-06-01 01:24:57 +00:00
Gonzalo Paniagua Javier 6e3884f14f 2004-06-01 Gonzalo Paniagua Javier <[email protected]>
* syntax.cs: reverting my previous patch. It causes bigger problems.

svn path=/trunk/mcs/; revision=28604
2004-06-01 01:01:23 +00:00
Sebastien Pouliot 0b06a8ac4c 2004-05-31 Sebastien Pouliot <[email protected]>
* Array.cs: Fixed legal case where value is null.
	* Byte.cs: Fixed ToString when format is an empty string (use "G").

svn path=/trunk/mcs/; revision=28603
2004-06-01 00:49:08 +00:00
Sebastien Pouliot 8b96bfb634 2004-05-31 Sebastien Pouliot <[email protected]>
* Guid.cs: Renamed private fields (and changed some to signed) to
	match MS implementation and allow serialization to work. Fix
	bug #59113.

svn path=/trunk/mcs/; revision=28602
2004-06-01 00:45:29 +00:00
Sebastien Pouliot e2c9c8c0bf 2004-05-31 Sebastien Pouliot <[email protected]>
* Hashtable.cs: Added ArgumentNullException in GetObjectData.

svn path=/trunk/mcs/; revision=28601
2004-06-01 00:44:10 +00:00
Sebastien Pouliot 585d7ffd41 2004-05-31 Sebastien Pouliot <[email protected]>
* ArrayListTest.cs: Added new test for null in BinarySearch.
	* HashtableTest.cs: Added null checking fro GetObjectData.

svn path=/trunk/mcs/; revision=28600
2004-06-01 00:20:08 +00:00
Sebastien Pouliot 93359ce5b4 2004-05-31 Sebastien Pouliot <[email protected]>
* FileTest.cs: Added tests to confirm that Exists never throws
	exceptions even for invalid filenames or for unexisting directories.
	* PathTest.cs: Added windows-specific tests that shows that
	ChangeExtension validate the input patch but doesn't validate the
	resulting path.

svn path=/trunk/mcs/; revision=28599
2004-06-01 00:16:12 +00:00
Sebastien Pouliot de8ffd34ed 2004-05-30 Sebastien Pouliot <[email protected]>
* ArrayTest.cs: Added tests for null values in BinarySearch.
	* Byte.cs: Added test for default ToString format value.

svn path=/trunk/mcs/; revision=28598
2004-06-01 00:11:50 +00:00
Gonzalo Paniagua Javier f82a1f85dd 2004-05-31 Gonzalo Paniagua Javier <[email protected]>
* HttpRequest.cs: nullify _sRequestRootVirtualDir and baseVirtualDir
	when SetFilePath is called. This way the cached values are reset and
	get the right value in case someone (namely SessionStateModule +
	cookieless session) changes the FilePath after the property cached its
	value. Fixes bug #59364.

svn path=/trunk/mcs/; revision=28586
2004-05-31 19:15:56 +00:00
Atsushi Eno e3cfa1cf7c 2004-05-31 Atsushi Enomoto <[email protected]>
* DataSet.cs : Loop-break of the last fix was incorrect.

svn path=/trunk/mcs/; revision=28585
2004-05-31 19:12:07 +00:00
Miguel de Icaza 3343ab394f version
svn path=/trunk/mcs/; revision=28575
2004-05-31 18:22:57 +00:00
Miguel de Icaza 749975515b version
svn path=/trunk/mcs/; revision=28574
2004-05-31 18:22:28 +00:00
Atsushi Eno 29bd87001f 2004-05-31 Atsushi Enomoto <[email protected]>
* DataSet.cs : When a row has no parent row but the table has parent
	  relation(s), that row had been always ignored.

svn path=/trunk/mcs/; revision=28572
2004-05-31 18:16:37 +00:00
Gonzalo Paniagua Javier 1263f41404 tired of those ^M
svn path=/trunk/mcs/; revision=28571
2004-05-31 18:14:08 +00:00
Miguel de Icaza 3389912d8f This is Beta2
svn path=/trunk/mono/; revision=28567
2004-05-31 17:51:14 +00:00
Miguel de Icaza f131483ce6 UPdate
svn path=/trunk/mono/; revision=28566
2004-05-31 17:28:06 +00:00
Atsushi Eno f2bfd9fe48 2004-05-31 Atsushi Enomoto <[email protected]>
* XmlDataInferenceLoader.cs : Fixed GetMappedTable() that incorrectly
	  rejected same-named tables in different hierarchy. Thanks to Boris.

svn path=/trunk/mcs/; revision=28565
2004-05-31 17:16:55 +00:00
Ben Maurer e45a69164c add multi-6
svn path=/trunk/mcs/; revision=28564
2004-05-31 17:12:21 +00:00
Gonzalo Paniagua Javier 1602cb9de7 2004-05-31 Gonzalo Paniagua Javier <[email protected]>
* configure.in: fixlets for windows.

svn path=/trunk/mono/; revision=28562
2004-05-31 17:01:48 +00:00
Paolo Molaro d273b61a20 Mon May 31 19:41:46 CEST 2004 Paolo Molaro <[email protected]>
* mini.c revert Zoltan's fix to bug#58863 on ppc, since it causes
	regressions in gtk-sharp.

svn path=/trunk/mono/; revision=28561
2004-05-31 17:01:25 +00:00
Miguel de Icaza 81e825559a 2004-05-31 Miguel de Icaza <[email protected]>
* Reverted patch to namespace.cs (Use lookuptypedirect).  This
	caused a regression: #59343.  Referencing nested classes from an
	assembly stopped working.

svn path=/trunk/mcs/; revision=28560
2004-05-31 16:57:21 +00:00
Atsushi Eno b1000500d6 2004-05-31 Atsushi Enomoto <[email protected]>
* XmlDiffLoader.cs : Added some Skip() that is required not to go to
	  infinite loop. Thanks to Boris for this fix.

svn path=/trunk/mcs/; revision=28558
2004-05-31 16:50:16 +00:00
Atsushi Eno 4557407d6d 2004-05-31 Atsushi Enomoto <[email protected]>
* Directory.cs, File.cs : Fixed Exists() that raised
	  DirectoryNotFoundException. Quick fix for bug #59354.

svn path=/trunk/mcs/; revision=28557
2004-05-31 16:44:03 +00:00
Zoltan Varga a84be32229 2004-05-31 Zoltan Varga <[email protected]>
* marshal.c (mono_marshal_get_runtime_invoke): Fix CR/LFs.

svn path=/trunk/mono/; revision=28555
2004-05-31 15:47:57 +00:00
Miguel de Icaza 862d515398 Updated with new tests
svn path=/trunk/mcs/; revision=28554
2004-05-31 15:18:47 +00:00
Miguel de Icaza 27adaadb5b Add new test files
svn path=/trunk/mcs/; revision=28553
2004-05-31 15:13:25 +00:00
Atsushi Eno 0820f840a5 2004-05-31 Atsushi Enomoto <[email protected]>
* SignedXml.cs : partial fix for bug #59165 that does not output
	  namespace that conflicts with element's namespace.

svn path=/trunk/mcs/; revision=28551
2004-05-31 12:06:45 +00:00
Atsushi Eno 87aa3d424c The latest tests were by Boris Kirzner (thanks!)
svn path=/trunk/mcs/; revision=28550
2004-05-31 10:47:19 +00:00
Atsushi Eno acec2a5772 2004-05-31 Atsushi Enomoto <[email protected]>
* DataTableTest.cs : Added test for serialization.
	* DataSetInferXmlSchemaTest.cs : Added test for schema element skip.

svn path=/trunk/mcs/; revision=28549
2004-05-31 10:45:27 +00:00
Atsushi Eno c4c84f3d00 2004-05-31 Atsushi Enomoto <[email protected]>
* XmlDataInferenceLoader.cs : XmlSchema elements should not be infered.
	  Thanks to Boris for this fix.

svn path=/trunk/mcs/; revision=28548
2004-05-31 10:29:27 +00:00
Atsushi Eno d538cb0571 2004-05-31 Atsushi Enomoto <[email protected]>
* RncParser.jay : now error output is disabled.
	* RncTokenizer.cs : It should not be public class.

svn path=/trunk/mcs/; revision=28547
2004-05-31 10:23:31 +00:00
Atsushi Eno 9c5f8f2746 2004-05-31 Atsushi Enomoto <[email protected]>
* Misc.cs : made Util class internal.
	* RelaxngDatatypeProvider.cs : looks commit was missing.
	* RelaxngException.cs : made one .ctor() internal that accepts
	  RdpPattern.
	* RelaxngNameClas.cs : Names list should not be settable.
	* RelaxngPattern.cs : RelaxngRefPattern class is internal use only.
	* RelaxngPatternType.cs : there is not "Include" pattern.

svn path=/trunk/mcs/; revision=28546
2004-05-31 10:22:51 +00:00
Atsushi Eno da5275f248 2004-05-31 Atsushi Enomoto <[email protected]>
* anglia-test-runner.cs : Added support for RELAX NG compact syntax
	  parser tests.
	* Makefile : added anglia-test support.
	* README : ditto.

svn path=/trunk/mcs/; revision=28545
2004-05-31 10:22:02 +00:00
Rafael Teixeira 776110a374 2004-05-31 Rafael Teixeira <[email protected]>
* OptionDetails.cs : ShortForm member now a string to favor some simplifications, fixes for Bug 58672
	* OptionList.cs : Fixes for Bug 58672 and better handling for mixed-form options (linux/windows)

svn path=/trunk/mcs/; revision=28543
2004-05-31 09:15:09 +00:00
Rafael Teixeira 386481ff06 Exercise Mono.GetOptions a bit in the testmbas/WriteOK.exe target
svn path=/trunk/mcs/; revision=28542
2004-05-31 08:57:22 +00:00
Ravindra 956c67906f * pie.cs: Made the output image little organized and added a
case where DrawPie and FillPie were crashing the system. It
	was happening with zero degree sweep angle.

svn path=/trunk/mcs/; revision=28541
2004-05-31 08:43:54 +00:00
Rafael Teixeira a9c884eaef 2004-05-31 Rafael Teixeira <[email protected]>
* OptionDetails.cs: Assemble an one-line authors' list in about processor (also abandon after about)

svn path=/trunk/mcs/; revision=28534
2004-05-31 07:03:50 +00:00
Rafael Teixeira 86a295501e 2004/05/31 Rafael Teixeira <[email protected]>
* AssemblyInfo.cs : Anirban is and author too

svn path=/trunk/mcs/; revision=28532
2004-05-31 07:00:05 +00:00
Rafael Teixeira 7ebae8306a 2004-05-31 Rafael Teixeira <[email protected]>
* Financial.cs:
		Correct IRR and MIRR method signatures and prevent public default constructor, all according to Class Status Page (corcompare)

svn path=/trunk/mcs/; revision=28530
2004-05-31 05:35:21 +00:00
Rafael Teixeira b1853cba15 BETTER ALPHA WARNING
svn path=/trunk/mcs/; revision=28529
2004-05-31 04:51:11 +00:00
Martin Baulig 5d7664c3cc 2004-05-31 Martin Baulig <[email protected]>
MCS is now frozen for beta 2.

svn path=/trunk/mcs/; revision=28528
2004-05-31 02:55:34 +00:00
Martin Baulig 1390efe910 **** Merged from MCS ****
svn path=/trunk/mcs/; revision=28527
2004-05-31 02:46:01 +00:00
Martin Baulig b5c5563b18 **** Merged from MCS ****
svn path=/trunk/mcs/; revision=28526
2004-05-31 02:44:20 +00:00
Martin Baulig a02bf8816d Reverted everything back until 14:15 this afternoon.
svn path=/trunk/mcs/; revision=28525
2004-05-31 02:32:48 +00:00
Martin Baulig 7e9bc7847d 2004-05-30 Ben Maurer <[email protected]>
* 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.

svn path=/trunk/mcs/; revision=28523
2004-05-31 02:31:16 +00:00
Martin Baulig 42981c413a 2004-05-30 Ben Maurer <[email protected]>
* 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  <[email protected]>

	* expression.cs (Invocation.OverloadResolve): Avoid the
	use of hashtables and boxing here by allocating on demand.

svn path=/trunk/mcs/; revision=28522
2004-05-31 02:26:38 +00:00
Martin Baulig d31c6ef8d0 2004-05-30 Martin Baulig <[email protected]>
* 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  <[email protected]>

	Committing a patch from Ben Maurer.

	* rootcontext.cs (RootContext.LookupType): Cache negative results.

svn path=/trunk/mcs/; revision=28521
2004-05-31 02:24:04 +00:00
Martin Baulig 7af71bde6d Reverted everything back until 14:15:00 this afternoon.
svn path=/trunk/mcs/; revision=28520
2004-05-31 02:12:45 +00:00
Martin Baulig 53624cf702 Moved the marker again.
svn path=/trunk/mcs/; revision=28519
2004-05-31 01:18:45 +00:00
Martin Baulig 4f900ec539 **** Merged from MCS ****
svn path=/trunk/mcs/; revision=28518
2004-05-31 01:18:06 +00:00
Ben Maurer aa976d180b hush little baby, dont say a word
svn path=/trunk/mcs/; revision=28517
2004-05-31 01:13:30 +00:00
Ben Maurer 9221c586f1 disable this for now
svn path=/trunk/mcs/; revision=28516
2004-05-31 01:11:56 +00:00
Ben Maurer 74df29cff8 2004-05-30 Ben Maurer <[email protected]>
* convert.cs: add a trivial cache for overload operator resolution.

svn path=/trunk/mcs/; revision=28515
2004-05-30 23:11:04 +00:00
Ben Maurer f333a7fbb7 revert this patch, it broke the build
svn path=/trunk/mcs/; revision=28514
2004-05-30 22:49:58 +00:00
Jackson Harper 518da7775c * library.make: Install to 2.0 package if building with the
net_2_0 profile.

svn path=/trunk/mcs/; revision=28513
2004-05-30 22:44:38 +00:00
Ben Maurer de1565c510 2004-05-31 Marek Safar <[email protected]>
* 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.

svn path=/trunk/mcs/; revision=28512
2004-05-30 22:10:04 +00:00
Marek Safar df8d224980 2004-05-31 Marek Safar <[email protected]>
* 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.

svn path=/trunk/mcs/; revision=28511
2004-05-30 21:56:07 +00:00
Marek Safar 27e7e8ce15 2004-05-31 Marek Safar <[email protected]>
* 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.

	* 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.

svn path=/trunk/mcs/; revision=28510
2004-05-30 21:37:08 +00:00
Martin Baulig c69e5cf3df Oooops, forgot to add this.
svn path=/trunk/mcs/; revision=28509
2004-05-30 21:32:23 +00:00
Marek Safar 88c51c34b5 2004-05-30 Marek Safar <[email protected]>
* test-240.cs: Enable test.

svn path=/trunk/mcs/; revision=28508
2004-05-30 21:28:21 +00:00
Gonzalo Paniagua Javier a2890ef65c 2004-05-30 Gonzalo Paniagua Javier <[email protected]>
* Mono.Data.SqliteClient.dll.sources: added SqliteTransaction.cs

	* Mono.Data.SqliteClient/SqliteConnection.cs:
	* Mono.Data.SqliteClient/SqliteTransaction.cs: patch from
	[email protected] that adds transactions support.

svn path=/trunk/mcs/; revision=28507
2004-05-30 20:50:33 +00:00
Gonzalo Paniagua Javier 370c785c91 2004-05-30 Gert Driesen ([email protected])
* SetWin32ContextInIDispatchAttribute.cs: only build
	for NET_2_0 profile
	* VariantWrapper.cs: only build for NET_2_0 profile

svn path=/trunk/mcs/; revision=28506
2004-05-30 20:42:47 +00:00
Ben Maurer 03fc690667 2004-05-30 Ben Maurer <[email protected]>
* 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.

svn path=/trunk/mcs/; revision=28505
2004-05-30 20:37:58 +00:00
Ben Maurer 9027e9d1b2 add this
svn path=/trunk/mcs/; revision=28504
2004-05-30 20:33:08 +00:00
Atsushi Eno e21ad29117 2004-05-30 Atsushi Enomoto <[email protected]>
* RncTests.cs : fixed test that got impossible to build anymore.

svn path=/trunk/mcs/; revision=28503
2004-05-30 20:23:52 +00:00
Atsushi Eno 5cd74c6e93 2004-05-30 Atsushi Enomoto <[email protected]>
* RncParser.jay :
	  Now RncParser.Parse() returns RelaxngPattern, not RelaxngGrammar.
	  Fixed many "confusing RelaxngPattern and RelaxngPatternList"
	  problems, and ditto for other "List" stuff.
	  To avoid complex situations, mostly removed unused annotation stuff.

svn path=/trunk/mcs/; revision=28502
2004-05-30 20:23:26 +00:00
Atsushi Eno f03957145f 2004-05-30 Atsushi Enomoto <[email protected]>
* RelaxngDatatypeProvider.cs : removed meaningless using alias.
	* RelaxngGrammar.cs : modified ArrayList to RelaxngGrammarContentList.
	  RelaxngMergedProvider.cs : Added #if PNET switch to support non-
	  xmlschema available environment.
	* RelaxngPattern.cs : added IGrammarContent and
	  RelaxngGrammarContentList.

svn path=/trunk/mcs/; revision=28501
2004-05-30 20:22:51 +00:00
Miguel de Icaza 022f2a162c Start
svn path=/trunk/mono/; revision=28500
2004-05-30 20:18:01 +00:00
Martin Baulig 8bdc8dbbb8 2004-05-30 Martin Baulig <[email protected]>
* Makefile (net_2_0_dir): New variable; also use the correct
	directory here.

svn path=/trunk/mcs/; revision=28499
2004-05-30 19:52:04 +00:00
Marek Safar 86108c6777 2004-05-30 Marek Safar <[email protected]>
Fixed bug #59071 & cs0160.cs
	* statement.cs (Try.Resolve): Check here whether order of catch
	clauses matches their dependencies.

svn path=/trunk/mcs/; revision=28498
2004-05-30 19:51:00 +00:00
Sebastien Pouliot 782aff048c 2004-05-30 Sebastien Pouliot <[email protected]>
* FileStream.cs: Added missing validations.

svn path=/trunk/mcs/; revision=28497
2004-05-30 19:34:26 +00:00
Sebastien Pouliot 3666377b63 2004-05-30 Sebastien Pouliot <[email protected]>
* FileStream.cs: Lots of new tests for exception handling (negatives,
	disposed) and test reading a byte ast the end of the stream.

svn path=/trunk/mcs/; revision=28496
2004-05-30 19:18:50 +00:00
Atsushi Eno b20f049e63 2004-05-30 Atsushi Enomoto <[email protected]>
* DataTable.cs : serialization .ctor() should use XmlReadMode.DiffGram
	  for ReadXml(). Thanks to Boris.

svn path=/trunk/mcs/; revision=28495
2004-05-30 19:13:00 +00:00
Marek Safar 2f31aa3e43 2004-05-30 Marek Safar <[email protected]>
* cs1017.cs: New test.

svn path=/trunk/mcs/; revision=28494
2004-05-30 19:08:00 +00:00
Marek Safar b18d980fab 2004-05-30 Marek Safar <[email protected]>
Fixed bug #58624
	* ecore.cs (SimpleName.SimpleNameResolve): Added test for
	unsafe type.

svn path=/trunk/mcs/; revision=28493
2004-05-30 19:00:12 +00:00
Jackson Harper d857e242ab * AssemblyInfo.cs: Sign corlib for net_2_0 now too.
svn path=/trunk/mcs/; revision=28492
2004-05-30 17:58:43 +00:00
Sebastien Pouliot c716a7bd6f 2004-05-30 Sebastien Pouliot <[email protected]>
* BufferedStreamTest.cs: Added tests for Position after SetLength,
	SetLength after Close and Seek logic exception handling.
	* FileStream.cs: Added test for invalid SeekOrigin in Seek.
	* MemoryStream.cs: Added test for Seek after Close.

svn path=/trunk/mcs/; revision=28491
2004-05-30 17:58:09 +00:00
Sebastien Pouliot 50ad571d70 2004-05-30 Sebastien Pouliot <[email protected]>
* BufferedStream.cs: Fixed Seek logic (check for CanSeek and dispose).
	SetLength must also reset Position and check for dispose.
	* FileStream.cs: Added missing check for invalid SeekOrigin.

svn path=/trunk/mcs/; revision=28490
2004-05-30 17:52:35 +00:00
Jackson Harper 1fc3bcc2b8 * reflection.c: Do not hardcode assembly versions or public key
tokens anymore. All of this except the corlib section was dead
	code anyways.

svn path=/trunk/mono/; revision=28489
2004-05-30 17:19:24 +00:00
Martin Baulig 94abf32795 Small fix for NET_2_0.
svn path=/trunk/mcs/; revision=28488
2004-05-30 17:17:15 +00:00
Martin Baulig b47870a87b Small fix.
svn path=/trunk/mcs/; revision=28487
2004-05-30 17:04:33 +00:00
Martin Baulig 957bc1dbe3 Make things work again.
This should have been done during merging.

svn path=/trunk/mcs/; revision=28486
2004-05-30 16:59:41 +00:00
Martin Baulig a5d9b3f229 Fix typo (base_classs_type' -> base_class_type').
svn path=/trunk/mcs/; revision=28485
2004-05-30 16:20:02 +00:00
Martin Baulig 374bdf5cd7 Moved the marker.
svn path=/trunk/mcs/; revision=28484
2004-05-30 16:08:34 +00:00
Martin Baulig fee32a49f5 **** Merged from MCS ****
svn path=/trunk/mcs/; revision=28483
2004-05-30 16:06:13 +00:00
Ben Maurer c7f63eecba 2004-05-30 Ben Maurer <[email protected]>
* expression.cs (Invocation.OverloadResolve): Avoid the
	use of hashtables and boxing here by allocating on demand.

svn path=/trunk/mcs/; revision=28482
2004-05-30 15:48:50 +00:00
Martin Baulig 3920aa8c5c 2004-05-30 Martin Baulig <[email protected]>
* 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).

svn path=/trunk/mcs/; revision=28481
2004-05-30 15:42:56 +00:00
Sebastien Pouliot 502882dde2 2004-05-30 Sebastien Pouliot <[email protected]>
* BinaryReader.cs: Added missing disposed check for most methods.
	Reordered some exceptions to match MS implementation.

svn path=/trunk/mcs/; revision=28480
2004-05-30 15:10:15 +00:00
Martin Baulig 6a30d9b3c6 2004-05-30 Martin Baulig <[email protected]>
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.

svn path=/trunk/mcs/; revision=28477
2004-05-30 14:12:23 +00:00
Martin Baulig e1029c24e4 **** Merged from MCS ****
svn path=/trunk/mcs/; revision=28476
2004-05-30 14:10:53 +00:00
Martin Baulig e6971e6673 2004-05-30 Martin Baulig <[email protected]>
Committing a patch from Ben Maurer.

	* rootcontext.cs (RootContext.LookupType): Cache negative results.

svn path=/trunk/mcs/; revision=28475
2004-05-30 12:58:09 +00:00
Gonzalo Paniagua Javier 2f8403bcf4 *** empty log message ***
svn path=/trunk/mcs/; revision=28474
2004-05-30 11:57:18 +00:00
Gonzalo Paniagua Javier 83c5cdea3c 2004-05-30 Gonzalo Paniagua Javier <[email protected]>
* DateTime.cs: adjust milliseconds for fraction specifier ('f').

svn path=/trunk/mcs/; revision=28473
2004-05-30 11:45:33 +00:00
David Sheldon cd7a35cae1 2004-05-30 David Sheldon <[email protected]>
* StackFrameTest.cs: Mark the failures that have been failing
	for months due to bug 45730 as ignored as it doesn't look like
	it will be fixed soon.

My aim with these commits is that eventually people will run the test cases,
and see what errors they have caused, rather than tens of pages of stacktraces.

svn path=/trunk/mcs/; revision=28472
2004-05-30 08:23:00 +00:00
David Sheldon b03e7fffb8 2004-05-30 David Sheldon <[email protected]>
* DecimalTest.cs: Moved the rounding test that fails due to
    bug 37744 (bankers rounding) into its own test, and annotated it as ignored
    until the bug is fixed.

svn path=/trunk/mcs/; revision=28471
2004-05-30 08:02:01 +00:00
Miguel de Icaza 819395604c 2004-05-30 Miguel de Icaza <[email protected]>
* Console.cs: Remove *again* the version of WriteLine with four
	arguments;  That should *not* be added.

	Flag it as internal as people migrate their code.

svn path=/trunk/mcs/; revision=28469
2004-05-30 05:39:21 +00:00
Atsushi Eno 4fc67d1a14 2004-05-30 Atsushi Enomoto <[email protected]>
* XmlTextReader.cs : Fixed version mismatch; ProhibitDtd should be
	  NET_2_0.

svn path=/trunk/mcs/; revision=28468
2004-05-30 04:07:19 +00:00
Sebastien Pouliot 2c47c798a5 2004-05-29 Sebastien Pouliot <[email protected]>
* BinaryReader.cs: Added new cases to check exceptions thrown by Read
	methods.

svn path=/trunk/mcs/; revision=28467
2004-05-29 22:44:01 +00:00
Zoltan Varga 4a791732ff 2004-05-29 Zoltan Varga <[email protected]>
* invoke.cs: Add an Invoke test.

svn path=/trunk/mono/; revision=28465
2004-05-29 19:22:32 +00:00
Zoltan Varga a1e21f8406 2004-05-29 Zoltan Varga <[email protected]>
* object.c (mono_runtime_invoke_array): Automatically create boxed
	objects for byref valuetypes if needed. Fixes #59300.

svn path=/trunk/mono/; revision=28464
2004-05-29 19:20:49 +00:00
Sebastien Pouliot 942bdbd5f4 2004-05-29 Sebastien Pouliot <[email protected]>
* Convert.cs: Fixed ChangeTo where null could be misinterpreted
	between null and Empty.

svn path=/trunk/mcs/; revision=28462
2004-05-29 18:47:09 +00:00
Zoltan Varga ae63609233 2004-05-29 Zoltan Varga <[email protected]>
* object.c (mono_method_return_message_restore): Handle
	MONO_TYPE_OBJECT as well.

svn path=/trunk/mono/; revision=28461
2004-05-29 18:29:35 +00:00
Zoltan Varga 5e69101fb5 2004-05-29 Zoltan Varga <[email protected]>
* exceptions.cs: New regression tests.

	* jit-icalls.c (mono_llmult_ovf): Fix some boundary conditions.

svn path=/trunk/mono/; revision=28460
2004-05-29 18:16:08 +00:00
Sebastien Pouliot 71e6af6bfb 2004-05-29 Sebastien Pouliot <[email protected]>
* ConvertTest.cs: Added test to ChangeType to Empty.

svn path=/trunk/mcs/; revision=28459
2004-05-29 18:12:28 +00:00
Martin Baulig 4cb79d4939 2004-05-29 Martin Baulig <[email protected]>
* 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.

svn path=/trunk/mcs/; revision=28458
2004-05-29 18:03:07 +00:00
Martin Baulig c299d9423a 2004-05-29 Martin Baulig <[email protected]>
* test-266.cs: New test for #52578.

svn path=/trunk/mcs/; revision=28457
2004-05-29 17:41:42 +00:00
Martin Baulig 4b82041b60 2004-05-29 Martin Baulig <[email protected]>
Committing a patch from Benjamin Jemlich <[email protected]>.

	* 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.

svn path=/trunk/mcs/; revision=28456
2004-05-29 17:40:21 +00:00
Martin Baulig fe699eac7f 2004-05-29 Martin Baulig <[email protected]>
* test-265.cs: New test for #59267.

svn path=/trunk/mcs/; revision=28455
2004-05-29 17:29:34 +00:00
Martin Baulig 1a336cbb03 2004-05-29 Martin Baulig <[email protected]>
* test-264.cs: New test for #59188.

svn path=/trunk/mcs/; revision=28454
2004-05-29 17:28:30 +00:00
Martin Baulig 6cb5277b61 2004-05-29 Martin Baulig <[email protected]>
* class.cs (ConstructorInitializer.GetOverloadedConstructor):
	Added support for `params' parameters.  Fixes #59267.

svn path=/trunk/mcs/; revision=28453
2004-05-29 17:27:57 +00:00
Sebastien Pouliot ac9098f000 2004-05-29 Sebastien Pouliot <[email protected]>
* Convert.cs: Fixed ToSByte(string,IFormatProvider) to throw
	ArgumentNullException (only case, all other returns 0). Fixed exception
	reporting for hex prefix only strings.

svn path=/trunk/mcs/; revision=28450
2004-05-29 16:56:04 +00:00
Miguel de Icaza 4b541b39b1 Update
svn path=/trunk/mono/; revision=28448
2004-05-29 16:42:23 +00:00
Miguel de Icaza bf7f10d598 update
svn path=/trunk/mcs/; revision=28447
2004-05-29 16:41:43 +00:00
Miguel de Icaza b346b5fdd2 up
svn path=/trunk/mcs/; revision=28446
2004-05-29 16:40:57 +00:00
Zoltan Varga 6dd9ea60dd 2004-05-29 Zoltan Varga <[email protected]>
* configure.in: export CC instead of passing it to libgc/configure.

svn path=/trunk/mono/; revision=28445
2004-05-29 16:32:27 +00:00
Sebastien Pouliot 3f625156e6 2004-05-29 Sebastien Pouliot <[email protected]>
* ConvertTest.cs: Added new parsing tests including special case for
	Convert.ToSByte.
	* Int64Test.cs: Added new test cases for overflows.

svn path=/trunk/mcs/; revision=28444
2004-05-29 16:31:32 +00:00
Gonzalo Paniagua Javier d311a8974f 2004-05-29 Gonzalo Paniagua Javier <[email protected]>
* ChangeLog:
	* Comparer.cs: reverted last 2 patches from Gert Driesen. Totally wrong.
	I wonder why.

svn path=/trunk/mcs/; revision=28441
2004-05-29 14:56:35 +00:00
Sebastien Pouliot a9dc7c1423 2004-05-29 Sebastien Pouliot <[email protected]>
* CspProviderFlags.cs: Reverted previous patch as UseExistingKey isn't
	part of the 1.0/1.1 framework.

svn path=/trunk/mcs/; revision=28440
2004-05-29 14:48:10 +00:00
Gonzalo Paniagua Javier 560e4580b9 2004-05-29 Gonzalo Paniagua Javier <[email protected]>
* ObjectWriter.cs: reduce contention in GetObjectData.

svn path=/trunk/mcs/; revision=28439
2004-05-29 14:23:10 +00:00
Gert Driesen ddc29a68dc * System.Messaging/Acknowledgment.cs: added/corrected values,
removed TODO
* System.Messaging/MessageQueueErrorCode.cs: fixed typo
* System.Messaging/MessageQueueAccessRights.cs: removed extra
enum field

svn path=/trunk/mcs/; revision=28438
2004-05-29 12:43:03 +00:00
Francisco Figueiredo Jr. b767d8ce93 2004-05-29 Francisco Figueiredo Jr. <[email protected]>
* Npgsql/NpgsqlConnection.cs: Added workaround for redhat server versions.
	It returns 7.3.4-RH as its server version. Thanks Jaroslaw Kowalski
([email protected]) for the patch.

svn path=/trunk/mcs/; revision=28437
2004-05-29 12:39:05 +00:00
Gert Driesen 31d3a9249b * Compare.cs: ISerializable should only be implemented
for NET_1_1 profile

svn path=/trunk/mcs/; revision=28436
2004-05-29 12:18:54 +00:00
Gert Driesen 31ce1e8731 * XmlTextReader.cs: Added ProhibitDtd property for NET 1.1 to match
public API in MS.NET 1.1

svn path=/trunk/mcs/; revision=28435
2004-05-29 12:09:06 +00:00
Martin Baulig 0ea9548259 2004-05-29 Martin Baulig <[email protected]>
* literal.cs (NullPointer): Provide a private .ctor which sets
	`type' to TypeManager.object_type.  Fixes #59048.

svn path=/trunk/mcs/; revision=28434
2004-05-29 11:58:51 +00:00
Gert Driesen 6966c937a7 * CspProviderFlags.cs: Added missing enum field UseExistingKey
svn path=/trunk/mcs/; revision=28433
2004-05-29 11:54:24 +00:00
Martin Baulig 4ed05be113 2004-05-29 Martin Baulig <[email protected]>
* test-264.cs: New test for #59188.

2004-05-27  Marek Safar <[email protected]>

	* test-263.cs: New test.

svn path=/trunk/mcs/; revision=28432
2004-05-29 11:50:44 +00:00
Martin Baulig 468605ade8 2004-05-29 Martin Baulig <[email protected]>
* expression.cs (MemberAccess.ResolveMemberAccess): If we're an
	EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.

	* ecore.cs (EventExpr.instance_expr): Make the field private.

svn path=/trunk/mcs/; revision=28431
2004-05-29 11:48:06 +00:00
Gert Driesen 8e85175c9f * corlib.dll.sources: added SetWin32ContextInIDispatchAttribute
and VariantWrapper

svn path=/trunk/mcs/; revision=28430
2004-05-29 11:47:40 +00:00
Gert Driesen 52b617c26d * SetWin32ContextInIDispatchAttribute.cs: added
* VariantWrapper.cs: added

svn path=/trunk/mcs/; revision=28429
2004-05-29 11:47:08 +00:00
Gert Driesen 33a27d220a * Compare.cs: Implemented ISerializable, fixes public API
svn path=/trunk/mcs/; revision=28428
2004-05-29 11:10:08 +00:00
Paolo Molaro 14fd5a011c Sat May 29 10:45:58 CEST 2004 Paolo Molaro <[email protected]>
* mini.c: emit castclass/isinst in their own trees (bug #54209/59057).

svn path=/trunk/mono/; revision=28427
2004-05-29 08:05:51 +00:00
Gert Driesen fbc5540411 * AssemblyBuilder.cs: removed extra method, fixes public API
compatibility with MS.NET
* TypeBuilder.cs: removed extra method, fixes public API
compatibility with MS.NET

svn path=/trunk/mcs/; revision=28426
2004-05-29 07:50:08 +00:00
Gonzalo Paniagua Javier 5c116b3809 update version
svn path=/trunk/mcs/; revision=28423
2004-05-29 02:10:28 +00:00
Gonzalo Paniagua Javier 041074c05c update and cleanup
svn path=/trunk/mono/; revision=28422
2004-05-29 02:06:59 +00:00
Duncan Mak 2eec15c2c2 Fix
svn path=/trunk/mcs/; revision=28421
2004-05-29 01:50:37 +00:00
Duncan Mak c036498ee3 2004-05-28 Duncan Mak <[email protected]>
* SharpZipLib.pub: Added public key.

	* AssemblyInfo.cs: Use the new SharpZipLib.pub.

svn path=/trunk/mcs/; revision=28420
2004-05-29 01:43:13 +00:00
Duncan Mak 348cc03c6b 2004-05-28 Duncan Mak <[email protected]>
* Zip/Compression/DeflaterHuffman.cs (FlushBlock): Add some
	parenthesis to help the generics compiler read this source.

svn path=/trunk/mcs/; revision=28419
2004-05-29 01:21:29 +00:00
Jackson Harper bf10762927 * reflection.c: The modified type encoding was causing build
problems. Reverted for now.

svn path=/trunk/mono/; revision=28417
2004-05-29 00:33:48 +00:00
Duncan Mak 539f93dc9b Weird! How did that get in there?
svn path=/trunk/mono/; revision=28416
2004-05-29 00:30:26 +00:00
Ben Maurer 100b11f54e fixeypoo
svn path=/trunk/mcs/; revision=28415
2004-05-29 00:19:40 +00:00
Duncan Mak 9c5054496a Fixity fix
svn path=/trunk/mono/; revision=28414
2004-05-29 00:17:56 +00:00
Duncan Mak 44e346f730 Add mono-find-provides and mono-find-requires
svn path=/trunk/mono/; revision=28413
2004-05-29 00:09:34 +00:00
Gonzalo Paniagua Javier e803963be2 2004-05-29 Gonzalo Paniagua Javier <[email protected]>
* WebConnectionStream.cs: fixed CanRead property. Closes bug #59273.

svn path=/trunk/mcs/; revision=28412
2004-05-28 23:54:19 +00:00
Duncan Mak 00afe48c72 * runtime/Makefile.am:
* scripts/Makefile.am: Include mono-find-provides and
mono-find-requires.

svn path=/trunk/mono/; revision=28411
2004-05-28 23:49:32 +00:00
Sebastien Pouliot 20205363c3 2004-05-28 Sebastien Pouliot <[email protected]>
* Convert.cs: Fixed the case when we parse Int64.MinValue (positive
	doesn't fit a signed long).

svn path=/trunk/mcs/; revision=28410
2004-05-28 23:48:05 +00:00
Jackson Harper c5ee2c6e20 * 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.

svn path=/trunk/mono/; revision=28409
2004-05-28 23:37:42 +00:00
Duncan Mak 0462988716 * scripts/Makefile.am: Include mono-find-provides and
mono-find-requires.

* scripts/mono-find-provides.in:
* scripts/mono-find-requires.in: New wrapper scripts.

svn path=/trunk/mono/; revision=28408
2004-05-28 23:33:19 +00:00
Duncan Mak 9df2d2b132 2004-05-26 Duncan Mak <[email protected]>
* icall.c
	(ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
	Set the full version number (major, minor, build, revision).

svn path=/trunk/mono/; revision=28407
2004-05-28 23:28:44 +00:00
Jackson Harper ab9ac534ec * appdomain.c: Increment version number.
svn path=/trunk/mono/; revision=28404
2004-05-28 22:36:45 +00:00
Ben Maurer 443a7ccc56 import .6
svn path=/trunk/mcs/; revision=28391
2004-05-28 20:53:20 +00:00
Peter Dennis Bartok bbc196f353 - Fixes for ContainerControl, ScrollableControl and UserControl, fixes some
of the issues I found with the pnet Coding Developers (Dining
  Philosophers) sample app. We now at least draw on screen :-)

svn path=/trunk/mcs/; revision=28390
2004-05-28 20:31:10 +00:00
Sebastien Pouliot f712d57b1d 2004-05-28 Sebastien Pouliot <[email protected]>
* Convert.cs: Fixed integer parsing for special cases (0x, 0X for base
	16), non-base 10 negative numbers ... see new unit tests.

svn path=/trunk/mcs/; revision=28389
2004-05-28 20:20:09 +00:00
Sebastien Pouliot 2bba2cb921 2004-05-28 Sebastien Pouliot <[email protected]>
* ConvertTest.cs: Added case for a prefixed hexadecimal without a number.

svn path=/trunk/mcs/; revision=28388
2004-05-28 19:51:19 +00:00
Jackson Harper 84b44740df * Environment.cs: Increment version number.
svn path=/trunk/mcs/; revision=28382
2004-05-28 19:01:22 +00:00
Jackson Harper 659bbbf9ed * CustomAttributeBuilder.cs: GetBlob now takes a ref to the
assembly so it can encode type names properly.

svn path=/trunk/mcs/; revision=28381
2004-05-28 18:59:37 +00:00
César Natarén 2f2dc9b0d1 2004-05-28 Cesar Lopez Nataren <[email protected]>
* switch.js: added clause after default

svn path=/trunk/mcs/; revision=28379
2004-05-28 18:47:04 +00:00
Sebastien Pouliot 4a36e8f8d3 2004-05-28 Sebastien Pouliot <[email protected]>
* ConvertTest.cs: Added new tests for pasring MinValue and MaxValue
	of integer types in all supported bases.

svn path=/trunk/mcs/; revision=28378
2004-05-28 18:46:47 +00:00
César Natarén df9f0d3bf7 updates from grammar changes
svn path=/trunk/mcs/; revision=28377
2004-05-28 18:39:31 +00:00
César Natarén 3d8ec43e8e 2004-05-28 Cesar Lopez Nataren <[email protected]>
* Statement.cs: changed parent_is_itr_stm method to ParentIsItrStm
	property. Added initial pieces for Break's Resolve. Fixed bug that
	did not let Emit the code for case clauses that came after the
	default clause (we match the jsc behavior).

svn path=/trunk/mcs/; revision=28376
2004-05-28 18:37:29 +00:00
Zoltan Varga d9ac812f0e 2004-05-28 Vladimir Vukicevic <[email protected]>
* 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

svn path=/trunk/mono/; revision=28375
2004-05-28 18:30:22 +00:00
Gonzalo Paniagua Javier ccf4e0f3ad 2004-05-28 Gonzalo Paniagua Javier <[email protected]>
* 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.

svn path=/trunk/mono/; revision=28374
2004-05-28 18:28:21 +00:00
César Natarén 0d0977764d set parent of switch's clauses
svn path=/trunk/mcs/; revision=28373
2004-05-28 18:25:53 +00:00
Sebastien Pouliot b7b4ddd52f 2004-05-28 Sebastien Pouliot <[email protected]>
* AssemblyInfo.cs: Update version number for beta 2.

svn path=/trunk/mcs/; revision=28370
2004-05-28 17:54:19 +00:00
Zoltan Varga be04be228d 2004-05-28 Zoltan Varga <[email protected]>
* mini-sparc.h (MONO_ARCH_NEED_DIV_CHECK): Define this.

svn path=/trunk/mono/; revision=28368
2004-05-28 17:43:38 +00:00
Zoltan Varga 095130eca6 2004-05-28 Zoltan Varga <[email protected]>
* cpu-sparc.md mini-sparc.c: Add overflow detection to div opcodes.

svn path=/trunk/mono/; revision=28366
2004-05-28 17:27:16 +00:00
Zoltan Varga d18c179d5e 2004-05-28 Zoltan Varga <[email protected]>
* pinvoke3.cs libtest.c: New tests for byref struct marshalling.

svn path=/trunk/mono/; revision=28365
2004-05-28 17:26:37 +00:00
Zoltan Varga 778d849ef0 2004-05-28 Zoltan Varga <[email protected]>
* marshal.c (mono_marshal_get_managed_wrapper): Add proper support for
	byref struct arguments in native->managed marshalling.

svn path=/trunk/mono/; revision=28364
2004-05-28 17:23:50 +00:00
Miguel de Icaza 0a2fccb980 Up
svn path=/trunk/mono/; revision=28363
2004-05-28 17:14:27 +00:00
Patrik Torstensson 12561b45b4 2004-05-28 Patrik Torstensson <[email protected]>
* 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)

svn path=/trunk/mono/; revision=28359
2004-05-28 16:22:40 +00:00
Patrik Torstensson 4dc959ad28 2004-05-28 Patrik Torstensson <[email protected]>
* 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.

svn path=/trunk/mono/; revision=28358
2004-05-28 16:21:23 +00:00
Gonzalo Paniagua Javier 37dc7f44c1 2004-05-28 Gonzalo Paniagua Javier <[email protected]>
* mono-config.c: set the correct path for mono_cfg_dir on windows when
	there's no MONO_CFG_DIR environment variable defined.

svn path=/trunk/mono/; revision=28357
2004-05-28 16:18:18 +00:00
Zoltan Varga d8e15dec91 2004-05-28 Zoltan Varga <[email protected]>
* AppDomain.cs (Load): Try loading from assemblyRef.CodeBase if exists.
	Fixes #59189.

svn path=/trunk/mcs/; revision=28356
2004-05-28 16:14:00 +00:00
Gonzalo Paniagua Javier 11f4b5566f 2004-05-28 Gonzalo Paniagua Javier <[email protected]>
* threads.c: windows version must be >= 0x0500 to include OpenThread.

svn path=/trunk/mono/; revision=28352
2004-05-28 15:27:12 +00:00
nobody 4e4824afab This commit was manufactured by cvs2svn to create branch 'SAVANNAH_CVS'.
svn path=/branches/SAVANNAH_CVS/mcs/; revision=6844
2002-08-21 10:08:33 +00:00
2031 changed files with 62675 additions and 15910 deletions

No files matched your search

+78
View File
@@ -1,3 +1,81 @@
Mon Jun 14 18:38:34 CEST 2004 Paolo Molaro <[email protected]>
* 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 <[email protected]>
* Makefile.am (populate-runtime-subdir): Add _tmpinst directory
to the PATH.
2004-06-11 Jackson Harper <[email protected]>
* runtime/net_2_0/Makefile.am:
* runtime/net_1_1/Makefile.am: Remove signing patches
2004-06-11 Jackson Harper <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
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 <[email protected]>
* configure.in: libc setting for NetBSD (patch from [email protected]).
2004-06-01 Raja R Harinath <[email protected]>
* 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 <[email protected]>
* configure.in: fixlets for windows.
2004-05-29 Zoltan Varga <[email protected]>
* configure.in: export CC instead of passing it to libgc/configure.
2004-05-28 Duncan Mak <[email protected]>
* 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 <[email protected]>
* configure.in: Pass CC to libgc configure.
+94 -82
View File
@@ -1,4 +1,5 @@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I .
SUBDIRS = @libgc_dir@ mono @ikvm_jni_dir@ docs runtime scripts man data samples support web
@@ -17,16 +18,16 @@ endif
DISTCLEANFILES= mono.pc mint.pc
#
# The following target is used to compile and install
# 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.
#
mcs_topdir=$(top_srcdir)/../mcs
.PHONY: tmpinst-dir tmpinst-basic-build tmpinst-short-build tmpinst-full-build
.PHONY: bootstrap faststrap fasterstrap one-stage-strap two-stage-strap three-stage-strap bootstrap-clean bootstrap-check
.PHONY: mono-do-basic-build mcs-do-basic-build mcs-do-short-build mcs-do-full-build mcs-do-clean-profiles mcs-do-run-test
.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
if USE_JIT
mono_runtime = mono/mini/mono
@@ -34,74 +35,99 @@ else
mono_runtime = mono/interpreter/mint
endif
bootstrap: three-stage-strap
# 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
faststrap: mono-do-basic-build
$(MAKE) two-stage-strap
# 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.CSharp.Debugger.dll
fasterstrap: mono-do-basic-build
$(MAKE) one-stage-strap
tmpinst = _tmpinst
three-stage-strap: tmpinst-basic-build
$(MAKE) two-stage-strap
bootstrap: tmpinst-mcs-basic-build mono-do-runtime-only
$(MAKE) tmpinst-mcs-short-build
$(MAKE) fasterstrap
two-stage-strap: tmpinst-short-build
$(MAKE) one-stage-strap
faststrap: tmpinst-mcs-short-build
$(MAKE) mono-do-runtime-only
$(MAKE) fasterstrap
one-stage-strap: tmpinst-full-build
rm -f $(top_srcdir)/runtime/*/*.dll $(top_srcdir)/runtime/*.exe
.PHONY: populate-runtime-subdir
## *** warning ***: tested only with GNU make
populate-runtime-subdir:
srcdir=`cd $(srcdir) && pwd`; tmpinst=`pwd`/$(tmpinst) ; \
PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
cd $(mcs_topdir) \
&& $(MAKE) PROGRAM_INSTALL_DIR=$$srcdir/runtime LIBRARY_INSTALL_DIR=$$srcdir/runtime/net_1_1 prefix=$$tmpinst/prefix PROFILE=default install \
&& $(MAKE) PROGRAM_INSTALL_DIR=$$srcdir/runtime LIBRARY_INSTALL_DIR=$$srcdir/runtime/net_2_0 prefix=$$tmpinst/prefix PROFILE=net_2_0 install
test -z "`find $(tmpinst)/prefix -name '*.dll'`"
test -z "`find $(tmpinst)/prefix -name '*.exe'`"
set fnord `find $(tmpinst)/prefix -type f | wc -l` ; test "$$2" = 9
rm -rf $(tmpinst)/prefix
fasterstrap: tmpinst-mcs-full-build
$(MAKE) populate-runtime-subdir
$(MAKE)
bootstrap-clean: clean mcs-do-clean-profiles
bootstrap-check: check mcs-do-run-test
# (takes advantage of 'make -j': independent subtasks are separate dependencies)
tmpinst-basic-build: mcs-do-basic-build mono-do-basic-build tmpinst-dir
mv -f $(mcs_topdir)/mcs/mcs.exe \
$(mcs_topdir)/class/lib/default/mscorlib.dll \
$(mcs_topdir)/class/lib/default/System.dll \
_tmpinst/lib
# building with monolite
tmpinst-short-build: mcs-do-short-build
mv -f $(mcs_topdir)/mcs/mcs.exe \
$(mcs_topdir)/class/lib/default/mscorlib.dll \
$(mcs_topdir)/class/lib/default/System.dll \
$(mcs_topdir)/class/lib/default/System.Xml.dll \
$(mcs_topdir)/class/lib/default/Mono.CSharp.Debugger.dll \
_tmpinst/lib
get-monolite-latest:
wget -O $(srcdir)/../monolite-latest.tar.gz http://www.go-mono.com/daily/monolite-latest.tar.gz
tmpinst-full-build: mcs-do-full-build
cp -f $(mcs_topdir)/mcs/mcs.exe \
$(mcs_topdir)/class/lib/default/mscorlib.dll \
$(mcs_topdir)/class/lib/default/System.dll \
$(mcs_topdir)/class/lib/default/System.Xml.dll \
$(mcs_topdir)/class/lib/default/Mono.CSharp.Debugger.dll \
_tmpinst/lib
monolite-bootstrap: tmpinst-monolite mono-do-runtime-only
rm -f $(MCS_FILES)
$(MAKE) tmpinst-mcs-short-build
$(MAKE) fasterstrap
# 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-basic-build: $(CONFIG_HEADER)
if test -z "$(libgc_dir)"; then :; else cd libgc && $(MAKE) ; fi
cd mono && $(MAKE)
mono-do-runtime-only: $(CONFIG_HEADER)
for dir in $(libgc_dir) mono data; do \
(cd $$dir && $(MAKE)) || exit 1 ; \
done
# Build stripped down versions of 'mcs', 'mscorlib.dll' and 'System.dll' with installed 'mcs'
## remove System.Xml.dll since it's a soft-dependency of System.dll
mcs-do-basic-build:
rm -f $(mcs_topdir)/mcs/mcs.exe $(mcs_topdir)/class/lib/default/mscorlib.dll
rm -f $(mcs_topdir)/class/lib/default/System.dll $(mcs_topdir)/class/lib/default/System.Xml.dll
cd $(mcs_topdir)/jay && $(MAKE)
cd $(mcs_topdir)/mcs && $(MAKE) PROFILE=default BOOTSTRAP_MCS="mcs -d:BOOTSTRAP_WITH_OLDLIB"
cd $(mcs_topdir)/class/corlib && $(MAKE) PROFILE=default BOOTSTRAP_MCS="mcs -d:BOOTSTRAP_WITH_OLDLIB"
cd $(mcs_topdir)/class/System && $(MAKE) PROFILE=default BOOTSTRAP_MCS="mcs -d:BOOTSTRAP_WITH_OLDLIB"
mcs-do-basic-build:
rm -f $(MCS_FILES)
for dir in $(MCS_BASIC_DIRS); do \
(cd $(mcs_topdir)/$$dir && $(MAKE) PROFILE=default USE_BOOT_COMPILE=yes BOOTSTRAP_MCS="mcs -d:BOOTSTRAP_WITH_OLDLIB") || exit 1 ; \
done
mcs-do-short-build:
tmpinst=`cd _tmpinst && pwd` ; \
tmpinst=`cd $(tmpinst) && pwd` ; \
PATH=$$tmpinst/bin:$$PATH; export PATH ; \
for dir in jay mcs class/corlib class/System class/System.XML class/System class/Mono.CSharp.Debugger; do \
for dir in $(MCS_DIRS); do \
(cd $(mcs_topdir)/$$dir && $(MAKE) PROFILE=default) || exit 1 ; \
done
mcs-do-full-build:
tmpinst=`cd _tmpinst && pwd` ; \
tmpinst=`cd $(tmpinst) && pwd` ; \
PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
cd $(mcs_topdir) && $(MAKE) all-profiles
@@ -109,44 +135,30 @@ mcs-do-clean-profiles:
cd $(mcs_topdir) && $(MAKE) clean-profiles
mcs-do-run-test: tmpinst-dir
tmpinst=`cd _tmpinst && pwd` ; \
tmpinst=`cd $(tmpinst) && pwd` ; \
PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
cd $(mcs_topdir) && $(MAKE) PROFILE=default run-test
tmpinst-dir.stamp: Makefile.am
set -e ; \
rootme=`pwd`; tmpinst=$$rootme/_tmpinst ; \
mkdir -p $$tmpinst $$tmpinst/bin $$tmpinst/lib ; \
echo '#! /bin/sh' > $$tmpinst/bin/mono ; \
echo 'if test -z "$$MONO_PATH" ; then MONO_PATH="'"$$tmpinst/lib"'"' >> $$tmpinst/bin/mono ; \
echo 'else MONO_PATH=$${MONO_PATH}:"'"$$tmpinst/lib"'" ; fi' >> $$tmpinst/bin/mono ; \
echo 'export MONO_PATH' >> $$tmpinst/bin/mono ; \
echo 'exec "'"$$rootme/libtool"'" --mode=execute "'"$$rootme/$(mono_runtime)"'" "$$@"' >> $$tmpinst/bin/mono ; \
echo '#! /bin/sh' > $$tmpinst/bin/mcs ; \
echo 'exec "'"$$tmpinst/bin/mono"'" "'"$$tmpinst/lib/mcs.exe"'" "$$@"' >> $$tmpinst/bin/mcs ; \
chmod +x $$tmpinst/bin/mono $$tmpinst/bin/mcs
echo "stamp" > $@
tmpinst-dir:
mkdir -p $(tmpinst) $(tmpinst)/bin $(tmpinst)/lib $(tmpinst)/etc/mono
$(MAKE) $(tmpinst)/bin/mono $(tmpinst)/bin/mcs $(tmpinst)/etc/mono/machine.config
tmpinst-dir: tmpinst-dir.stamp
@if test -d _tmpinst; then :; else rm -f tmpinst-dir.stamp; $(MAKE) tmpinst-dir.stamp; fi
$(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 $@
$(tmpinst)/bin/mcs: $(srcdir)/Makefile.am
(t=`cd $(tmpinst) && pwd`; echo '#! /bin/sh'; echo 'exec "'"$$t/bin/mono"'" "'"$$t/lib/mcs.exe"'" "$$@"') > $@
chmod +x $@
# building with monolite
get-monolite-latest:
wget -O $(srcdir)/../monolite-latest.tar.gz http://www.go-mono.com/daily/monolite-latest.tar.gz
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-*
monolite-bootstrap: tmpinst-monolite mono-do-basic-build
rm -f $(mcs_topdir)/mcs/mcs.exe $(mcs_topdir)/class/lib/default/mscorlib.dll
rm -f $(mcs_topdir)/class/lib/default/System.dll $(mcs_topdir)/class/lib/default/System.Xml.dll Mono.CSharp.Debugger.dll
$(MAKE) two-stage-strap
$(tmpinst)/etc/mono/machine.config: $(srcdir)/data/machine.config
rm -f $@
srcdir=`cd $(srcdir) && pwd`; cd $(tmpinst)/etc/mono && $(LN_S) $$srcdir/data/machine.config machine.config
# Obsolete target -- don't use.
.PHONY: fullbuild
+22 -9
View File
@@ -1,9 +1,11 @@
AC_INIT(README)
AC_CANONICAL_SYSTEM
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(mono,0.92)
AM_INIT_AUTOMAKE(mono,0.96)
AM_MAINTAINER_MODE
AC_PROG_LN_S
dnl
dnl libgc checks
dnl
@@ -42,12 +44,18 @@ case "$host" in
AC_DEFINE(PLATFORM_WIN32,1,[Platform is Win32])
CC="gcc -mno-cygwin"
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=boehm
with_nptl=no
with_sigaltstack=no
LN_S=cp
;;
*-*-*netbsd*)
platform_win32=no
@@ -238,14 +246,15 @@ AC_SUBST(GMODULE_LIBS)
AC_ARG_WITH(gc, [ --with-gc=boehm,included,none],[gc=$with_gc],[gc=$gc_default])
# Enable support for NPTL only features like fast thread-local storage
# We can't reliably detect nptl at compile & run time
# so this option will stay until nptl becomes more widespread
AC_ARG_WITH(nptl, [ --with-nptl=yes,no enable/disable support for NPTL],[],[with_nptl=yes])
# Enable support for fast thread-local storage
# Some systems have broken support, so we allow to disable it.
# This is misnamed: __thread support has no relation to NPTL,
# but people already use it...
AC_ARG_WITH(nptl, [ --with-nptl=yes,no enable/disable support for __thread support],[],[with_nptl=yes])
# 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=yes])
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],[
@@ -317,7 +326,7 @@ esac
# tell libgc/configure about what we want
ac_configure_args="$ac_configure_args --disable-embed-check --with-libgc-threads=$libgc_threads CC=$CC"
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)
@@ -896,6 +905,7 @@ if test x$platform_win32 = xno; then
AC_DEFINE_UNQUOTED(SIGVAL_PTR,$SIGVAL_PTR,[Pointer field name in 'union sigval'])
fi
else
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?))
fi
@@ -947,7 +957,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
@@ -1132,6 +1142,9 @@ case "$host" in
libsuffix=".dylib"
LIBC="libc.dylib"
;;
*-*-*netbsd*)
LIBC="libc.so.12"
;;
esac
AC_SUBST(libsuffix)
@@ -1246,7 +1259,7 @@ echo "
GC: $gc
ICU: $enable_icu
NPTL: $with_nptl
__thread: $with_nptl
SIGALTSTACK: $with_sigaltstack
Engine: $jit_status
2.0 Alpha: $PREVIEW
+15
View File
@@ -35,6 +35,8 @@
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"
@@ -190,6 +192,19 @@
</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>
+16
View File
@@ -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.
+28 -20
View File
@@ -238,10 +238,10 @@ Finally, namespaces can be specified using the N: prefix:
Turns off the garbage collection in Mono. This should be only used
for debugging purposes
.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
.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 "MONO_CFG_DIR"
If set, this variable overrides the default system configuration directory
@@ -269,18 +269,41 @@ 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 "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 "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.
.TP
.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 "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_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_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 "MONO_SHARED_DIR"
If set its the directory where the ".wapi" handle state is stored.
@@ -296,21 +319,6 @@ new and might have some bugs. Basically we recommend Managed XSLT
solution, but if it contains some blocking bugs, then you can also
use traditional libxslt. If you want to use msxsl:script, you have
to select Managed XSLT.
.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_CODEDOM_NODELETE"
If set to any value, the C# CodeDom compiler will not remove the temporary
source files generated.
.TP
.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.
.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
+48 -10
View File
@@ -1,8 +1,9 @@
.\"
.\" sn manual page.
.\" Copyright 2003 Motus Technologies
.\" Copyright 2004 Novell
.\" Author:
.\" Sebastien Pouliot (spouliot@motus.com)
.\" Sebastien Pouliot <sebastien@ximian.com>
.\"
.TH Mono "sn"
.SH NAME
@@ -13,24 +14,33 @@ sn \- Digitally sign/verify/compare strongname on CLR assemblies.
.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).
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.
Use a machine [y] key container or a user [n] key container. Currently not
supported in Mono.
.TP
.I "-Vl"
List the verification options.
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.
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.
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"
@@ -62,11 +72,14 @@ 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 in the specified file.
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).
(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.
@@ -83,10 +96,10 @@ Show the public key from the specified assembly.
.I "-Tp assembly"
Show the public key and the public key token from the specified assembly.
.TP
.I "-V assembly"
.I "-v assembly"
Verify the specified assembly signature.
.TP
.I "-Vf assembly"
.I "-vf assembly"
Verify the specified assembly signature (even if disabled).
.SH HELP OPTIONS
.TP
@@ -104,10 +117,35 @@ 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.
+1 -1
View File
@@ -50,7 +50,7 @@ Specifies the namespace of the XML schema element for which a class or a dataset
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. Type name must be full name. Assembly name is file name that xsd.exe tries to load.
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.
+8
View File
@@ -1,3 +1,11 @@
2004-06-14 Raja R Harinath <[email protected]>
* Makefile (all-profiles, clean-profiles): Simplify slightly.
2004-06-05 Atsushi Enomoto <[email protected]>
* Makefile: added target run-test-ondotnet.
2004-05-26 Raja R Harinath <[email protected]>
* nunit20/util/Makefile (EXTRA_DISTFILES): Remove
+6 -4
View File
@@ -19,17 +19,19 @@ test: platform-check profile-check test-recursive #test-local
run-test: run-test-recursive #run-test-local
run-test-ondotnet: run-test-ondotnet-recursive # run-test-ondotnet-local
clean: clean-recursive #clean-local
# fun specialty targets
all-profiles:
$(MAKE) PROFILE=default all || exit 1 ; \
$(MAKE) PROFILE=net_2_0 all || exit 1 ;
$(MAKE) PROFILE=default all
$(MAKE) PROFILE=net_2_0 all
clean-profiles:
$(MAKE) PROFILE=default clean || exit 1 ; \
$(MAKE) PROFILE=net_2_0 clean || exit 1 ;
$(MAKE) PROFILE=default clean
$(MAKE) PROFILE=net_2_0 clean
testcorlib:
@cd class/corlib && $(MAKE) test run-test
+12 -7
View File
@@ -1,7 +1,12 @@
2004-05-15 Rafael Teixeira (rafaelteixeira@hotmail.com)
* Makefile: corrected /libpath: compiler flag (parameter) to point to ../class/lib/default/ the new location of libraries
2004-03-16 Rafael Teixeira ([email protected])
* Test1.vb: corrected mispelling in keyword
* Test.Sources: no misc1.vb or CharacterLiteralsA.vb sources
* ConditionalCompilationC.vb: added some tests with #Const
2004-06-11 Anirban Bhattacharjee <banirban@novell.com>
* Makefile: Removed inclusion of rules.make from Makefile for two reasons :
- This Makefile as of now has no dependency on rules.make what so ever
- Because of inclusion of INTENAL_MBAS in rules.make it was causing confliction with existing INTERNAL_MBAS in this makefile and causing lots of tests to fail
2004-05-15 Rafael Teixeira ([email protected])
* Makefile: corrected /libpath: compiler flag (parameter) to point to ../class/lib/default/ the new location of libraries
2004-03-16 Rafael Teixeira ([email protected])
* Test1.vb: corrected mispelling in keyword
* Test.Sources: no misc1.vb or CharacterLiteralsA.vb sources
* ConditionalCompilationC.vb: added some tests with #Const
+12 -7
View File
@@ -1,7 +1,12 @@
2004-05-15 Rafael Teixeira (rafaelteixeira@hotmail.com)
* Makefile: corrected /libpath: compiler flag (parameter) to point to ../class/lib/default/ the new location of libraries
2004-03-16 Rafael Teixeira ([email protected])
* Test1.vb: corrected mispelling in keyword
* Test.Sources: no misc1.vb or CharacterLiteralsA.vb sources
* ConditionalCompilationC.vb: added some tests with #Const
2004-06-11 Anirban Bhattacharjee <banirban@novell.com>
* Makefile: Removed inclusion of rules.make from Makefile for two reasons :
- This Makefile as of now has no dependency on rules.make what so ever
- Because of inclusion of INTENAL_MBAS in rules.make it was causing confliction with existing INTERNAL_MBAS in this makefile and causing lots of tests to fail
2004-05-15 Rafael Teixeira ([email protected])
* Makefile: corrected /libpath: compiler flag (parameter) to point to ../class/lib/default/ the new location of libraries
2004-03-16 Rafael Teixeira ([email protected])
* Test1.vb: corrected mispelling in keyword
* Test.Sources: no misc1.vb or CharacterLiteralsA.vb sources
* ConditionalCompilationC.vb: added some tests with #Const
+34
View File
@@ -0,0 +1,34 @@
Imports System
Module M
Delegate Sub SD()
sub f()
End sub
Public Delegate Function SF(a as integer) as Integer
Public Function f1(a as integer) as Integer
return a
End Function
Sub Main()
dim d1 as SD
d1 = new SD(AddressOf f)
d1.Invoke()
dim d2 as SD
d2 = AddressOf f
d2.Invoke()
dim d3 as new SD(AddressOf f)
d3.Invoke()
dim d4 as SF
d4 = new SF(AddressOf f1)
Dim i as Integer = d4.Invoke(10)
if i <> 10 then
Throw new System.Exception ("#A1, Unexpected result")
end if
End Sub
End Module
+14
View File
@@ -0,0 +1,14 @@
Imports System
Module M
Delegate Sub SD()
sub f(i as integer)
End sub
Sub Main()
dim d1 as SD
d1= new SD(AddressOf f)
d1.Invoke()
End Sub
End Module
+18
View File
@@ -0,0 +1,18 @@
Imports System
Module M
Delegate Sub SD()
sub f()
End sub
Public Delegate Function SF(a as integer) as Integer
Public Function f1(a as integer) as Integer
return a
End Function
Sub Main()
dim d1 as SD
d1= new SD(AddressOf f1)
d1.Invoke()
End Sub
End Module
+27
View File
@@ -0,0 +1,27 @@
Imports System
Class C
Public Event E
Public Sub S()
RaiseEvent E
End Sub
End Class
Class C1
dim WithEvents x as C = new C()
Sub call_S()
x.S()
End Sub
Sub EH() Handles x.E
Console.WriteLine("event called")
End Sub
End Class
Module M
Sub Main()
dim y as new C1
y.call_S()
End Sub
End Module
+28
View File
@@ -0,0 +1,28 @@
Imports System
Class C
Delegate Sub EH()
Public Event E as EH
Public Sub S()
RaiseEvent E
End Sub
End Class
Class C1
dim WithEvents x as C = new C()
Sub call_S()
x.S()
End Sub
Sub EH() Handles x.E
Console.WriteLine("event called")
End Sub
End Class
Module M
Sub Main()
dim y as new C1
y.call_S()
End Sub
End Module
+30
View File
@@ -0,0 +1,30 @@
Imports System
Class C
Public Event E (ByVal i as integer)
Public Sub S()
RaiseEvent E(10)
End Sub
End Class
Class C1
dim WithEvents x as C = new C()
Sub call_S()
x.S()
End Sub
Sub EH(i as Integer) Handles x.E
Console.WriteLine("event called : " + i)
End Sub
End Class
Module M
Sub Main()
dim y as new C1
y.call_S()
End Sub
End Module
+31
View File
@@ -0,0 +1,31 @@
Imports System
Class C
Delegate Sub EH(ByVal i as integer)
Public Event E as EH
Public Sub S()
RaiseEvent E(10)
End Sub
End Class
Class C1
dim WithEvents x as C = new C()
Sub call_S()
x.S()
End Sub
Sub EH(i as Integer) Handles x.E
Console.WriteLine("event called : " + i)
End Sub
End Class
Module M
Sub Main()
dim y as new C1
y.call_S()
End Sub
End Module
+28
View File
@@ -0,0 +1,28 @@
Imports System
Public Class C
Public Event E()
Sub S()
RaiseEvent E()
End Sub
End Class
Module M
Sub S1()
Dim x As New C()
AddHandler x.E, AddressOf EH
x.S()
End Sub
Sub EH()
Console.WriteLine("Event fired")
End Sub
Sub Main()
S1()
End Sub
End Module
+30
View File
@@ -0,0 +1,30 @@
Imports System
Class C
Delegate Sub EH()
Public Event E as EH
Public Sub S()
RaiseEvent E
End Sub
End Class
Class C1
Sub call_S()
dim x as C = new C()
AddHandler x.E, AddressOf xh
x.S()
End Sub
Sub xh()
Console.WriteLine("event called")
End Sub
End Class
Module M
Sub Main()
dim y as new C1
y.call_S()
End Sub
End Module
+4 -1
View File
@@ -6,7 +6,10 @@ INTERNAL_MBAS = $(TEST_RUNTIME) --debug ../mbas/mbas.exe --stacktrace $(COMPILER
#INTERNAL_MBAS = vbc $(COMPILER_FLAGS)
all: test-compiler-jit
include ../build/rules.make
# removed this cause INTERNAL_MBAS now getting set in
# rules.make which is conflicting with this instance of
# INTERNAL_MBAS
#include ../build/rules.make
DISTFILES = README.tests $(wildcard *.vb)
+21
View File
@@ -0,0 +1,21 @@
Imports system
Module M
private i as integer
protected Property p() as Integer
GET
return i
END GET
SET (val as Integer)
i = val
End SET
End Property
Sub Main()
End Sub
End Module
+17
View File
@@ -0,0 +1,17 @@
Class C1
'property that do not override any other
'property should not be declared 'notoverridable'
Public NotOverridable Property p() as Integer
GET
END GET
SET (val as Integer)
End SET
End Property
End Class
Module OverrideC2
Sub Main()
End Sub
End Module
+19
View File
@@ -0,0 +1,19 @@
Imports system
Module M
private i as integer
public WriteOnly Property p() as Integer
GET
return i
END GET
SET (ByVal val as Integer)
i = val
End SET
End Property
Sub Main()
End Sub
End Module
+19
View File
@@ -0,0 +1,19 @@
Imports system
Module M
private i as integer
public ReadOnly Property p() as Integer
GET
return i
END GET
SET (ByVal val as Integer)
i = val
End SET
End Property
Sub Main()
End Sub
End Module
+11
View File
@@ -0,0 +1,11 @@
Imports system
Module M
private i as integer
public MustOverride Property p() as Integer
Sub Main()
End Sub
End Module
+15
View File
@@ -0,0 +1,15 @@
Imports system
Public Struct s
public MustOverride Property p() as Integer
End Struct
Module M
private i as integer
Sub Main()
End Sub
End Module
+22
View File
@@ -0,0 +1,22 @@
Imports system
Structure S
private i as integer
protected Property p() as Integer
GET
return i
END GET
SET (val as Integer)
i = val
End SET
End Property
End Structure
Module M
Sub Main()
End Sub
End Module
+18 -2
View File
@@ -132,7 +132,14 @@ PropertyA \
PropertyB \
PropertyC \
PropertyD \
PropertyE
PropertyE \
DelegateA \
EventA \
EventB \
EventC \
EventD \
EventE \
EventF
# All negetive test cases which should
# fail during compilation goes here
@@ -281,7 +288,16 @@ EnumC7 \
PropertyC1 \
PropertyC2 \
PropertyC3 \
PropertyC4
PropertyC4 \
PropertyC5 \
PropertyC6 \
PropertyC7 \
PropertyC8 \
PropertyC9 \
PropertyC10 \
PropertyC11 \
DelegateC1 \
DelegateC2
# All negetive test cases which should fail at
# runtime goes here
+109
View File
@@ -1,3 +1,112 @@
2004-06-14 Raja R Harinath <[email protected]>
* platforms/linux.make (PLATFORM_CHANGE_SEPARATOR_CMD): Define to 'cat'.
(PLATFORM_TWEAK_CORLIB_SOURCES): Remove.
(platform-check): Avoid bash-ism.
* library.make: Simplify uses of $(patsubst x,y,$(foo)) to $(foo:x=y).
(core_sourcefile): Rename back to ...
(sourcefile): ... this. Remove creation of redundant intermediate file.
(response): Change test for optimization, now that
PLATFORM_CHANGE_SEPARATOR_CMD is unconditional. Combine with
platform-exclude handling.
(library_CLEAN_FILES): New variable to specify clean:-able files
close to where they're defined.
(test_response, btest_response): Simplify.
* executable.make (response): Change test for optimization.
(executable_CLEAN_FILES): New define.
2004-06-14 Raja R Harinath <[email protected]>
* library.make (uninstall-local): Fix typo.
2004-06-11 Atsushi Enomoto <[email protected]>
* library.make : HAVE_CS_TESTS fixie.
2004-06-11 Raja R Harinath <[email protected]>
* library.make (HAVE_CS_TESTS, HAVE_VB_TESTS): Allow to be
overriden. Useful if the tests sourcefile is generated.
(TEST_COMPILE, BTEST_COMPILE): Allow these to be customized too.
* platforms/win32.make (PLATFORM_TWEAK_CORLIB_SOURCES): Remove.
Support enough features to build mscorlib.dll.
* library.make (core_sourcefile): New renamed from $(sourcefile).
(PLATFORM_excludes): Auto-detecting define that sees if
$(LIBRARY).$(PLATFORM)-excludes file exists.
(sourcefile): New. Possibly-built file that removes
PLATFORM_excluded files from core_sourcefile.
(test_against, test_dep): New. Allow the test assembly to be
built against a different library.
(test_lib): Allow makefile to override the name of the test
assembly.
(LIBRARY_INSTALL_DIR): If defined, switch to using $(INSTALL_LIB)
rather than $(gacutil).
(DISTFILES, dist-local): Use core_sourcefile.
(clean-local): Remove sourcefile if it was generated.
(test_lib, btest_lib): Depend on $(test_dep).
2004-06-10 Gonzalo Paniagua Javier <[email protected]>
* library.make: fixed PLATFORM_CHANGE_SEPARATOR_CHAR on windows.
2004-06-09 Sebastien Pouliot <[email protected]>
* library.make: Added support to fully sign assemblies when doing a
"make install" (thanks to Jackson :-).
2004-06-09 Raja R Harinath <[email protected]>
Do away with stampfiles.
Introduce support for VB test cases.
* library.make (HAVE_CS_TESTS, HAVE_VB_TESTS): New auto-detecting
defines.
(stampfile, test_stampfile): Remove.
(clean-local): Don't mention them.
(test-local, run-test-local, run-test-ondotnet-local):
Make unconditional.
($(makefrag), $(test_makefrag)): Simplify.
($(btest_lib)): New. Support for VB testcases.
2004-06-09 Raja R Harinath <[email protected]>
Partial support for writing Visual Basic source files.
* rules.make (USE_MBAS_FLAGS,BASCOMPILE,INTERNAL_MBAS): New.
* config-default.make (MBAS_FLAGS, DEFAULT_MBAS_FLAGS): New.
* profiles/default.make (MBAS): New.
2004-06-09 Raja R Harinath <[email protected]>
Do away with stampfiles.
* executable.make (stampfile): Remove.
(clean-local): Remove mention of $(stampfile).
(test-local, run-test-local, run-test-ondotnet-local):
Make unconditional. Add dummy rule to prevent other makefiles
from defining rules on these.
($(PROGRAM)): Depend directly on $(BUILT_SOURCES).
($(makefrag)): Simplify.
2004-06-03 Atsushi Enomoto <[email protected]>
* README.makefiles : added description for run-test-ondotnet.
2004-06-03 Atsushi Enomoto <[email protected]>
* Makefile, executable.make, library.make, rules.make :
Added new target "run-test-ondotnet" that works what "run-test"
used to be on windows (i.e. tests our libs under MS.NET).
2004-06-01 Atsushi Enomoto <[email protected]>
* platforms/win32.make : TEST_RUNTIME should be always mono we can't
test our libs against MS.NET runtime. Think about internal call).
2004-05-30 Jackson Harper <[email protected]>
* library.make: Install to 2.0 package if building with the
net_2_0 profile.
2004-05-26 Gonzalo Paniagua Javier <[email protected]>
* library.make: reference nunti.core.dll and nunit.util.dll when
+1 -1
View File
@@ -2,7 +2,7 @@ thisdir = build
SUBDIRS =
include ../build/rules.make
all-local install-local test-local run-test-local clean-local uninstall-local:
all-local install-local test-local run-test-local run-test-ondotnet-local clean-local uninstall-local:
DISTFILES = \
README.makefiles \
+7 -2
View File
@@ -40,6 +40,9 @@ test-local: my_test_program.exe
run-test-local:
$(RUNTIME) my_test_program.exe
run-test-ondotnet-local:
$(RUNTIME) my_test_program.exe
DISTFILES = myfile.txt my_test_source.cs
dist-local: dist-default
@@ -49,7 +52,7 @@ my_test_program.exe: my_test_source.cs
========================================
Each makefile follows the same pattern: it does some setup, includes
the standard make rules, and provides rules for six standard targets:
the standard make rules, and provides rules for seven standard targets:
all, install, test, run-test, clean, and dist.
"Some setup" is defining two variables: $(thisdir) and
@@ -57,7 +60,7 @@ $(SUBDIRS). $(thisdir) is the directory that the makefile lives in,
relative to the top directory (ie, class/corlib) and $(SUBDIRS)
defines the subdirectories that should be built in.
The six targets do the following:
The seven targets do the following:
* all-local builds whatever someone would expect to be built
when they just type 'make'. Most likely Foo.dll or Foo.exe
@@ -75,6 +78,8 @@ target. The idea is that 'make run-test' from the toplevel should be
able to proceed unsupervised and test everything that can be tested in
such a manner.
* run-test-ondotnet-local is a variant of run-test-local. It is used only to validate if our tests themselves works fine under Microsoft runtime (on Windows). Basically, in this target, we should not use $(TEST_RUNTIME) to test our libraries.
* clean-local removes built files; 'make clean' should leave
only files that go into a distribution tarball. (But it is not necessarily
true that all files that go into a tarball need to be left after a make clean.)
+2
View File
@@ -9,6 +9,7 @@
RUNTIME_FLAGS =
TEST_HARNESS = $(topdir)/class/lib/nunit-console.exe
MCS_FLAGS = $(PLATFORM_DEBUG_FLAGS)
MBAS_FLAGS = $(PLATFORM_DEBUG_FLAGS)
LIBRARY_FLAGS = /noconfig
CFLAGS = -g -O2
INSTALL = /usr/bin/install
@@ -20,6 +21,7 @@ prefix = /usr/local
# keep track of the default value
DEFAULT_MCS_FLAGS := $(MCS_FLAGS)
DEFAULT_MBAS_FLAGS := $(MBAS_FLAGS)
# You shouldn't need to set these but might on a
# weird platform.
+16 -30
View File
@@ -8,14 +8,17 @@
base_prog = $(shell basename $(PROGRAM))
sourcefile = $(base_prog).sources
ifdef PLATFORM_CHANGE_SEPARATOR_CMD
response = $(depsdir)/$(base_prog).response
else
ifeq (cat,$(PLATFORM_CHANGE_SEPARATOR_CMD))
response = $(sourcefile)
else
response = $(depsdir)/$(base_prog).response
executable_CLEAN_FILES += $(response)
endif
stampfile = $(depsdir)/$(base_prog).stamp
makefrag = $(depsdir)/$(base_prog).makefrag
pdb = $(patsubst %.exe,%.pdb,$(PROGRAM))
executable_CLEAN_FILES += $(makefrag) $(pdb)
ifndef PROGRAM_INSTALL_DIR
PROGRAM_INSTALL_DIR = $(prefix)/bin
@@ -31,16 +34,14 @@ uninstall-local:
-rm -f $(DESTDIR)$(PROGRAM_INSTALL_DIR)/$(base_prog)
clean-local:
-rm -f *.exe $(BUILT_SOURCES) $(CLEAN_FILES) $(pdb) $(stampfile) $(makefrag)
ifdef PLATFORM_CHANGE_SEPARATOR_CMD
-rm -f $(response)
endif
-rm -f *.exe $(BUILT_SOURCES) $(executable_CLEAN_FILES) $(CLEAN_FILES)
ifndef HAS_TEST
test-local: $(PROGRAM)
@:
run-test-local:
endif
@:
run-test-ondotnet-local:
@:
DISTFILES = $(sourcefile) $(EXTRA_DISTFILES)
@@ -50,36 +51,21 @@ dist-local: dist-default
$(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ; \
done
# Changing makefile probably means changing the
# sources, so let's be safe and add a Makefile dep
ifndef PROGRAM_COMPILE
PROGRAM_COMPILE = $(CSCOMPILE)
endif
$(PROGRAM): $(makefrag) $(response) $(stampfile)
$(PROGRAM): $(makefrag) $(BUILT_SOURCES) $(response)
$(PROGRAM_COMPILE) /target:exe /out:$@ $(BUILT_SOURCES) @$(response)
# warning: embedded tab in the 'echo touch' line
$(makefrag): $(sourcefile)
@echo Creating $@ ...
@echo "HAVE_MAKEFRAG = yes" >$@.new
@echo "$(stampfile): $(BUILT_SOURCES) \\" >>[email protected]
@cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>[email protected]
@cat [email protected] |sed -e '$$s, \\$$,,' >$@
@echo " touch \$$@" >>$@
@rm -rf [email protected]
@sed 's,^,$(PROGRAM): ,' $< > $@
ifdef PLATFORM_CHANGE_SEPARATOR_CMD
ifneq ($(response),$(sourcefile))
$(response): $(sourcefile)
@echo Creating $@ ...
@cat $< |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
@( $(PLATFORM_CHANGE_SEPARATOR_CMD) ) <$< >$@
endif
-include $(makefrag)
ifndef HAVE_MAKEFRAG
$(stampfile):
touch $@
endif
+153 -71
View File
@@ -9,87 +9,169 @@
# munge in the library name to keep the files from clashing.
sourcefile = $(LIBRARY).sources
ifdef PLATFORM_CHANGE_SEPARATOR_CMD
response = $(depsdir)/$(PROFILE)_$(LIBRARY).response
else
PLATFORM_excludes := $(wildcard $(LIBRARY).$(PLATFORM)-excludes)
ifndef PLATFORM_excludes
ifeq (cat,$(PLATFORM_CHANGE_SEPARATOR_CMD))
response = $(sourcefile)
endif
endif
ifndef response
response = $(depsdir)/$(PROFILE)_$(LIBRARY).response
library_CLEAN_FILES += $(response)
endif
ifndef LIBRARY_NAME
LIBRARY_NAME = $(LIBRARY)
endif
makefrag = $(depsdir)/$(PROFILE)_$(LIBRARY).makefrag
stampfile = $(depsdir)/$(PROFILE)_$(LIBRARY).stamp
the_lib = $(topdir)/class/lib/$(PROFILE)/$(LIBRARY_NAME)
the_pdb = $(patsubst %.dll,%.pdb,$(the_lib))
the_pdb = $(the_lib:.dll=.pdb)
library_CLEAN_FILES += $(makefrag) $(the_lib) $(the_pdb)
ifndef NO_TEST
test_lib = $(patsubst %.dll,%_test.dll,$(LIBRARY))
test_pdb = $(patsubst %.dll,%.pdb,$(test_lib))
test_nunit_lib = nunit.framework.dll nunit.core.dll nunit.util.dll
test_nunit_dep = $(test_nunit_lib:%=$(topdir)/class/lib/$(PROFILE)/%)
test_nunit_ref = $(test_nunit_dep:%=-r:%)
library_CLEAN_FILES += TestResult.xml
ifndef test_against
test_against = $(the_lib)
test_dep = $(the_lib)
endif
ifndef test_lib
test_lib = $(LIBRARY:.dll=_test.dll)
endif
test_pdb = $(test_lib:.dll=.pdb)
test_sourcefile = $(test_lib).sources
test_response = $(depsdir)/$(PROFILE)_$(test_lib).response
test_makefrag = $(depsdir)/$(PROFILE)_$(test_lib).makefrag
test_stampfile = $(depsdir)/$(PROFILE)_$(test_lib).stamp
test_nunitfw = $(topdir)/class/lib/$(PROFILE)/nunit.framework.dll
test_nunitcore = $(topdir)/class/lib/$(PROFILE)/nunit.core.dll
test_nunitutil = $(topdir)/class/lib/$(PROFILE)/nunit.util.dll
test_nunit_ref = -r:$(test_nunitfw) -r:$(test_nunitcore) -r:$(test_nunitutil)
test_flags = /r:$(the_lib) $(test_nunit_ref) $(TEST_MCS_FLAGS)
test_flags = /r:$(test_against) $(test_nunit_ref) $(TEST_MCS_FLAGS)
library_CLEAN_FILES += $(test_lib) $(test_pdb) $(test_response) $(test_makefrag)
ifndef btest_lib
btest_lib = $(LIBRARY:.dll=_btest.dll)
endif
btest_pdb = $(btest_lib:.dll=.pdb)
btest_sourcefile = $(btest_lib).sources
btest_response = $(depsdir)/$(btest_lib).response
btest_makefrag = $(depsdir)/$(btest_lib).makefrag
btest_flags = /r:$(test_against) $(test_nunit_ref) $(TEST_MBAS_FLAGS)
library_CLEAN_FILES += $(btest_lib) $(btest_pdb) $(btest_response) $(btest_makefrag)
ifndef HAVE_CS_TESTS
HAVE_CS_TESTS := $(wildcard $(test_sourcefile))
endif
ifndef HAVE_VB_TESTS
HAVE_VB_TESTS := $(wildcard $(btest_sourcefile))
endif
endif
gacutil = $(topdir)/tools/gacutil/gacutil.exe
sn = $(topdir)/tools/security/sn.exe
PACKAGE = 1.0
ifeq ($(PROFILE), net_2_0)
PACKAGE = 1.1
PACKAGE = 2.0
endif
all-local: $(the_lib)
install-local: $(the_lib) $(gacutil)
$(RUNTIME) $(gacutil) /i $(the_lib) /f /root $(DESTDIR)$(prefix)/lib /package 1.0
install-local: $(the_lib) maybe-sign-lib
ifdef LIBRARY_INSTALL_DIR
install-local:
$(MKINSTALLDIRS) $(DESTDIR)$(LIBRARY_INSTALL_DIR)
$(INSTALL_LIB) $(the_lib) $(DESTDIR)$(LIBRARY_INSTALL_DIR)/$(LIBRARY_NAME)
uninstall-local:
-rm -f $(DESTDIR)$(LIBRARY_INSTALL_DIR)/$(LIBRARY_NAME)
else
install-local: $(gacutil)
$(RUNTIME) $(gacutil) /i $(the_lib) /f /root $(DESTDIR)$(prefix)/lib /package $(PACKAGE)
uninstall-local: $(gacutil)
$(RUNTIME) $(gacutil) /u $$(basename $(the_lib) .dll) ; \
$(RUNTIME) $(gacutil) /u $(LIBRARY_NAME:.dll=)
$(gacutil):
cd $(topdir)/tools/gacutil && $(MAKE) || exit 1 ;
cd $(topdir)/tools/gacutil && $(MAKE)
clean-local:
-rm -f $(the_lib) $(makefrag) $(test_lib) \
$(test_makefrag) $(test_response) \
$(stampfile) $(test_stampfile) \
$(the_pdb) $(test_pdb) $(CLEAN_FILES) \
TestResult.xml
ifdef PLATFORM_CHANGE_SEPARATOR_CMD
-rm -rf $(response)
endif
ifndef NO_TEST
$(test_nunitfw):
(cd ${topdir}/nunit20 && make)
maybe-sign-lib:
ifndef NO_SIGN_ASSEMBLY
maybe-sign-lib: $(sn)
$(RUNTIME) $(sn) -q -R $(the_lib) $(topdir)/class/mono.snk
endif
test-local: $(test_nunitfw) $(the_lib) $(test_lib)
$(sn):
cd $(topdir)/tools/security && $(MAKE) sn.exe
clean-local:
-rm -f $(library_CLEAN_FILES) $(CLEAN_FILES)
test-local: $(the_lib)
@:
run-test-local:
@:
run-test-ondotnet-local:
@:
ifndef NO_TEST
$(test_nunit_dep): $(topdir)/build/deps/nunit.stamp
@if test -f $@; then :; else rm -f $<; $(MAKE) $<; fi
$(topdir)/build/deps/nunit.stamp:
cd ${topdir}/nunit20 && $(MAKE)
echo "stamp" >$@
endif
ifdef HAVE_CS_TESTS
test-local: $(test_lib)
run-test-local: run-test-lib
run-test-lib: test-local
$(TEST_RUNTIME) $(TEST_HARNESS) $(test_lib)
else
test-local: $(the_lib)
run-test-ondotnet-local: run-test-ondotnet-lib
run-test-ondotnet-lib: test-local
$(TEST_HARNESS) $(test_lib)
endif
ifdef HAVE_VB_TESTS
test-local: $(btest_lib)
run-test-local: run-btest-lib
run-btest-lib: test-local
$(TEST_RUNTIME) $(TEST_HARNESS) $(btest_lib)
run-test-ondotnet-local: run-btest-ondotnet-lib
run-btest-ondotnet-lib: test-local
$(TEST_HARNESS) $(btest_lib)
run-test-local:
endif
DISTFILES = $(sourcefile) $(test_sourcefile) $(EXTRA_DISTFILES)
ifdef NO_TEST
TEST_FILES =
else
TEST_FILES = `cat $(test_sourcefile) |sed -e 's,^\(.\),Test/\1,'`
ifdef HAVE_CS_TESTS
TEST_FILES += `sed 's,^,Test/,' $(test_sourcefile)`
endif
ifdef HAVE_VB_TESTS
TEST_FILES += `sed 's,^,Test/,' $(btest_sourcefile)`
endif
dist-local: dist-default
@@ -102,64 +184,64 @@ ifndef LIBRARY_COMPILE
LIBRARY_COMPILE = $(CSCOMPILE)
endif
ifndef TEST_COMPILE
TEST_COMPILE = $(CSCOMPILE)
endif
ifndef BTEST_COMPILE
BTEST_COMPILE = $(BASCOMPILE)
endif
# Fun with dependency tracking
$(the_lib): $(makefrag) $(stampfile) $(response)
$(the_lib): $(makefrag) $(response)
$(LIBRARY_COMPILE) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS) /target:library /out:$@ @$(response)
# warning: embedded tab in the 'echo touch' line
$(makefrag): $(sourcefile)
@echo Creating $@ ...
@echo "HAVE_MAKEFRAG = yes" >[email protected]
@echo "$(stampfile): \\" >>[email protected]
@cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>[email protected]
@cat [email protected] |sed -e '$$s, \\$$,,' >$@
@echo " touch \$$@" >>$@
@rm -rf [email protected]
@sed 's,^,$(the_lib): ,' $< >$@
ifdef PLATFORM_CHANGE_SEPARATOR_CMD
$(response): $(sourcefile)
ifneq ($(response),$(sourcefile))
$(response): $(sourcefile) $(PLATFORM_excludes)
@echo Creating $@ ...
@cat $< |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
@sort $(sourcefile) $(PLATFORM_excludes) | uniq -u | $(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
endif
-include $(makefrag)
ifndef HAVE_MAKEFRAG
$(stampfile):
touch $@
endif
# for now, don't give any /lib flags or set MONO_PATH, since we
# give a full path to the assembly.
ifndef NO_TEST
$(test_lib): $(test_makefrag) $(the_lib) $(test_response) $(test_stampfile)
$(CSCOMPILE) /target:library /out:$@ $(test_flags) @$(test_response)
ifdef HAVE_CS_TESTS
$(test_lib): $(test_makefrag) $(test_dep) $(test_response) $(test_nunit_dep)
$(TEST_COMPILE) /target:library /out:$@ $(test_flags) @$(test_response)
$(test_response): $(test_sourcefile)
@echo Creating $@ ...
ifdef PLATFORM_CHANGE_SEPARATOR_CMD
@cat $< |sed -e 's,^\(.\),Test/\1,' |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
else
@cat $< |sed -e 's,^\(.\),Test/\1,' >$@
endif
@sed 's,^,Test/,' $(test_sourcefile) | $(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
# warning: embedded tab in the 'echo touch' line
$(test_makefrag): $(test_response)
@echo Creating $@ ...
@echo "HAVE_TEST_MAKEFRAG = yes" >[email protected]
@echo "$(test_stampfile): \\" >>[email protected]
@cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>[email protected]
@cat [email protected] |sed -e '$$s, \\$$,,' >$@
@echo " touch \$$@" >>$@
@rm -rf [email protected]
@sed 's,^,$(test_lib): ,' $< >$@
-include $(test_makefrag)
endif
ifndef HAVE_TEST_MAKEFRAG
$(test_stampfile):
touch $@
endif
ifdef HAVE_VB_TESTS
$(btest_lib): $(btest_makefrag) $(test_dep) $(btest_response) $(test_nunit_dep)
$(BTEST_COMPILE) /target:library /out:$@ $(btest_flags) @$(btest_response)
$(btest_response): $(btest_sourcefile)
@echo Creating $@ ...
@sed 's,^,Test/,' $(btest_sourcefile) | $(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
$(btest_makefrag): $(btest_response)
@echo Creating $@ ...
@sed 's,^,$(btest_lib): ,' $< >$@
-include $(btest_makefrag)
endif
+3 -11
View File
@@ -16,28 +16,20 @@ PLATFORM_PATH_SEPARATOR = :
# Define this if this ever will work on Linux
# PLATFORM_MAKE_CORLIB_CMP = yes
# This is for the security permission attribute problem
# on windows
PLATFORM_TWEAK_CORLIB_SOURCES = cat
# This is for changing / to \ on windows
# Don't define it so we don't needlessly copy the sources
# file. This command is handy for testing:
#
# PLATFORM_CHANGE_SEPARATOR_CMD=sed -e 's,/,/./,g'
PLATFORM_CHANGE_SEPARATOR_CMD = cat
hidden_prefix = .
hidden_suffix =
platform-check:
@if ! type $(BOOTSTRAP_MCS) >/dev/null 2>&1 ; then \
echo "*** You need a C# compiler installed to build MCS." ; \
@set fnord $(BOOTSTRAP_MCS) ; if type $$2 >/dev/null 2>&1 ; then :; else \
echo "*** You need a C# compiler installed to build MCS. (make sure mcs works from the command line)" ; \
echo "*** Read INSTALL.txt for information on how to bootstrap" ; \
echo "*** a Mono installation." ; \
exit 1 ; \
fi
# I tried this but apparently Make's version strings aren't that
# ... consistent between releases. Whatever.
#
+2 -1
View File
@@ -13,10 +13,11 @@ MCS = $(BOOTSTRAP_MCS)
RESGEN = resgen.exe
PLATFORM_MAKE_CORLIB_CMP = yes
PLATFORM_TWEAK_CORLIB_SOURCES=cat - corlib.dll.win32-excludes |sort |uniq -u
PLATFORM_CHANGE_SEPARATOR_CMD=tr '/' '\\\\'
PLATFORM_PATH_SEPARATOR = ;
TEST_RUNTIME = mono
hidden_prefix =
hidden_suffix = .tmp
+3
View File
@@ -16,9 +16,11 @@
ifdef PLATFORM_MONO_NATIVE
MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE):$$MONO_PATH" $(INTERNAL_MCS)
MBAS = MONO_PATH="$(topdir)/class/lib/$(PROFILE):$$MONO_PATH" $(INTERNAL_MBAS)
TEST_RUNTIME = MONO_PATH="$(topdir)/class/lib/$(PROFILE):$$MONO_PATH" $(RUNTIME) --debug
else
MCS = $(PLATFORM_RUNTIME) $(BOOTSTRAP_MCS) /lib:$(topdir)/class/lib/$(PROFILE)
MBAS = $(PLATFORM_RUNTIME) $(BOOTSTRAP_MBAS) /lib:$(topdir)/class/lib/$(PROFILE)
endif
# nuttzing!
@@ -26,3 +28,4 @@ endif
profile-check:
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:ONLY_1_1
PROFILE_MBAS_FLAGS = -d:NET_1_1 -d:ONLY_1_1
+6 -1
View File
@@ -13,11 +13,13 @@
dots := $(shell echo $(thisdir) |sed -e 's,[^./][^/]*,..,g')
topdir := $(dots)
VERSION = 0.91.99
VERSION = 0.93
USE_MCS_FLAGS = $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS) $(MCS_FLAGS)
USE_MBAS_FLAGS = $(LOCAL_MBAS_FLAGS) $(PLATFORM_MBAS_FLAGS) $(PROFILE_MBAS_FLAGS) $(MBAS_FLAGS)
USE_CFLAGS = $(LOCAL_CFLAGS) $(CFLAGS)
CSCOMPILE = $(MCS) $(USE_MCS_FLAGS)
BASCOMPILE = $(MBAS) $(USE_MBAS_FLAGS)
CCOMPILE = $(CC) $(USE_CFLAGS)
BOOT_COMPILE = $(BOOTSTRAP_MCS) $(USE_MCS_FLAGS)
INSTALL_DATA = $(INSTALL) -m 644
@@ -25,6 +27,7 @@ INSTALL_BIN = $(INSTALL) -m 755
INSTALL_LIB = $(INSTALL_BIN)
MKINSTALLDIRS = $(SHELL) $(topdir)/mkinstalldirs
INTERNAL_MCS = $(RUNTIME) $(topdir)/mcs/mcs.exe
INTERNAL_MBAS = $(RUNTIME) $(topdir)/mbas/mbas.exe
INTERNAL_GMCS = $(RUNTIME) $(topdir)/gmcs/gmcs.exe
INTERNAL_ILASM = $(RUNTIME) $(topdir)/ilasm/ilasm.exe
INTERNAL_RESGEN = $(RUNTIME) $(topdir)/monoresgen/monoresgen.exe
@@ -124,6 +127,8 @@ test: test-recursive test-local
run-test: run-test-recursive test-local run-test-local
run-test-ondotnet: run-test-ondotnet-recursive test-local run-test-ondotnet-local
clean: clean-recursive clean-local
uninstall: uninstall-recursive uninstall-local
+5
View File
@@ -1,3 +1,8 @@
2004-06-11 Duncan Mak <[email protected]>
* IBM.Data.DB2/IBM.Data.DB2.dll.sources:
* Makefile: Add IBM.Data.DB2.
2004-05-07 Raja R Harinath <[email protected]>
* Makefile (SUBDIRS): Build 'corlib' and first pass of 'System'
@@ -1,3 +1,21 @@
2004-06-07 Atsushi Enomoto <[email protected]>
* RncParser.jay : removed unused code. Fixed LookupNamespace() to
pass atomized name always.
2004-05-31 Atsushi Enomoto <[email protected]>
* RncParser.jay : now error output is disabled.
* RncTokenizer.cs : It should not be public class.
2004-05-30 Atsushi Enomoto <[email protected]>
* RncParser.jay :
Now RncParser.Parse() returns RelaxngPattern, not RelaxngGrammar.
Fixed many "confusing RelaxngPattern and RelaxngPatternList"
problems, and ditto for other "List" stuff.
To avoid complex situations, mostly removed unused annotation stuff.
2004-05-09 Atsushi Enomoto <[email protected]>
* RncParser.jay :
File diff suppressed because it is too large. Load diff
@@ -16,7 +16,7 @@ using Commons.Xml.Relaxng;
namespace Commons.Xml.Relaxng.Rnc
{
public class RncTokenizer : Commons.Xml.Relaxng.Rnc.yyParser.yyInput
internal class RncTokenizer : Commons.Xml.Relaxng.Rnc.yyParser.yyInput
{
TextReader source;
@@ -1,3 +1,22 @@
2004-05-31 Atsushi Enomoto <[email protected]>
* Misc.cs : made Util class internal.
* RelaxngDatatypeProvider.cs : looks commit was missing.
* RelaxngException.cs : made one .ctor() internal that accepts
RdpPattern.
* RelaxngNameClas.cs : Names list should not be settable.
* RelaxngPattern.cs : RelaxngRefPattern class is internal use only.
* RelaxngPatternType.cs : there is not "Include" pattern.
2004-05-30 Atsushi Enomoto <[email protected]>
* RelaxngDatatypeProvider.cs : removed meaningless using alias.
* RelaxngGrammar.cs : modified ArrayList to RelaxngGrammarContentList.
RelaxngMergedProvider.cs : Added #if PNET switch to support non-
xmlschema available environment.
* RelaxngPattern.cs : added IGrammarContent and
RelaxngGrammarContentList.
2004-03-17 Atsushi Enomoto <[email protected]>
* RelaxngNameClass.cs : Introduced RelaxngNameClassList class.
@@ -14,7 +14,7 @@ using Commons.Xml.Relaxng.Derivative;
namespace Commons.Xml.Relaxng
{
public class Util
internal class Util
{
public static string ResolveUri (string baseUri, string href)
{
@@ -10,9 +10,6 @@
using System;
using System.Xml;
using System.Xml.Schema;
using Commons.Xml.Relaxng.XmlSchema;
using XSchema = System.Xml.Schema.XmlSchema;
namespace Commons.Xml.Relaxng
{
@@ -22,7 +22,7 @@ namespace Commons.Xml.Relaxng
public RelaxngException (string message) : base (message) {}
public RelaxngException (string message, Exception innerException)
: base (message, innerException) {}
public RelaxngException (string message, RdpPattern invalidatedPattern)
internal RelaxngException (string message, RdpPattern invalidatedPattern)
: base (message)
{
debugXml = RdpUtil.DebugRdpPattern (invalidatedPattern, new Hashtable ());
@@ -23,10 +23,10 @@ namespace Commons.Xml.Relaxng
"http://relaxng.org/ns/structure/1.0";
// object model fields
ArrayList starts = new ArrayList ();
ArrayList defs = new ArrayList ();
ArrayList includes = new ArrayList ();
ArrayList divs = new ArrayList ();
RelaxngGrammarContentList starts = new RelaxngGrammarContentList ();
RelaxngGrammarContentList defs = new RelaxngGrammarContentList ();
RelaxngGrammarContentList includes = new RelaxngGrammarContentList ();
RelaxngGrammarContentList divs = new RelaxngGrammarContentList ();
RelaxngDatatypeProvider provider;
@@ -75,19 +75,19 @@ namespace Commons.Xml.Relaxng
get { return RelaxngPatternType.Grammar; }
}
public IList Starts {
public RelaxngGrammarContentList Starts {
get { return starts; }
}
public IList Defines {
public RelaxngGrammarContentList Defines {
get { return defs; }
}
public IList Includes {
public RelaxngGrammarContentList Includes {
get { return includes; }
}
public IList Divs {
public RelaxngGrammarContentList Divs {
get { return divs; }
}
@@ -20,8 +20,10 @@ namespace Commons.Xml.Relaxng
static RelaxngMergedProvider ()
{
RelaxngMergedProvider p = new RelaxngMergedProvider ();
#if !PNET
p ["http://www.w3.org/2001/XMLSchema-datatypes"] = XsdDatatypeProvider.Instance;
p [XSchema.Namespace] = XsdDatatypeProvider.Instance;
#endif
p [String.Empty] = RelaxngNamespaceDatatypeProvider.Instance;
defaultProvider = p;
}
@@ -260,7 +260,6 @@ namespace Commons.Xml.Relaxng
public RelaxngNameClassList Names {
get { return names; }
set { names = value; }
}
public override void Write (XmlWriter writer)
@@ -121,7 +121,11 @@ namespace Commons.Xml.Relaxng
#endregion
#region Grammatical elements
public class RelaxngStart : RelaxngElementBase
public interface IGrammarContent
{
}
public class RelaxngStart : RelaxngElementBase, IGrammarContent
{
RelaxngPattern p;
string combine;
@@ -155,7 +159,7 @@ namespace Commons.Xml.Relaxng
}
}
public class RelaxngDefine : RelaxngElementBase
public class RelaxngDefine : RelaxngElementBase, IGrammarContent
{
string name;
private RelaxngPatternList patterns = new RelaxngPatternList ();
@@ -211,12 +215,12 @@ namespace Commons.Xml.Relaxng
}
}
public class RelaxngInclude : RelaxngElementBase
public class RelaxngInclude : RelaxngElementBase, IGrammarContent
{
string href;
IList starts = new ArrayList ();
IList defines = new ArrayList ();
IList divs = new ArrayList ();
RelaxngGrammarContentList starts = new RelaxngGrammarContentList ();
RelaxngGrammarContentList defines = new RelaxngGrammarContentList ();
RelaxngGrammarContentList divs = new RelaxngGrammarContentList ();
string ns;
public RelaxngInclude ()
@@ -228,15 +232,15 @@ namespace Commons.Xml.Relaxng
set { href = value; }
}
public IList Starts {
public RelaxngGrammarContentList Starts {
get { return starts; }
}
public IList Defines {
public RelaxngGrammarContentList Defines {
get { return defines; }
}
public IList Divs {
public RelaxngGrammarContentList Divs {
get { return divs; }
}
@@ -292,7 +296,7 @@ namespace Commons.Xml.Relaxng
// starts.
if (this.Starts.Count > 0 && g.Starts.Count == 0)
throw new RelaxngException ("When the included grammar does not contain start components, this include component must not contain start components.");
IList appliedStarts = (this.starts.Count > 0) ?
RelaxngGrammarContentList appliedStarts = (this.starts.Count > 0) ?
this.starts : g.Starts;
RelaxngDiv div = new RelaxngDiv ();
@@ -325,30 +329,30 @@ namespace Commons.Xml.Relaxng
}
}
public class RelaxngDiv : RelaxngElementBase
public class RelaxngDiv : RelaxngElementBase, IGrammarContent
{
IList starts = new ArrayList ();
IList defines = new ArrayList ();
IList includes = new ArrayList ();
IList divs = new ArrayList ();
RelaxngGrammarContentList starts = new RelaxngGrammarContentList ();
RelaxngGrammarContentList defines = new RelaxngGrammarContentList ();
RelaxngGrammarContentList includes = new RelaxngGrammarContentList ();
RelaxngGrammarContentList divs = new RelaxngGrammarContentList ();
public RelaxngDiv ()
{
}
public IList Starts {
public RelaxngGrammarContentList Starts {
get { return starts; }
}
public IList Defines {
public RelaxngGrammarContentList Defines {
get { return defines; }
}
public IList Includes {
public RelaxngGrammarContentList Includes {
get { return includes; }
}
public IList Divs {
public RelaxngGrammarContentList Divs {
get { return divs; }
}
@@ -480,6 +484,33 @@ namespace Commons.Xml.Relaxng
}
}
public class RelaxngGrammarContentList : CollectionBase
{
public RelaxngGrammarContentList ()
{
}
public void Add (IGrammarContent p)
{
List.Add (p);
}
public IGrammarContent this [int i] {
get { return this.List [i] as IGrammarContent; }
set { this.List [i] = value; }
}
public void Insert (int pos, IGrammarContent p)
{
List.Insert (pos, p);
}
public void Remove (IGrammarContent p)
{
List.Remove (p);
}
}
// strict to say, it's not a pattern ;)
public class RelaxngNotAllowed : RelaxngPattern
{
@@ -1317,7 +1348,7 @@ namespace Commons.Xml.Relaxng
}
}
public class RelaxngRefPattern
internal class RelaxngRefPattern
{
RelaxngPattern patternRef;
string name;
@@ -36,7 +36,7 @@ namespace Commons.Xml.Relaxng
ZeroOrMore = 17, // no use in derivative
Mixed = 18, // no use in derivative
Optional = 19, // no use in derivative
Include = 20, // no use in derivative
// Include = 20, // no use in derivative
ExternalRef = 21, // no use in derivative
ParentRef = 22, // no use in derivative
}
@@ -1,3 +1,7 @@
2004-05-30 Atsushi Enomoto <[email protected]>
* RncTests.cs : fixed test that got impossible to build anymore.
2004-05-08 Gonzalo Paniagua Javier <[email protected]>
* RelaxngValidatingReaderTests.cs: this compiled with mcs but fails with
@@ -24,7 +24,7 @@ namespace MonoTests.Commons.Xml.Relaxng
{
RncParser parser = new RncParser (new NameTable ());
using (StreamReader sr = new StreamReader ("Test/XmlFiles/relaxng.rnc")) {
RelaxngGrammar g = parser.Parse (sr);
RelaxngPattern g = parser.Parse (sr);
g.Compile ();
}
}
@@ -1,3 +1,10 @@
2004-05-31 Atsushi Enomoto <[email protected]>
* anglia-test-runner.cs : Added support for RELAX NG compact syntax
parser tests.
* Makefile : added anglia-test support.
* README : ditto.
2004-02-25 Atsushi Enomoto <[email protected]>
* Added README, Makefile, relaxngtest.cs, prep.xsl, copying.html
@@ -1,26 +1,44 @@
RUNTIME = mono
MCS_RUNTIME =
MCS = mcs
TESTS = relax-ng/001/i.rng
TEST_ARCHIVE = testSuite.zip
RNCTESTS = test/RNCTest.xml
RNCTEST_ARCHIVE = anglia-test-suite.zip
all : relaxngtest.exe anglia-test-runner.exe
relaxngtest.exe : relaxngtest.cs $(TESTS)
$(MCS_RUNTIME) $(MCS) relaxngtest.cs -r:Commons.Xml.Relaxng.dll
$(MCS_RUNTIME) $(MCS) -debug+ relaxngtest.cs -r:Commons.Xml.Relaxng.dll
anglia-test-runner.exe : anglia-test-runner.cs $(RNCTESTS)
$(MCS_RUNTIME) $(MCS) -debug+ anglia-test-runner.cs -r:Commons.Xml.Relaxng.dll
$(TESTS) : $(TEST_ARCHIVE) relax-ng
cd relax-ng; unzip -n ../$(TEST_ARCHIVE); \
xsltproc split.xsl spectest.xml; cd ..; \
cp prep.xsl relax-ng
$(RNCTESTS) : $(RNCTEST_ARCHIVE)
unzip -n anglia-test-suite.zip
$(TEST_ARCHIVE) :
wget http://www.thaiopensource.com/relaxng/testSuite.zip
$(RNCTEST_ARCHIVE) :
wget http://www.jeffrafter.com/anglia/anglia-test-suite.zip
relax-ng:
mkdir relax-ng
test :
test : relaxngtest.exe
$(RUNTIME) relaxngtest.exe
anglia-test : anglia-test-runner.exe
$(RUNTIME) anglia-test-runner.exe
# be careful to use it. This removes ALL files in xml-test-suite!
# clean:
# rm -rf xml-test-suite
@@ -1,17 +1,41 @@
* standalone RELAX NG test program for the Test Suite
** Introduction
* Standalone test collection for Commons.Xml.Relaxng.dll
** standalone RELAX NG test program for the Test Suite
It is a test runner for James Clark's test collection.
prep.xsl is included in Jing (a Java implementation of RELAX NG validator).
copying.html is license information for prep.xsl and relaxng.rng.
prep.xsl is originally included in Jing (a Java implementation of RELAX NG
validator). copying.html is license information for prep.xsl and relaxng.rng.
** Usage
To set up test runner, you need xsltproc, which is included in libxslt.
** standalone RELAX NG Compact Syntax test program for the "anglia" test suite
It is a test runner for Jeff Rafter's "anglia" RNC test collection.
** How to build
NOTE: To set up test runner, you need xsltproc, which is included in libxslt.
(Since the stylesheet uses extensions, we cannot use our xslt engine.)
"make" will download the test collection from http://www.thaiopensource.com/relaxng/testSuite.zip , run xsltproc and create test directories and files.
"make" will do the same as "make relaxngtest.exe" and
"make anglia-test-runner.exe".
"make relaxngtest.exe" will download the test collection from
http://www.thaiopensource.com/relaxng/testSuite.zip and then run
xsltproc to split tests and create test directories and files, and finally
will compile relaxngtest.cs.
"make anglia-test-runner.exe" will download the test collection from
http://www.jeffrafter.com/anglia/anglia-test-suite.zip , and then will expand
that archive, and finally will compile anglia-test-runner.cs.
*** How to run
"make test" will run relaxngtest.exe and will output the error cases.
"make anglia-test" will run anglia-test-runner.exe and will output the
error cases.
"make test" will run the test program and will output the error cases.
@@ -0,0 +1,46 @@
using System;
using System.IO;
using System.Xml;
using Commons.Xml.Relaxng;
using Commons.Xml.Relaxng.Rnc;
public class Driver
{
public static void Main ()
{
try {
XmlDocument doc = new XmlDocument ();
doc.Load ("test/RNCTest.xml");
int success = 0;
int failure = 0;
foreach (XmlElement el in doc.SelectNodes ("/RNCTestCases/TestCase")) {
string id = el.GetAttribute ("id");
bool isValid = el.GetAttribute ("legal") == "true";
RncParser p = new RncParser (new NameTable ());
try {
string s = new StreamReader ("test" + Path.DirectorySeparatorChar + el.GetAttribute ("path")).ReadToEnd ();
p.Parse (new StringReader (s));
if (isValid) {
success++;
// Console.Error.WriteLine ("valid " + id);
} else {
failure++;
Console.Error.WriteLine ("INCORRECTLY VALID " + id);
}
} catch (Exception ex) {
if (isValid) {
failure++;
Console.Error.WriteLine ("INCORRECTLY INVALID " + id + " --> " + ex.Message);
} else {
success++;
// Console.Error.WriteLine ("invalid " + id);
}
}
}
Console.Error.WriteLine ("Total success: " + success);
Console.Error.WriteLine ("Total failure: " + failure);
} catch (Exception ex) {
Console.Error.WriteLine ("Unexpected Exception: " + ex);
}
}
}
@@ -29,5 +29,9 @@ namespace Microsoft.CSharp {
{
this.comment = comment;
}
public string Comment {
get { return comment; }
}
}
}
+1 -1
View File
@@ -219,7 +219,7 @@ public class CP51932 : Encoding
value -= 0x0100;
bytes [posn++] = (byte) (value / 0x5E + 0xA1);
bytes [posn++] = (byte) (value % 0x5E + 0xA1);
Console.WriteLine ("{0:X04}", ch);
//Console.WriteLine ("{0:X04}", ch);
continue;
}
else
@@ -1,24 +1,23 @@
./Assembly/AssemblyInfo.cs
./IBM.Data.DB2/DB2ClientUtils.cs
./IBM.Data.DB2/DB2CLIWrapper.cs
./IBM.Data.DB2/DB2ClientUtils.cs
./IBM.Data.DB2/DB2OpenConnection.cs
./IBM.Data.DB2/DB2Command.cs
./IBM.Data.DB2/DB2Connection.cs
./IBM.Data.DB2/DB2ConnectionPool.cs
./IBM.Data.DB2/DB2ConnectionSettings.cs
./IBM.Data.DB2/DB2Constants.cs
./IBM.Data.DB2/DB2DataAdapter.cs
./IBM.Data.DB2/DB2DataReader.cs
./IBM.Data.DB2/DB2Environment.cs
./IBM.Data.DB2/DB2ErrorCollection.cs
./IBM.Data.DB2/DB2Error.cs
./IBM.Data.DB2/DB2ErrorCollection.cs
./IBM.Data.DB2/DB2Exception.cs
./IBM.Data.DB2/DB2InfoMessageEventArgs.cs
./IBM.Data.DB2/DB2OpenConnection.cs
./IBM.Data.DB2/DB2ParameterCollection.cs
./IBM.Data.DB2/DB2Parameter.cs
./IBM.Data.DB2/DB2ParameterCollection.cs
./IBM.Data.DB2/DB2RowUpdatedEventArgs.cs
./IBM.Data.DB2/DB2RowUpdatedEventHandler.cs
./IBM.Data.DB2/DB2RowUpdatingEventArgs.cs
./IBM.Data.DB2/DB2RowUpdatingEventHandler.cs
./IBM.Data.DB2/DB2Transaction.cs
./IBM.Data.DB2/DB2Type.cs
./IBM.Data.DB2/DB2Type.cs
@@ -0,0 +1,8 @@
2004-06-09 Sebastien Pouliot <[email protected]>
* Makefile: Don't sign this assembly as it is fully signed during
compilation (we have the original private key). Thanks to Jackson.
2004-05-28 Duncan Mak <[email protected]>
* SharpZipLib.pub: Added public key.
@@ -1,53 +1,53 @@
// AssemblyInfo.cs
// Copyright (C) 2001 Mike Krueger
//
// 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.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyTitle("SharpZipLibrary")]
[assembly: AssemblyDescription("free C# zlib implementation")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("#ZipLibrary")]
[assembly: AssemblyCopyright("(c) Mike Krueger 2001-2002")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
#if NET_2_0
[assembly: AssemblyVersion("0.31.2.0")]
#else
[assembly: AssemblyVersion("0.31.0.0")]
#endif
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("SharpZipLib.key")]
// AssemblyInfo.cs
// Copyright (C) 2001 Mike Krueger
//
// 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.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: CLSCompliant(true)]
[assembly: AssemblyTitle("ICSharpCode.SharpZipLibrary")]
[assembly: AssemblyDescription("free C# zlib implementation")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("#ZipLibrary")]
[assembly: AssemblyCopyright("(c) Mike Krueger 2001-2004")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("0.6.0.0")]
[assembly: AssemblyDelaySign(true)]
[assembly: AssemblyKeyFile ("SharpZipLib.pub")]
@@ -35,7 +35,8 @@
using System;
using System.IO;
namespace ICSharpCode.SharpZipLib.BZip2 {
namespace ICSharpCode.SharpZipLib.BZip2
{
/// <summary>
/// Does all the compress and decompress pre-operation stuff.
@@ -46,16 +47,8 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
{
public static void Decompress(Stream instream, Stream outstream)
{
BufferedStream bos = new BufferedStream(outstream);
BufferedStream bis = new BufferedStream(instream);
int b = bis.ReadByte();
if (b != 'B') {
return;
}
b = bis.ReadByte();
if (b != 'Z') {
return;
}
System.IO.Stream bos = outstream;
System.IO.Stream bis = instream;
BZip2InputStream bzis = new BZip2InputStream(bis);
int ch = bzis.ReadByte();
while (ch != -1) {
@@ -66,13 +59,11 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
}
public static void Compress(Stream instream, Stream outstream, int blockSize)
{
BufferedStream bos = new BufferedStream(outstream);
bos.WriteByte((byte)'B');
bos.WriteByte((byte)'Z');
BufferedStream bis = new BufferedStream(instream);
{
System.IO.Stream bos = outstream;
System.IO.Stream bis = instream;
int ch = bis.ReadByte();
BZip2OutputStream bzos = new BZip2OutputStream(bos);
BZip2OutputStream bzos = new BZip2OutputStream(bos, blockSize);
while(ch != -1) {
bzos.WriteByte((byte)ch);
ch = bis.ReadByte();
@@ -32,7 +32,8 @@
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
namespace ICSharpCode.SharpZipLib.BZip2 {
namespace ICSharpCode.SharpZipLib.BZip2
{
/// <summary>
/// Base class for both the compress and decompress classes.
@@ -41,59 +42,59 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
public sealed class BZip2Constants
{
public readonly static int[] rNums = {
619, 720, 127, 481, 931, 816, 813, 233, 566, 247,
985, 724, 205, 454, 863, 491, 741, 242, 949, 214,
733, 859, 335, 708, 621, 574, 73, 654, 730, 472,
419, 436, 278, 496, 867, 210, 399, 680, 480, 51,
878, 465, 811, 169, 869, 675, 611, 697, 867, 561,
862, 687, 507, 283, 482, 129, 807, 591, 733, 623,
150, 238, 59, 379, 684, 877, 625, 169, 643, 105,
170, 607, 520, 932, 727, 476, 693, 425, 174, 647,
73, 122, 335, 530, 442, 853, 695, 249, 445, 515,
909, 545, 703, 919, 874, 474, 882, 500, 594, 612,
641, 801, 220, 162, 819, 984, 589, 513, 495, 799,
161, 604, 958, 533, 221, 400, 386, 867, 600, 782,
382, 596, 414, 171, 516, 375, 682, 485, 911, 276,
98, 553, 163, 354, 666, 933, 424, 341, 533, 870,
227, 730, 475, 186, 263, 647, 537, 686, 600, 224,
469, 68, 770, 919, 190, 373, 294, 822, 808, 206,
184, 943, 795, 384, 383, 461, 404, 758, 839, 887,
715, 67, 618, 276, 204, 918, 873, 777, 604, 560,
951, 160, 578, 722, 79, 804, 96, 409, 713, 940,
652, 934, 970, 447, 318, 353, 859, 672, 112, 785,
645, 863, 803, 350, 139, 93, 354, 99, 820, 908,
609, 772, 154, 274, 580, 184, 79, 626, 630, 742,
653, 282, 762, 623, 680, 81, 927, 626, 789, 125,
411, 521, 938, 300, 821, 78, 343, 175, 128, 250,
170, 774, 972, 275, 999, 639, 495, 78, 352, 126,
857, 956, 358, 619, 580, 124, 737, 594, 701, 612,
669, 112, 134, 694, 363, 992, 809, 743, 168, 974,
944, 375, 748, 52, 600, 747, 642, 182, 862, 81,
344, 805, 988, 739, 511, 655, 814, 334, 249, 515,
897, 955, 664, 981, 649, 113, 974, 459, 893, 228,
433, 837, 553, 268, 926, 240, 102, 654, 459, 51,
686, 754, 806, 760, 493, 403, 415, 394, 687, 700,
946, 670, 656, 610, 738, 392, 760, 799, 887, 653,
978, 321, 576, 617, 626, 502, 894, 679, 243, 440,
680, 879, 194, 572, 640, 724, 926, 56, 204, 700,
707, 151, 457, 449, 797, 195, 791, 558, 945, 679,
297, 59, 87, 824, 713, 663, 412, 693, 342, 606,
134, 108, 571, 364, 631, 212, 174, 643, 304, 329,
343, 97, 430, 751, 497, 314, 983, 374, 822, 928,
140, 206, 73, 263, 980, 736, 876, 478, 430, 305,
170, 514, 364, 692, 829, 82, 855, 953, 676, 246,
369, 970, 294, 750, 807, 827, 150, 790, 288, 923,
804, 378, 215, 828, 592, 281, 565, 555, 710, 82,
896, 831, 547, 261, 524, 462, 293, 465, 502, 56,
661, 821, 976, 991, 658, 869, 905, 758, 745, 193,
768, 550, 608, 933, 378, 286, 215, 979, 792, 961,
61, 688, 793, 644, 986, 403, 106, 366, 905, 644,
372, 567, 466, 434, 645, 210, 389, 550, 919, 135,
780, 773, 635, 389, 707, 100, 626, 958, 165, 504,
920, 176, 193, 713, 857, 265, 203, 50, 668, 108,
645, 990, 626, 197, 510, 357, 358, 850, 858, 364,
936, 638
};
619, 720, 127, 481, 931, 816, 813, 233, 566, 247,
985, 724, 205, 454, 863, 491, 741, 242, 949, 214,
733, 859, 335, 708, 621, 574, 73, 654, 730, 472,
419, 436, 278, 496, 867, 210, 399, 680, 480, 51,
878, 465, 811, 169, 869, 675, 611, 697, 867, 561,
862, 687, 507, 283, 482, 129, 807, 591, 733, 623,
150, 238, 59, 379, 684, 877, 625, 169, 643, 105,
170, 607, 520, 932, 727, 476, 693, 425, 174, 647,
73, 122, 335, 530, 442, 853, 695, 249, 445, 515,
909, 545, 703, 919, 874, 474, 882, 500, 594, 612,
641, 801, 220, 162, 819, 984, 589, 513, 495, 799,
161, 604, 958, 533, 221, 400, 386, 867, 600, 782,
382, 596, 414, 171, 516, 375, 682, 485, 911, 276,
98, 553, 163, 354, 666, 933, 424, 341, 533, 870,
227, 730, 475, 186, 263, 647, 537, 686, 600, 224,
469, 68, 770, 919, 190, 373, 294, 822, 808, 206,
184, 943, 795, 384, 383, 461, 404, 758, 839, 887,
715, 67, 618, 276, 204, 918, 873, 777, 604, 560,
951, 160, 578, 722, 79, 804, 96, 409, 713, 940,
652, 934, 970, 447, 318, 353, 859, 672, 112, 785,
645, 863, 803, 350, 139, 93, 354, 99, 820, 908,
609, 772, 154, 274, 580, 184, 79, 626, 630, 742,
653, 282, 762, 623, 680, 81, 927, 626, 789, 125,
411, 521, 938, 300, 821, 78, 343, 175, 128, 250,
170, 774, 972, 275, 999, 639, 495, 78, 352, 126,
857, 956, 358, 619, 580, 124, 737, 594, 701, 612,
669, 112, 134, 694, 363, 992, 809, 743, 168, 974,
944, 375, 748, 52, 600, 747, 642, 182, 862, 81,
344, 805, 988, 739, 511, 655, 814, 334, 249, 515,
897, 955, 664, 981, 649, 113, 974, 459, 893, 228,
433, 837, 553, 268, 926, 240, 102, 654, 459, 51,
686, 754, 806, 760, 493, 403, 415, 394, 687, 700,
946, 670, 656, 610, 738, 392, 760, 799, 887, 653,
978, 321, 576, 617, 626, 502, 894, 679, 243, 440,
680, 879, 194, 572, 640, 724, 926, 56, 204, 700,
707, 151, 457, 449, 797, 195, 791, 558, 945, 679,
297, 59, 87, 824, 713, 663, 412, 693, 342, 606,
134, 108, 571, 364, 631, 212, 174, 643, 304, 329,
343, 97, 430, 751, 497, 314, 983, 374, 822, 928,
140, 206, 73, 263, 980, 736, 876, 478, 430, 305,
170, 514, 364, 692, 829, 82, 855, 953, 676, 246,
369, 970, 294, 750, 807, 827, 150, 790, 288, 923,
804, 378, 215, 828, 592, 281, 565, 555, 710, 82,
896, 831, 547, 261, 524, 462, 293, 465, 502, 56,
661, 821, 976, 991, 658, 869, 905, 758, 745, 193,
768, 550, 608, 933, 378, 286, 215, 979, 792, 961,
61, 688, 793, 644, 986, 403, 106, 366, 905, 644,
372, 567, 466, 434, 645, 210, 389, 550, 919, 135,
780, 773, 635, 389, 707, 100, 626, 958, 165, 504,
920, 176, 193, 713, 857, 265, 203, 50, 668, 108,
645, 990, 626, 197, 510, 357, 358, 850, 858, 364,
936, 638
};
public readonly static int baseBlockSize = 100000;
@@ -37,7 +37,8 @@ using System.IO;
using ICSharpCode.SharpZipLib.Checksums;
namespace ICSharpCode.SharpZipLib.BZip2 {
namespace ICSharpCode.SharpZipLib.BZip2
{
/// <summary>
/// An input stream that decompresses from the BZip2 format (without the file
@@ -159,23 +160,23 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
static void Cadvise()
{
Console.WriteLine("CRC Error");
//Console.WriteLine("CRC Error");
//throw new CCoruptionError();
}
static void BadBGLengths()
{
Console.WriteLine("bad BG lengths");
//Console.WriteLine("bad BG lengths");
}
static void bitStreamEOF()
static void BitStreamEOF()
{
Console.WriteLine("bit stream eof");
//Console.WriteLine("bit stream eof");
}
static void CompressedStreamEOF()
{
Console.WriteLine("compressed stream eof");
//Console.WriteLine("compressed stream eof");
}
void MakeMaps()
@@ -209,8 +210,8 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
bool blockRandomised;
// private int bytesIn;
// private int bytesOut;
// private int bytesIn;
// private int bytesOut;
int bsBuff;
int bsLive;
IChecksum mCrc = new StrangeCRC();
@@ -284,7 +285,7 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
public override int ReadByte()
{
if (streamEnd) {
return -1;
return -1; // ok
}
int retChar = currentChar;
@@ -313,10 +314,14 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
void Initialize()
{
// -jr- 18-Nov-2003 magic1 and 2 added here so stream is fully capable on its own
char magic1 = BsGetUChar();
char magic2 = BsGetUChar();
char magic3 = BsGetUChar();
char magic4 = BsGetUChar();
if (magic3 != 'h' || magic4 < '1' || magic4 > '9') {
if (magic1 != 'B' || magic2 != 'Z' || magic3 != 'h' || magic4 < '1' || magic4 > '9') {
streamEnd = true;
return;
}
@@ -365,7 +370,7 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
CrcError();
}
// 1528150659
// 1528150659
computedCombinedCRC = ((computedCombinedCRC << 1) & 0xFFFFFFFF) | (computedCombinedCRC >> 31);
computedCombinedCRC = computedCombinedCRC ^ (uint)computedBlockCRC;
}
@@ -382,17 +387,17 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
static void BlockOverrun()
{
Console.WriteLine("Block overrun");
//Console.WriteLine("Block overrun");
}
static void BadBlockHeader()
{
Console.WriteLine("Bad block header");
//Console.WriteLine("Bad block header");
}
static void CrcError()
{
Console.WriteLine("crc error");
//Console.WriteLine("crc error");
}
@@ -518,6 +523,10 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
for (int j = 0; j < 16; j++) {
inUse[i * 16 + j] = (BsR(1) == 1);
}
} else {
for (int j = 0; j < 16; j++) {
inUse[i * 16 + j] = false;
}
}
}
@@ -622,6 +631,9 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
int zj;
while (zvec > limit[zt][zn]) {
if (zn > 20) { // the longest code
throw new ApplicationException("Bzip data error"); // -jr- 17-Dec-2003 from bzip 1.02 why 20???
}
zn++;
while (bsLive < 1) {
FillBuffer();
@@ -630,10 +642,12 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
bsLive--;
zvec = (zvec << 1) | zj;
}
if (zvec - baseArray[zt][zn] < 0 || zvec - baseArray[zt][zn] >= BZip2Constants.MAX_ALPHA_SIZE) {
throw new ApplicationException("Bzip data error"); // -jr- 17-Dec-2003 from bzip 1.02
}
nextSym = perm[zt][zvec - baseArray[zt][zn]];
while (true) {
if (nextSym == EOB) {
break;
}
@@ -643,9 +657,9 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
int n = 1;
do {
if (nextSym == BZip2Constants.RUNA) {
s += (0+1) * n;
s += (0 + 1) * n;
} else if (nextSym == BZip2Constants.RUNB) {
s += (1+1) * n;
s += (1 + 1) * n;
}
n <<= 1;
@@ -762,7 +776,7 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
void SetupRandPartA()
{
if(i2 <= last) {
if (i2 <= last) {
chPrev = ch2;
ch2 = ll8[tPos];
tPos = tt[tPos];
@@ -886,11 +900,10 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
void SetDecompressStructureSizes(int newSize100k)
{
if (!(0 <= newSize100k && newSize100k <= 9 &&
0 <= blockSize100k && blockSize100k <= 9)) {
if (!(0 <= newSize100k && newSize100k <= 9 && 0 <= blockSize100k && blockSize100k <= 9)) {
throw new ApplicationException("Invalid block size");
}
blockSize100k = newSize100k;
if (newSize100k == 0) {
@@ -37,7 +37,8 @@ using System.IO;
using ICSharpCode.SharpZipLib.Checksums;
namespace ICSharpCode.SharpZipLib.BZip2 {
namespace ICSharpCode.SharpZipLib.BZip2
{
/// <summary>
/// An output stream that compresses into the BZip2 format (without the file
@@ -152,7 +153,7 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
static void Panic()
{
Console.WriteLine("panic");
//Console.WriteLine("panic");
}
void MakeMaps()
@@ -222,7 +223,7 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
break;
}
if (yy < nHeap && weight[heap[yy+1]] < weight[heap[yy]]) {
yy++;
yy++;
}
if (weight[tmp] < weight[heap[yy]]) {
break;
@@ -241,13 +242,15 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
tmp = heap[zz];
while (true) {
yy = zz << 1;
if (yy > nHeap)
if (yy > nHeap) {
break;
if (yy < nHeap &&
weight[heap[yy+1]] < weight[heap[yy]])
yy++;
if (weight[tmp] < weight[heap[yy]])
}
if (yy < nHeap && weight[heap[yy+1]] < weight[heap[yy]]) {
yy++;
}
if (weight[tmp] < weight[heap[yy]]) {
break;
}
heap[zz] = heap[yy];
zz = yy;
}
@@ -255,7 +258,7 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
nNodes++;
parent[n1] = parent[n2] = nNodes;
weight[nNodes] = (int)((weight[n1] & 0xffffff00) + (weight[n2] & 0xffffff00)) |
weight[nNodes] = (int)((weight[n1] & 0xffffff00) + (weight[n2] & 0xffffff00)) |
(int)(1 + (((weight[n1] & 0x000000ff) > (weight[n2] & 0x000000ff)) ? (weight[n1] & 0x000000ff) : (weight[n2] & 0x000000ff)));
parent[nNodes] = -1;
@@ -319,7 +322,7 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
bool blockRandomised;
// int bytesIn;
// int bytesIn;
int bytesOut;
int bsBuff;
int bsLive;
@@ -475,14 +478,14 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
EndBlock();
EndCompression();
closed = true;
// super.close();
// super.close();
Flush();
baseStream.Close();
}
public override void Flush()
{
// super.flush();
// super.flush();
baseStream.Flush();
}
@@ -490,13 +493,16 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
void Initialize()
{
// bytesIn = 0;
// bytesIn = 0;
bytesOut = 0;
nBlocksRandomised = 0;
/*--- Write `magic' bytes h indicating file-format == huffmanised,
followed by a digit indicating blockSize100k.
---*/
BsPutUChar('B'); // -jr- 18-Nov-2003 added to match BZ2 1.02 header already in BZip class but that sux a lot
BsPutUChar('Z');
BsPutUChar('h');
BsPutUChar('0' + blockSize100k);
@@ -522,6 +528,10 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
void EndBlock()
{
if (last < 0) { //-jr- dont do anything for empty files, (makes empty files compatible with original Bzip)
return;
}
blockCRC = (uint)mCrc.Value;
combinedCRC = (combinedCRC << 1) | (combinedCRC >> 31);
combinedCRC ^= blockCRC;
@@ -609,7 +619,8 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
void BsFinishedWithStream()
{
while (bsLive > 0) {
while (bsLive > 0)
{
int ch = (bsBuff >> 24);
baseStream.WriteByte((byte)ch); // write 8-bit
bsBuff <<= 8;
@@ -740,7 +751,6 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
totc = 0;
gs = 0;
while (true) {
/*--- Set group start & end marks. --*/
if (gs >= nMTF) {
break;
@@ -831,7 +841,6 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
Panic();
}
/*--- Compute MTF values for the selectors. ---*/
char[] pos = new char[BZip2Constants.N_GROUPS];
char ll_i, tmp2, tmp;
@@ -1011,35 +1020,40 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
i++;
/*-- copy 2 --*/
if (i > hi)
if (i > hi) {
break;
}
v = zptr[i];
j = i;
while (FullGtU ( zptr[j-h]+d, v+d )) {
zptr[j] = zptr[j-h];
j = j - h;
if (j <= (lo + h - 1))
if (j <= (lo + h - 1)) {
break;
}
}
zptr[j] = v;
i++;
/*-- copy 3 --*/
if (i > hi)
if (i > hi) {
break;
}
v = zptr[i];
j = i;
while (FullGtU ( zptr[j-h]+d, v+d)) {
zptr[j] = zptr[j-h];
j = j - h;
if (j <= (lo + h - 1))
if (j <= (lo + h - 1)) {
break;
}
}
zptr[j] = v;
i++;
if (workDone > workLimit && firstAttempt)
if (workDone > workLimit && firstAttempt) {
return;
}
}
}
}
@@ -1088,8 +1102,9 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
int unLo, unHi, ltLo, gtHi, med, n, m;
int sp, lo, hi, d;
StackElem[] stack = new StackElem[QSORT_STACK_SIZE];
for(int count = 0; count < QSORT_STACK_SIZE; count++)
for (int count = 0; count < QSORT_STACK_SIZE; count++) {
stack[count] = new StackElem();
}
sp = 0;
@@ -1110,8 +1125,9 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
if (hi - lo < SMALL_THRESH || d > DEPTH_THRESH) {
SimpleSort(lo, hi, d);
if (workDone > workLimit && firstAttempt)
if (workDone > workLimit && firstAttempt) {
return;
}
continue;
}
@@ -1143,8 +1159,9 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
unLo++;
}
while (true) {
if (unLo > unHi)
if (unLo > unHi) {
break;
}
n = ((int)block[zptr[unHi]+d + 1]) - med;
if (n == 0) {
int temp = 0;
@@ -1154,19 +1171,21 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
gtHi--;
unHi--;
continue;
};
if (n < 0)
}
if (n < 0) {
break;
}
unHi--;
}
if (unLo > unHi)
if (unLo > unHi) {
break;
}
{
int temp = zptr[unLo];
zptr[unLo] = zptr[unHi];
zptr[unHi] = temp;
unLo++;
unHi--;
int temp = zptr[unLo];
zptr[unLo] = zptr[unHi];
zptr[unHi] = temp;
unLo++;
unHi--;
}
}
@@ -1233,18 +1252,20 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
Use simpleSort(), since the full sorting mechanism
has quite a large constant overhead.
--*/
for (i = 0; i <= last; i++)
for (i = 0; i <= last; i++) {
zptr[i] = i;
}
firstAttempt = false;
workDone = workLimit = 0;
SimpleSort(0, last, 0);
} else {
numQSorted = 0;
for (i = 0; i <= 255; i++)
for (i = 0; i <= 255; i++) {
bigDone[i] = false;
for (i = 0; i <= 65536; i++)
}
for (i = 0; i <= 65536; i++) {
ftab[i] = 0;
}
c1 = block[0];
for (i = 0; i <= last; i++) {
@@ -1253,8 +1274,9 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
c1 = c2;
}
for (i = 1; i <= 65536; i++)
for (i = 1; i <= 65536; i++) {
ftab[i] += ftab[i - 1];
}
c1 = block[1];
for (i = 0; i < last; i++) {
@@ -1292,8 +1314,9 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
while ((ftab[((runningOrder[j-h])+1) << 8] - ftab[(runningOrder[j-h]) << 8]) > (ftab[((vv)+1) << 8] - ftab[(vv) << 8])) {
runningOrder[j] = runningOrder[j-h];
j = j - h;
if (j <= (h - 1))
if (j <= (h - 1)) {
break;
}
}
runningOrder[j] = vv;
}
@@ -1318,7 +1341,7 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
--*/
for (j = 0; j <= 255; j++) {
sb = (ss << 8) + j;
if(!((ftab[sb] & SETMASK) == SETMASK) ) {
if(!((ftab[sb] & SETMASK) == SETMASK)) {
int lo = ftab[sb] & CLEARMASK;
int hi = (ftab[sb+1] & CLEARMASK) - 1;
if (hi > lo) {
@@ -1393,15 +1416,17 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
int i;
int rNToGo = 0;
int rTPos = 0;
for (i = 0; i < 256; i++)
for (i = 0; i < 256; i++) {
inUse[i] = false;
}
for (i = 0; i <= last; i++) {
if (rNToGo == 0) {
rNToGo = (int)BZip2Constants.rNums[rTPos];
rTPos++;
if(rTPos == 512)
if (rTPos == 512) {
rTPos = 0;
}
}
rNToGo--;
block[i + 1] ^= (byte)((rNToGo == 1) ? 1 : 0);
@@ -1482,8 +1507,9 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
c1 = block[i1 + 1];
c2 = block[i2 + 1];
if (c1 != c2)
if (c1 != c2) {
return c1 > c2;
}
i1++;
i2++;
@@ -1572,9 +1598,11 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
because the number of elems to sort is
usually small, typically <= 20.
--*/
readonly int[] incs = new int[] { 1, 4, 13, 40, 121, 364, 1093, 3280,
9841, 29524, 88573, 265720,
797161, 2391484 };
readonly int[] incs = new int[] {
1, 4, 13, 40, 121, 364, 1093, 3280,
9841, 29524, 88573, 265720,
797161, 2391484
};
void AllocateCompressStructures()
{
@@ -1636,7 +1664,7 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
j = 0;
tmp = yy[j];
while ( ll_i != tmp ) {
while (ll_i != tmp) {
j++;
tmp2 = tmp;
tmp = yy[j];
@@ -1661,11 +1689,12 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
wr++;
mtfFreq[BZip2Constants.RUNB]++;
break;
};
if (zPend < 2)
}
if (zPend < 2) {
break;
}
zPend = (zPend - 2) / 2;
};
}
zPend = 0;
}
szptr[wr] = (short)(j + 1);
@@ -1689,8 +1718,9 @@ namespace ICSharpCode.SharpZipLib.BZip2 {
mtfFreq[BZip2Constants.RUNB]++;
break;
}
if (zPend < 2)
if (zPend < 2) {
break;
}
zPend = (zPend - 2) / 2;
}
}
@@ -0,0 +1,5 @@
2004-05-28 Duncan Mak <[email protected]>
* AssemblyInfo.cs: Use the new SharpZipLib.pub.
* Zip/Compression/DeflaterHuffman.cs (FlushBlock): Add some
parenthesis to help the generics compiler read this source.
@@ -37,7 +37,8 @@
using System;
namespace ICSharpCode.SharpZipLib.Checksums {
namespace ICSharpCode.SharpZipLib.Checksums
{
/// <summary>
/// Computes Adler32 checksum for a stream of data. An Adler32
@@ -37,7 +37,8 @@
using System;
namespace ICSharpCode.SharpZipLib.Checksums {
namespace ICSharpCode.SharpZipLib.Checksums
{
/// <summary>
/// Generate a table for a byte-wise 32-bit CRC calculation on the polynomial:
@@ -96,7 +97,7 @@ namespace ICSharpCode.SharpZipLib.Checksums {
0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6,
0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615,
0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344,
0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344,
0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB,
0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A,
0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
@@ -118,10 +119,15 @@ namespace ICSharpCode.SharpZipLib.Checksums {
0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605,
0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8,
0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B,
0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B,
0x2D02EF8D
};
internal static uint ComputeCrc32(uint oldCrc, byte bval)
{
return (uint)(Crc32.CrcTable[(oldCrc ^ bval) & 0xFF] ^ (oldCrc >> 8));
}
/// <summary>
/// The crc data checksum so far.
/// </summary>
@@ -134,6 +140,9 @@ namespace ICSharpCode.SharpZipLib.Checksums {
get {
return (long)crc;
}
set {
crc = (uint)value;
}
}
/// <summary>
@@ -35,7 +35,8 @@
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
namespace ICSharpCode.SharpZipLib.Checksums {
namespace ICSharpCode.SharpZipLib.Checksums
{
/// <summary>
/// Interface to compute a data checksum used by checked input/output streams.
@@ -49,7 +50,8 @@ namespace ICSharpCode.SharpZipLib.Checksums {
/// <summary>
/// Returns the data checksum computed so far.
/// </summary>
long Value {
long Value
{
get;
}
@@ -38,76 +38,77 @@
using System;
namespace ICSharpCode.SharpZipLib.Checksums {
namespace ICSharpCode.SharpZipLib.Checksums
{
public class StrangeCRC : IChecksum
{
readonly static uint[] crc32Table = {
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9,
0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9,
0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011,
0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd,
0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039,
0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5,
0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81,
0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,
0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49,
0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95,
0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1,
0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d,
0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae,
0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072,
0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16,
0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca,
0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde,
0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02,
0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066,
0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e,
0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692,
0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6,
0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a,
0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e,
0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2,
0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686,
0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a,
0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637,
0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb,
0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f,
0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,
0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47,
0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b,
0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff,
0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623,
0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7,
0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b,
0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f,
0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3,
0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7,
0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b,
0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f,
0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,
0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640,
0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c,
0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8,
0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24,
0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30,
0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,
0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088,
0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654,
0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0,
0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c,
0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18,
0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,
0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0,
0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c,
0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668,
0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
};
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9,
0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9,
0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011,
0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd,
0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039,
0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5,
0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81,
0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,
0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49,
0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95,
0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1,
0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d,
0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae,
0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072,
0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16,
0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca,
0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde,
0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02,
0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066,
0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e,
0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692,
0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6,
0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a,
0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e,
0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2,
0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686,
0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a,
0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637,
0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb,
0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f,
0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,
0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47,
0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b,
0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff,
0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623,
0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7,
0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b,
0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f,
0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3,
0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7,
0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b,
0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f,
0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,
0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640,
0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c,
0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8,
0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24,
0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30,
0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,
0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088,
0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654,
0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0,
0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c,
0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18,
0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,
0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0,
0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c,
0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668,
0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
};
int globalCrc;
public StrangeCRC()
@@ -35,7 +35,8 @@
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
namespace ICSharpCode.SharpZipLib.GZip {
namespace ICSharpCode.SharpZipLib.GZip
{
/// <summary>
/// This class contains constants used for gzip.
@@ -42,7 +42,8 @@ using ICSharpCode.SharpZipLib.Checksums;
using ICSharpCode.SharpZipLib.Zip.Compression;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
namespace ICSharpCode.SharpZipLib.GZip {
namespace ICSharpCode.SharpZipLib.GZip
{
/// <summary>
/// This filter stream is used to decompress a "GZIP" format stream.
@@ -80,9 +81,6 @@ namespace ICSharpCode.SharpZipLib.GZip {
/// </example>
public class GZipInputStream : InflaterInputStream
{
//Variables
/// <summary>
/// CRC-32 value for uncompressed data
/// </summary>
@@ -93,6 +91,9 @@ namespace ICSharpCode.SharpZipLib.GZip {
/// </summary>
protected bool eos;
// Have we read the GZIP header yet?
bool readGZIPHeader;
/// <summary>
/// Creates a GzipInputStream with the default buffer size
/// </summary>
@@ -165,8 +166,8 @@ namespace ICSharpCode.SharpZipLib.GZip {
Crc32 headCRC = new Crc32();
int magic = baseInputStream.ReadByte();
if (magic < 0) {
eos = true;
return;
eos = true;
return;
}
headCRC.Update(magic);
if (magic != (GZipConstants.GZIP_MAGIC >> 8)) {
@@ -246,7 +247,8 @@ namespace ICSharpCode.SharpZipLib.GZip {
extraLen = (len1 << 8) | len2;
for (int i = 0; i < extraLen;i++) {
int readByte = baseInputStream.ReadByte();
if (readByte < 0) {
if (readByte < 0)
{
throw new Exception("Early EOF baseInputStream GZIP header");
}
headCRC.Update(readByte);
@@ -330,8 +332,5 @@ namespace ICSharpCode.SharpZipLib.GZip {
*/
eos = true;
}
/* Have we read the GZIP header yet? */
private bool readGZIPHeader;
}
}
@@ -42,7 +42,8 @@ using ICSharpCode.SharpZipLib.Checksums;
using ICSharpCode.SharpZipLib.Zip.Compression;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
namespace ICSharpCode.SharpZipLib.GZip {
namespace ICSharpCode.SharpZipLib.GZip
{
/// <summary>
/// This filter stream is used to compress a stream into a "GZIP" stream.
@@ -55,7 +56,7 @@ namespace ICSharpCode.SharpZipLib.GZip {
/// using System;
/// using System.IO;
///
/// using NZlib.GZip;
/// using ICSharpCode.SharpZipLib.GZip; // -jr- corrected
///
/// class MainClass
/// {
@@ -103,7 +104,12 @@ namespace ICSharpCode.SharpZipLib.GZip {
/// </param>
public GZipOutputStream(Stream baseOutputStream, int size) : base(baseOutputStream, new Deflater(Deflater.DEFAULT_COMPRESSION, true), size)
{
// TODO : find out correctness, orgininally this was : (int) (System.currentTimeMillis() / 1000L);
WriteHeader();
// System.err.println("wrote GZIP header (" + gzipHeader.length + " bytes )");
}
void WriteHeader()
{
int mod_time = (int)(DateTime.Now.Ticks / 10000L); // Ticks give back 100ns intervals
byte[] gzipHeader = {
/* The two magic bytes */
@@ -125,9 +131,7 @@ namespace ICSharpCode.SharpZipLib.GZip {
/* The OS type (unknown) */
(byte) 255
};
baseOutputStream.Write(gzipHeader, 0, gzipHeader.Length);
// System.err.println("wrote GZIP header (" + gzipHeader.length + " bytes )");
}
public override void Write(byte[] buf, int off, int len)
@@ -162,7 +166,7 @@ namespace ICSharpCode.SharpZipLib.GZip {
(byte) totalin, (byte) (totalin >> 8),
(byte) (totalin >> 16), (byte) (totalin >> 24)
};
baseOutputStream.Write(gzipFooter, 0, gzipFooter.Length);
// System.err.println("wrote GZIP trailer (" + gzipFooter.length + " bytes )");
}
@@ -1,4 +1,4 @@
// BZip2OutputStream.cs
// InvalidHeaderException.cs
// Copyright (C) 2001 Mike Krueger
//
// This program is free software; you can redistribute it and/or
@@ -38,18 +38,18 @@ using System.Text;
namespace ICSharpCode.SharpZipLib.Tar {
public delegate void ProgressMessageHandler(TarArchive archive, string message);
public delegate void ProgressMessageHandler(TarArchive archive, TarEntry entry, string message);
/// <summary>
/// The TarArchive class implements the concept of a
/// tar archive. A tar archive is a series of entries, each of
/// which represents a file system object. Each entry in
/// the archive consists of a header record. Directory entries
/// consist only of the header record, and are followed by entries
/// the archive consists of a header block. Directory entries
/// consist only of the header block, and are followed by entries
/// for the directory's contents. File entries consist of a
/// header record followed by the number of records needed to
/// header followed by the number of blocks needed to
/// contain the file's contents. All entries are written on
/// record boundaries. Records are 512 bytes long.
/// block boundaries. Blocks are 512 bytes long.
///
/// TarArchives are instantiated in either read or write mode,
/// based upon whether they are instantiated with an InputStream
@@ -63,31 +63,31 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </summary>
public class TarArchive
{
protected bool verbose;
protected bool debug;
protected bool keepOldFiles;
protected bool asciiTranslate;
bool verbose;
bool debug;
bool keepOldFiles;
bool asciiTranslate;
protected int userId;
protected string userName;
protected int groupId;
protected string groupName;
int userId;
string userName;
int groupId;
string groupName;
protected string rootPath;
protected string pathPrefix;
string rootPath;
string pathPrefix;
protected int recordSize;
protected byte[] recordBuf;
int recordSize;
byte[] recordBuf;
protected TarInputStream tarIn;
protected TarOutputStream tarOut;
TarInputStream tarIn;
TarOutputStream tarOut;
public event ProgressMessageHandler ProgressMessageEvent;
protected virtual void OnProgressMessageEvent(string message)
protected virtual void OnProgressMessageEvent(TarEntry entry, string message)
{
if (ProgressMessageEvent != null) {
ProgressMessageEvent(this, message);
ProgressMessageEvent(this, entry, message);
}
}
@@ -103,19 +103,14 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </summary>
public static TarArchive CreateInputTarArchive(Stream inputStream)
{
return CreateInputTarArchive(inputStream, TarBuffer.DEFAULT_BLKSIZE);
return CreateInputTarArchive(inputStream, TarBuffer.DefaultBlockFactor);
}
public static TarArchive CreateInputTarArchive(Stream inputStream, int blockSize)
{
return CreateInputTarArchive(inputStream, blockSize, TarBuffer.DEFAULT_RCDSIZE);
}
public static TarArchive CreateInputTarArchive(Stream inputStream, int blockSize, int recordSize)
public static TarArchive CreateInputTarArchive(Stream inputStream, int blockFactor)
{
TarArchive archive = new TarArchive();
archive.tarIn = new TarInputStream(inputStream, blockSize, recordSize);
archive.Initialize(recordSize);
archive.tarIn = new TarInputStream(inputStream, blockFactor);
archive.Initialize(blockFactor * TarBuffer.BlockSize);
return archive;
}
@@ -126,28 +121,23 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </summary>
public static TarArchive CreateOutputTarArchive(Stream outputStream)
{
return CreateOutputTarArchive(outputStream, TarBuffer.DEFAULT_BLKSIZE);
return CreateOutputTarArchive(outputStream, TarBuffer.DefaultBlockFactor);
}
public static TarArchive CreateOutputTarArchive(Stream outputStream, int blockSize)
{
return CreateOutputTarArchive(outputStream, blockSize, TarBuffer.DEFAULT_RCDSIZE);
}
public static TarArchive CreateOutputTarArchive(Stream outputStream, int blockSize, int recordSize)
public static TarArchive CreateOutputTarArchive(Stream outputStream, int blockFactor)
{
TarArchive archive = new TarArchive();
archive.tarOut = new TarOutputStream(outputStream, blockSize, recordSize);
archive.Initialize(recordSize);
archive.tarOut = new TarOutputStream(outputStream, blockFactor);
archive.Initialize(blockFactor * TarBuffer.BlockSize);
return archive;
}
/// <summary>
/// Common constructor initialization code.
/// </summary>
void Initialize(int recordSize)
{
this.recordSize = recordSize;
this.rootPath = null;
this.pathPrefix = null;
@@ -165,11 +155,11 @@ namespace ICSharpCode.SharpZipLib.Tar {
this.recordBuf = new byte[RecordSize];
}
/**
* Set the debugging flag.
*
* @param debugF The new debug setting.
*/
///
/// <summary> Set the debugging flag. </summary>
///
/// <param name=debugF> The new debug setting. </param>
public void SetDebug(bool debugF)
{
this.debug = debugF;
@@ -206,7 +196,7 @@ namespace ICSharpCode.SharpZipLib.Tar {
}
/// <summary>
/// Set the ascii file translation flag. If ascii file translatio
/// Set the ascii file translation flag. If ascii file translation
/// is true, then the MIME file type will be consulted to determine
/// if the file is of type 'text/*'. If the MIME type is not found,
/// then the TransFileTyper is consulted if it is not null. If
@@ -214,8 +204,7 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// file, it will be translated. The translation converts the local
/// operating system's concept of line ends into the UNIX line end,
/// '\n', which is the defacto standard for a TAR archive. This makes
/// text files compatible with UNIX, and since most tar implementations
/// text files compatible with UNIX, and since most tar implementations
/// text files compatible with UNIX.
/// </summary>
/// <param name= "asciiTranslate">
/// If true, translate ascii text files.
@@ -225,7 +214,7 @@ namespace ICSharpCode.SharpZipLib.Tar {
this.asciiTranslate = asciiTranslate;
}
/*
/*
/// <summary>
/// Set the object that will determine if a file is of type
/// ascii text for translation purposes.
@@ -236,7 +225,8 @@ namespace ICSharpCode.SharpZipLib.Tar {
public void SetTransFileTyper(TarTransFileTyper transTyper)
{
this.transTyper = transTyper;
}*/
}
*/
/// <summary>
/// Set user and group information that will be used to fill in the
@@ -315,11 +305,11 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <summary>
/// Get the archive's record size. Because of its history, tar
/// supports the concept of buffered IO consisting of BLOCKS of
/// RECORDS. This allowed tar to match the IO characteristics of
/// supports the concept of buffered IO consisting of RECORDS of
/// BLOCKS. This allowed tar to match the IO characteristics of
/// the physical device being used. Of course, in the Java world,
/// this makes no sense, WITH ONE EXCEPTION - archives are expected
/// to be propertly "blocked". Thus, all of the horrible TarBuffer
/// to be properly "blocked". Thus, all of the horrible TarBuffer
/// support boils down to simply getting the "boundaries" correct.
/// </summary>
/// <returns>
@@ -329,10 +319,11 @@ namespace ICSharpCode.SharpZipLib.Tar {
get {
if (this.tarIn != null) {
return this.tarIn.GetRecordSize();
} else if (this.tarOut != null) {
}
else if (this.tarOut != null) {
return this.tarOut.GetRecordSize();
}
return TarBuffer.DEFAULT_RCDSIZE;
return TarBuffer.DefaultRecordSize;
}
}
@@ -344,7 +335,8 @@ namespace ICSharpCode.SharpZipLib.Tar {
{
if (this.tarIn != null) {
this.tarIn.Close();
} else if (this.tarOut != null) {
}
else if (this.tarOut != null) {
this.tarOut.Flush();
this.tarOut.Close();
}
@@ -364,11 +356,11 @@ namespace ICSharpCode.SharpZipLib.Tar {
if (entry == null) {
if (this.debug) {
Console.Error.WriteLine("READ EOF RECORD");
Console.Error.WriteLine("READ EOF BLOCK");
}
break;
}
OnProgressMessageEvent(entry.Name);
OnProgressMessageEvent(entry, null);
}
}
@@ -385,7 +377,7 @@ namespace ICSharpCode.SharpZipLib.Tar {
if (entry == null) {
if (this.debug) {
Console.Error.WriteLine("READ EOF RECORD");
Console.Error.WriteLine("READ EOF BLOCK");
}
break;
}
@@ -399,20 +391,22 @@ namespace ICSharpCode.SharpZipLib.Tar {
if (!Directory.Exists(directoryName)) {
try {
Directory.CreateDirectory(directoryName);
} catch (Exception e) {
}
catch (Exception e) {
throw new IOException("error making directory path '" + directoryName + "', " + e.Message);
}
}
}
// TODO -jr- No longer reads entire file into memory but is still a weak test!
bool IsBinary(string filename)
{
FileStream fs = File.OpenRead(filename);
byte[] content = new byte[fs.Length];
int sampleSize = System.Math.Min(4096, (int)fs.Length);
byte[] content = new byte[sampleSize];
fs.Read(content, 0, (int)fs.Length);
fs.Read(content, 0, sampleSize);
fs.Close();
// assume that ascii 0 or
@@ -440,7 +434,7 @@ namespace ICSharpCode.SharpZipLib.Tar {
void ExtractEntry(string destDir, TarEntry entry)
{
if (this.verbose) {
OnProgressMessageEvent(entry.Name);
OnProgressMessageEvent(entry, null);
}
string name = entry.Name;
@@ -454,15 +448,17 @@ namespace ICSharpCode.SharpZipLib.Tar {
if (entry.IsDirectory) {
EnsureDirectoryExists(destFile);
} else {
}
else {
string parentDirectory = Path.GetDirectoryName(destFile);
EnsureDirectoryExists(parentDirectory);
if (this.keepOldFiles && File.Exists(destFile)) {
if (this.verbose) {
OnProgressMessageEvent("not overwriting " + entry.Name);
OnProgressMessageEvent(entry, "Destination file already exists");
}
} else {
}
else {
bool asciiTrans = false;
Stream outputStream = File.Create(destFile);
if (this.asciiTranslate) {
@@ -512,14 +508,16 @@ namespace ICSharpCode.SharpZipLib.Tar {
off = b + 1;
}
}
} else {
}
else {
outputStream.Write(rdbuf, 0, numRead);
}
}
if (asciiTrans) {
outw.Close();
} else {
}
else {
outputStream.Close();
}
}
@@ -551,7 +549,8 @@ namespace ICSharpCode.SharpZipLib.Tar {
//
if (eFile == null || eFile.Length == 0) {
entry = TarEntry.CreateTarEntry(entry.Name);
} else {
}
else {
//
// The user may have explicitly set the entry's name to
// something other than the file's path, so we must save
@@ -564,11 +563,12 @@ namespace ICSharpCode.SharpZipLib.Tar {
}
if (this.verbose) {
OnProgressMessageEvent(entry.Name);
OnProgressMessageEvent(entry, null);
}
if (this.asciiTranslate && !entry.IsDirectory) {
asciiTrans = !IsBinary(eFile);
// original java source :
// MimeType mime = null;
// string contentType = null;
@@ -616,6 +616,7 @@ namespace ICSharpCode.SharpZipLib.Tar {
}
inStream.Close();
outStream.Flush();
outStream.Close();
@@ -650,7 +651,8 @@ namespace ICSharpCode.SharpZipLib.Tar {
this.WriteEntry(list[i], recurse);
}
}
} else {
}
else {
Stream inputStream = File.OpenRead(eFile);
int numWritten = 0;
byte[] eBuf = new byte[32 * 1024];
@@ -664,7 +666,8 @@ namespace ICSharpCode.SharpZipLib.Tar {
this.tarOut.Write(eBuf, 0, numRead);
numWritten += numRead;
}
Console.WriteLine("written " + numWritten + " bytes");
// Console.WriteLine("written " + numWritten + " bytes");
inputStream.Close();
@@ -36,14 +36,15 @@ using System;
using System.IO;
using System.Text;
namespace ICSharpCode.SharpZipLib.Tar {
namespace ICSharpCode.SharpZipLib.Tar
{
/// <summary>
/// The TarBuffer class implements the tar archive concept
/// of a buffered input stream. This concept goes back to the
/// days of blocked tape drives and special io devices. In the
/// C# universe, the only real function that this class
/// performs is to ensure that files have the correct "block"
/// performs is to ensure that files have the correct "record"
/// size, or other tars will complain.
/// <p>
/// You should never have a need to access this class directly.
@@ -52,20 +53,68 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </summary>
public class TarBuffer
{
public static readonly int DEFAULT_RCDSIZE = 512;
public static readonly int DEFAULT_BLKSIZE = DEFAULT_RCDSIZE * 20;
/* A quote from GNU tar man file on blocking and records
A `tar' archive file contains a series of blocks. Each block
contains `BLOCKSIZE' bytes. Although this format may be thought of as
being on magnetic tape, other media are often used.
Each file archived is represented by a header block which describes
the file, followed by zero or more blocks which give the contents of
the file. At the end of the archive file there may be a block filled
with binary zeros as an end-of-file marker. A reasonable system should
write a block of zeros at the end, but must not assume that such a
block exists when reading an archive.
The blocks may be "blocked" for physical I/O operations. Each
record of N blocks (where N is set by the `--blocking-factor=512-SIZE'
(`-b 512-SIZE') option to `tar') is written with a single `write ()'
operation. On magnetic tapes, the result of such a write is a single
record. When writing an archive, the last record of blocks should be
written at the full size, with blocks after the zero block containing
all zeros. When reading an archive, a reasonable system should
properly handle an archive whose last record is shorter than the rest,
or which contains garbage records after a zero block.
*/
// public static readonly int DEFAULT_RCDSIZE = 512;
// public const int DEFAULT_BLOCKFACTOR = 20;
// public static readonly int DEFAULT_BLKSIZE = DEFAULT_RCDSIZE * DEFAULT_BLOCKFACTOR;
public static readonly int BlockSize = 512;
public static readonly int DefaultBlockFactor = 20;
public static readonly int DefaultRecordSize = BlockSize * DefaultBlockFactor;
Stream inputStream;
Stream outputStream;
byte[] blockBuffer;
int currBlkIdx;
int currRecIdx;
int blockSize;
int recordSize;
int recsPerBlock;
byte[] recordBuffer;
int currentBlockIndex;
int currentRecordIndex;
int recordSize = DefaultRecordSize;
public int RecordSize
{
get { return recordSize; }
}
int blockFactor = DefaultBlockFactor;
public int BlockFactor
{
get { return blockFactor; }
}
bool debug = false;
/// <summary>
/// Set the debugging flag for the buffer.
/// </summary>
public void SetDebug(bool debug)
{
this.debug = debug;
}
bool debug;
protected TarBuffer()
{
@@ -73,36 +122,30 @@ namespace ICSharpCode.SharpZipLib.Tar {
public static TarBuffer CreateInputTarBuffer(Stream inputStream)
{
return CreateInputTarBuffer(inputStream, TarBuffer.DEFAULT_BLKSIZE);
return CreateInputTarBuffer(inputStream, TarBuffer.DefaultBlockFactor);
}
public static TarBuffer CreateInputTarBuffer(Stream inputStream, int blockSize )
{
return CreateInputTarBuffer(inputStream, blockSize, TarBuffer.DEFAULT_RCDSIZE);
}
public static TarBuffer CreateInputTarBuffer(Stream inputStream, int blockSize, int recordSize)
public static TarBuffer CreateInputTarBuffer(Stream inputStream, int blockFactor)
{
TarBuffer tarBuffer = new TarBuffer();
tarBuffer.inputStream = inputStream;
tarBuffer.outputStream = null;
tarBuffer.Initialize(blockSize, recordSize);
tarBuffer.Initialize(blockFactor);
return tarBuffer;
}
public static TarBuffer CreateOutputTarBuffer(Stream outputStream)
{
return CreateOutputTarBuffer(outputStream, TarBuffer.DEFAULT_BLKSIZE);
return CreateOutputTarBuffer(outputStream, TarBuffer.DefaultBlockFactor);
}
public static TarBuffer CreateOutputTarBuffer(Stream outputStream, int blockSize )
{
return CreateOutputTarBuffer(outputStream, blockSize, TarBuffer.DEFAULT_RCDSIZE);
}
public static TarBuffer CreateOutputTarBuffer(Stream outputStream, int blockSize, int recordSize)
public static TarBuffer CreateOutputTarBuffer(Stream outputStream, int blockFactor)
{
TarBuffer tarBuffer = new TarBuffer();
tarBuffer.inputStream = null;
tarBuffer.outputStream = outputStream;
tarBuffer.Initialize(blockSize, recordSize);
tarBuffer.Initialize(blockFactor);
return tarBuffer;
}
@@ -110,29 +153,32 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <summary>
/// Initialization common to all constructors.
/// </summary>
void Initialize(int blockSize, int recordSize)
void Initialize(int blockFactor)
{
this.debug = false;
this.blockSize = blockSize;
this.recordSize = recordSize;
this.recsPerBlock = this.blockSize / this.recordSize;
this.blockBuffer = new byte[this.blockSize];
this.blockFactor = blockFactor;
this.recordSize = blockFactor * BlockSize;
this.recordBuffer = new byte[RecordSize];
if (inputStream != null) {
this.currBlkIdx = -1;
this.currRecIdx = this.recsPerBlock;
} else {
this.currBlkIdx = 0;
this.currRecIdx = 0;
if (inputStream != null)
{
this.currentRecordIndex = -1;
this.currentBlockIndex = BlockFactor;
}
else
{
this.currentRecordIndex = 0;
this.currentBlockIndex = 0;
}
}
/// <summary>
/// Get the TAR Buffer's block size. Blocks consist of multiple records.
/// Get the TAR Buffer's block factor
/// </summary>
public int GetBlockSize()
public int GetBlockFactor()
{
return this.blockSize;
return this.blockFactor;
}
/// <summary>
@@ -144,24 +190,21 @@ namespace ICSharpCode.SharpZipLib.Tar {
}
/// <summary>
/// Set the debugging flag for the buffer.
/// Determine if an archive block indicates End of Archive. End of
/// archive is indicated by a block that consists entirely of null bytes.
/// All remaining blocks for the record should also be null's
/// However some older tars only do a couple of null blocks (Old GNU tar for one)
/// and also partial records
/// </summary>
public void SetDebug(bool debug)
{
this.debug = debug;
}
/// <summary>
/// Determine if an archive record indicate End of Archive. End of
/// archive is indicated by a record that consists entirely of null bytes.
/// </summary>
/// <param name = "record">
/// The record data to check.
/// <param name = "block">
/// The block data to check.
/// </param>
public bool IsEOFRecord(byte[] record)
public bool IsEOFBlock(byte[] block)
{
for (int i = 0, sz = this.GetRecordSize(); i < sz; ++i) {
if (record[i] != 0) {
for (int i = 0, sz = BlockSize; i < sz; ++i)
{
if (block[i] != 0)
{
return false;
}
}
@@ -170,156 +213,175 @@ namespace ICSharpCode.SharpZipLib.Tar {
}
/// <summary>
/// Skip over a record on the input stream.
/// Skip over a block on the input stream.
/// </summary>
public void SkipRecord()
public void SkipBlock()
{
if (this.debug) {
Console.Error.WriteLine("SkipRecord: recIdx = " + this.currRecIdx + " blkIdx = " + this.currBlkIdx);
if (this.debug)
{
//Console.WriteLine.WriteLine("SkipBlock: recIdx = " + this.currentRecordIndex + " blkIdx = " + this.currentBlockIndex);
}
if (this.inputStream == null) {
if (this.inputStream == null)
{
throw new System.IO.IOException("no input stream defined");
}
if (this.currRecIdx >= this.recsPerBlock) {
if (!this.ReadBlock()) {
if (this.currentBlockIndex >= this.BlockFactor)
{
if (!this.ReadRecord())
{
return; // UNDONE
}
}
this.currRecIdx++;
this.currentBlockIndex++;
}
/// <summary>
/// Read a record from the input stream and return the data.
/// Read a block from the input stream and return the data.
/// </summary>
/// <returns>
/// The record data.
/// The block data.
/// </returns>
public byte[] ReadRecord()
public byte[] ReadBlock()
{
if (this.debug) {
Console.Error.WriteLine( "ReadRecord: recIdx = " + this.currRecIdx + " blkIdx = " + this.currBlkIdx );
if (this.debug)
{
//Console.WriteLine.WriteLine( "ReadBlock: blockIndex = " + this.currentBlockIndex + " recordIndex = " + this.currentRecordIndex );
}
if (this.inputStream == null) {
throw new System.IO.IOException("no input stream defined");
if (this.inputStream == null)
{
throw new ApplicationException("TarBuffer.ReadBlock - no input stream defined");
}
if (this.currRecIdx >= this.recsPerBlock) {
if (!this.ReadBlock()) {
if (this.currentBlockIndex >= this.BlockFactor)
{
if (!this.ReadRecord())
{
return null;
}
}
byte[] result = new byte[this.recordSize];
byte[] result = new byte[BlockSize];
Array.Copy(this.blockBuffer, (this.currRecIdx * this.recordSize), result, 0, this.recordSize );
this.currRecIdx++;
Array.Copy(this.recordBuffer, (this.currentBlockIndex * BlockSize), result, 0, BlockSize );
this.currentBlockIndex++;
return result;
}
/// <returns>
/// false if End-Of-File, else true
/// </returns>
bool ReadBlock()
bool ReadRecord()
{
Console.WriteLine(this.debug);
if (this.debug) {
Console.Error.WriteLine("ReadBlock: blkIdx = " + this.currBlkIdx);
if (this.debug)
{
//Console.WriteLine.WriteLine("ReadRecord: recordIndex = " + this.currentRecordIndex);
}
if (this.inputStream == null) {
if (this.inputStream == null)
{
throw new System.IO.IOException("no input stream stream defined");
}
this.currRecIdx = 0;
this.currentBlockIndex = 0;
int offset = 0;
int bytesNeeded = this.blockSize;
for (; bytesNeeded > 0 ;) {
long numBytes = this.inputStream.Read(this.blockBuffer, offset, bytesNeeded);
int bytesNeeded = RecordSize;
while (bytesNeeded > 0)
{
long numBytes = this.inputStream.Read(this.recordBuffer, offset, bytesNeeded);
//
// NOTE
// We have fit EOF, and the block is not full!
// We have found EOF, and the record is not full!
//
// This is a broken archive. It does not follow the standard
// blocking algorithm. However, because we are generous, and
// it requires little effort, we will simply ignore the error
// and continue as if the entire block were read. This does
// and continue as if the entire record were read. This does
// not appear to break anything upstream. We used to return
// false in this case.
//
// Thanks to '[email protected]' for this fix.
//
if (numBytes <= 0) {
if (numBytes <= 0)
{
break;
}
offset += (int)numBytes;
bytesNeeded -= (int)numBytes;
if (numBytes != this.blockSize) {
if (this.debug) {
Console.Error.WriteLine("ReadBlock: INCOMPLETE READ " + numBytes + " of " + this.blockSize + " bytes read.");
if (numBytes != RecordSize)
{
if (this.debug)
{
//Console.WriteLine.WriteLine("ReadRecord: INCOMPLETE READ " + numBytes + " of " + this.blockSize + " bytes read.");
}
}
}
this.currBlkIdx++;
this.currentRecordIndex++;
return true;
}
/// <summary>
/// Get the current block number, zero based.
/// Get the current block number, within the current record, zero based.
/// </summary>
/// <returns>
/// The current zero based block number.
/// </returns>
public int GetCurrentBlockNum()
{
return this.currBlkIdx;
return this.currentBlockIndex;
}
/// <summary>
/// Get the current record number, within the current block, zero based.
/// Thus, current offset = (currentBlockNum * recsPerBlk) + currentRecNum.
/// Get the current record number
/// Absolute block number in file = (currentRecordNum * block factor) + currentBlockNum.
/// </summary>
/// <returns>
/// The current zero based record number.
/// </returns>
public int GetCurrentRecordNum()
{
return this.currRecIdx - 1;
return this.currentRecordIndex;
}
/// <summary>
/// Write an archive record to the archive.
/// Write an archive block to the archive.
/// </summary>
/// <param name="record">
/// The record data to write to the archive.
/// <param name="block">
/// The data to write to the archive.
/// </param>
///
public void WriteRecord(byte[] record)
public void WriteBlock(byte[] block)
{
if (this.debug) {
Console.Error.WriteLine("WriteRecord: recIdx = " + this.currRecIdx + " blkIdx = " + this.currBlkIdx );
if (this.debug)
{
//Console.WriteLine.WriteLine("WriteRecord: recIdx = " + this.currentRecordIndex + " blkIdx = " + this.currentBlockIndex );
}
if (this.outputStream == null) {
throw new System.IO.IOException("no output stream defined");
if (this.outputStream == null)
{
throw new ApplicationException("TarBuffer.WriteBlock - no output stream defined");
}
if (record.Length != this.recordSize) {
throw new IOException("record to write has length '" + record.Length + "' which is not the record size of '" + this.recordSize + "'" );
if (block.Length != BlockSize)
{
throw new ApplicationException("TarBuffer.WriteBlock - block to write has length '" + block.Length + "' which is not the block size of '" + BlockSize + "'" );
}
if (this.currRecIdx >= this.recsPerBlock) {
this.WriteBlock();
if (this.currentBlockIndex >= BlockFactor)
{
this.WriteRecord();
}
Array.Copy(record, 0, this.blockBuffer, (this.currRecIdx * this.recordSize), this.recordSize );
this.currRecIdx++;
Array.Copy(block, 0, this.recordBuffer, (this.currentBlockIndex * BlockSize), BlockSize);
this.currentBlockIndex++;
}
/// <summary>
@@ -333,47 +395,53 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <param name="offset">
/// The offset of the record data within buf.
/// </param>
public void WriteRecord(byte[] buf, int offset)
public void WriteBlock(byte[] buf, int offset)
{
if (this.debug) {
Console.Error.WriteLine("WriteRecord: recIdx = " + this.currRecIdx + " blkIdx = " + this.currBlkIdx );
if (this.debug)
{
//Console.WriteLine.WriteLine("WriteBlock: recIdx = " + this.currentRecordIndex + " blkIdx = " + this.currentBlockIndex );
}
if (this.outputStream == null) {
throw new System.IO.IOException("no output stream stream defined");
if (this.outputStream == null)
{
throw new ApplicationException("TarBuffer.WriteBlock - no output stream stream defined");
}
if ((offset + this.recordSize) > buf.Length) {
throw new IOException("record has length '" + buf.Length + "' with offset '" + offset + "' which is less than the record size of '" + this.recordSize + "'" );
if ((offset + BlockSize) > buf.Length)
{
throw new ApplicationException("TarBuffer.WriteBlock - record has length '" + buf.Length + "' with offset '" + offset + "' which is less than the record size of '" + this.recordSize + "'" );
}
if (this.currRecIdx >= this.recsPerBlock) {
this.WriteBlock();
if (this.currentBlockIndex >= this.BlockFactor)
{
this.WriteRecord();
}
Array.Copy(buf, offset, this.blockBuffer, (this.currRecIdx * this.recordSize), this.recordSize );
Array.Copy(buf, offset, this.recordBuffer, (this.currentBlockIndex * BlockSize), BlockSize);
this.currRecIdx++;
this.currentBlockIndex++;
}
/// <summary>
/// Write a TarBuffer block to the archive.
/// Write a TarBuffer record to the archive.
/// </summary>
void WriteBlock()
void WriteRecord()
{
if (this.debug) {
Console.Error.WriteLine("WriteBlock: blkIdx = " + this.currBlkIdx);
if (this.debug)
{
//Console.WriteLine.WriteLine("Writerecord: record index = " + this.currentRecordIndex);
}
if (this.outputStream == null) {
throw new System.IO.IOException("no output stream defined");
if (this.outputStream == null)
{
throw new ApplicationException("TarBuffer.WriteRecord no output stream defined");
}
this.outputStream.Write(this.blockBuffer, 0, this.blockSize);
this.outputStream.Write(this.recordBuffer, 0, RecordSize);
this.outputStream.Flush();
this.currRecIdx = 0;
this.currBlkIdx++;
this.currentBlockIndex = 0;
this.currentRecordIndex++;
}
/// <summary>
@@ -381,16 +449,19 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </summary>
void Flush()
{
if (this.debug) {
Console.Error.WriteLine("TarBuffer.FlushBlock() called.");
if (this.debug)
{
//Console.WriteLine.WriteLine("TarBuffer.FlushBlock() called.");
}
if (this.outputStream == null) {
throw new System.IO.IOException("no output base stream defined");
if (this.outputStream == null)
{
throw new ApplicationException("TarBuffer.Flush no output stream defined");
}
if (this.currRecIdx > 0) {
this.WriteBlock();
if (this.currentBlockIndex > 0)
{
this.WriteRecord();
}
outputStream.Flush();
}
@@ -401,25 +472,27 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </summary>
public void Close()
{
if (this.debug) {
Console.Error.WriteLine("TarBuffer.Close().");
if (this.debug)
{
//Console.WriteLine.WriteLine("TarBuffer.Close().");
}
if (outputStream != null ) {
if (outputStream != null)
{
Flush();
// if ( this.outStream != System.out
// && this.outStream != System.err ) {
outputStream.Close();
outputStream = null;
} else if (inputStream != null) {
// if (this.inStream != System.in ) {
}
else if (inputStream != null)
{
inputStream.Close();
inputStream = null;
}
}
}
}
/* The original Java file had this header:
*
** Authored by Timothy Gerard Endres
@@ -36,7 +36,8 @@ using System;
using System.IO;
using System.Text;
namespace ICSharpCode.SharpZipLib.Tar {
namespace ICSharpCode.SharpZipLib.Tar
{
/// <summary>
/// This class represents an entry in a Tar archive. It consists
@@ -64,27 +65,6 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// other information. In this case the header fields are set to
/// defaults and the File is set to null.</p>
///
/// <p>
/// The C structure for a Tar Entry's header is:
/// <pre>
/// struct header {
/// char name[NAMSIZ];
/// char mode[8];
/// char uid[8];
/// char gid[8];
/// char size[12];
/// char mtime[12];
/// char chksum[8];
/// char linkflag;
/// char linkname[NAMSIZ];
/// char magic[8];
/// char uname[TUNMLEN];
/// char gname[TGNMLEN];
/// char devmajor[8];
/// char devminor[8];
/// } header;
/// </pre>
/// </p>
/// <see cref="TarHeader"/>
/// </summary>
public class TarEntry
@@ -92,12 +72,12 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <summary>
/// If this entry represents a File, this references it.
/// </summary>
protected string file;
string file;
/// <summary>
/// This is the entry's header information.
/// </summary>
protected TarHeader header;
TarHeader header;
/// <summary>
/// Only Create Entries with the static CreateXYZ methods or a headerBuffer.
@@ -116,10 +96,15 @@ namespace ICSharpCode.SharpZipLib.Tar {
public TarEntry(byte[] headerBuf)
{
this.Initialize();
this.ParseTarHeader(this.header, headerBuf);
this.header.ParseBuffer(headerBuf);
}
public TarEntry(TarHeader header)
{
file = null;
this.header = header;
}
/// <summary>
/// Construct an entry with only a name. This allows the programmer
@@ -149,7 +134,7 @@ namespace ICSharpCode.SharpZipLib.Tar {
}
/// <summary>
/// Initialization code common to all constructors.
/// Initialization code common to all pseudo constructors.
/// </summary>
void Initialize()
{
@@ -166,7 +151,8 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </returns>
public override bool Equals(object it)
{
if (!(it is TarEntry)) {
if (!(it is TarEntry))
{
return false;
}
return this.header.name.ToString().Equals(((TarEntry)it).header.name.ToString());
@@ -203,8 +189,10 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <returns>
/// This entry's TarHeader.
/// </returns>
public TarHeader TarHeader {
get {
public TarHeader TarHeader
{
get
{
return this.header;
}
}
@@ -212,11 +200,14 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <summary>
/// Get/Set this entry's name.
/// </summary>
public string Name {
get {
public string Name
{
get
{
return this.header.name.ToString();
}
set {
set
{
this.header.name = new StringBuilder(value);
}
}
@@ -224,11 +215,14 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <summary>
/// Get/set this entry's user id.
/// </summary>
public int UserId {
get {
public int UserId
{
get
{
return this.header.userId;
}
set {
set
{
this.header.userId = value;
}
}
@@ -236,11 +230,14 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <summary>
/// Get/set this entry's group id.
/// </summary>
public int GroupId {
get {
public int GroupId
{
get
{
return this.header.groupId;
}
set {
set
{
this.header.groupId = value;
}
}
@@ -248,11 +245,14 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <summary>
/// Get/set this entry's user name.
/// </summary>
public string UserName {
get {
public string UserName
{
get
{
return this.header.userName.ToString();
}
set {
set
{
this.header.userName = new StringBuilder(value);
}
}
@@ -260,11 +260,14 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <summary>
/// Get/set this entry's group name.
/// </summary>
public string GroupName {
get {
public string GroupName
{
get
{
return this.header.groupName.ToString();
}
set {
set
{
this.header.groupName = new StringBuilder(value);
}
}
@@ -299,17 +302,17 @@ namespace ICSharpCode.SharpZipLib.Tar {
GroupName = groupName;
}
// TODO :
// /**
// * Set this entry's modification time. The parameter passed
// * to this method is in "Java time".
// *
// * @param time This entry's new modification time.
// */
// public void setModTime( long time )
// {
// this.header.modTime = time / 1000;
// }
// TODO :
// /**
// * Set this entry's modification time. The parameter passed
// * to this method is in "Java time".
// *
// * @param time This entry's new modification time.
// */
// public void setModTime( long time )
// {
// this.header.modTime = time / 1000;
// }
/// Convert time to DateTimes
/**
@@ -317,11 +320,14 @@ namespace ICSharpCode.SharpZipLib.Tar {
*
* @param time This entry's new modification time.
*/
public DateTime ModTime {
get {
public DateTime ModTime
{
get
{
return this.header.modTime;
}
set {
set
{
this.header.modTime = value;
}
}
@@ -332,8 +338,10 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <returns>
/// This entry's file.
/// </returns>
public string File {
get {
public string File
{
get
{
return this.file;
}
}
@@ -341,11 +349,14 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <summary>
/// Get/set this entry's file size.
/// </summary>
public long Size {
get {
public long Size
{
get
{
return this.header.size;
}
set {
set
{
this.header.size = value;
}
}
@@ -374,13 +385,17 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </returns>
public bool IsDirectory
{
get {
if (this.file != null) {
get
{
if (this.file != null)
{
return Directory.Exists(file);
}
if (this.header != null) {
if (this.header.linkFlag == TarHeader.LF_DIR || this.header.name.ToString().EndsWith( "/" )) {
if (this.header != null)
{
if (this.header.typeFlag == TarHeader.LF_DIR || this.header.name.ToString().EndsWith( "/" ))
{
return true;
}
}
@@ -400,50 +415,61 @@ namespace ICSharpCode.SharpZipLib.Tar {
public void GetFileTarHeader(TarHeader hdr, string file)
{
this.file = file;
string name = Path.GetDirectoryName(file);
if (Path.DirectorySeparatorChar == '\\') { // check if the OS is a windows
// bugfix from torhovl from #D forum:
string name = file;
// -jr- 23-Jan-2004 HAK HAK HAK, GnuTar allows device names in path where the name is not local to the current directory
if (Environment.CurrentDirectory == Path.GetDirectoryName(name))
{
name = Path.GetFileName(name);
}
/*
if (Path.DirectorySeparatorChar == '\\')
{ // check if the OS is Windows
// Strip off drive letters!
if (name.Length > 2) {
if (name.Length > 2)
{
char ch1 = name[0];
char ch2 = name[1];
if (ch2 == ':' && Char.IsLetter(ch1)) {
if (ch2 == ':' && Char.IsLetter(ch1))
{
name = name.Substring(2);
}
}
}
*/
name = name.Replace(Path.DirectorySeparatorChar, '/');
name = name.Replace(Path.DirectorySeparatorChar, '/').ToLower();
// No absolute pathnames
// Windows (and Posix?) paths can start with "\\NetworkDrive\",
// Windows (and Posix?) paths can start with UNC style "\\NetworkDrive\",
// so we loop on starting /'s.
while (name.StartsWith("/")) {
name = name.Substring(1);
}
hdr.linkName = new StringBuilder(String.Empty);
hdr.name = new StringBuilder(name);
if (Directory.Exists(file)) {
hdr.mode = 040755; // TODO : what does this magic number ?? Mike
hdr.linkFlag = TarHeader.LF_DIR;
if (hdr.name[hdr.name.Length - 1] != '/') {
hdr.mode = 1003; // 01753 -jr- no octal constants!! 040755; // Magic number for security access for a UNIX filesystem
hdr.typeFlag = TarHeader.LF_DIR;
if (hdr.name.Length == 0 || hdr.name[hdr.name.Length - 1] != '/') {
hdr.name.Append("/");
}
hdr.size = 0;
} else {
hdr.mode = 0100644; // TODO : again a magic number
hdr.linkFlag = TarHeader.LF_NORMAL;
Console.WriteLine(file.Replace('/', Path.DirectorySeparatorChar));
hdr.mode = 33216; // 0100700 -jr- // 0100644; // Magic number for security access for a UNIX filesystem
hdr.typeFlag = TarHeader.LF_NORMAL;
hdr.size = new FileInfo(file.Replace('/', Path.DirectorySeparatorChar)).Length;
}
// UNDONE When File lets us get the userName, use it!
hdr.modTime = System.IO.File.GetLastAccessTime(file.Replace('/', Path.DirectorySeparatorChar));
hdr.checkSum = 0;
hdr.modTime = System.IO.File.GetLastWriteTimeUtc(file.Replace('/', Path.DirectorySeparatorChar)); // -jr- Unix times are in UTC
hdr.checkSum = 0;
hdr.devMajor = 0;
hdr.devMinor = 0;
}
@@ -457,44 +483,23 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </returns>
public TarEntry[] GetDirectoryEntries()
{
if (this.file == null || !Directory.Exists(this.file)) {
if (this.file == null || !Directory.Exists(this.file))
{
return new TarEntry[0];
}
string[] list = Directory.GetFileSystemEntries(this.file);
TarEntry[] result = new TarEntry[list.Length];
string dirName = file;
if (!dirName.EndsWith(Path.DirectorySeparatorChar.ToString())) {
dirName += Path.DirectorySeparatorChar;
}
for (int i = 0; i < list.Length; ++i) {
for (int i = 0; i < list.Length; ++i)
{
result[i] = TarEntry.CreateEntryFromFile(list[i]);
}
return result;
}
/// <summary>
/// Compute the checksum of a tar entry header.
/// </summary>
/// <param name = "buf">
/// The tar entry's header buffer.
/// </param>
/// <returns>
/// The computed checksum.
/// </returns>
public long ComputeCheckSum(byte[] buf)
{
long sum = 0;
for (int i = 0; i < buf.Length; ++i) {
sum += 255 & buf[i]; // TODO : I think the 255 & x isn't neccessary += buf[i] should be enough. CHECK IT!
}
return sum;
}
/// <summary>
/// <summary>
/// Write an entry's header information to a header buffer.
/// </summary>
/// <param name = "outbuf">
@@ -502,120 +507,7 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </param>
public void WriteEntryHeader(byte[] outbuf)
{
int offset = 0;
offset = TarHeader.GetNameBytes(this.header.name, outbuf, offset, TarHeader.NAMELEN);
offset = TarHeader.GetOctalBytes(this.header.mode, outbuf, offset, TarHeader.MODELEN);
offset = TarHeader.GetOctalBytes(this.header.userId, outbuf, offset, TarHeader.UIDLEN);
offset = TarHeader.GetOctalBytes(this.header.groupId, outbuf, offset, TarHeader.GIDLEN);
long size = this.header.size;
offset = TarHeader.GetLongOctalBytes(size, outbuf, offset, TarHeader.SIZELEN);
offset = TarHeader.GetLongOctalBytes(GetCTime(this.header.modTime), outbuf, offset, TarHeader.MODTIMELEN);
int csOffset = offset;
for (int c = 0; c < TarHeader.CHKSUMLEN; ++c) {
outbuf[offset++] = (byte)' ';
}
outbuf[offset++] = this.header.linkFlag;
offset = TarHeader.GetNameBytes(this.header.linkName, outbuf, offset, TarHeader.NAMELEN);
offset = TarHeader.GetNameBytes(this.header.magic, outbuf, offset, TarHeader.MAGICLEN);
offset = TarHeader.GetNameBytes(this.header.userName, outbuf, offset, TarHeader.UNAMELEN);
offset = TarHeader.GetNameBytes(this.header.groupName, outbuf, offset, TarHeader.GNAMELEN);
offset = TarHeader.GetOctalBytes(this.header.devMajor, outbuf, offset, TarHeader.DEVLEN);
offset = TarHeader.GetOctalBytes(this.header.devMinor, outbuf, offset, TarHeader.DEVLEN);
for (; offset < outbuf.Length;) {
outbuf[offset++] = 0;
}
long checkSum = this.ComputeCheckSum(outbuf);
TarHeader.GetCheckSumOctalBytes(checkSum, outbuf, csOffset, TarHeader.CHKSUMLEN);
}
// time conversion functions
readonly static long timeConversionFactor = 10000000L;
readonly static DateTime datetTime1970 = new DateTime(1970, 1, 1, 0, 0, 0, 0);
static int GetCTime(System.DateTime dateTime)
{
return (int)((dateTime.Ticks - datetTime1970.Ticks) / timeConversionFactor);
}
static DateTime GetDateTimeFromCTime(long ticks)
{
return new DateTime(datetTime1970.Ticks + ticks * timeConversionFactor);
}
/// <summary>
/// Parse an entry's TarHeader information from a header buffer.
/// </summary>
/// <param name ="hdr">
/// Parse an entry's TarHeader information from a header buffer.
/// </param>
/// <param name = "header">
/// The tar entry header buffer to get information from.
/// </param>
public void ParseTarHeader(TarHeader hdr, byte[] header)
{
int offset = 0;
hdr.name = TarHeader.ParseName(header, offset, TarHeader.NAMELEN);
offset += TarHeader.NAMELEN;
hdr.mode = (int)TarHeader.ParseOctal(header, offset, TarHeader.MODELEN);
offset += TarHeader.MODELEN;
hdr.userId = (int)TarHeader.ParseOctal(header, offset, TarHeader.UIDLEN);
offset += TarHeader.UIDLEN;
hdr.groupId = (int)TarHeader.ParseOctal(header, offset, TarHeader.GIDLEN);
offset += TarHeader.GIDLEN;
hdr.size = TarHeader.ParseOctal(header, offset, TarHeader.SIZELEN);
offset += TarHeader.SIZELEN;
hdr.modTime = GetDateTimeFromCTime(TarHeader.ParseOctal(header, offset, TarHeader.MODTIMELEN));
offset += TarHeader.MODTIMELEN;
hdr.checkSum = (int)TarHeader.ParseOctal(header, offset, TarHeader.CHKSUMLEN);
offset += TarHeader.CHKSUMLEN;
hdr.linkFlag = header[ offset++ ];
hdr.linkName = TarHeader.ParseName(header, offset, TarHeader.NAMELEN);
offset += TarHeader.NAMELEN;
hdr.magic = TarHeader.ParseName(header, offset, TarHeader.MAGICLEN);
offset += TarHeader.MAGICLEN;
hdr.userName = TarHeader.ParseName(header, offset, TarHeader.UNAMELEN);
offset += TarHeader.UNAMELEN;
hdr.groupName = TarHeader.ParseName(header, offset, TarHeader.GNAMELEN);
offset += TarHeader.GNAMELEN;
hdr.devMajor = (int)TarHeader.ParseOctal(header, offset, TarHeader.DEVLEN);
offset += TarHeader.DEVLEN;
hdr.devMinor = (int)TarHeader.ParseOctal(header, offset, TarHeader.DEVLEN);
this.header.WriteHeader(outbuf);
}
/// <summary>
@@ -629,22 +521,22 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </param>
public void NameTarHeader(TarHeader hdr, string name)
{
bool isDir = name.EndsWith("/");
bool isDir = name.EndsWith("/"); // -jr- this is true for BSD tar but not all others I think?
hdr.checkSum = 0;
hdr.devMajor = 0;
hdr.devMinor = 0;
hdr.name = new StringBuilder(name);
hdr.mode = isDir ? 040755 : 0100644; // TODO : I think I've seen these magics before ...
hdr.userId = 0;
// hdr.mode = isDir ? 040755 : 0100644; // TODO : I think I've seen these magics before ...
hdr.mode = isDir ? 1003 : 33216;
hdr.userId = 0;
hdr.groupId = 0;
hdr.size = 0;
hdr.checkSum = 0;
hdr.modTime = DateTime.Now;//(new java.util.Date()).getTime() / 1000;
hdr.modTime = DateTime.UtcNow; // -jr- 24-Jan-2004 Unix times are in utc!
// hdr.modTime = DateTime.Now; // (new java.util.Date()).getTime() / 1000;
hdr.linkFlag = isDir ? TarHeader.LF_DIR : TarHeader.LF_NORMAL;
hdr.typeFlag = isDir ? TarHeader.LF_DIR : TarHeader.LF_NORMAL;
hdr.linkName = new StringBuilder(String.Empty);
hdr.userName = new StringBuilder(String.Empty);
@@ -655,6 +547,9 @@ namespace ICSharpCode.SharpZipLib.Tar {
}
}
}
/* The original Java file had this header:
*
** Authored by Timothy Gerard Endres
@@ -1,4 +1,5 @@
// TarHeader.cs
//
// Copyright (C) 2001 Mike Krueger
//
// This program is free software; you can redistribute it and/or
@@ -32,10 +33,41 @@
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
/* The tar format and its POSIX successor PAX have a long history which makes for compatability
issues when creating and reading files...
This is the ustar (Posix 1003.1) header.
struct header
{
char t_name[100]; // 0 Filename
char t_mode[8]; // 100 Permissions
char t_uid[8]; // 108 Numerical User ID
char t_gid[8]; // 116 Numerical Group ID
char t_size[12]; // 124 Filesize
char t_mtime[12]; // 136 st_mtime
char t_chksum[8]; // 148 Checksum
char t_typeflag; // 156 Type of File
char t_linkname[100]; // 157 Target of Links
char t_magic[6]; // 257 "ustar"
char t_version[2]; // 263 Version fixed to 00
char t_uname[32]; // 265 User Name
char t_gname[32]; // 297 Group Name
char t_devmajor[8]; // 329 Major for devices
char t_devminor[8]; // 337 Minor for devices
char t_prefix[155]; // 345 Prefix for t_name
// 500 End
char t_mfill[12]; // 500 Filler up to 512
};
*/
using System;
using System.Text;
namespace ICSharpCode.SharpZipLib.Tar {
namespace ICSharpCode.SharpZipLib.Tar
{
/// <summary>
@@ -77,8 +109,13 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <summary>
/// The length of the magic field in a header buffer.
/// </summary>
public readonly static int MAGICLEN = 8;
public readonly static int MAGICLEN = 6;
/// <summary>
/// The length of the version field in a header buffer.
/// </summary>
public readonly static int VERSIONLEN = 2;
/// <summary>
/// The length of the modification time field in a header buffer.
/// </summary>
@@ -100,58 +137,109 @@ namespace ICSharpCode.SharpZipLib.Tar {
public readonly static int DEVLEN = 8;
/// <summary>
/// LF_ constants represent the "link flag" of an entry, or more commonly,
/// the "entry type". This is the "old way" of indicating a normal file.
/// LF_ constants represents the "type" of an entry
/// </summary>
public readonly static byte LF_OLDNORM = 0;
///
/// <summary>
/// This is the "old way" of indicating a normal file.
/// </summary>
public const byte LF_OLDNORM = 0;
/// <summary>
/// Normal file type.
/// </summary>
public readonly static byte LF_NORMAL = (byte) '0';
public const byte LF_NORMAL = (byte) '0';
/// <summary>
/// Link file type.
/// </summary>
public readonly static byte LF_LINK = (byte) '1';
public const byte LF_LINK = (byte) '1';
/// <summary>
/// Symbolic link file type.
/// </summary>
public readonly static byte LF_SYMLINK = (byte) '2';
public const byte LF_SYMLINK = (byte) '2';
/// <summary>
/// Character device file type.
/// </summary>
public readonly static byte LF_CHR = (byte) '3';
public const byte LF_CHR = (byte) '3';
/// <summary>
/// Block device file type.
/// </summary>
public readonly static byte LF_BLK = (byte) '4';
public const byte LF_BLK = (byte) '4';
/// <summary>
/// Directory file type.
/// </summary>
public readonly static byte LF_DIR = (byte) '5';
public const byte LF_DIR = (byte) '5';
/// <summary>
/// FIFO (pipe) file type.
/// </summary>
public readonly static byte LF_FIFO = (byte) '6';
public const byte LF_FIFO = (byte) '6';
/// <summary>
/// Contiguous file type.
/// </summary>
public readonly static byte LF_CONTIG = (byte) '7';
public const byte LF_CONTIG = (byte) '7';
/// <summary>
/// The magic tag representing a POSIX tar archive.
/// Posix.1 2001 global extended header
/// </summary>
public readonly static string TMAGIC = "ustar";
///
public const byte LF_GHDR = (byte) 'g';
/// <summary>
/// The magic tag representing a GNU tar archive.
/// Posix.1 2001 extended header
/// </summary>
public readonly static byte LF_XHDR = (byte) 'x';
// POSIX allows for upper case ascii type as extensions
// Solaris access control list
public const byte LF_ACL = (byte) 'A';
// This is a dir entry that contains the names of files that were in the
// dir at the time the dump was made
public const byte LF_GNU_DUMPDIR = (byte) 'D';
// Solaris Extended Attribute File
public const byte LF_EXTATTR = (byte) 'E' ;
// Inode (metadata only) no file content
public const byte LF_META = (byte) 'I';
// Identifies the next file on the tape as having a long link name
public const byte LF_GNU_LONGLINK = (byte) 'K';
// Identifies the next file on the tape as having a long name
public const byte LF_GNU_LONGNAME = (byte) 'L';
// Continuation of a file that began on another volume
public const byte LF_GNU_MULTIVOL = (byte) 'M';
// For storing filenames that dont fit in the main header (old GNU)
public const byte LF_GNU_NAMES = (byte) 'N';
// Sparse file
public const byte LF_GNU_SPARSE = (byte) 'S';
// Tape/volume header ignore on extraction
public const byte LF_GNU_VOLHDR = (byte) 'V';
/// <summary>
/// The magic tag representing a POSIX tar archive. (includes trailing NULL)
/// </summary>
public readonly static string TMAGIC = "ustar ";
/// <summary>
/// The magic tag representing an old GNU tar archive where version is included in magic and overwrites it
/// </summary>
public readonly static string GNU_TMAGIC = "ustar ";
@@ -191,9 +279,9 @@ namespace ICSharpCode.SharpZipLib.Tar {
public int checkSum;
/// <summary>
/// The entry's link flag.
/// The entry's type flag.
/// </summary>
public byte linkFlag;
public byte typeFlag;
/// <summary>
/// The entry's link name.
@@ -205,6 +293,11 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </summary>
public StringBuilder magic;
/// <summary>
/// The entry's version.
/// </summary>
public StringBuilder version;
/// <summary>
/// The entry's user name.
/// </summary>
@@ -228,20 +321,27 @@ namespace ICSharpCode.SharpZipLib.Tar {
public TarHeader()
{
this.magic = new StringBuilder(TarHeader.TMAGIC);
this.version = new StringBuilder(" ");
this.name = new StringBuilder();
this.linkName = new StringBuilder();
string user = Environment.UserName;
// string user = "PocketPC";
// string user = "Everyone";
if (user.Length > 31) {
user = user.Substring(0, 31);
}
this.userId = 0;
this.groupId = 0;
this.userId = 1003; // -jr- was 0
this.groupId = 513; // -jr- was 0
this.userName = new StringBuilder(user);
this.groupName = new StringBuilder(String.Empty);
// -jr-
// this.groupName = new StringBuilder(String.Empty);
// this.groupName = new StringBuilder("Everyone"); Attempt2
this.groupName = new StringBuilder("None"); // Gnu compatible
this.size = 0;
}
/// <summary>
@@ -258,9 +358,10 @@ namespace ICSharpCode.SharpZipLib.Tar {
hdr.size = this.size;
hdr.modTime = this.modTime;
hdr.checkSum = this.checkSum;
hdr.linkFlag = this.linkFlag;
hdr.typeFlag = this.typeFlag;
hdr.linkName = (this.linkName == null) ? null : new StringBuilder(this.linkName.ToString());
hdr.magic = (this.magic == null) ? null : new StringBuilder(this.magic.ToString());
hdr.version = (this.version == null) ? null : new StringBuilder(this.version.ToString());
hdr.userName = (this.userName == null) ? null : new StringBuilder(this.userName.ToString());
hdr.groupName = (this.groupName == null) ? null : new StringBuilder(this.groupName.ToString());
hdr.devMajor = this.devMajor;
@@ -302,17 +403,22 @@ namespace ICSharpCode.SharpZipLib.Tar {
bool stillPadding = true;
int end = offset + length;
for (int i = offset; i < end ; ++i) {
if (header[i] == 0) {
for (int i = offset; i < end ; ++i)
{
if (header[i] == 0)
{
break;
}
if (header[i] == (byte)' ' || header[i] == '0') {
if (stillPadding) {
if (header[i] == (byte)' ' || header[i] == '0')
{
if (stillPadding)
{
continue;
}
if (header[i] == (byte)' ') {
if (header[i] == (byte)' ')
{
break;
}
}
@@ -344,8 +450,10 @@ namespace ICSharpCode.SharpZipLib.Tar {
{
StringBuilder result = new StringBuilder(length);
for (int i = offset; i < offset + length; ++i) {
if (header[i] == 0) {
for (int i = offset; i < offset + length; ++i)
{
if (header[i] == 0)
{
break;
}
result.Append((char)header[i]);
@@ -354,7 +462,24 @@ namespace ICSharpCode.SharpZipLib.Tar {
return result;
}
/// <summary>
public static int GetNameBytes(StringBuilder name, int nameOffset, byte[] buf, int bufferOffset, int length)
{
int i;
for (i = 0 ; i < length && nameOffset + i < name.Length; ++i)
{
buf[bufferOffset + i] = (byte)name[nameOffset + i];
}
for (; i < length ; ++i)
{
buf[bufferOffset + i] = 0;
}
return bufferOffset + length;
}
/// <summary>
/// Determine the number of bytes in an entry name.
/// </summary>
/// <param name="name">
@@ -373,17 +498,7 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </returns>
public static int GetNameBytes(StringBuilder name, byte[] buf, int offset, int length)
{
int i;
for (i = 0 ; i < length && i < name.Length; ++i) {
buf[offset + i] = (byte)name[i];
}
for (; i < length ; ++i) {
buf[offset + i] = 0;
}
return offset + length;
return GetNameBytes(name, 0, buf, offset, length);
}
/// <summary>
@@ -405,27 +520,26 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </returns>
public static int GetOctalBytes(long val, byte[] buf, int offset, int length)
{
byte[] result = new byte[length];
// TODO check for values too large...
int idx = length - 1;
// Either a space or null is valid here. We use NULL as per GNUTar
buf[offset + idx] = 0;
--idx;
buf[offset + idx] = (byte)' ';
--idx;
if (val == 0) {
buf[offset + idx] = (byte)'0';
--idx;
} else {
for (long v = val; idx >= 0 && v > 0; --idx) {
if (val > 0)
{
for (long v = val; idx >= 0 && v > 0; --idx)
{
buf[offset + idx] = (byte)((byte)'0' + (byte)(v & 7));
v >>= 3;
}
}
for (; idx >= 0; --idx) {
buf[offset + idx] = (byte)' ';
for (; idx >= 0; --idx)
{
buf[offset + idx] = (byte)'0';
}
return offset + length;
@@ -450,37 +564,176 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </returns>
public static int GetLongOctalBytes(long val, byte[] buf, int offset, int length)
{
byte[] temp = new byte[length + 1];
TarHeader.GetOctalBytes(val, temp, 0, length + 1);
Array.Copy(temp, 0, buf, offset, length);
return offset + length;
return GetOctalBytes(val, buf, offset, length);
}
/// <summary>
/// Parse the checksum octal integer from a header buffer.
/// Add the checksum octal integer to header buffer.
/// </summary>
/// <param name = "val">
/// </param>
/// <param name = "buf">
/// The header buffer from which to parse.
/// The header buffer to set the checksum for
/// </param>
/// <param name = "offset">
/// The offset into the buffer from which to parse.
/// The offset into the buffer for the checksum
/// </param>
/// <param name = "length">
/// The number of header bytes to parse.
/// The number of header bytes to update.
/// It's formatted differently from the other fields: it has 6 digits, a
/// null, then a space -- rather than digits, a space, then a null.
/// The final space is already there, from checksumming
/// </param>
/// <returns>
/// The integer value of the entry's checksum.
/// The modified buffer offset
/// </returns>
public static int GetCheckSumOctalBytes(long val, byte[] buf, int offset, int length)
private static int GetCheckSumOctalBytes(long val, byte[] buf, int offset, int length)
{
TarHeader.GetOctalBytes(val, buf, offset, length);
buf[offset + length - 1] = (byte)' ';
buf[offset + length - 2] = 0;
TarHeader.GetOctalBytes(val, buf, offset, length - 1);
// buf[offset + length - 1] = (byte)' '; -jr- 23-Jan-2004 this causes failure!!!
// buf[offset + length - 2] = 0;
return offset + length;
}
}
/// <summary>
/// Compute the checksum for a tar entry header.
/// The checksum field must be all spaces prior to this happening
/// </summary>
/// <param name = "buf">
/// The tar entry's header buffer.
/// </param>
/// <returns>
/// The computed checksum.
/// </returns>
private static long ComputeCheckSum(byte[] buf)
{
long sum = 0;
for (int i = 0; i < buf.Length; ++i)
{
sum += buf[i];
}
return sum;
}
readonly static long timeConversionFactor = 10000000L; // -jr- 1 tick == 100 nanoseconds
readonly static DateTime datetTime1970 = new DateTime(1970, 1, 1, 0, 0, 0, 0);
// readonly static DateTime datetTime1970 = new DateTime(1970, 1, 1, 0, 0, 0, 0).ToUniversalTime(); // -jr- Should be UTC? doesnt match Gnutar if this is so though, why?
static int GetCTime(System.DateTime dateTime)
{
return (int)((dateTime.Ticks - datetTime1970.Ticks) / timeConversionFactor);
}
static DateTime GetDateTimeFromCTime(long ticks)
{
return new DateTime(datetTime1970.Ticks + ticks * timeConversionFactor);
}
/// <summary>
/// Parse TarHeader information from a header buffer.
/// </summary>
/// <param name = "header">
/// The tar entry header buffer to get information from.
/// </param>
public void ParseBuffer(byte[] header)
{
int offset = 0;
name = TarHeader.ParseName(header, offset, TarHeader.NAMELEN);
offset += TarHeader.NAMELEN;
mode = (int)TarHeader.ParseOctal(header, offset, TarHeader.MODELEN);
offset += TarHeader.MODELEN;
userId = (int)TarHeader.ParseOctal(header, offset, TarHeader.UIDLEN);
offset += TarHeader.UIDLEN;
groupId = (int)TarHeader.ParseOctal(header, offset, TarHeader.GIDLEN);
offset += TarHeader.GIDLEN;
size = TarHeader.ParseOctal(header, offset, TarHeader.SIZELEN);
offset += TarHeader.SIZELEN;
modTime = GetDateTimeFromCTime(TarHeader.ParseOctal(header, offset, TarHeader.MODTIMELEN));
offset += TarHeader.MODTIMELEN;
checkSum = (int)TarHeader.ParseOctal(header, offset, TarHeader.CHKSUMLEN);
offset += TarHeader.CHKSUMLEN;
typeFlag = header[ offset++ ];
linkName = TarHeader.ParseName(header, offset, TarHeader.NAMELEN);
offset += TarHeader.NAMELEN;
magic = TarHeader.ParseName(header, offset, TarHeader.MAGICLEN);
offset += TarHeader.MAGICLEN;
version = TarHeader.ParseName(header, offset, TarHeader.VERSIONLEN);
offset += TarHeader.VERSIONLEN;
userName = TarHeader.ParseName(header, offset, TarHeader.UNAMELEN);
offset += TarHeader.UNAMELEN;
groupName = TarHeader.ParseName(header, offset, TarHeader.GNAMELEN);
offset += TarHeader.GNAMELEN;
devMajor = (int)TarHeader.ParseOctal(header, offset, TarHeader.DEVLEN);
offset += TarHeader.DEVLEN;
devMinor = (int)TarHeader.ParseOctal(header, offset, TarHeader.DEVLEN);
// Fields past this point not currently parsed or used...
}
/// <summary>
/// 'Write' header information to buffer provided
/// </summary>
/// <param name="outbuf">output buffer for header information</param>
public void WriteHeader(byte[] outbuf)
{
int offset = 0;
offset = GetNameBytes(this.name, outbuf, offset, TarHeader.NAMELEN);
offset = GetOctalBytes(this.mode, outbuf, offset, TarHeader.MODELEN);
offset = GetOctalBytes(this.userId, outbuf, offset, TarHeader.UIDLEN);
offset = GetOctalBytes(this.groupId, outbuf, offset, TarHeader.GIDLEN);
long size = this.size;
offset = GetLongOctalBytes(size, outbuf, offset, TarHeader.SIZELEN);
offset = GetLongOctalBytes(GetCTime(this.modTime), outbuf, offset, TarHeader.MODTIMELEN);
int csOffset = offset;
for (int c = 0; c < TarHeader.CHKSUMLEN; ++c)
{
outbuf[offset++] = (byte)' ';
}
outbuf[offset++] = this.typeFlag;
offset = GetNameBytes(this.linkName, outbuf, offset, NAMELEN);
offset = GetNameBytes(this.magic, outbuf, offset, MAGICLEN);
offset = GetNameBytes(this.version, outbuf, offset, VERSIONLEN);
offset = GetNameBytes(this.userName, outbuf, offset, UNAMELEN);
offset = GetNameBytes(this.groupName, outbuf, offset, GNAMELEN);
if (this.typeFlag == LF_CHR || this.typeFlag == LF_BLK)
{
offset = GetOctalBytes(this.devMajor, outbuf, offset, DEVLEN);
offset = GetOctalBytes(this.devMinor, outbuf, offset, DEVLEN);
}
for ( ; offset < outbuf.Length; )
{
outbuf[offset++] = 0;
}
long checkSum = ComputeCheckSum(outbuf);
GetCheckSumOctalBytes(checkSum, outbuf, csOffset, CHKSUMLEN);
}
}
}
/* The original Java file had this header:
@@ -36,7 +36,8 @@ using System;
using System.IO;
using System.Text;
namespace ICSharpCode.SharpZipLib.Tar {
namespace ICSharpCode.SharpZipLib.Tar
{
/// <summary>
/// The TarInputStream reads a UNIX tar archive as an InputStream.
@@ -59,11 +60,14 @@ namespace ICSharpCode.SharpZipLib.Tar {
protected IEntryFactory eFactory;
Stream inputStream;
/// <summary>
/// I needed to implement the abstract member.
/// </summary>
public override bool CanRead {
get {
public override bool CanRead
{
get
{
return inputStream.CanRead;
}
}
@@ -71,8 +75,11 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <summary>
/// I needed to implement the abstract member.
/// </summary>
public override bool CanSeek {
get {
public override bool CanSeek
{
// TODO is this valid? should it return false?
get
{
return inputStream.CanSeek;
}
}
@@ -80,8 +87,10 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <summary>
/// I needed to implement the abstract member.
/// </summary>
public override bool CanWrite {
get {
public override bool CanWrite
{
get
{
return inputStream.CanWrite;
}
}
@@ -89,8 +98,10 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <summary>
/// I needed to implement the abstract member.
/// </summary>
public override long Length {
get {
public override long Length
{
get
{
return inputStream.Length;
}
}
@@ -98,11 +109,14 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <summary>
/// I needed to implement the abstract member.
/// </summary>
public override long Position {
get {
public override long Position
{
get
{
return inputStream.Position;
}
set {
set
{
inputStream.Position = value;
}
}
@@ -120,6 +134,7 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </summary>
public override long Seek(long offset, SeekOrigin origin)
{
// TODO allow this?
return inputStream.Seek(offset, origin);
}
@@ -148,30 +163,27 @@ namespace ICSharpCode.SharpZipLib.Tar {
}
public TarInputStream(Stream inputStream) : this(inputStream, TarBuffer.DEFAULT_BLKSIZE, TarBuffer.DEFAULT_RCDSIZE)
public TarInputStream(Stream inputStream) : this(inputStream, TarBuffer.DefaultBlockFactor)
{
}
public TarInputStream(Stream inputStream, int blockSize) : this(inputStream, blockSize, TarBuffer.DEFAULT_RCDSIZE)
{
}
public TarInputStream(Stream inputStream, int blockSize, int recordSize)
public TarInputStream(Stream inputStream, int blockFactor)
{
this.inputStream = inputStream;
this.buffer = TarBuffer.CreateInputTarBuffer(inputStream, blockSize, recordSize);
this.buffer = TarBuffer.CreateInputTarBuffer(inputStream, blockFactor);
this.readBuf = null;
this.readBuf = null;
this.debug = false;
this.hasHitEOF = false;
this.eFactory = null;
}
public void SetDebug(bool debugF)
public void SetDebug(bool debugFlag)
{
this.debug = debugF;
SetBufferDebug(debugF);
this.debug = debugFlag;
SetBufferDebug(debugFlag);
}
public void SetBufferDebug(bool debug)
{
this.buffer.SetDebug(debug);
@@ -214,8 +226,10 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <returns>
/// The number of available bytes for the current entry.
/// </returns>
public int Available {
get {
public int Available
{
get
{
return this.entrySize - this.entryOffset;
}
}
@@ -231,16 +245,18 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </param>
public void Skip(int numToSkip)
{
// REVIEW
// TODO REVIEW
// This is horribly inefficient, but it ensures that we
// properly skip over bytes via the TarBuffer...
//
byte[] skipBuf = new byte[8 * 1024];
for (int num = numToSkip; num > 0;){
for (int num = numToSkip; num > 0;)
{
int numRead = this.Read(skipBuf, 0, (num > skipBuf.Length ? skipBuf.Length : num));
if (numRead == -1) {
if (numRead == -1)
{
break;
}
@@ -251,8 +267,10 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <summary>
/// Since we do not support marking just yet, we return false.
/// </summary>
public bool IsMarkSupported {
get {
public bool IsMarkSupported
{
get
{
return false;
}
}
@@ -273,7 +291,24 @@ namespace ICSharpCode.SharpZipLib.Tar {
public void Reset()
{
}
void SkipToNextEntry()
{
int numToSkip = this.entrySize - this.entryOffset;
if (this.debug)
{
//Console.WriteLine.WriteLine("TarInputStream: SKIP currENTRY '" + this.currEntry.Name + "' SZ " + this.entrySize + " OFF " + this.entryOffset + " skipping " + numToSkip + " bytes");
}
if (numToSkip > 0)
{
this.Skip(numToSkip);
}
this.readBuf = null;
}
/// <summary>
/// Get the next entry in this tar archive. This will skip
/// over any remaining data in the current entry, if there
@@ -289,68 +324,144 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </returns>
public TarEntry GetNextEntry()
{
if (this.hasHitEOF) {
if (this.hasHitEOF)
{
return null;
}
if (this.currEntry != null) {
int numToSkip = this.entrySize - this.entryOffset;
if (this.debug) {
Console.Error.WriteLine("TarInputStream: SKIP currENTRY '" + this.currEntry.Name + "' SZ " + this.entrySize + " OFF " + this.entryOffset + " skipping " + numToSkip + " bytes");
}
if (numToSkip > 0) {
this.Skip(numToSkip);
}
this.readBuf = null;
if (this.currEntry != null)
{
SkipToNextEntry();
}
byte[] headerBuf = this.buffer.ReadRecord();
byte[] headerBuf = this.buffer.ReadBlock();
if (headerBuf == null) {
if (this.debug) {
Console.Error.WriteLine("READ NULL RECORD");
if (headerBuf == null)
{
if (this.debug)
{
//Console.WriteLine.WriteLine("READ NULL BLOCK");
}
this.hasHitEOF = true;
} else if (this.buffer.IsEOFRecord(headerBuf)) {
if (this.debug) {
Console.Error.WriteLine( "READ EOF RECORD" );
}
else if (this.buffer.IsEOFBlock(headerBuf))
{
if (this.debug)
{
//Console.WriteLine.WriteLine( "READ EOF BLOCK" );
}
this.hasHitEOF = true;
}
if (this.hasHitEOF) {
if (this.hasHitEOF)
{
this.currEntry = null;
} else {
try {
if (this.eFactory == null) {
this.currEntry = new TarEntry(headerBuf);
} else {
this.currEntry = this.eFactory.CreateEntry(headerBuf);
}
else
{
try
{
TarHeader header = new TarHeader();
header.ParseBuffer(headerBuf);
this.entryOffset = 0;
this.entrySize = (int)header.size;
StringBuilder longName = null;
if (header.typeFlag == TarHeader.LF_GNU_LONGNAME)
{
Console.WriteLine("TarInputStream: Long name found '" + header.name + "' size = " + header.size); // DEBUG
byte[] nameBuffer = new byte[TarBuffer.BlockSize];
int numToRead = this.entrySize;
longName = new StringBuilder();
while (numToRead > 0)
{
int numRead = this.Read(nameBuffer, 0, (numToRead > nameBuffer.Length ? nameBuffer.Length : numToRead));
if (numRead == -1)
{
throw new InvalidHeaderException("Failed to read long name entry");
}
longName.Append(TarHeader.ParseName(nameBuffer, 0, numRead).ToString());
numToRead -= numRead;
}
Console.WriteLine("TarInputStream: Long name is '" + longName.ToString()); // DEBUG
SkipToNextEntry();
headerBuf = this.buffer.ReadBlock();
}
else if (header.typeFlag == TarHeader.LF_GHDR) // POSIX global extended header
{
// Ignore things we dont understand completely for now
SkipToNextEntry();
headerBuf = this.buffer.ReadBlock();
}
else if (header.typeFlag == TarHeader.LF_XHDR) // POSIX extended header
{
// Ignore things we dont understand completely for now
SkipToNextEntry();
headerBuf = this.buffer.ReadBlock();
}
else if (header.typeFlag == TarHeader.LF_GNU_VOLHDR)
{
// TODO could show volume name when verbose?
SkipToNextEntry();
headerBuf = this.buffer.ReadBlock();
}
else if (header.typeFlag != TarHeader.LF_NORMAL
&& header.typeFlag != TarHeader.LF_OLDNORM)
{
// Ignore things we dont understand completely for now
SkipToNextEntry();
headerBuf = this.buffer.ReadBlock();
}
if (this.eFactory == null)
{
this.currEntry = new TarEntry(headerBuf);
if (longName != null)
{
this.currEntry.TarHeader.name.Length = 0;
this.currEntry.TarHeader.name.Append(longName.ToString());
}
}
else
{
this.currEntry = this.eFactory.CreateEntry(headerBuf);
}
if (!(headerBuf[257] == 'u' && headerBuf[258] == 's' && headerBuf[259] == 't' && headerBuf[260] == 'a' && headerBuf[261] == 'r')) {
// TODO -jr- ustar is not the only magic possible by any means
// tar, xtar, ...
if (!(headerBuf[257] == 'u' && headerBuf[258] == 's' && headerBuf[259] == 't' && headerBuf[260] == 'a' && headerBuf[261] == 'r'))
{
throw new InvalidHeaderException("header magic is not 'ustar', but '" + headerBuf[257] + headerBuf[258] + headerBuf[259] + headerBuf[260] + headerBuf[261] +
"', or (dec) " + ((int)headerBuf[257]) + ", " + ((int)headerBuf[258]) + ", " + ((int)headerBuf[259]) + ", " + ((int)headerBuf[260]) + ", " + ((int)headerBuf[261]));
"', or (dec) " + ((int)headerBuf[257]) + ", " + ((int)headerBuf[258]) + ", " + ((int)headerBuf[259]) + ", " + ((int)headerBuf[260]) + ", " + ((int)headerBuf[261]));
}
if (this.debug) {
Console.Error.WriteLine("TarInputStream: SET CURRENTRY '" + this.currEntry.Name + "' size = " + this.currEntry.Size);
if (this.debug)
{
//Console.WriteLine.WriteLine("TarInputStream: SET CURRENTRY '" + this.currEntry.Name + "' size = " + this.currEntry.Size);
}
this.entryOffset = 0;
// REVIEW How do we resolve this discrepancy?!
// TODO REVIEW How do we resolve this discrepancy?!
this.entrySize = (int) this.currEntry.Size;
} catch (InvalidHeaderException ex) {
}
catch (InvalidHeaderException ex)
{
this.entrySize = 0;
this.entryOffset = 0;
this.currEntry = null;
throw new InvalidHeaderException("bad header in block " + this.buffer.GetCurrentBlockNum() + " record " + this.buffer.GetCurrentRecordNum() + ", " + ex.Message);
throw new InvalidHeaderException("bad header in record " + this.buffer.GetCurrentBlockNum() + " block " + this.buffer.GetCurrentBlockNum() + ", " + ex.Message);
}
}
return this.currEntry;
@@ -364,7 +475,8 @@ namespace ICSharpCode.SharpZipLib.Tar {
{
byte[] oneByteBuffer = new byte[1];
int num = this.Read(oneByteBuffer, 0, 1);
if (num <= 0) { // return -1 to indicate that no byte was read.
if (num <= 0) // return -1 to indicate that no byte was read.
{
return -1;
}
return (int)oneByteBuffer[0];
@@ -374,10 +486,9 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// Reads bytes from the current tar archive entry.
///
/// This method is aware of the boundaries of the current
/// entry in the archive and will deal with them as if they
/// entry in the archive and will deal with them as if they
/// entry in the archive and will deal with them appropriately
/// </summary>
/// <param name="buf">
/// <param name="outputBuffer">
/// The buffer into which to place bytes read.
/// </param>
/// <param name="offset">
@@ -387,30 +498,36 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// The number of bytes to read.
/// </param>
/// <returns>
/// The number of bytes read, or -1 at EOF.
/// The number of bytes read, or 0 at end of stream/EOF.
/// </returns>
public override int Read(byte[] buf, int offset, int numToRead)
public override int Read(byte[] outputBuffer, int offset, int numToRead)
{
int totalRead = 0;
if (this.entryOffset >= this.entrySize) {
return -1;
if (this.entryOffset >= this.entrySize)
{
return 0;
}
if ((numToRead + this.entryOffset) > this.entrySize) {
if ((numToRead + this.entryOffset) > this.entrySize)
{
numToRead = this.entrySize - this.entryOffset;
}
if (this.readBuf != null) {
if (this.readBuf != null)
{
int sz = (numToRead > this.readBuf.Length) ? this.readBuf.Length : numToRead;
Array.Copy(this.readBuf, 0, buf, offset, sz);
Array.Copy(this.readBuf, 0, outputBuffer, offset, sz);
if (sz >= this.readBuf.Length) {
if (sz >= this.readBuf.Length)
{
this.readBuf = null;
} else {
}
else
{
int newLen = this.readBuf.Length - sz;
byte[] newBuf = new byte[ newLen ];
byte[] newBuf = new byte[newLen];
Array.Copy(this.readBuf, sz, newBuf, 0, newLen);
this.readBuf = newBuf;
}
@@ -420,9 +537,11 @@ namespace ICSharpCode.SharpZipLib.Tar {
offset += sz;
}
while (numToRead > 0) {
byte[] rec = this.buffer.ReadRecord();
if (rec == null) {
while (numToRead > 0)
{
byte[] rec = this.buffer.ReadBlock();
if (rec == null)
{
// Unexpected EOF!
throw new IOException("unexpected EOF with " + numToRead + " bytes unread");
}
@@ -430,13 +549,16 @@ namespace ICSharpCode.SharpZipLib.Tar {
int sz = numToRead;
int recLen = rec.Length;
if (recLen > sz) {
Array.Copy(rec, 0, buf, offset, sz);
if (recLen > sz)
{
Array.Copy(rec, 0, outputBuffer, offset, sz);
this.readBuf = new byte[recLen - sz];
Array.Copy(rec, sz, this.readBuf, 0, recLen - sz);
} else {
}
else
{
sz = recLen;
Array.Copy(rec, 0, buf, offset, recLen);
Array.Copy(rec, 0, outputBuffer, offset, recLen);
}
totalRead += sz;
@@ -460,9 +582,11 @@ namespace ICSharpCode.SharpZipLib.Tar {
{
byte[] buf = new byte[32 * 1024];
while (true) {
while (true)
{
int numRead = this.Read(buf, 0, buf.Length);
if (numRead <= 0) {
if (numRead <= 0)
{
break;
}
outputStream.Write(buf, 0, numRead);
@@ -36,7 +36,8 @@ using System;
using System.IO;
using System.Text;
namespace ICSharpCode.SharpZipLib.Tar {
namespace ICSharpCode.SharpZipLib.Tar
{
/// <summary>
/// The TarOutputStream writes a UNIX tar archive as an OutputStream.
@@ -49,7 +50,7 @@ namespace ICSharpCode.SharpZipLib.Tar {
protected bool debug;
protected int currSize;
protected int currBytes;
protected byte[] recordBuf;
protected byte[] blockBuf;
protected int assemLen;
protected byte[] assemBuf;
@@ -59,8 +60,10 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <summary>
/// I needed to implement the abstract member.
/// </summary>
public override bool CanRead {
get {
public override bool CanRead
{
get
{
return outputStream.CanRead;
}
}
@@ -68,17 +71,21 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <summary>
/// I needed to implement the abstract member.
/// </summary>
public override bool CanSeek {
get {
return outputStream.CanSeek;
public override bool CanSeek
{
get
{
return outputStream.CanSeek; // -jr- Should be false?
}
}
/// <summary>
/// I needed to implement the abstract member.
/// </summary>
public override bool CanWrite {
get {
public override bool CanWrite
{
get
{
return outputStream.CanWrite;
}
}
@@ -86,8 +93,10 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <summary>
/// I needed to implement the abstract member.
/// </summary>
public override long Length {
get {
public override long Length
{
get
{
return outputStream.Length;
}
}
@@ -95,11 +104,14 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <summary>
/// I needed to implement the abstract member.
/// </summary>
public override long Position {
get {
public override long Position
{
get
{
return outputStream.Position;
}
set {
set
{
outputStream.Position = value;
}
}
@@ -141,35 +153,31 @@ namespace ICSharpCode.SharpZipLib.Tar {
outputStream.Flush();
}
public TarOutputStream(Stream outputStream) : this(outputStream, TarBuffer.DEFAULT_BLKSIZE, TarBuffer.DEFAULT_RCDSIZE)
public TarOutputStream(Stream outputStream) : this(outputStream, TarBuffer.DefaultBlockFactor)
{
}
public TarOutputStream(Stream outputStream, int blockSize) : this(outputStream, blockSize, TarBuffer.DEFAULT_RCDSIZE)
{
}
public TarOutputStream(Stream outputStream, int blockSize, int recordSize)
public TarOutputStream(Stream outputStream, int blockFactor)
{
this.outputStream = outputStream;
this.buffer = TarBuffer.CreateOutputTarBuffer(outputStream, blockSize, recordSize);
this.buffer = TarBuffer.CreateOutputTarBuffer(outputStream, blockFactor);
this.debug = false;
this.assemLen = 0;
this.assemBuf = new byte[recordSize];
this.recordBuf = new byte[recordSize];
this.assemBuf = new byte[TarBuffer.BlockSize];
this.blockBuf = new byte[TarBuffer.BlockSize];
}
/// <summary>
/// Sets the debugging flag.
/// </summary>
/// <param name = "debugF">
/// <param name = "debugFlag">
/// True to turn on debugging.
/// </param>
public void SetDebug(bool debugF)
public void SetDebug(bool debugFlag)
{
this.debug = debugF;
SetBufferDebug(debugF);
this.debug = debugFlag;
SetBufferDebug(debugFlag);
}
public void SetBufferDebug(bool debug)
@@ -210,7 +218,7 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// <summary>
/// Put an entry on the output stream. This writes the entry's
/// header record and positions the output stream for writing
/// header and positions the output stream for writing
/// the contents of the entry. Once this method is called, the
/// stream is ready for calls to write() to write the entry's
/// contents. Once the contents are written, closeEntry()
@@ -222,12 +230,36 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </param>
public void PutNextEntry(TarEntry entry)
{
if (entry.TarHeader.name.Length > TarHeader.NAMELEN) {
throw new InvalidHeaderException("file name '" + entry.TarHeader.name + "' is too long ( > " + TarHeader.NAMELEN + " bytes )");
if (entry.TarHeader.name.Length > TarHeader.NAMELEN)
{
TarHeader longHeader = new TarHeader();
longHeader.typeFlag = TarHeader.LF_GNU_LONGNAME;
longHeader.name.Append("././@LongLink");
longHeader.userId = 0;
longHeader.groupId = 0;
longHeader.groupName.Length = 0;
longHeader.userName.Length = 0;
longHeader.linkName.Length = 0;
longHeader.size = entry.TarHeader.name.Length;
Console.WriteLine("TarOutputStream: PutNext entry Long name found size = " + longHeader.size); // DEBUG
longHeader.WriteHeader(this.blockBuf);
this.buffer.WriteBlock(this.blockBuf); // Add special long filename header block
int nameCharIndex = 0;
while (nameCharIndex < entry.TarHeader.name.Length)
{
TarHeader.GetNameBytes(entry.TarHeader.name, nameCharIndex, this.blockBuf, 0, TarBuffer.BlockSize);
nameCharIndex += TarBuffer.BlockSize;
this.buffer.WriteBlock(this.blockBuf);
}
}
entry.WriteEntryHeader(this.recordBuf);
this.buffer.WriteRecord(this.recordBuf);
entry.WriteEntryHeader(this.blockBuf);
this.buffer.WriteBlock(this.blockBuf);
this.currBytes = 0;
@@ -238,25 +270,28 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// Close an entry. This method MUST be called for all file
/// entries that contain data. The reason is that we must
/// buffer data written to the stream in order to satisfy
/// the buffer's record based writes. Thus, there may be
/// the buffer's block based writes. Thus, there may be
/// data fragments still being assembled that must be written
/// to the output stream before this entry is closed and the
/// next entry written.
/// </summary>
public void CloseEntry()
{
if (this.assemLen > 0) {
for (int i = this.assemLen; i < this.assemBuf.Length; ++i) {
if (this.assemLen > 0)
{
for (int i = this.assemLen; i < this.assemBuf.Length; ++i)
{
this.assemBuf[i] = 0;
}
this.buffer.WriteRecord(this.assemBuf);
this.buffer.WriteBlock(this.assemBuf);
this.currBytes += this.assemLen;
this.assemLen = 0;
}
if (this.currBytes < this.currSize) {
if (this.currBytes < this.currSize)
{
throw new IOException("entry closed at '" + this.currBytes + "' before the '" + this.currSize + "' bytes specified in the header were written");
}
}
@@ -293,7 +328,8 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </param>
public override void Write(byte[] wBuf, int wOffset, int numToWrite)
{
if ((this.currBytes + numToWrite) > this.currSize) {
if ((this.currBytes + numToWrite) > this.currSize)
{
throw new IOException("request to write '" + numToWrite + "' bytes exceeds size in header of '" + this.currSize + "' bytes");
}
@@ -304,23 +340,27 @@ namespace ICSharpCode.SharpZipLib.Tar {
// REVIEW Maybe this should be in TarBuffer? Could that help to
// eliminate some of the buffer copying.
//
if (this.assemLen > 0) {
if ((this.assemLen + numToWrite ) >= this.recordBuf.Length) {
int aLen = this.recordBuf.Length - this.assemLen;
if (this.assemLen > 0)
{
if ((this.assemLen + numToWrite ) >= this.blockBuf.Length)
{
int aLen = this.blockBuf.Length - this.assemLen;
Array.Copy(this.assemBuf, 0, this.recordBuf, 0, this.assemLen);
Array.Copy(this.assemBuf, 0, this.blockBuf, 0, this.assemLen);
Array.Copy(wBuf, wOffset, this.recordBuf, this.assemLen, aLen);
Array.Copy(wBuf, wOffset, this.blockBuf, this.assemLen, aLen);
this.buffer.WriteRecord(this.recordBuf);
this.buffer.WriteBlock(this.blockBuf);
this.currBytes += this.recordBuf.Length;
this.currBytes += this.blockBuf.Length;
wOffset += aLen;
numToWrite -= aLen;
this.assemLen = 0;
} else {// ( (this.assemLen + numToWrite ) < this.recordBuf.length )
}
else
{// ( (this.assemLen + numToWrite ) < this.blockBuf.length )
Array.Copy(wBuf, wOffset, this.assemBuf, this.assemLen, numToWrite);
wOffset += numToWrite;
this.assemLen += numToWrite;
@@ -333,16 +373,18 @@ namespace ICSharpCode.SharpZipLib.Tar {
// o An empty "assemble" buffer.
// o No bytes to write (numToWrite == 0)
//
while (numToWrite > 0) {
if (numToWrite < this.recordBuf.Length) {
while (numToWrite > 0)
{
if (numToWrite < this.blockBuf.Length)
{
Array.Copy(wBuf, wOffset, this.assemBuf, this.assemLen, numToWrite);
this.assemLen += numToWrite;
break;
}
this.buffer.WriteRecord(wBuf, wOffset);
this.buffer.WriteBlock(wBuf, wOffset);
int num = this.recordBuf.Length;
int num = this.blockBuf.Length;
this.currBytes += num;
numToWrite -= num;
wOffset += num;
@@ -355,10 +397,11 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// </summary>
void WriteEOFRecord()
{
for (int i = 0; i < this.recordBuf.Length; ++i) {
this.recordBuf[i] = 0;
for (int i = 0; i < this.blockBuf.Length; ++i)
{
this.blockBuf[i] = 0;
}
this.buffer.WriteRecord(this.recordBuf);
this.buffer.WriteBlock(this.blockBuf);
}
}
}
@@ -37,7 +37,8 @@
using System;
namespace ICSharpCode.SharpZipLib.Zip.Compression {
namespace ICSharpCode.SharpZipLib.Zip.Compression
{
/// <summary>
/// This is the Deflater class. The deflater class compresses input
@@ -119,8 +120,8 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
private static int INIT_STATE = 0x00;
private static int SETDICT_STATE = 0x01;
// private static int INIT_FINISHING_STATE = 0x08;
// private static int SETDICT_FINISHING_STATE = 0x09;
// private static int INIT_FINISHING_STATE = 0x08;
// private static int SETDICT_FINISHING_STATE = 0x09;
private static int BUSY_STATE = 0x10;
private static int FLUSHING_STATE = 0x14;
private static int FINISHING_STATE = 0x1c;
@@ -137,10 +138,10 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
/// </summary>
private bool noHeader;
// /// <summary>
// /// Compression strategy.
// /// </summary>
// private int strategy;
// /// <summary>
// /// Compression strategy.
// /// </summary>
// private int strategy;
/// <summary>
/// The current state.
@@ -360,7 +361,6 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
throw new ArgumentOutOfRangeException("lvl");
}
if (level != lvl) {
level = lvl;
engine.SetLevel(lvl);
@@ -425,7 +425,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
if (state < BUSY_STATE) {
/* output header */
int header = (DEFLATED +
((DeflaterConstants.MAX_WBITS - 8) << 4)) << 8;
((DeflaterConstants.MAX_WBITS - 8) << 4)) << 8;
int level_flags = (level - 1) >> 1;
if (level_flags < 0 || level_flags > 3) {
level_flags = 3;
@@ -37,7 +37,8 @@
using System;
namespace ICSharpCode.SharpZipLib.Zip.Compression {
namespace ICSharpCode.SharpZipLib.Zip.Compression
{
/// <summary>
/// This class contains constants used for the deflater.
@@ -39,9 +39,11 @@ using System;
using ICSharpCode.SharpZipLib.Checksums;
namespace ICSharpCode.SharpZipLib.Zip.Compression {
namespace ICSharpCode.SharpZipLib.Zip.Compression
{
public enum DeflateStrategy {
public enum DeflateStrategy
{
// The default strategy.
Default = 0,
@@ -60,7 +62,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
static int TOO_FAR = 4096;
int ins_h;
// private byte[] buffer;
// private byte[] buffer;
short[] head;
short[] prev;
@@ -175,15 +177,15 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
max_chain = DeflaterConstants.MAX_CHAIN[lvl];
if (DeflaterConstants.COMPR_FUNC[lvl] != comprFunc) {
// if (DeflaterConstants.DEBUGGING) {
// Console.WriteLine("Change from "+comprFunc +" to "
// + DeflaterConstants.COMPR_FUNC[lvl]);
// }
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("Change from "+comprFunc +" to "
// + DeflaterConstants.COMPR_FUNC[lvl]);
// }
switch (comprFunc) {
case DEFLATE_STORED:
if (strstart > blockStart) {
huffman.FlushStoredBlock(window, blockStart,
strstart - blockStart, false);
strstart - blockStart, false);
blockStart = strstart;
}
UpdateHash();
@@ -191,7 +193,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
case DEFLATE_FAST:
if (strstart > blockStart) {
huffman.FlushBlock(window, blockStart, strstart - blockStart,
false);
false);
blockStart = strstart;
}
break;
@@ -200,8 +202,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
huffman.TallyLit(window[strstart-1] & 0xff);
}
if (strstart > blockStart) {
huffman.FlushBlock(window, blockStart, strstart - blockStart,
false);
huffman.FlushBlock(window, blockStart, strstart - blockStart, false);
blockStart = strstart;
}
prevAvailable = false;
@@ -212,29 +213,29 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
}
}
private void UpdateHash()
void UpdateHash()
{
// if (DEBUGGING) {
// Console.WriteLine("updateHash: "+strstart);
// }
// if (DEBUGGING) {
// //Console.WriteLine("updateHash: "+strstart);
// }
ins_h = (window[strstart] << HASH_SHIFT) ^ window[strstart + 1];
}
private int InsertString()
int InsertString()
{
short match;
int hash = ((ins_h << HASH_SHIFT) ^ window[strstart + (MIN_MATCH -1)]) & HASH_MASK;
// if (DEBUGGING) {
// if (hash != (((window[strstart] << (2*HASH_SHIFT)) ^
// (window[strstart + 1] << HASH_SHIFT) ^
// (window[strstart + 2])) & HASH_MASK)) {
// throw new Exception("hash inconsistent: "+hash+"/"
// +window[strstart]+","
// +window[strstart+1]+","
// +window[strstart+2]+","+HASH_SHIFT);
// }
// }
// if (DEBUGGING) {
// if (hash != (((window[strstart] << (2*HASH_SHIFT)) ^
// (window[strstart + 1] << HASH_SHIFT) ^
// (window[strstart + 2])) & HASH_MASK)) {
// throw new Exception("hash inconsistent: "+hash+"/"
// +window[strstart]+","
// +window[strstart+1]+","
// +window[strstart+2]+","+HASH_SHIFT);
// }
// }
prev[strstart & WMASK] = match = head[hash];
head[hash] = (short)strstart;
@@ -296,7 +297,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
}
}
private bool FindLongestMatch(int curMatch)
bool FindLongestMatch(int curMatch)
{
int chainLength = this.max_chain;
int niceLength = this.niceLength;
@@ -325,7 +326,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
}
if (DeflaterConstants.DEBUGGING && strstart > 2 * WSIZE - MIN_LOOKAHEAD) {
throw new InvalidOperationException("need lookahead");
throw new InvalidOperationException("need lookahead");
}
do {
@@ -333,10 +334,10 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
throw new InvalidOperationException("future match");
}
if (window[curMatch + best_len] != scan_end ||
window[curMatch + best_len - 1] != scan_end1 ||
window[curMatch] != window[scan] ||
window[curMatch + 1] != window[scan + 1]) {
continue;
window[curMatch + best_len - 1] != scan_end1 ||
window[curMatch] != window[scan] ||
window[curMatch + 1] != window[scan + 1]) {
continue;
}
match = curMatch + 2;
@@ -345,14 +346,14 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
/* We check for insufficient lookahead only every 8th comparison;
* the 256th check will be made at strstart+258.
*/
while (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 < strend) ;
while (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 < strend) ;
if (scan > best_end) {
// if (DeflaterConstants.DEBUGGING && ins_h == 0)
@@ -360,6 +361,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
matchStart = curMatch;
best_end = scan;
best_len = scan - strstart;
if (best_len >= niceLength) {
break;
}
@@ -400,7 +402,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
blockStart = strstart;
}
private bool DeflateStored(bool flush, bool finish)
bool DeflateStored(bool flush, bool finish)
{
if (!flush && lookahead == 0) {
return false;
@@ -420,9 +422,9 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
lastBlock = false;
}
// if (DeflaterConstants.DEBUGGING) {
// Console.WriteLine("storedBlock["+storedLen+","+lastBlock+"]");
// }
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("storedBlock["+storedLen+","+lastBlock+"]");
// }
huffman.FlushStoredBlock(window, blockStart, storedLen, lastBlock);
blockStart += storedLen;
@@ -445,8 +447,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
return false;
}
if (strstart > 2 * WSIZE - MIN_LOOKAHEAD)
{
if (strstart > 2 * WSIZE - MIN_LOOKAHEAD) {
/* slide window, as findLongestMatch need this.
* This should only happen when flushing and the window
* is almost full.
@@ -456,20 +457,25 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
int hashHead;
if (lookahead >= MIN_MATCH &&
(hashHead = InsertString()) != 0 &&
strategy != DeflateStrategy.HuffmanOnly &&
strstart - hashHead <= MAX_DIST &&
FindLongestMatch(hashHead)) {
(hashHead = InsertString()) != 0 &&
strategy != DeflateStrategy.HuffmanOnly &&
strstart - hashHead <= MAX_DIST &&
FindLongestMatch(hashHead)) {
/* longestMatch sets matchStart and matchLen */
// if (DeflaterConstants.DEBUGGING) {
// for (int i = 0 ; i < matchLen; i++) {
// if (window[strstart+i] != window[matchStart + i]) {
// throw new Exception();
// }
// }
// }
// if (DeflaterConstants.DEBUGGING) {
// for (int i = 0 ; i < matchLen; i++) {
// if (window[strstart+i] != window[matchStart + i]) {
// throw new Exception();
// }
// }
// }
huffman.TallyDist(strstart - matchStart, matchLen);
// -jr- Hak hak hak this stops problems with fast/low compression and index out of range
if (huffman.TallyDist(strstart - matchStart, matchLen)) {
bool lastBlock = finish && lookahead == 0;
huffman.FlushBlock(window, blockStart, strstart - blockStart, lastBlock);
blockStart = strstart;
}
lookahead -= matchLen;
if (matchLen <= max_lazy && lookahead >= MIN_MATCH) {
@@ -495,8 +501,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
if (huffman.IsFull()) {
bool lastBlock = finish && lookahead == 0;
huffman.FlushBlock(window, blockStart, strstart - blockStart,
lastBlock);
huffman.FlushBlock(window, blockStart, strstart - blockStart, lastBlock);
blockStart = strstart;
return !lastBlock;
}
@@ -504,7 +509,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
return true;
}
private bool DeflateSlow(bool flush, bool finish)
bool DeflateSlow(bool flush, bool finish)
{
if (lookahead < MIN_LOOKAHEAD && !flush) {
return false;
@@ -522,43 +527,41 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
throw new Exception("Not flushing, but no lookahead");
}
huffman.FlushBlock(window, blockStart, strstart - blockStart,
finish);
finish);
blockStart = strstart;
return false;
}
if (strstart >= 2 * WSIZE - MIN_LOOKAHEAD)
{
if (strstart >= 2 * WSIZE - MIN_LOOKAHEAD) {
/* slide window, as findLongestMatch need this.
* This should only happen when flushing and the window
* is almost full.
*/
SlideWindow();
SlideWindow();
}
int prevMatch = matchStart;
int prevLen = matchLen;
if (lookahead >= MIN_MATCH) {
int hashHead = InsertString();
if (strategy != DeflateStrategy.HuffmanOnly && hashHead != 0 && strstart - hashHead <= MAX_DIST && FindLongestMatch(hashHead))
{
/* longestMatch sets matchStart and matchLen */
if (strategy != DeflateStrategy.HuffmanOnly && hashHead != 0 && strstart - hashHead <= MAX_DIST && FindLongestMatch(hashHead)) {
/* longestMatch sets matchStart and matchLen */
/* Discard match if too small and too far away */
if (matchLen <= 5 && (strategy == DeflateStrategy.Filtered || (matchLen == MIN_MATCH && strstart - matchStart > TOO_FAR))) {
matchLen = MIN_MATCH - 1;
}
/* Discard match if too small and too far away */
if (matchLen <= 5 && (strategy == DeflateStrategy.Filtered || (matchLen == MIN_MATCH && strstart - matchStart > TOO_FAR))) {
matchLen = MIN_MATCH - 1;
}
}
}
/* previous match was better */
if (prevLen >= MIN_MATCH && matchLen <= prevLen) {
// if (DeflaterConstants.DEBUGGING) {
// for (int i = 0 ; i < matchLen; i++) {
// if (window[strstart-1+i] != window[prevMatch + i])
// throw new Exception();
// }
// }
// if (DeflaterConstants.DEBUGGING) {
// for (int i = 0 ; i < matchLen; i++) {
// if (window[strstart-1+i] != window[prevMatch + i])
// throw new Exception();
// }
// }
huffman.TallyDist(strstart - 1 - prevMatch, prevLen);
prevLen -= 2;
do {
@@ -601,10 +604,10 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
do {
FillWindow();
bool canFlush = flush && inputOff == inputEnd;
// if (DeflaterConstants.DEBUGGING) {
// Console.WriteLine("window: ["+blockStart+","+strstart+","
// +lookahead+"], "+comprFunc+","+canFlush);
// }
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("window: ["+blockStart+","+strstart+","
// +lookahead+"], "+comprFunc+","+canFlush);
// }
switch (comprFunc) {
case DEFLATE_STORED:
progress = DeflateStored(canFlush, finish);
@@ -37,7 +37,8 @@
using System;
namespace ICSharpCode.SharpZipLib.Zip.Compression {
namespace ICSharpCode.SharpZipLib.Zip.Compression
{
/// <summary>
/// This is the DeflaterHuffman class.
@@ -78,15 +79,15 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
15
};
public class Tree
{
public short[] freqs;
public short[] codes;
public byte[] length;
public int[] bl_counts;
public int minNumCodes, numCodes;
public int maxLength;
short[] codes;
int[] bl_counts;
int maxLength;
DeflaterHuffman dh;
public Tree(DeflaterHuffman dh, int elems, int minCodes, int maxLength)
@@ -109,10 +110,10 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
public void WriteSymbol(int code)
{
// if (DeflaterConstants.DEBUGGING) {
// freqs[code]--;
// // Console.Write("writeSymbol("+freqs.length+","+code+"): ");
// }
// if (DeflaterConstants.DEBUGGING) {
// freqs[code]--;
// // Console.Write("writeSymbol("+freqs.length+","+code+"): ");
// }
dh.pending.WriteBits(codes[code] & 0xffff, length[code]);
}
@@ -121,14 +122,14 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
bool empty = true;
for (int i = 0; i < freqs.Length; i++) {
if (freqs[i] != 0) {
Console.WriteLine("freqs["+i+"] == "+freqs[i]);
//Console.WriteLine("freqs["+i+"] == "+freqs[i]);
empty = false;
}
}
if (!empty) {
throw new Exception();
}
Console.WriteLine("checkEmpty suceeded!");
//Console.WriteLine("checkEmpty suceeded!");
}
public void SetStaticCodes(short[] stCodes, byte[] stLength)
@@ -144,17 +145,17 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
int code = 0;
codes = new short[freqs.Length];
// if (DeflaterConstants.DEBUGGING) {
// Console.WriteLine("buildCodes: "+freqs.Length);
// }
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("buildCodes: "+freqs.Length);
// }
for (int bits = 0; bits < maxLength; bits++) {
nextCode[bits] = code;
code += bl_counts[bits] << (15 - bits);
// if (DeflaterConstants.DEBUGGING) {
// Console.WriteLine("bits: "+(bits+1)+" count: "+bl_counts[bits]
// +" nextCode: "+code); // HACK : Integer.toHexString(
// }
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("bits: "+(bits+1)+" count: "+bl_counts[bits]
// +" nextCode: "+code); // HACK : Integer.toHexString(
// }
}
if (DeflaterConstants.DEBUGGING && code != 65536) {
throw new Exception("Inconsistent bl_counts!");
@@ -163,17 +164,17 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
for (int i=0; i < numCodes; i++) {
int bits = length[i];
if (bits > 0) {
// if (DeflaterConstants.DEBUGGING) {
// Console.WriteLine("codes["+i+"] = rev(" + nextCode[bits-1]+")," // HACK : Integer.toHexString(
// +bits);
// }
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("codes["+i+"] = rev(" + nextCode[bits-1]+")," // HACK : Integer.toHexString(
// +bits);
// }
codes[i] = BitReverse(nextCode[bits-1]);
nextCode[bits-1] += 1 << (16 - bits);
}
}
}
private void BuildLength(int[] childs)
void BuildLength(int[] childs)
{
this.length = new byte [freqs.Length];
int numNodes = childs.Length / 2;
@@ -204,13 +205,13 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
}
}
// if (DeflaterConstants.DEBUGGING) {
// Console.WriteLine("Tree "+freqs.Length+" lengths:");
// for (int i=0; i < numLeafs; i++) {
// Console.WriteLine("Node "+childs[2*i]+" freq: "+freqs[childs[2*i]]
// + " len: "+length[childs[2*i]]);
// }
// }
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("Tree "+freqs.Length+" lengths:");
// for (int i=0; i < numLeafs; i++) {
// //Console.WriteLine("Node "+childs[2*i]+" freq: "+freqs[childs[2*i]]
// + " len: "+length[childs[2*i]]);
// }
// }
if (overflow == 0) {
return;
@@ -258,13 +259,13 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
}
}
}
// if (DeflaterConstants.DEBUGGING) {
// Console.WriteLine("*** After overflow elimination. ***");
// for (int i=0; i < numLeafs; i++) {
// Console.WriteLine("Node "+childs[2*i]+" freq: "+freqs[childs[2*i]]
// + " len: "+length[childs[2*i]]);
// }
// }
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("*** After overflow elimination. ***");
// for (int i=0; i < numLeafs; i++) {
// //Console.WriteLine("Node "+childs[2*i]+" freq: "+freqs[childs[2*i]]
// + " len: "+length[childs[2*i]]);
// }
// }
}
public void BuildTree()
@@ -332,16 +333,17 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
/* Propagate the hole to the leafs of the heap */
int ppos = 0;
int path = 1;
while (path < heapLen) {
if (path + 1 < heapLen && values[heap[path]] > values[heap[path+1]]) {
path++;
}
heap[ppos] = heap[path];
ppos = path;
path = path * 2 + 1;
}
/* Now propagate the last element down along path. Normally
* it shouldn't go too deep.
*/
@@ -364,16 +366,17 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
/* Again, propagate the hole to the leafs */
ppos = 0;
path = 1;
while (path < heapLen) {
if (path + 1 < heapLen && values[heap[path]] > values[heap[path+1]]) {
path++;
}
heap[ppos] = heap[path];
ppos = path;
path = ppos * 2 + 1;
}
/* Now propagate the new element down along path */
while ((path = ppos) > 0 && values[heap[ppos = (path - 1)/2]] > lastVal) {
heap[path] = heap[ppos];
@@ -476,8 +479,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
while (count-- > 0) {
blTree.WriteSymbol(curlen);
}
}
else if (curlen != 0) {
} else if (curlen != 0) {
blTree.WriteSymbol(REP_3_6);
dh.pending.WriteBits(count - 3, 2);
} else if (count <= 10) {
@@ -509,10 +511,10 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
/// </summary>
public static short BitReverse(int value)
{
return (short) (bit4Reverse[value & 0xF] << 12
| bit4Reverse[(value >> 4) & 0xF] << 8
| bit4Reverse[(value >> 8) & 0xF] << 4
| bit4Reverse[value >> 12]);
return (short) (bit4Reverse[value & 0xF] << 12 |
bit4Reverse[(value >> 4) & 0xF] << 8 |
bit4Reverse[(value >> 8) & 0xF] << 4 |
bit4Reverse[value >> 12]);
}
@@ -570,7 +572,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
blTree.Reset();
}
private int L_code(int len)
int Lcode(int len)
{
if (len == 255) {
return 285;
@@ -584,7 +586,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
return code + len;
}
private int D_code(int distance)
int Dcode(int distance)
{
int code = 0;
while (distance >= 4) {
@@ -607,9 +609,9 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
}
literalTree.WriteTree(blTree);
distTree.WriteTree(blTree);
// if (DeflaterConstants.DEBUGGING) {
// blTree.CheckEmpty();
// }
// if (DeflaterConstants.DEBUGGING) {
// blTree.CheckEmpty();
// }
}
public void CompressBlock()
@@ -618,11 +620,11 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
int litlen = l_buf[i] & 0xff;
int dist = d_buf[i];
if (dist-- != 0) {
// if (DeflaterConstants.DEBUGGING) {
// Console.Write("["+(dist+1)+","+(litlen+3)+"]: ");
// }
// if (DeflaterConstants.DEBUGGING) {
// Console.Write("["+(dist+1)+","+(litlen+3)+"]: ");
// }
int lc = L_code(litlen);
int lc = Lcode(litlen);
literalTree.WriteSymbol(lc);
int bits = (lc - 261) / 4;
@@ -630,7 +632,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
pending.WriteBits(litlen & ((1 << bits) - 1), bits);
}
int dc = D_code(dist);
int dc = Dcode(dist);
distTree.WriteSymbol(dc);
bits = dc / 2 - 1;
@@ -638,41 +640,40 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
pending.WriteBits(dist & ((1 << bits) - 1), bits);
}
} else {
// if (DeflaterConstants.DEBUGGING) {
// if (litlen > 32 && litlen < 127) {
// Console.Write("("+(char)litlen+"): ");
// } else {
// Console.Write("{"+litlen+"}: ");
// }
// }
// if (DeflaterConstants.DEBUGGING) {
// if (litlen > 32 && litlen < 127) {
// Console.Write("("+(char)litlen+"): ");
// } else {
// Console.Write("{"+litlen+"}: ");
// }
// }
literalTree.WriteSymbol(litlen);
}
}
// if (DeflaterConstants.DEBUGGING) {
// Console.Write("EOF: ");
// }
// if (DeflaterConstants.DEBUGGING) {
// Console.Write("EOF: ");
// }
literalTree.WriteSymbol(EOF_SYMBOL);
// if (DeflaterConstants.DEBUGGING) {
// literalTree.CheckEmpty();
// distTree.CheckEmpty();
// }
// if (DeflaterConstants.DEBUGGING) {
// literalTree.CheckEmpty();
// distTree.CheckEmpty();
// }
}
public void FlushStoredBlock(byte[] stored, int stored_offset, int stored_len, bool lastBlock)
public void FlushStoredBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock)
{
// if (DeflaterConstants.DEBUGGING) {
// Console.WriteLine("Flushing stored block "+ stored_len);
// }
pending.WriteBits((DeflaterConstants.STORED_BLOCK << 1)
+ (lastBlock ? 1 : 0), 3);
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("Flushing stored block "+ storedLength);
// }
pending.WriteBits((DeflaterConstants.STORED_BLOCK << 1) + (lastBlock ? 1 : 0), 3);
pending.AlignToByte();
pending.WriteShort(stored_len);
pending.WriteShort(~stored_len);
pending.WriteBlock(stored, stored_offset, stored_len);
pending.WriteShort(storedLength);
pending.WriteShort(~storedLength);
pending.WriteBlock(stored, storedOffset, storedLength);
Reset();
}
public void FlushBlock(byte[] stored, int stored_offset, int stored_len, bool lastBlock)
public void FlushBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock)
{
literalTree.freqs[EOF_SYMBOL]++;
@@ -694,8 +695,8 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
}
}
int opt_len = 14 + blTreeCodes * 3 + blTree.GetEncodedLength() +
literalTree.GetEncodedLength() + distTree.GetEncodedLength() +
extra_bits;
literalTree.GetEncodedLength() + distTree.GetEncodedLength() +
extra_bits;
int static_len = extra_bits;
for (int i = 0; i < LITERAL_NUM; i++) {
@@ -709,13 +710,13 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
opt_len = static_len;
}
if (stored_offset >= 0 && stored_len+4 < (opt_len >> 3)) {
if ((storedOffset >= 0) && (storedLength + 4 < (opt_len >> 3))) {
/* Store Block */
// if (DeflaterConstants.DEBUGGING) {
// Console.WriteLine("Storing, since " + stored_len + " < " + opt_len
// + " <= " + static_len);
// }
FlushStoredBlock(stored, stored_offset, stored_len, lastBlock);
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("Storing, since " + storedLength + " < " + opt_len
// + " <= " + static_len);
// }
FlushStoredBlock(stored, storedOffset, storedLength, lastBlock);
} else if (opt_len == static_len) {
/* Encode with static tree */
pending.WriteBits((DeflaterConstants.STATIC_TREES << 1) + (lastBlock ? 1 : 0), 3);
@@ -734,18 +735,19 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
public bool IsFull()
{
return last_lit + 16 >= BUFSIZE; // HACK: This was == 'last_lit == BUFSIZE', but errors occured with DeflateFast
// return last_lit + 16 >= BUFSIZE; // HACK: This was == 'last_lit == BUFSIZE', but errors occured with DeflateFast
return last_lit >= BUFSIZE; // -jr- This is the correct form!
}
public bool TallyLit(int lit)
{
// if (DeflaterConstants.DEBUGGING) {
// if (lit > 32 && lit < 127) {
// Console.WriteLine("("+(char)lit+")");
// } else {
// Console.WriteLine("{"+lit+"}");
// }
// }
// if (DeflaterConstants.DEBUGGING) {
// if (lit > 32 && lit < 127) {
// //Console.WriteLine("("+(char)lit+")");
// } else {
// //Console.WriteLine("{"+lit+"}");
// }
// }
d_buf[last_lit] = 0;
l_buf[last_lit++] = (byte)lit;
literalTree.freqs[lit]++;
@@ -754,20 +756,20 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
public bool TallyDist(int dist, int len)
{
// if (DeflaterConstants.DEBUGGING) {
// Console.WriteLine("["+dist+","+len+"]");
// }
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("["+dist+","+len+"]");
// }
d_buf[last_lit] = (short)dist;
l_buf[last_lit++] = (byte)(len - 3);
int lc = L_code(len - 3);
int lc = Lcode(len - 3);
literalTree.freqs[lc]++;
if (lc >= 265 && lc < 285) {
extra_bits += (lc - 261) / 4;
}
int dc = D_code(dist - 1);
int dc = Dcode(dist - 1);
distTree.freqs[dc]++;
if (dc >= 4) {
extra_bits += dc / 2 - 1;
@@ -35,7 +35,8 @@
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
namespace ICSharpCode.SharpZipLib.Zip.Compression {
namespace ICSharpCode.SharpZipLib.Zip.Compression
{
/// <summary>
/// This class stores the pending output of the Deflater.
@@ -40,7 +40,8 @@ using System;
using ICSharpCode.SharpZipLib.Checksums;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
namespace ICSharpCode.SharpZipLib.Zip.Compression {
namespace ICSharpCode.SharpZipLib.Zip.Compression
{
/// <summary>
/// Inflater is used to decompress data that has been compressed according
@@ -69,35 +70,35 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
/// Copy lengths for literal codes 257..285
/// </summary>
private static int[] CPLENS = {
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258
};
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258
};
/// <summary>
/// Extra bits for literal codes 257..285
/// </summary>
private static int[] CPLEXT = {
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0
};
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0
};
/// <summary>
/// Copy offsets for distance codes 0..29
/// </summary>
private static int[] CPDIST = {
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
8193, 12289, 16385, 24577
};
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
8193, 12289, 16385, 24577
};
/// <summary>
/// Extra bits for distance codes
/// </summary>
private static int[] CPDEXT = {
0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
12, 12, 13, 13
};
0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
12, 12, 13, 13
};
/// <summary>
/// This are the state in which the inflater can be.
@@ -384,9 +385,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
neededBits -= 8;
}
if ((int) adler.Value != readAdler) {
throw new FormatException("Adler chksum doesn't match: "
+ (int)adler.Value
+ " vs. " + readAdler);
throw new FormatException("Adler chksum doesn't match: " + (int)adler.Value + " vs. " + readAdler);
}
mode = FINISHED;
return false;
@@ -433,7 +432,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
if ((type & 1) != 0) {
isLastBlock = true;
}
switch (type >> 1) {
switch (type >> 1){
case DeflaterConstants.STORED_BLOCK:
input.SkipToByteBoundary();
mode = DECODE_STORED_LEN1;
@@ -452,15 +451,17 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
}
return true;
case DECODE_STORED_LEN1: {
case DECODE_STORED_LEN1:
{
if ((uncomprLen = input.PeekBits(16)) < 0) {
return false;
}
input.DropBits(16);
mode = DECODE_STORED_LEN2;
}
goto case DECODE_STORED_LEN2; /* fall through */
case DECODE_STORED_LEN2: {
goto case DECODE_STORED_LEN2; /* fall through */
case DECODE_STORED_LEN2:
{
int nlen = input.PeekBits(16);
if (nlen < 0) {
return false;
@@ -471,8 +472,9 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
}
mode = DECODE_STORED;
}
goto case DECODE_STORED;/* fall through */
case DECODE_STORED: {
goto case DECODE_STORED;/* fall through */
case DECODE_STORED:
{
int more = outputWindow.CopyStored(input, uncomprLen);
uncomprLen -= more;
if (uncomprLen == 0) {
@@ -554,7 +556,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
}
adler.Update(buffer, off, len);
if ((int) adler.Value != readAdler) {
if ((int)adler.Value != readAdler) {
throw new ArgumentException("Wrong adler checksum");
}
adler.Reset();
@@ -660,12 +662,15 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
}
// Special case: len may be zero
if (len == 0) {
if (IsFinished == false) {// -jr- 08-Nov-2003 INFLATE_BUG fix..
Decode();
}
return 0;
}
/* // Check for correct buff, off, len triple
if (off < 0 || off + len >= buf.Length) {
throw new ArgumentException("off/len outside buf bounds");
}*/
/* // Check for correct buff, off, len triple
if (off < 0 || off + len >= buf.Length) {
throw new ArgumentException("off/len outside buf bounds");
}*/
int count = 0;
int more;
do {
@@ -687,8 +692,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
return count;
}
}
} while (Decode() || (outputWindow.GetAvailable() > 0 &&
mode != DECODE_CHKSUM));
} while (Decode() || (outputWindow.GetAvailable() > 0 && mode != DECODE_CHKSUM));
return count;
}
@@ -39,7 +39,8 @@ using System;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
namespace ICSharpCode.SharpZipLib.Zip.Compression {
namespace ICSharpCode.SharpZipLib.Zip.Compression
{
class InflaterDynHeader
{
@@ -64,7 +65,8 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
byte lastLen;
int ptr;
static readonly int[] BL_ORDER = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 };
static readonly int[] BL_ORDER =
{ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 };
public InflaterDynHeader()
{
@@ -73,91 +75,93 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
public bool Decode(StreamManipulator input)
{
decode_loop:
for (;;) {
switch (mode) {
case LNUM:
lnum = input.PeekBits(5);
if (lnum < 0) {
return false;
}
lnum += 257;
input.DropBits(5);
// System.err.println("LNUM: "+lnum);
mode = DNUM;
goto case DNUM; // fall through
case DNUM:
dnum = input.PeekBits(5);
if (dnum < 0) {
return false;
}
dnum++;
input.DropBits(5);
// System.err.println("DNUM: "+dnum);
num = lnum+dnum;
litdistLens = new byte[num];
mode = BLNUM;
goto case BLNUM; // fall through
case BLNUM:
blnum = input.PeekBits(4);
if (blnum < 0) {
return false;
}
blnum += 4;
input.DropBits(4);
blLens = new byte[19];
ptr = 0;
// System.err.println("BLNUM: "+blnum);
mode = BLLENS;
goto case BLLENS; // fall through
case BLLENS:
while (ptr < blnum) {
int len = input.PeekBits(3);
if (len < 0) {
for (;;) {
switch (mode) {
case LNUM:
lnum = input.PeekBits(5);
if (lnum < 0) {
return false;
}
input.DropBits(3);
// System.err.println("blLens["+BL_ORDER[ptr]+"]: "+len);
blLens[BL_ORDER[ptr]] = (byte) len;
ptr++;
}
blTree = new InflaterHuffmanTree(blLens);
blLens = null;
ptr = 0;
mode = LENS;
goto case LENS; // fall through
case LENS: {
int symbol;
while (((symbol = blTree.GetSymbol(input)) & ~15) == 0) {
/* Normal case: symbol in [0..15] */
// System.err.println("litdistLens["+ptr+"]: "+symbol);
litdistLens[ptr++] = lastLen = (byte)symbol;
if (ptr == num) {
/* Finished */
return true;
lnum += 257;
input.DropBits(5);
// System.err.println("LNUM: "+lnum);
mode = DNUM;
goto case DNUM; // fall through
case DNUM:
dnum = input.PeekBits(5);
if (dnum < 0) {
return false;
}
}
/* need more input ? */
if (symbol < 0)
return false;
/* otherwise repeat code */
if (symbol >= 17) {
/* repeat zero */
// System.err.println("repeating zero");
lastLen = 0;
} else {
if (ptr == 0) {
throw new Exception();
dnum++;
input.DropBits(5);
// System.err.println("DNUM: "+dnum);
num = lnum+dnum;
litdistLens = new byte[num];
mode = BLNUM;
goto case BLNUM; // fall through
case BLNUM:
blnum = input.PeekBits(4);
if (blnum < 0) {
return false;
}
blnum += 4;
input.DropBits(4);
blLens = new byte[19];
ptr = 0;
// System.err.println("BLNUM: "+blnum);
mode = BLLENS;
goto case BLLENS; // fall through
case BLLENS:
while (ptr < blnum) {
int len = input.PeekBits(3);
if (len < 0) {
return false;
}
input.DropBits(3);
// System.err.println("blLens["+BL_ORDER[ptr]+"]: "+len);
blLens[BL_ORDER[ptr]] = (byte) len;
ptr++;
}
blTree = new InflaterHuffmanTree(blLens);
blLens = null;
ptr = 0;
mode = LENS;
goto case LENS; // fall through
case LENS:
{
int symbol;
while (((symbol = blTree.GetSymbol(input)) & ~15) == 0) {
/* Normal case: symbol in [0..15] */
// System.err.println("litdistLens["+ptr+"]: "+symbol);
litdistLens[ptr++] = lastLen = (byte)symbol;
if (ptr == num) {
/* Finished */
return true;
}
}
/* need more input ? */
if (symbol < 0) {
return false;
}
/* otherwise repeat code */
if (symbol >= 17) {
/* repeat zero */
// System.err.println("repeating zero");
lastLen = 0;
} else {
if (ptr == 0) {
throw new Exception();
}
}
repSymbol = symbol-16;
}
repSymbol = symbol-16;
}
mode = REPS;
goto case REPS; // fall through
case REPS:
mode = REPS;
goto case REPS; // fall through
case REPS:
{
int bits = repBits[repSymbol];
int count = input.PeekBits(bits);
@@ -180,10 +184,10 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
return true;
}
}
mode = LENS;
goto decode_loop;
mode = LENS;
goto decode_loop;
}
}
}
}
public InflaterHuffmanTree BuildLitLenTree()
@@ -39,7 +39,8 @@ using System;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
namespace ICSharpCode.SharpZipLib.Zip.Compression {
namespace ICSharpCode.SharpZipLib.Zip.Compression
{
public class InflaterHuffmanTree
{
@@ -96,8 +97,9 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
for (int i = 0; i < codeLengths.Length; i++) {
int bits = codeLengths[i];
if (bits > 0)
if (bits > 0) {
blCount[bits]++;
}
}
int code = 0;
@@ -112,9 +114,12 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
treeSize += (end - start) >> (16 - bits);
}
}
if (code != 65536) {
/* -jr comment this out! doesnt work for dynamic trees and pkzip 2.04g
if (code != 65536)
{
throw new Exception("Code lengths don't add up properly.");
}
*/
/* Now create and fill the extra tables from longest to shortest
* bit len. This way the sub trees will be aligned.
*/
@@ -37,7 +37,8 @@
using System;
namespace ICSharpCode.SharpZipLib.Zip.Compression {
namespace ICSharpCode.SharpZipLib.Zip.Compression
{
/// <summary>
/// This class is general purpose class for writing data to a buffer.
@@ -73,8 +74,9 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
public void WriteByte(int b)
{
if (DeflaterConstants.DEBUGGING && start != 0)
if (DeflaterConstants.DEBUGGING && start != 0) {
throw new Exception();
}
buf[end++] = (byte) b;
}
@@ -133,9 +135,9 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
if (DeflaterConstants.DEBUGGING && start != 0) {
throw new Exception();
}
// if (DeflaterConstants.DEBUGGING) {
// Console.WriteLine("writeBits("+b+","+count+")");
// }
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("writeBits("+b+","+count+")");
// }
bits |= (uint)(b << bitCount);
bitCount += count;
if (bitCount >= 16) {
@@ -198,7 +200,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
public byte[] ToByteArray()
{
byte[] ret = new byte[ end - start ];
byte[] ret = new byte[end - start];
System.Array.Copy(buf, start, ret, 0, ret.Length);
start = 0;
end = 0;
@@ -37,10 +37,11 @@
using System;
using System.IO;
using ICSharpCode.SharpZipLib.Checksums;
using ICSharpCode.SharpZipLib.Zip.Compression;
namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams
{
/// <summary>
/// This is a special FilterOutputStream deflating the bytes that are
@@ -80,7 +81,8 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
/// </summary>
public override bool CanSeek {
get {
return baseOutputStream.CanSeek;
return false;
// return baseOutputStream.CanSeek;
}
}
@@ -119,7 +121,8 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
/// </summary>
public override long Seek(long offset, SeekOrigin origin)
{
return baseOutputStream.Seek(offset, origin);
throw new NotSupportedException("Seek not supported"); // -jr- 01-Dec-2003
// return baseOutputStream.Seek(offset, origin);
}
/// <summary>
@@ -145,14 +148,24 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
{
return baseOutputStream.Read(b, off, len);
}
// -jr- 01-Dec-2003
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
{
throw new NotSupportedException("Asynch read not currently supported");
}
// -jr- 01-Dec-2003
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
{
throw new NotSupportedException("Asynch write not currently supported");
}
/// <summary>
/// Deflates everything in the def's input buffers. This will call
/// <code>def.deflate()</code> until all bytes from the input buffers
/// are processed.
/// </summary>
protected void deflate()
protected void Deflate()
{
while (!def.IsNeedingInput) {
int len = def.Deflate(buf, 0, buf.Length);
@@ -177,7 +190,6 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
/// </param>
public DeflaterOutputStream(Stream baseOutputStream) : this(baseOutputStream, new Deflater(), 512)
{
}
/// <summary>
@@ -228,7 +240,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
public override void Flush()
{
def.Flush();
deflate();
Deflate();
baseOutputStream.Flush();
}
@@ -238,11 +250,18 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
public virtual void Finish()
{
def.Finish();
while (!def.IsFinished) {
while (!def.IsFinished) {
int len = def.Deflate(buf, 0, buf.Length);
if (len <= 0) {
break;
}
// kidnthrain encryption alteration
if (this.Password != null) {
// plain data has been deflated. Now encrypt result
this.EncryptBlock(buf, 0, len);
}
baseOutputStream.Write(buf, 0, len);
}
if (!def.IsFinished) {
@@ -289,8 +308,72 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
{
// System.err.println("DOS with off " + off + " and len " + len);
def.SetInput(buf, off, len);
deflate();
Deflate();
}
#region Encryption
string password = null;
uint[] keys = null;
public string Password {
get {
return password;
}
set {
password = value;
}
}
//The beauty of xor-ing bits is that
//plain ^ key = enc
//and enc ^ key = plain
//accordingly, this is the exact same as the decrypt byte
//function in InflaterInputStream
protected byte EncryptByte()
{
uint temp = ((keys[2] & 0xFFFF) | 2);
return (byte)((temp * (temp ^ 1)) >> 8);
}
/// <summary>
/// Takes a buffer of data and uses the keys
/// that have been previously initialized from a
/// password and then updated via a random encryption header
/// to encrypt that data
/// </summary>
protected void EncryptBlock(byte[] buf, int off, int len)
{
for (int i = off; i < off + len; ++i) {
byte oldbyte = buf[i];
buf[i] ^= EncryptByte();
UpdateKeys(oldbyte);
}
}
/// <summary>
/// Initializes our encryption keys using a given password
/// </summary>
protected void InitializePassword(string password) {
keys = new uint[] {
0x12345678,
0x23456789,
0x34567890
};
for (int i = 0; i < password.Length; ++i) {
UpdateKeys((byte)password[i]);
}
}
protected void UpdateKeys(byte ch)
{
keys[0] = Crc32.ComputeCrc32(keys[0], ch);
keys[1] = keys[1] + (byte)keys[0];
keys[1] = keys[1] * 134775813 + 1;
keys[2] = Crc32.ComputeCrc32(keys[2], (byte)(keys[1] >> 24));
}
#endregion
}
}
@@ -39,8 +39,10 @@ using System;
using System.IO;
using ICSharpCode.SharpZipLib.Zip.Compression;
using ICSharpCode.SharpZipLib.Checksums;
namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams
{
/// <summary>
/// This filter stream is used to decompress data compressed baseInputStream the "deflate"
@@ -60,7 +62,6 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
/// </summary>
protected Inflater inf;
/// <summary>
/// Byte array used as a buffer
/// </summary>
@@ -79,6 +80,8 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
/// </summary>
protected Stream baseInputStream;
protected long csize;
/// <summary>
/// I needed to implement the abstract member.
/// </summary>
@@ -93,7 +96,8 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
/// </summary>
public override bool CanSeek {
get {
return baseInputStream.CanSeek;
return false;
// return baseInputStream.CanSeek;
}
}
@@ -140,7 +144,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
/// </summary>
public override long Seek(long offset, SeekOrigin origin)
{
return baseInputStream.Seek(offset, origin);
throw new NotSupportedException("Seek not supported"); // -jr- 01-Dec-2003
}
/// <summary>
@@ -167,6 +171,12 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
baseInputStream.WriteByte(val);
}
// -jr- 01-Dec-2003 This may be flawed for some base streams? Depends on implementation of BeginWrite
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
{
throw new NotSupportedException("Asynch write not currently supported");
}
//Constructors
/// <summary>
@@ -193,7 +203,6 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
/// </param>
public InflaterInputStream(Stream baseInputStream, Inflater inf) : this(baseInputStream, inf, 4096)
{
}
/// <summary>
@@ -215,7 +224,8 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
this.inf = inf;
try {
this.len = (int)baseInputStream.Length;
} catch (Exception) { // the stream may not support .Length
} catch (Exception) {
// the stream may not support .Length
this.len = 0;
}
@@ -243,9 +253,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
/// </summary>
public override void Close()
{
// Do not close the parent, it might be used by a ZipFile, and
// we do not want to close the "master" source.
// baseInputStream.Close();
baseInputStream.Close();
}
/// <summary>
@@ -254,8 +262,12 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
protected void Fill()
{
len = baseInputStream.Read(buf, 0, buf.Length);
// decrypting crypted data
if (cryptbuffer != null) {
DecryptBlock(buf, 0, System.Math.Min((int)(csize - inf.TotalIn), buf.Length));
}
if (len < 0) {
if (len <= 0) {
throw new ApplicationException("Deflated stream ends early.");
}
inf.SetInput(buf, 0, len);
@@ -272,7 +284,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
if (nread > 0) {
return onebytebuffer[0] & 0xff;
}
return -1;
return -1; // ok
}
/// <summary>
@@ -328,20 +340,47 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
if (n < len) {
len = (int) n;
}
if (false && baseInputStream.CanSeek){
baseInputStream.Seek (len, SeekOrigin.Current);
} else {
byte[] tmp = new byte[8192];
for (long i = 0; i < len; ){
long left = len - i;
int count = left < 8192 ? ((int) left) : 8192;
baseInputStream.Read (tmp, 0, count);
i += count;
}
}
return (long) len;
byte[] tmp = new byte[len];
return (long)baseInputStream.Read(tmp, 0, tmp.Length);
}
#region Encryption stuff
protected byte[] cryptbuffer = null;
uint[] keys = null;
protected byte DecryptByte()
{
uint temp = ((keys[2] & 0xFFFF) | 2);
return (byte)((temp * (temp ^ 1)) >> 8);
}
protected void DecryptBlock(byte[] buf, int off, int len)
{
for (int i = off; i < off + len; ++i) {
buf[i] ^= DecryptByte();
UpdateKeys(buf[i]);
}
}
protected void InitializePassword(string password)
{
keys = new uint[] {
0x12345678,
0x23456789,
0x34567890
};
for (int i = 0; i < password.Length; ++i) {
UpdateKeys((byte)password[i]);
}
}
protected void UpdateKeys(byte ch)
{
keys[0] = Crc32.ComputeCrc32(keys[0], ch);
keys[1] = keys[1] + (byte)keys[0];
keys[1] = keys[1] * 134775813 + 1;
keys[2] = Crc32.ComputeCrc32(keys[2], (byte)(keys[1] >> 24));
}
#endregion
}
}
@@ -37,7 +37,8 @@
using System;
namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams
{
/// <summary>
/// Contains the output from the Inflation process.
@@ -52,45 +53,45 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
private static int WINDOW_MASK = WINDOW_SIZE - 1;
private byte[] window = new byte[WINDOW_SIZE]; //The window is 2^15 bytes
private int window_end = 0;
private int window_filled = 0;
private int windowEnd = 0;
private int windowFilled = 0;
public void Write(int abyte)
{
if (window_filled++ == WINDOW_SIZE) {
if (windowFilled++ == WINDOW_SIZE) {
throw new InvalidOperationException("Window full");
}
window[window_end++] = (byte) abyte;
window_end &= WINDOW_MASK;
window[windowEnd++] = (byte) abyte;
windowEnd &= WINDOW_MASK;
}
private void SlowRepeat(int rep_start, int len, int dist)
private void SlowRepeat(int repStart, int len, int dist)
{
while (len-- > 0) {
window[window_end++] = window[rep_start++];
window_end &= WINDOW_MASK;
rep_start &= WINDOW_MASK;
window[windowEnd++] = window[repStart++];
windowEnd &= WINDOW_MASK;
repStart &= WINDOW_MASK;
}
}
public void Repeat(int len, int dist)
{
if ((window_filled += len) > WINDOW_SIZE) {
if ((windowFilled += len) > WINDOW_SIZE) {
throw new InvalidOperationException("Window full");
}
int rep_start = (window_end - dist) & WINDOW_MASK;
int rep_start = (windowEnd - dist) & WINDOW_MASK;
int border = WINDOW_SIZE - len;
if (rep_start <= border && window_end < border) {
if (rep_start <= border && windowEnd < border) {
if (len <= dist) {
System.Array.Copy(window, rep_start, window, window_end, len);
window_end += len;
} else {
System.Array.Copy(window, rep_start, window, windowEnd, len);
windowEnd += len;
} else {
/* We have to copy manually, since the repeat pattern overlaps.
*/
while (len-- > 0) {
window[window_end++] = window[rep_start++];
window[windowEnd++] = window[rep_start++];
}
}
} else {
@@ -100,27 +101,27 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
public int CopyStored(StreamManipulator input, int len)
{
len = Math.Min(Math.Min(len, WINDOW_SIZE - window_filled), input.AvailableBytes);
len = Math.Min(Math.Min(len, WINDOW_SIZE - windowFilled), input.AvailableBytes);
int copied;
int tailLen = WINDOW_SIZE - window_end;
int tailLen = WINDOW_SIZE - windowEnd;
if (len > tailLen) {
copied = input.CopyBytes(window, window_end, tailLen);
copied = input.CopyBytes(window, windowEnd, tailLen);
if (copied == tailLen) {
copied += input.CopyBytes(window, 0, len - tailLen);
}
} else {
copied = input.CopyBytes(window, window_end, len);
copied = input.CopyBytes(window, windowEnd, len);
}
window_end = (window_end + copied) & WINDOW_MASK;
window_filled += copied;
windowEnd = (windowEnd + copied) & WINDOW_MASK;
windowFilled += copied;
return copied;
}
public void CopyDict(byte[] dict, int offset, int len)
{
if (window_filled > 0) {
if (windowFilled > 0) {
throw new InvalidOperationException();
}
@@ -129,40 +130,39 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
len = WINDOW_SIZE;
}
System.Array.Copy(dict, offset, window, 0, len);
window_end = len & WINDOW_MASK;
windowEnd = len & WINDOW_MASK;
}
public int GetFreeSpace()
{
return WINDOW_SIZE - window_filled;
return WINDOW_SIZE - windowFilled;
}
public int GetAvailable()
{
return window_filled;
return windowFilled;
}
public int CopyOutput(byte[] output, int offset, int len)
{
int copy_end = window_end;
if (len > window_filled) {
len = window_filled;
int copy_end = windowEnd;
if (len > windowFilled) {
len = windowFilled;
} else {
copy_end = (window_end - window_filled + len) & WINDOW_MASK;
copy_end = (windowEnd - windowFilled + len) & WINDOW_MASK;
}
int copied = len;
int tailLen = len - copy_end;
if (tailLen > 0) {
System.Array.Copy(window, WINDOW_SIZE - tailLen,
output, offset, tailLen);
System.Array.Copy(window, WINDOW_SIZE - tailLen, output, offset, tailLen);
offset += tailLen;
len = copy_end;
}
System.Array.Copy(window, copy_end - len, output, offset, len);
window_filled -= copied;
if (window_filled < 0) {
windowFilled -= copied;
if (windowFilled < 0) {
throw new InvalidOperationException();
}
return copied;
@@ -170,7 +170,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
public void Reset()
{
window_filled = window_end = 0;
windowFilled = windowEnd = 0;
}
}
}
@@ -37,7 +37,8 @@
using System;
namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams
{
/// <summary>
/// This class allows us to retrieve a specified amount of bits from
@@ -75,7 +76,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
{
if (bits_in_buffer < n) {
if (window_start == window_end) {
return -1;
return -1; // ok
}
buffer |= (uint)((window[window_start++] & 0xff |
(window[window_start++] & 0xff) << 8) << bits_in_buffer);
@@ -174,7 +175,7 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams {
if (length < 0) {
throw new ArgumentOutOfRangeException("length negative");
}
if ((bits_in_buffer & 7) != 0) {
if ((bits_in_buffer & 7) != 0) {
/* bits_in_buffer may only be 0 or 8 */
throw new InvalidOperationException("Bit buffer is not aligned!");
}
@@ -37,7 +37,8 @@
using System.Text;
namespace ICSharpCode.SharpZipLib.Zip {
namespace ICSharpCode.SharpZipLib.Zip
{
/// <summary>
/// This class contains constants used for zip.
@@ -58,6 +59,9 @@ namespace ICSharpCode.SharpZipLib.Zip {
public const int LOCNAM = 26;
public const int LOCEXT = 28;
public const int SPANNINGSIG = 'P' | ('K' << 8) | (7 << 16) | (8 << 24);
public const int SPANTEMPSIG = 'P' | ('K' << 8) | ('0' << 16) | ('0' << 24);
/* The Data descriptor */
public const int EXTSIG = 'P' | ('K' << 8) | (7 << 16) | (8 << 24);
public const int EXTHDR = 16;
@@ -70,7 +74,7 @@ namespace ICSharpCode.SharpZipLib.Zip {
public const int CENSIG = 'P' | ('K' << 8) | (1 << 16) | (2 << 24);
/* The central directory file header for 64bit ZIP*/
public const int CENSIG64 = 0x06064b50;
public const int CENSIG64 = 'P' | ('K' << 8) | (6 << 16) | (6 << 24);
public const int CENHDR = 46;
@@ -94,6 +98,9 @@ namespace ICSharpCode.SharpZipLib.Zip {
public const int ENDSIG = 'P' | ('K' << 8) | (5 << 16) | (6 << 24);
public const int ENDHDR = 22;
public const int HDRDIGITALSIG = 'P' | ('K' << 8) | (5 << 16) | (5 << 24);
public const int CENDIGITALSIG = 'P' | ('K' << 8) | (5 << 16) | (5 << 24);
/* The following two fields are missing in SUN JDK */
public const int ENDNRD = 4;
public const int ENDDCD = 6;
@@ -104,21 +111,36 @@ namespace ICSharpCode.SharpZipLib.Zip {
public const int ENDOFF = 16;
public const int ENDCOM = 20;
/* Using the codepage 1252 doesn't solve the 8bit ASCII problem :/
any help would be appreciated.
// get encoding for latin characters (like ö, ü, ß or ô)
static Encoding ecp1252 = Encoding.GetEncoding(1252);
*/
static int defaultCodePage = 0; // 0 gives default code page, set it to whatever you like or alternatively alter it via property at runtime for more flexibility
// Some care for compatability purposes is required as you can specify unicode code pages here.... if this way of working seems ok
// then some protection may be added to make the interface a bit more robust perhaps.
public static int DefaultCodePage {
get {
return defaultCodePage;
}
set {
defaultCodePage = value;
}
}
public static string ConvertToString(byte[] data)
{
return Encoding.ASCII.GetString(data);
#if COMACT_FRAMEWORK
return Encoding.ASCII.GetString(data,0, data.Length);
#else
return Encoding.GetEncoding(DefaultCodePage).GetString(data, 0, data.Length);
#endif
}
public static byte[] ConvertToArray(string str)
{
#if COMACT_FRAMEWORK
return Encoding.ASCII.GetBytes(str);
#else
return Encoding.GetEncoding(DefaultCodePage).GetBytes(str);
#endif
}
}
}
@@ -37,7 +37,8 @@
using System;
namespace ICSharpCode.SharpZipLib.Zip {
namespace ICSharpCode.SharpZipLib.Zip
{
public enum CompressionMethod
{
@@ -60,22 +61,63 @@ namespace ICSharpCode.SharpZipLib.Zip {
static int KNOWN_CRC = 4;
static int KNOWN_TIME = 8;
DateTime cal = DateTime.Now;
string name;
uint size;
ushort version;
uint compressedSize;
int crc;
uint crc;
uint dosTime;
ushort known = 0;
CompressionMethod method = CompressionMethod.Deflated;
byte[] extra = null;
string comment = null;
bool isCrypted;
int zipFileIndex = -1; /* used by ZipFile */
int flags; /* used by ZipOutputStream */
int offset; /* used by ZipFile and ZipOutputStream */
public bool IsEncrypted {
get {
return (flags & 1) != 0;
}
set {
if (value) {
flags |= 1;
} else {
flags &= ~1;
}
}
}
public int ZipFileIndex {
get {
return zipFileIndex;
}
set {
zipFileIndex = value;
}
}
public int Offset {
get {
return offset;
}
set {
offset = value;
}
}
public int Flags { // Stops having two things represent same concept in class (flag isCrypted removed)
get {
return flags;
}
set {
flags = value;
}
}
public int zipFileIndex = -1; /* used by ZipFile */
public int flags; /* used by ZipOutputStream */
public int offset; /* used by ZipFile and ZipOutputStream */
/// <summary>
/// Creates a zip entry with the given name.
@@ -85,9 +127,10 @@ namespace ICSharpCode.SharpZipLib.Zip {
/// </param>
public ZipEntry(string name)
{
if (name == null) {
if (name == null) {
throw new System.ArgumentNullException("name");
}
this.DateTime = System.DateTime.Now;
this.name = name;
}
@@ -99,72 +142,64 @@ namespace ICSharpCode.SharpZipLib.Zip {
/// </param>
public ZipEntry(ZipEntry e)
{
name = e.name;
known = e.known;
size = e.size;
name = e.name;
known = e.known;
size = e.size;
compressedSize = e.compressedSize;
crc = e.crc;
// time = e.time;
method = e.method;
extra = e.extra;
comment = e.comment;
crc = e.crc;
dosTime = e.dosTime;
method = e.method;
extra = e.extra;
comment = e.comment;
}
public ushort Version {
public int Version {
get {
return version;
}
set {
version = value;
version = (ushort)value;
}
}
public int DosTime {
public long DosTime {
get {
// if ((known & KNOWN_TIME) == 0) {
// return 0;
// }
lock (this) {
return (cal.Year - 1980 & 0x7f) << 25 |
(cal.Month + 1) << 21 |
(cal.Day ) << 16 |
(cal.Hour) << 11 |
(cal.Minute) << 5 |
(cal.Second) >> 1;
if ((known & KNOWN_TIME) == 0) {
return 0;
} else {
return dosTime;
}
}
set {
// Guard against invalid or missing date causing
// IndexOutOfBoundsException.
try {
lock (this) {
cal = CalculateDateTime(value);
// time = (int) (cal.Millisecond / 1000L);
}
known |= (ushort)KNOWN_TIME;
} catch (Exception) {
/* Ignore illegal time stamp */
known &= (ushort)~KNOWN_TIME;
}
this.dosTime = (uint)value;
known |= (ushort)KNOWN_TIME;
}
}
/// <summary>
/// Gets/Sets the time of last modification of the entry.
/// </summary>
public DateTime DateTime {
get {
return cal;
uint sec = 2 * (dosTime & 0x1f);
uint min = (dosTime >> 5) & 0x3f;
uint hrs = (dosTime >> 11) & 0x1f;
uint day = (dosTime >> 16) & 0x1f;
uint mon = ((dosTime >> 21) & 0xf);
uint year = ((dosTime >> 25) & 0x7f) + 1980; /* since 1900 */
return new System.DateTime((int)year, (int)mon, (int)day, (int)hrs, (int)min, (int)sec);
}
set {
lock (this) {
cal = value;
// time = (int) (cal.Millisecond / 1000L);
}
known |= (ushort)KNOWN_TIME;
DosTime = ((uint)value.Year - 1980 & 0x7f) << 25 |
((uint)value.Month) << 21 |
((uint)value.Day) << 16 |
((uint)value.Hour) << 11 |
((uint)value.Minute) << 5 |
((uint)value.Second) >> 1;
}
}
/// <summary>
/// Returns the entry name. The path components in the entry are
/// always separated by slashes ('/').
@@ -175,21 +210,21 @@ namespace ICSharpCode.SharpZipLib.Zip {
}
}
// /// <summary>
// /// Gets/Sets the time of last modification of the entry.
// /// </summary>
// /// <returns>
// /// the time of last modification of the entry, or -1 if unknown.
// /// </returns>
// public long Time {
// get {
// return (known & KNOWN_TIME) != 0 ? time * 1000L : -1;
// }
// set {
// this.time = (int) (value / 1000L);
// this.known |= (ushort)KNOWN_TIME;
// }
// }
// /// <summary>
// /// Gets/Sets the time of last modification of the entry.
// /// </summary>
// /// <returns>
// /// the time of last modification of the entry, or -1 if unknown.
// /// </returns>
// public long Time {
// get {
// return (known & KNOWN_TIME) != 0 ? time * 1000L : -1;
// }
// set {
// this.time = (int) (value / 1000L);
// this.known |= (ushort)KNOWN_TIME;
// }
// }
/// <summary>
/// Gets/Sets the size of the uncompressed data.
@@ -204,7 +239,7 @@ namespace ICSharpCode.SharpZipLib.Zip {
get {
return (known & KNOWN_SIZE) != 0 ? (long)size : -1L;
}
set {
set {
if (((ulong)value & 0xFFFFFFFF00000000L) != 0) {
throw new ArgumentOutOfRangeException("size");
}
@@ -249,10 +284,11 @@ namespace ICSharpCode.SharpZipLib.Zip {
return (known & KNOWN_CRC) != 0 ? crc & 0xffffffffL : -1L;
}
set {
if (((ulong)crc & 0xffffffff00000000L) != 0) {
if (((ulong)crc & 0xffffffff00000000L) != 0)
{
throw new Exception();
}
this.crc = (int)value;
this.crc = (uint)value;
this.known |= (ushort)KNOWN_CRC;
}
}
@@ -273,7 +309,7 @@ namespace ICSharpCode.SharpZipLib.Zip {
return method;
}
set {
this.method = value;
this.method = value;
}
}
@@ -309,13 +345,12 @@ namespace ICSharpCode.SharpZipLib.Zip {
/* extended time stamp, unix format by Rainer Prem <[email protected]> */
int flags = extra[pos];
if ((flags & 1) != 0) {
int iTime = ((extra[pos+1] & 0xff) |
(extra[pos+2] & 0xff) << 8 |
(extra[pos+3] & 0xff) << 16 |
(extra[pos+4] & 0xff) << 24);
int iTime = ((extra[pos+1] & 0xff) |
(extra[pos+2] & 0xff) << 8 |
(extra[pos+3] & 0xff) << 16 |
(extra[pos+4] & 0xff) << 24);
cal = (new DateTime ( 1970, 1, 1, 0, 0, 0 ) +
new TimeSpan ( 0, 0, 0, iTime, 0 )).ToLocalTime ();
DateTime = (new DateTime ( 1970, 1, 1, 0, 0, 0 ) + new TimeSpan ( 0, 0, 0, iTime, 0 )).ToLocalTime ();
known |= (ushort)KNOWN_TIME;
}
}
@@ -342,7 +377,8 @@ namespace ICSharpCode.SharpZipLib.Zip {
return comment;
}
set {
if (value.Length > 0xffff) {
if (value.Length > 0xffff)
{
throw new ArgumentOutOfRangeException();
}
this.comment = value;
@@ -360,6 +396,18 @@ namespace ICSharpCode.SharpZipLib.Zip {
}
}
/// <value>
/// True, if the entry is encrypted.
/// </value>
public bool IsCrypted {
get {
return isCrypted;
}
set {
isCrypted = value;
}
}
/// <summary>
/// Creates a copy of this zip entry.
/// </summary>
@@ -376,18 +424,5 @@ namespace ICSharpCode.SharpZipLib.Zip {
{
return name;
}
DateTime CalculateDateTime(int dosTime)
{
int sec = 2 * (dosTime & 0x1f);
int min = (dosTime >> 5) & 0x3f;
int hrs = (dosTime >> 11) & 0x1f;
int day = (dosTime >> 16) & 0x1f;
int mon = ((dosTime >> 21) & 0xf);
int year = ((dosTime >> 25) & 0x7f) + 1980; /* since 1900 */
return new DateTime(year, mon, day, hrs, min, sec);
}
}
}
@@ -43,7 +43,8 @@ using System.Text;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
using ICSharpCode.SharpZipLib.Zip.Compression;
namespace ICSharpCode.SharpZipLib.Zip {
namespace ICSharpCode.SharpZipLib.Zip
{
/// <summary>
/// This class represents a Zip archive. You can ask for the contained
@@ -68,13 +69,13 @@ namespace ICSharpCode.SharpZipLib.Zip {
/// static public void Main(string[] args)
/// {
/// ZipFile zFile = new ZipFile(args[0]);
/// Console.WriteLine("Listing of : " + zFile.Name);
/// Console.WriteLine("");
/// Console.WriteLine("Raw Size Size Date Time Name");
/// Console.WriteLine("-------- -------- -------- ------ ---------");
/// //Console.WriteLine("Listing of : " + zFile.Name);
/// //Console.WriteLine("");
/// //Console.WriteLine("Raw Size Size Date Time Name");
/// //Console.WriteLine("-------- -------- -------- ------ ---------");
/// foreach (ZipEntry e in zFile) {
/// DateTime d = e.DateTime;
/// Console.WriteLine("{0, -10}{1, -10}{2} {3} {4}", e.Size, e.CompressedSize,
/// //Console.WriteLine("{0, -10}{1, -10}{2} {3} {4}", e.Size, e.CompressedSize,
/// d.ToString("dd-MM-yy"), d.ToString("t"),
/// e.Name);
/// }
@@ -84,6 +85,7 @@ namespace ICSharpCode.SharpZipLib.Zip {
public class ZipFile : IEnumerable
{
string name;
string comment;
Stream baseStream;
ZipEntry[] entries;
@@ -203,6 +205,12 @@ namespace ICSharpCode.SharpZipLib.Zip {
int centralOffset = ReadLeInt();
// GET COMMENT SIZE (COMES AFTER CENTRALOFFSET)
int commentSize = ReadLeShort();
byte[] zipComment = new byte[commentSize];
baseStream.Read(zipComment, 0, zipComment.Length);
comment = ZipConstants.ConvertToString(zipComment);
entries = new ZipEntry[count];
baseStream.Seek(centralOffset, SeekOrigin.Begin);
for (int i = 0; i < count; i++) {
@@ -242,7 +250,7 @@ namespace ICSharpCode.SharpZipLib.Zip {
entry.Crc = crc & 0xffffffffL;
entry.Size = size & 0xffffffffL;
entry.CompressedSize = csize & 0xffffffffL;
entry.DosTime = dostime;
entry.DosTime = (uint)dostime;
if (extraLen > 0) {
byte[] extra = new byte[extraLen];
baseStream.Read(extra, 0, extraLen);
@@ -252,8 +260,8 @@ namespace ICSharpCode.SharpZipLib.Zip {
baseStream.Read(buffer, 0, commentLen);
entry.Comment = ZipConstants.ConvertToString(buffer);
}
entry.zipFileIndex = i;
entry.offset = offset;
entry.ZipFileIndex = i;
entry.Offset = offset;
entries[i] = entry;
}
}
@@ -293,7 +301,7 @@ namespace ICSharpCode.SharpZipLib.Zip {
return i;
}
}
return -1;
return -1; // ok
}
/// <summary>
@@ -330,7 +338,7 @@ namespace ICSharpCode.SharpZipLib.Zip {
long CheckLocalHeader(ZipEntry entry)
{
lock(baseStream) {
baseStream.Seek(entry.offset, SeekOrigin.Begin);
baseStream.Seek(entry.Offset, SeekOrigin.Begin);
if (ReadLeInt() != ZipConstants.LOCSIG) {
throw new ZipException("Wrong Local header signature");
}
@@ -359,7 +367,7 @@ namespace ICSharpCode.SharpZipLib.Zip {
}
int extraLen = entry.Name.Length + ReadLeShort();
return entry.offset + ZipConstants.LOCHDR + extraLen;
return entry.Offset + ZipConstants.LOCHDR + extraLen;
}
}
@@ -383,7 +391,7 @@ namespace ICSharpCode.SharpZipLib.Zip {
throw new InvalidOperationException("ZipFile has closed");
}
int index = entry.zipFileIndex;
int index = entry.ZipFileIndex;
if (index < 0 || index >= entries.Length || entries[index].Name != entry.Name) {
index = GetEntryIndex(entry.Name);
if (index < 0) {
@@ -404,6 +412,15 @@ namespace ICSharpCode.SharpZipLib.Zip {
}
}
/// <summary>
/// The comment for the whole zip file.
/// </summary>
public string ZipFileComment {
get {
return comment;
}
}
/// <summary>
/// Returns the name of this zip file.
/// </summary>
@@ -465,7 +482,8 @@ namespace ICSharpCode.SharpZipLib.Zip {
end = start + len;
}
public override int Available {
public override int Available
{
get {
long amount = end - filepos;
if (amount > Int32.MaxValue) {
@@ -479,8 +497,9 @@ namespace ICSharpCode.SharpZipLib.Zip {
public override int ReadByte()
{
if (filepos == end) {
return -1;
return -1; //ok
}
lock(baseStream) {
baseStream.Seek(filepos++, SeekOrigin.Begin);
return baseStream.ReadByte();
@@ -492,7 +511,7 @@ namespace ICSharpCode.SharpZipLib.Zip {
if (len > end - filepos) {
len = (int) (end - filepos);
if (len == 0) {
return -1;
return 0;
}
}
lock(baseStream) {
@@ -43,8 +43,8 @@ using ICSharpCode.SharpZipLib.Checksums;
using ICSharpCode.SharpZipLib.Zip.Compression;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
namespace ICSharpCode.SharpZipLib.Zip {
namespace ICSharpCode.SharpZipLib.Zip
{
/// <summary>
/// This is a FilterInputStream that reads the files baseInputStream an zip archive
/// one after another. It has a special method to get the zip entry of
@@ -55,7 +55,7 @@ namespace ICSharpCode.SharpZipLib.Zip {
/// author of the original java version : Jochen Hoenicke
/// </summary>
/// <example> This sample shows how to read a zip file
/// <code>
/// <code lang="C#">
/// using System;
/// using System.Text;
/// using System.IO;
@@ -70,7 +70,6 @@ namespace ICSharpCode.SharpZipLib.Zip {
///
/// ZipEntry theEntry;
/// while ((theEntry = s.GetNextEntry()) != null) {
/// Console.WriteLine("File " + theEntry.Name);
/// int size = 2048;
/// byte[] data = new byte[2048];
///
@@ -85,7 +84,6 @@ namespace ICSharpCode.SharpZipLib.Zip {
/// }
/// }
/// }
/// Console.WriteLine();
/// }
/// s.Close();
/// }
@@ -94,34 +92,42 @@ namespace ICSharpCode.SharpZipLib.Zip {
/// </example>
public class ZipInputStream : InflaterInputStream
{
private Crc32 crc = new Crc32();
private ZipEntry entry = null;
Crc32 crc = new Crc32();
ZipEntry entry = null;
private long csize;
private long size;
private int method;
private int flags;
private long avail;
long size;
int method;
int flags;
long avail;
string password = null;
public string Password {
get {
return password;
}
set {
password = value;
}
}
/// <summary>
/// Creates a new Zip input stream, reading a zip archive.
/// </summary>
public ZipInputStream(Stream baseInputStream) : base(baseInputStream, new Inflater(true))
{
}
private void FillBuf()
void FillBuf()
{
avail = len = baseInputStream.Read(buf, 0, buf.Length);
}
private int ReadBuf(byte[] outBuf, int offset, int length)
int ReadBuf(byte[] outBuf, int offset, int length)
{
if (avail <= 0) {
FillBuf();
if (avail <= 0) {
return -1;
return 0;
}
}
if (length > avail) {
@@ -132,7 +138,7 @@ namespace ICSharpCode.SharpZipLib.Zip {
return length;
}
private void ReadFully(byte[] outBuf)
void ReadFully(byte[] outBuf)
{
int off = 0;
int len = outBuf.Length;
@@ -146,7 +152,7 @@ namespace ICSharpCode.SharpZipLib.Zip {
}
}
private int ReadLeByte()
int ReadLeByte()
{
if (avail <= 0) {
FillBuf();
@@ -160,7 +166,7 @@ namespace ICSharpCode.SharpZipLib.Zip {
/// <summary>
/// Read an unsigned short baseInputStream little endian byte order.
/// </summary>
private int ReadLeShort()
int ReadLeShort()
{
return ReadLeByte() | (ReadLeByte() << 8);
}
@@ -168,7 +174,7 @@ namespace ICSharpCode.SharpZipLib.Zip {
/// <summary>
/// Read an int baseInputStream little endian byte order.
/// </summary>
private int ReadLeInt()
int ReadLeInt()
{
return ReadLeShort() | (ReadLeShort() << 16);
}
@@ -176,7 +182,7 @@ namespace ICSharpCode.SharpZipLib.Zip {
/// <summary>
/// Read an int baseInputStream little endian byte order.
/// </summary>
private long ReadLeLong()
long ReadLeLong()
{
return ReadLeInt() | (ReadLeInt() << 32);
}
@@ -194,28 +200,48 @@ namespace ICSharpCode.SharpZipLib.Zip {
CloseEntry();
}
if (this.cryptbuffer != null) {
if (avail == 0 && inf.RemainingInput != 0) {
avail = inf.RemainingInput - 16;
inf.Reset();
}
baseInputStream.Position -= this.len;
baseInputStream.Read(this.buf, 0, this.len);
}
int header = ReadLeInt();
if (header == ZipConstants.CENSIG) {
/* Central Header reached. */
// -jr- added end sig for empty zip files, Zip64 end sig and digital sig for files that have them...
if (header == ZipConstants.CENSIG ||
header == ZipConstants.ENDSIG ||
header == ZipConstants.CENDIGITALSIG ||
header == ZipConstants.CENSIG64) {
// Central Header reached or end of empty zip file
Close();
return null;
}
// -jr- 07-Dec-2003 ignore spanning temporary signatures if found
// SPANNINGSIG is same as descriptor signature and is untested as yet.
if (header == ZipConstants.SPANTEMPSIG || header == ZipConstants.SPANNINGSIG) {
header = ReadLeInt();
}
if (header != ZipConstants.LOCSIG) {
throw new ZipException("Wrong Local header signature" + header);
throw new ZipException("Wrong Local header signature: 0x" + String.Format("{0:X}", header));
}
short version = (short)ReadLeShort();
flags = ReadLeShort();
method = ReadLeShort();
int dostime = ReadLeInt();
uint dostime = (uint)ReadLeInt();
int crc2 = ReadLeInt();
csize = ReadLeInt();
size = ReadLeInt();
int nameLen = ReadLeShort();
int extraLen = ReadLeShort();
if (method == ZipOutputStream.STORED && csize != size) {
bool isCrypted = (flags & 1) == 1;
if (method == ZipOutputStream.STORED && (!isCrypted && csize != size || (isCrypted && csize - 12 != size))) {
throw new ZipException("Stored, but compressed != uncompressed");
}
@@ -225,7 +251,7 @@ namespace ICSharpCode.SharpZipLib.Zip {
string name = ZipConstants.ConvertToString(buffer);
entry = new ZipEntry(name);
entry.IsCrypted = isCrypted;
entry.Version = (ushort)version;
if (method != 0 && method != 8) {
throw new ZipException("unknown compression method " + method);
@@ -237,22 +263,43 @@ namespace ICSharpCode.SharpZipLib.Zip {
entry.Size = size & 0xFFFFFFFFL;
entry.CompressedSize = csize & 0xFFFFFFFFL;
}
entry.DosTime = dostime;
if (extraLen > 0) {
byte[] extra = new byte[extraLen];
ReadFully(extra);
entry.ExtraData = extra;
}
// test for encryption
if (isCrypted) {
if (password == null) {
throw new ZipException("No password set.");
}
InitializePassword(password);
cryptbuffer = new byte[12];
ReadFully(cryptbuffer);
DecryptBlock(cryptbuffer, 0, cryptbuffer.Length);
if ((flags & 8) == 0) {// -jr- 10-Feb-2004 Dont yet know correct size here....
csize -= 12;
}
} else {
cryptbuffer = null;
}
if (method == ZipOutputStream.DEFLATED && avail > 0) {
System.Array.Copy(buf, len - (int)avail, buf, 0, (int)avail);
len = (int)avail;
avail = 0;
if (isCrypted) {
DecryptBlock(buf, 0, Math.Min((int)csize, len));
}
inf.SetInput(buf, 0, len);
}
return entry;
}
private void ReadDataDescr()
{
if (ReadLeInt() != ZipConstants.EXTSIG) {
@@ -273,6 +320,7 @@ namespace ICSharpCode.SharpZipLib.Zip {
if (crc == null) {
throw new InvalidOperationException("Closed.");
}
if (entry == null) {
return;
}
@@ -335,7 +383,7 @@ namespace ICSharpCode.SharpZipLib.Zip {
{
byte[] b = new byte[1];
if (Read(b, 0, 1) <= 0) {
return -1;
return -1; // ok
}
return b[0] & 0xff;
}
@@ -355,24 +403,23 @@ namespace ICSharpCode.SharpZipLib.Zip {
if (crc == null) {
throw new InvalidOperationException("Closed.");
}
if (entry == null) {
return -1;
return 0;
}
bool finished = false;
switch (method) {
case ZipOutputStream.DEFLATED:
len = base.Read(b, off, len);
if (len < 0) {
if (len <= 0) { // TODO BUG1 -jr- Check this was < 0 but avail was not adjusted causing failure in later calls
if (!inf.IsFinished) {
throw new ZipException("Inflater not finished!?");
}
avail = inf.RemainingInput;
if ((flags & 8) != 0) {
ReadDataDescr();
}
if (inf.TotalIn != csize || inf.TotalOut != size) {
// BUG1 -jr- With bit 3 set you dont yet know the size
if ((flags & 8) == 0 && (inf.TotalIn != csize || inf.TotalOut != size)) {
throw new ZipException("size mismatch: " + csize + ";" + size + " <-> " + inf.TotalIn + ";" + inf.TotalOut);
}
inf.Reset();
@@ -381,7 +428,6 @@ namespace ICSharpCode.SharpZipLib.Zip {
break;
case ZipOutputStream.STORED:
if (len > csize && csize >= 0) {
len = (int)csize;
}
@@ -398,15 +444,25 @@ namespace ICSharpCode.SharpZipLib.Zip {
throw new ZipException("EOF in stored block");
}
}
// decrypting crypted data
if (cryptbuffer != null) {
DecryptBlock(b, off, len);
}
break;
}
if (len > 0) {
crc.Update(b, off, len);
}
if (finished) {
if ((crc.Value & 0xFFFFFFFFL) != entry.Crc) {
if ((flags & 8) != 0) {
ReadDataDescr();
}
if ((crc.Value & 0xFFFFFFFFL) != entry.Crc && entry.Crc != -1) {
throw new ZipException("CRC mismatch");
}
crc.Reset();
@@ -427,5 +483,6 @@ namespace ICSharpCode.SharpZipLib.Zip {
crc = null;
entry = null;
}
}
}
Loaded 100 of 2031 files, more files were not shown because too many files have changed in this diff. Show more