Compare commits

..
372 Commits
Author SHA1 Message Date
Everaldo Canuto e117097e1f In System.Windows.Forms:
2008-09-30  Everaldo Canuto  <[email protected]>

	* MenuAPI.cs: Prevent NRE when deactivate menu. Fixes #413636.


svn path=/branches/mono-2-0/mcs/; revision=114557
2008-10-01 13:20:38 +00:00
Michael Hutchinson 95d855ebdd 2008-09-30 Michael Hutchinson <[email protected]>
* HttpServerChannel.cs: make sure the channel data object is set 
	  when the port is auto-assigned.
	* HttpClientTransportSink.cs: Use the __RequestUri header for the 
	  request's URI. Includes workaround for bad __RequestUri values.
	
	Fixes Bug 378713 - [regression] Remoting - HttpChannel.


svn path=/branches/mono-2-0/mcs/; revision=114529
2008-09-30 23:43:33 +00:00
Jb Evain 362fb88f27 2008-09-30 Jb Evain <[email protected]>
* QueryableEnumerable.cs: fix ElementType.


svn path=/branches/mono-2-0/mcs/; revision=114516
2008-09-30 21:36:30 +00:00
Rodrigo Kumpera 9c53f50c43 2008-09-29 Rodrigo Kumpera <[email protected]>
* TypeBuilderTest.cs: Add a test for MakeGenericType with EnumBuilder.
	Tests #430508.

	Backported from trunk.


svn path=/branches/mono-2-0/mcs/; revision=114413
2008-09-29 15:38:28 +00:00
Rodrigo Kumpera 075d5711fa 2008-09-29 Rodrigo Kumpera <[email protected]>
* Type.cs (MakeGenericType): Only use UnderlyingSystemType for user types.
       This must exclude TypeBuilder and EnumBuilder. Fixes #430508.

		Backported from trunk.


svn path=/branches/mono-2-0/mcs/; revision=114412
2008-09-29 15:34:09 +00:00
Geoff Norton c5d359670a 2008-09-29 Geoff Norton <[email protected]>
* include/private/gcconfig.h: Make Darwin/ARM use mmap() instead of
        sbrk() for its allocator implementation.

svn path=/branches/mono-2-0/mono/; revision=114395
2008-09-29 14:03:19 +00:00
Zoltan Varga ee457822fa Merge r114163 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=114200
2008-09-26 16:21:26 +00:00
Zoltan Varga 0589d7ddf5 Merge r113458 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=114102
2008-09-25 17:27:30 +00:00
Marek Safar 2d8310224e 2008-09-25 Marek Safar <marek.safar at gmail.com>
* driver.cs, namespace.cs: Read types and namespaces after all
	requested assemblies are loaded, fixes issues with System.Core
	auto-reference, and #419888.


svn path=/branches/mono-2-0/mcs/; revision=114098
2008-09-25 17:04:27 +00:00
Dick Porter 6bf7d13701 2008-09-25 Dick Porter <[email protected]>
* events.c (event_create): Revert previous kludge as it's no
	longer needed.

	* wait.c: Make sure we keep references to handles we're waiting
	for.  Fixes bug 424851.


svn path=/branches/mono-2-0/mono/; revision=114096
2008-09-25 17:00:21 +00:00
Miguel de Icaza f2eca844d4 Version
svn path=/branches/mono-2-0/mono/; revision=114045
2008-09-25 00:08:10 +00:00
Zoltan Varga 42b162613a 2008-09-24 Zoltan Varga <[email protected]>
* Makefile.am (PLATFORM_DISABLED_TESTS): Disable winx64structs.exe
	on ia64 for the release.

svn path=/branches/mono-2-0/mono/; revision=114015
2008-09-24 20:36:25 +00:00
Michael Hutchinson c02fd518fa 2008-09-24 Michael Hutchinson <[email protected]>
* HttpServerTransportSink.cs: Disable chunking on the server, as 
	  for some reason it was breaking the tests. This reduces efficiency 
	  but right now is unavoidable.
	  
	* HttpServerChannel.cs: Implement AddHookChannelUri. Thanks to 
	  Lluis for the patch.


svn path=/branches/mono-2-0/mcs/; revision=113997
2008-09-24 19:23:00 +00:00
Michael Hutchinson 46ba96ab4c 2008-09-24 Michael Hutchinson <[email protected]>
* HttpServerChannelTests.cs: Don't check for a chunked response from 
	  the Mono HTTP server; it no longer chunks since that was breaking 
	  other tests.


svn path=/branches/mono-2-0/mcs/; revision=113996
2008-09-24 19:22:24 +00:00
Michael Hutchinson 245f79b651 2008-09-23 Michael Hutchinson <[email protected]>
* HttpClientChannel.cs: Fix logic error from ==/!= typo. Stops 
	  channel from trying to handle IPC URLs, which was breaking the 
	  IPC tests.


svn path=/branches/mono-2-0/mcs/; revision=113908
2008-09-23 22:36:04 +00:00
Jb Evain 325b17c5e6 backport fix for bug 428309
svn path=/branches/mono-2-0/mcs/; revision=113782
2008-09-23 06:57:59 +00:00
Miguel de Icaza b77b0e57c7 Backport: do not crash on Goto/cloning
svn path=/branches/mono-2-0/mcs/; revision=113769
2008-09-22 23:26:05 +00:00
Miguel de Icaza 5817f62c06 Backport fix for 427974
svn path=/branches/mono-2-0/mcs/; revision=113636
2008-09-20 16:36:36 +00:00
Kornél Pál 4d846f3217 Backport of r113614. coree.c (_CorValidateImage): Some 64-bit IL only images have entry point calling _CorDllMain imported from mscoree.dll. Set entry point RVA to 0 for 64-bit IL only images because imports are not resolved for IL only images. Special thanks to Bill Holmes for finding this bug and testing the patch. Also fail for 64-bit images marked as CLI_FLAGS_32BITREQUIRED.
svn path=/branches/mono-2-0/mono/; revision=113615
2008-09-20 07:09:14 +00:00
Michael Hutchinson 53ae02f613 2008-09-19 Michael Hutchinson <[email protected]>
* System.Runtime.Remoting_test.dll.sources: add HttpBugtests.cs.


svn path=/branches/mono-2-0/mcs/; revision=113613
2008-09-20 02:13:42 +00:00
Michael Hutchinson 18b14d2b33 2008-09-19 Michael Hutchinson <[email protected]>
* ActivationTests.cs:
	* HttpCalls.cs: Add a timeout on the client.
	* HttpBugTests.cs: Add tests for some bugzilla bugs. One's not fixed, 
	  so is marked as not working.


svn path=/branches/mono-2-0/mcs/; revision=113612
2008-09-20 02:12:30 +00:00
Michael Hutchinson f56c7b32e9 2008-09-19 Michael Hutchinson <[email protected]>
* HttpServerChannel.cs:
	* HttpClientChannel.cs:
	* HttpChannel.cs: Fixes from corcompare, and some cleanup.


svn path=/branches/mono-2-0/mcs/; revision=113611
2008-09-20 02:07:24 +00:00
Jeffrey Stedfast 65a6ec3240 2008-09-19 Jeffrey Stedfast <[email protected]>
* HttpServerChannelTests.cs: More unit tests for
	HttpServerChannel.


svn path=/branches/mono-2-0/mcs/; revision=113600
2008-09-19 23:29:03 +00:00
Jeffrey Stedfast 373c459bb6 2008-09-19 Jeffrey Stedfast <[email protected]>
* HttpChannel.cs: Throw ArgumentNullException if url is null.


svn path=/branches/mono-2-0/mcs/; revision=113552
2008-09-19 17:20:17 +00:00
Michael Hutchinson 384f8eb073 2008-09-18 Michael Hutchinson <[email protected]>
* HttpServerTransportSink.cs:
	* HttpServerChannel.cs: Cleanup.
	* HttpClientTransportSink.cs: Use username/password/domain parameters, 
	  fix some spelling, add FIXME comment regarding stream copying.
	* HttpClientChannel.cs: 
	* HttpChannel.cs: Fix 1.1 API slip.

svn path=/branches/mono-2-0/mcs/; revision=113489
2008-09-19 02:16:53 +00:00
Michael Hutchinson ecb560796d 2008-09-18 Michael Hutchinson <[email protected]>
* HttpServerChannel.cs: Don't try to resolve IPAddress.Any, so that 
	by default we bind to localhost/lo as well as the host address.
	Also remove dead code for binding to multiple IP addresses; I don't 
	think we need to handle that.


svn path=/branches/mono-2-0/mcs/; revision=113457
2008-09-18 19:49:48 +00:00
Michael Hutchinson b94fed666b 2008-09-18 Michael Hutchinson <[email protected]>
* HttpChannel.cs: Fix default channel name.

svn path=/branches/mono-2-0/mcs/; revision=113453
2008-09-18 18:46:34 +00:00
Michael Hutchinson b54f5a8c31 2008-09-18 Michael Hutchinson <[email protected]>
* HttpClientTransportSink: Fix logic error that broke async client 
	functionality. Fixes HttpAsyncCallTest tests.


svn path=/branches/mono-2-0/mcs/; revision=113434
2008-09-18 16:02:59 +00:00
Dick Porter cde9923d53 2008-09-18 Dick Porter <[email protected]>
* events.c (event_create): Start event handles with a reference
	count of 2, to work around a bug causing banshee to hang at exit.
	Temporary kludge for bug 424851.


svn path=/branches/mono-2-0/mono/; revision=113394
2008-09-18 08:11:08 +00:00
Michael Hutchinson a4dd2eb9ab Enable failing test, to avoid missing it later
svn path=/branches/mono-2-0/mcs/; revision=113369
2008-09-17 23:54:32 +00:00
Michael Hutchinson de053ca593 Updated implementation, uses a copy of our HttpListener core
svn path=/branches/mono-2-0/mcs/; revision=113368
2008-09-17 23:53:23 +00:00
Michael Hutchinson 56afb5aa4f Disable failing tests (to fix later; And add binary tests
svn path=/branches/mono-2-0/mcs/; revision=113367
2008-09-17 23:52:55 +00:00
Michael Hutchinson 448d7c2cd7 Add MonoHttp: a scripted copy of the HttpListener core that works in 1.0 for the channel
svn path=/branches/mono-2-0/mcs/; revision=113366
2008-09-17 23:52:10 +00:00
Michael Hutchinson 96c4a7d4b9 2008-09-17 Michael Hutchinson <michael@>
* SoapServerFormatterSink.cs: Do not try to parse text/xml code
	unless there is a SOAPAction.   

	Set position on outgoing streams to zero, so they can be properly
	parsed in the general infrastructure.

	Do not try to seek on incoming streams.

svn path=/branches/mono-2-0/mcs/; revision=113365
2008-09-17 23:51:17 +00:00
Michael Hutchinson e83ed4dbed 2008-09-17 Michael Hutchinson <[email protected]>
* HttpListenerPrefixCollection.cs:
	* EndPointListener.cs:
	* WebHeaderCollection.cs:
	* HttpConnection.cs: Fixes for EMBEDDED_IN_1_0.


svn path=/branches/mono-2-0/mcs/; revision=113363
2008-09-17 23:36:49 +00:00
Miguel de Icaza e4a117cd9a 2008-09-12 Miguel de Icaza <[email protected]>
* HttpListenerPrefixCollection.cs, EndPointListener.cs,
	HttpListener.cs, EndPointManager.cs, HttpConnection.cs: Remove
	generics support where necessary to allow this code to be reused
	in the 1.0 profile.

svn path=/branches/mono-2-0/mcs/; revision=113360
2008-09-17 22:55:36 +00:00
Andreia Gaita c791106c25 * Mono.Mozilla/AsciiString.cs: Change marshalling to ansi - auto is no
good on windows. Fixes #414146.
  [backport of r113117]

svn path=/branches/mono-2-0/mcs/; revision=113308
2008-09-17 13:43:11 +00:00
Ivan Zlatev 2a97314f8d Revert accidental commit to branch.
svn path=/branches/mono-2-0/mcs/; revision=113063
2008-09-15 17:20:56 +00:00
Ivan Zlatev ed54a1b761 2008-09-15 Ivan N. Zlatev <[email protected]>
* MimeIcon.cs: Add null checks in the GnomeHandler, because it might
	happen that the icons from the theme is missing or the particular size
	unavailable.
	[Fixes bug #424981]

svn path=/branches/mono-2-0/mcs/; revision=113059
2008-09-15 17:06:29 +00:00
Michael Hutchinson 7e1ac93383 Add
svn path=/branches/mono-2-0/mcs/; revision=112918
2008-09-12 22:52:36 +00:00
Michael Hutchinson 2fb9b64e73 Removed
svn path=/branches/mono-2-0/mcs/; revision=112917
2008-09-12 22:51:28 +00:00
Dick Porter 1a28da3faf 2008-07-28 Dick Porter <[email protected]>
* handles.c (_wapi_handle_count_signalled_handles): Remove an
	unmatched _wapi_handle_ref().  Fixes bug 410743.
	(Reinstated.)


svn path=/branches/mono-2-0/mono/; revision=112755
2008-09-11 13:13:39 +00:00
Bill Holmes 167914a79b 2008-09-10 Bill Holmes <[email protected]>
Backport of r112715.

	* process.c (complete_path) : Removing quotes from the 
	  input path.  The glib file routines do not handle file paths
	  that have quotes around them.

	Code is contributed under MIT/X11 license.

svn path=/branches/mono-2-0/mono/; revision=112716
2008-09-10 22:00:26 +00:00
Bill Holmes d33e20924b 2008-09-10 Bill Holmes <[email protected]>
Backport of 112681.

	* Socket.cs : Adding a comment to provide locations where
	  changes to MonoSocketAsyncResult need to be synced.

	* Process.cs : Update the fields of ProcessAsyncReader to
	  match MonoSocketAsyncResult metadata/socket-io.h

	Code is contributed under MIT/X11 license.


svn path=/branches/mono-2-0/mcs/; revision=112683
2008-09-10 15:25:30 +00:00
Bill Holmes beb890595c 2008-09-10 Bill Holmes <[email protected]>
Backport of 112680.

	* socket-io.h : Adding a comment to provide locations where
	  changes to MonoSocketAsyncResult need to be synced.

	Code is contributed under MIT/X11 license.


svn path=/branches/mono-2-0/mono/; revision=112682
2008-09-10 15:23:37 +00:00
Andreia Gaita 13f9cb3434 * Mono.Mozilla/WebBrowser.cs: Update the loaded flag so users can now
if the engine is actually running properly.
* Mono.Mozilla/Base.cs: Create cache directory with a version specific
  name so there's no conflict when the user has both xulrunner
  runtime 1.8 and 1.9 installed. Get rid of gluezillaInstalled flag,
  redundant. Bind now returns bool so I can check if the engine is
  actually running properly after initialization. Check the return
  value of createBrowserWindow and bail out if no valid pointer is
  returned. Protect the string functions with a check so they don't
  get called if the engine is not initialized.

Fixes: segfaults when two xulrunner engines are installed. 
segfaults when engine gets initialized but doesn't load properly afterwards

2008-09-10  Andreia Gaita <[email protected]>

svn path=/branches/mono-2-0/mcs/; revision=112640
2008-09-10 03:52:01 +00:00
Dick Porter 85432ce24a Revert this change on 2.0 for now (see bug 424851)
svn path=/branches/mono-2-0/mono/; revision=112613
2008-09-09 19:45:14 +00:00
Jonathan Pryor b9a946161c * TraceImpl.cs:
- Remove the "lock-free" code, which (come to think of it) would be 
	    faulty in a multithreaded environment anyway because the "other"
	    threads won't wait (block) until initialization is complete...
	  - Add InitOnce() calls to all public properties, so that
	    `Debug.AutoFlush=true' will cause InitOnce() to be loaded, lest
	    a `Debug.AutoFlush=true; Debug.Listeners.Add(...)` sequence cause
	    .AutoFlush=true to be ignored as the InitOnce implied by .Add() 
	    will "overwrite" the .AutoFlush.
	  - Split up TraceListenerCollection creation from DefaultTraceListener 
	    addition, as TraceListenerCollection.Add() calls back into 
	    TraceImpl, so if these aren't separate we get an infinite loop
	    and never actually initialize anything.
	  - Fixes #424370.
	* TraceListenerCollection.cs: Add a TraceListenerCollection(bool)
	  constructor, which provides a way to NOT add the
	  DefaultTraceListener (needed by TraceImpl; see above).

svn path=/branches/mono-2-0/mcs/; revision=112607
2008-09-09 17:17:01 +00:00
Zoltan Varga 3674150432 Merge r112539 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=112540
2008-09-08 19:25:38 +00:00
Ivan Zlatev b7db72d0e5 2008-09-08 Ivan N. Zlatev <[email protected]>
* ErrorProvider.cs: Unbreak my previous commit.

svn path=/branches/mono-2-0/mcs/; revision=112522
2008-09-08 16:59:14 +00:00
Ivan Zlatev 7cd4a28f4a 2008-09-08 Ivan N. Zlatev <[email protected]>
* ErrorProvider.cs: Icon should always be 16x16.
	[Fixes bug #424380]

svn path=/branches/mono-2-0/mcs/; revision=112519
2008-09-08 16:16:42 +00:00
Rodrigo Kumpera 5e858b9c01 In .:
2008-09-08  Rodrigo Kumpera  <[email protected]>

	* InotifyWatcher.cs: Really fix #359181.
	(Ported from trunk)
	

svn path=/branches/mono-2-0/mcs/; revision=112516
2008-09-08 16:02:19 +00:00
Miguel de Icaza 653096d4d3 Revert patch, the tests are not working on non UK timezones
svn path=/branches/mono-2-0/mcs/; revision=112507
2008-09-08 15:10:51 +00:00
Miguel de Icaza 596a9f9abf Backport 112483, fixes #409181
svn path=/branches/mono-2-0/mcs/; revision=112485
2008-09-08 02:05:08 +00:00
Ivan Zlatev 86b66e974e 2008-09-07 Ivan N. Zlatev <[email protected]>
* GridEntry.cs: Invalidate the child items cache when the property
	value changes.

svn path=/branches/mono-2-0/mcs/; revision=112467
2008-09-07 17:04:41 +00:00
Ivan Zlatev a30e7b6859 2008-09-07 Ivan N. Zlatev <[email protected]>
* GridEntry.cs, PropertyGridView.cs:
	   - Update the ReadOnly detection and rendering to finally hopefully
	   match the one of MSFT.
	   - Niceify and move the debug CWLS.
	[Fixes bug #409028]

svn path=/branches/mono-2-0/mcs/; revision=112464
2008-09-07 16:53:39 +00:00
Zoltan Varga b9dd5065b4 2008-09-06 Zoltan Varga <[email protected]>
* mini.h (MONO_AOT_FILE_VERSION): Bump this because of the arm AOT
	changes.

svn path=/branches/mono-2-0/mono/; revision=112439
2008-09-06 17:59:39 +00:00
Zoltan Varga 53ea73491e 2008-09-06 Zoltan Varga <[email protected]>
* pinvoke2.cs: Remove a stray Console.WriteLine.

svn path=/branches/mono-2-0/mono/; revision=112425
2008-09-06 14:13:37 +00:00
Zoltan Varga 676e17ac4b 2008-09-06 Zoltan Varga <[email protected]>
* libtest.c pinvoke2.cs: Add float tests.

svn path=/branches/mono-2-0/mono/; revision=112423
2008-09-06 14:10:17 +00:00
Zoltan Varga 742bd55cc3 2008-09-06 Zoltan Varga <[email protected]>
* mini.c (mono_spill_call): Handle pinvoke+soft float on arm.

svn path=/branches/mono-2-0/mono/; revision=112422
2008-09-06 14:06:47 +00:00
Zoltan Varga 8125642105 2008-09-06 Zoltan Varga <[email protected]>
* aot-runtime.c (mono_aot_get_method): Add another cache mapping wrapper
	methods to their code to avoid computing the full name of wrappers and
	doing a lookup in a string hash table.

svn path=/branches/mono-2-0/mono/; revision=112412
2008-09-06 03:01:59 +00:00
Atsushi Eno cac4a6fa87 backport r112408.
svn path=/branches/mono-2-0/mcs/; revision=112409
2008-09-05 23:57:44 +00:00
Zoltan Varga 808a676350 2008-09-06 Zoltan Varga <[email protected]>
* reflection.c (_mono_reflection_get_type_from_info): Revert the last change
	(r111766) as it is not needed after the no-exec changes.

svn path=/branches/mono-2-0/mono/; revision=112404
2008-09-05 22:05:45 +00:00
Ivan Zlatev 73e67e1db3 2008-09-04 Ivan N. Zlatev <[email protected]>
* GridEntry.cs, CategoryGridEntry.cs, RootGridEntry.cs, PropertyGrid.cs,
	PropertyGridView.sc: Implement lazy/delayed propertygrid population
	on item expansion. Improves performance and fixes bug #417955.
	[Fixes bug #417955]

svn path=/branches/mono-2-0/mcs/; revision=112370
2008-09-05 12:01:31 +00:00
Zoltan Varga 0bef4ef894 2008-09-05 Zoltan Varga <[email protected]>
* tramp-arm.c (mono_arch_nullify_class_init_trampoline): Implement this.
	(mono_arch_patch_plt_entry): Fix the calculation of the jump_entry.
	(mono_arch_get_nullified_class_init_trampoline): Return 'code' instead of
	'buf'.

	* aot-compiler.c (emit_plt): Fix the arm plt entries, previously they all 
	jumped to the same entry in plt_jump_table.

svn path=/branches/mono-2-0/mono/; revision=112337
2008-09-04 23:47:03 +00:00
Marek Safar 493446ce04 2008-09-04 Marek Safar <[email protected]>
A fix for bug #422853
	* delegate.cs (DelegateCreation): Add special handling for
	EmptyExpression.Null instance expression which is just another
	hack for undecided member instance exression.


svn path=/branches/mono-2-0/mcs/; revision=112272
2008-09-04 12:34:42 +00:00
Rodrigo Kumpera 9efbf70813 In .:
2008-09-03 Rodrigo Kumpera  <[email protected]>+ 
 	* verify.c (verify_type_compatibility_full): Revert change
 	to allow converting a native int to unmanaged pointer be verifiable
 	under non-strict mode.
 	It turns out that "(IntPtr)null" is indeed unverifiable, go figure.
 
 	* verify.c: Added some TODOs.
	(Ported from trunk)


svn path=/branches/mono-2-0/mono/; revision=112216
2008-09-03 22:05:48 +00:00
Marek Safar 4994a0b289 2008-09-03 Marek Safar <[email protected]>
A fix for bug #422507
	* expression.cs (UnboxCast): Add missing child expression mutator.


svn path=/branches/mono-2-0/mcs/; revision=112185
2008-09-03 15:25:39 +00:00
Ivan Zlatev cb9600b9b9 2008-09-03 Ivan N. Zlatev <[email protected]>
* ButtonBase.cs CheckBox.cs, Control.cs, FlowLayoutPanel.cs,
	  FlowLayoutSettings.cs, GroupBox.cs, Label.cs, ListBox.cs,
	  PropertyGrid.cs, RadioButton.cs, TableLayoutPanel.cs,
	  TableLayoutSettings.cs, ToolStrip.cs, ToolStripDropDownButton.cs,
	  ToolStripDropDownMenu.cs, ToolStripItem.cs, ToolStripSplitButton.cs,
	  ToolStripStatusLabel.cs: Add missing PerformLayout calls to various
	  properties.
	  [Fixes bug #418684]

svn path=/branches/mono-2-0/mcs/; revision=112175
2008-09-03 12:35:10 +00:00
Marek Safar 34c7e44150 2008-09-03 Marek Safar <[email protected]>
A fix for bug #422507
	* expression.cs (StringConcat): Add missing type mutator.


svn path=/branches/mono-2-0/mcs/; revision=112171
2008-09-03 11:59:33 +00:00
Bill Holmes 4cd4569ec6 2008-09-02 Bill Holmes <[email protected]>
Backport of r112125

	* marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi,
	  ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni) :
	  Changed to use GlobalAlloc for the memory returned on Windows platforms.

	Code is contributed under MIT/X11 license.

svn path=/branches/mono-2-0/mono/; revision=112128
2008-09-02 21:43:21 +00:00
Jonathan Pobst 93b9e20e3c 2008-09-02 Jonathan Pobst <[email protected]>
* XplatUIWin32.cs: Ensure we never send the WS_EX_MDICHILD flag
	to Windows when creating a window, as we fake MDI stuffs.
	[Fixes bug #421858]

svn path=/branches/mono-2-0/mcs/; revision=112096
2008-09-02 16:00:34 +00:00
Rodrigo Kumpera 28021d9e5c In .:
2008-09-02  Rodrigo Kumpera  <[email protected]>

	* method-to-ir.c (initialize_array_data): Handle field with RVA from
	dynamic images.
	(Ported from trunk)


svn path=/branches/mono-2-0/mono/; revision=112078
2008-09-02 11:50:22 +00:00
Rodrigo Kumpera d04c85fc8e In .:
2008-09-02 Rodrigo Kumpera  <[email protected]>

	* reflection.c (typebuilder_setup_fields): Handle classes with
	explicit size.
	(Ported from trunk)


svn path=/branches/mono-2-0/mono/; revision=112077
2008-09-02 11:49:03 +00:00
Rodrigo Kumpera beebac4e2e In Test/System.ComponentModel:
2008-09-02  Rodrigo Kumpera  <[email protected]>
	[Backport to 2.0]
	* PropertyDescriptorTest.cs: Tests for Get/Set Value of partial
	overrides of virtual properties.

In System.ComponentModel:
2008-09-02  Rodrigo Kumpera  <[email protected]>
	[Backport to 2.0]
	* ReflectionPropertyDescriptor.cs (SetValue, GetValue) : Lookup
	the MethodInfo for accessors in parent types in case of partial
	overrides of virtual properties.


svn path=/branches/mono-2-0/mcs/; revision=112074
2008-09-02 11:39:01 +00:00
Marek Safar 018c430733 Updated
svn path=/branches/mono-2-0/mcs/; revision=112046
2008-09-01 16:45:30 +00:00
Ivan Zlatev 723a933e9c 2008-09-01 Ivan N. Zlatev <[email protected]>
* TextBox.cs: Invalidate after UseSystemPasswordChar, so that the
	change takes effect.
	[Fixes bug #417957]

svn path=/branches/mono-2-0/mcs/; revision=112042
2008-09-01 16:06:39 +00:00
Jb Evain 8cec72a31f backport r112039
svn path=/branches/mono-2-0/mcs/; revision=112040
2008-09-01 15:22:28 +00:00
Jb Evain ed3a8e8e12 backport 112034
svn path=/branches/mono-2-0/mcs/; revision=112035
2008-09-01 14:23:35 +00:00
Jb Evain 0eee593d3a backport r112032
svn path=/branches/mono-2-0/mcs/; revision=112033
2008-09-01 14:21:02 +00:00
Ivan Zlatev a0b8967951 2008-09-01 Ivan N. Zlatev <[email protected]>
* SettingsPropertyValue.cs: Explicitly use the Invariant culture
	instead of the current.
	[Fixes bug #374516]

svn path=/branches/mono-2-0/mcs/; revision=112028
2008-09-01 13:55:35 +00:00
Ivan Zlatev 4b5cb5b7ec 2008-09-01 Ivan N. Zlatev <[email protected]>
* ParentControlDesigner.cs: Be nice with Components that are no
	Controls in CreateToolCore.

svn path=/branches/mono-2-0/mcs/; revision=112024
2008-09-01 13:32:16 +00:00
Dick Porter 7c9abd6ea4 2008-09-01 Dick Porter <[email protected]>
* InotifyWatcher.cs: Revert fix for bug 322330, as it is somehow
	breaking other stuff.
	(Ported from trunk)



svn path=/branches/mono-2-0/mcs/; revision=112021
2008-09-01 13:28:24 +00:00
Ivan Zlatev 4b791f4ebf 2008-08-24 Ivan N. Zlatev <[email protected]>
* XplatUIX11.cs: Provide MouseButtons/State information to the XPlatUI.
        [Fixes bug #419001]

svn path=/branches/mono-2-0/mcs/; revision=112016
2008-09-01 12:16:42 +00:00
Marek Safar e61f5a6c0b 2008-09-01 Marek Safar <[email protected]>
A fix for bug #421736
	* iterators.cs: Don't crash on unreachable iterators.


svn path=/branches/mono-2-0/mcs/; revision=112014
2008-09-01 11:42:10 +00:00
Marek Safar 4576f262ca 2008-09-01 Marek Safar <[email protected]>
A fix for bug #421628
	* parameter.cs, attribute.cs: Clone also parameter attributes.


svn path=/branches/mono-2-0/mcs/; revision=112009
2008-09-01 10:23:54 +00:00
Marek Habersack 44f49f7e6d Backport of r112005
svn path=/branches/mono-2-0/mcs/; revision=112006
2008-09-01 02:30:50 +00:00
Marek Habersack 06de999787 Backport of r112003 + some forgotten ChangeLog entries
svn path=/branches/mono-2-0/mcs/; revision=112004
2008-09-01 01:33:52 +00:00
Marek Habersack e95d116ee3 Backport of r112000
svn path=/branches/mono-2-0/mcs/; revision=112001
2008-09-01 00:18:10 +00:00
Marek Habersack 24ff4f1c36 Backport of r111998
svn path=/branches/mono-2-0/mcs/; revision=111999
2008-08-31 23:31:09 +00:00
Zoltan Varga 8ecd99c009 Merge r111994 from HEAD.
svn path=/branches/mono-2-0/mcs/; revision=111996
2008-08-31 20:12:44 +00:00
Marek Habersack 667266be44 Backport of r111990
svn path=/branches/mono-2-0/mcs/; revision=111991
2008-08-31 17:05:47 +00:00
Zoltan Varga 71b2fac370 Revert last change as it breaks the build.
svn path=/branches/mono-2-0/mono/; revision=111986
2008-08-31 09:19:24 +00:00
Marek Habersack 94782a9675 Backport of r111983
svn path=/branches/mono-2-0/mcs/; revision=111984
2008-08-31 02:06:33 +00:00
Zoltan Varga 58f0695e8b 2008-08-31 Zoltan Varga <[email protected]>
* class.c (mono_class_is_assignable_from): Call mono_class_setup_vtable ()
	before accessing klass->interface_bitmap. Fixes #421744.

svn path=/branches/mono-2-0/mono/; revision=111981
2008-08-30 23:24:16 +00:00
Marek Habersack a0cd75d310 Backport of r111956
svn path=/branches/mono-2-0/mcs/; revision=111957
2008-08-29 22:38:14 +00:00
Marek Habersack 5a6bb10f5c Backport of r111939
svn path=/branches/mono-2-0/mcs/; revision=111940
2008-08-29 19:43:16 +00:00
Geoff Norton cc104efec3 2008-08-29 Geoff Norton <[email protected]>
* aot-compiler.c: The Mach/ARM compiler doesn't understand the bss
        segment, and doesn't properly handle .space as .text.  Fixes
        AOT Mach/ARM

svn path=/branches/mono-2-0/mono/; revision=111931
2008-08-29 17:56:59 +00:00
Geoff Norton f40f665d9b 2008-08-29 Geoff Norton <[email protected]>
* mini.c: Disable the mach exception handler when running on
        ARM

svn path=/branches/mono-2-0/mono/; revision=111928
2008-08-29 15:32:34 +00:00
Geoff Norton 8e2e6c1909 2008-08-29 Geoff Norton <[email protected]>
* aot-compiler.c: Patch from Renaldas Zioma to properly register
        globals on Darwin/ARM

svn path=/branches/mono-2-0/mono/; revision=111923
2008-08-29 14:27:23 +00:00
Marek Habersack 8980b35c17 Backport of r111916
svn path=/branches/mono-2-0/mcs/; revision=111917
2008-08-29 13:08:12 +00:00
Dick Porter 8325c4c78e 2008-07-28 Dick Porter <[email protected]>
* Process.cs: When passing handle references around, it needs to
	be duplicated and freed so the OS doesn't close it.  Makes the
	testcase in 410743 work again now the underlying bug has been
	fixed.
	(Ported from trunk.)



svn path=/branches/mono-2-0/mcs/; revision=111900
2008-08-29 09:26:58 +00:00
Dick Porter e186bdfb4b 2008-08-29 Dick Porter <[email protected]>
* icall-def.h
	* process.c
	(ves_icall_System_Diagnostics_Process_ProcessHandle_duplicate):
	New internal calls to duplicate and close a process handle.
	(Ported from trunk)



svn path=/branches/mono-2-0/mono/; revision=111899
2008-08-29 09:25:17 +00:00
Bill Holmes 208de0f8ac 2008-08-28 Bill Holmes <[email protected]>
Backport of r111875

	* src/glib.h : Adding a c++ definition for G_BEGIN_DECLS.

	Contributed under MIT/X11 license.

svn path=/branches/mono-2-0/mono/; revision=111876
2008-08-28 20:55:01 +00:00
Geoff Norton 1eaf76f83a 2008-08-28 Geoff Norton <[email protected]>
* build-iphone.sh: iPhone lies about HAVE_MMAP as well.

svn path=/branches/mono-2-0/mono/; revision=111871
2008-08-28 20:40:57 +00:00
Geoff Norton 84ad52dda7 2008-08-28 Geoff Norton <[email protected]>
* darwin_stop_world.c:
        * include/private/gcconfig.h: Add support for Darwin/ARM

svn path=/branches/mono-2-0/mono/; revision=111870
2008-08-28 20:40:52 +00:00
Zoltan Varga 3afcd622ea Merge r111867 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=111868
2008-08-28 20:24:00 +00:00
Zoltan Varga ecf4d5fec4 Merge r111865 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=111866
2008-08-28 20:19:11 +00:00
Zoltan Varga 191a0b7c13 Merge r111861 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=111862
2008-08-28 19:40:46 +00:00
Zoltan Varga b428cee93f Merge r111859 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=111860
2008-08-28 19:37:29 +00:00
Miguel de Icaza 75d83b4784 Add here as well
svn path=/branches/mono-2-0/mcs/; revision=111852
2008-08-28 17:54:30 +00:00
Miguel de Icaza 33a4ce27ab Backport console fixes to 2.0
svn path=/branches/mono-2-0/mcs/; revision=111850
2008-08-28 17:46:03 +00:00
Miguel de Icaza b7fbf894c5 Backport console fixes to 2.0
svn path=/branches/mono-2-0/mono/; revision=111849
2008-08-28 17:45:52 +00:00
Zoltan Varga 733791ff24 Merge the wapi handle leak fix from HEAD.
svn path=/branches/mono-2-0/mono/; revision=111810
2008-08-28 13:54:41 +00:00
Zoltan Varga 462f7da2b9 Merge r111807 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=111808
2008-08-28 13:53:01 +00:00
Marek Safar 9b58fb9ab7 2008-08-28 Marek Safar <[email protected]>
A fix for bug #420832
	* anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.


svn path=/branches/mono-2-0/mcs/; revision=111804
2008-08-28 13:33:01 +00:00
Marek Habersack 1c8879f557 Backport of r111801
svn path=/branches/mono-2-0/mcs/; revision=111802
2008-08-28 13:13:53 +00:00
Marek Safar 17da99ccab 2008-08-28 Marek Safar <[email protected]>
A fix for bug #420386
	* nullables.cs: Fixed logic of nullable user comparison operators involving
	null values.


svn path=/branches/mono-2-0/mcs/; revision=111798
2008-08-28 11:07:12 +00:00
Marek Safar c64179faa5 2008-08-28 Marek Safar <[email protected]>
* attribute (IsClsCompliant): Use FALSE value for pointer types.


svn path=/branches/mono-2-0/mcs/; revision=111795
2008-08-28 10:10:25 +00:00
Zoltan Varga 6d32218cb8 Merge r111774 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=111775
2008-08-28 01:40:18 +00:00
Marek Habersack 6262c11cfc Backport of r111772
svn path=/branches/mono-2-0/mcs/; revision=111773
2008-08-28 01:36:08 +00:00
Zoltan Varga 412d92d596 Merge r111770 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=111771
2008-08-28 01:35:46 +00:00
Zoltan Varga bfcdea1305 Merge r111765 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=111768
2008-08-28 01:23:01 +00:00
Zoltan Varga ab453faffe Merge r111766 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=111767
2008-08-28 01:19:21 +00:00
Zoltan Varga 62bf373fea Merge r111759 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=111760
2008-08-28 00:04:52 +00:00
Zoltan Varga 4136d5da76 Merge r111748-r111752 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=111758
2008-08-27 23:42:34 +00:00
Zoltan Varga 9c81677a33 Merge r111755 from HEAD.
svn path=/branches/mono-2-0/mcs/; revision=111757
2008-08-27 23:38:56 +00:00
Zoltan Varga fc363fc7a6 Merge r111754 from HEAD.
svn path=/branches/mono-2-0/mcs/; revision=111756
2008-08-27 23:36:22 +00:00
Bill Holmes c221d6c0e8 2008-08-27 Bill Holmes <[email protected]>
Backport of r111724.

	* mini-amd64.h : Fix a compiler warning.

	* exceptions-amd64.c (mono_arch_unwindinfo_install_unwind_info) :
	  Changed to use a callback function to retrieve the unwind info.
	  This avoids problems observed when code blocks were removed by
	  unloading an app domain.

	* mini-amd64.c (mono_arch_cpu_optimizazions) : Removing the peephole 
	  and branch excludes for Winx64.  The fix in exceptions-amd64.c allows them
	  to work properly.

	Contributed under MIT/X11 license.

svn path=/branches/mono-2-0/mono/; revision=111729
2008-08-27 18:18:35 +00:00
Bill Holmes 47932d265a 2008-08-27 Bill Holmes <[email protected]>
Backport of r111722.

	* mini-amd64.c (mono_arch_output_basic_block) : Fix the OP_X86_PUSH_OBJ
	  case to keep the stack aligned to 8.

	Contributed under MIT/X11 license.

svn path=/branches/mono-2-0/mono/; revision=111728
2008-08-27 18:15:59 +00:00
Zoltan Varga e2c37e98bf Merge r111681 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=111682
2008-08-27 03:30:26 +00:00
Veerapuram Varadhan 6eedd08ed8 Do not call GetSchemaTable() from the constructor, instead fetch column
information.


svn path=/branches/mono-2-0/mcs/; revision=111651
2008-08-26 19:42:05 +00:00
Veerapuram Varadhan 060406f25e Handle binary type along with VarBinary and Image
svn path=/branches/mono-2-0/mcs/; revision=111645
2008-08-26 19:23:11 +00:00
Veerapuram Varadhan dc60cf7ea6 Test case for testing binary type
svn path=/branches/mono-2-0/mcs/; revision=111644
2008-08-26 19:21:49 +00:00
Zoltan Varga 24575d5e57 Merge r111641 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=111642
2008-08-26 19:12:21 +00:00
Zoltan Varga 6f6a2135b5 Merge r111637 from HEAD.
svn path=/branches/mono-2-0/mcs/; revision=111639
2008-08-26 18:47:41 +00:00
Geoff Norton 06c53dfc80 Whoops
svn path=/branches/mono-2-0/mono/; revision=111638
2008-08-26 18:44:28 +00:00
Geoff Norton fdcba04ccc 2008-08-26 Geoff Norton <[email protected]>
* build-iphone.sh: Update build-iphone to not wget old inssel's, and build
        out of the box with teh current SDK.

svn path=/branches/mono-2-0/mono/; revision=111636
2008-08-26 18:19:35 +00:00
Jonathan Pobst 2ce934fbac 2008-08-26 Jonathan Pobst <[email protected]>
* ErrorProvider.cs: Fix a regression NRE when setting properties
	for a control before it has a parent.
	[Fixes bug #420305]

svn path=/branches/mono-2-0/mcs/; revision=111627
2008-08-26 16:35:35 +00:00
Jonathan Pobst 4b6092b945 2008-08-19 Jonathan Pobst <[email protected]>
* LinkLabel.cs: Always clear any previous links when LinkArea
	is set.  [Fixes bug #410709]

svn path=/branches/mono-2-0/mcs/; revision=111617
2008-08-26 14:25:38 +00:00
Veerapuram Varadhan c35c98a888 Backported from trunk - test case for bug#377146
svn path=/branches/mono-2-0/mcs/; revision=111613
2008-08-26 13:28:24 +00:00
Veerapuram Varadhan 1d05f4019d Backported from trunk - on demand generation of schemaTable and related
memory fixes


svn path=/branches/mono-2-0/mcs/; revision=111610
2008-08-26 13:17:08 +00:00
Veerapuram Varadhan 2c90f8215b Fix for 377146 - let the reference type's ReadXml do the reading, if it
implements IXmlSerializable


svn path=/branches/mono-2-0/mcs/; revision=111597
2008-08-26 10:18:25 +00:00
Scott Thomas 741b3708a6 Fixed bug 417833 which allowed for the creation of illegal
BitVector32.Sections. Also added a unit test for the bug.


svn path=/branches/mono-2-0/mcs/; revision=111592
2008-08-26 02:26:24 +00:00
Marek Habersack 88d78a139c Backport of r111589
svn path=/branches/mono-2-0/mcs/; revision=111590
2008-08-26 00:58:43 +00:00
Marek Habersack 9ecf430d4a Backport of r111587
svn path=/branches/mono-2-0/mcs/; revision=111588
2008-08-26 00:14:32 +00:00
Zoltan Varga 66fa2508f9 Merge r111576 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=111578
2008-08-25 21:33:52 +00:00
Marek Habersack a7d6f5e17f Backport of r111572
svn path=/branches/mono-2-0/mcs/; revision=111573
2008-08-25 20:39:49 +00:00
Zoltan Varga 6b8412c1d3 2008-08-25 Zoltan Varga <[email protected]>
* aot-compiler.c (add_method): Avoid adding a method twice.
	(add_wrappers): Add runtime invoke wrappers for all methods.

svn path=/branches/mono-2-0/mono/; revision=111541
2008-08-25 17:46:47 +00:00
Zoltan Varga 2641cfa52a 2008-08-25 Zoltan Varga <[email protected]>
* mini.c (mono_method_to_ir): Handle the !aot case in CEE_MONO_ICALL_ADDR.

svn path=/branches/mono-2-0/mono/; revision=111537
2008-08-25 15:06:35 +00:00
Atsushi Eno 4a05d3d046 backport r111535.
svn path=/branches/mono-2-0/mcs/; revision=111536
2008-08-25 14:58:12 +00:00
Marek Habersack dda14a7141 Backport of r111526
svn path=/branches/mono-2-0/mcs/; revision=111527
2008-08-25 10:48:41 +00:00
Zoltan Varga 9dbe7163c6 Merge r111497 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=111498
2008-08-24 12:34:50 +00:00
Zoltan Varga 4da72ac87d Merge rr111495 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=111496
2008-08-24 12:08:12 +00:00
Marek Habersack 965210d362 Backport of r111421
svn path=/branches/mono-2-0/mcs/; revision=111422
2008-08-22 20:52:01 +00:00
Zoltan Varga a2831a6759 Merge r111361 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=111362
2008-08-22 11:56:05 +00:00
Atsushi Eno ce7703f9ef backport r111349 and r111350.
svn path=/branches/mono-2-0/mcs/; revision=111351
2008-08-22 08:56:07 +00:00
Massimiliano Mantione e611b35bc9 * mono.1: Updated description of the logging profiler from trunk.
svn path=/branches/mono-2-0/mono/; revision=111345
2008-08-22 07:28:00 +00:00
Massimiliano Mantione 6ae3bec0b6 * mono-profiler-logging.c: Backported fixes from trunk (making it
identical to r111250):
        - r111250 (correct accounting of allocations happening at JIT time).
        - r111096 (emit directives blocks).
        - r111095 (stack tracking).
        - r109120 (fix bug 412473).
        - r109069 (fix allocation summaries).
        - r108633 (emit full type names for loaded classes, by Rodrigo Kumpera).
        - r108632 (use the "runtime initialized" hook to register the thread).


svn path=/branches/mono-2-0/mono/; revision=111344
2008-08-22 07:26:58 +00:00
Bill Holmes e7a8f19764 2008-08-20 Bill Holmes <[email protected]>
Backport of r111197

	* exceptions-amd64.c (seh_handler):  For Winx64 adding missing copy 
	  of nonvolatile registers back from MonoContext to CONTEXT.

	Contributed under MIT/X11 license.

svn path=/branches/mono-2-0/mono/; revision=111209
2008-08-20 22:26:00 +00:00
Bill Holmes e7c42af958 2008-08-20 Bill Holmes <[email protected]>
Backport of r111194

	* mini-amd64.c (mono_arch_get_delegate_invoke_impl):  When shifting the
	  arguments on Winx64 there are only 4 argument registers.  For this
	  logic to work the last argument must be pulled from the stack.  

	Contributed under MIT/X11 license.

svn path=/branches/mono-2-0/mono/; revision=111206
2008-08-20 22:23:59 +00:00
Marek Habersack a0d26a1ecc Backport of r111122
svn path=/branches/mono-2-0/mcs/; revision=111123
2008-08-20 14:07:20 +00:00
Marek Habersack 23848fcfc6 Optimization of the bug #418620 fix, by Juraj Skripsky <[email protected]>, thanks!
svn path=/branches/mono-2-0/mcs/; revision=111108
2008-08-20 12:46:53 +00:00
Marek Habersack 8744beb65c Backport of r111103
svn path=/branches/mono-2-0/mcs/; revision=111104
2008-08-20 11:51:29 +00:00
Zoltan Varga 9b07470957 Merge r111051 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=111053
2008-08-20 01:42:54 +00:00
Marek Habersack 7ee3c559e3 Backport of r111024
svn path=/branches/mono-2-0/mcs/; revision=111025
2008-08-19 22:26:05 +00:00
Marek Habersack dc5b0de65a Backport of r110984
svn path=/branches/mono-2-0/mcs/; revision=110985
2008-08-19 19:47:56 +00:00
Zoltan Varga d5a9aafee6 2008-08-19 Zoltan Varga <[email protected]>
* mini-ia64.c (mono_arch_output_basic_block): Add OP_FCONV_TO_I.
	Fixes #418381.

svn path=/branches/mono-2-0/mono/; revision=110976
2008-08-19 18:55:43 +00:00
Marek Habersack e4ab1fe02c Backport of r110941
svn path=/branches/mono-2-0/mcs/; revision=110942
2008-08-19 12:54:35 +00:00
Marek Habersack ad05561854 Backport of r110932
svn path=/branches/mono-2-0/mcs/; revision=110933
2008-08-19 10:34:56 +00:00
Atsushi Eno be268ce1fa backport r110924.
svn path=/branches/mono-2-0/mcs/; revision=110925
2008-08-19 07:51:38 +00:00
Andreia Gaita 3c4a0853ca Revert r110884, these changes are not for the branch :P
svn path=/branches/mono-2-0/mcs/; revision=110893
2008-08-19 00:23:55 +00:00
Andreia Gaita 0c1e02a5fd * Assembly/AssemblyInfo.cs, ChangeLog,
Mono.WebBrowser/DOM/IAttribute.cs,
  Mono.WebBrowser/DOM/IElementCollection.cs,
  Mono.WebBrowser/DOM/IWindow.cs, Mono.WebBrowser/DOM/IDocument.cs,
  Mono.WebBrowser/DOM/IAttributeCollection.cs,
  Mono.WebBrowser/DOM/INodeList.cs,
  Mono.WebBrowser/DOM/IWindowCollection.cs,
  Mono.WebBrowser/DOM/INode.cs, Mono.WebBrowser/DOM/IElement.cs,
  Mono.WebBrowser/DOM/INavigation.cs,
  Mono.WebBrowser/DOM/IHistory.cs, Mono.WebBrowser/Exception.cs,
  Mono.WebBrowser/IWebBrowser.cs, Mono.Mozilla/DOM/Document.cs,
  Mono.Mozilla/DOM/HTMLElement.cs,
  Mono.Mozilla/DOM/AttributeCollection.cs,
  Mono.Mozilla/DOM/DocumentType.cs, Mono.Mozilla/DOM/NodeList.cs,
  Mono.Mozilla/DOM/WindowCollection.cs, Mono.Mozilla/DOM/Node.cs,
  Mono.Mozilla/DOM/NamedNodeMap.cs, Mono.Mozilla/DOM/Element.cs,
  Mono.Mozilla/DOM/HTMLElementCollection.cs,
  Mono.Mozilla/DOM/Navigation.cs, Mono.Mozilla/DOM/History.cs,
  Mono.Mozilla/DOM/Attribute.cs, Mono.Mozilla/DOM/DOMObject.cs,
  Mono.Mozilla/DOM/Window.cs, Mono.Mozilla/Callback.cs,
  Mono.Mozilla/AsciiString.cs, Mono.Mozilla/WebBrowser.cs,
  Mono.Mozilla/UniString.cs, Mono.Mozilla/Base.cs: Fix inconsistent
  newlines. Add eol-style property

svn path=/branches/mono-2-0/mcs/; revision=110884
2008-08-18 23:58:04 +00:00
Marek Habersack 0436f3c228 Backport of r110844
svn path=/branches/mono-2-0/mcs/; revision=110845
2008-08-18 19:49:29 +00:00
Marek Habersack 8eecfbc54b Backport of r110734
svn path=/branches/mono-2-0/mcs/; revision=110735
2008-08-18 14:28:01 +00:00
Marek Habersack a2470d9b12 Backport of r110722
svn path=/branches/mono-2-0/mcs/; revision=110723
2008-08-18 10:21:59 +00:00
Zoltan Varga 9abbb9bfa3 Merge r110653 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=110654
2008-08-16 15:04:13 +00:00
Ivan Zlatev 50c4040639 2008-08-16 Ivan N. Zlatev <[email protected]>
* GridEntry.cs: Leave the ICustomTypeDescriptor handling up to the
	ComponentModel layer, which will properly prioritize the attributes.
	Avoids wrong prioritization of duplicate attributes when retrieving
	the converter and editor.
	[Fixes bug #417729]

svn path=/branches/mono-2-0/mcs/; revision=110644
2008-08-16 11:19:21 +00:00
Ivan Zlatev 438bc0e3aa 2008-08-15 Ivan N. Zlatev <[email protected]>
* GridEntry.cs: Perform stricter check for the ParentEntry's
	PropertyDescriptor/PropertyOwner for the ICustomTypeDescriptor
	implementation.
	[Fixes bug #417567]

svn path=/branches/mono-2-0/mcs/; revision=110565
2008-08-15 12:38:51 +00:00
Zoltan Varga ed6dfed6f5 2008-08-14 Zoltan Varga <[email protected]>
* mini.c (mini_method_compile): Abort aot compilation for generic
	methods if generic sharing is disabled.
	
	* mini.c (mono_method_to_ir): Disable AOT for virtual calls requiring
	an mrgctx.

svn path=/branches/mono-2-0/mono/; revision=110524
2008-08-14 19:44:17 +00:00
Marek Habersack 9ddad195c6 Backport of r110516
svn path=/branches/mono-2-0/mcs/; revision=110517
2008-08-14 18:42:29 +00:00
Geoff Norton 29444d0002 2008-08-14 Geoff Norton <[email protected]>
* XplatUICarbon.cs: Track the ActiveWindow internally for GetActive().
        Don't prematurely display POPUP windows.  Fully fixed #393317.

svn path=/branches/mono-2-0/mcs/; revision=110513
2008-08-14 18:29:37 +00:00
Geoff Norton 079933816f 2008-08-14 Geoff Norton <[email protected]>
* WindowHandler.cs: Revert the change which didn't set ActiveWindow
        here and fix the problem in the driver.  Fully fixes #393317.

svn path=/branches/mono-2-0/mcs/; revision=110512
2008-08-14 18:29:33 +00:00
Marek Safar 950d95d519 2008-08-14 Marek Safar <[email protected]>
A fix for bug #417078
	* expression.cs: Emit correctly left side pointer operators.


svn path=/branches/mono-2-0/mcs/; revision=110469
2008-08-14 11:03:14 +00:00
Marek Habersack 2e21360c50 Backport of r110441
svn path=/branches/mono-2-0/mcs/; revision=110442
2008-08-14 00:36:14 +00:00
Marek Habersack 8943e7e0d6 Backport of r110403
svn path=/branches/mono-2-0/mcs/; revision=110404
2008-08-13 20:39:34 +00:00
Marek Habersack cc3db58df7 Backport of r110389
svn path=/branches/mono-2-0/mcs/; revision=110390
2008-08-13 18:17:30 +00:00
Marek Habersack 7e1e70827a Backport of r110385
svn path=/branches/mono-2-0/mcs/; revision=110386
2008-08-13 17:51:09 +00:00
Bill Holmes 466e31790f 2008-08-13 Bill Holmes <[email protected]>
* winconfig.h:  Updating the config file for MSVC builds to match
 	  the config file used when compiling with gcc in Cygwin.

	* eglib.vcproj, genmdesc.vcproj, libgc.vcproj, libmono.vcproj, libtest.vcproj,
	  mono.vcproj, monoburg.vcproj, monodiet.vcproj, monodis.vcproj, monograph.vcproj,
	  pedump.vcproj, test_eglib.vcproj, teste.vcproj, test-invoke.vcproj,
	  test-metadata.vcproj:  Updating the preprocessor definitions for MSVC builds to
	  match the gcc build in Cygwin.

	* mini-amd64.c (mono_arch_cpu_optimizazions):  Remove peephole and branch
	  from default optimizaton list on Winx64.

	* mini-amd64.c (emit_tls_get):  Added Winx64 specific implementation for GetTLS.

	* mini-amd64.c (mono_arch_emit_prolog):  Adding an offset on Winx64 to get
	  the LMF from the MonoJitTlsData structure.

	* mini-amd64.c (mono_arch_setup_jit_tls_data):  Added Winx64 implementation.

	Contributed under MIT/X11 license.

svn path=/branches/mono-2-0/mono/; revision=110378
2008-08-13 16:41:20 +00:00
Zoltan Varga 5405ae9046 2008-08-12 Zoltan Varga <[email protected]>
* driver.c (main_thread_handler): Allow AOT compilation of multiple 
	assemblies in one run.

	* aot-compiler.c (mono_compile_assembly): Only print out a count of
	skipped methods if it is not 0.

svn path=/branches/mono-2-0/mono/; revision=110308
2008-08-12 21:48:51 +00:00
Zoltan Varga d7b1a66b94 Merge r110288 from HEAD.
svn path=/branches/mono-2-0/mcs/; revision=110291
2008-08-12 19:46:06 +00:00
Geoff Norton 7b06e01c8f 2008-08-12 Geoff Norton <[email protected]>
* pthread_support.c: GCC shipped with SLES9 ppc gets confused with our current
        GC_setspecific define.  Unfold the define into a static inline on all platforms
        except ppc where it is a static leaf function.

svn path=/branches/mono-2-0/mono/; revision=110287
2008-08-12 19:33:24 +00:00
Zoltan Varga efb68a566b Really fix the build.
svn path=/branches/mono-2-0/mono/; revision=110286
2008-08-12 19:30:16 +00:00
Miguel de Icaza 1ea3cc4cf0 Fix the build
svn path=/branches/mono-2-0/mono/; revision=110267
2008-08-12 17:22:20 +00:00
Carlos Alberto Cortez 2387e7270d * XplatUIX11.cs: Handle the obscured regions while scrolling using
GraphicsExpose event, processing it just after we copy the scrolled
	area. This ensures that the next calls to ScrollWindow will copy
	regions already updated, and the scrolling will be smooth. Also remove
	the code that was trying to detect the obscured regions, since we are
	not using it anymore (too slow).

2008-08-12  Carlos Alberto Cortez <[email protected]>


svn path=/branches/mono-2-0/mcs/; revision=110252
2008-08-12 15:53:00 +00:00
Carlos Alberto Cortez dd49afdaf1 * ListBox.cs: Fix the -temporary- broken selection in ListBox for
MultiExtended mode, by separating some logic between the ctrl/shift
	handling. Also ignore any MouseMove events generated together with
	MouseDown events - we are only interested in the real motion event.
	Fixes part of #414963.

2008-08-12  Carlos Alberto Cortez <[email protected]>


svn path=/branches/mono-2-0/mcs/; revision=110250
2008-08-12 15:33:42 +00:00
Carlos Alberto Cortez 59b3a649d5 2008-08-12 Carlos Alberto Cortez <[email protected]>
* XplatUIX11.cs: When getting EnterNotify with mode other than
	NotifyNormal (pseudo motion events), ignore them as we used to do
	before, since it's breaking our selection code and some drag and drop
	operations, because of the confusion of generating extra events (not
	fired by .net, btw).


svn path=/branches/mono-2-0/mcs/; revision=110246
2008-08-12 15:19:07 +00:00
Zoltan Varga c5fd486b84 2008-08-12 Zoltan Varga <[email protected]>
* mini-amd64.c (emit_call_body): Use image->aot_module instead of 
	assembly->aot_module.

	* aot-runtime.c: Use image->aot_module instead of searching in the aot_modules
	hash table. This simplifies and speeds up a lot of code, and fixes support
	for .netmodules.

svn path=/branches/mono-2-0/mono/; revision=110237
2008-08-12 14:15:45 +00:00
Zoltan Varga 637aa4c949 Merge r110233 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=110234
2008-08-12 14:12:13 +00:00
Zoltan Varga 5db35126ad Merge r110229 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=110230
2008-08-12 13:03:09 +00:00
Zoltan Varga 7b270fecd9 Merge r110156-r110157 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=110158
2008-08-11 20:07:32 +00:00
Marek Habersack 4e6fe443a2 Backport of r110125
svn path=/branches/mono-2-0/mcs/; revision=110126
2008-08-11 17:05:13 +00:00
Marek Habersack b2882b35e8 Backport of r110121
svn path=/branches/mono-2-0/mcs/; revision=110122
2008-08-11 16:14:04 +00:00
Zoltan Varga 1c482a505c Merge r110066 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=110067
2008-08-10 11:30:40 +00:00
Jonathan Pobst d14e5c26e2 2008-08-08 Jonathan Pobst <[email protected]>
* DataGridViewCell.cs: Guard against an AOORE when checking if a cell
	is selected.  [Fixes bug #414143]

svn path=/branches/mono-2-0/mcs/; revision=110025
2008-08-08 20:45:37 +00:00
Zoltan Varga de071f89a0 2008-08-08 Zoltan Varga <[email protected]>
* aot-compiler.c (mono_aot_parse_options): Disable no-dlsym option for now.

svn path=/branches/mono-2-0/mono/; revision=109973
2008-08-08 15:23:07 +00:00
Zoltan Varga 2ddeac257f Merge r109971 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=109972
2008-08-08 15:18:27 +00:00
Zoltan Varga 00c96e5ee1 2008-08-08 Zoltan Varga <[email protected]>
* marshal.c (mono_remoting_wrapper): Handle nullable types correctly.
	Fixes #415621.

	Backported from trunk.

svn path=/branches/mono-2-0/mono/; revision=109969
2008-08-08 14:59:54 +00:00
Zoltan Varga 939f5b706d 2008-08-08 Zoltan Varga <[email protected]>
* mini.c (mono_resolve_patch_target): Don't error out on missing icalls
	while aot compiling.

svn path=/branches/mono-2-0/mono/; revision=109966
2008-08-08 14:34:35 +00:00
Zoltan Varga a549de0c98 Fix a typo.
svn path=/branches/mono-2-0/mono/; revision=109965
2008-08-08 14:11:51 +00:00
Zoltan Varga e4767b2ed7 2008-08-08 Zoltan Varga <[email protected]>
* mini.c driver.c aot-compiler.c: Update after changes to 
	mono_marshal_get_native_wrapper () signature changes.

	* mini.c (mono_resolve_patch_target): Error out if an icall is not found.
	(mono_method_to_ir): Handle new CEE_MONO_ICALL_ADDR opcode.

svn path=/branches/mono-2-0/mono/; revision=109963
2008-08-08 13:50:44 +00:00
Zoltan Varga e336bccc7a 2008-08-08 Zoltan Varga <[email protected]>
* marshal.c (mono_marshal_get_native_wrapper): Add an 'aot' argument, when
	it is set, looking up the icall address is deferred to the JIT, since 
	in embedded scenarios, the icall might not be registered in the runtime
	doing the AOT compilation.

svn path=/branches/mono-2-0/mono/; revision=109962
2008-08-08 13:48:24 +00:00
Zoltan Varga 5b5f567690 2008-08-08 Zoltan Varga <[email protected]>
* cil-opcodes.xml: Add an 'icall_addr' opcode.

svn path=/branches/mono-2-0/mono/; revision=109960
2008-08-08 13:45:45 +00:00
Marek Habersack 46184895e1 Backport of r109952
svn path=/branches/mono-2-0/mcs/; revision=109953
2008-08-08 09:52:47 +00:00
Jb Evain 8b4bde4713 backport r109948
svn path=/branches/mono-2-0/mcs/; revision=109949
2008-08-08 08:43:10 +00:00
Marek Habersack 8e21b187db Backport of r109922
svn path=/branches/mono-2-0/mcs/; revision=109923
2008-08-08 00:37:19 +00:00
Zoltan Varga 2557c91607 2008-08-07 Zoltan Varga <[email protected]>
* aot-runtime.c (load_named_code): Pass the sofile to find_symbol, not the
	MonoAotModule.

svn path=/branches/mono-2-0/mono/; revision=109915
2008-08-07 21:45:49 +00:00
Zoltan Varga 480b7f5d7b 2008-08-07 Zoltan Varga <[email protected]>
* exceptions-arm.c (mono_arch_get_throw_exception_generic): Add aot
	support.

	* aot-runtime.c (load_named_code): Handle 'mono_arm_throw_exception'.

	* mini-arm.c (mono_arch_register_lowlevel_calls): Register 
	mono_arm_throw_exception as a jit icall.

svn path=/branches/mono-2-0/mono/; revision=109912
2008-08-07 21:19:37 +00:00
Zoltan Varga 6629632a6a 2008-08-07 Zoltan Varga <[email protected]>
* exceptions-arm.c (mono_arch_get_throw_exception_generic): Add aot
	support.

	* aot-runtime.c (load_named_code): Handle 'mono_arm_throw_exception'.

	* mini-arm.c (mono_arch_register_lowlevel_calls): Register 
	mono_arm_throw_exception as a jit icall.

svn path=/branches/mono-2-0/mono/; revision=109911
2008-08-07 21:19:13 +00:00
Gert Driesen 9f99215160 * TestIcon.cs: Add test case for bug #410608.
* Makefile: Add 323511.ico.
* Icon.cs (InitFromStreamWithSize): Move init of iconDir.idCount
and imageData until after the number of entries was determined to
cope with skipping of 256x256 icons. Fixes bug #410608.
* TestIcon.cs: Ignore test for bug #410608 on Unix, since it depends
on bug #323511.

svn path=/branches/mono-2-0/mcs/; revision=109881
2008-08-07 17:27:23 +00:00
Ivan Zlatev 278f836939 2008-08-07 Ivan N. Zlatev <[email protected]>
* GridEntry.cs: Check if current property is a ICustomTypeDescriptor
	and not the parent one (the propertyowner). Fixes the behavior of
	GetConverter/GetEditor.
	[Fixes bug #415452]

svn path=/branches/mono-2-0/mcs/; revision=109865
2008-08-07 14:44:32 +00:00
Ivan Zlatev e2bac9878f 2008-08-07 Ivan N. Zlatev <[email protected]>
* PropertyGrid.cs: Refresh should also repopulate the PropertyGrid.
	[Fixes part of bug #415452]

svn path=/branches/mono-2-0/mcs/; revision=109863
2008-08-07 14:41:02 +00:00
Jb Evain f275b6e485 backport 109858
svn path=/branches/mono-2-0/mcs/; revision=109859
2008-08-07 13:50:14 +00:00
Andreia Gaita bf926e9d96 * System.Windows.Forms/WebBrowser.cs: Remove extraneous CWL. Fixes
#411372 (partially)

svn path=/branches/mono-2-0/mcs/; revision=109838
2008-08-07 09:34:51 +00:00
Marek Habersack 6371e5446d Backport of r109776
svn path=/branches/mono-2-0/mcs/; revision=109777
2008-08-06 18:26:10 +00:00
Marek Habersack e6553234a6 Backport of r109773
svn path=/branches/mono-2-0/mcs/; revision=109774
2008-08-06 18:18:21 +00:00
Zoltan Varga f85a872195 2008-08-06 Zoltan Varga <[email protected]>
* aot-compiler.c (mono_compile_assembly): Correct the computation of 
	acfg->nmethods.
	(add_wrappers): Don't emit jit icall wrappers etc. into every image.

svn path=/branches/mono-2-0/mono/; revision=109760
2008-08-06 15:38:21 +00:00
Zoltan Varga bcd23c2ce3 Merge r109756 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=109757
2008-08-06 13:32:13 +00:00
Carlos Alberto Cortez f243f57580 2008-08-06 Carlos Alberto Cortez <[email protected]>
* ListBox.cs: Selection changes made in the MouseDown handler should
	use the *Core versions of selection in SelectedIndices collection,
	since the SelectedIndexChanged/SelectedValueChanged events are fired
	until we get a MouseUp event, and thus we need to separate the logic
	from the events, as done in the keyboard navigation. Also, fire those
	selection events from keyboard navigation in SelectionMode.None, even
	if we don't have a selection, as .Net does.


svn path=/branches/mono-2-0/mcs/; revision=109749
2008-08-06 12:03:42 +00:00
Zoltan Varga 2eab3e93ec Merge r109506 from HEAD.
svn path=/branches/mono-2-0/mcs/; revision=109746
2008-08-06 10:55:39 +00:00
Ivan Zlatev 2f5dd747db 2008-08-05 Ivan N. Zlatev <[email protected]>
* ApplicationSettingsBase.cs: If there is no explicit
	SettingsSerializeAs attribute to specify the format, distinguish
	between plain string and XML by checking if the TypeConverter for the
	property type supports string conversions. If it doesn't then we are
	present with XML.
	[Fixes bug #414445]

svn path=/branches/mono-2-0/mcs/; revision=109707
2008-08-05 20:39:48 +00:00
Ivan Zlatev 9b21552888 2008-08-05 Ivan N. Zlatev <[email protected]>
* GridEntry.cs: ITypeDescriptorContext should be relative to the parent
	GridEntry, not the current.
	[Fixes bug #413896]

svn path=/branches/mono-2-0/mcs/; revision=109684
2008-08-05 14:38:40 +00:00
Ivan Zlatev 130cc0265e 2008-08-04 Ivan N. Zlatev <[email protected]>
* TextBoxBase.cs: De-internalize max_length field.
	* RichTextBox.cs: Use base.MaxLength - both TextBoxBase and RichTextBox
	share the same logic.
	[Fixes bug #414454]

svn path=/branches/mono-2-0/mcs/; revision=109615
2008-08-04 20:32:51 +00:00
Zoltan Varga 1aa65b49b5 2008-08-04 Zoltan Varga <[email protected]>
* socket-io.c (get_socket_assembly): Make 'moonlight' variable static.

svn path=/branches/mono-2-0/mono/; revision=109605
2008-08-04 18:58:40 +00:00
Geoff Norton 3d4af0a3ca 2008-08-01 Geoff Norton <[email protected]>
* CarbonCursor.cs: If the window doesn't have a cursor set, revert
        to the default.  Fixes #411114.

svn path=/branches/mono-2-0/mcs/; revision=109603
2008-08-04 18:56:14 +00:00
Geoff Norton 34a36c6021 2008-07-31 Geoff Norton <[email protected]>
* XplatUICarbon.cs: Properly implement PeekMessage and DoEvents
	Fixes #396983

svn path=/branches/mono-2-0/mcs/; revision=109602
2008-08-04 18:56:06 +00:00
Geoff Norton f544ec6a5a 2008-07-31 Geoff Norton <[email protected]>
* WindowHandler.cs: Dont set ActiveWindow when emitting the event,
	its set when the event is handled.  Fixes #393317.

svn path=/branches/mono-2-0/mcs/; revision=109601
2008-08-04 18:56:02 +00:00
Bill Holmes dadc02c527 2008-08-04 Bill Holmes <[email protected]>
* src/glib.h : Changing the allocation routines to return null if 0 size is
	  passed in.

	Contributed under MIT/X11 license.

svn path=/branches/mono-2-0/mono/; revision=109561
2008-08-04 13:25:28 +00:00
Zoltan Varga b1d2757f8e Merge r109521 from HEAD.
svn path=/branches/mono-2-0/mcs/; revision=109531
2008-08-03 17:49:59 +00:00
Zoltan Varga 87f3f3d032 Merge r109511 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=109512
2008-08-03 15:35:26 +00:00
Zoltan Varga a93743339f Merge r109502 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=109503
2008-08-03 00:20:07 +00:00
Carlos Alberto Cortez 7faba06720 2008-08-01 Carlos Alberto Cortez <[email protected]>
* ListBindingHelperTest.cs: New test for GetList receiving an IEnumerable
	object which return instances of ICustomTypeDescriptor instances,
	instead of actual items.


svn path=/branches/mono-2-0/mcs/; revision=109443
2008-08-01 15:32:18 +00:00
Carlos Alberto Cortez 652318a44d 2008-08-01 Carlos Alberto Cortez <[email protected]>
* DateTimePicker.cs: 
	* ThemeWin32Classic.cs: Add a editing capability to DateTimePicker, in
	order to set the value as required (which means: when selection
	changes for a part being edited, and not before that if not needed).
	Also use an enum to describe which part are we using, and use the
	selection as a property in PartData, in order to notify the
	DateTimePicker owner that we need to end the current edit.
	Fixes #383462.


svn path=/branches/mono-2-0/mcs/; revision=109442
2008-08-01 15:29:16 +00:00
Carlos Alberto Cortez 724f0a6d4e * ThemeWin32Classic.cs: Don't draw ListViewSubItem instances from
DrawListViewItem - we need to reuse the main item's drawing for the
	first sub item in case owner draw is true, but wants the system to
	do the default draw for the first sub item, without incurring in a
	recursion problem.
	Fixes #410880.

2008-08-01  Carlos Alberto Cortez <[email protected]>


svn path=/branches/mono-2-0/mcs/; revision=109441
2008-08-01 15:19:55 +00:00
Carlos Alberto Cortez 5ebc3a5956 2008-08-01 Carlos Alberto Cortez <[email protected]>
* ListBindingHelper.cs: When looking for an object's properties, check
	if it implements ICustomTypeDescriptor, in which case we should
	resolve the propertu based on its GetProperties method, not in its
	actual properties. This is what .Net seems to do.
	Fixes a UsingWebBrowser problem during initialization.



svn path=/branches/mono-2-0/mcs/; revision=109440
2008-08-01 15:10:38 +00:00
Jonathan Pobst 76cb00959c 2008-08-01 Jonathan Pobst <[email protected]>
* ToolStripButton.cs, ToolStripMenuItem.cs: Guard against a NRE my
	last change introduced when an item is clicked but isn't on a toolstrip.

svn path=/branches/mono-2-0/mcs/; revision=109430
2008-08-01 14:42:06 +00:00
Zoltan Varga 3397f96efb 2008-07-31 Zoltan Varga <[email protected]>
* mini.h: Add a declaration for mono_aot_register_module ().

svn path=/branches/mono-2-0/mono/; revision=109375
2008-07-31 18:52:43 +00:00
Zoltan Varga 8c24850ae5 2008-07-31 Zoltan Varga <[email protected]>
* aot-compiler.c aot-runtime.c: Merge some mach changes from Renaldas Zioma.

svn path=/branches/mono-2-0/mono/; revision=109368
2008-07-31 18:12:05 +00:00
Zoltan Varga 95974cdb7a Merge r109366 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=109367
2008-07-31 17:51:01 +00:00
Zoltan Varga 8722a70b7a 2008-07-31 Zoltan Varga <[email protected]>
* debug-debugger.c (MONO_DEBUGGER__debugger_info): Fix a warning.

	* aot-compiler.c aot-runtime.c: Add a 'static' option to generate aot files
	which can be statically linked into an executable.

svn path=/branches/mono-2-0/mono/; revision=109365
2008-07-31 17:40:04 +00:00
Jonathan Pobst e6e4288c5b 2008-07-31 Jonathan Pobst <[email protected]>
* ToolStrip.cs: Fix an NRE caused by clicking on a ToolStripButton
	sitting on a MenuStrip.

svn path=/branches/mono-2-0/mcs/; revision=109357
2008-07-31 16:10:15 +00:00
Dean Brettle 5bbfe2090e ++ System.Web.UI.HtmlControls/ChangeLog (working copy)
* HtmlControl.cs (PreProcessRelativeReference), 
	HtmlForm.cs (RenderAttributes), HtmlInputButton (RenderAttributes),
	HtmlInputRadioButton (RenderAttributes), HtmlSelect (RenderChildren):
	Encode attributes that could contain HTML special chars.
	
	* HtmlSelect (RenderChildren): HTML-encode option text.

++ Test/System.Web.UI.HtmlControls/ChangeLog	(working copy)

	* HtmlInputButtonTest.cs, HtmlImageTest.cs, HtmlFormTest.cs, 
	HtmlInputRadioButtonTest.cs, HtmlSelectTest.cs:	Added tests 
	for HTML-encoded of attributes. 


svn path=/branches/mono-2-0/mcs/; revision=109348
2008-07-31 14:31:31 +00:00
Bill Holmes f9427d49b1 2008-07-31 Bill Holmes <[email protected]>
* marshal.c (cominterop_get_native_wrapper) : Backport of r109343.
	  Adding a call to mono_class_setup_methods if the methods are not
	  initialized.

	Code is contributed under MIT/X11 license.

svn path=/branches/mono-2-0/mono/; revision=109347
2008-07-31 14:07:25 +00:00
Bill Holmes 8561c8042c 2008-07-31 Bill Holmes <[email protected]>
* aot-compiler.c : Backport of r108759.  Fix win32 build.

	Contributed under MIT/X11 license.

svn path=/branches/mono-2-0/mono/; revision=109346
2008-07-31 13:58:01 +00:00
Everaldo Canuto d9334ab132 2008-07-30 Everaldo Canuto <[email protected]>
* MenuAPI.cs: Check for null GrabControl on ProcessMnemonic to prevent 
	runtime errors.


svn path=/branches/mono-2-0/mcs/; revision=109320
2008-07-30 22:58:47 +00:00
Rodrigo Kumpera 27810cca75 2008-07-30 Rodrigo Kumpera <[email protected]>
* verify.c: Remove some debug code I commited by accident.

	* verify.c (mono_method_is_valid_in_context): Change the return value
	to make possible to distinguish between invalid and unverifiable.

	* verify.c (verifier_load_method): Don't return NULL for unverifiable
	methods.

	Backported from trunk.



svn path=/branches/mono-2-0/mono/; revision=109302
2008-07-30 20:18:14 +00:00
Rodrigo Kumpera 38342a2028 2008-07-30 Rodrigo Kumpera <[email protected]>
* verify.c (mono_generic_param_is_constraint_compatible): Inflate type
	constraints. Fixes regression in gtest-253.

	Backported from trunk.



svn path=/branches/mono-2-0/mono/; revision=109292
2008-07-30 18:40:51 +00:00
Ivan Zlatev ab969071df 2008-07-30 Ivan N. Zlatev <[email protected]>
* Form.cs: Ensure that we reset the shown_raised flag after
	the form is closed, so that we raise the show events the next
	time the form is shown.
	[Fixes bug #413141]

svn path=/branches/mono-2-0/mcs/; revision=109289
2008-07-30 18:30:09 +00:00
Ivan Zlatev 121aafc036 2008-07-30 Ivan N. Zlatev <[email protected]>
* Form.cs: Ensure closing events are raised only once.
	[Fixes bug #413143]

svn path=/branches/mono-2-0/mcs/; revision=109287
2008-07-30 18:19:45 +00:00
Jonathan Pobst 01443d56f9 2008-07-29 Jonathan Pobst <[email protected]>
* ListBox.cs: Don't let the user set TopIndex so high that it
	scrolls up far enough to show empty items.
	[Fixes bug #412728]

2008-07-29  Jonathan Pobst  <[email protected]>

	* ListBox.cs: Add test for bug #412728.

svn path=/branches/mono-2-0/mcs/; revision=109279
2008-07-30 16:20:27 +00:00
Rodrigo Kumpera d349d3cf66 2008-07-30 Rodrigo Kumpera <[email protected]>
* verify.c (mono_verifier_verify_class): Don't allow generic types
	with explicit layout.

	* verify.c (mono_method_verify): Check locals and argument types.

	Backported from trunk.


svn path=/branches/mono-2-0/mono/; revision=109271
2008-07-30 15:40:49 +00:00
Ivan Zlatev 508eeb5266 2008-07-30 Ivan N. Zlatev <[email protected]>
* X11Keyboard.cs: Refactor SendKeyboardInput to accept the keycode,
	so that we can successfully generate the LParam in-place instead of
	in KeyEvent, which isn't called for e.g. MainMenu. Fixes keyboard
	navigation for menus.

svn path=/branches/mono-2-0/mcs/; revision=109251
2008-07-30 12:52:03 +00:00
Everaldo Canuto 9698eebc3a 2008-07-30 Everaldo Canuto <[email protected]>
* MenuAPI.cs: When montion don't set the keyboard navigation state to 
	'navigating'. Fixes bug #411356.

svn path=/branches/mono-2-0/mcs/; revision=109238
2008-07-30 06:55:26 +00:00
Everaldo Canuto bf0c63bdaf 2008-07-30 Everaldo Canuto <[email protected]>
[Fixed remaining issues of #406773 (#1)]
	* MenuItem.cs: UpdateMenuItem added to track the shotcut changes.

	* MenuAPI.cs: Don't create tracker on TrackPopupMenu, it will be created in
	MainMenu (already done) and ContextMenu creation.

	* ContextMenu.cs: Create tracker on construction.

svn path=/branches/mono-2-0/mcs/; revision=109232
2008-07-30 05:13:09 +00:00
Everaldo Canuto 1f4d704c06 2008-07-30 Everaldo Canuto <[email protected]>
* MenuAPI.cs: For ContextMenu set GrabControl on TrackPopupMenu, it make
	possible to instantiate MenuTracker without GrabControl.

svn path=/branches/mono-2-0/mcs/; revision=109229
2008-07-30 03:54:19 +00:00
Everaldo Canuto 0c2a768d04 2008-07-30 Everaldo Canuto <[email protected]>
* MenuAPI.cs: On constructor dont set the GrabControl for non ContextMenu.

	* MainMenu.cs: Set GrabControl on SetForm using current form.

svn path=/branches/mono-2-0/mcs/; revision=109227
2008-07-30 03:36:59 +00:00
Everaldo Canuto d4b59a0987 2008-07-30 Everaldo Canuto <[email protected]>
* MenuAPI.cs: Chage grab_control to GrabControl and make it public.

svn path=/branches/mono-2-0/mcs/; revision=109225
2008-07-30 03:18:33 +00:00
Everaldo Canuto d66bd40a5e 2008-07-30 Everaldo Canuto <[email protected]>
* MenuAPI.cs: Check if menu is activated before deactivate it in 
	ProcessShortcut.


svn path=/branches/mono-2-0/mcs/; revision=109223
2008-07-30 03:13:16 +00:00
Zoltan Varga 8ecd5784fc 2008-07-30 Zoltan Varga <[email protected]>
* SqliteParameterUnitTests.cs: Disable the random value insertion
	test as it fails randomly.

svn path=/branches/mono-2-0/mcs/; revision=109220
2008-07-30 01:46:45 +00:00
Ivan Zlatev 864017ae96 2008-07-30 Ivan N. Zlatev <[email protected]>
* TableLayoutStyleCollection, TableLayoutStyle.cs, RowStyle.cs,
	ColumnStyle.cs:
	Make the TableLayoutStyle owned by the the TableLayoutPanel, so that:
	 - One style instance can only participate in a single style collection.
	 - Styles can request their owner to layout whenever their properties
	 change.
	* TableLayoutTest.cs: Add tests for bug #412582
	 [Fixes bugs #412583 and #412582]

svn path=/branches/mono-2-0/mcs/; revision=109210
2008-07-29 22:05:48 +00:00
Ivan Zlatev 9fa61327c6 2008-07-29 Ivan N. Zlatev <[email protected]>
* X11Keyboard.cs: Implement the generation of the LParam for
	all keyboard messages.
	[Fixes bug #378728]

svn path=/branches/mono-2-0/mcs/; revision=109202
2008-07-29 20:31:24 +00:00
Massimiliano Mantione ac33be5c4f Call the new "runtime initialized" profiler hook (backported from r108631).
svn path=/branches/mono-2-0/mono/; revision=109177
2008-07-29 17:10:27 +00:00
Massimiliano Mantione 022cc2489d Added a new "runtime initialized" profiler hook (backport of r108630 from trunk).
svn path=/branches/mono-2-0/mono/; revision=109176
2008-07-29 17:04:58 +00:00
Dick Porter c9cd06e98c 2008-07-29 Dick Porter <[email protected]>
* processes.c (get_module_name): Make a last-ditch effort to
	figure out the process name.  Fixes bug 413723, patch by Casey
	Marshall <[email protected]>



svn path=/branches/mono-2-0/mono/; revision=109161
2008-07-29 14:18:35 +00:00
Marek Habersack d3c3b9817a Forgotten file
svn path=/branches/mono-2-0/mcs/; revision=109158
2008-07-29 13:02:55 +00:00
Marek Habersack 6574c4842c Backport of r109156
svn path=/branches/mono-2-0/mcs/; revision=109157
2008-07-29 13:02:45 +00:00
Marek Safar 35af91a654 2008-07-29 Marek Safar <[email protected]>
A fix for bug #412880 by Atsushi Enomoto <[email protected]>
	* modifiers.cs (GetDescription): Fixed FamANDAssem case.


svn path=/branches/mono-2-0/mcs/; revision=109151
2008-07-29 12:09:06 +00:00
Marek Safar 924eaae1b1 2008-07-29 Marek Safar <[email protected]>
A fix for bug #412595
	* cfold.cs: Don't cast undefined bool constant.


svn path=/branches/mono-2-0/mcs/; revision=109135
2008-07-29 10:16:37 +00:00
Martin Baulig 5c0653cc3b 2008-07-29 Martin Baulig <[email protected]>
* symbolwriter.cs
	(SymbolWriter.Reset): New public static method.

	* driver.cs
	(CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().


svn path=/branches/mono-2-0/mcs/; revision=109113
2008-07-29 07:20:29 +00:00
Martin Baulig 9b10d5247d 2008-07-29 Martin Baulig <[email protected]>
* compiler-tester.cs: Added `-compiler-options' command line
	argument to specify global compiler options in addition to the
	ones which are read from the test cases.


svn path=/branches/mono-2-0/mcs/; revision=109111
2008-07-29 07:15:44 +00:00
Zoltan Varga eed9f45d27 2008-07-29 Zoltan Varga <[email protected]>
* monitor.c (mono_monitor_try_enter_internal): Allow nterruption of the
	wait if the thread is in StopRequested state.

	Backported from trunk.

svn path=/branches/mono-2-0/mono/; revision=109083
2008-07-28 23:00:37 +00:00
Rodrigo Kumpera e938f4fad3 2008-07-28 Rodrigo Kumpera <[email protected]>
* verify.c (mono_type_is_valid_in_context): Improve the error message.
	Check both the type and it's generic type definition for loader errors.
	
	* verify.c (mono_method_is_valid_in_context): Don't generate another
	error when a type errors occur, this leads to the wrong exception been
	thrown.

	Backported from trunk.



svn path=/branches/mono-2-0/mono/; revision=109072
2008-07-28 19:53:45 +00:00
Atsushi Eno 47eb68cddb backport r109049.
svn path=/branches/mono-2-0/mcs/; revision=109050
2008-07-28 16:46:14 +00:00
Marek Habersack db68333eb7 Backport of r109040
svn path=/branches/mono-2-0/mcs/; revision=109041
2008-07-28 16:08:18 +00:00
Ivan Zlatev 3fd99b981e 2008-07-28 Ivan N. Zlatev <[email protected]>
* TableLayout.cs: MS adds rows instead of columns even when
	GrowStyle is AddColumns, but RowCount is 0.

svn path=/branches/mono-2-0/mcs/; revision=109037
2008-07-28 15:50:37 +00:00
Rodrigo Kumpera d59ab90071 2008-07-28 Rodrigo Kumpera <[email protected]>
* verify.c: Implement constraint equivalence checking.
	This is required when a generic parameter is used as
	argument to a constrained one.

	Fixes #410637.

	Backported from trunk.


svn path=/branches/mono-2-0/mono/; revision=109029
2008-07-28 15:37:08 +00:00
Jonathan Pobst 8a7077c3fd 2008-07-28 Jonathan Pobst <[email protected]>
* ToolStripButton.cs: Update Checked for CheckOnClick before
	raising the Click event.  [Fixes bug #412505]

svn path=/branches/mono-2-0/mcs/; revision=109019
2008-07-28 15:11:53 +00:00
Marek Habersack fdb3f32aff Backport of r108992
svn path=/branches/mono-2-0/mcs/; revision=108993
2008-07-28 12:38:20 +00:00
Marek Habersack bf91fdc886 Backport of r108985
svn path=/branches/mono-2-0/mcs/; revision=108986
2008-07-28 11:43:37 +00:00
Marek Habersack afabc945e6 Backport of r108975
svn path=/branches/mono-2-0/mcs/; revision=108976
2008-07-28 08:21:14 +00:00
Atsushi Eno 2d6f641629 backport r108971.
svn path=/branches/mono-2-0/mcs/; revision=108972
2008-07-28 06:51:01 +00:00
Ivan Zlatev cbbb130a5f 2008-07-28 Ivan N. Zlatev <[email protected]>
* Form.cs: Remove some seems leftover code for non-TopLevel's
	CreateParams, which is breaking ClientSize sizing, because it
	removes the border window styles.

svn path=/branches/mono-2-0/mcs/; revision=108965
2008-07-27 21:21:57 +00:00
Zoltan Varga 47b637d576 2008-07-27 Zoltan Varga <[email protected]>
* debug-mini.c (mono_debug_close_method): Avoid a crash if jit->this_var
	is not set.

svn path=/branches/mono-2-0/mono/; revision=108963
2008-07-27 20:17:00 +00:00
Ivan Zlatev 82d4d8a64c 2008-07-27 Ivan N. Zlatev <[email protected]>
* RootCodeDomSerializer.cs: Clear the fields as well.

svn path=/branches/mono-2-0/mcs/; revision=108962
2008-07-27 19:18:57 +00:00
Ivan Zlatev e29ff8407d 2008-07-27 Ivan N. Zlatev <[email protected]>
* PropertyGrid.cs: Invalidate the View when the PropertyTab
	changes.

svn path=/branches/mono-2-0/mcs/; revision=108960
2008-07-27 19:15:13 +00:00
Andreas Färber b2225d42ea Merge r108956 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=108957
2008-07-27 18:44:14 +00:00
Zoltan Varga 5e95510e6e Merge r108937 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=108939
2008-07-27 15:00:05 +00:00
Zoltan Varga a583e2b947 Merge r108887 from HEAD.
svn path=/branches/mono-2-0/mcs/; revision=108888
2008-07-27 00:08:55 +00:00
Dean Brettle a84f9e8fa3 ++ Test/mainsoft/ChangeLog (working copy)
* NunitWebResources/adapters.browser: added capabilities with 
	multiple substitutions and $ and % characters not associated
	with substitutions. 

++ Test/System.Web/ChangeLog	(working copy)

	* AppBrowsersTest.cs: Added tests for bug where capabilities 
	containing literal $ or % were dropped.  Added test for bug 
	where capabilities with multiple $ substitutions only
	had one applied.

++ System.Web.Configuration_2.0/ChangeLog	(working copy)

	* nBrowser/Node.cs nBrowser/Build.cs nBrowser/Identification.cs:
	Fixed race condition in Node.Process() by removing mutating 
	functions from Identification and changing Node.Process() and
	Node.BrowserIdentification() to maintain state in a List<Match>
	instead of a List<Identification>.
	
	* nBrowser/Node.cs: Fixed race condition associated with lookup of
	adapter types.
	
	* nBrowser/Node.cs: Removed duplicate call to 
	Node.BrowserIdentification() from Node.Process().

	* nBrowser/Node.cs: Removed duplicate call to Result.AddAdaper()
	from Node.Process().
	
	* nBrowser/Node.cs: Fixed bug where capabilities containing literal
	$ or % were dropped.

	* nBrowser/Node.cs: Fixed bug where capabilities with multiple $ 
	substitutions only had one applied.


svn path=/branches/mono-2-0/mcs/; revision=108858
2008-07-26 16:01:24 +00:00
Ivan Zlatev c10bca60c9 2008-07-26 Ivan N. Zlatev <[email protected]>
* TableLayout.cs: Perform layout even if they are no child controls, so
	that cell sizes are updated properly for the cell border painting.

svn path=/branches/mono-2-0/mcs/; revision=108825
2008-07-25 21:17:31 +00:00
Ivan Zlatev 6ddc460530 2008-07-25 Ivan N. Zlatev <[email protected]>
* TableLayout.cs: For newly created cells for controls without a
	specifically assinged such enforce AddRows if ColumnCount == 0 else
	AddColumns if RowCount == 0.
	[Fixes bug #412163]

svn path=/branches/mono-2-0/mcs/; revision=108823
2008-07-25 21:13:06 +00:00
Ivan Zlatev 00f6a73eb1 2008-07-25 Ivan N. Zlatev <[email protected]>
* TableLayoutPanel.cs: Perform layout on GrowStyle change, so
	that the change has an immediate effect.

svn path=/branches/mono-2-0/mcs/; revision=108817
2008-07-25 19:59:39 +00:00
Ivan Zlatev 37b08459d4 2008-07-25 Ivan N. Zlatev <[email protected]>
* TableLayout.cs: Automagically add the required number of columns/rows
	if the control is added at non-existent such. Note that ColumnCount and
	RowCount do not change in LayoutSettings.
	* TableLayoutTest.cs: Add test for bug #412161
	[Fixes bug #412161]

svn path=/branches/mono-2-0/mcs/; revision=108815
2008-07-25 19:55:45 +00:00
Marek Safar 83ceed4489 2008-07-25 Marek Safar <[email protected]>
A fix for bug #412217
	* assign.cs: Mutate also assignment type.


svn path=/branches/mono-2-0/mcs/; revision=108786
2008-07-25 14:59:30 +00:00
Ivan Zlatev bcd3aec7e5 2008-07-25 Ivan N. Zlatev <[email protected]>
* ScrollableControl.cs: Update PerformLayout calls to include
	provide the name of the property that changed.

svn path=/branches/mono-2-0/mcs/; revision=108776
2008-07-25 13:21:15 +00:00
Ivan Zlatev e4ce9895a7 2008-07-25 Ivan N. Zlatev <[email protected]>
* TableLayoutPanel.cs: Draw relative to the DisplayRectangle
	location. Fixes drawing of border and cell borders if scrollable.

svn path=/branches/mono-2-0/mcs/; revision=108771
2008-07-25 12:58:26 +00:00
Ivan Zlatev 542d8e5b0e 2008-07-25 Ivan N. Zlatev <[email protected]>
* ScrollableControl.cs: Perform layouting after the AutoScroll
	properties have changed, so that the changes have immediate
	effect.
	[Fixes bug #409090]

svn path=/branches/mono-2-0/mcs/; revision=108769
2008-07-25 12:53:29 +00:00
Martin Baulig 8a6f210585 2008-07-25 Martin Baulig <[email protected]>
* debug-debugger.c
	(debugger_get_boxed_object): GC-protect the last 16 objects.
	(debugger_runtime_invoke): Likewise.


svn path=/branches/mono-2-0/mono/; revision=108765
2008-07-25 12:13:14 +00:00
Marek Safar 989abab5fb 2008-07-25 Marek Safar <[email protected]>
A fix for bug #412134
	* expression.cs (ResolveOperatorEnum): Do implicit conversion of
	non-enumerable operands when overloading equality or bitwise operators.


svn path=/branches/mono-2-0/mcs/; revision=108762
2008-07-25 11:20:01 +00:00
Ivan Zlatev e01b93cd98 2008-07-25 Ivan N. Zlatev <[email protected]>
* XplatUIX11.cs: Non Client area is actually Client such in the
	case of NotifyIcon, so double check WholeWindow == ClientWindow
	when adding an expose.
	[Fixes bugs #324237 and #357022]

svn path=/branches/mono-2-0/mcs/; revision=108756
2008-07-25 10:31:14 +00:00
Ivan Zlatev 1b19fbcc37 2008-07-25 Ivan N. Zlatev <[email protected]>
* TableLayout.cs: Initialize columns and rows as empty array, so that we
	can drop the null check when drawing and always draw the control border,
	but void for the cell borders if there aren't any.
	[Fixes bug #411858]

svn path=/branches/mono-2-0/mcs/; revision=108754
2008-07-25 10:21:11 +00:00
Ivan Zlatev e46bc42fa8 2008-07-25 Ivan N. Zlatev <[email protected]>
* TableLayout.cs: Initialize columns and rows as empty array, so that we
	can drop the null check when drawing and always draw the control border,
	but void for the cell borders if there aren't any.
	[Fixes bug #411858]

svn path=/branches/mono-2-0/mcs/; revision=108752
2008-07-25 10:19:28 +00:00
Martin Baulig eb6253ba03 Ooops, actually pass the newly created LocalBuilder to the LocalTemporary.
svn path=/branches/mono-2-0/mcs/; revision=108750
2008-07-25 10:18:26 +00:00
Ivan Zlatev 3ed4f50114 2008-07-25 Ivan N. Zlatev <[email protected]>
* TableLayoutPanel.cs: Invalidate after layouting, so that we
	repaint the cell borders.
	[Fix bug #411860]

svn path=/branches/mono-2-0/mcs/; revision=108749
2008-07-25 10:02:58 +00:00
Ivan Zlatev 427d699aa3 2008-07-25 Ivan N. Zlatev <[email protected]>
* PropertyGridTextBox.cs: Stop filtering messages prior to our
	disposal to avoid unexpected ObjectDisposedExceptions.

svn path=/branches/mono-2-0/mcs/; revision=108726
2008-07-24 21:14:27 +00:00
Zoltan Varga 4e0d8f27ba Revert mistaken change.
svn path=/branches/mono-2-0/mono/; revision=108725
2008-07-24 21:21:42 +00:00
Zoltan Varga 1ee3e71937 2008-07-24 Zoltan Varga <[email protected]>
* configure.in: Patch libtool to avoid the 
	'copying selected object files ...' messages.
	
	* configure.in: Invoke patch-quiet.sh using AC_CONFIG_COMMANDS so it
	runs during a reconfigure too.

	Backported from trunk.

svn path=/branches/mono-2-0/mono/; revision=108724
2008-07-24 21:20:23 +00:00
Ivan Zlatev 988168e2c3 2008-07-24 Ivan N. Zlatev <[email protected]>
* TableLayoutPanel.cs: Layout on Row/Column count change.
	[Fixes bug #411891]

svn path=/branches/mono-2-0/mcs/; revision=108721
2008-07-24 20:44:56 +00:00
Zoltan Varga dbacc958c8 2008-07-24 Zoltan Varga <[email protected]>
* aot-runtime.c aot-compiler.c: Merge with the version in HEAD.

svn path=/branches/mono-2-0/mono/; revision=108678
2008-07-24 17:13:41 +00:00
Mark Probst cc46bbf965 2008-07-24 Mark Probst <[email protected]>
* mini-exceptions.c: Free a MonoType with
	mono_metadata_free_type() instead of g_free().

	* aot-runtime.c: Free a MonoType.

	Backported from trunk.

svn path=/branches/mono-2-0/mono/; revision=108675
2008-07-24 16:54:22 +00:00
Rodrigo Kumpera 089e8de54b 2008-07-24 Rodrigo Kumpera <[email protected]>
* verify.c (do_branch_op): Handle valuetypes and generic
	arguments properly.

	* verify.c (do_cmp_op): Same.

	Fixes #410383.

	Backported from trunk.


svn path=/branches/mono-2-0/mono/; revision=108674
2008-07-24 16:46:25 +00:00
Rodrigo Kumpera 57a84b0eeb 2008-07-24 Rodrigo Kumpera <[email protected]>
* configure.in: Change USED_GC_NAME to show if parallel mark is used.
	This is shown in mono --version.

	Backported from trunk.


svn path=/branches/mono-2-0/mono/; revision=108661
2008-07-24 15:56:19 +00:00
Bill Holmes 78a2769fe2 2008-07-24 Bill Holmes <[email protected]>
* mini-amd64.c (mono_arch_call_opcode) : Winx64 fix.  Use the size
	  variable computed above as the copy length for arguments of storage
	  type ArgValuetypeAddrInIReg.

	Contributed under MIT/X11 license.

svn path=/branches/mono-2-0/mono/; revision=108651
2008-07-24 13:19:31 +00:00
Bill Holmes 986ce54e81 2008-07-24 Bill Holmes <[email protected]>
* mini-amd64.c (mono_arch_emit_prolog) : Winx64 fix.  When omitting the
	  frame pointer the stack adjustment value must be saved to the unwind 
	  info structure.

	Contributed under MIT/X11 license.

svn path=/branches/mono-2-0/mono/; revision=108650
2008-07-24 13:12:16 +00:00
Zoltan Varga 4a7de092d4 Merge r108643 from HEAD.
svn path=/branches/mono-2-0/mcs/; revision=108644
2008-07-24 10:45:55 +00:00
Marek Habersack bf76a83964 Backport of r108638
svn path=/branches/mono-2-0/mcs/; revision=108639
2008-07-24 09:56:01 +00:00
Marek Habersack 510576a508 Backport of r108636
svn path=/branches/mono-2-0/mcs/; revision=108637
2008-07-24 09:21:12 +00:00
Rodrigo Kumpera 75639f296f 2008-07-23 Rodrigo Kumpera <[email protected]>
* verify.c (do_cast): Do boxing for generic arguments as well.

	* class.c (is_nesting_type): Drop generic instantiations before
	checking for nesting.

	* class.c (can_access_instantiation): Allow access to generic
	arguments.

	Backported from trunk.


svn path=/branches/mono-2-0/mono/; revision=108625
2008-07-24 03:10:20 +00:00
Rodrigo Kumpera e7d5ef2c30 2008-07-23 Rodrigo Kumpera <[email protected]>
* verify.c (verify_class_for_overlapping_reference_fields):
	On some cases, the field size might be zero, guard against that.
	Fix the explicit layout check to work as expected.

	Backported from trunk.


svn path=/branches/mono-2-0/mono/; revision=108608
2008-07-23 23:10:56 +00:00
Zoltan Varga 4d30c11e0c Merge r108601 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=108602
2008-07-23 21:52:57 +00:00
Martin Baulig d3a81ce711 2008-07-23 Martin Baulig <[email protected]>
* debug-mini.c (mono_debug_close_method): Check
	`MONO_INST_IS_DEAD' for `this'.


svn path=/branches/mono-2-0/mono/; revision=108598
2008-07-23 20:43:24 +00:00
Marek Habersack 4170fd8523 Backport of r108538
svn path=/branches/mono-2-0/mcs/; revision=108539
2008-07-23 10:29:13 +00:00
Marek Habersack 73545d7a30 Backport of r108535
svn path=/branches/mono-2-0/mcs/; revision=108536
2008-07-23 10:19:03 +00:00
Martin Baulig 47ecadbebb 2008-07-23 Martin Baulig <[email protected]>
* anonymous.cs
	(AnonymousMethodStorey.EmitHoistedVariables): Added the required
	symbolwriter calls to tell the debugger about the scope variable.
	(AnonymousMethodStorey.EmitType): Added the required symbol writer
	calls to tell the debugger about captured variables.

	* statement.cs
	(ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
	(ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
	scope variable.

	* class.cs
	(MethodOrOperator.Define): Set `Modifiers.DEBUGGER_HIDDEN' if
	we're an iterator.
	(MethodOrOperator.Emit): Add the `[DebuggerHidden]' custom
	attribute if requested.
	(Constructor.Emit): Likewise.


svn path=/branches/mono-2-0/mcs/; revision=108527
2008-07-23 03:46:43 +00:00
Gert Driesen b0b8b6fbd8 * LosFormatter.cs: Avoid using Position when stream is unseekable.
Do not invoke Length property twice for seekable MemoryStream.  
* LosFormatterTest.cs: Improved test for bug #411115.

svn path=/branches/mono-2-0/mcs/; revision=108505
2008-07-22 19:54:34 +00:00
Dean Brettle a5c3f5c622 ++ Test/System.Web.UI/ChangeLog (working copy)
* LosFormatterTest.cs: added test for bug 411115 where passing an
	unseekable stream to LosFormatter.Deserialize() causes an exception.

++ System.Web.UI/ChangeLog	(working copy)

	* LosFormatter.cs: fixed bug 411115 where passing an unseekable 
	stream to LosFormatter.Deserialize() causes an exception.


svn path=/branches/mono-2-0/mcs/; revision=108492
2008-07-22 18:20:47 +00:00
Bill Holmes b7f7a9261e 2008-07-22 Bill Holmes <[email protected]>
* libtest.c, winx64structs.cs :
	  Adding tests to exercise calling managed code from native with struct
	  arguments on Winx64.

	Contributed under MIT/X11 license.

svn path=/branches/mono-2-0/mono/; revision=108481
2008-07-22 17:04:51 +00:00
Bill Holmes ebe3ff9854 2008-07-22 Bill Holmes <[email protected]>
* inssel-amd64.brg :  Adding rules for OP_VTARG_ADDR that are used for
	  Winx64 struct arguments.

	* mini-amd64.c (mono_arch_allocate_vars) : Implementing the ArgValuetypeAddrInIReg
	  argument case.  Setting the argument op to OP_VTARG_ADDR (OP_REGOFFSET)).

	* mini-amd64.c (mono_arch_emit_prolog, emit_load_volatile_arguments) :
 	  Implementing the ArgValuetypeAddrInIReg argument case.  When the address
 	  of a struct is passed in a register it must be saved with the other
 	  volatile argument on the stack.

	Contributed under MIT/X11 license.

svn path=/branches/mono-2-0/mono/; revision=108480
2008-07-22 17:04:11 +00:00
Jb Evain b4b1af268b backport 108467
svn path=/branches/mono-2-0/mono/; revision=108477
2008-07-22 16:30:42 +00:00
Jonathan Pobst 37b6e49f7f Add MonoTODO to VirtualMode.
svn path=/branches/mono-2-0/mcs/; revision=108472
2008-07-22 15:01:36 +00:00
Marek Safar 766c997480 2008-07-22 Marek Safar <[email protected]>
A fix for bug #387040
	* ecore.cs: Skip constrains check for an explicit implementation.


svn path=/branches/mono-2-0/mcs/; revision=108452
2008-07-22 10:34:54 +00:00
Jb Evain b79c922ef9 backport r108446
svn path=/branches/mono-2-0/mcs/; revision=108447
2008-07-22 06:05:15 +00:00
Bill Holmes 524ecb2f30 2008-07-21 Bill Holmes <[email protected]>
Back port from trunk.  r108417

	* mini-amd64.c (get_call_info): Winx64 fix for passing floats.
	  The float param registers and other param registers must be the 
	  same index on Windows x64.

	Contributed under MIT/X11 license.

svn path=/branches/mono-2-0/mono/; revision=108418
2008-07-21 21:33:49 +00:00
Rodrigo Kumpera 70ff2308c0 2008-07-21 Rodrigo Kumpera <[email protected]>
* mini.c: Make the previous fix GC safe.
	Backported from trunk.


svn path=/branches/mono-2-0/mono/; revision=108383
2008-07-21 16:36:07 +00:00
Marek Safar e19a0cdd3f 2008-07-21 Marek Safar <[email protected]>
A fix for bug #410369
	* parameter.cs: Clone correctly ParamsParameter.


svn path=/branches/mono-2-0/mcs/; revision=108358
2008-07-21 15:11:09 +00:00
Mark Probst ae1b7774cd 2008-07-21 Mark Probst <[email protected]>
* reflection.c (mono_method_get_object): Don't let static RGCTX
	invoke wrappers get into MonoReflectionMethods.

	Backported from trunk.

2008-07-21  Mark Probst  <[email protected]>

	* generic-getgenericarguments.2.cs: Test case catching static
	RGCTX wrappers in MonoReflectionMethods.

	* Makefile.am: Test added.

	Backported from trunk.

svn path=/branches/mono-2-0/mono/; revision=108353
2008-07-21 14:51:37 +00:00
Bill Holmes 579a15b47a 2008-07-21 Bill Holmes <[email protected]>
Back port from trunk.  r108343

	* mini-amd64.c (get_call_info): Correcting the case for MONO_TYPE_TYPEDBYREF
	  on Winx64.  This type will not be passed on the stack (ArgOnStack), but 
	  ArgValuetypeAddrInIReg instead.

	Contributed under MIT/X11 license.

svn path=/branches/mono-2-0/mono/; revision=108352
2008-07-21 14:48:02 +00:00
Ivan Zlatev d25226e6f7 2008-07-21 Ivan N. Zlatev <[email protected]>
* CodeDomComponentSerializationService.cs: Remove redundant assignment.

svn path=/branches/mono-2-0/mcs/; revision=108351
2008-07-21 14:36:20 +00:00
Raja R Harinath 9fb03707ab * Makefile.am (version.h): Allow a trailing '/' in the repository URL.
svn path=/branches/mono-2-0/mono/; revision=108347
2008-07-21 14:24:11 +00:00
Marek Safar f82536d160 2008-07-19 Marek Safar <[email protected]>
A fix for bug #410666
	* anonymous.cs: Correctly initialize generic storey reference.


svn path=/branches/mono-2-0/mcs/; revision=108313
2008-07-19 12:55:30 +00:00
Gert Driesen 908a4b9c8d * OracleDataAdapter_FillSchema_DsSt.cs: Moved initialization of
connectionString to a setup method, as workaround for NUNit 2.2.0
bug with Assert.Ignore in ctor.
* OracleDataReader_GetDateTime.cs: Moved initialization of
connectionString to a setup method, as workaround for NUnit 2.2.0
bug with Assert.Ignore in ctor.
* OracleDataReader_NextResult.cs: Moved initialization of connection
to setup method, as workaround for NUnit 2.2.0 bug with Assert.Ignore
in ctor.

svn path=/branches/mono-2-0/mcs/; revision=108309
2008-07-19 10:52:46 +00:00
Jb Evain e2bf3c46d7 backport 108305:108307
svn path=/branches/mono-2-0/mcs/; revision=108308
2008-07-19 08:02:57 +00:00
Rodrigo Kumpera eb6fd2eb23 2008-07-18 Rodrigo Kumpera <[email protected]>
* mini.c: Use mono_runtime_class_init_full to avoid leaking memory
	for types which the initialization fails. Raises the provided exception
	at the right stop after cleanup. Backported from trunk.


svn path=/branches/mono-2-0/mono/; revision=108290
2008-07-18 23:58:06 +00:00
Rodrigo Kumpera 464026f902 2008-07-18 Rodrigo Kumpera <[email protected]>
* object-internals.h:
	* object.c: New mono_runtime_class_init_full function
	that makes throwing the exception optinal.

	* class-internals.h: New exception type MONO_EXCEPTION_OBJECT_SUPPLIED
	for the case where the exception object is supplied.

	Backported from trunk.


svn path=/branches/mono-2-0/mono/; revision=108289
2008-07-18 23:57:38 +00:00
Rodrigo Kumpera 3e9be851d4 2008-07-18 Rodrigo Kumpera <[email protected]>
* versioninfo.c (map_pe_file): Fix memory leak. Backported from trunk.


svn path=/branches/mono-2-0/mono/; revision=108285
2008-07-18 23:21:18 +00:00
Marek Safar 35439fa111 Reverted GetHashCode changes.
svn path=/branches/mono-2-0/mcs/; revision=108277
2008-07-18 21:50:44 +00:00
Marek Safar 822dba4a3e Reverted GetHashCode changes.
svn path=/branches/mono-2-0/mono/; revision=108277
2008-07-18 21:50:44 +00:00
Marek Safar 8d9bebe7fd 2008-07-18 Marek Safar <[email protected]>
* ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
	Finished missing generic type mutators.


svn path=/branches/mono-2-0/mcs/; revision=108274
2008-07-18 21:38:46 +00:00
Jonathan Pobst 452b871488 2008-07-16 Jonathan Pobst <[email protected]>
[Backport to 2.0]
	Apply patch from Achille Fouilleul (achille.fouilleul at gadz dot org)

	* BackgroundWorker.cs: Ensure the async object is set to null before
	calling RunWorkerCompleted, as IsBusy is based off the async object.
	[Fixes bug #394365]

2008-07-16  Jonathan Pobst  <[email protected]>
	[Backport to 2.0]
	Apply patches from Jordan Callicoat (MonkeeSage at gmail dot com)

	* AsyncCompleteEventArgs.cs: RaiseExceptionIfNecessary should throw
	TargetInvocationException if there was an exception, and IOE if
	the operation was cancelled.
	* BackgroundWorker.cs: Do not call RunWorkerCompleted from CancelAsync,
	setting cancel_pending to true is enough.
	* RunWorkerCompletedEventArgs.cs: Raise exceptions when user tries
	to access the Result if there are any exceptions.
	[Fixes bugs #328830 and 373153]

2008-07-16  Jonathan Pobst  <[email protected]>
	[Backport to 2.0]
	* BackgroundWorkerTest.cs: Add some asserts for bug #364365.

2008-07-16  Jonathan Pobst  <[email protected]>
	[Backport to 2.0]
	* BackgroundWorkerTest.cs: Add tests for bugs 328830 and 373153.

svn path=/branches/mono-2-0/mcs/; revision=108238
2008-07-18 15:03:17 +00:00
Jonathan Pobst c3b5d44422 2008-07-15 Jonathan Pobst <[email protected]>
[Backport to 2.0]
	* ImageList.cs: Fix ICollection.CopyTo implementation for
	ImageListCollection.  [Fixes bug #409169]

2008-07-15  Jonathan Pobst  <[email protected]>
	[Backport to 2.0]
	* ImageListTest.cs: Add test for bug #409169.

svn path=/branches/mono-2-0/mcs/; revision=108237
2008-07-18 14:57:19 +00:00
Jb Evain fcb0a02c88 merge fixes from 108210:108218
svn path=/branches/mono-2-0/mcs/; revision=108220
2008-07-18 12:14:43 +00:00
Marek Habersack b43ae3c971 Backport of r108179
svn path=/branches/mono-2-0/mcs/; revision=108195
2008-07-17 23:33:49 +00:00
Ivan Zlatev f708641b8d 2008-07-17 Ivan N. Zlatev <[email protected]>
* TypeDescriptor.cs: Attributes precendence (higher to lower)
	should be type -> base types -> interfaces and not
	type -> interfaces -> base types.

svn path=/branches/mono-2-0/mcs/; revision=108191
2008-07-17 22:23:12 +00:00
Ivan Zlatev 4e10c1ab81 2008-07-17 Ivan N. Zlatev <[email protected]>
* TypeDescriptor.cs:
	 - Refactor the default converters table not to be a Hashtable,
	 because the order of the keys is not preserved.
	 - Fix FindDefaultConverterType to properly make use of the default
	 converters.

svn path=/branches/mono-2-0/mcs/; revision=108122
2008-07-17 10:49:00 +00:00
Ivan Zlatev da3f57c214 2008-07-17 Ivan N. Zlatev <[email protected]>
* PropertyGridTextBox.cs: Validation should be performed only if we
	are focused. We can lose focus for example if the Return key is used
	to set the entry and there is an error. When the message box is
	displayed we would have validate on click in the message box.

svn path=/branches/mono-2-0/mcs/; revision=108115
2008-07-17 06:56:31 +00:00
Kornél Pál 48dccee80f Backport r108091.
svn path=/branches/mono-2-0/mono/; revision=108092
2008-07-16 22:25:07 +00:00
Ivan Zlatev 1faa706804 2008-07-16 Ivan N. Zlatev <[email protected]>
* GridEntry.cs: Checking for DesignerSerializaitonVisibility.Content
	in order to determine that we are expandable is wrong. There was a bug,
	now fixed, in TypeDescriptor that was causing the wrong converter to be
	returned which caused GetPropertiesSupported == false in most cases.
	[Fixes bug #409027]

svn path=/branches/mono-2-0/mcs/; revision=108090
2008-07-16 21:29:09 +00:00
Ivan Zlatev 38e2ec8469 2008-07-16 Ivan N. Zlatev <[email protected]>
* TypeDescriptor.cs:
	 - Fix GetConverter (Type) overload to have same logic as the
	 object one.
	 - Object-ReferenceConverter should be the last entry in the predefined
	 converters table, so that when we look up we don't end up with the wrong
	 converter for derived types.
	* TypeDescriptorTests.cs: Add a test that both GetConverter
	overloads return the same converter.

svn path=/branches/mono-2-0/mcs/; revision=108089
2008-07-16 21:22:51 +00:00
Jonathan Chambers 57dbdb3e42 2008-07-15 Jonathan Chambers <[email protected]>
* assembly.c (mono_set_rootdir): Revert part of mixed
       mode assembly patch to fix build. Use mono_module_handle
       instead of linker specific __ImageBase.

       * coree.h: Add back mono_module_handle.

       * coree.c: Add back mono_module_handle.

       Code is contributed under MIT/X11 license.

2008-07-15  Jonathan Chambers  <[email protected]>

       * driver.c: Add back mono_module_handle and
       initialize in DllMain DLL_PROCESS_ATTACH case.

       Code is contributed under MIT/X11 license.


svn path=/branches/mono-2-0/mono/; revision=108051
2008-07-16 16:09:49 +00:00
Marek Habersack e83157f0bf Backport of r108024
svn path=/branches/mono-2-0/mcs/; revision=108030
2008-07-16 13:59:06 +00:00
Zoltan Varga 6bc712404f Merge r107985 from HEAD.
svn path=/branches/mono-2-0/mono/; revision=107988
2008-07-15 18:22:47 +00:00
Andrew Jorgensen 31349722b8 Update versions to 2.0
svn path=/branches/mono-2-0/mono/; revision=107979
2008-07-15 17:11:32 +00:00
15420 changed files with 163765 additions and 2527873 deletions

No files matched your search

+7 -490
View File
@@ -1,422 +1,3 @@
2009-02-07 Gonzalo Paniagua Javier <[email protected]>
* configure.in: include stdio so that NULL is defined when checking
for ifreq.
2009-02-06 Miguel De Icaza <[email protected]>
* Disable parallel marking on OSX as it hangs during collections
in the bootstrap stage of Mono.
As we find more platforms that hang, we should disable it there as
well.
2009-02-03 Miguel de Icaza <[email protected]>
* configure.in (PLATFORM_NO_SYMLINKS): New define that replaces
PLATFORM_WIN32.
2009-02-02 Rodrigo Kumpera <[email protected]>
* configure.in: Add --with-mcs-docs to make it possible to disable building of documentation under mcs.
2009-01-29 Zoltan Varga <[email protected]>
* configure.in: Remove -Wcast-align from the warning list, it leads to a lot of
useless warnings which can only be fixed by casting a pointer to (void*).
2009-01-29 Miguel de Icaza <[email protected]>
* configure.in: Add a couple of new AM conditionals for POSIX and
DARWIN, these are used to conditionally include some files in
mono/mini.
2009-01-27 Jb Evain <[email protected]>
* configure.in: bump Mono's version to 2.5 now that 2.4
has been branched.
2009-01-25 Zoltan Varga <[email protected]>
* acinclude.m4 (dolt_supported): Handle ARM as well.
2009-01-23 Zoltan Varga <[email protected]>
* configure.in: Make --enable-parallel-mark=yes the default.
2009-01-17 Zoltan Varga <[email protected]>
* configure.in: Complete the OPROFILE checks.
2009-01-16 Zoltan Varga <[email protected]>
* configure.in: Avoid error messages in the quiet code if libgc/Makefile
does not exist yet. Fixes #466814.
2009-01-09 Zoltan Varga <[email protected]>
* configure.in: Check for the existence of the gettext executables.
2008-01-08 Christian Prochnow <[email protected]>
* configure.in: Check for sys/statfs.h and sys/mount.h
2009-01-07 Geoff Norton <[email protected]>
* configure.in: Provide platform information to the mcs build tree
2009-01-06 Jb Evain <[email protected]>
* scripts/Makefile.am: don't generate a script for the now
dead mono-api-diff.
2008-12-05 Jonathan Pryor <[email protected]>
* man/mdoc-update.1: Document -fno-assembly-versions.
2009-01-05 Zoltan Varga <[email protected]>
* configure.in: Disable sigaltstack on freebsd as it doesn't seem to work.
2008-12-16 Marek Habersack <[email protected]>
* data/system.web.extensions.design_1.0.pc.in: added
* data/Makefile.am (EXTRA_DIST): added
system.web.extensions.design_1.0.pc.in. Also added to
pkgconfig_DATA
* configure.in: added data/system.web.extensions_1.0.pc to
AC_OUTPUT
2008-12-16 Bill Holmes <[email protected]>
* winconfig.h : Defining the SIZEOF_REGISTER variable for the MSVC builds.
Code is contributed under MIT/X11 license.
2008-12-15 Marek Habersack <[email protected]>
* data/Makefile.am (EXTRA_DIST): added
system.web.extensions_1.0.pc.in. Also added to pkgconfig_DATA
* data/system.web.extensions_1.0.pc.in: added. This file serves
the purpose of making MonoDevelop see the 1.0 version of the
System.Web.Extensions assembly in the project references
editor. This will also make legacy 2.0 ASP.NET apps not fail when
they reference the 1.0 version of the assembly in their project
files.
* configure.in: added data/system.web.extensions_1.0.pc to AC_OUTPUT
2008-12-11 Mark Mason <[email protected]>
* configure.in: introduce SIZEOF_REGISTER - usually ==SIZEOF_VOID_P, except on mips/n32
2008-12-05 Marek Habersack <[email protected]>
* configure.in: check whether round (3) and rint (3) are present
in the C library.
2008-12-05 Jonathan Pryor <[email protected]>
* man/mdoc-update.1: Document new parameters such as --exceptions.
2008-12-04 Mark Probst <[email protected]>
* configure.in: Disabling the sibling call optimization doesn't
work, so we're using -mminimal-toc.
2008-12-03 Mark Probst <[email protected]>
* configure.in: Disable sibling call optimization on PPC64 as it
seems to trip up GCC on the build bot.
2008-11-28 Atsushi Enomoto <[email protected]>
* data/mono-nunit.pc.in : add new 2.4.8 files.
2008-11-21 Jb Evain <[email protected]>
* scripts/Makefile.am: use only one mono-api-info pointing to the cecil one
which is mscorlib agnostic.
2008-11-21 Zoltan Varga <[email protected]>
* configure.in: Only enable AOT on linux. Fixes #447265.
2008-11-19 Jonathan Pryor <[email protected]>
* configure.in: Remove mono/monoburg/Makefile; fixes the build.
2008-11-14 Andreas Färber <[email protected]>
* configure.in: Add preprocessor defines for ppc(64).
Suggested by Paolo and Mark.
Contributed under MIT/X11 license.
2008-11-12 Zoltan Varga <[email protected]>
* configure.in: Add an ENABLE_AOT variable to config.make, currently only
enabled for AMD64.
2008-11-11 Zoltan Varga <[email protected]>
* configure.in: Bump version to 2.3.
Mon Nov 10 17:37:08 CET 2008 Paolo Molaro <[email protected]>
* configure.in: check for sys/user.h and struct kinfo_proc members.
2008-11-07 Bill Holmes <[email protected]>
* winconfig.h : Removing HAVE_DIRENT_H, HAVE_STDINT_H,
HAVE_VISIBILITY_HIDDEN, HAVE_ZLIB for the VC builds.
Code is contributed under MIT/X11 license.
2008-11-05 Bill Holmes <[email protected]>
* configure.in : Adding a auto configure check for dirent.h.
Code is contributed under MIT/X11 license.
2008-10-30 Jonathan Pryor <[email protected]>
* Makefile.am: Build `docs` after `runtime`, so that it can depend
upon mdoc.exe for it's operation.
2008-10-30 Jonathan Pryor <[email protected]>
* man/mdoc-assemble.1: Document //node use within .source files.
2008-10-27 Jb Evain <[email protected]>
* data/cecil.pc.in: update version.
2008-10-22 Zoltan Varga <[email protected]>
* scripts/Makefile.am: Add gacutil1 script.
2008-10-21 Atsushi Enomoto <[email protected]>
* data/dotnet35.pc.in : added sys.cm.dataannotations.dll too.
2008-10-21 Atsushi Enomoto <[email protected]>
* data/net_2_0/web.config : added new assemblies and namespaces in
pages and compilation sections.
2008-10-21 Atsushi Enomoto <[email protected]>
* data/dotnet35.pc.in : added new assemblies (dlinq, abstractions,
routing, dynamic data).
2008-10-20 Jonathan Pryor <[email protected]>
* scripts/mod.in: Remove bash-isms.
2008-10-18 Jonathan Pryor <[email protected]>
* configure.in: Generate data/monodoc.pc.
2008-10-18 Jonathan Pryor <[email protected]>
* data/Makefile.am: Add monodoc.pc to $(pkgconfig_DATA), $(DISTCLEANFILES).
2008-10-18 Jonathan Pryor <[email protected]>
* data/monodoc.pc.in: Fixup sourcesdir.
* data/Makefile.am (EXTRA_DIST): Add monodoc.pc.in.
2008-10-17 Jonathan Pryor <[email protected]>
* scripts/Makefile.am: Install scripts for mdoc-compat commands.
* scripts (svn:ignore): Ignore generated files.
* mdassembler, mdvalidater, monodocer, monodocs2html,
monodocs2slashdoc: Added; "compatibility" scripts, converting the
previous commands into mdoc commands.
2008-10-17 Jonathan Pryor <[email protected]>
* scripts/Makefile.am: Create scripts for mdoc sub-commands.
2008-10-17 Jonathan Pryor <[email protected]>
* scripts/Makefile.am: Add mod.
2008-10-16 Jonathan Pryor <[email protected]>
* scripts/Makefile.am: Move mono-shlib-cop to scripts_2_0.
2008-10-15 Jonathan Pryor <[email protected]>
* configure.in: Add checks for `struct flock`, `struct timespec`.
2008-10-14 Jonathan Pryor <[email protected]>
* data/mono-options.pcs.in: We're not installing Mono.Options.dll into
the GAC anymore, we're just concerned `pkg-config --variable=Source`
support.
2008-10-14 Jonathan Pryor <[email protected]>
* data/mono-options.pc.in: Add a Sources variable so that
`pkg-config --variable Sources mono-options` can be used to grab the
sources to Mono.Options (useful for embedding).
2008-10-13 Jonathan Pryor <[email protected]>
* configure.in: Generate data/mono-options.pc.
* data/Makefile.am: Support mono-options.pc.in and mono-options.pc.
* data/mono-options.pc.in: Added.
Mon Oct 13 11:26:19 CEST 2008 Paolo Molaro <[email protected]>
* configure.in: check for shm_open ().
2008-10-12 Zoltan Varga <[email protected]>
* configure.in: Only process Makefiles with patch-quiet.sh which have a
corresponding Makefile.in.
2008-10-11 Zoltan Varga <[email protected]>
* configure.in: Make --enable-minimal=reflection_emit turn on
--enable-minimal=reflection_emit_save too.
* README: Add docs for the option.
* configure.in: Add --enable-minimal=reflection_emit_save option.
2008-10-10 Atsushi Enomoto <[email protected]>
* data/net_2_0/web.config: add UrlRouting.axd handler (forbidden).
2008-10-08 Zoltan Varga <[email protected]>
* Makefile.am (dist-hook): Use 'net_1_1' instead of 'default'.
* runtime/Makefile.am: Rename 'default' profile to 'net_1_1'.
2008-10-07 Atsushi Enomoto <[email protected]>
* data/Makefile.am : there seems a couple more of required changes.
2008-10-07 Atsushi Enomoto <[email protected]>
* scripts/Makefile.am : one more dist fix is needed.
2008-10-07 Atsushi Enomoto <[email protected]>
* configure.in : fix missing change for previous change.
2008-10-07 Atsushi Enomoto <[email protected]>
* scripts/mono-nunit.pc.in, data/mono-nunit.pc.in:
move former to latter.
* scripts/Makefile.am : remove packaging info.
* data/Makefile.am : add mono-nunit.pc too.
2008-10-03 Rodrigo Kumpera <[email protected]>
* configure.in: Add simd intrinsics to the disable set.
2008-10-01 Jb Evain <[email protected]>
* scripts/Makefile.am: add mono-cil-strip.
2008-09-29 Zoltan Varga <[email protected]>
* scripts/patch-quiet.sh: Handle the ifs used by some versions of
automake.
2008-09-25 Luis Ortiz <[email protected]>
* configure.in: Big arrays are only supported on 64 bit systems.
Fixes #430022
2008-09-24 Zoltan Varga <[email protected]>
* configure.in: Add --enable-minimal=attach option.
2008-09-22 Raja R Harinath <[email protected]>
* scripts/patch-quiet.sh: Skip Makefiles that've already been
patched. Handle automake 1.10a.
2008-09-18 Mark Probst <[email protected]>
* docs/generic-sharing: More generic sharing porting
documentation.
2008-09-17 Raja R Harinath <[email protected]>
* Makefile.am (EXTRA_DIST): Update.
* nls.m4, progtest.m4: Really add from Gettext 0.17.
2008-09-15 Raja R Harinath <[email protected]>
* configure.in (AC_CONFIG_FILES): Put po/mcs/Makefile.in in its
own stanza.
(AC_OUTPUT): Don't list po/mcs/Makefile, it's automatically
handled by AM_PO_SUBDIRS.
2008-09-14 Miguel de Icaza <[email protected]>
* Added some infrastructure to start the translation of the
compiler error messages.
Currently the compiler does not yet use the infrastructure,
that needs a bit of work, but the PO infrastructure is in place.
2008-09-14 gettextize <[email protected]>
* Makefile.am (SUBDIRS): Add po/mcs.
(DIST_SUBDIRS): Add po/mcs.
(EXTRA_DIST): Add config.rpath.
* configure.in (AC_CONFIG_FILES): Add po/mcs/Makefile.in.
2008-09-14 gettextize <[email protected]>
* gettext.m4: New file, from gettext-0.17.
* iconv.m4: New file, from gettext-0.17.
* lib-ld.m4: New file, from gettext-0.17.
* lib-link.m4: New file, from gettext-0.17.
* lib-prefix.m4: New file, from gettext-0.17.
* nls.m4: New file, from gettext-0.17.
* po.m4: New file, from gettext-0.17.
* progtest.m4: New file, from gettext-0.17.
* Makefile.am (EXTRA_DIST): Add the new files.
2008-09-12 Zoltan Varga <[email protected]>
* scripts/patch-quiet.sh: Remove an obsolete comment. Change the Makefile so
this script is rerun if Makefile.am changes.
2008-09-11 Zoltan Varga <[email protected]>
* configure.in: Add a DISABLE_JIT automake conditional too.
* configure.in: Add a --enable-minimal=jit option to disable jit, only
allowing full-aot execution.
2008-09-10 Zoltan Varga <[email protected]>
* configure.in: Move the computation of export_ldflags after libtool has
been created.
2008-09-08 Massimiliano Mantione <[email protected]>
* configure.in: Added DISABLE_PROFILER automake conditional.
2008-08-29 Geoff Norton <[email protected]>
* configure.in: Rollup our unrolled FreeBSD support so that we properly
build and compile on FreeBSD6+. (FreeBSD5 is 2004)
2008-08-28 Geoff Norton <[email protected]>
* build-iphone.sh: iPhone lies about HAVE_MMAP as well.
@@ -426,97 +7,33 @@ Mon Oct 13 11:26:19 CEST 2008 Paolo Molaro <[email protected]>
* build-iphone.sh: Update build-iphone to not wget old inssel's, and build
out of the box with teh current SDK.
2008-08-28 Zoltan Varga <vargaz@gmail.com>
* scripts/Makefile.am (scripts_2_0): Add gacutil2.
* scripts/gacutil2: New file.
2008-08-22 Jb Evain <[email protected]>
* data/wcf.pc.in
* data/Makefile.am
* configure.in: add a new wcf.pc for assemblies recently moved
from olive to mcs.
2008-08-12 Bill Holmes <[email protected]>
2008-08-13 Bill Holmes <billholmes54@gmail.com>
* winconfig.h: Updating the config file for MSVC builds to match
the config file used when compiling with gcc in Cygwin.
Contributed under MIT/X11 license.
2008-08-09 Rodrigo Kumpera <[email protected]>
* docs/generic-sharing: Some updates from an irc talk with Mark.
2008-08-06 Zoltan Varga <[email protected]>
* Makefile.am (EXTRA_DIST): Add dtrace-prelink.sh and build-mingw32.sh.
* scripts/Makefile.am (EXTRA_DIST): Add patch-quiet.sh.
2008-08-05 Marek Habersack <[email protected]>
* configure.in: use the PKG_CONFIG_PATH only when cross-compiling.
2008-08-05 Marek Habersack <[email protected]>
* configure.in: added support for cross-compilation
2008-08-05 Marek Habersack <[email protected]>
* build-mingw32.sh: added a script to build Mono for Windows on a
Linux host using mingw.
2008-08-05 Marek Habersack <[email protected]>
* scripts/Makefile.am: added support for cross-compilation,
including .bat generation for windows targets.
2008-08-05 Marek Habersack <[email protected]>
* scripts/smcs.bat.in, scripts/script.bat.in,
scripts/script_umask.bat.in: added .bat templates.
2008-08-05 Marek Habersack <[email protected]>
* runtime/Makefile.am: mingw cross-compilation support.
2008-08-05 Andreas Färber <[email protected]>
* autogen.sh: Suppress arguments warning for NOCONFIGURE.
Contributed under MIT/X11 license.
2008-08-02 Zoltan Varga <[email protected]>
* configure.in: Enable dtrace by default on platforms which support it.
2008-07-27 Zoltan Varga <[email protected]>
* scripts/patch-quiet.sh: Make the libtool --quiet flag configurable by
V=1 as well.
2008-07-24 Zoltan Varga <[email protected]>
* configure.in: Patch libtool to avoid the
'copying selected object files ...' messages.
* configure.in: Invoke patch-quiet.sh using AC_CONFIG_COMMANDS so it
runs during a reconfigure too.
Backported from trunk.
2008-07-24 Rodrigo Kumpera <[email protected]>
* configure.in: Change USED_GC_NAME to show if parallel mark is used.
This is shown in mono --version.
2008-07-22 Mark Probst <[email protected]>
* configure.in: New configure option (--with-malloc-mempools) to
make mempools use malloc for every single allocation, which makes
it easier to use debugging/profiling tools like Valgrind.
2008-07-21 Zoltan Varga <[email protected]>
* configure.in: Invoke patch-quiet.sh using AC_CONFIG_COMMANDS so it
runs during a reconfigure too.
Backported from trunk.
2008-07-13 Zoltan Varga <[email protected]>
+3 -3
View File
@@ -22,7 +22,7 @@ For comments, corrections and updates, please contact [email protected]
Contributions for other modules should be under the same license
terms as the rest of the module, or under MIT X11 terms.
If you need further information, please contact [email protected]
If you ned further information, please contact [email protected]
* The Modules
@@ -37,8 +37,8 @@ For comments, corrections and updates, please contact [email protected]
We consider non-LGPL use instances where you use this on an
embedded system where the end user is not able to upgrade the
Mono VM or Moonlight installation or distribution that is part
of your product (Section 6 and 7), you would have to obtain a
Moonlight installation or distribution that is part of your
product (Section 6 and 7), you would have to obtain a
commercial license from Novell (consider software burned into
a ROM, systems where end users would not be able to upgrade,
an embedded console, a game console that imposes limitations
+4 -4
View File
@@ -1,20 +1,20 @@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I .
SUBDIRS = po $(libgc_dir) $(eglib_dir) mono $(ikvm_native_dir) support data runtime scripts man samples web msvc docs
SUBDIRS = $(libgc_dir) $(eglib_dir) mono $(ikvm_native_dir) support docs data runtime scripts man samples web msvc
# Keep in sync with SUBDIRS
## 'tools' is not normally built
DIST_SUBDIRS = po libgc $(eglib_dir) mono ikvm-native support data runtime scripts man samples web tools msvc docs
DIST_SUBDIRS = libgc $(eglib_dir) mono ikvm-native support docs data runtime scripts man samples web tools msvc
EXTRA_DIST= nls.m4 po.m4 progtest.m4 mono-uninstalled.pc.in build-mingw32.sh LICENSE mkinstalldirs
EXTRA_DIST= mono-uninstalled.pc.in LICENSE
DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
# Distribute the 'mcs' tree too
dist-hook:
test -d $(distdir)/mcs || mkdir $(distdir)/mcs
d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) PROFILE=net_1_1 distdir=$$d dist-recursive
d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) PROFILE=default distdir=$$d dist-recursive
d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) PROFILE=net_2_0 distdir=$$d dist-recursive
pkgconfigdir = $(libdir)/pkgconfig
+18 -41
View File
@@ -67,14 +67,6 @@ This is Mono.
./autogen.sh --prefix=/usr/local
make
The Mono build system is silent for most compilation commands.
To enable a more verbose compile (for example, to pinpoint
problems in your makefiles or your system) pass the V=1 flag to make, like this:
make V=1
c. Building the software from SVN
---------------------------------
@@ -324,25 +316,22 @@ This is Mono.
Disables support for the Ahead of Time
compilation.
com:
Disables COM support.
debug:
Drop debugging support.
profiler:
Disables support for the default profiler.
decimal:
Disables support for System.Decimal.
generics:
Generics support. Disabling this will not
allow Mono to run any 2.0 libraries or
code that contains generics.
pinvoke:
Support for Platform Invocation services,
disabling this will drop support for any
libraries using DllImport.
jit:
Removes the JIT engine from the build, this reduces
the executable size, and requires that all code
executed by the virtual machine be compiled with
Full AOT before execution.
debug:
Drop debugging support.
reflection_emit:
Drop System.Reflection.Emit support
large_code:
Disables support for large assemblies.
@@ -350,31 +339,19 @@ This is Mono.
logging:
Disables support for debug logging.
pinvoke:
Support for Platform Invocation services,
disabling this will drop support for any
libraries using DllImport.
profiler:
Disables support for the default profiler.
reflection_emit:
Drop System.Reflection.Emit support
reflection_emit_save:
Drop support for saving dynamically created
assemblies (AssemblyBuilderAccess.Save) in
System.Reflection.Emit.
simd:
Disables support for the Mono.SIMD intrinsics
library.
com:
Disables COM support.
ssa:
Disables compilation for the SSA optimization
framework, and the various SSA-based
optimizations.
generics:
Generics support. Disabling this will not
allow Mono to run any 2.0 libraries or
code that contains generics.
--enable-big-arrays
This enables the use arrays whose indexes are larger
+1 -1
View File
@@ -23,7 +23,7 @@ if test x$GCC != xyes; then
fi
case $host in
i?86-*-linux*|x86_64-*-linux*|powerpc-*-linux* \
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*|arm*-*-linux*)
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*)
pic_options='-fPIC'
;;
i?86-apple-darwin*)
+3 -3
View File
@@ -82,7 +82,7 @@ if test "$DIE" -eq 1; then
exit 1
fi
if test x$NOCONFIGURE = x && test -z "$*"; then
if test -z "$*"; then
echo "**Warning**: I am going to run \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \`$0\'" command line."
@@ -102,8 +102,8 @@ if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
fi
fi
echo "Running aclocal -I . $ACLOCAL_FLAGS ..."
aclocal -I . $ACLOCAL_FLAGS || {
echo "Running aclocal $ACLOCAL_FLAGS ..."
aclocal $ACLOCAL_FLAGS || {
echo
echo "**Error**: aclocal failed. This may mean that you have not"
echo "installed all of the packages you need, or you may need to"
-110
View File
@@ -1,110 +0,0 @@
#!/bin/bash -e
CURDIR="`pwd`"
CROSS_DIR=${1:-/opt/cross/}
MINGW=${1:-i386-mingw32msvc}
CROSS_BIN_DIR="$CROSS_DIR/bin"
CROSS_DLL_DIR="$CROSS_DIR/$MINGW/bin"
CROSS_PKG_CONFIG_DIR=$CROSS_DIR/$MINGW/lib/pkgconfig
COPY_DLLS="libgio*.dll libglib*.dll libgmodule*.dll libgthread*.dll libgobject*.dll"
PATH=$CROSS_BIN_DIR:$PATH
INSTALL_DESTDIR="$CURDIR/mono-win32"
PROFILES="default net_2_0 net_2_1 net_3_5"
export PATH
function setup ()
{
if [ -d ./.git/svn ]; then
SVN_INFO='git svn info'
elif [ -d ./.svn ]; then
SVN_INFO='svn info'
else
SVN_INFO=""
fi
if [ -n "$SVN_INFO" ]; then
MONO_SVN_REVISION=`$SVN_INFO | grep Revision | sed 's/.*: //'`
MONO_BRANCH=`$SVN_INFO | grep URL | sed -e 's;.*source/;;g' -e 's;/mono;;g'`
else
MONO_SVN_REVISION="rUNKNOWN"
MONO_BRANCH="tarball"
fi
MONO_VERSION=`grep AM_INIT_AUTOMAKE configure.in | cut -d ',' -f 2|tr -d '\)'`
MONO_RELEASE="$MONO_VERSION-$MONO_BRANCH-r$MONO_SVN_REVISION"
MONO_PREFIX="/mono-$MONO_RELEASE"
NOCONFIGURE=yes
export NOCONFIGURE
echo Mono Win32 installation prefix: $MONO_PREFIX
}
function build ()
{
./autogen.sh
if [ -f ./Makefile ]; then
make distclean
fi
if [ ! -d "$CURDIR/build-cross-windows" ]; then
mkdir "$CURDIR/build-cross-windows"
fi
cd "$CURDIR/build-cross-windows"
rm -rf *
../configure --prefix=$MONO_PREFIX --with-crosspkgdir=$CROSS_PKG_CONFIG_DIR --target=$MINGW --host=$MINGW --enable-parallel-mark --program-transform-name=""
make
cd "$CURDIR"
if [ ! -d "$CURDIR/build-cross-windows-mcs" ]; then
mkdir "$CURDIR/build-cross-windows-mcs"
fi
cd "$CURDIR/build-cross-windows-mcs"
rm -rf *
../configure --prefix=$MONO_PREFIX --enable-parallel-mark
make
}
function doinstall ()
{
if [ -d "$INSTALL_DIR" ]; then
rm -rf "$INSTALL_DIR"
fi
cd "$CURDIR/build-cross-windows"
make DESTDIR="$INSTALL_DESTDIR" USE_BATCH_FILES=yes install
cd "$CURDIR/../mcs/mcs"
for p in $PROFILES; do
make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "mcs profile $p installation failed"
done
cd "$CURDIR/../mcs/class"
for p in $PROFILES; do
make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "class library profile $p installation failed"
done
cd "$CURDIR/../mcs/tools"
for p in $PROFILES; do
make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "tools profile $p installation failed"
done
cd "$CURDIR/mono-win32"
for dll in $COPY_DLLS; do
cp -ap "$CROSS_DLL_DIR"/$dll "$INSTALL_DESTDIR/$MONO_PREFIX/bin"
done
rm -f "$CURDIR/mono-win32-$MONO_RELEASE".zip
zip -9r "$CURDIR/mono-win32-$MONO_RELEASE".zip .
}
pushd . > /dev/null
setup
build
doinstall
popd > /dev/null
+116 -219
View File
@@ -6,7 +6,7 @@ AC_CANONICAL_SYSTEM
m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(mono,2.5)
AM_INIT_AUTOMAKE(mono,2.0)
AM_MAINTAINER_MODE
API_VER=1.0
@@ -49,6 +49,8 @@ libmono_cflags=""
libmono_ldflags=""
AC_SUBST(libmono_cflags)
AC_SUBST(libmono_ldflags)
export_ldflags=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
AC_SUBST(export_ldflags)
# Variable to have relocatable .pc files (lib, or lib64)
reloc_libdir=`basename ${libdir}`
@@ -63,14 +65,10 @@ need_link_unlink=no
# Thread configuration inspired by sleepycat's db
AC_MSG_CHECKING([host platform characteristics])
libgc_threads=no
has_dtrace=no
parallel_mark=yes
case "$host" in
*-*-mingw*|*-*-cygwin*)
platform_win32=yes
AC_DEFINE(PLATFORM_WIN32,1,[Platform is Win32])
AC_DEFINE(DISABLE_PORTABILITY,1,[Disable the io-portability layer])
AC_DEFINE(PLATFORM_NO_SYMLINKS,1,[This platform does not support symlinks])
if test "x$cross_compiling" = "xno"; then
CC="gcc -mno-cygwin -g"
# So libgc configure gets -mno-cygwin
@@ -79,8 +77,8 @@ case "$host" in
HOST_CC="gcc"
# Windows 2000 is required that includes Internet Explorer 5.01
CPPFLAGS="$CPPFLAGS -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS -DFD_SETSIZE=1024"
libmono_cflags="-mno-cygwin -mms-bitfields -mwindows"
libmono_ldflags="-mno-cygwin -mms-bitfields -mwindows"
libmono_cflags="-mno-cygwin"
libmono_ldflags="-mno-cygwin"
libdl=
libgc_threads=win32
gc_default=included
@@ -100,9 +98,34 @@ case "$host" in
libdl="-ldl"
libgc_threads=pthreads
with_sigaltstack=no
use_sigposix=yes
;;
*-*-*freebsd*)
# these flags will work for all versions of -STABLE
#
*-*-*freebsd4*)
platform_win32=no
if test "x$PTHREAD_CFLAGS" = "x"; then
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS"
libmono_cflags="-D_THREAD_SAFE"
else
CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS -DGC_FREEBSD_THREADS"
libmono_cflags="$PTHREAD_CFLAGS"
fi
if test "x$PTHREAD_LIBS" = "x"; then
LDFLAGS="$LDFLAGS -pthread"
libmono_ldflags="-pthread"
else
LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
libmono_ldflags="$PTHREAD_LIBS"
fi
CPPFLAGS="$CPPFLAGS -DPLATFORM_BSD -DPLATFORM_BSD4"
need_link_unlink=yes
AC_DEFINE(PTHREAD_POINTER_ID, 1, [pthread_t is a pointer])
libdl=
libgc_threads=pthreads
# TLS isn't implemented at all on 4-STABLE
with_tls=pthread
;;
*-*-*freebsd5*)
platform_win32=no
if test "x$PTHREAD_CFLAGS" = "x"; then
CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS"
@@ -118,22 +141,47 @@ case "$host" in
LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
libmono_ldflags="$PTHREAD_LIBS"
fi
CPPFLAGS="$CPPFLAGS -DPLATFORM_BSD"
CPPFLAGS="$CPPFLAGS -DPLATFORM_BSD -DPLATFORM_BSD5"
need_link_unlink=yes
AC_DEFINE(PTHREAD_POINTER_ID, 1, [pthread is a pointer])
AC_DEFINE(PTHREAD_POINTER_ID)
libdl=
with_sigaltstack=yes
libgc_threads=pthreads
# TLS is only partially implemented on 5-STABLE (compiler support
# but NOT library support)
#
with_tls=pthread
;;
*-*-*freebsd6*)
platform_win32=no
if test "x$PTHREAD_CFLAGS" = "x"; then
CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS"
libmono_cflags=
else
CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS -DGC_FREEBSD_THREADS"
libmono_cflags="$PTHREAD_CFLAGS"
fi
if test "x$PTHREAD_LIBS" = "x"; then
LDFLAGS="$LDFLAGS -pthread"
libmono_ldflags="-pthread"
else
LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
libmono_ldflags="$PTHREAD_LIBS"
fi
CPPFLAGS="$CPPFLAGS -DPLATFORM_BSD -DPLATFORM_BSD6"
need_link_unlink=yes
AC_DEFINE(PTHREAD_POINTER_ID)
libdl=
libgc_threads=pthreads
# This doesn't seem to work as of 7.0 on amd64
with_sigaltstack=no
with_sigaltstack=yes
# TLS is only partially implemented on -CURRENT (compiler support
# but NOT library support)
#
with_tls=pthread
use_sigposix=yes
;;
*-*-*openbsd*)
platform_win32=no
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS -DPLATFORM_BSD"
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS"
libmono_cflags="-D_THREAD_SAFE"
LDFLAGS="$LDFLAGS -pthread"
libmono_ldflags="-pthread"
@@ -141,7 +189,6 @@ case "$host" in
AC_DEFINE(PTHREAD_POINTER_ID)
libdl=
libgc_threads=pthreads
use_sigposix=yes
;;
*-*-linux*)
platform_win32=no
@@ -150,11 +197,9 @@ case "$host" in
libmono_ldflags="-lpthread"
libdl="-ldl"
libgc_threads=pthreads
AOT_SUPPORTED="yes"
use_sigposix=yes
;;
*-*-hpux*)
platform_win32=no
platform_win32=no
CPPFLAGS="$CPPFLAGS -DGC_HPUX_THREADS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_REENTRANT"
# +ESdbgasm only valid on bundled cc on RISC
# silently ignored for ia64
@@ -170,7 +215,6 @@ case "$host" in
libmono_ldflags="-lpthread"
libgc_threads=pthreads
need_link_unlink=yes
use_sigposix=yes
;;
*-*-solaris*)
platform_win32=no
@@ -180,13 +224,9 @@ case "$host" in
libgc_threads=pthreads
# This doesn't seem to work on solaris/x86, but the configure test runs
with_tls=pthread
has_dtrace=yes
use_sigposix=yes
;;
*-*-darwin*)
parallel_mark="Disabled_Currently_Hangs_On_MacOSX"
platform_win32=no
platform_darwin=yes
CPPFLAGS="$CPPFLAGS -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS -DPLATFORM_MACOSX -DUSE_MMAP -DUSE_MUNMAP"
CPPFLAGS="$CPPFLAGS -DGetCurrentProcess=MonoGetCurrentProcess -DGetCurrentThread=MonoGetCurrentThread -DCreateEvent=MonoCreateEvent"
libmono_cflags="-D_THREAD_SAFE"
@@ -198,7 +238,6 @@ case "$host" in
no_version_script=yes
libdl=
libgc_threads=pthreads
has_dtrace=yes
if test "x$cross_compiling" = "xyes"; then
has_broken_apple_cpp=yes
fi
@@ -217,8 +256,6 @@ fi
AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes)
AM_CONDITIONAL(PLATFORM_LINUX, echo x$target_os | grep -q linux)
AM_CONDITIONAL(PLATFORM_DARWIN, test x$platform_darwin = xyes)
AM_CONDITIONAL(PLATFORM_SIGPOSIX, test x$use_sigposix = xyes)
AC_CHECK_TOOL(CC, gcc, gcc)
AC_PROG_CC
@@ -256,7 +293,6 @@ AC_SUBST(HOST_CC)
AC_SUBST(BUILD_EXEEXT)
AM_CONDITIONAL(CROSS_COMPILING, [test x$cross_compiling = xyes])
AM_CONDITIONAL(USE_BATCH_FILES, [test x$platform_win32 = xyes -a x$cross_compiling = xyes])
# Set STDC_HEADERS
AC_HEADER_STDC
@@ -267,9 +303,6 @@ AM_PROG_LIBTOOL
# Use dolt (http://dolt.freedesktop.org/) instead of libtool for building.
DOLT
export_ldflags=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
AC_SUBST(export_ldflags)
# Test whenever ld supports -version-script
AC_PROG_LD
AC_PROG_LD_GNU
@@ -280,7 +313,6 @@ fi
AM_CONDITIONAL(NO_VERSION_SCRIPT, test x$no_version_script = xyes)
AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h sys/utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h sys/mkdev.h)
AC_CHECK_HEADERS(sys/user.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h)
AC_CHECK_HEADER(zlib.h, [have_zlib=yes], [have_zlib=no])
if test x$have_zlib = xyes; then
@@ -316,7 +348,17 @@ AC_CHECK_HEADERS(syslog.h)
# for mono/dis
AC_CHECK_HEADERS(wchar.h)
AC_CHECK_HEADERS(ieeefp.h)
case "$host" in
*-*-*freebsd6*)
AC_CHECK_HEADERS(ieeefp.h)
;;
*-*-*freebsd*)
/* Only freebsd6 has a working ieeefp.h */
;;
*)
AC_CHECK_HEADERS(ieeefp.h)
;;
esac
AC_MSG_CHECKING(for isinf)
AC_TRY_LINK([#include <math.h>], [
int f = isinf (1);
@@ -334,7 +376,7 @@ AC_CHECK_SIZEOF(void *, 4)
WARN=''
if test x"$GCC" = xyes; then
WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings'
WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings'
# The runtime code does not respect ANSI C strict aliasing rules
CFLAGS="$CFLAGS -fno-strict-aliasing"
@@ -401,18 +443,6 @@ if test -d $srcdir/$olivedir; then
olive_topdir='$(top_srcdir)/'$olivedir
fi
# gettext: prepare the translation directories.
# we do not configure the full gettext, as we consume it dynamically from C#
AM_PO_SUBDIRS
if test "x$USE_NLS" = "xyes"; then
AC_CHECK_PROG(HAVE_MSGFMT, msgfmt,yes,no)
if test "x$HAVE_MSGFMT" = "xno"; then
AC_MSG_ERROR([msgfmt not found. You need to install the 'gettext' package, or pass --enable-nls=no to configure.])
fi
fi
AC_ARG_WITH([libgdiplus],
[ --with-libgdiplus=installed|sibling|<path> Override the libgdiplus used for System.Drawing tests (defaults to NO)],
[], [with_libgdiplus=installed])
@@ -461,17 +491,9 @@ embedded)
AC_CONFIG_SUBDIRS(eglib)
;;
system)
if test "x$cross_compiling" = "xyes"; then
pkg_config_path="$PKG_CONFIG_PATH"
unset PKG_CONFIG_PATH
fi
BUILD_GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0`
BUILD_GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
if test "x$cross_compiling" = "xyes"; then
PKG_CONFIG_PATH=$pkg_config_path
export PKG_CONFIG_PATH
fi
## Versions of dependencies
GLIB_REQUIRED_VERSION=1.3.11
@@ -564,7 +586,7 @@ DISABLED_FEATURES=none
AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems.
LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug,
reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd.],
reflection_emit, large_code, logging, com, ssa, generics.],
[
for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
eval "mono_feature_disable_$feature='yes'"
@@ -583,7 +605,6 @@ fi
if test "x$mono_feature_disable_profiler" = "xyes"; then
AC_DEFINE(DISABLE_PROFILER, 1, [Disable default profiler support])
fi
AM_CONDITIONAL(DISABLE_PROFILER, test x$mono_feature_disable_profiler = xyes)
if test "x$mono_feature_disable_decimal" = "xyes"; then
AC_DEFINE(DISABLE_DECIMAL, 1, [Disable System.Decimal support])
@@ -599,11 +620,6 @@ fi
if test "x$mono_feature_disable_reflection_emit" = "xyes"; then
AC_DEFINE(DISABLE_REFLECTION_EMIT, 1, [Disable reflection emit support])
mono_feature_disable_reflection_emit_save=yes
fi
if test "x$mono_feature_disable_reflection_emit_save" = "xyes"; then
AC_DEFINE(DISABLE_REFLECTION_EMIT_SAVE, 1, [Disable assembly saving support in reflection emit])
fi
if test "x$mono_feature_disable_large_code" = "xyes"; then
@@ -626,20 +642,6 @@ if test "x$mono_feature_disable_generics" = "xyes"; then
AC_DEFINE(DISABLE_GENERICS, 1, [Disable generics support])
fi
if test "x$mono_feature_disable_attach" = "xyes"; then
AC_DEFINE(DISABLE_ATTACH, 1, [Disable agent attach support])
fi
if test "x$mono_feature_disable_jit" = "xyes"; then
AC_DEFINE(DISABLE_JIT, 1, [Disable the JIT, only full-aot mode will be supported by the runtime.])
fi
AM_CONDITIONAL(DISABLE_JIT, test x$mono_feature_disable_jit = xyes)
if test "x$mono_feature_disable_simd" = "xyes"; then
AC_DEFINE(DISABLE_SIMD, 1, [Disable SIMD intrinsics related optimizations.])
fi
AC_MSG_CHECKING(for visibility __attribute__)
AC_TRY_COMPILE([], [
void __attribute__ ((visibility ("hidden"))) doit (void) {}
@@ -652,7 +654,7 @@ AC_TRY_COMPILE([], [
AC_MSG_RESULT(no)
])
AC_ARG_ENABLE(parallel-mark, [ --enable-parallel-mark Enables GC Parallel Marking], enable_parallel_mark=$enableval, enable_parallel_mark=$parallel_mark)
AC_ARG_ENABLE(parallel-mark, [ --enable-parallel-mark Enables GC Parallel Marking])
if test x$enable_parallel_mark = xyes; then
libgc_configure_args="$libgc_configure_args --enable-parallel-mark"
fi
@@ -1113,7 +1115,13 @@ if test x$platform_win32 = xno; then
# and libpthread does not exist
#
case "${host}" in
*-*-*freebsd*)
*-*-*freebsd4*)
AC_CHECK_LIB(pthread, main, LIBS="$LIBS -pthread")
;;
*-*-*freebsd5*)
AC_CHECK_LIB(pthread, main, LIBS="$LIBS -pthread")
;;
*-*-*freebsd6*)
AC_CHECK_LIB(pthread, main, LIBS="$LIBS -pthread")
;;
*)
@@ -1291,9 +1299,6 @@ if test x$platform_win32 = xno; then
# pthread (first!) on Linux
AC_SEARCH_LIBS(sem_init, pthread rt posix4)
AC_SEARCH_LIBS(shm_open, pthread rt posix4)
AC_CHECK_FUNCS(shm_open)
dnl ********************************
dnl *** Checks for timezone stuff **
dnl ********************************
@@ -1373,7 +1378,6 @@ if test x$platform_win32 = xno; then
AC_CHECK_HEADERS(net/if.h)
AC_MSG_CHECKING(for ifreq)
AC_TRY_COMPILE([
#include <stdio.h>
#include <sys/ioctl.h>
#include <net/if.h>
], [
@@ -1428,12 +1432,9 @@ if test x$platform_win32 = xno; then
AC_CHECK_HEADERS(sys/extattr.h)
AC_CHECK_HEADERS(sys/sendfile.h)
AC_CHECK_HEADERS(sys/statvfs.h)
AC_CHECK_HEADERS(sys/statfs.h)
AC_CHECK_HEADERS(sys/vfstab.h)
AC_CHECK_HEADERS(sys/xattr.h)
AC_CHECK_HEADERS(sys/mman.h)
AC_CHECK_HEADERS(sys/param.h)
AC_CHECK_HEADERS(sys/mount.h)
AC_CHECK_FUNCS(getdomainname)
AC_CHECK_FUNCS(setdomainname)
AC_CHECK_FUNCS(fgetgrent)
@@ -1467,17 +1468,12 @@ if test x$platform_win32 = xno; then
#include <unistd.h>])
AC_CHECK_TYPES([suseconds_t], [AC_DEFINE(HAVE_SUSECONDS_T)], ,
[#include <sys/time.h>])
AC_CHECK_TYPES([struct flock], [AC_DEFINE(HAVE_STRUCT_FLOCK)], ,
[#include <unistd.h>
#include <fcntl.h>])
AC_CHECK_TYPES([struct pollfd], [AC_DEFINE(HAVE_STRUCT_POLLFD)], ,
[#include <sys/poll.h>])
AC_CHECK_TYPES([struct stat], [AC_DEFINE(HAVE_STRUCT_STAT)], ,
[#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>])
AC_CHECK_TYPES([struct timespec], [AC_DEFINE(HAVE_STRUCT_TIMESPEC)], ,
[#include <time.h>])
AC_CHECK_TYPES([struct timeval], [AC_DEFINE(HAVE_STRUCT_TIMEVAL)], ,
[#include <sys/time.h>
#include <sys/types.h>
@@ -1498,20 +1494,11 @@ if test x$platform_win32 = xno; then
)
AC_SUBST(XATTR_LIB)
dnl kinfo_proc.kp_proc works on darwin but fails on other simil-bsds
AC_CHECK_MEMBERS(
[struct kinfo_proc.kp_proc],,,
[#include <sys/types.h>
#include <sys/sysctl.h>
#include <sys/proc.h>
])
dnl *********************************
dnl *** Checks for Windows compilation ***
dnl *********************************
AC_CHECK_HEADERS(sys/time.h)
AC_CHECK_HEADERS(sys/param.h)
AC_CHECK_HEADERS(dirent.h)
dnl *********************************
dnl *** Check for Console 2.0 I/O ***
@@ -1609,9 +1596,6 @@ if test "x$ac_cv_truncl" != "xyes"; then
AC_CHECK_LIB(sunmath, aintl, [ AC_DEFINE(HAVE_AINTL, 1, [Has the 'aintl' function]) LIBS="$LIBS -lsunmath"])
fi
AC_CHECK_FUNCS(round)
AC_CHECK_FUNCS(rint)
dnl ****************************
dnl *** Look for /dev/random ***
dnl ****************************
@@ -1697,35 +1681,21 @@ AM_CONDITIONAL(ENABLE_NUNIT_TESTS, [test x$enable_nunit_tests = xyes])
AC_MSG_CHECKING([if big-arrays are to be enabled])
AC_ARG_ENABLE(big-arrays, [ --enable-big-arrays Enable the allocation and indexing of arrays greater than Int32.MaxValue], enable_big_arrays=$enableval, enable_big_arrays=no)
if test "x$enable_big_arrays" = "xyes" ; then
if test "x$ac_cv_sizeof_void_p" = "x8"; then
AC_DEFINE(MONO_BIG_ARRAYS,1,[Enable the allocation and indexing of arrays greater than Int32.MaxValue])
else
AC_MSG_ERROR([The allocation and indexing of arrays greater than Int32.MaxValue is not supported on this platform.])
fi
fi
AC_MSG_RESULT($enable_big_arrays)
dnl **************
dnl *** DTRACE ***
dnl **************
AC_ARG_ENABLE(dtrace,[ --enable-dtrace Enable DTrace probes], enable_dtrace=$enableval, enable_dtrace=$has_dtrace)
if test "x$enable_dtrace" = "xyes"; then
if test "x$has_dtrace" = "xno"; then
AC_MSG_ERROR([DTrace probes are not supported on this platform.])
fi
AC_PATH_PROG(DTRACE, [dtrace], [no], [$PATH:/usr/sbin])
if test "x$DTRACE" = "xno"; then
AC_MSG_RESULT([dtrace utility not found, dtrace support disabled.])
enable_dtrace=no
fi
if test "x$enable_big_arrays" = "xyes" ; then
AC_DEFINE(MONO_BIG_ARRAYS,1,[Enable the allocation and indexing of arrays greater than Int32.MaxValue])
fi
AC_MSG_CHECKING([if DTrace support is requested])
AC_ARG_ENABLE(dtrace,[ --enable-dtrace Enable DTrace probes], enable_dtrace=$enableval, enable_dtrace=no)
AC_MSG_RESULT($enable_dtrace)
dtrace_g=no
if test "x$enable_dtrace" = "xyes"; then
AC_DEFINE(ENABLE_DTRACE, 1, [Enable DTrace probes])
AC_PATH_PROG(DTRACE, [dtrace], [no], [$PATH:/usr/sbin])
if test "x$DTRACE" = "xno"; then
AC_MSG_FAILURE([DTrace requested but not found])
fi
DTRACEFLAGS=
if test "x$ac_cv_sizeof_void_p" = "x8"; then
case "$host" in
@@ -1774,8 +1744,6 @@ SQLITE="libsqlite.so.0"
SQLITE3="libsqlite3.so.0"
X11="libX11.so"
sizeof_register="SIZEOF_VOID_P"
jit_wanted=false
interp_wanted=false
case "$host" in
@@ -1789,20 +1757,6 @@ case "$host" in
ACCESS_UNALIGNED="no"
JIT_SUPPORTED=yes
jit_wanted=true
AC_MSG_CHECKING(for mips n32)
AC_TRY_COMPILE([], [
void main () {
#if _MIPS_SIM != _ABIN32
#error Not mips n32
#endif
}
],[
AC_MSG_RESULT(yes)
sizeof_register=8
],[
AC_MSG_RESULT(no)
])
;;
i*86-*-*)
TARGET=X86;
@@ -1911,11 +1865,8 @@ case "$host" in
powerpc-*-sysv* | powerpc-*-darwin* | powerpc-*-netbsd* )
if test "x$ac_cv_sizeof_void_p" = "x8"; then
TARGET=POWERPC64;
CPPFLAGS="$CPPFLAGS -D__mono_ppc__ -D__mono_ppc64__"
CFLAGS="$CFLAGS -mminimal-toc"
else
TARGET=POWERPC;
CPPFLAGS="$CPPFLAGS -D__mono_ppc__"
fi
AC_DEFINE(MONO_ARCH_REGPARMS,1,[Architecture uses registers for Parameters])
arch_target=ppc;
@@ -1958,14 +1909,6 @@ case "$host" in
;;
esac
if test "x$sizeof_register" = "x4"; then
AC_DEFINE(SIZEOF_REGISTER,4,[size of machine integer registers])
elif test "x$sizeof_register" = "x8"; then
AC_DEFINE(SIZEOF_REGISTER,8,[size of machine integer registers])
else
AC_DEFINE(SIZEOF_REGISTER,SIZEOF_VOID_P,[size of machine integer registers])
fi
if test "x$have_visibility_hidden" = "xyes"; then
AC_DEFINE(HAVE_VISIBILITY_HIDDEN, 1, [Support for the visibility ("hidden") attribute])
fi
@@ -2162,32 +2105,12 @@ AC_ARG_WITH(moonlight,[ --with-moonlight=yes,no If you want to build the Moonl
])
OPROFILE=no
AC_ARG_WITH(oprofile,[ --with-oprofile=no,<oprofile install dir> Enable oprofile support (defaults to NO)],[
AC_ARG_WITH(oprofile,[ --with-oprofile=no,<path> Enable oprofile support (defaults to NO)],[
if test x$with_oprofile != xno; then
oprofile_include=$with_oprofile/include
if test ! -f $oprofile_include/opagent.h; then
AC_MSG_ERROR([oprofile include file not found at $oprofile_include/opagent.h])
fi
OPROFILE=yes
OPROFILE_CFLAGS="-I$oprofile_include"
OPROFILE_LIBS="-L$with_oprofile/lib/oprofile -lopagent"
AC_DEFINE(HAVE_OPROFILE,1,[Have oprofile support])
fi
])
MALLOC_MEMPOOLS=no
AC_ARG_WITH(malloc_mempools,[ --with-malloc-mempools=yes,no Use malloc for each single mempool allocation (only for runtime debugging, defaults to NO)],[
if test x$with_malloc_mempools = xyes; then
MALLOC_MEMPOOLS=yes
AC_DEFINE(USE_MALLOC_FOR_MEMPOOLS,1,[Use malloc for each single mempool allocation])
fi
])
DISABLE_MCS_DOCS=no
AC_ARG_WITH(mcs_docs,[ --with-mcs-docs=yes,no If you want to build the documentation under mcs (defaults to YES)],[
if test x$with_mcs_docs != xyes; then
DISABLE_MCS_DOCS=yes
OPROFILE=yes
OPROFILE_CFLAGS="-I$with_oprofile/include"
OPROFILE_LIBS=
AC_DEFINE(HAVE_OPROFILE,1,[Have oprofile support])
fi
])
@@ -2244,18 +2167,12 @@ AC_SUBST(mono_runtime)
mono_cfg_root=$mono_build_root/runtime
if test x$platform_win32 = xyes; then
if test "x$cross_compiling" = "xno"; then
mono_cfg_dir=`cygpath -w -a $mono_cfg_root`\\etc
else
mono_cfg_dir=`echo $mono_cfg_root | tr '/' '\\\'`\\etc
fi
mono_cfg_dir=`cygpath -w -a $mono_cfg_root`\\etc
else
mono_cfg_dir=$mono_cfg_root/etc
fi
AC_SUBST(mono_cfg_dir)
AC_CONFIG_FILES([po/mcs/Makefile.in])
AC_CONFIG_FILES([runtime/mono-wrapper],[chmod +x runtime/mono-wrapper])
AC_CONFIG_FILES([runtime/monodis-wrapper],[chmod +x runtime/monodis-wrapper])
@@ -2330,13 +2247,14 @@ AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/Browsers/Compat.browser],
],[LN_S='$LN_S'])
if test x$enable_quiet_build = xyes; then
AC_CONFIG_COMMANDS([quiet], [for i in `find mono libgc support -name Makefile.in | sed -e 's/Makefile.in/Makefile/g'`; do if test -f $i; then $srcdir/scripts/patch-quiet.sh $i; fi; done], [shell=$SHELL])
AC_CONFIG_COMMANDS([quiet], [find mono libgc support -name Makefile -exec $shell $srcdir/scripts/patch-quiet.sh {} \;], [shell=$SHELL])
AC_CONFIG_COMMANDS([quiet-libtool], [sed -e 's/$echo "copying selected/$show "copying selected/g' < libtool > libtool.tmp && mv libtool.tmp libtool && chmod a+x libtool])
fi
AC_OUTPUT([
Makefile
mono-uninstalled.pc
scripts/mono-nunit.pc
scripts/mono-find-provides
scripts/mono-find-requires
mono/Makefile
@@ -2368,6 +2286,7 @@ mono/tests/cas/inheritance/Makefile
mono/tests/cas/linkdemand/Makefile
mono/tests/cas/threads/Makefile
mono/benchmark/Makefile
mono/monoburg/Makefile
mono/monograph/Makefile
mono/io-layer/Makefile
mono/mini/Makefile
@@ -2384,17 +2303,10 @@ data/net_2_0/Browsers/Makefile
data/mint.pc
data/mono.pc
data/mono-cairo.pc
data/mono-nunit.pc
data/mono-options.pc
data/mono-lineeditor.pc
data/monodoc.pc
data/dotnet.pc
data/dotnet35.pc
data/wcf.pc
data/cecil.pc
data/smcs.pc
data/system.web.extensions_1.0.pc
data/system.web.extensions.design_1.0.pc
samples/Makefile
support/Makefile
data/config
@@ -2402,7 +2314,6 @@ tools/Makefile
tools/locale-builder/Makefile
runtime/Makefile
msvc/Makefile
po/Makefile
])
if test x$platform_win32 = xyes; then
@@ -2457,14 +2368,6 @@ fi
echo "MONO_VERSION = $myver" >> $srcdir/$mcsdir/build/config.make
fi
if test x$platform_darwin = xyes; then
echo "PLATFORM = darwin" >> $srcdir/$mcsdir/build/config.make
fi
if test x$TARGET = xAMD64 -a x$platform_win32 = xno -a "x$AOT_SUPPORTED" = "xyes"; then
echo "ENABLE_AOT = 1" >> $srcdir/$mcsdir/build/config.make
fi
# if we have an olive folder, override the default settings
if test -d $olivedir; then
@@ -2482,10 +2385,6 @@ fi
fi
fi
fi
if test x$DISABLE_MCS_DOCS = xyes; then
echo "DISABLE_MCS_DOCS = yes" >> $srcdir/$mcsdir/build/config.make
fi
)
libgdiplus_msg=${libgdiplus_loc:-assumed to be installed}
@@ -2494,24 +2393,22 @@ echo "
mcs source: $mcs_topdir
olive source: $olive_topdir
GC: $gc
TLS: $with_tls
SIGALTSTACK: $with_sigaltstack
Engine: $jit_status
2.0 Beta: $PREVIEW
2.1 Alpha: $MOONLIGHT
JNI support: $jdk_headers_found
libgdiplus: $libgdiplus_msg
zlib: $zlib_msg
oprofile: $OPROFILE
BigArrays: $enable_big_arrays
DTrace: $enable_dtrace
Parallel Mark: $enable_parallel_mark
GC: $gc
TLS: $with_tls
SIGALTSTACK: $with_sigaltstack
Engine: $jit_status
2.0 Beta: $PREVIEW
2.1 Alpha: $MOONLIGHT
JNI support: $jdk_headers_found
libgdiplus: $libgdiplus_msg
zlib: $zlib_msg
oprofile: $OPROFILE
BigArrays: $enable_big_arrays
$disabled
"
if test x$with_static_mono = xno -a "x$platform_win32" != "xyes"; then
AC_MSG_WARN(Turning off static Mono is a risk, you might run into unexpected bugs)
AC_MSG_WARN(Turning off static Mono is a risk, you might run into unexepcted bugs)
fi
if test x$gc = xsgen; then
+6 -11
View File
@@ -5,27 +5,22 @@ monodir = $(sysconfdir)/mono
EXTRA_DIST = \
config.in \
browscap.ini mono.supp mono.d README \
mono.pc.in mint.pc.in dotnet.pc.in dotnet35.pc.in wcf.pc.in monodoc.pc.in \
mono-nunit.pc.in mono-cairo.pc.in mono-options.pc.in cecil.pc.in smcs.pc.in \
mono-lineeditor.pc.in system.web.extensions_1.0.pc.in system.web.extensions.design_1.0.pc.in\
dtrace-prelink.sh
mono.pc.in mint.pc.in dotnet.pc.in dotnet35.pc.in \
mono-cairo.pc.in cecil.pc.in smcs.pc.in
pkgconfigdir = $(libdir)/pkgconfig
if JIT_SUPPORTED
if INTERP_SUPPORTED
pkgconfig_DATA= mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc
pkgconfig_DATA= mono.pc mint.pc dotnet.pc dotnet35.pc mono-cairo.pc cecil.pc smcs.pc
else
pkgconfig_DATA= mono.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc
pkgconfig_DATA= mono.pc dotnet.pc dotnet35.pc mono-cairo.pc cecil.pc smcs.pc
endif
else
pkgconfig_DATA= mint.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc
pkgconfig_DATA= mint.pc mono-cairo.pc cecil.pc smcs.pc
endif
DISTCLEANFILES= mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc
DISTCLEANFILES= mono.pc mint.pc dotnet.pc dotnet35.pc mono-cairo.pc cecil.pc smcs.pc
mono_DATA = config \
browscap.ini
+1 -1
View File
@@ -1,5 +1,5 @@
assemblies_dir=@prefix@/lib/mono
Libraries=${assemblies_dir}/gac/Mono.Cecil/0.6.9.0__0738eb9f132ed756/Mono.Cecil.dll
Libraries=${assemblies_dir}/gac/Mono.Cecil/0.6.8.8607__0738eb9f132ed756/Mono.Cecil.dll
Name: Mono Internal -- Do not use.
Description: Mono Internal Libraries -- Do not use
+1 -1
View File
@@ -2,4 +2,4 @@
Name: Standard libraries in a .NET setup
Description: References all the standard .NET libraries for compilation (.NET Framework 3.5 compatibility)
Version: @VERSION@
Libs: -r:Accessibility.dll -r:cscompmgd.dll -r:Microsoft.JScript.dll -r:Microsoft.VisualC.dll -r:Microsoft.Vsa.dll -r:System.Configuration.Install.dll -r:System.Data.dll -r:System.Data.OracleClient.dll -r:System.Design.dll -r:System.DirectoryServices.dll -r:System.dll -r:System.Drawing.Design.dll -r:System.Drawing.dll -r:System.EnterpriseServices.dll -r:System.Management.dll -r:System.Messaging.dll -r:System.Runtime.Remoting.dll -r:System.Runtime.Serialization.Formatters.Soap.dll -r:System.Security.dll -r:System.ServiceProcess.dll -r:System.Web.dll -r:System.Web.Services.dll -r:System.Windows.Forms.dll -r:System.Xml.dll -r:System.Configuration.dll -r:System.Core.dll -r:System.Xml.Linq.dll -r:System.Data.DataSetExtensions.dll -r:System.Data.Linq.dll -r:System.Web.Abstractions.dll -r:System.Web.Routing.dll -r:System.Web.DynamicData.dll -r:System.ComponentModel.DataAnnotations.dll
Libs: -r:Accessibility.dll -r:cscompmgd.dll -r:Microsoft.JScript.dll -r:Microsoft.VisualC.dll -r:Microsoft.Vsa.dll -r:System.Configuration.Install.dll -r:System.Data.dll -r:System.Data.OracleClient.dll -r:System.Design.dll -r:System.DirectoryServices.dll -r:System.dll -r:System.Drawing.Design.dll -r:System.Drawing.dll -r:System.EnterpriseServices.dll -r:System.Management.dll -r:System.Messaging.dll -r:System.Runtime.Remoting.dll -r:System.Runtime.Serialization.Formatters.Soap.dll -r:System.Security.dll -r:System.ServiceProcess.dll -r:System.Web.dll -r:System.Web.Services.dll -r:System.Windows.Forms.dll -r:System.Xml.dll -r:System.Configuration.dll -r:System.Core.dll -r:System.Xml.Linq.dll -r:System.Data.DataSetExtensions.dll
-22
View File
@@ -1,22 +0,0 @@
2009-02-03 Zoltan Varga <[email protected]>
* mono-gdb.py: Remove the --64 argument to as, it is not needed.
* mono-gdb.py (stringify_class_name): Helper function to print base types
using their short name. Also add a prototype implementation of registering
the hooks from python code instead of needing the mono-gdbinit file.
* gdb-python.diff: Changes against the gdb archer branch at
http://sourceware.org/gdb/wiki/PythonGdb to fix some problems/add functionality.
2009-02-03 Geoff Norton <[email protected]>
* mono-gdbinit: Hook into backtrace as hook-stop seems to crash gdb
* mono-gdb.py: Find the gdbinit name from the executable name instead of
hardcoding mono
2009-01-29 Zoltan Varga <[email protected]>
* mono-gdb.py mono-gdbinit: Support files to help debugging mono/mono apps
using a python enabled gdb.
-163
View File
@@ -1,163 +0,0 @@
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 640998b..fb73e9d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2009-02-03 Zoltan Varga <[email protected]>
+
+ * cil-script.c python/python-cmd.c: Allow registration of pre/post hooks from
+ python.
+
+ * symfile.c (add_symbol_file_command): Comment out verbose messages.
+
2009-02-03 Thiago Jung Bauermann <[email protected]>
* gdb/c-lang.c (c_get_string): Remove superfluous parenthesis from
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index 835d29c..3941aa5 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -299,6 +299,13 @@ execute_user_command (struct cmd_list_element *c, char *args)
static int user_call_depth = 0;
extern int max_user_call_depth;
+ /* Might be a user defined command implemented in Python */
+ if (!c->user_commands && c->func)
+ {
+ (*c->func) (c, args, FALSE);
+ return;
+ }
+
old_chain = setup_user_args (args);
cmdlines = c->user_commands;
diff --git a/gdb/python/python-cmd.c b/gdb/python/python-cmd.c
index 61d5e5d..a3fbc08 100644
--- a/gdb/python/python-cmd.c
+++ b/gdb/python/python-cmd.c
@@ -339,7 +339,8 @@ gdbpy_parse_command_name (char *text, struct cmd_list_element ***base_list,
/* Object initializer; sets up gdb-side structures for command.
- Use: __init__(NAME, CMDCLASS, [COMPLETERCLASS, [PREFIX]]).
+ Use: __init__(NAME, CMDCLASS, [completerclass=COMPLETERCLASS, prefix=PREFIX,
+ pre_hook_of=PREHOOK_OF, post_hook_of=POSTHOOK_OF]).
NAME is the name of the command. It may consist of multiple words,
in which case the final word is the name of the new command, and
@@ -354,6 +355,11 @@ gdbpy_parse_command_name (char *text, struct cmd_list_element ***base_list,
If PREFIX is True, then this command is a prefix command.
+ PREHOOK_OF is the name of a gdb command this command becomes a
+ pre-execution hook of, same as if this command was defined using
+ "define hook-<cmdname>"
+ POSTHOOK_OF is the same for post-execution hooks.
+
The documentation for the command is taken from the doc string for
the python class.
@@ -362,15 +368,18 @@ static int
cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
{
cmdpy_object *obj = (cmdpy_object *) self;
- char *name;
+ char *name, *pre_hook_of = NULL, *post_hook_of = NULL;
int cmdtype;
int completetype = -1;
char *docstring = NULL;
volatile struct gdb_exception except;
struct cmd_list_element **cmd_list;
+ struct cmd_list_element *pre_hookc = NULL, *post_hookc = NULL;
char *cmd_name, *pfx_name;
PyObject *is_prefix = NULL;
int cmp;
+ static char *kwlist[] = {"name", "cmdclass", "completerclass", "prefix",
+ "pre_hook_of", "post_hook_of", NULL};
if (obj->command)
{
@@ -381,8 +390,9 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
return -1;
}
- if (! PyArg_ParseTuple (args, "si|iO", &name, &cmdtype,
- &completetype, &is_prefix))
+ if (! PyArg_ParseTupleAndKeywords (args, kwds, "si|iOss", kwlist, &name, &cmdtype,
+ &completetype, &is_prefix, &pre_hook_of,
+ &post_hook_of))
return -1;
if (cmdtype != no_class && cmdtype != class_run
@@ -402,6 +412,30 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
return -1;
}
+ if (pre_hook_of)
+ {
+ char *text = pre_hook_of;
+
+ pre_hookc = lookup_cmd_1 (&text, cmdlist, NULL, 1);
+ if (! pre_hookc)
+ {
+ PyErr_Format (PyExc_RuntimeError, _("command name given by pre_hook argument not found"));
+ return -1;
+ }
+ }
+
+ if (post_hook_of)
+ {
+ char *text = post_hook_of;
+
+ post_hookc = lookup_cmd_1 (&text, cmdlist, NULL, 1);
+ if (! post_hookc)
+ {
+ PyErr_Format (PyExc_RuntimeError, _("command name given by post_hook argument not found"));
+ return -1;
+ }
+ }
+
cmd_name = gdbpy_parse_command_name (name, &cmd_list, &cmdlist);
if (! cmd_name)
return -1;
@@ -470,6 +504,18 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
cmd->func = cmdpy_function;
cmd->destroyer = cmdpy_destroyer;
+ if (pre_hookc)
+ {
+ pre_hookc->hook_pre = cmd;
+ cmd->hookee_pre = pre_hookc;
+ }
+
+ if (post_hookc)
+ {
+ post_hookc->hook_post = cmd;
+ cmd->hookee_post = post_hookc;
+ }
+
obj->command = cmd;
set_cmd_context (cmd, self);
set_cmd_completer (cmd, ((completetype == -1) ? cmdpy_completer
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 14cb7b8..6d0bb40 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -2196,7 +2196,7 @@ add_symbol_file_command (char *args, int from_tty)
statements because hex_string returns a local static
string. */
- printf_unfiltered (_("add symbol table from file \"%s\" at\n"), filename);
+ /* printf_unfiltered (_("add symbol table from file \"%s\" at\n"), filename); */
section_addrs = alloc_section_addr_info (section_index);
make_cleanup (xfree, section_addrs);
for (i = 0; i < section_index; i++)
@@ -2211,7 +2211,7 @@ add_symbol_file_command (char *args, int from_tty)
entered on the command line. */
section_addrs->other[sec_num].name = sec;
section_addrs->other[sec_num].addr = addr;
- printf_unfiltered ("\t%s_addr = %s\n", sec, paddress (addr));
+ /* printf_unfiltered ("\t%s_addr = %s\n", sec, paddress (addr)); */
sec_num++;
/* The object's sections are initialized when a
-181
View File
@@ -1,181 +0,0 @@
#
# Author: Zoltan Varga ([email protected])
# License: MIT/X11
#
#
# This is a mono support mode for a python-enabled gdb:
# http://sourceware.org/gdb/wiki/PythonGdb
# Usage:
# - copy/symlink this file, plus mono-gdbinit to the directory where the mono
# executable lives.
# - run mono under gdb, or attach to a mono process using gdb
# - Type 'xdb' in gdb to load/reload the debugging info emitted by the runtime.
# - The debug info is emitted to a file called xdb.s in the current working directory.
# When attaching to a mono process, make sure you are in the same directory.
#
import os
class StringPrinter:
"Print a C# string"
def __init__(self, val):
self.val = val
def to_string(self):
if int(self.val.cast (gdb.Type ("guint64"))) == 0:
return "null"
obj = self.val.cast (gdb.Type ("MonoString").pointer ()).dereference ()
len = obj ['length']
chars = obj ['chars']
i = 0
res = ['"']
while i < len:
c = chr ((chars.cast(gdb.Type ("gint64")) + (i * 2)).cast(gdb.Type ("gunichar2").pointer ()).dereference ())
res.append (c)
i = i + 1
res.append ('"')
return ''.join (res)
def stringify_class_name(ns, name):
if ns == "System":
if name == "Byte":
return "byte"
if name == "String":
return "string"
return "%s.%s" % (ns, name)
class ArrayPrinter:
"Print a C# array"
def __init__(self, val, class_ns, class_name):
self.val = val
self.class_ns = class_ns
self.class_name = class_name
def to_string(self):
obj = self.val.cast (gdb.Type ("MonoArray").pointer ()).dereference ()
length = obj ['max_length']
return "%s [%d]" % (stringify_class_name (self.class_ns, self.class_name [0:len(self.class_name) - 2]), int(length))
class ObjectPrinter:
"Print a C# object"
def __init__(self, val):
self.val = val
class _iterator:
def __init__(self,obj):
self.obj = obj
self.iter = self.obj.type ().fields ().__iter__ ()
pass
def __iter__(self):
return self
def next(self):
field = self.iter.next ()
return (field.name, self.obj [field.name])
def children(self):
# FIXME: It would be easier if gdb.Value would support iteration itself
# It would also be better if we could return None
if int(self.val.cast (gdb.Type ("guint64"))) == 0:
return {}.__iter__ ()
try:
obj = self.val.cast (gdb.Type ("MonoObject").pointer ()).dereference ()
class_ns = obj ['vtable'].dereference ()['klass'].dereference ()['name_space'].string ()
class_name = obj ['vtable'].dereference ()['klass'].dereference ()['name'].string ()
gdb_type = gdb.Type ("struct %s.%s" % (class_ns, class_name))
return self._iterator(obj.cast (gdb_type))
except:
return {}.__iter__ ()
def to_string(self):
if int(self.val.cast (gdb.Type ("guint64"))) == 0:
return "null"
try:
obj = self.val.cast (gdb.Type ("MonoObject").pointer ()).dereference ()
class_ns = obj ['vtable'].dereference ()['klass'].dereference ()['name_space'].string ()
class_name = obj ['vtable'].dereference ()['klass'].dereference ()['name'].string ()
if class_ns == "System" and class_name == "String":
return StringPrinter (self.val).to_string ()
if class_name [-2:len(class_name)] == "[]":
return ArrayPrinter (self.val,class_ns,class_name).to_string ()
if class_ns != "":
try:
gdb_type = gdb.Type ("struct %s.%s" % (class_ns, class_name))
except:
# Maybe there is no debug info for that type
return "%s.%s" % (class_ns, class_name)
#return obj.cast (gdb_type)
return "%s.%s" % (class_ns, class_name)
return class_name
except:
print sys.exc_info ()[0]
print sys.exc_info ()[1]
# FIXME: This can happen because we don't have liveness information
return self.val.cast (gdb.Type ("guint64"))
def register_csharp_printers(obj):
"Register C# pretty-printers with objfile Obj."
if obj == None:
obj = gdb
obj.pretty_printers['object'] = ObjectPrinter
obj.pretty_printers['string'] = StringPrinter
register_csharp_printers (gdb.current_objfile())
class MonoSupport(object):
def __init__(self):
self.s_size = 0
def run_hook(self):
if os.access ("xdb.s", os.F_OK):
os.remove ("xdb.s")
gdb.execute ("set environment MONO_XDEBUG 1")
def stop_hook(self):
# Called when the program is stopped
# Need to recompile+reload the xdb.s file if needed
# FIXME: Need to detect half-written files created when the child is
# interrupted while executing the xdb.s writing code
# FIXME: Handle appdomain unload
if os.access ("xdb.s", os.F_OK):
new_size = os.stat ("xdb.s").st_size
if new_size > self.s_size:
sofile = "xdb.so"
gdb.execute ("shell as -o xdb.o xdb.s && ld -shared -o %s xdb.o" % sofile)
# FIXME: This prints messages which couldn't be turned off
gdb.execute ("add-symbol-file %s 0" % sofile)
self.s_size = new_size
class RunHook (gdb.Command):
def __init__ (self):
super (RunHook, self).__init__ ("hook-run", gdb.COMMAND_NONE,
gdb.COMPLETE_COMMAND, pre_hook_of="run")
def invoke(self, arg, from_tty):
mono_support.run_hook ()
print "Mono support loaded."
mono_support = MonoSupport ()
# This depends on the changes in gdb-python.diff to work
#RunHook ()
# Register our hooks
# This currently cannot be done from python code
exec_file = gdb.current_objfile ().filename
# FIXME: Is there a way to detect symbolic links ?
if os.stat (exec_file).st_size != os.lstat (exec_file).st_size:
exec_file = os.readlink (exec_file)
exec_dir = os.path.dirname (exec_file)
gdb.execute ("source %s/%s-gdbinit" % (exec_dir, os.path.basename (exec_file)))
-20
View File
@@ -1,20 +0,0 @@
# Loaded by mono-gdb.py
# FIXME: According to gdb docs, this is called _before_ anything is printed
# Got broken by this patch:
# http://sourceware.org/ml/gdb-patches/2008-09/msg00193.html
# FIXME: This seems to cause crashes inside gdb
#define hook-stop
# python mono_support.stop_hook ()
#end
define hook-backtrace
python mono_support.stop_hook ()
end
define hook-run
python mono_support.run_hook ()
end
define xdb
python mono_support.stop_hook ()
end
-7
View File
@@ -1,7 +0,0 @@
prefix=${pcfiledir}/../..
assemblies_dir=${prefix}/lib/mono-source-libs
Sources=${assemblies_dir}/getline.cs
Name: Mono.Terminal.LineEditor
Description: Terminal text entry editor using System.Console.
Version: 0.2.1
-9
View File
@@ -1,9 +0,0 @@
prefix=${pcfiledir}/../..
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
Name: Mono NUnit
Description: Mono's version of NUnit
Version: @VERSION@
Libs: -r:${libdir}/mono/1.0/nunit.core.dll -r:${libdir}/mono/1.0/nunit.core.interfaces.dll -r:${libdir}/mono/1.0/nunit.core.extensions.dll -r:${libdir}/mono/1.0/nunit.framework.dll -r:${libdir}/mono/1.0/nunit.framework.extensions.dll -r:${libdir}/mono/1.0/nunit.mocks.dll -r:${libdir}/mono/1.0/nunit.util.dll -r:${libdir}/mono/1.0/nunit-console-runner.dll
-7
View File
@@ -1,7 +0,0 @@
prefix=${pcfiledir}/../..
assemblies_dir=${prefix}/lib/mono-source-libs
Sources=${assemblies_dir}/Options.cs
Name: Mono.Options
Description: Command Line Parsing Library
Version: 0.2.1
-9
View File
@@ -1,9 +0,0 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@prefix@/lib
sourcesdir=${libdir}/monodoc/sources
Name: Monodoc
Description: Monodoc - Mono Documentation Tools
Version: @VERSION@
Libs: /r:${prefix}/lib/mono/monodoc/monodoc.dll
-59
View File
@@ -1,62 +1,3 @@
2009-01-23 Atsushi Enomoto <[email protected]>
* web.config : added .svc handler.
2009-01-07 Kornél Pál <[email protected]>
* DefaultWsdlHelpGenerator.aspx: Move <script> at the end of <head> that
will make Visual Studio recognize the web service disco reference.
Contributed under MIT/X11 license.
2008-12-03 Marek Habersack <[email protected]>
* machine.config: rename serviceModelHostingEnvironment to
serviceHostingEnvironment.
2008-11-20 Gonzalo Paniagua Javier <[email protected]>
* machine.config: in 2.0, there's no <connectionManagement> section
here. Bug #445991 fixed.
2008-11-14 Gonzalo Paniagua Javier <[email protected]>
* DefaultWsdlHelpGenerator.aspx: use javascript instead of
HttpWebRequest to avoid a deadlock if the web service uses Session.
Bug #444343 fixed.
2008-10-09 Gonzalo Paniagua Javier <[email protected]>
* web.config: default values for httpRuntime are different in 2.0
2008-10-09 Marek Habersack <[email protected]>
* web.config: added the default monoSettings section which works around
an incompatibility between mcs and csc, mentioned in bug #433806
* machine.config: added definition of the monoSettings section to
the system.web group
2008-10-06 Marek Habersack <[email protected]>
* machine.config: added entries to ignore the mobileControls and
deviceFilters sections.
2008-09-02 Marek Habersack <[email protected]>
* web.config: removed System.Web.Extensions.dll from the assemblies
(reverting r112073) - it would break all the ASP.NET applications
which use System.Web.Extensions other than 3.5.0.0
2008-09-06 Daniel Morgan <[email protected]>
* machine.config: added Mono.Data.SybaseClient
to DbProviderFactories section.
2008-09-02 Atsushi Enomoto <[email protected]>
* web.config: added System.Web.Extensions.dll to assemblies.
2008-08-28 Zoltan Varga <[email protected]>
* machine.config: Fix syntax error.
+64 -92
View File
@@ -329,31 +329,21 @@ class NoCheckCertificatePolicy : ICertificatePolicy {
}
}
string GetOrPost ()
{
return (CurrentOperationProtocols.IndexOf ("HttpGet") >= 0) ? "GET" : "POST";
}
string GetQS ()
{
string GetTestResult ()
{
if (!HasFormResult) return null;
bool fill = false;
string qs = "";
NameValueCollection query_string = Request.QueryString;
for (int n = 0; n < query_string.Count; n++) {
for (int n=0; n<Request.QueryString.Count; n++)
{
if (fill) {
if (qs != "") qs += "&";
qs += query_string.GetKey(n) + "=" + Server.UrlEncode (query_string [n]);
qs += Request.QueryString.GetKey(n) + "=" + Server.UrlEncode (Request.QueryString [n]);
}
if (query_string.GetKey(n) == "ext") fill = true;
if (Request.QueryString.GetKey(n) == "ext") fill = true;
}
return qs;
}
string GetTestResultUrl ()
{
if (!HasFormResult) return "";
string location = null;
ServiceDescription desc = descriptions [0];
Service service = desc.Services[0];
@@ -368,7 +358,59 @@ string GetTestResultUrl ()
if (location == null)
return "Could not locate web service";
return location + "/" + CurrentOperationName;
try
{
string url = location + "/" + CurrentOperationName;
Uri uri = new Uri (url);
WebRequest req;
if (CurrentOperationProtocols.IndexOf ("HttpGet") < 0) {
req = WebRequest.Create (url);
req.Method="POST";
if (!String.IsNullOrEmpty (qs)) {
req.ContentType = "application/x-www-form-urlencoded";
byte [] postBuffer = Encoding.UTF8.GetBytes (qs);
req.ContentLength = postBuffer.Length;
using (Stream requestStream = req.GetRequestStream())
requestStream.Write (postBuffer, 0, postBuffer.Length);
}
}
else
req = WebRequest.Create (url + "?" + qs);
if (url.StartsWith ("https:"))
ServicePointManager.CertificatePolicy = new NoCheckCertificatePolicy ();
HttpCookieCollection cookies = Request.Cookies;
int last = cookies.Count;
if (last > 0) {
CookieContainer container = new CookieContainer ();
for (int i = 0; i < last; i++) {
HttpCookie hcookie = cookies [i];
Cookie cookie = new Cookie (hcookie.Name, hcookie.Value, hcookie.Path, hcookie.Domain);
container.Add (uri, cookie);
}
((HttpWebRequest) req).CookieContainer = container;
}
WebResponse resp = req.GetResponse();
StreamReader sr = new StreamReader (resp.GetResponseStream());
string s = sr.ReadToEnd ();
sr.Close ();
return "<div class='code-xml'>" + ColorizeXml(WrapText(s,CodeTextColumns)) + "</div>";
}
catch (Exception ex)
{
string res = "<b style='color:red'>" + ex.Message + "</b>";
WebException wex = ex as WebException;
if (wex != null)
{
WebResponse resp = wex.Response;
if (resp != null) {
StreamReader sr = new StreamReader (resp.GetResponseStream());
string s = sr.ReadToEnd ();
sr.Close ();
res += "<div class='code-xml'>" + ColorizeXml(WrapText(s,CodeTextColumns)) + "</div>";
}
}
return res;
}
}
string GenerateOperationMessages (string protocol, bool generateInput)
@@ -1548,73 +1590,7 @@ public class HtmlSampleGenerator: SampleGenerator
A:hover { color: blue }
</style>
<script language="javascript" type="text/javascript">
var req;
function getXML (command, url, qs) {
if (url == "" || url.substring (0, 4) != "http")
return;
var post_data = null;
req = getReq ();
req.onreadystatechange = stateChange;
if (command == "GET") {
url = url + "?" + qs;
} else {
post_data = qs;
}
req.open (command, url, true);
if (command == "POST")
req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
req.send (post_data);
}
function stateChange () {
if (req.readyState == 4) {
var node = document.getElementById("testresult_div");
var text = "";
if (req.status == 200) {
node.innerHTML = "<div class='code-xml'>" + formatXml (req.responseText) + "</div>";
} else {
var ht = "<b style='color: red'>" + formatXml (req.status + " - " + req.statusText) + "</b>";
if (req.responseText != "")
ht = ht + "\n<div class='code-xml'>" + formatXml (req.responseText) + "</div>";
node.innerHTML = ht;
}
}
}
function formatXml (text)
{
var re = / /g;
text = text.replace (re, "&nbsp;");
re = /\t/g;
text = text.replace (re, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
re = /\<\s*(\/?)\s*(.*?)\s*(\/?)\s*\>/g;
text = text.replace (re,"{blue:&lt;$1}{maroon:$2}{blue:$3&gt;}");
re = /{(\w*):(.*?)}/g;
text = text.replace (re,"<span style='color:$1'>$2</span>");
re = /"(.*?)"/g;
text = text.replace (re,"\"<span style='color:purple'>$1</span>\"");
re = /\r\n|\r|\n/g;
text = text.replace (re, "<br/>");
return text;
}
function getReq () {
if (window.XMLHttpRequest) {
return new XMLHttpRequest(); // Firefox, Safari, ...
} else if (window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
}
}
<script>
function clearForm ()
{
document.getElementById("testFormResult").style.display="none";
@@ -1771,11 +1747,7 @@ This service does not contain any public web method.
</form>
<div id="testFormResult" style="display:<%= (HasFormResult?"block":"none") %>">
The web service returned the following result:<br/><br/>
<div class="codePanel" id="testresult_div">
</div>
<script language="javascript">
getXML ("<%= GetOrPost () %>", "<%= GetTestResultUrl () %>", "<%= GetQS () %>");
</script>
<div class="codePanel"><%=GetTestResult()%></div>
</div>
<% } else {%>
The test form is not available for this operation because it has parameters with a complex structure.
+4 -7
View File
@@ -37,8 +37,6 @@
<section name="identity" type="System.Web.Configuration.IdentitySection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="machineKey" type="System.Web.Configuration.MachineKeySection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="membership" type="System.Web.Configuration.MembershipSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="mobileControls" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="deviceFilters" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="pages" type="System.Web.Configuration.PagesSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="processModel" type="System.Web.Configuration.ProcessModelSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineOnly" allowLocation="false" />
<section name="profile" type="System.Web.Configuration.ProfileSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
@@ -60,7 +58,6 @@
<section name="outputCacheSettings" type="System.Web.Configuration.OutputCacheSettingsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
<section name="sqlCacheDependency" type="System.Web.Configuration.OutputCacheSettingsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
</sectionGroup>
<section name="monoSettings" type="System.Web.Configuration.MonoSettingsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</sectionGroup>
<sectionGroup name="system.net" type="System.Net.Configuration.NetSectionGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="authenticationModules" type="System.Net.Configuration.AuthenticationModulesSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
@@ -81,7 +78,7 @@
<section name="commonBehaviors" type="System.ServiceModel.Configuration.CommonBehaviorsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="diagnostic" type="System.ServiceModel.Configuration.DiagnosticSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="extensions" type="System.ServiceModel.Configuration.ExtensionsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="serviceHostingEnvironment" type="System.ServiceModel.Configuration.ServiceHostingEnvironmentSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="serviceModelHostingEnvironment" type="System.ServiceModel.Configuration.ServiceHostingEnvironmentSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="services" type="System.ServiceModel.Configuration.ServicesSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
<section name="system.webServer" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
@@ -102,6 +99,9 @@
</configProtectedData>
<system.net>
<connectionManagement>
<add address="*" maxconnection="2" />
</connectionManagement>
<authenticationModules>
<add type="System.Net.BasicClient, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add type="System.Net.DigestClient, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
@@ -181,9 +181,6 @@
<add name="SqlClient Data Provider" invariant="System.Data.SqlClient"
description=".Net Framework Data Provider for SqlServer"
type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add name="Sybase Data Provider" invariant="Mono.Data.SybaseClient"
description=".Net Framework Data Provider for Sybase"
type="Mono.Data.SybaseClient.SybaseClientFactory, Mono.Data.SybaseClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"/>
</DbProviderFactories>
</system.data>
+4 -13
View File
@@ -3,19 +3,11 @@
<configuration>
<system.web>
<monoSettings>
<compilersCompatibility>
<compiler language="c#;cs;csharp" extension=".cs" compilerOptions="/nowarn:0169"
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</compilersCompatibility>
</monoSettings>
<authorization>
<allow users="*" />
</authorization>
<httpHandlers>
<add verb="*" path="Trace.axd" type="System.Web.Handlers.TraceHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.asmx" validate="false" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.ashx" type="System.Web.UI.SimpleHandlerFactory, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
@@ -37,9 +29,8 @@
<add verb="*" path="*.vbproj" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.licx" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.dll" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.rem" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
<add verb="*" path="*.soap" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
<add verb="*" path="*.svc" type="System.ServiceModel.Channels.SvcHttpHandlerFactory, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add verb="*" path="*.rem" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
<add verb="*" path="*.soap" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
<add verb="GET,HEAD" path="*" type="System.Web.StaticFileHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*" type="System.Web.HttpMethodNotAllowedHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</httpHandlers>
@@ -124,12 +115,12 @@
<add extension=".refresh" type="System.Web.Compilation.IgnoreFileBuildProvider" />
</buildProviders>
</compilation>
<httpRuntime executionTimeout="110"
<httpRuntime executionTimeout="90"
maxRequestLength="4096"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="5000" />
appRequestQueueLimit="100" />
<clientTarget>
<add alias="ie5" userAgent="Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)" />
<add alias="ie4" userAgent="Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 4.0)" />
@@ -1,4 +0,0 @@
Name: System.Web.Extensions.Design
Description: System.Web.Extensions.Design ASP.NET 2.0 add-on
Version: 1.0.61025.0
Libs: -r:@prefix@/lib/mono/gac/System.Web.Extensions.Design/1.0.61025.0__31bf3856ad364e35/System.Web.Extensions.Design.dll
-4
View File
@@ -1,4 +0,0 @@
Name: System.Web.Extensions
Description: System.Web.Extensions ASP.NET 2.0 add-on
Version: 1.0.61025.0
Libs: -r:@prefix@/lib/mono/gac/System.Web.Extensions/1.0.61025.0__31bf3856ad364e35/System.Web.Extensions.dll
-5
View File
@@ -1,5 +0,0 @@
Name: WCF
Description: References WCF for compilation
Version: @VERSION@
Libs: -r:System.Runtime.Serialization.dll -r:System.IdentityModel.dll -r:System.IdentityModel.Selectors.dll -r:System.ServiceModel.dll -r:System.ServiceModel.Web.dll
-114
View File
@@ -1,114 +0,0 @@
2009-02-12 Zoltan Varga <[email protected]>
* Makefile.am (EXTRA_DIST): Remove removed files.
* README: Point to the documentation on the wiki.
* call-sites.txt: Remove this, its contents is in jit-trampolines.
* memory-management.txt thread-safety.txt aot-compiler.txt jit-regalloc
exception-handling.txt: Remove documents which are now on the wiki.
2009-02-11 Rodrigo Kumpera <[email protected]>
* thread-safety.txt: Improve the docs about image lock.
2009-02-11 Rodrigo Kumpera <[email protected]>
* thread-safety.txt: Document the new image lock.
2008-12-12 Mark Probst <[email protected]>
* mini-porting.txt: Added some details about function descriptors
and emulated opcodes.
2008-12-08 Jonathan Pryor <[email protected]>
* mono-file-formats.source, mono-tools.source: Place these under the
new "Commands and Files" node, and remove nay intermediate nodes.
2008-11-20 Jonathan Pryor <[email protected]>
* Makefile.am (sources_DATA): Add mono-file-formats.source,
mono-tools.source.
2008-11-20 Raja R Harinath <[email protected]>
Remove unnecessary rebuilds of the html directory
* docs.make (monoapi.zip): Make slightly more unforgiving, by
using '&&' instead of ';' to sequence commands.
(mono-tools.zip, mono-file-formats.zip): Likewise.
* Makefile.am (monoapi.zip, mono-tools.zip, mono-fileformats.zip):
Likewise.
(convert.exe): Don't depend on Makefile.am or docs.make.
2008-11-19 Raja R Harinath <[email protected]>
Fix srcdir != builddir, and add idiom for multi-output commands
* docs.make (monoapi.zip): Handle the case where 'monoapi.tree'
exists but 'monoapi.zip' doesn't. IOW, we should rebuild
monoapi.zip with 'rm monoapi.zip; make'.
(mono-tools.zip, mono-file-formats.zip): Likewise.
* Makefile.am (monoapi.zip, mono-tools.zip, mono-fileformats.zip):
Likewise.
(monoapi.tree): Don't use $< in an explicit rule.
(mono-tools.tree, mono-file-formats.tree): Likewise.
2008-11-18 Jonathan Pryor <[email protected]>
* Makefile.am (EXTRA_DIST): Add mono-file-formats{.config,.source} and
mono-tools{.config,.source} (fixes the build).
2008-11-18 Jonathan Pryor <[email protected]>
* docs.make, Makefile.am: Build mono-file-formats{.tree,.zip},
mono-tool{.tree,.zip} files.
* mono-file-formats.config, mono-tools.config: Alter paths to man
pages so that they're valid for building from mono/docs.
* monoapi.make: Rename to docs.make.
2008-11-01 Raja R Harinath <[email protected]>
* Makefile.am: Clean up for srcdir != builddir.
(deploy/.stamp): Compute location of 'mono-wrapper' and pass to exdoc.
* exdoc (mono-wrapper): Use $runtimedir to look for 'mono-wrapper'.
2008-10-31 Jonathan Pryor <[email protected]>
* check, Makefile.am (EXTRA_DIST): Rename to check-exports. This was
needed to fix `make distdir...`, because (1) with a file named
`check` which (2) was listed in $(EXTRA_DIST), while (3) `check` is
ALSO a .PHONY target, this caused make to look for the `check` file,
not find it due to (3), and then proceed to try to build convert.exe
from convert.cs...for reasons I don't care about. This obviously
can't work during `make distdir`, as mcs hasn't been built yet, thus
leading to pain, suffering, and a broken build.
2008-10-30 Jonathan Pryor <[email protected]>
* . (svn:ignore), deploy (svn:ignore): Ignore generated files.
* AgilityPack.dll, api-style.css, ChangeLog, check, check-coverage,
convert.cs, current-api, deploy, documented, exdoc, ignore,
mono-api-metadata.html, monoapi.source, produce-lists, public,
public-api, README, sources, toc.xml, TODO, wapi: Copy from
../mono/docscripts.
* exdoc: Use the in-tree mono program to run convert.exe.
* Makefile.am: Mention files to clean/distribute; extract
documentation (with exdoc) and then assemble documentation (with
monoapi.make's assemble target) for use by monodoc.
* monoapi.make: Added; Makefile to use mcs' buid/rules.make to compile
convert.cs and assemble documentation. (This is a separate file so
that we can include mcs' build/rules.make, which needs topdir set to
behave properly BUT must be $(mcs_topdir) from Makefile.am's
perspective.)
* monoapi.source: Add a /monodoc/node element for use with monodoc 2.2.
2006-11-19 Miguel de Icaza <[email protected]>
* exdoc: Move to use CSS instead of tables, this will break
GtkHTML rendering.
* ignore: Updated with more hidden APIs.
* Bunch of documentation work.
+4 -75
View File
@@ -1,106 +1,35 @@
sourcesdir = $(prefix)/lib/monodoc/sources
sources_DATA = \
mono-file-formats.source \
mono-tools.source \
monoapi.source \
$(ASSEMBLED_DOCS)
ASSEMBLED_DOCS = \
mono-file-formats.tree mono-file-formats.zip \
mono-tools.tree mono-tools.zip \
monoapi.tree monoapi.zip
EXTRA_DIST = \
abc-removal.txt \
AgilityPack.dll \
api-style.css \
aot-compiler.txt \
assembly-bundle \
check-exports \
check-coverage \
convert.cs \
current-api \
deploy \
docs.make \
documented \
embedded-api \
exception-handling.txt \
exceptions \
exdoc \
file-share-modes \
gc-issues \
gc-variables-in-c \
glossary.txt \
ignore \
internal-calls \
ir-desc \
jit-imt \
jit-regalloc \
jit-thoughts \
jit-trampolines \
local-regalloc.txt \
magic.diff \
mini-doc.txt \
mini-porting.txt \
mono-api-metadata.html \
mono-file-formats.config\
mono-file-formats.source\
mono_handle_d \
mono-tools.config \
mono-tools.source \
monoapi.source \
new-regalloc \
object-layout \
opcode-decomp.txt \
precise-gc \
produce-lists \
public \
public-api \
README \
release-notes-1.0.html \
remoting \
ssapre.txt \
stack-alignment \
stack-overflow.txt \
threading \
toc.xml \
TODO \
thread-safety.txt \
tree-mover.txt \
unmanaged-calls
dist-hook:
$(mkdir_p) $(distdir)/sources
$(mkdir_p) $(distdir)/svgs
cp sources/* $(distdir)/sources
cp svgs/* $(distdir)/svgs
clean-local:
-rm -Rf $(srcdir)/html
-rm -f $(srcdir)/deploy/* $(srcdir)/convert.exe*
-cd $(srcdir) && rm -f $(ASSEMBLED_DOCS)
monoapi.zip: monoapi.tree
@test -f $@ || { rm -f $(srcdir)/monoapi.tree && $(MAKE) monoapi.tree; }
monoapi.tree: docs.make Makefile.am toc.xml $(srcdir)/deploy/.stamp
cd $(srcdir) && cp api-style.css deploy
cd $(srcdir) && $(MAKE) -f docs.make topdir=$(mcs_topdir_from_srcdir) $@
mono-tools.zip: mono-tools.tree
@test -f $@ || { rm -f $(srcdir)/mono-tools.tree && $(MAKE) mono-tools.tree; }
mono-tools.tree: docs.make Makefile.am $(srcdir)/deploy/.stamp
cd $(srcdir) && $(MAKE) -f docs.make topdir=$(mcs_topdir_from_srcdir) $@
mono-file-formats.zip: mono-file-formats.tree
@test -f $@ || { rm -f $(srcdir)/mono-file-formats.tree && $(MAKE) mono-file-formats.tree; }
mono-file-formats.tree: docs.make Makefile.am $(srcdir)/deploy/.stamp
cd $(srcdir) && $(MAKE) -f docs.make topdir=$(mcs_topdir_from_srcdir) $@
$(srcdir)/deploy/.stamp: convert.exe Makefile.am
$(mkdir_p) $(srcdir)/html
runtimedir=`cd ../runtime && pwd`; export runtimedir; \
cd $(srcdir) && MONO_PATH=$(mcs_topdir_from_srcdir)/class/lib/net_2_0 perl ./exdoc -h . ../mono/*/*.c
touch $@
extract: $(srcdir)/deploy/.stamp
convert.exe: convert.cs AgilityPack.dll
cd $(srcdir) && $(MAKE) -f docs.make topdir=$(mcs_topdir_from_srcdir) convert.exe
-87
View File
@@ -1,87 +0,0 @@
Documentation is now maintained on the mono wiki:
http://www.mono-project.com/Mono:Runtime:Documentation
Older documents or documents which were not yet migrated to the wiki are kept here.
* Scripts to maintain the Mono VM internal API
Layout
------
sources/
mono-api-*.html
Contains the various source files, each source file
contains HTML, and a line for each API call like this:
<h4><a name="api:mono_something">mono_something</a></h4>
The format is static, notice that the tools actually search
for the above format and process that (both the tools here,
as well as the upcoming Monodoc tools and index creation
tools).
The files can contain any ammount of extra information.
The documentation from the source code is then merged with
these files and the header/footer information to produce
the deploy directory.
deploy/
Scripts produce a ready-to-use set of XHTML files that can
be either fed into a monodoc XHTML provider or can be published
directly on the web.
PROGRAMS
--------
* check-coverage
Run this script every once in a while to make sure that a
public symbol that has been added to Mono has a corresponding
section on the mono-vm-api.html
This works by looking for the <h4>APICALL</h4> pattern on the
HTML file.
* produce-lists
Produces the public-api and wapi files that contain the public
libmono API.
* exdoc
Extracts the embedded documentation from the sources.
* check
This script is used to verify which routines are missing inline
documentation, usage:
check mono/metadata/*.c
* convert.cs
Converts an HTML file into a valid XML document, uses the
AgilityPack.dll. The sources to this DLL live in GNOME CVS
module beagle/Filters/AgilityPack.
A binary is shipped for our convenience.
DATAFILES:
---------
ignore
Contains the list of public symbols that should be
ignored, they come from tests for example, or are known
to be exposed.
This is consumed by produce-lists
public-api
wapi
These two are produced by the produce-lists script
and it documents all the public methods.
+393
View File
@@ -0,0 +1,393 @@
Mono Ahead Of Time Compiler
===========================
The Ahead of Time compilation feature in Mono allows Mono to
precompile assemblies to minimize JIT time, reduce memory
usage at runtime and increase the code sharing across multiple
running Mono application.
To precompile an assembly use the following command:
mono --aot -O=all assembly.exe
The `--aot' flag instructs Mono to ahead-of-time compile your
assembly, while the -O=all flag instructs Mono to use all the
available optimizations.
* Caching metadata
------------------
Besides code, the AOT file also contains cached metadata information which allows
the runtime to avoid certain computations at runtime, like the computation of
generic vtables. This reduces both startup time, and memory usage. It is possible
to create an AOT image which contains only this cached information and no code by
using the 'metadata-only' option during compilation:
mono --aot=metadata-only assembly.exe
This works even on platforms where AOT is not normally supported.
* Position Independent Code
---------------------------
On x86 and x86-64 the code generated by Ahead-of-Time compiled
images is position-independent code. This allows the same
precompiled image to be reused across multiple applications
without having different copies: this is the same way in which
ELF shared libraries work: the code produced can be relocated
to any address.
The implementation of Position Independent Code had a
performance impact on Ahead-of-Time compiled images but
compiler bootstraps are still faster than JIT-compiled images,
specially with all the new optimizations provided by the Mono
engine.
* How to support Position Independent Code in new Mono Ports
------------------------------------------------------------
Generated native code needs to reference various runtime
structures/functions whose address is only known at run
time. JITted code can simple embed the address into the native
code, but AOT code needs to do an indirection. This
indirection is done through a table called the Global Offset
Table (GOT), which is similar to the GOT table in the Elf
spec. When the runtime saves the AOT image, it saves some
information for each method describing the GOT table entries
used by that method. When loading a method from an AOT image,
the runtime will fill out the GOT entries needed by the
method.
* Computing the address of the GOT
Methods which need to access the GOT first need to compute its
address. On the x86 it is done by code like this:
call <IP + 5>
pop ebx
add <OFFSET TO GOT>, ebx
<save got addr to a register>
The variable representing the got is stored in
cfg->got_var. It is allways allocated to a global register to
prevent some problems with branches + basic blocks.
* Referencing GOT entries
Any time the native code needs to access some other runtime
structure/function (i.e. any time the backend calls
mono_add_patch_info ()), the code pointed by the patch needs
to load the value from the got. For example, instead of:
call <ABSOLUTE ADDR>
it needs to do:
call *<OFFSET>(<GOT REG>)
Here, the <OFFSET> can be 0, it will be fixed up by the AOT compiler.
For more examples on the changes required, see
svn diff -r 37739:38213 mini-x86.c
* The Program Linkage Table
As in ELF, calls made from AOT code do not go through the GOT. Instead, a direct call is
made to an entry in the Program Linkage Table (PLT). This is based on the fact that on
most architectures, call instructions use a displacement instead of an absolute address, so
they are already position independent. An PLT entry is usually a jump instruction, which
initially points to some trampoline code which transfers control to the AOT loader, which
will compile the called method, and patch the PLT entry so that further calls are made
directly to the called method.
If the called method is in the same assembly, and does not need initialization (i.e. it
doesn't have GOT slots etc), then the call is made directly, bypassing the PLT.
* Implementation
----------------
** The Precompiled File Format
-----------------------------
We use the native object format of the platform. That way it
is possible to reuse existing tools like objdump and the
dynamic loader. All we need is a working assembler, i.e. we
write out a text file which is then passed to gas (the gnu
assembler) to generate the object file.
The precompiled image is stored in a file next to the original
assembly that is precompiled with the native extension for a shared
library (on Linux its ".so" to the generated file).
For example: basic.exe -> basic.exe.so; corlib.dll -> corlib.dll.so
To avoid symbol lookup overhead and to save space, some things like the
compiled code of the individual methods are not identified by specific symbols
like method_code_1234. Instead, they are stored in one big array and the
offsets inside this array are stored in another array, requiring just two
symbols. The offsets array is usually named 'FOO_offsets', where FOO is the
array the offsets refer to, like 'methods', and 'method_offsets'.
Generating code using an assembler and linker has some disadvantages:
- it requires GNU binutils or an equivalent package to be installed on the
machine running the aot compilation.
- it is slow.
There is some support in the aot compiler for directly emitting elf files, but
its not complete (yet).
The following things are saved in the object file and can be
looked up using the equivalent to dlsym:
mono_assembly_guid
A copy of the assembly GUID.
mono_aot_version
The format of the AOT file format.
mono_aot_opt_flags
The optimizations flags used to build this
precompiled image.
method_infos
Contains additional information needed by the runtime for using the
precompiled method, like the GOT entries it uses.
method_info_offsets
Maps method indexes to offsets in the method_infos array.
mono_icall_table
A table that lists all the internal calls
references by the precompiled image.
mono_image_table
A list of assemblies referenced by this AOT
module.
methods
The precompiled code itself.
method_offsets
Maps method indexes to offsets in the methods array.
ex_info
Contains information about methods which is rarely used during normal execution,
like exception and debug info.
ex_info_offsets
Maps method indexes to offsets in the ex_info array.
class_info
Contains precomputed metadata used to speed up various runtime functions.
class_info_offsets
Maps class indexes to offsets in the class_info array.
class_name_table
A hash table mapping class names to class indexes. Used to speed up
mono_class_from_name ().
plt
The Program Linkage Table
plt_info
Contains information needed to find the method belonging to a given PLT entry.
** Source file structure
-----------------------------
The AOT infrastructure is split into two files, aot-compiler.c and
aot-runtime.c. aot-compiler.c contains the AOT compiler which is invoked by
--aot, while aot-runtime.c contains the runtime support needed for loading
code and other things from the aot files.
** Compilation process
----------------------------
AOT compilation consists of the following stages:
- collecting the methods to be compiled.
- compiling them using the JIT.
- emitting the JITted code and other information into an assembly file (.s).
- assembling the file using the system assembler.
- linking the resulting object file into a shared library using the system
linker.
** Handling compiled code
----------------------------
Each method is identified by a method index. For normal methods, this is
equivalent to its index in the METHOD metadata table. For runtime generated
methods (wrappers), it is an arbitrary number.
Compiled code is created by invoking the JIT, requesting it to created AOT
code instead of normal code. This is done by the compile_method () function.
The output of the JIT is compiled code and a set of patches (relocations). Each
relocation specifies an offset inside the compiled code, and a runtime object
whose address is accessed at that offset.
Patches are described by a MonoJumpInfo structure. From the perspective
of the AOT compiler, there are two kinds of patches:
- calls, which require an entry in the PLT table.
- everything else, which require an entry in the GOT table.
How patches is handled is described in the next section.
After all the method are compiled, they are emitted into the output file into
a byte array called 'methods', The emission
is done by the emit_method_code () and emit_and_reloc_code () functions. Each
piece of compiled code is identified by the local symbol .Lm_<method index>.
While compiled code is emitted, all the locations which have an associated patch
are rewritten using a platform specific process so the final generated code will
refer to the plt and got entries belonging to the patches.
The compiled code array
can be accessed using the 'methods' global symbol.
** Handling patches
----------------------------
Before a piece of AOTed code can be used, the GOT entries used by it must be
filled out with the addresses of runtime objects. Those objects are identified
by MonoJumpInfo structures. These stuctures are saved in a serialized form in
the AOT file, so the AOT loader can deconstruct them. The serialization is done
by the encode_patch () function, while the deserialization is done by the
decode_patch_info () function.
Every method has an associated method info blob inside the 'method_info' byte
array in the AOT file. This contains all the information required to load the
method at runtime:
- the first got entry used by the method.
- the number of got entries used by the method.
- the serialized patch info for the got entries.
Some patches, like vtables, icalls are very common, so instead of emitting their
info every time they are used by a method, we emit the info only once into a
byte array named 'got_info', and only emit an index into this array for every
access.
** The Procedure Linkage Table (PLT)
------------------------------------
Our PLT is similar to the elf PLT, it is used to handle calls between methods.
If method A needs to call method B, then an entry is allocated in the PLT for
method B, and A calls that entry instead of B directly. This is useful because
in some cases the runtime needs to do some processing the first time B is
called.
There are two cases:
- if B is in another assembly, then it needs to be looked up, then JITted or the
corresponding AOT code needs to be found.
- if B is in the same assembly, but has got slots, then the got slots need to be
initialized.
If none of these cases is true, then the PLT is not used, and the call is made
directly to the native code of the target method.
A PLT entry is usually implemented by a jump though a jump table, where the
jump table entries are initially filled up with the address of a trampoline so
the runtime can get control, and after the native code of the called method is
created/found, the jump table entry is changed to point to the native code.
All PLT entries also embed a integer offset after the jump which indexes into
the 'plt_info' table, which stores the information required to find the called
method. The PLT is emitted by the emit_plt () function.
** Exception/Debug info
----------------------------
Each compiled method has some additional info generated by the JIT, usable
for debugging (IL offset-native offset maps) and exception handling
(saved registers, native offsets of try/catch clauses). Since this info is
rarely needed, it is saved into a separate byte array called 'ex_info'.
** Cached metadata
---------------------------
When the runtime loads a class, it needs to compute a variety of information
which is not readily available in the metadata, like the instance size,
vtable, whenever the class has a finalizer/type initializer etc. Computing this
information requires a lot of time, causes the loading of lots of metadata,
and it usually involves the creation of many runtime data structures
(MonoMethod/MonoMethodSignature etc), which are long living, and usually persist
for the lifetime of the app. To avoid this, we compute the required information
at aot compilation time, and save it into the aot image, into an array called
'class_info'. The runtime can query this information using the
mono_aot_get_cached_class_info () function, and if the information is available,
it can avoid computing it.
** Full AOT mode
-------------------------
Some platforms like the iphone prohibit JITted code, using technical and/or
legal means. This is a significant problem for the mono runtime, since it
generates a lot of code dynamically, using either the JIT or more low-level
code generation macros. To solve this, the AOT compiler is able to function in
full-aot or aot-only mode, where it generates and saves all the neccesary code
in the aot image, so at runtime, no code needs to be generated.
There are two kinds of code which needs to be considered:
- wrapper methods, that is methods whose IL is generated dynamically by the
runtime. They are handled by generating them in the add_wrappers () function,
then emitting them the same way as the 'normal' methods. The only problem is
that these methods do not have a methoddef token, so we need a separate table
in the aot image ('wrapper_info') to find their method index.
- trampolines and other small hand generated pieces of code. They are handled
in an ad-hoc way in the emit_trampolines () function.
* Performance considerations
----------------------------
Using AOT code is a trade-off which might lead to higher or
slower performance, depending on a lot of circumstances. Some
of these are:
- AOT code needs to be loaded from disk before being used, so
cold startup of an application using AOT code MIGHT be
slower than using JITed code. Warm startup (when the code is
already in the machines cache) should be faster. Also,
JITing code takes time, and the JIT compiler also need to
load additional metadata for the method from the disk, so
startup can be faster even in the cold startup case.
- AOT code is usually compiled with all optimizations turned
on, while JITted code is usually compiled with default
optimizations, so the generated code in the AOT case should
be faster.
- JITted code can directly access runtime data structures and
helper functions, while AOT code needs to go through an
indirection (the GOT) to access them, so it will be slower
and somewhat bigger as well.
- When JITting code, the JIT compiler needs to load a lot of
metadata about methods and types into memory.
- JITted code has better locality, meaning that if A method
calls B, then the native code for A and B is usually quite
close in memory, leading to better cache behaviour thus
improved performance. In contrast, the native code of
methods inside the AOT file is in a somewhat random order.
* Future Work
-------------
- Currently, when an AOT module is loaded, all of its
dependent assemblies are also loaded eagerly, and these
assemblies need to be exactly the same as the ones loaded
when the AOT module was created ('hard binding'). Non-hard
binding should be allowed.
- On x86, the generated code uses call 0, pop REG, add
GOTOFFSET, REG to materialize the GOT address. Newer
versions of gcc use a separate function to do this, maybe we
need to do the same.
- Currently, we get vtable addresses from the GOT. Another
solution would be to store the data from the vtables in the
.bss section, so accessing them would involve less
indirection.
-29
View File
@@ -1,29 +0,0 @@
thisdir = docs
SUBDIRS =
include $(topdir)/build/rules.make
ASSEMBLED_DOCS = \
mono-file-formats.tree mono-file-formats.zip \
mono-tools.tree mono-tools.zip \
monoapi.tree monoapi.zip
convert.exe: convert.cs AgilityPack.dll
$(CSCOMPILE) -out:$@ $< -r:AgilityPack.dll
monoapi.zip: monoapi.tree
@test -f $@ || { rm -f $< && $(MAKE) $<; }
monoapi.tree: toc.xml docs.make
$(MDOC) assemble -o monoapi -f hb $<
mono-tools.zip: mono-tools.tree
@test -f $@ || { rm -f $< && $(MAKE) $<; }
mono-tools.tree: mono-tools.config docs.make
$(MDOC) assemble -o mono-tools -f man $<
mono-file-formats.zip: mono-file-formats.tree
@test -f $@ || { rm -f $< && $(MAKE) $<; }
mono-file-formats.tree: mono-file-formats.config docs.make
$(MDOC) assemble -o mono-file-formats -f man $<
.doc-stamp:
+330
View File
@@ -0,0 +1,330 @@
Exception Handling In the Mono Runtime
--------------------------------------
* Introduction
--------------
There are many types of exceptions which the runtime needs to
handle. These are:
- exceptions thrown from managed code using the 'throw' or 'rethrow' CIL
instructions.
- exceptions thrown by some IL instructions like InvalidCastException thrown
by the 'castclass' CIL instruction.
- exceptions thrown by runtime code
- synchronous signals received while in managed code
- synchronous signals received while in native code
- asynchronous signals
Since exception handling is very arch dependent, parts of the
exception handling code reside in the arch specific
exceptions-<ARCH>.c files. The architecture independent parts
are in mini-exceptions.c. The different exception types listed
above are generated in different parts of the runtime, but
ultimately, they all end up in the mono_handle_exception ()
function in mini-exceptions.c.
* Exceptions throw programmatically from managed code
-----------------------------------------------------
These exceptions are thrown from managed code using 'throw' or
'rethrow' CIL instructions. The JIT compiler will translate
them to a call to a helper function called
'mono_arch_throw/rethrow_exception'.
These helper functions do not exist at compile time, they are
created dynamically at run time by the code in the
exceptions-<ARCH>.c files.
They perform various stack manipulation magic, then call a
helper function usually named throw_exception (), which does
further processing in C code, then calls
mono_handle_exception() to do the rest.
* Exceptions thrown implicitly from managed code
------------------------------------------------
These exceptions are thrown by some IL instructions when
something goes wrong. When the JIT needs to throw such an
exception, it emits a forward conditional branch and remembers
its position, along with the exception which needs to be
emitted. This is usually done in macros named
EMIT_COND_SYSTEM_EXCEPTION in the mini-<ARCH>.c files.
After the machine code for the method is emitted, the JIT
calls the arch dependent mono_arch_emit_exceptions () function
which will add the exception throwing code to the end of the
method, and patches up the previous forward branches so they
will point to this code.
This has the advantage that the rarely-executed exception
throwing code is kept separate from the method body, leading
to better icache performance.
The exception throwing code braches to the dynamically
generated mono_arch_throw_corlib_exception helper function,
which will create the proper exception object, does some stack
manipulation, then calls throw_exception ().
* Exceptions thrown by runtime code
-----------------------------------
These exceptions are usually thrown by the implementations of
InternalCalls (icalls). First an appropriate exception object
is created with the help of various helper functions in
metadata/exception.c, which has a separate helper function for
allocating each kind of exception object used by the runtime
code. Then the mono_raise_exception () function is called to
actually throw the exception. That function never returns.
An example:
if (something_is_wrong)
mono_raise_exception (mono_get_exception_index_out_of_range ());
mono_raise_exception () simply passes the exception to the JIT
side through an API, where it will be received by helper
created by mono_arch_throw_exception (). From now on, it is
treated as an exception thrown from managed code.
* Synchronous signals
---------------------
For performance reasons, the runtime does not do same checks
required by the CLI spec. Instead, it relies on the CPU to do
them. The two main checks which are omitted are null-pointer
checks, and arithmetic checks. When a null pointer is
dereferenced by JITted code, the CPU will notify the kernel
through an interrupt, and the kernel will send a SIGSEGV
signal to the process. The runtime installs a signal handler
for SIGSEGV, which is sigsegv_signal_handler () in mini.c. The
signal handler creates the appropriate exception object and
calls mono_handle_exception () with it. Arithmetic exceptions
like division by zero are handled similarly.
* Synchronous signals in native code
------------------------------------
Receiving a signal such as SIGSEGV while in native code means
something very bad has happened. Because of this, the runtime
will abort after trying to print a managed plus a native stack
trace. The logic is in the mono_handle_native_sigsegv ()
function.
Note that there are two kinds of native code which can be the
source of the signal:
- code inside the runtime
- code inside a native library loaded by an application, ie. libgtk+
* Stack overflow checking
-------------------------
Stack overflow exceptions need special handling. When a thread
overflows its stack, the kernel sends it a normal SIGSEGV
signal, but the signal handler tries to execute on the same as
the thread leading to a further SIGSEGV which will terminate
the thread. A solution is to use an alternative signal stack
supported by UNIX operating systems through the sigaltstack
(2) system call. When a thread starts up, the runtime will
install an altstack using the mono_setup_altstack () function
in mini-exceptions.c. When a SIGSEGV is received, the signal
handler checks whenever the fault address is near the bottom
of the threads normal stack. If it is, a
StackOverflowException is created instead of a
NullPointerException. This exception is handled like any other
exception, with some minor differences.
There are two reasons why sigaltstack is disabled by default:
* The main problem with sigaltstack() is that the stack
employed by it is not visible to the GC and it is possible
that the GC will miss it.
* Working sigaltstack support is very much os/kernel/libc
dependent, so it is disabled by default.
* Asynchronous signals
----------------------
Async signals are used by the runtime to notify a thread that
it needs to change its state somehow. Currently, it is used
for implementing thread abort/suspend/resume.
Handling async signals correctly is a very hard problem,
since the receiving thread can be in basically any state upon
receipt of the signal. It can execute managed code, native
code, it can hold various managed/native locks, or it can be
in a process of acquiring them, it can be starting up,
shutting down etc. Most of the C APIs used by the runtime are
not asynch-signal safe, meaning it is not safe to call them
from an async signal handler. In particular, the pthread
locking functions are not async-safe, so if a signal handler
interrupted code which was in the process of acquiring a lock,
and the signal handler tries to acquire a lock, the thread
will deadlock. Unfortunately, the current signal handling
code does acquire locks, so sometimes it does deadlock.
When receiving an async signal, the signal handler first tries
to determine whenever the thread was executing managed code
when it was interrupted. If it did, then it is safe to
interrupt it, so a ThreadAbortException is constructed and
thrown. If the thread was executing native code, then it is
generally not safe to interrupt it. In this case, the runtime
sets a flag then returns from the signal handler. That flag is
checked every time the runtime returns from native code to
managed code, and the exception is thrown then. Also, a
platform specific mechanism is used to cause the thread to
interrupt any blocking operation it might be doing.
The async signal handler is in sigusr1_signal_handler () in
mini.c, while the logic which determines whenever an exception
is safe to be thrown is in mono_thread_request_interruption
().
* Stack unwinding during exception handling
-------------------------------------------
The execution state of a thread during exception handling is
stored in an arch-specific structure called MonoContext. This
structure contains the values of all the CPU registers
relevant during exception handling, which usually means:
- IP (instruction pointer)
- SP (stack pointer)
- FP (frame pointer)
- callee saved registers
Callee saved registers are the registers which are required by
any procedure to be saved/restored before/after using
them. They are usually defined by each platforms ABI
(Application Binary Interface). For example, on x86, they are
EBX, ESI and EDI.
The code which calls mono_handle_exception () is required to
construct the initial MonoContext. How this is done depends on
the caller. For exceptions thrown from managed code, the
mono_arch_throw_exception helper function saves the values of
the required registers and passes them to throw_exception (),
which will save them in the MonoContext structure. For
exceptions thrown from signal handlers, the MonoContext
stucture is initialized from the signal info received from the
kernel.
During exception handling, the runtime needs to 'unwind' the
stack, i.e. given the state of the thread at a stack frame,
construct the state at its callers. Since this is platform
specific, it is done by a platform specific function called
mono_arch_find_jit_info ().
Two kinds of stack frames need handling:
- Managed frames are easier. The JIT will store some
information about each managed method, like which
callee-saved registers it uses. Based on this information,
mono_arch_find_jit_info () can find the values of the
registers on the thread stack, and restore them.
- Native frames are problematic, since we have no information
about how to unwind through them. Some compilers generate
unwind information for code, some don't. Also, there is no
general purpose library to obtain and decode this unwind
information. So the runtime uses a different solution. When
managed code needs to call into native code, it does through
a managed->native wrapper function, which is generated by
the JIT. This function is responsible for saving the machine
state into a per-thread structure called MonoLMF (Last
Managed Frame). These LMF structures are stored on the
threads stack, and are linked together using one of their
fields. When the unwinder encounters a native frame, it
simply pops one entry of the LMF 'stack', and uses it to
restore the frame state to the moment before control passed
to native code. In effect, all successive native frames are
skipped together.
Problems/future work
--------------------
1. Async signal safety
----------------------
The current async signal handling code is not async safe, so
it can and does deadlock in practice. It needs to be rewritten
to avoid taking locks at least until it can determine that it
was interrupting managed code.
Another problem is the managed stack frame unwinding code. It
blindly assumes that if the IP points into a managed frame,
then all the callee saved registers + the stack pointer are
saved on the stack. This is not true if the thread was
interrupted while executing the method prolog/epilog.
2. Raising exceptions from native code
--------------------------------------
Currently, exceptions are raised by calling
mono_raise_exception () in the middle of runtime code. This
has two problems:
- No cleanup is done, ie. if the caller of the function which
throws an exception has taken locks, or allocated memory,
that is not cleaned up. For this reason, it is only safe to
call mono_raise_exception () 'very close' to managed code,
ie. in the icall functions themselves.
- To allow mono_raise_exception () to unwind through native
code, we need to save the LMF structures which can add a lot
of overhead even in the common case when no exception is
thrown. So this is not zero-cost exception handling.
An alternative might be to use a JNI style
set-pending-exception API. Runtime code could call
mono_set_pending_exception (), then return to its caller with
an error indication allowing the caller to clean up. When
execution returns to managed code, then managed->native
wrapper could check whenever there is a pending exception and
throw it if neccesary. Since we already check for pending
thread interruption, this would have no overhead, allowing us
to drop the LMF saving/restoring code, or significant parts of
it.
4. libunwind
------------
There is an OSS project called libunwind which is a standalone
stack unwinding library. It is currently in development, but
it is used by default by gcc on ia64 for its stack
unwinding. The mono runtime also uses it on ia64. It has
several advantages in relation to our current unwinding code:
- it has a platform independent API, i.e. the same unwinding
code can be used on multiple platforms.
- it can generate unwind tables which are correct at every
instruction, i.e. can be used for unwinding from async
signals.
- given sufficient unwind info generated by a C compiler, it
can unwind through C code.
- most of its API is async-safe
- it implements the gcc C++ exception handling API, so in
theory it can be used to implement mixed-language exception
handling (i.e. C++ exception caught in mono, mono exception
caught in C++).
- it is MIT licensed
The biggest problem with libuwind is its platform support. ia64 support is
complete/well tested, while support for other platforms is missing/incomplete.
http://www.hpl.hp.com/research/linux/libunwind/
+12 -53
View File
@@ -9,30 +9,15 @@ Generic code sharing
The generic class init trampoline is very similar to the class init
trampoline, with the exception that the VTable of the class to be
inited is passed in a register, MONO_ARCH_VTABLE_REG. That register
can be the same as the IMT register.
inited is passed in a register, MONO_ARCH_VTABLE_REG. That can be the
same as the IMT register.
The call to the generic class init trampoline is never patched because
the VTable is not constant - it depends on the type arguments of the
class/method doing the call to the trampoline. For that reason, the
trampoline needs a fast path for the case that the class is already
inited, i.e. the trampoline needs to check the initialized bit of the
MonoVTable and immediately return if it is set. See tramp-x86.c for
how to portably figure out the number of the bit in the bit-field that
needs to be checked.
Since the MONO_ARCH_VTABLE_REG is needed by the generic class init
trampoline function (in mini-trampolines.c) it needs to be saved by
the generic trampoline code in the register save block which is passed
to the trampoline. This also applies to the RGCTX fetch trampoline
(see below).
Like the normal class init trampoline, the result of the generic class
init trampoline function is not a pointer to code that needs to be
jumped to. Instead, just like for the class init trampoline, the
generic trampoline code must return to the caller instead of jumping
to the returned value. The same applies for the RGCTX fetch
trampoline (see below).
inited. See tramp-x86.c for how to portably figure out the number of
the bit in the bit-field that needs to be checked.
** RGCTX register
@@ -57,20 +42,6 @@ MONO_ARCH_RGCTX_REG can be the same as the IMT register for now, but
this might change in the future when we implement virtual generic
method calls (more) efficiently.
This register lifetime starts at the call site that loads it and
ends in the callee prologue when it is either discarded or stored
into a local variable.
It's better to avoid registers used for argument passing for the RGCTX
as it would make the code dealing with calling conventions code a lot
harder.
** Method prologue
Generic shared code that have a RGCTX receive it in RGCTX_REG. There
must be a check in mono_arch_emit_prolog for MonoCompile::rgctx_var
and if set store it. See mini-x86.c for reference.
** Dealing with types
Types passed to arch functions might be type parameters
@@ -104,14 +75,14 @@ the layout of a RGCTX:
.
.
For fetching a slot from a RGCTX the trampoline is passed a pointer
(as a normal integer argument) to the VTable. From there it has to
fetch the pointer to the RGCTX, which might be null. Then it has to
traverse the correct number of "next" links, each of which might be
NULL. Arriving at the right array it needs to fetch the slot, which
might also be NULL. If any of the NULL cases, the trampoline must
transition to unmanaged code to potentially setup the RGCTX and fill
the slot. Here is pseudo-code for fetching slot 11:
For fetching a slot from a RGCTX the trampoline is passed a pointer to
the VTable. From there it has to fetch the pointer to the RGCTX,
which might be null. Then it has to traverse the correct number of
"next" links, each of which might be NULL. Arriving at the right
array it needs to fetch the slot, which might also be NULL. If any of
the NULL cases, the trampoline must transition to unmanaged code to
potentially setup the RGCTX and fill the slot. Here is pseudo-code
for fetching slot 11:
; vtable ptr in r1
; fetch RGCTX array 0
@@ -158,18 +129,6 @@ a trampoline for an MRGCTX is needed, as opposed to one for a RGCTX.
Use MONO_RGCTX_SLOT_INDEX to get the index of the slot (like 2 for
"slot 2" as above).
The unmanaged fetch code is yet another trampoline created via
mono_arch_create_specific_trampoline(), of type
MONO_TRAMPOLINE_RGCTX_LAZY_FETCH. It's given the slot number as the
trampoline argument. In addition, the pointer to the VTable/MRGCTX is
passed in MONO_ARCH_VTABLE_REG (like the VTable to the generic class
init trampoline - see above).
Like the class init and generic class init trampolines, the RGCTX
fetch trampoline code doesn't return code that must be jumped to, so,
like for those trampolines (see above), the generic trampoline code
must do a normal return instead.
* Getting generics information about a stack frame
+283
View File
@@ -0,0 +1,283 @@
Register Allocation
===================
The current JIT implementation uses a tree matcher to generate code. We use a
simple algorithm to allocate registers in trees, and limit the number of used
temporary register to 4 when evaluating trees. So we can use 2 registers for
global register allocation.
Register Allocation for Trees
=============================
We always evaluate trees from left to right. When there are no more registers
available we need to spill values to memory. Here is the simplified algorithm.
gboolean
tree_allocate_regs (tree, exclude_reg)
{
if (!tree_allocate_regs (tree->left, -1))
return FALSE;
if (!tree_allocate_regs (tree->right, -1)) {
tree->left->spilled == TRUE;
free_used_regs (tree->left);
if (!tree_allocate_regs (tree->right, tree->left->reg))
return FALSE;
}
free_used_regs (tree->left);
free_used_regs (tree->right);
/* try to allocate a register (reg != exclude_reg) */
if ((tree->reg = next_free_reg (exclude_reg)) != -1)
return TRUE;
return FALSE;
}
The emit routing actually spills the registers:
tree_emit (tree)
{
tree_emit (tree->left);
if (tree->left->spilled)
save_reg (tree->left->reg);
tree_emit (tree->right);
if (tree->left->spilled)
restore_reg (tree->left->reg);
emit_code (tree);
}
Global Register Allocation
==========================
TODO.
Local Register Allocation
=========================
This section describes the cross-platform local register allocator which is
in the file mini-codegen.c.
The input to the allocator is a basic block which contains linear IL, ie.
instructions of the form:
DEST <- SRC1 OP SRC2
where DEST, SRC1, and SRC2 are virtual registers (vregs). The job of the
allocator is to assign hard or physical registers (hregs) to each virtual
registers so the vreg references in the instructions can be replaced with their
assigned hreg, allowing machine code to be generated later.
The allocator needs information about the number and types of arguments of
instructions. It takes this information from the machine description files. It
also needs arch specific information, like the number and type of the hard
registers. It gets this information from arch-specific macros.
Currently, the vregs and hregs are partitioned into two classes: integer and
floating point.
The allocator consists of two phases: In the first phase, a forward pass is
made over the instructions, collecting liveness information for vregs. In the
second phase, a backward pass is made over the instructions, assigning
registers. This backward mode of operation makes understanding the allocator
somewhat difficult to understand, but leads to better code in most cases.
Allocator state
===============
The state of the allocator is stored in two arrays: iassign and isymbolic.
iassign maps vregs to hregs, while isymbolic is the opposite.
For a vreg, iassign [vreg] can contain the following values:
* -1 vreg has no assigned hreg
* hreg index (>= 0) vreg is assigned to the given hreg. This means
later instructions (which we have already
processed due to the backward direction) expect
the value of vreg to be found in hreg.
* spill slot index (< -1) vreg is spilled to the given spill slot. This
means later instructions expect the value of
vreg to be found on the stack in the given
spill slot.
Also, the allocator keeps track of which hregs are free and which are used.
This information is stored in a bitmask called ifree_mask.
There is a similar set of data structures for floating point registers.
Spilling
========
When an allocator needs a free hreg, but all of them are assigned, it needs to
free up one of them. It does this by spilling the contents of the vreg which
is currently assigned to the selected hreg. Since later instructions expect
the vreg to be found in the selected hreg, the allocator emits a spill-load
instruction to load the value from the spill slot into the hreg after the
currently processed instruction. When the vreg which is spilled is a
destination in an instruction, the allocator will emit a spill-store to store
the value into the spill slot.
Fixed registers
===============
Some architectures, notably x86/amd64 require that the arguments/results of
some instructions be assigned to specific hregs. An example is the shift
opcodes on x86, where the second argument must be in ECX. The allocator
has support for this. It tries to allocate the vreg to the required hreg. If
thats not possible, then it will emit compensation code which moves values to
the correct registers before/after the instruction.
Fixed registers are mainly used on x86, but they are useful on more regular
architectures on well, for example to model that after a call instruction, the
return of the call is in a specific register.
A special case of fixed registers is two address architectures, like the x86,
where the instructions place their results into their first argument. This is
modelled in the allocator by allocating SRC1 and DEST to the same hreg.
Global registers
================
Some variables might already be allocated to hardware registers during the
global allocation phase. In this case, SRC1, SRC2 and DEST might already be
a hardware register. The allocator needs to do nothing in this case, except
when the architecture uses fixed registers, in which case it needs to emit
compensation code.
Register pairs
==============
64 bit arithmetic on 32 bit machines requires instructions whose arguments are
not registers, but register pairs. The allocator has support for this, both
for freely allocatable register pairs, and for register pairs which are
constrained to specific hregs (EDX:EAX on x86).
Floating point stack
====================
The x86 architecture uses a floating point register stack instead of a set of
fp registers. The allocator supports this by keeping track of the height of the
fp stack, and spilling/loading values from the stack as neccesary.
Calls
=====
Calls need special handling for two reasons: first, they will clobber all
caller-save registers, meaning their contents will need to be spilled. Also,
some architectures pass arguments in registers. The registers used for
passing arguments are usually the same as the ones used for local allocation,
so the allocator needs to handle them specially. This is done as follows:
the MonoInst for the call instruction contains a map mapping vregs which
contain the argument values to hregs where the argument needs to be placed,
like this (on amd64):
R33 -> RDI
R34 -> RSI
...
When the allocator processes the call instruction, it allocates the vregs
in the map to their associated hregs. So the call instruction is processed as
if having a variable number of arguments which fixed register assignments.
An example:
R33 <- 1
R34 <- 2
call
When the call instruction is processed, R33 is assigned to RDI, and R34 is
assigned to RSI. Later, when the two assignment instructions are processed,
R33 and R34 are already assigned to a hreg, so they are replaced with the
associated hreg leading to the following final code:
RDI <- 1
RSI <- 1
call
Machine description files
=========================
A typical entry in the machine description files looks like this:
shl: dest:i src1:i src2:s clob:1 len:2
The allocator is only interested in the dest,src1,src2 and clob fields.
It understands the following values for the dest, src1, src2 fields:
i - integer register
f - fp register
b - base register (same as i, but the instruction does not modify the reg)
m - fp register, even if an fp stack is used (no fp stack tracking)
It understands the following values for the clob field:
1 - sreg1 needs to be the same as dreg
c - instruction clobbers the caller-save registers
Beside these values, an architecture can define additional values (like the 's'
in the example). The allocator depends on a set of arch-specific macros to
convert these values to information it needs during allocation.
Arch specific macros
====================
These macros usually receive a value from the machine description file (like
the 's' in the example). The examples below are for x86.
/*
* A bitmask selecting the caller-save registers (these are used for local
* allocation).
*/
#define MONO_ARCH_CALLEE_REGS X86_CALLEE_REGS
/*
* A bitmask selecting the callee-saved registers (these are usually used for
* global allocation).
*/
#define MONO_ARCH_CALLEE_SAVED_REGS X86_CALLER_REGS
/* Same for the floating point registers */
#define MONO_ARCH_CALLEE_FREGS 0
#define MONO_ARCH_CALLEE_SAVED_FREGS 0
/* Whenever the target uses a floating point stack */
#define MONO_ARCH_USE_FPSTACK TRUE
/* The size of the floating point stack */
#define MONO_ARCH_FPSTACK_SIZE 6
/*
* Given a descriptor value from the machine description file, return the fixed
* hard reg corresponding to that value.
*/
#define MONO_ARCH_INST_FIXED_REG(desc) ((desc == 's') ? X86_ECX : ((desc == 'a') ? X86_EAX : ((desc == 'd') ? X86_EDX : ((desc == 'y') ? X86_EAX : ((desc == 'l') ? X86_EAX : -1)))))
/*
* A bitmask selecting the hregs which can be used for allocating sreg2 for
* a given instruction.
*/
#define MONO_ARCH_INST_SREG2_MASK(ins) (((ins [MONO_INST_CLOB] == 'a') || (ins [MONO_INST_CLOB] == 'd')) ? (1 << X86_EDX) : 0)
/*
* Given a descriptor value, return whenever it denotes a register pair.
*/
#define MONO_ARCH_INST_IS_REGPAIR(desc) (desc == 'l' || desc == 'L')
/*
* Given a descriptor value, and the first register of a regpair, return a
* bitmask selecting the hregs which can be used for allocating the second
* register of the regpair.
*/
#define MONO_ARCH_INST_REGPAIR_REG2(desc,hreg1) (desc == 'l' ? X86_EDX : -1)
-24
View File
@@ -103,30 +103,6 @@ In the cases above, the number of generated trampolines goes from
5400 for the IronPython case and from 800 to 150 for the hello world
case.
Kinds of Trampolines and Thunks
===============================
This is a list of the trampolines and thunks used in Mono:
- create_fnptr
- load_aot_method
- imt thunk
Interface Method Table, this is used to dispatch calls to
interface methods.
- jump table
- debugger code
- exception call filter
- trampoline (various types)
- throw corlib exception
- restore context
- throw exception by name
- handle stack overflow
- throw exception
- delegate invoke implementation
- cpuid code
Implementation for x86/x86-64
=============================
+32
View File
@@ -0,0 +1,32 @@
Metadata memory management
--------------------------
Most metadata structures have a lifetime which is equal to the MonoImage where they are
loaded from. These structures should be allocated from the memory pool of the
corresponding MonoImage. The memory pool is protected by the loader lock.
Examples of metadata structures in this category:
- MonoClass
- MonoMethod
- MonoType
Memory owned by these structures should be allocated from the image mempool as well.
Examples include: klass->methods, klass->fields, method->signature etc.
Generics complicates things. A generic class could have many instantinations where the
generic arguments are from different assemblies. Where should we allocate memory for
instantinations ? We can allocate from the mempool of the image which contains the
generic type definition, but that would mean that the instantinations would remain in
memory even after the assemblies containing their type arguments are unloaded, leading
to a memory leak. Therefore, we do the following:
- data structures representing the generic definitions are allocated from the image
mempool as usual. These include:
- generic class definition (MonoGenericClass->container_class)
- generic method definitions
- type parameters (MonoGenericParam)
- data structures representing inflated classes/images are allocated from the heap. These
structures are kept in a cache, indexed by type arguments of the instantinations. When
an assembly is unloaded, this cache is searched and all instantinations referencing
types from the assembly are freed. This is done by mono_metadata_clean_for_image ()
in metadata.c. The structures handled this way include:
- MonoGenericClass
- MonoGenericInst
- inflated MonoMethods
+6 -59
View File
@@ -417,19 +417,12 @@
* Testing the port
The JIT has a set of regression tests in *.cs files inside the
mini directory.
The usual method of testing a port is by compiling these tests on
another machine with a working runtime by typing 'make rcheck',
then copying TestDriver.dll and *.exe to the mini directory. The
tests can be run by typing:
The JIT has a set of regression tests in *.cs files inside the mini directory.
The usual method of testing a port is by compiling these tests on another machine
with a working runtime by typing 'make rcheck', then copying TestDriver.dll and
*.exe to the mini directory. The tests can be run by typing:
./mono --regression <exe file name>
The suggested order for working through these tests is the
following:
The suggested order for working through these tests is the following:
- basic.exe
- basic-long.exe
- basic-float.exe
@@ -480,52 +473,6 @@
at this point, so the only parts which require changing are
the arch dependent files.
* Function descriptors
Some ABIs, like those for IA64 and PPC64, don't use direct
function pointers, but so called function descriptors. A
function descriptor is a short data structure which contains
at least a pointer to the code of the function and a pointer
to a GOT/TOC, which needs to be loaded into a specific
register prior to jumping to the function. Global variables
and large constants are accessed through that register.
Mono does not need function descriptors for the JITted code,
but we need to handle them when calling unmanaged code and we
need to create them when passing managed code to unmanaged
code.
mono_create_ftnptr() creates a function descriptor for a piece
of generated code within a specific domain.
mono_get_addr_from_ftnptr() returns the pointer to the native
code in a function descriptor. Never use this function to
generate a jump to a function without loading the GOT/TOC
register unless the function descriptor was created by
mono_create_ftnptr().
See the sources for IA64 and PPC64 on when to create and when
to dereference function descriptors. On PPC64 function
descriptors for various generated helper functions (in
exceptions-ppc.c and tramp-ppc.c) are generated in front of
the code they refer to (see ppc_create_pre_code_ftnptr()). On
IA64 they are created separately.
* Emulated opcodes
Mini has code for emulating quite a few opcodes, most notably
operations on longs, int/float conversions and atomic
operations. If an architecture wishes such an opcode to be
emulated, mini produces icalls instead of those opcodes. This
should only be considered when the operation cannot be
implemented efficiently and thus the overhead occured by the
icall is not relatively large. Emulation of operations is
controlled by #defines in the arch header, but the naming is
not consistent. They usually start with MONO_ARCH_EMULATE_,
MONO_ARCH_NO_EMULATE_ and MONO_ARCH_HAVE_.
* Generic code sharing
Generic code sharing is optional. See the file
"generic-sharing" for information on how to support it on an
architecture.
-5
View File
@@ -1,5 +0,0 @@
<?xml version="1.0"?>
<manpages>
<manpage name="mdoc(5)" page="../man/mdoc.5" />
<manpage name="mono-config(5)" page="../man/mono-config.5" />
</manpages>
-4
View File
@@ -1,4 +0,0 @@
<?xml version="1.0"?>
<monodoc>
<source provider="man" basefile="mono-file-formats" path="man"/>
</monodoc>
-55
View File
@@ -1,55 +0,0 @@
<?xml version="1.0"?>
<manpages>
<manpage name="al(1)" page="../man/al.1" />
<manpage name="caspol(1)" page="../man/caspol.1" />
<manpage name="cert2spc(1)" page="../man/cert2spc.1" />
<manpage name="certmgr(1)" page="../man/certmgr.1" />
<manpage name="chktrust(1)" page="../man/chktrust.1" />
<manpage name="cilc(1)" page="../man/cilc.1" />
<manpage name="disco(1)" page="../man/disco.1" />
<manpage name="dtd2xsd(1)" page="../man/dtd2xsd.1" />
<manpage name="gacutil(1)" page="../man/gacutil.1" />
<manpage name="genxs(1)" page="../man/genxs.1" />
<manpage name="httpcfg(1)" page="../man/httpcfg.1" />
<manpage name="ilasm(1)" page="../man/ilasm.1" />
<manpage name="macpack(1)" page="../man/macpack.1" />
<manpage name="makecert(1)" page="../man/makecert.1" />
<manpage name="mconfig(1)" page="../man/mconfig.1" />
<manpage name="mcs(1)" page="../man/mcs.1" />
<manpage name="mdassembler(1)" page="../man/mdassembler.1" />
<manpage name="mdcs2ecma(1)" page="../man/mdcs2ecma.1" />
<manpage name="mdnormalizer(1)" page="../man/mdnormalizer.1" />
<manpage name="mdoc(1)" page="../man/mdoc.1" />
<manpage name="mdoc-assemble(1)" page="../man/mdoc-assemble.1" />
<manpage name="mdoc-export-html(1)" page="../man/mdoc-export-html.1" />
<manpage name="mdoc-export-msxdoc(1)" page="../man/mdoc-export-msxdoc.1" />
<manpage name="mdoc-update(1)" page="../man/mdoc-update.1" />
<manpage name="mdoc-validate(1)" page="../man/mdoc-validate.1" />
<manpage name="mdvalidator(1)" page="../man/mdvalidator.1" />
<manpage name="mkbundle(1)" page="../man/mkbundle.1" />
<manpage name="mono(1)" page="../man/mono.1" />
<manpage name="mono-service(1)" page="../man/mono-service.1" />
<manpage name="mono-shlib-cop(1)" page="../man/mono-shlib-cop.1" />
<manpage name="monodocer(1)" page="../man/monodocer.1" />
<manpage name="monodocs2html(1)" page="../man/monodocs2html.1" />
<manpage name="monolinker(1)" page="../man/monolinker.1" />
<manpage name="monop(1)" page="../man/monop.1" />
<manpage name="monostyle(1)" page="../man/monostyle.1" />
<manpage name="mono-xmltool(1)" page="../man/mono-xmltool.1" />
<manpage name="mozroots(1)" page="../man/mozroots.1" />
<manpage name="oldmono(1)" page="../man/oldmono.1" />
<manpage name="permview(1)" page="../man/permview.1" />
<manpage name="prj2make(1)" page="../man/prj2make.1" />
<manpage name="resgen(1)" page="../man/resgen.1" />
<manpage name="secutil(1)" page="../man/secutil.1" />
<manpage name="setreg(1)" page="../man/setreg.1" />
<manpage name="sgen(1)" page="../man/sgen.1" />
<manpage name="signcode(1)" page="../man/signcode.1" />
<manpage name="sn(1)" page="../man/sn.1" />
<manpage name="soapsuds(1)" page="../man/soapsuds.1" />
<manpage name="sqlsharp(1)" page="../man/sqlsharp.1" />
<manpage name="vbnc(1)" page="../man/vbnc.1" />
<manpage name="wsdl(1)" page="../man/wsdl.1" />
<manpage name="wsdl2(1)" page="../man/wsdl2.1" />
<manpage name="xsd(1)" page="../man/xsd.1" />
</manpages>
-4
View File
@@ -1,4 +0,0 @@
<?xml version="1.0"?>
<monodoc>
<source provider="man" basefile="mono-tools" path="man"/>
</monodoc>
-5
View File
@@ -1,5 +0,0 @@
<?xml version="1.0"?>
<monodoc>
<node label="Mono Embedding" name="embed" parent="libraries"/>
<source provider="xhtml" basefile="monoapi" path="embed"/>
</monodoc>
-749
View File
@@ -1,749 +0,0 @@
<h1>Metadata Reading</h1>
<p>The Metadata API gives developers low-level access to the
information encoded in CLI modules: type and
methods definitions encoded in metadata as well as access to
the CIL code and embedded resources.
<p>Managed developers access this information using either the
System.Reflection API or a library
like <a href="http://www.mono-project.com/Cecil">Cecil</a>.
<p>To start using the Metadata API it is necessary
to <a href="mono-api-assembly.html#cil_assembly_load">open an
assembly</a> or a CIL image (a .dll or .exe file) using one of
the
<a href="mono-api-image.html#cil_image_open">CIL image
opening</a> API calls.
<h2>Metadata Heaps</h2>
<p>ECMA CLI images contain four heaps that store different
kinds of information, these are:
<ul>
<li>GUID heap (called #GUID) contains 128-bit GUIDs,
you can get pointer to a GUID value by
calling <a href="#api:mono_metadata_guid_heap">mono_metadata_guid_heap</a>.
<li>User string heap (called #US), it contains user
visible strings, you can fetch a string from this heap
by calling
<a href="#api:mono_metadata_user_string">mono_metadata_user_string</a>.
<li>Blob heap (called #blob), it contains binary
blobs of data, you can get a blob
by <a href="#api:mono_metadata_blob_heap">mono_metadata_blob_heap</a>.
You can determine the size of the blob using
the <a href="#api:mono_metadata_decode_blob_size">mono_metadata_decode_blob_size</a>.
</ul>
<p>The ECMA file format also has an extra section called the
"#~" stream, this stream is the one that holds the metadata
tables. There is a high-level API to get access to the
contents of this API, described in the
section <a href="#metadata-tables">Metadata Tables</a>.
<h4><a name="api:mono_metadata_guid_heap">mono_metadata_guid_heap</a></h4>
<h4><a name="api:mono_metadata_string_heap">mono_metadata_string_heap</a></h4>
<h4><a name="api:mono_metadata_blob_heap">mono_metadata_blob_heap</a></h4>
<h4><a name="api:mono_metadata_user_string">mono_metadata_user_string</a></h4>
<h4><a name="api:mono_metadata_decode_blob_size">mono_metadata_decode_blob_size</a></h4>
<a name="metadata-tables"/>
<h2>Metadata Tables</h2>
<p>Metadata is encoded in a number of tables included on every
CIL image. These tables contain type definitions, member
definitions and so on, these constants are defined in the ECMA 335
specification Partition II section 22. The following table
shows the C constants defined in the Mono runtime and how they
map to the equivalent ECMA CLI metadata table:
<center>
<table border=1>
<thead>
<td>
<b>ECMA CLI Table Name</b>
</td>
<td>
<b>C Constant Name</b>
</td>
<td>
<b>Table Schema (Array Size + Columns Constants)</b>
</td>
</thead>
<td>Assembly</td><td>MONO_TABLE_ASSEMBLY</td><td>
Array size:
MONO_ASSEMBLY_SIZE
<ul>
<li>MONO_ASSEMBLY_HASH_ALG
<li>MONO_ASSEMBLY_MAJOR_VERSION
<li>MONO_ASSEMBLY_MINOR_VERSION
<li>MONO_ASSEMBLY_BUILD_NUMBER
<li>MONO_ASSEMBLY_REV_NUMBER
<li>MONO_ASSEMBLY_FLAGS
<li>MONO_ASSEMBLY_PUBLIC_KEY
<li>MONO_ASSEMBLY_NAME
<li>MONO_ASSEMBLY_CULTURE
</ul>
</td>
</tr>
<td>AssemblyOS</td><td>MONO_TABLE_ASSEMBLYOS</td><td>
Array size:
MONO_ASSEMBLYOS_SIZE
<ul>
<li>MONO_ASSEMBLYOS_PLATFORM
<li>MONO_ASSEMBLYOS_MAJOR_VERSION
<li>MONO_ASSEMBLYOS_MINOR_VERSION
</ul>
</td>
</tr>
<td>AssemblyProcessor</td><td>MONO_TABLE_ASSEMBLYPROCESSOR</td><td>Array
size: MONO_ASSEMBLYPROCESSOR_SIZE
<ul>
<li>MONO_ASSEMBLY_PROCESSOR
</ul>
</td>
</tr>
<td>AssemblyRef</td><td>MONO_TABLE_ASSEMBLYREF</td><td>
Array size:
MONO_ASSEMBLYREF_SIZE
<ul>
<li>MONO_ASSEMBLYREF_MAJOR_VERSION
<li>MONO_ASSEMBLYREF_MINOR_VERSION
<li>MONO_ASSEMBLYREF_BUILD_NUMBER
<li>MONO_ASSEMBLYREF_REV_NUMBER
<li>MONO_ASSEMBLYREF_FLAGS
<li>MONO_ASSEMBLYREF_PUBLIC_KEY
<li>MONO_ASSEMBLYREF_NAME
<li>MONO_ASSEMBLYREF_CULTURE
<li>MONO_ASSEMBLYREF_HASH_VALUE
</ul>
</td>
</tr>
<td>AssemblyRefProcessor</td><td>MONO_TABLE_ASSEMBLYREFPROCESSOR</td><td>Array
size: MONO_ASSEMBLYREFPROC_SIZE
<ul>
<li>MONO_ASSEMBLYREFPROC_PROCESSOR
<li>MONO_ASSEMBLYREFPROC_ASSEMBLYREF
</ul>
</td>
</tr>
<td>AssemblyRefOS</td><td>MONO_TABLE_ASSEMBLYREFOS</td><td>
Array size:
<li>MONO_ASSEMBLYREFOS_SIZE
<ul>
<li>MONO_ASSEMBLYREFOS_PLATFORM
<li>MONO_ASSEMBLYREFOS_MAJOR_VERSION
<li>MONO_ASSEMBLYREFOS_MINOR_VERSION
<li>MONO_ASSEMBLYREFOS_ASSEMBLYREF
</ul>
</td>
</tr>
<td>ClassLayout</td><td>MONO_TABLE_CLASSLAYOUT</td><td>
Array size:
MONO_CLASSLAYOUT_SIZE
<ul>
<li>MONO_CLASS_LAYOUT_PACKING_SIZE
<li>MONO_CLASS_LAYOUT_CLASS_SIZE
<li>MONO_CLASS_LAYOUT_PARENT
</ul>
</td>
</tr>
<td>Constant</td><td>MONO_TABLE_CONSTANT</td><td>
Array size:
MONO_CONSTANT_SIZE
<ul>
<li>MONO_CONSTANT_TYPE
<li>MONO_CONSTANT_PADDING
<li>MONO_CONSTANT_PARENT
<li>MONO_CONSTANT_VALUE
</ul>
</td>
</tr>
<td>CustomAttribute</td><td>MONO_TABLE_CUSTOMATTRIBUTE</td><td>
Array size:
MONO_CUSTOM_ATTR_SIZE
<ul>
<li>MONO_CUSTOM_ATTR_PARENT
<li>MONO_CUSTOM_ATTR_TYPE
<li>MONO_CUSTOM_ATTR_VALUE
</ul>
</td>
</tr>
<td>DeclSecurity</td><td>MONO_TABLE_DECLSECURITY</td><td>
Array size:
MONO_DECL_SECURITY_SIZE
<ul>
<li>MONO_DECL_SECURITY_ACTION
<li>MONO_DECL_SECURITY_PARENT
<li>MONO_DECL_SECURITY_PERMISSIONSET
</ul>
</td>
</tr>
<td>EventMap</td><td>MONO_TABLE_EVENTMAP</td><td>
Array size:
MONO_EVENT_MAP_SIZE
<ul>
<li>MONO_EVENT_MAP_PARENT
<li>MONO_EVENT_MAP_EVENTLIST
</ul>
</td>
</tr>
<td>EventPtr</td><td>MONO_TABLE_EVENT_POINTER</td><td>
Array size:
MONO_EVENT_POINTER_SIZE
<ul>
<li>MONO_EVENT_POINTER_EVENT
</ul>
</td>
</tr>
<td>Event</td><td>MONO_TABLE_EVENT</td><td>
Array size: MONO_EVENT_SIZE
<ul>
<li>MONO_EVENT_FLAGS
<li>MONO_EVENT_NAME
<li>MONO_EVENT_TYPE
</ul>
</td>
</tr>
<td>ExportedType</td><td>MONO_TABLE_EXPORTEDTYPE</td><td>
Array size:
MONO_EXPORTEDTYPE_SIZE
<ul>
<li>MONO_EXP_TYPE_FLAGS
<li>MONO_EXP_TYPE_TYPEDEF
<li>MONO_EXP_TYPE_NAME
<li>MONO_EXP_TYPE_NAMESPACE
<li>MONO_EXP_TYPE_IMPLEMENTATION
</ul>
</td>
</tr>
<td>Field</td><td>MONO_TABLE_FIELD</td><td>
Array size: MONO_FIELD_SIZE
<ul>
<li>MONO_FIELD_FLAGS
<li>MONO_FIELD_NAME
<li>MONO_FIELD_SIGNATURE
</ul>
</td>
</tr>
<td>FieldLayoutt</td><td>MONO_TABLE_FIELDLAYOUT</td><td>
Array size:
MONO_FIELDLAYOUT_SIZE
<ul>
<li>MONO_FIELD_LAYOUT_OFFSET
<li>MONO_FIELD_LAYOUT_FIELD
</ul>
</td>
</tr>
<td>FieldMarshal</td><td>MONO_TABLE_FIELDMARSHAL</td><td>
Array size:
MONO_FIELD_MARSHAL_SIZE
<ul>
<li>MONO_FIELD_MARSHAL_PARENT
<li>MONO_FIELD_MARSHAL_NATIVE_TYPE
</ul>
</td>
</tr>
<td>FieldPtr</td><td>MONO_TABLE_FIELD_POINTER</td><td>
Array size:
MONO_FIELD_POINTER_SIZE
<ul>
<li>MONO_FIELD_POINTER_FIELD
</ul>
</td>
</tr>
<td>FieldRVA</td><td>MONO_TABLE_FIELDRVA</td><td>
Array size:
MONO_FIELDRVA_SIZE
<ul>
<li>MONO_FIELD_RVA_RVA
<li>MONO_FIELD_RVA_FIELD
</ul>
</td>
</tr>
<td>File</td><td>MONO_TABLE_FILE</td><td>
Array size: MONO_FILE_SIZE
<ul>
<li>MONO_FILE_FLAGS
<li>MONO_FILE_NAME
<li>MONO_FILE_HASH_VALUE
</ul>
</td>
</tr>
<td>GenericParam</td><td>MONO_TABLE_GENERICPARAM</td><td>
Array size:
MONO_GENERICPARAM_SIZE
<ul>
<li>MONO_GENERICPARAM_NUMBER
<li>MONO_GENERICPARAM_FLAGS
<li>MONO_GENERICPARAM_OWNER
<li>MONO_GENERICPARAM_NAME
</ul>
</td>
</tr>
<td>GenericParamConstraint</td><td>MONO_TABLE_GENERICPARAMCONSTRAINT</td><td>Array
size: MONO_GENERICPARAMCONSTRAINT_SIZE
<ul>
<li>MONO_GENPARCONSTRAINT_GENERICPAR
<li>MONO_GENPARCONSTRAINT_CONSTRAINT
</ul>
</td>
<tr>
<td>ImplMap</td><td>MONO_TABLE_IMPLMAP</td><td>
Array size:
MONO_IMPLMAP_SIZE
<ul>
<li>MONO_IMPLMAP_FLAGS
<li>MONO_IMPLMAP_MEMBER
<li>MONO_IMPLMAP_NAME
<li>MONO_IMPLMAP_SCOPE
</ul>
</td>
</tr>
<td>InterfaceImpl</td><td>MONO_TABLE_INTERFACEIMPL</td><td>
Array size:
<li>MONO_INTERFACEIMPL_SIZE
<ul>
<li>MONO_INTERFACEIMPL_CLASS
<li>MONO_INTERFACEIMPL_INTERFACE
</ul>
</td>
</tr>
<td>ManifestResource</td><td>MONO_TABLE_MANIFESTRESOURCE</td><td>Array
size: MONO_MANIFESTRESOURCE_SIZE
<ul>
<li>MONO_MANIFEST_OFFSET
<li>MONO_MANIFEST_FLAGS
<li>MONO_MANIFEST_NAME
<li>MONO_MANIFEST_IMPLEMENTATION
</ul>
</td>
</tr>
<tr>
<td>MemberRef</td><td>MONO_TABLE_MEMBERREF</td><td>
Array size:
MONO_MEMBERREF_SIZE
<ul>
<li>MONO_MEMBERREF_CLASS
<li>MONO_MEMBERREF_NAME
<li>MONO_MEMBERREF_SIGNATURE
</ul>
</td>
</tr>
<td>MethodImpl</td><td>MONO_TABLE_METHODIMPL</td><td>
Array size:
MONO_METHODIMPL_SIZE
<ul>
<li>MONO_METHODIMPL_CLASS
<li>MONO_METHODIMPL_BODY
<li>MONO_METHODIMPL_DECLARATION
</ul>
</td>
</tr>
<td>MethodSpec</td><td>MONO_TABLE_METHODSPEC</td><td>
Array size:
MONO_METHODSPEC_SIZE
<ul>
<li>MONO_METHODSPEC_METHOD
<li>MONO_METHODSPEC_SIGNATURE
</ul>
</td>
</tr>
<tr>
<td>MethodSemantics</td><td>MONO_TABLE_METHODSEMANTICS</td><td>Array
size: MONO_METHOD_SEMA_SIZE
<ul>
<li>MONO_METHOD_SEMA_SEMANTICS
<li>MONO_METHOD_SEMA_METHOD
<li>MONO_METHOD_SEMA_ASSOCIATION
</ul>
</td>
</tr>
<td>Moduleref</td><td>MONO_TABLE_MODULEREF</td><td>
Array size:
MONO_MODULEREF_SIZE
<ul>
<li>MONO_MODULEREF_NAME
</ul>
</td>
</tr>
<tr>
<td>Module</td><td>MONO_TABLE_MODULE</td><td>
Array size:
MONO_MODULE_SIZE
<br>
Columns:
<ul>
<li>MONO_MODULE_GENERATION
<li>MONO_MODULE_NAME
<li>MONO_MODULE_MVID
<li>MONO_MODULE_ENC
<li>MONO_MODULE_ENCBASE
</ul>
</td>
</tr>
<td>TypeRef</td><td>MONO_TABLE_TYPEREF</td><td>
Array size:
MONO_TYPEREF_SIZE
<ul>
<li>MONO_TYPEREF_SCOPE
<li>MONO_TYPEREF_NAME
<li>MONO_TYPEREF_NAMESPACE
</ul>
</td>
</tr>
<tr>
<td>MethodPtr</td><td>MONO_TABLE_METHOD_POINTER</td><td>
Array size:
MONO_METHOD_POINTER_SIZE
<ul>
<li>MONO_METHOD_POINTER_METHOD
</ul>
</td>
</tr>
<td>Method</td><td>MONO_TABLE_METHOD</td><td>
Array size:
MONO_METHOD_SIZE
<ul>
<li>MONO_METHOD_RVA
<li>MONO_METHOD_IMPLFLAGS
<li>MONO_METHOD_FLAGS
<li>MONO_METHOD_NAME
<li>MONO_METHOD_SIGNATURE
<li>MONO_METHOD_PARAMLIST
</ul>
</td>
</tr>
<tr>
<td>NestedClass</td><td>MONO_TABLE_NESTEDCLASS</td><td>
Array size:
MONO_NESTEDCLASS_SIZE
<ul>
<li>MONO_NESTED_CLASS_NESTED
<li>MONO_NESTED_CLASS_ENCLOSING
</ul>
</td>
</tr>
<tr>
<td>ParamPtr</td><td>MONO_TABLE_PARAM_POINTER</td><td>
Array size:
MONO_PARAM_POINTER_SIZE
<ul>
<li>MONO_PARAM_POINTER_PARAM
</ul>
</td>
</tr>
<td>Param</td><td>MONO_TABLE_PARAM</td><td>
Array size: MONO_PARAM_SIZE
<ul>
<li>MONO_PARAM_FLAGS
<li>MONO_PARAM_SEQUENCE
<li>MONO_PARAM_NAME
</ul>
</td>
</tr>
<td>PropertyMap</td><td>MONO_TABLE_PROPERTYMAP</td><td>
Array size:
MONO_PROPERTY_MAP_SIZE
<ul>
<li>MONO_PROPERTY_MAP_PARENT
<li>MONO_PROPERTY_MAP_PROPERTY_LIST
</ul>
</td>
</tr>
<td>PropertyPtr</td><td>MONO_TABLE_PROPERTY_POINTER</td><td>Array
size: MONO_PROPERTY_POINTER_SIZE
<ul>
<li>MONO_PROPERTY_POINTER_PROPERTY
</ul>
</td>
</tr>
<td>Property</td><td>MONO_TABLE_PROPERTY</td><td>
Array size:
MONO_PROPERTY_SIZE
<ul>
<li>MONO_PROPERTY_FLAGS
<li>MONO_PROPERTY_NAME
<li>MONO_PROPERTY_TYPE
</ul>
</td>
</tr>
<tr>
<td>StandaloneSig</td><td>MONO_TABLE_STANDALONESIG</td><td>
Array size:
<li>MONO_STAND_ALONE_SIGNATURE_SIZE
<ul>
<li>MONO_STAND_ALONE_SIGNATURE
</ul>
</td>
</tr>
<tr>
<td>TypeDef</td><td>MONO_TABLE_TYPEDEF</td><td>
Array size:
MONO_TYPEDEF_SIZE
<ul>
<li>MONO_TYPEDEF_FLAGS
<li>MONO_TYPEDEF_NAME
<li>MONO_TYPEDEF_NAMESPACE
<li>MONO_TYPEDEF_EXTENDS
<li>MONO_TYPEDEF_FIELD_LIST
<li>MONO_TYPEDEF_METHOD_LIST
</ul>
</td>
</tr>
<tr>
<td>TypeSpec</td><td>MONO_TABLE_TYPESPEC</td><td>
Array size:
MONO_TYPESPEC_SIZE
<ul>
<li>MONO_TYPESPEC_SIGNATURE
</ul>
</td>
</tr>
</table>
</center>
<p>Each table can contain zero or more rows, you must call the
<a href="#api:mono_metadata_table_rows">mono_metadata_table_rows</a>
to obtain the number of rows in a table, and then you can
extract individual row values by using
the <a href="#api:mono_metadata_decode_row">mono_metadata_decode_row</a>
or
the <a href="#api:mono_metadata_decode_row_col">mono_metadata_decode_row_col</a>.
When decoding rows you must provide an guint32 array large
enough to hold as many columns as the table contains.
<p>The metadata tables are stored in the MonoImage, you obtain
a pointer to the MonoTableInfo by calling
the <a href="#api:mono_image_get_table_info">mono_image_get_table_info</a>
and then you can scan those tables, for example:
<pre class="prettyprint">
/*
* Dumps a few fields from the AssemblyRef table
*/
void DumpAssemblyRefs (MonoImage *image)
{
/* Get a pointer to the AssemblyRef metadata table */
MonoTableInfo *t = mono_image_get_table_info (image, MONO_TABLE_ASSEMBLYREF);
/* Fetch the number of rows available in the table */
int rows = mono_table_info_get_rows (t);
int i;
/* For each row, print some of its values */
for (i = 0; i &lt; rows; i++){
/* Space where we extract one row from the metadata table */
guint32 cols [MONO_ASSEMBLYREF_SIZE];
/* Extract the row into the array cols */
mono_metadata_decode_row (t, i, cols, MONO_ASSEMBLYREF_SIZE);
fprintf (output, "%d: Version=%d.%d.%d.%d\n\tName=%s\n", i + 1,
cols [MONO_ASSEMBLYREF_MAJOR_VERSION],
cols [MONO_ASSEMBLYREF_MINOR_VERSION],
cols [MONO_ASSEMBLYREF_BUILD_NUMBER],
cols [MONO_ASSEMBLYREF_REV_NUMBER],
mono_metadata_string_heap (image, cols [MONO_ASSEMBLYREF_NAME]));
}
}
</pre>
<p>The above program shows the following output when ran on
the C# compiler:
<pre>
1: Version=1.0.5000.0
Name=mscorlib
2: Version=1.0.5000.0
Name=System
3: Version=1.0.5000.0
Name=System.Xml
</pre>
<p>
<h3>Metadata Tables API</h3>
<p>These are the APIs for dealing with tables:
<h4><a name="api:mono_image_get_table_info">mono_image_get_table_info</a></h4>
<h4><a name="api:mono_image_get_table_rows">mono_image_get_table_rows</a></h4>
<h4><a name="api:mono_metadata_get_table">mono_metadata_get_table</a></h4>
<h4><a name="api:mono_meta_table_name">mono_meta_table_name</a></h4>
<h4><a name="api:mono_metadata_decode_row_col">mono_metadata_decode_row_col</a></h4>
<h4><a name="api:mono_metadata_decode_row">mono_metadata_decode_row</a></h4>
<h4><a name="api:mono_metadata_compute_size">mono_metadata_compute_size</a></h4>
<h4><a name="api:mono_metadata_custom_attrs_from_index">mono_metadata_custom_attrs_from_index</a></h4>
<h4><a name="api:mono_metadata_decode_signed_value">mono_metadata_decode_signed_value</a></h4>
<h4><a name="api:mono_metadata_decode_value">mono_metadata_decode_value</a></h4>
<h4><a name="api:mono_metadata_encode_value">mono_metadata_encode_value</a></h4>
<h2>Metadata access API</h2>
<p>This is the low-level API for accessing the metadata
images.
<h4><a name="api:mono_cli_rva_image_map">mono_cli_rva_image_map</a></h4>
<h4><a name="api:mono_pe_file_open">mono_pe_file_open</a></h4>
<h4><a name="api:mono_metadata_events_from_typedef">mono_metadata_events_from_typedef</a></h4>
<h4><a name="api:mono_metadata_field_info">mono_metadata_field_info</a></h4>
<h4><a name="api:mono_metadata_free_array">mono_metadata_free_array</a></h4>
<h4><a name="api:mono_metadata_free_marshal_spec">mono_metadata_free_marshal_spec</a></h4>
<h4><a name="api:mono_metadata_free_mh">mono_metadata_free_mh</a></h4>
<h4><a name="api:mono_metadata_free_type">mono_metadata_free_type</a></h4>
<h4><a name="api:mono_metadata_get_constant_index">mono_metadata_get_constant_index</a></h4>
<h4><a name="api:mono_metadata_get_marshal_info">mono_metadata_get_marshal_info</a></h4>
<h4><a name="api:mono_metadata_implmap_from_method">mono_metadata_implmap_from_method</a></h4>
<h4><a name="api:mono_metadata_interfaces_from_typedef_full">mono_metadata_interfaces_from_typedef_full</a></h4>
<h4><a name="api:mono_metadata_interfaces_from_typedef">mono_metadata_interfaces_from_typedef</a></h4>
<h4><a name="api:mono_metadata_locate">mono_metadata_locate</a></h4>
<h4><a name="api:mono_metadata_locate_token">mono_metadata_locate_token</a></h4>
<h4><a name="api:mono_metadata_methods_from_event">mono_metadata_methods_from_event</a></h4>
<h4><a name="api:mono_metadata_methods_from_property">mono_metadata_methods_from_property</a></h4>
<h4><a name="api:mono_metadata_nested_in_typedef">mono_metadata_nested_in_typedef</a></h4>
<h4><a name="api:mono_metadata_nesting_typedef">mono_metadata_nesting_typedef</a></h4>
<h4><a name="api:mono_metadata_packing_from_typedef">mono_metadata_packing_from_typedef</a></h4>
<h4><a name="api:mono_metadata_properties_from_typedef">mono_metadata_properties_from_typedef</a></h4>
<h4><a name="api:mono_metadata_token_from_dor">mono_metadata_token_from_dor</a></h4>
<h4><a name="api:mono_metadata_typedef_from_field">mono_metadata_typedef_from_field</a></h4>
<h4><a name="api:mono_metadata_typedef_from_method">mono_metadata_typedef_from_method</a></h4>
<h4><a name="api:mono_metadata_type_equal">mono_metadata_type_equal</a></h4>
<h4><a name="api:mono_metadata_type_hash">mono_metadata_type_hash</a></h4>
<h4><a name="api:mono_metadata_declsec_from_index">mono_metadata_declsec_from_index</a></h4>
<h4><a name="api:mono_metadata_free_method_signature">mono_metadata_free_method_signature</a></h4>
<h3>Retrieving Objects from Tokens</h3>
<h4><a name="api:mono_metadata_parse_custom_mod">mono_metadata_parse_custom_mod</a></h4>
<h4><a name="api:mono_metadata_parse_field_type">mono_metadata_parse_field_type</a></h4>
<h4><a name="api:mono_metadata_parse_marshal_spec">mono_metadata_parse_marshal_spec</a></h4>
<h4><a name="api:mono_metadata_parse_method_signature_full">mono_metadata_parse_method_signature_full</a></h4>
<h4><a name="api:mono_metadata_parse_method_signature">mono_metadata_parse_method_signature</a></h4>
<h4><a name="api:mono_metadata_parse_mh_full">mono_metadata_parse_mh_full</a></h4>
<h4><a name="api:mono_metadata_parse_mh">mono_metadata_parse_mh</a></h4>
<h4><a name="api:mono_metadata_parse_param">mono_metadata_parse_param</a></h4>
<h4><a name="api:mono_metadata_parse_signature_full">mono_metadata_parse_signature_full</a></h4>
<h4><a name="api:mono_metadata_parse_signature">mono_metadata_parse_signature</a></h4>
<h4><a name="api:mono_metadata_parse_typedef_or_ref">mono_metadata_parse_typedef_or_ref</a></h4>
<h4><a name="api:mono_metadata_parse_type_full">mono_metadata_parse_type_full</a></h4>
<h4><a name="api:mono_metadata_parse_type">mono_metadata_parse_type</a></h4>
<h2>Metadata Loader Locking</h2>
<p>The locking functions here are used by code in class.c and
metadata.c to lock access to the shared hashtables inside the
MonoImage.
<h4><a name="api:mono_loader_lock">mono_loader_lock</a></h4>
<h4><a name="api:mono_loader_unlock">mono_loader_unlock</a></h4>
<h2>Generics Support</h2>
<h4><a name="api:mono_metadata_generic_class_is_valuetype">mono_metadata_generic_class_is_valuetype</a></h4>
<h4><a name="api:mono_metadata_has_generic_params">mono_metadata_has_generic_params</a></h4>
<h4><a name="api:mono_metadata_inflate_generic_inst">mono_metadata_inflate_generic_inst</a></h4>
<h4><a name="api:mono_metadata_parse_generic_inst">mono_metadata_parse_generic_inst</a></h4>
<h4><a name="api:mono_metadata_generic_inst_equal">mono_metadata_generic_inst_equal</a></h4>
<h4><a name="api:mono_metadata_generic_inst_hash">mono_metadata_generic_inst_hash</a></h4>
<h4><a name="api:mono_metadata_load_generic_params">mono_metadata_load_generic_params</a></h4>
<h4><a name="api:mono_metadata_generic_inst_is_valuetype">mono_metadata_generic_inst_is_valuetype</a></h4>
<h4><a name="api:mono_metadata_generic_method_equal">mono_metadata_generic_method_equal</a></h4>
<h2>Tokens</h2>
<h4><a name="api:mono_ldtoken">mono_ldtoken</a></h4>
<h4><a name="api:mono_lookup_dynamic_token">mono_lookup_dynamic_token</a></h4>
<h4><a name="api:mono_ldstr">mono_ldstr</a></h4>
<h4><a name="api:mono_exception_from_token">mono_exception_from_token</a></h4>
<h4><a name="api:mono_create_jit_trampoline_from_token">mono_create_jit_trampoline_from_token</a></h4>
<h2>OpCodes</h2>
<h4><a name="api:mono_opcode_name">mono_opcode_name</a></h4>
<h4><a name="api:mono_opcode_value">mono_opcode_value</a></h4>
<h2>Metadata Loading Errors</h2>
<p>The routines in this section are used to cope with errors
during metadata loading. Errors in metadata handling can
happen for many reason, and these include (this is not an
exhaustive list).
<ul>
<li>An assembly referenced is missing.
<li>Fields referenced are missing.
<li>Methods referenced are missing.
</ul>
<p>The <tt>mono_loader_set_*</tt> routines are invoked during
metadata loading to flag that an error has happened. The
class loading errros are flagged in a per-thread basis.
<P>In various spots in the runtime the
<tt>mono_loader_get_last_error</tt> routine is called to check
if there was a problem, and then errors are propagated upwards
on the stack until we reach a point where an exception can be
raised and no runtime locks are held.
<p>The <tt>mono_loader_error_prepare_exception</tt> takes a
<tt>MonoLoaderError</tt> structure (the value returned from
<tt>mono_loader_get_last_error</tt>), turns that into an
exception and clears the error condition from the current
thread.
<h4><a name="api:mono_loader_set_error_field_load">mono_loader_set_error_field_load</a></h4>
<h4><a name="api:mono_loader_set_error_method_load">mono_loader_set_error_method_load</a></h4>
<h4><a name="api:mono_loader_set_error_type_load">mono_loader_set_error_type_load</a></h4>
<h4><a name="api:mono_loader_get_last_error">mono_loader_get_last_error</a></h4>
<h4><a name="api:mono_loader_clear_error">mono_loader_clear_error</a></h4>
<h4><a name="api:mono_loader_error_prepare_exception">mono_loader_error_prepare_exception</a></h4>
+113
View File
@@ -0,0 +1,113 @@
1. Thread safety of metadata structures
----------------------------------------
1.1 Synchronization of read-only data
-------------------------------------
Read-only data is data which is not modified after creation, like the
actual binary metadata in the metadata tables.
There are three kinds of threads with regards to read-only data:
- readers
- the creator of the data
- the destroyer of the data
Most threads are readers.
- synchronization between readers is not neccesary
- synchronization between the writers is done using locks.
- synchronization between the readers and the creator is done by not exposing
the data to readers before it is fully constructed.
- synchronization between the readers and the destroyer: TBD.
1.2 Deadlock prevention plan
----------------------------
Hold locks for the shortest time possible. Avoid calling functions inside
locks which might obtain global locks (i.e. locks known outside this module).
1.3 Locks
----------
1.3.1 Simple locks
------------------
There are a lot of global data structures which can be protected by a 'simple' lock. Simple means:
- the lock protects only this data structure or it only protects the data structures in a given C module.
An example would be the appdomains list in domain.c
- the lock is only held for a short amount of time, and no other lock is acquired inside this simple lock. Thus there is
no possibility of deadlock.
1.3.2 The class loader lock
---------------------------
This locks is held by the class loading routines in class.c and loader.c. It
protects the various caches inside MonoImage which are used by these modules.
1.3.3 The domain lock
---------------------
Each appdomain has a lock which protects the per-domain data structures.
1.3.4 The locking hierarchy
---------------------------
It is useful to model locks by a locking hierarchy, which is a relation between locks, which is reflexive, transitive,
and antisymmetric, in other words, a lattice. If a thread wants to acquire a lock B, while already holding A, it can only
do it if A < B. If all threads work this way, then no deadlocks can occur.
Our locking hierarchy so far looks like this:
<DOMAIN LOCK>
\
<CLASS LOADER LOCK>
\ \
<SIMPLE LOCK 1> <SIMPLE LOCK 2>
1.4 Notes
----------
Some common scenarios:
- if a function needs to access a data structure, then it should lock it itself, and do not count on its caller locking it.
So for example, the image->class_cache hash table would be locked by mono_class_get().
- there are lots of places where a runtime data structure is created and stored in a cache. In these places, care must be
taken to avoid multiple threads creating the same runtime structure, for example, two threads might call mono_class_get ()
with the same class name. There are two choices here:
<enter mutex>
<check that item is created>
if (created) {
<leave mutex>
return item
}
<create item>
<store it in cache>
<leave mutex>
This is the easiest solution, but it requires holding the lock for the whole time which might create a scalability problem, and could also lead to deadlock.
<enter mutex>
<check that item is created>
<leave mutex>
if (created) {
return item
}
<create item>
<enter mutex>
<check that item is created>
if (created) {
/* Another thread already created and stored the same item */
<free our item>
<leave mutex>
return orig item
}
else {
<store item in cache>
<leave mutex>
return item
}
This solution does not present scalability problems, but the created item might be hard to destroy (like a MonoClass).
- lazy initialization of hashtables etc. is not thread safe
File renamed without changes.
+2 -152
View File
@@ -1,160 +1,11 @@
2009-02-05 Miguel de Icaza <[email protected]>
* src/gstr.c: Add g_strnfill
* src/glib.h: Add g_list_previous
2009-01-19 Bill Holmes <[email protected]>
* gmisc-win32.c (g_path_is_absolute): Adding support for UNC
paths on Windows.
Contributed under MIT/X11 license.
2009-01-08 Bill Holmes <[email protected]>
* winconfig.h, src/gfile-posix.c :
Fixing the MSVC builds.
Contributed under MIT/X11 license.
2009-01-07 Miguel de Icaza <[email protected]>
* src/gfile-posix.c: Move g_get_current_dir, as it is a
POSIX-esque feature, and some other systems do not have current
directories.
* src/glib.h (G_LOCK_DEFINE, G_LOCK_DEFINE_STATIC):
Embedded support from Paolo's work on quack.
* configure.ac: check for strtok_r, langinfo.h and iconv.h
* src/gpath.c (strtok_r): Add a strtok_r implementation if it is
not available on the target system.
2008-11-05 Bill Holmes <[email protected]>
* src/gutf8.c, src/unicode-data.h, src/gunicode.c :
Fixing the MSVC builds.
Contributed under MIT/X11 license.
2008-11-04 Atsushi Enomoto <[email protected]>
* src/gutf8.c, src/gunicode.c, src/glib.h:
implemented g_unichar_type(), g_unichar_toupper(),
g_unichar_tolower(), g_unichar_totitle(), g_utf8_strup()
and g_utf8_strdown(). Fixed some surrogate pair bugs.
* TODO : removed implemented things.
* test/unicode.c, test/tests.h, test/utf8.c, test/Makefile.am:
added new tests.
2008-11-04 Atsushi Enomoto <[email protected]>
* src/unicode-data.h : new header for some new unicode manipulation
functions.
2008-10-17 Miguel de Icaza <[email protected]>
* Allow types to be defined on the eglib-config.h file, that could
be a platform specific generated type file.
* gtimer.c: split functionality in platforms.
2008-10-13 Bill Holmes <[email protected]>
* src/gdate-win32.c : Fix compiler errors for MSVC.
* src/gpath.c : Fix compiler errors for MSVC.
* src/gfile-posix.c : Adding declaration for mkstemp for the win 32
implementation in gfile-win32.c.
Contributed under MIT/X11 license.
2008-10-11 Miguel de Icaza <[email protected]>
* gtimer.c: Same process.
* src/glib.h: Move g_strdup here, to consolidate all allocations
in this header, will help for merging the allocation work later.
* src/gpattern.c (compile_pattern): From Unity, use -1 in the enum
for MatchType.
* src/gpath.c: Split this one as well.
* src/gmodule-win32.c, src/gmisc-unix.c, src/gmisc-win32.c,
src/gmodule-unix.c: split functionality in platforms.
* src/goutput.c (g_logv): On some platforms, before we abort we
want to flush the stdout/stderr.
2008-10-10 Miguel de Icaza <[email protected]>
* Split functionality that is operating system specific into
-win32.c, -unix.c and -posix.c
* Use g_malloc everywhere, and g_free, so that these can be easily
overwritten consistently.
2008-09-16 Bill Holmes <[email protected]>
* src/gunicode.c : Fix a warning.
Contributed under MIT/X11 license.
2008-08-28 Bill Holmes <[email protected]>
Backport of r111875
* src/glib.h : Adding a c++ definition for G_BEGIN_DECLS.
Contributed under MIT/X11 license.
2008-08-27 Bill Holmes <[email protected]>
* glib.h, gunicode.c : Fixing some compiler errors.
Contributed under MIT/X11 license.
2008-08-20 Mike Voorhees <[email protected]>
* Patch from Mike Voorhees to fix various problems with
g_utf8_validate compared to the glib implementation and unit tests
to ensure that there are no regressions.
From a mailing list post to mono-devel-list on August 19th, 2008
[Mono-dev] utf8 related patches. Please review.
2008-08-20 Mike Voorhees <[email protected]>
* src/glib.h : Adding declarations for g_utf8_strlen, g_utf8_get_char,
and g_utf8_next_char.
* src/gunicode.c : Adding implementation for g_utf8_strlen, g_utf8_get_char,
and g_utf8_next_char.
* src/gunicode.c : Rewrote g_utf8_validate.
* test/utf8.c Adding tests for g_utf8_strlen, g_utf8_get_char,
g_utf8_next_char, and g_utf8_validate.
Contributed under MIT/X11 license.
2008-08-05 Andreas Faerber <[email protected]>
* autogen.sh: Suppress arguments warning for NOCONFIGURE.
Contributed under MIT/X11 license.
2008-08-04 Bill Holmes <[email protected]>
* test/tests.h, test/Makefile.am, test/memory.c : Adding memory tests to test
allocation routines return NULL when 0 size is passed in.
Contributed under MIT/X11 license.
2008-08-04 Bill Holmes <[email protected]>
* src/glib.h : Changing the allocation routines to return null if 0 size is
@@ -1297,4 +1148,3 @@ Mon Oct 9 12:59:16 CEST 2006 Paolo Molaro <[email protected]>
untested at this point.
+5 -19
View File
@@ -18,31 +18,17 @@ no separate files, please try to follow the convetions in the source code
Please read the README in tests/
* Features
The source code is designed to allow for different operating
system builds of the eglib code.
Files in src that:
* Have a plain name: are cross platform, and should work on
every operating system.
* That end in -unix.c: These files contain Unix specific code.
* That end in -win32.c: These files contain Win32 specific code.
* That end in -posix.c: Will work on both Windows and Unix,
but should not be included for other operating systems.
* Plans: short and long term.
The short term plans for eglib is to allow Mono to optionally
build with it instead of using glib, gmodule and gthread, but
the default build will continue to be done against glib 2.0.
In the long-term we are considering dropping glib as a
dependency, considering that Mono requires a modern Unix
Our first target is to make this work with Linux, other
platforms will follow after that.
In the long-term (Mono 2.0) we are considering dropping glib
as a dependency, considering that Mono requires a modern Unix
system to run anyways (for its thread support) it would allow
us to fix some of the glib API limitations we have to live
with (explicit thread support for example), rework the API to
+2 -1
View File
@@ -14,7 +14,8 @@ Macros:
* Unimplemented, not supported currently:
(none as yet.)
g_unichar_tolower Used for deprecated unmanaged string collation
g_unichar_type Used for deprecated unmanaged string collation
* Dead Code
+1 -1
View File
@@ -82,7 +82,7 @@ if test "$DIE" -eq 1; then
exit 1
fi
if test x$NOCONFIGURE = x && test -z "$*"; then
if test -z "$*"; then
echo "**Warning**: I am going to run \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \`$0\'" command line."
+3 -3
View File
@@ -2,7 +2,7 @@ AC_INIT(README)
AC_CANONICAL_SYSTEM
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(eglib,0.3)
AM_INIT_AUTOMAKE(eglib,0.1)
AM_MAINTAINER_MODE
AC_PROG_CC
@@ -55,7 +55,7 @@ AM_CONDITIONAL(PLATFORM_WIN32, test x$OS = xWIN32)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(void *)
AC_CHECK_FUNCS(strndup strlcpy getpwent_r strtok_r)
AC_CHECK_FUNCS(strndup strlcpy getpwent_r)
AC_CHECK_LIB(iconv, libiconv_open, LIBS="$LIBS -liconv")
old_ldflags="${LDFLAGS}"
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
@@ -64,7 +64,7 @@ if test $found_export_dynamic = no; then
LDFLAGS="${old_ldflags}"
fi
AC_CHECK_HEADERS(getopt.h sys/time.h sys/wait.h pwd.h langinfo.h iconv.h)
AC_CHECK_HEADERS(getopt.h sys/time.h sys/wait.h pwd.h)
if test $ac_cv_sizeof_void_p != $ac_cv_sizeof_int; then
GPOINTER_TO_INT="((gint)(long) (ptr))"
+7 -19
View File
@@ -1,19 +1,5 @@
noinst_LTLIBRARIES = libeglib.la
win_files = \
gdate-win32.c gdir-win32.c gfile-win32.c gmisc-win32.c \
gmodule-win32.c gtimer-win32.c
unix_files = \
gdate-unix.c gdir-unix.c gfile-unix.c gmisc-unix.c \
gmodule-unix.c gtimer-unix.c
if PLATFORM_WIN32
os_files = $(win_files)
else
os_files = $(unix_files)
endif
libeglib_la_SOURCES = \
eglib-config.h \
sort.frag.h \
@@ -22,6 +8,7 @@ libeglib_la_SOURCES = \
gerror.c \
ghashtable.c \
gmem.c \
gmodule.c \
gmodule.h \
goutput.c \
gstr.c \
@@ -29,18 +16,19 @@ libeglib_la_SOURCES = \
gstring.c \
gptrarray.c \
glist.c \
gmisc.c \
gqueue.c \
gpath.c \
gshell.c \
gspawn.c \
gtimer.c \
gdate.c \
gfile.c \
gfile-posix.c \
gpattern.c \
gdir.c \
gmarkup.c \
gutf8.c \
gunicode.c \
unicode-data.h \
$(os_files)
gunicode.c
libeglib_la_CFLAGS = -Wall -D_FORTIFY_SOURCE=2
@@ -54,4 +42,4 @@ endif
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = eglib-config.h.in $(win_files) $(unix_files)
EXTRA_DIST = eglib-config.h.in
-42
View File
@@ -1,42 +0,0 @@
/*
* gdate-unix.c: Date and time utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected]
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdio.h>
#include <glib.h>
#include <sys/time.h>
void
g_get_current_time (GTimeVal *result)
{
struct timeval tv;
g_return_if_fail (result != NULL);
gettimeofday (&tv, NULL);
result->tv_sec = tv.tv_sec;
result->tv_usec = tv.tv_usec;
}
-44
View File
@@ -1,44 +0,0 @@
/*
* gdate-win32.c: Date and time utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected]
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdio.h>
#include <glib.h>
#include <winsock2.h>
void
g_get_current_time (GTimeVal *result)
{
long int l;
g_return_if_fail (result != NULL);
l = GetTickCount();
result->tv_sec = l / 1000;
result->tv_usec = (l % 1000) * 1000;
}
+55
View File
@@ -0,0 +1,55 @@
/*
* Date and time utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected]
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdio.h>
#include <glib.h>
#ifdef G_OS_WIN32
#include <winsock2.h>
#else
#include <sys/time.h>
#endif
void
g_get_current_time (GTimeVal *result)
{
#ifdef G_OS_WIN32
long int l = GetTickCount();
g_return_if_fail (result != NULL);
result->tv_sec = l / 1000;
result->tv_usec = (l % 1000) * 1000;
#else
struct timeval tv;
g_return_if_fail (result != NULL);
gettimeofday (&tv, NULL);
result->tv_sec = tv.tv_sec;
result->tv_usec = tv.tv_usec;
#endif
}
-94
View File
@@ -1,94 +0,0 @@
/*
* Directory utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected])
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
struct _GDir {
DIR *dir;
};
GDir *
g_dir_open (const gchar *path, guint flags, GError **error)
{
GDir *dir;
g_return_val_if_fail (path != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
(void) flags; /* this is not used */
dir = g_new (GDir, 1);
dir->dir = opendir (path);
if (dir->dir == NULL) {
if (error) {
gint err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
}
g_free (dir);
return NULL;
}
return dir;
}
const gchar *
g_dir_read_name (GDir *dir)
{
struct dirent *entry;
g_return_val_if_fail (dir != NULL && dir->dir != NULL, NULL);
do {
entry = readdir (dir->dir);
if (entry == NULL)
return NULL;
} while ((strcmp (entry->d_name, ".") == 0) || (strcmp (entry->d_name, "..") == 0));
return entry->d_name;
}
void
g_dir_rewind (GDir *dir)
{
g_return_if_fail (dir != NULL && dir->dir != NULL);
rewinddir (dir->dir);
}
void
g_dir_close (GDir *dir)
{
g_return_if_fail (dir != NULL && dir->dir != 0);
closedir (dir->dir);
dir->dir = NULL;
g_free (dir);
}
-147
View File
@@ -1,147 +0,0 @@
/*
* Directory utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected])
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <io.h>
#include <winsock2.h>
struct _GDir {
HANDLE handle;
gchar* current;
gchar* next;
};
GDir *
g_dir_open (const gchar *path, guint flags, GError **error)
{
GDir *dir;
gunichar2* path_utf16;
gunichar2* path_utf16_search;
WIN32_FIND_DATA find_data;
g_return_val_if_fail (path != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
dir = g_new0 (GDir, 1);
path_utf16 = u8to16 (path);
dir->handle = FindFirstFile (path_utf16, &find_data);
if (dir->handle == INVALID_HANDLE_VALUE) {
if (error) {
gint err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
}
g_free (dir);
g_free (path_utf16);
return NULL;
}
/* now get files */
FindClose (dir->handle);
path_utf16_search = g_malloc ((wcslen(path_utf16) + 3)*sizeof(gunichar2));
wcscpy (path_utf16_search, path_utf16);
wcscat (path_utf16_search, L"\\*");
dir->handle = FindFirstFile (path_utf16_search, &find_data);
g_free (path_utf16_search);
while ((wcscmp (find_data.cFileName, L".") == 0) || (wcscmp (find_data.cFileName, L"..") == 0)) {
if (!FindNextFile (dir->handle, &find_data)) {
if (error) {
gint err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
}
g_free (dir);
g_free (path_utf16);
return NULL;
}
}
dir->current = NULL;
dir->next = u16to8 (find_data.cFileName);
g_free (path_utf16);
return dir;
}
const gchar *
g_dir_read_name (GDir *dir)
{
WIN32_FIND_DATA find_data;
g_return_val_if_fail (dir != NULL && dir->handle != 0, NULL);
if (dir->current)
g_free (dir->current);
dir->current = NULL;
dir->current = dir->next;
if (!dir->current)
return NULL;
dir->next = NULL;
do {
if (!FindNextFile (dir->handle, &find_data)) {
dir->next = NULL;
return dir->current;
}
} while ((wcscmp (find_data.cFileName, L".") == 0) || (wcscmp (find_data.cFileName, L"..") == 0));
dir->next = u16to8 (find_data.cFileName);
return dir->current;
}
void
g_dir_rewind (GDir *dir)
{
}
void
g_dir_close (GDir *dir)
{
g_return_if_fail (dir != NULL && dir->handle != 0);
if (dir->current)
g_free (dir->current);
dir->current = NULL;
if (dir->next)
g_free (dir->next);
dir->next = NULL;
FindClose (dir->handle);
dir->handle = 0;
g_free (dir);
}
+203
View File
@@ -0,0 +1,203 @@
/*
* Directory utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected])
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifndef _MSC_VER
#include <unistd.h>
#include <dirent.h>
#else
#include <io.h>
#endif
#ifdef G_OS_WIN32
#include <winsock2.h>
#endif
struct _GDir {
#ifdef G_OS_WIN32
HANDLE handle;
gchar* current;
gchar* next;
#else
DIR *dir;
#endif
};
GDir *
g_dir_open (const gchar *path, guint flags, GError **error)
{
#ifdef G_OS_WIN32
GDir *dir;
gunichar2* path_utf16;
gunichar2* path_utf16_search;
WIN32_FIND_DATA find_data;
g_return_val_if_fail (path != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
dir = g_new0 (GDir, 1);
path_utf16 = u8to16 (path);
dir->handle = FindFirstFile (path_utf16, &find_data);
if (dir->handle == INVALID_HANDLE_VALUE) {
if (error) {
gint err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
}
g_free (dir);
g_free (path_utf16);
return NULL;
}
/* now get files */
FindClose (dir->handle);
path_utf16_search = g_malloc ((wcslen(path_utf16) + 3)*sizeof(gunichar2));
wcscpy (path_utf16_search, path_utf16);
wcscat (path_utf16_search, L"\\*");
dir->handle = FindFirstFile (path_utf16_search, &find_data);
g_free (path_utf16_search);
while ((wcscmp (find_data.cFileName, L".") == 0) || (wcscmp (find_data.cFileName, L"..") == 0)) {
if (!FindNextFile (dir->handle, &find_data)) {
if (error) {
gint err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
}
g_free (dir);
g_free (path_utf16);
return NULL;
}
}
dir->current = NULL;
dir->next = u16to8 (find_data.cFileName);
g_free (path_utf16);
return dir;
#else
GDir *dir;
g_return_val_if_fail (path != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
(void) flags; /* this is not used */
dir = g_new (GDir, 1);
dir->dir = opendir (path);
if (dir->dir == NULL) {
if (error) {
gint err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
}
g_free (dir);
return NULL;
}
return dir;
#endif
}
const gchar *
g_dir_read_name (GDir *dir)
{
#ifdef G_OS_WIN32
WIN32_FIND_DATA find_data;
g_return_val_if_fail (dir != NULL && dir->handle != 0, NULL);
if (dir->current)
g_free (dir->current);
dir->current = NULL;
dir->current = dir->next;
if (!dir->current)
return NULL;
dir->next = NULL;
do {
if (!FindNextFile (dir->handle, &find_data)) {
dir->next = NULL;
return dir->current;
}
} while ((wcscmp (find_data.cFileName, L".") == 0) || (wcscmp (find_data.cFileName, L"..") == 0));
dir->next = u16to8 (find_data.cFileName);
return dir->current;
#else
struct dirent *entry;
g_return_val_if_fail (dir != NULL && dir->dir != NULL, NULL);
do {
entry = readdir (dir->dir);
if (entry == NULL)
return NULL;
} while ((strcmp (entry->d_name, ".") == 0) || (strcmp (entry->d_name, "..") == 0));
return entry->d_name;
#endif
}
void
g_dir_rewind (GDir *dir)
{
#ifdef G_OS_WIN32
#else
g_return_if_fail (dir != NULL && dir->dir != NULL);
rewinddir (dir->dir);
#endif
}
void
g_dir_close (GDir *dir)
{
#ifdef G_OS_WIN32
g_return_if_fail (dir != NULL && dir->handle != 0);
if (dir->current)
g_free (dir->current);
dir->current = NULL;
if (dir->next)
g_free (dir->next);
dir->next = NULL;
FindClose (dir->handle);
dir->handle = 0;
g_free (dir);
#else
g_return_if_fail (dir != NULL && dir->dir != 0);
closedir (dir->dir);
dir->dir = NULL;
g_free (dir);
#endif
}
-167
View File
@@ -1,167 +0,0 @@
/*
* File utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected])
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <config.h>
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#ifdef _MSC_VER
#include <direct.h>
int mkstemp (char *tmp_template);
#endif
#ifndef O_LARGEFILE
#define OPEN_FLAGS (O_RDONLY)
#else
#define OPEN_FLAGS (O_RDONLY | O_LARGEFILE)
#endif
gboolean
g_file_get_contents (const gchar *filename, gchar **contents, gsize *length, GError **error)
{
gchar *str;
int fd;
struct stat st;
long offset;
int nread;
g_return_val_if_fail (filename != NULL, FALSE);
g_return_val_if_fail (contents != NULL, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
*contents = NULL;
if (length)
*length = 0;
fd = open (filename, OPEN_FLAGS);
if (fd == -1) {
if (error != NULL) {
int err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error opening file");
}
return FALSE;
}
if (fstat (fd, &st) != 0) {
if (error != NULL) {
int err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error in fstat()");
}
close (fd);
return FALSE;
}
str = g_malloc (st.st_size + 1);
offset = 0;
do {
nread = read (fd, str + offset, st.st_size - offset);
if (nread > 0) {
offset += nread;
}
} while ((nread > 0 && offset < st.st_size) || (nread == -1 && errno == EINTR));
close (fd);
str [st.st_size] = '\0';
if (length) {
*length = st.st_size;
}
*contents = str;
return TRUE;
}
gint
g_file_open_tmp (const gchar *tmpl, gchar **name_used, GError **error)
{
const static gchar *default_tmpl = ".XXXXXX";
gchar *t;
gint fd;
size_t len;
g_return_val_if_fail (error == NULL || *error == NULL, -1);
if (tmpl == NULL)
tmpl = default_tmpl;
if (strchr (tmpl, G_DIR_SEPARATOR) != NULL) {
if (error) {
*error = g_error_new (G_LOG_DOMAIN, 24, "Template should not have any " G_DIR_SEPARATOR_S);
}
return -1;
}
len = strlen (tmpl);
if (len < 6 || strcmp (tmpl + len - 6, "XXXXXX")) {
if (error) {
*error = g_error_new (G_LOG_DOMAIN, 24, "Template should end with XXXXXX");
}
return -1;
}
t = g_build_filename (g_get_tmp_dir (), tmpl, NULL);
fd = mkstemp (t);
if (fd == -1) {
if (error) {
int err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error in mkstemp()");
}
g_free (t);
return -1;
}
if (name_used) {
*name_used = t;
} else {
g_free (t);
}
return fd;
}
gchar *
g_get_current_dir (void)
{
int s = 32;
char *buffer = NULL, *r;
gboolean fail;
do {
buffer = g_realloc (buffer, s);
r = getcwd (buffer, s);
fail = (r == NULL && errno == ERANGE);
if (fail) {
s <<= 1;
}
} while (fail);
return r;
}
-84
View File
@@ -1,84 +0,0 @@
/*
* File utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected])
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <config.h>
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
gboolean
g_file_test (const gchar *filename, GFileTest test)
{
struct stat st;
gboolean have_stat;
if (filename == NULL || test == 0)
return FALSE;
have_stat = FALSE;
if ((test & G_FILE_TEST_EXISTS) != 0) {
if (access (filename, F_OK) == 0)
return TRUE;
}
if ((test & G_FILE_TEST_IS_EXECUTABLE) != 0) {
if (access (filename, X_OK) == 0)
return TRUE;
}
if ((test & G_FILE_TEST_IS_SYMLINK) != 0) {
have_stat = (lstat (filename, &st) == 0);
if (have_stat && S_ISLNK (st.st_mode))
return TRUE;
}
if ((test & G_FILE_TEST_IS_REGULAR) != 0) {
if (!have_stat)
have_stat = (stat (filename, &st) == 0);
if (have_stat && S_ISREG (st.st_mode))
return TRUE;
}
if ((test & G_FILE_TEST_IS_DIR) != 0) {
if (!have_stat)
have_stat = (stat (filename, &st) == 0);
if (have_stat && S_ISDIR (st.st_mode))
return TRUE;
}
return FALSE;
}
-113
View File
@@ -1,113 +0,0 @@
/*
* File utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected])
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <config.h>
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef G_OS_WIN32
#include <io.h>
#define open _open
#define S_ISREG(x) ((x & _S_IFMT) == _S_IFREG)
#define S_ISDIR(x) ((x & _S_IFMT) == _S_IFDIR)
#endif
int mkstemp (char *tmp_template)
{
int fd;
gunichar2* utf16_template;
utf16_template = u8to16 (tmp_template);
fd = -1;
utf16_template = _wmktemp( utf16_template);
if (utf16_template && *utf16_template) {
/* FIXME: _O_TEMPORARY causes file to disappear on close causing a test to fail */
fd = _wopen( utf16_template, _O_BINARY | _O_CREAT /*| _O_TEMPORARY*/ | _O_EXCL, _S_IREAD | _S_IWRITE);
}
sprintf (tmp_template + strlen (tmp_template) - 6, "%S", utf16_template + wcslen (utf16_template) - 6);
g_free (utf16_template);
return fd;
}
#ifdef _MSC_VER
#pragma warning(disable:4701)
#endif
gboolean
g_file_test (const gchar *filename, GFileTest test)
{
struct _stat64 stat;
int ret = 0;
gunichar2* utf16_filename = NULL;
if (filename == NULL || test == 0)
return FALSE;
utf16_filename = u8to16 (filename);
ret = _wstati64 (utf16_filename, &stat);
g_free (utf16_filename);
if ((test & G_FILE_TEST_EXISTS) != 0) {
if (ret == 0)
return TRUE;
}
if (ret != 0)
return FALSE;
if ((test & G_FILE_TEST_IS_EXECUTABLE) != 0) {
if (stat.st_mode & _S_IEXEC)
return TRUE;
}
if ((test & G_FILE_TEST_IS_REGULAR) != 0) {
if (stat.st_mode & _S_IFREG)
return TRUE;
}
if ((test & G_FILE_TEST_IS_DIR) != 0) {
if (stat.st_mode & _S_IFDIR)
return TRUE;
}
/* make this last in case it is OR'd with something else */
if ((test & G_FILE_TEST_IS_SYMLINK) != 0) {
return FALSE;
}
return FALSE;
}
+232
View File
@@ -28,7 +28,22 @@
#include <config.h>
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifdef G_OS_WIN32
#include <io.h>
#define open _open
#define S_ISREG(x) ((x & _S_IFMT) == _S_IFREG)
#define S_ISDIR(x) ((x & _S_IFMT) == _S_IFDIR)
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
GFileError
g_file_error_from_errno (gint err_no)
@@ -91,4 +106,221 @@ g_file_error_from_errno (gint err_no)
}
}
#ifndef O_LARGEFILE
#define OPEN_FLAGS (O_RDONLY)
#else
#define OPEN_FLAGS (O_RDONLY | O_LARGEFILE)
#endif
gboolean
g_file_get_contents (const gchar *filename, gchar **contents, gsize *length, GError **error)
{
gchar *str;
int fd;
struct stat st;
long offset;
int nread;
g_return_val_if_fail (filename != NULL, FALSE);
g_return_val_if_fail (contents != NULL, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
*contents = NULL;
if (length)
*length = 0;
fd = open (filename, OPEN_FLAGS);
if (fd == -1) {
if (error != NULL) {
int err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error opening file");
}
return FALSE;
}
if (fstat (fd, &st) != 0) {
if (error != NULL) {
int err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error in fstat()");
}
close (fd);
return FALSE;
}
str = g_malloc (st.st_size + 1);
offset = 0;
do {
nread = read (fd, str + offset, st.st_size - offset);
if (nread > 0) {
offset += nread;
}
} while ((nread > 0 && offset < st.st_size) || (nread == -1 && errno == EINTR));
close (fd);
str [st.st_size] = '\0';
if (length) {
*length = st.st_size;
}
*contents = str;
return TRUE;
}
#ifdef _MSC_VER
int mkstemp (char *tmp_template)
{
int fd;
gunichar2* utf16_template;
utf16_template = u8to16 (tmp_template);
fd = -1;
utf16_template = _wmktemp( utf16_template);
if (utf16_template && *utf16_template) {
/* FIXME: _O_TEMPORARY causes file to disappear on close causing a test to fail */
fd = _wopen( utf16_template, _O_BINARY | _O_CREAT /*| _O_TEMPORARY*/ | _O_EXCL, _S_IREAD | _S_IWRITE);
}
sprintf (tmp_template + strlen (tmp_template) - 6, "%S", utf16_template + wcslen (utf16_template) - 6);
g_free (utf16_template);
return fd;
}
#endif
gint
g_file_open_tmp (const gchar *tmpl, gchar **name_used, GError **error)
{
const static gchar *default_tmpl = ".XXXXXX";
gchar *t;
gint fd;
size_t len;
g_return_val_if_fail (error == NULL || *error == NULL, -1);
if (tmpl == NULL)
tmpl = default_tmpl;
if (strchr (tmpl, G_DIR_SEPARATOR) != NULL) {
if (error) {
*error = g_error_new (G_LOG_DOMAIN, 24, "Template should not have any " G_DIR_SEPARATOR_S);
}
return -1;
}
len = strlen (tmpl);
if (len < 6 || strcmp (tmpl + len - 6, "XXXXXX")) {
if (error) {
*error = g_error_new (G_LOG_DOMAIN, 24, "Template should end with XXXXXX");
}
return -1;
}
t = g_build_filename (g_get_tmp_dir (), tmpl, NULL);
fd = mkstemp (t);
if (fd == -1) {
if (error) {
int err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error in mkstemp()");
}
g_free (t);
return -1;
}
if (name_used) {
*name_used = t;
} else {
g_free (t);
}
return fd;
}
#ifdef _MSC_VER
#pragma warning(disable:4701)
#endif
gboolean
g_file_test (const gchar *filename, GFileTest test)
{
#ifdef G_OS_WIN32
struct _stat64 stat;
int ret = 0;
gunichar2* utf16_filename = NULL;
if (filename == NULL || test == 0)
return FALSE;
utf16_filename = u8to16 (filename);
ret = _wstati64 (utf16_filename, &stat);
g_free (utf16_filename);
if ((test & G_FILE_TEST_EXISTS) != 0) {
if (ret == 0)
return TRUE;
}
if (ret != 0)
return FALSE;
if ((test & G_FILE_TEST_IS_EXECUTABLE) != 0) {
if (stat.st_mode & _S_IEXEC)
return TRUE;
}
if ((test & G_FILE_TEST_IS_REGULAR) != 0) {
if (stat.st_mode & _S_IFREG)
return TRUE;
}
if ((test & G_FILE_TEST_IS_DIR) != 0) {
if (stat.st_mode & _S_IFDIR)
return TRUE;
}
/* make this last in case it is OR'd with something else */
if ((test & G_FILE_TEST_IS_SYMLINK) != 0) {
return FALSE;
}
return FALSE;
#else
struct stat st;
gboolean have_stat;
if (filename == NULL || test == 0)
return FALSE;
have_stat = FALSE;
if ((test & G_FILE_TEST_EXISTS) != 0) {
if (access (filename, F_OK) == 0)
return TRUE;
}
if ((test & G_FILE_TEST_IS_EXECUTABLE) != 0) {
if (access (filename, X_OK) == 0)
return TRUE;
}
if ((test & G_FILE_TEST_IS_SYMLINK) != 0) {
have_stat = (lstat (filename, &st) == 0);
if (have_stat && S_ISLNK (st.st_mode))
return TRUE;
}
if ((test & G_FILE_TEST_IS_REGULAR) != 0) {
if (!have_stat)
have_stat = (stat (filename, &st) == 0);
if (have_stat && S_ISREG (st.st_mode))
return TRUE;
}
if ((test & G_FILE_TEST_IS_DIR) != 0) {
if (!have_stat)
have_stat = (stat (filename, &st) == 0);
if (have_stat && S_ISDIR (st.st_mode))
return TRUE;
}
return FALSE;
#endif
}
+3 -56
View File
@@ -38,7 +38,6 @@ typedef const void * gconstpointer;
typedef char gchar;
typedef unsigned char guchar;
#if !G_TYPES_DEFINED
#ifdef _MSC_VER
typedef __int8 gint8;
typedef unsigned __int8 guint8;
@@ -65,8 +64,6 @@ typedef float gfloat;
typedef double gdouble;
typedef uint16_t gunichar2;
#endif
#endif
/*
* Macros
@@ -125,7 +122,7 @@ static inline gpointer g_malloc0 (gsize x) {if (x) return calloc(1,x); else retu
#define g_alloca(size) alloca (size)
gpointer g_memdup (gconstpointer mem, guint byte_size);
static inline gchar *g_strdup (const gchar *str) { if (str) {return strdup (str);} return NULL; }
gchar *g_strdup (const gchar *str);
typedef struct {
gpointer (*malloc) (gsize n_bytes);
@@ -234,7 +231,6 @@ gchar *g_strjoinv (const gchar *separator, gchar **str_array);
gchar *g_strchug (gchar *str);
gchar *g_strchomp (gchar *str);
void g_strdown (gchar *string);
gchar *g_strnfill (gsize length, gchar fill_char);
gchar *g_strdelimit (gchar *string, const gchar *delimiters, gchar new_delimiter);
gchar *g_strescape (const gchar *source, const gchar *exceptions);
@@ -367,7 +363,6 @@ struct _GList {
};
#define g_list_next(list) ((list) ? (((GList *) (list))->next) : NULL)
#define g_list_previous(list) ((list) ? (((GList *) (list))->prev) : NULL)
GList *g_list_alloc (void);
GList *g_list_append (GList *list,
@@ -533,41 +528,10 @@ gpointer g_convert_error_quark(void);
typedef guint32 gunichar;
typedef enum {
G_UNICODE_CONTROL,
G_UNICODE_FORMAT,
G_UNICODE_UNASSIGNED,
G_UNICODE_PRIVATE_USE,
G_UNICODE_SURROGATE,
G_UNICODE_LOWERCASE_LETTER,
G_UNICODE_MODIFIER_LETTER,
G_UNICODE_OTHER_LETTER,
G_UNICODE_TITLECASE_LETTER,
G_UNICODE_UPPERCASE_LETTER,
G_UNICODE_COMBINING_MARK,
G_UNICODE_ENCLOSING_MARK,
G_UNICODE_NON_SPACING_MARK,
G_UNICODE_DECIMAL_NUMBER,
G_UNICODE_LETTER_NUMBER,
G_UNICODE_OTHER_NUMBER,
G_UNICODE_CONNECT_PUNCTUATION,
G_UNICODE_DASH_PUNCTUATION,
G_UNICODE_CLOSE_PUNCTUATION,
G_UNICODE_FINAL_PUNCTUATION,
G_UNICODE_INITIAL_PUNCTUATION,
G_UNICODE_OTHER_PUNCTUATION,
G_UNICODE_OPEN_PUNCTUATION,
G_UNICODE_CURRENCY_SYMBOL,
G_UNICODE_MODIFIER_SYMBOL,
G_UNICODE_MATH_SYMBOL,
G_UNICODE_OTHER_SYMBOL,
G_UNICODE_LINE_SEPARATOR,
G_UNICODE_PARAGRAPH_SEPARATOR,
G_UNICODE_SPACE_SEPARATOR
} GUnicodeType;
gunichar g_unichar_toupper (gunichar c);
gunichar g_unichar_tolower (gunichar c);
gunichar g_unichar_totitle (gunichar c);
GUnicodeType g_unichar_type (gunichar c);
gboolean g_unichar_isxdigit (gunichar c);
gint g_unichar_xdigit_value (gunichar c);
@@ -603,8 +567,6 @@ typedef enum {
G_CONVERT_ERROR_NOT_ABSOLUTE_PATH
} GConvertError;
gchar* g_utf8_strup (const gchar *str, gssize len);
gchar* g_utf8_strdown (const gchar *str, gssize len);
gunichar2 *g_utf8_to_utf16 (const gchar *str, glong len, glong *items_read, glong *items_written, GError **error);
gchar *g_utf16_to_utf8 (const gunichar2 *str, glong len, glong *items_read, glong *items_written, GError **error);
gunichar2 *g_ucs4_to_utf16 (const gunichar *str, glong len, glong *items_read, glong *items_written, GError **error);
@@ -803,15 +765,6 @@ gboolean g_markup_parse_context_end_parse (GMarkupParseContext *context,
/*
* Character set conversion
*/
/*
* Index into the table below with the first byte of a UTF-8 sequence to
* get the number of trailing bytes that are supposed to follow it.
* Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is
* left as-is for anyone who may want to do such conversion, which was
* allowed in earlier algorithms.
*/
extern const gchar g_trailingBytesForUTF8[256];
gboolean g_get_charset (G_CONST_RETURN char **charset);
gchar *g_locale_to_utf8 (const gchar *opsysstring, gssize len,
gsize *bytes_read, gsize *bytes_written,
@@ -824,9 +777,6 @@ gchar *g_convert (const gchar *str, gssize len,
const gchar *to_codeset, const gchar *from_codeset,
gsize *bytes_read, gsize *bytes_written, GError **error);
gboolean g_utf8_validate (const gchar *str, gssize max_len, const gchar **end);
gunichar g_utf8_get_char (const gchar *src);
glong g_utf8_strlen (const gchar *str, gssize max);
#define g_utf8_next_char(p) p + (g_trailingBytesForUTF8[(guchar)(*p)] + 1)
/*
* Empty thread functions, not used by eglib
@@ -834,15 +784,13 @@ glong g_utf8_strlen (const gchar *str, gssize max);
#define g_thread_supported() TRUE
#define g_thread_init(x) G_STMT_START { if (x != NULL) { g_error ("No vtable supported in g_thread_init"); } } G_STMT_END
#define G_LOCK_DEFINE(name) int name;
#define G_LOCK_DEFINE_STATIC(name) static int name;
#define G_LOCK_DEFINE(name)
#define G_LOCK_DEFINE_STATIC(name)
#define G_LOCK_EXTERN(name)
#define G_LOCK(name)
#define G_TRYLOCK(name)
#define G_UNLOCK(name)
#define GUINT16_SWAP_LE_BE_CONSTANT(x) ((((guint16) x) >> 8) | ((((guint16) x) << 8)))
#define GUINT16_SWAP_LE_BE(x) ((guint16) (((guint16) x) >> 8) | ((((guint16)(x)) & 0xff) << 8))
#define GUINT32_SWAP_LE_BE(x) ((guint32) \
( (((guint32) (x)) << 24)| \
@@ -881,4 +829,3 @@ glong g_utf8_strlen (const gchar *str, gssize max);
#endif
+17 -45
View File
@@ -40,7 +40,6 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdio.h>
#include <ctype.h>
#include <glib.h>
#define set_error(msg, ...) do { if (error != NULL) *error = g_error_new (GINT_TO_POINTER (1), 1, msg, __VA_ARGS__); } while (0);
@@ -100,37 +99,10 @@ g_markup_parse_context_free (GMarkupParseContext *context)
g_free (context);
}
static gboolean
my_isspace (char c)
{
if (c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\v')
return TRUE;
return FALSE;
}
static gboolean
my_isalnum (char c)
{
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
return TRUE;
if (c >= '0' && c <= '9')
return TRUE;
return FALSE;
}
static gboolean
my_isalpha (char c)
{
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
return TRUE;
return FALSE;
}
static const char *
skip_space (const char *p, const char *end)
{
for (; p < end && my_isspace (*p); p++)
for (; p < end && isspace (*p); p++)
;
return p;
}
@@ -152,7 +124,7 @@ parse_value (const char *p, const char *end, char **value, GError **error)
return end;
l = (int)(p - start);
p++;
*value = g_malloc (l + 1);
*value = malloc (l + 1);
if (*value == NULL)
return end;
strncpy (*value, start, l);
@@ -166,13 +138,13 @@ parse_name (const char *p, const char *end, char **value)
const char *start = p;
int l;
for (; p < end && my_isalnum (*p); p++)
for (; p < end && isalnum (*p); p++)
;
if (p == end)
return end;
l = (int)(p - start);
*value = g_malloc (l + 1);
*value = malloc (l + 1);
if (*value == NULL)
return end;
strncpy (*value, start, l);
@@ -211,24 +183,24 @@ parse_attributes (const char *p, const char *end, char ***names, char ***values,
p = skip_space (p, end);
if (p == end){
g_free (name);
free (name);
return p;
}
if (*p != '='){
set_error ("Expected an = after the attribute name `%s'", name);
g_free (name);
free (name);
return end;
}
p++;
p = skip_space (p, end);
if (p == end){
g_free (name);
free (name);
return end;
}
p = parse_value (p, end, &value, error);
if (p == end){
g_free (name);
free (name);
return p;
}
@@ -296,7 +268,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
int full_stop = 0, l;
gchar **names = NULL, **values = NULL;
for (; p < end && my_isspace (*p); p++)
for (; p < end && isspace (*p); p++)
;
if (p == end){
set_error ("%s", "Unfinished element");
@@ -309,12 +281,12 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
break;
}
if (!my_isalpha (*p)){
if (!(isascii (*p) && isalpha (*p))){
set_error ("%s", "Expected an element name");
goto fail;
}
for (++p; p < end && (my_isalnum (*p) || (*p == '.')); p++)
for (++p; p < end && (isalnum (*p) || (*p == '.')); p++)
;
if (p == end){
set_error ("%s", "Expected an element");
@@ -322,7 +294,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
}
element_end = p;
for (; p < end && my_isspace (*p); p++)
for (; p < end && isspace (*p); p++)
;
if (p == end){
set_error ("%s", "Unfinished element");
@@ -340,7 +312,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
goto fail;
}
l = (int)(element_end - element_start);
ename = g_malloc (l + 1);
ename = malloc (l + 1);
if (ename == NULL)
goto fail;
strncpy (ename, element_start, l);
@@ -359,7 +331,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
}
if (error != NULL && *error != NULL){
g_free (ename);
free (ename);
goto fail;
}
@@ -371,7 +343,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
goto fail;
}
}
g_free (ename);
free (ename);
} else {
context->level = g_slist_prepend (context->level, ename);
}
@@ -432,11 +404,11 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
if (context->parser.end_element != NULL){
context->parser.end_element (context, text, context->user_data, error);
if (error != NULL && *error != NULL){
g_free (text);
free (text);
goto fail;
}
}
g_free (text);
free (text);
while (p < end && *p != '>')
p++;
-140
View File
@@ -1,140 +0,0 @@
/*
* gmisc.c: Misc functions with no place to go (right now)
*
* Author:
* Aaron Bockover ([email protected])
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdlib.h>
#include <glib.h>
#include <pthread.h>
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
const gchar *
g_getenv(const gchar *variable)
{
return getenv(variable);
}
gboolean
g_setenv(const gchar *variable, const gchar *value, gboolean overwrite)
{
return setenv(variable, value, overwrite) == 0;
}
void
g_unsetenv(const gchar *variable)
{
unsetenv(variable);
}
gchar*
g_win32_getlocale(void)
{
return NULL;
}
gboolean
g_path_is_absolute (const char *filename)
{
g_return_val_if_fail (filename != NULL, FALSE);
return (*filename == '/');
}
static pthread_mutex_t home_lock = PTHREAD_MUTEX_INITIALIZER;
static const gchar *home_dir;
/* Give preference to /etc/passwd than HOME */
const gchar *
g_get_home_dir (void)
{
if (home_dir == NULL){
pthread_mutex_lock (&home_lock);
if (home_dir == NULL){
#ifdef HAVE_GETPWENT_R
struct passwd pwbuf, *track;
char buf [4096];
uid_t uid;
uid = getuid ();
setpwent ();
while (getpwent_r (&pwbuf, buf, sizeof (buf), &track) == 0){
if (pwbuf.pw_uid == uid){
home_dir = g_strdup (pwbuf.pw_dir);
break;
}
}
endpwent ();
#endif
if (home_dir == NULL)
home_dir = g_getenv ("HOME");
pthread_mutex_unlock (&home_lock);
}
}
return home_dir;
}
const char *
g_get_user_name (void)
{
const char *retName = g_getenv ("USER");
return retName;
}
static const char *tmp_dir;
static pthread_mutex_t tmp_lock = PTHREAD_MUTEX_INITIALIZER;
const gchar *
g_get_tmp_dir (void)
{
if (tmp_dir == NULL){
pthread_mutex_lock (&tmp_lock);
if (tmp_dir == NULL){
tmp_dir = g_getenv ("TMPDIR");
if (tmp_dir == NULL){
tmp_dir = g_getenv ("TMP");
if (tmp_dir == NULL){
tmp_dir = g_getenv ("TEMP");
if (tmp_dir == NULL)
tmp_dir = "/tmp";
}
}
}
pthread_mutex_unlock (&tmp_lock);
}
return tmp_dir;
}
-155
View File
@@ -1,155 +0,0 @@
/*
* gmisc.c: Misc functions with no place to go (right now)
*
* Author:
* Aaron Bockover ([email protected])
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdlib.h>
#include <glib.h>
#include <windows.h>
#include <direct.h>
#include <io.h>
const gchar *
g_getenv(const gchar *variable)
{
gunichar2 *var, *buffer;
gchar* val = NULL;
gint32 buffer_size = 1024;
gint32 retval;
var = u8to16(variable);
buffer = g_malloc(buffer_size*sizeof(gunichar2));
retval = GetEnvironmentVariable (var, buffer, buffer_size);
if (retval != 0) {
if (retval > buffer_size) {
g_free (buffer);
buffer_size = retval;
buffer = g_malloc(buffer_size*sizeof(gunichar2));
retval = GetEnvironmentVariable (var, buffer, buffer_size);
}
val = u16to8 (buffer);
}
g_free(var);
g_free(buffer);
return val;
}
gboolean
g_setenv(const gchar *variable, const gchar *value, gboolean overwrite)
{
gunichar2 *var, *val;
gboolean result;
var = u8to16(variable);
val = u8to16(value);
result = (SetEnvironmentVariable(var, val) != 0) ? TRUE : FALSE;
g_free(var);
g_free(val);
return result;
}
void
g_unsetenv(const gchar *variable)
{
gunichar2 *var;
var = u8to16(variable);
SetEnvironmentVariable(var, TEXT(""));
g_free(var);
}
gchar*
g_win32_getlocale(void)
{
/* FIXME: Use GetThreadLocale
* and convert LCID to standard
* string form, "en_US" */
return strdup ("en_US");
}
gboolean
g_path_is_absolute (const char *filename)
{
g_return_val_if_fail (filename != NULL, FALSE);
if (filename[0] != '\0' && filename[1] != '\0')
if (filename[1] == ':' && filename[2] != '\0' &&
(filename[2] == '\\' || filename[2] == '/'))
return TRUE;
/* UNC paths */
else if (filename[0] == '\\' && filename[1] == '\\' &&
filename[2] != '\0')
return TRUE;
return FALSE;
}
const gchar *
g_get_home_dir (void)
{
/* FIXME */
const gchar *drive = g_getenv ("HOMEDRIVE");
const gchar *path = g_getenv ("HOMEPATH");
gchar *home_dir = NULL;
if (drive && path) {
home_dir = g_malloc(strlen(drive) + strlen(path) +1);
if (home_dir) {
sprintf(home_dir, "%s%s", drive, path);
}
}
return home_dir;
}
const char *
g_get_user_name (void)
{
const char * retName = g_getenv ("USER");
if (!retName)
retName = g_getenv ("USERNAME");
return retName;
}
static const char *tmp_dir;
const gchar *
g_get_tmp_dir (void)
{
if (tmp_dir == NULL){
if (tmp_dir == NULL){
tmp_dir = g_getenv ("TMPDIR");
if (tmp_dir == NULL){
tmp_dir = g_getenv ("TMP");
if (tmp_dir == NULL){
tmp_dir = g_getenv ("TEMP");
if (tmp_dir == NULL)
tmp_dir = "C:\\temp";
}
}
}
}
return tmp_dir;
}
+107
View File
@@ -0,0 +1,107 @@
/*
* gmisc.c: Misc functions with no place to go (right now)
*
* Author:
* Aaron Bockover ([email protected])
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdlib.h>
#include <glib.h>
#ifdef G_OS_WIN32
#include <windows.h>
#endif
const gchar *
g_getenv(const gchar *variable)
{
#ifdef G_OS_WIN32
gunichar2 *var, *buffer;
gchar* val = NULL;
gint32 buffer_size = 1024;
gint32 retval;
var = u8to16(variable);
buffer = g_malloc(buffer_size*sizeof(gunichar2));
retval = GetEnvironmentVariable (var, buffer, buffer_size);
if (retval != 0) {
if (retval > buffer_size) {
g_free (buffer);
buffer_size = retval;
buffer = g_malloc(buffer_size*sizeof(gunichar2));
retval = GetEnvironmentVariable (var, buffer, buffer_size);
}
val = u16to8 (buffer);
}
g_free(var);
g_free(buffer);
return val;
#else
return getenv(variable);
#endif
}
gboolean
g_setenv(const gchar *variable, const gchar *value, gboolean overwrite)
{
#ifdef G_OS_WIN32
gunichar2 *var, *val;
gboolean result;
var = u8to16(variable);
val = u8to16(value);
result = (SetEnvironmentVariable(var, val) != 0) ? TRUE : FALSE;
g_free(var);
g_free(val);
return result;
#else
return setenv(variable, value, overwrite) == 0;
#endif
}
void
g_unsetenv(const gchar *variable)
{
#ifdef G_OS_WIN32
gunichar2 *var;
var = u8to16(variable);
SetEnvironmentVariable(var, TEXT(""));
g_free(var);
#else
unsetenv(variable);
#endif
}
gchar*
g_win32_getlocale(void)
{
#ifdef G_OS_WIN32
/* FIXME: Use GetThreadLocale
* and convert LCID to standard
* string form, "en_US" */
return strdup ("en_US");
#else
return NULL;
#endif
}
-288
View File
@@ -1,288 +0,0 @@
/*
* gmodule.c: dl* functions, glib style
*
* Author:
* Gonzalo Paniagua Javier ([email protected])
* Jonathan Chambers ([email protected])
* Robert Jordan ([email protected])
*
* (C) 2006 Novell, Inc.
* (C) 2006 Jonathan Chambers
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <glib.h>
#include <gmodule.h>
#ifdef G_OS_UNIX
#include <dlfcn.h>
/* For Linux and Solaris, need to add others as we port this */
#define LIBPREFIX "lib"
#define LIBSUFFIX ".so"
struct _GModule {
void *handle;
};
GModule *
g_module_open (const gchar *file, GModuleFlags flags)
{
int f = 0;
GModule *module;
void *handle;
flags &= G_MODULE_BIND_MASK;
if ((flags & G_MODULE_BIND_LAZY) != 0)
f |= RTLD_LAZY;
if ((flags & G_MODULE_BIND_LOCAL) != 0)
f |= RTLD_LOCAL;
handle = dlopen (file, f);
if (handle == NULL)
return NULL;
module = g_new (GModule,1);
module->handle = handle;
return module;
}
gboolean
g_module_symbol (GModule *module, const gchar *symbol_name, gpointer *symbol)
{
if (symbol_name == NULL || symbol == NULL)
return FALSE;
if (module == NULL || module->handle == NULL)
return FALSE;
*symbol = dlsym (module->handle, symbol_name);
return (*symbol != NULL);
}
const gchar *
g_module_error (void)
{
return dlerror ();
}
gboolean
g_module_close (GModule *module)
{
void *handle;
if (module == NULL || module->handle == NULL)
return FALSE;
handle = module->handle;
module->handle = NULL;
g_free (module);
return (0 == dlclose (handle));
}
#elif defined (G_OS_WIN32)
#include <windows.h>
#include <psapi.h>
#define LIBSUFFIX ".dll"
#define LIBPREFIX ""
struct _GModule {
HMODULE handle;
int main_module;
};
GModule *
g_module_open (const gchar *file, GModuleFlags flags)
{
GModule *module;
module = g_malloc (sizeof (GModule));
if (module == NULL)
return NULL;
if (file != NULL) {
gunichar2 *file16;
file16 = u8to16(file);
module->main_module = FALSE;
module->handle = LoadLibrary (file16);
g_free(file16);
if (!module->handle) {
g_free (module);
return NULL;
}
} else {
module->main_module = TRUE;
module->handle = GetModuleHandle (NULL);
}
return module;
}
static gpointer
w32_find_symbol (const gchar *symbol_name)
{
HMODULE *modules;
DWORD buffer_size = sizeof (HMODULE) * 1024;
DWORD needed, i;
modules = (HMODULE *) g_malloc (buffer_size);
if (modules == NULL)
return NULL;
if (!EnumProcessModules (GetCurrentProcess (), modules,
buffer_size, &needed)) {
g_free (modules);
return NULL;
}
/* check whether the supplied buffer was too small, realloc, retry */
if (needed > buffer_size) {
g_free (modules);
buffer_size = needed;
modules = (HMODULE *) g_malloc (buffer_size);
if (modules == NULL)
return NULL;
if (!EnumProcessModules (GetCurrentProcess (), modules,
buffer_size, &needed)) {
g_free (modules);
return NULL;
}
}
for (i = 0; i < needed / sizeof (HANDLE); i++) {
gpointer proc = (gpointer)(intptr_t)GetProcAddress (modules [i], symbol_name);
if (proc != NULL) {
g_free (modules);
return proc;
}
}
g_free (modules);
return NULL;
}
gboolean
g_module_symbol (GModule *module, const gchar *symbol_name, gpointer *symbol)
{
if (module == NULL || symbol_name == NULL || symbol == NULL)
return FALSE;
if (module->main_module) {
*symbol = (gpointer)(intptr_t)GetProcAddress (module->handle, symbol_name);
if (*symbol != NULL)
return TRUE;
*symbol = w32_find_symbol (symbol_name);
return *symbol != NULL;
} else {
*symbol = (gpointer)(intptr_t)GetProcAddress (module->handle, symbol_name);
return *symbol != NULL;
}
}
const gchar *
g_module_error (void)
{
gchar* ret = NULL;
TCHAR* buf = NULL;
DWORD code = GetLastError ();
FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL,
code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, 0, NULL);
ret = u16to8 (buf);
LocalFree(buf);
return ret;
}
gboolean
g_module_close (GModule *module)
{
HMODULE handle;
int main_module;
if (module == NULL || module->handle == NULL)
return FALSE;
handle = module->handle;
main_module = module->main_module;
module->handle = NULL;
g_free (module);
return (main_module ? 1 : (0 == FreeLibrary (handle)));
}
#else
#define LIBSUFFIX ""
#define LIBPREFIX ""
GModule *
g_module_open (const gchar *file, GModuleFlags flags)
{
g_error ("%s", "g_module_open not implemented on this platform");
return NULL;
}
gboolean
g_module_symbol (GModule *module, const gchar *symbol_name, gpointer *symbol)
{
g_error ("%s", "g_module_open not implemented on this platform");
return FALSE;
}
const gchar *
g_module_error (void)
{
g_error ("%s", "g_module_open not implemented on this platform");
return NULL;
}
gboolean
g_module_close (GModule *module)
{
g_error ("%s", "g_module_open not implemented on this platform");
return FALSE;
}
#endif
gchar *
g_module_build_path (const gchar *directory, const gchar *module_name)
{
char *lib_prefix = "";
if (module_name == NULL)
return NULL;
if (strncmp (module_name, "lib", 3) != 0)
lib_prefix = LIBPREFIX;
if (directory && *directory){
return g_strdup_printf ("%s/%s%s" LIBSUFFIX, directory, lib_prefix, module_name);
}
return g_strdup_printf ("%s%s" LIBSUFFIX, lib_prefix, module_name);
}
-185
View File
@@ -1,185 +0,0 @@
/*
* gmodule.c: dl* functions, glib style
*
* Author:
* Gonzalo Paniagua Javier ([email protected])
* Jonathan Chambers ([email protected])
* Robert Jordan ([email protected])
*
* (C) 2006 Novell, Inc.
* (C) 2006 Jonathan Chambers
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <glib.h>
#include <gmodule.h>
#include <windows.h>
#include <psapi.h>
#define LIBSUFFIX ".dll"
#define LIBPREFIX ""
struct _GModule {
HMODULE handle;
int main_module;
};
GModule *
g_module_open (const gchar *file, GModuleFlags flags)
{
GModule *module;
module = g_malloc (sizeof (GModule));
if (module == NULL)
return NULL;
if (file != NULL) {
gunichar2 *file16;
file16 = u8to16(file);
module->main_module = FALSE;
module->handle = LoadLibrary (file16);
g_free(file16);
if (!module->handle) {
g_free (module);
return NULL;
}
} else {
module->main_module = TRUE;
module->handle = GetModuleHandle (NULL);
}
return module;
}
static gpointer
w32_find_symbol (const gchar *symbol_name)
{
HMODULE *modules;
DWORD buffer_size = sizeof (HMODULE) * 1024;
DWORD needed, i;
modules = (HMODULE *) g_malloc (buffer_size);
if (modules == NULL)
return NULL;
if (!EnumProcessModules (GetCurrentProcess (), modules,
buffer_size, &needed)) {
g_free (modules);
return NULL;
}
/* check whether the supplied buffer was too small, realloc, retry */
if (needed > buffer_size) {
g_free (modules);
buffer_size = needed;
modules = (HMODULE *) g_malloc (buffer_size);
if (modules == NULL)
return NULL;
if (!EnumProcessModules (GetCurrentProcess (), modules,
buffer_size, &needed)) {
g_free (modules);
return NULL;
}
}
for (i = 0; i < needed / sizeof (HANDLE); i++) {
gpointer proc = (gpointer)(intptr_t)GetProcAddress (modules [i], symbol_name);
if (proc != NULL) {
g_free (modules);
return proc;
}
}
g_free (modules);
return NULL;
}
gboolean
g_module_symbol (GModule *module, const gchar *symbol_name, gpointer *symbol)
{
if (module == NULL || symbol_name == NULL || symbol == NULL)
return FALSE;
if (module->main_module) {
*symbol = (gpointer)(intptr_t)GetProcAddress (module->handle, symbol_name);
if (*symbol != NULL)
return TRUE;
*symbol = w32_find_symbol (symbol_name);
return *symbol != NULL;
} else {
*symbol = (gpointer)(intptr_t)GetProcAddress (module->handle, symbol_name);
return *symbol != NULL;
}
}
const gchar *
g_module_error (void)
{
gchar* ret = NULL;
TCHAR* buf = NULL;
DWORD code = GetLastError ();
FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL,
code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, 0, NULL);
ret = u16to8 (buf);
LocalFree(buf);
return ret;
}
gboolean
g_module_close (GModule *module)
{
HMODULE handle;
int main_module;
if (module == NULL || module->handle == NULL)
return FALSE;
handle = module->handle;
main_module = module->main_module;
module->handle = NULL;
g_free (module);
return (main_module ? 1 : (0 == FreeLibrary (handle)));
}
gchar *
g_module_build_path (const gchar *directory, const gchar *module_name)
{
char *lib_prefix = "";
if (module_name == NULL)
return NULL;
if (strncmp (module_name, "lib", 3) != 0)
lib_prefix = LIBPREFIX;
if (directory && *directory){
return g_strdup_printf ("%s/%s%s" LIBSUFFIX, directory, lib_prefix, module_name);
}
return g_strdup_printf ("%s%s" LIBSUFFIX, lib_prefix, module_name);
}
+287
View File
@@ -0,0 +1,287 @@
/*
* gmodule.c: dl* functions, glib style
*
* Author:
* Gonzalo Paniagua Javier ([email protected])
* Jonathan Chambers ([email protected])
* Robert Jordan ([email protected])
*
* (C) 2006 Novell, Inc.
* (C) 2006 Jonathan Chambers
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <glib.h>
#include <gmodule.h>
#ifdef G_OS_UNIX
#include <dlfcn.h>
/* For Linux and Solaris, need to add others as we port this */
#define LIBPREFIX "lib"
#define LIBSUFFIX ".so"
struct _GModule {
void *handle;
};
GModule *
g_module_open (const gchar *file, GModuleFlags flags)
{
int f = 0;
GModule *module;
void *handle;
flags &= G_MODULE_BIND_MASK;
if ((flags & G_MODULE_BIND_LAZY) != 0)
f |= RTLD_LAZY;
if ((flags & G_MODULE_BIND_LOCAL) != 0)
f |= RTLD_LOCAL;
handle = dlopen (file, f);
if (handle == NULL)
return NULL;
module = g_new (GModule,1);
module->handle = handle;
return module;
}
gboolean
g_module_symbol (GModule *module, const gchar *symbol_name, gpointer *symbol)
{
if (symbol_name == NULL || symbol == NULL)
return FALSE;
if (module == NULL || module->handle == NULL)
return FALSE;
*symbol = dlsym (module->handle, symbol_name);
return (*symbol != NULL);
}
const gchar *
g_module_error (void)
{
return dlerror ();
}
gboolean
g_module_close (GModule *module)
{
void *handle;
if (module == NULL || module->handle == NULL)
return FALSE;
handle = module->handle;
module->handle = NULL;
g_free (module);
return (0 == dlclose (handle));
}
#elif defined (G_OS_WIN32)
#include <windows.h>
#include <psapi.h>
#define LIBSUFFIX ".dll"
#define LIBPREFIX ""
struct _GModule {
HMODULE handle;
int main_module;
};
GModule *
g_module_open (const gchar *file, GModuleFlags flags)
{
GModule *module;
module = g_malloc (sizeof (GModule));
if (module == NULL)
return NULL;
if (file != NULL) {
gunichar2 *file16;
file16 = u8to16(file);
module->main_module = FALSE;
module->handle = LoadLibrary (file16);
g_free(file16);
if (!module->handle) {
g_free (module);
return NULL;
}
} else {
module->main_module = TRUE;
module->handle = GetModuleHandle (NULL);
}
return module;
}
static gpointer
w32_find_symbol (const gchar *symbol_name)
{
HMODULE *modules;
DWORD buffer_size = sizeof (HMODULE) * 1024;
DWORD needed, i;
modules = (HMODULE *) g_malloc (buffer_size);
if (modules == NULL)
return NULL;
if (!EnumProcessModules (GetCurrentProcess (), modules,
buffer_size, &needed)) {
g_free (modules);
return NULL;
}
/* check whether the supplied buffer was too small, realloc, retry */
if (needed > buffer_size) {
g_free (modules);
buffer_size = needed;
modules = (HMODULE *) g_malloc (buffer_size);
if (modules == NULL)
return NULL;
if (!EnumProcessModules (GetCurrentProcess (), modules,
buffer_size, &needed)) {
g_free (modules);
return NULL;
}
}
for (i = 0; i < needed / sizeof (HANDLE); i++) {
gpointer proc = (gpointer)(intptr_t)GetProcAddress (modules [i], symbol_name);
if (proc != NULL) {
g_free (modules);
return proc;
}
}
g_free (modules);
return NULL;
}
gboolean
g_module_symbol (GModule *module, const gchar *symbol_name, gpointer *symbol)
{
if (module == NULL || symbol_name == NULL || symbol == NULL)
return FALSE;
if (module->main_module) {
*symbol = (gpointer)(intptr_t)GetProcAddress (module->handle, symbol_name);
if (*symbol != NULL)
return TRUE;
*symbol = w32_find_symbol (symbol_name);
return *symbol != NULL;
} else {
*symbol = (gpointer)(intptr_t)GetProcAddress (module->handle, symbol_name);
return *symbol != NULL;
}
}
const gchar *
g_module_error (void)
{
gchar* ret = NULL;
TCHAR* buf = NULL;
DWORD code = GetLastError ();
FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL,
code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, 0, NULL);
ret = u16to8 (buf);
LocalFree(buf);
return ret;
}
gboolean
g_module_close (GModule *module)
{
HMODULE handle;
int main_module;
if (module == NULL || module->handle == NULL)
return FALSE;
handle = module->handle;
main_module = module->main_module;
module->handle = NULL;
g_free (module);
return (main_module ? 1 : (0 == FreeLibrary (handle)));
}
#else
#define LIBSUFFIX ""
#define LIBPREFIX ""
GModule *
g_module_open (const gchar *file, GModuleFlags flags)
{
g_error ("%s", "g_module_open not implemented on this platform");
return NULL;
}
gboolean
g_module_symbol (GModule *module, const gchar *symbol_name, gpointer *symbol)
{
g_error ("%s", "g_module_open not implemented on this platform");
return FALSE;
}
const gchar *
g_module_error (void)
{
g_error ("%s", "g_module_open not implemented on this platform");
return NULL;
}
gboolean
g_module_close (GModule *module)
{
g_error ("%s", "g_module_open not implemented on this platform");
return FALSE;
}
#endif
gchar *
g_module_build_path (const gchar *directory, const gchar *module_name)
{
char *lib_prefix = "";
if (module_name == NULL)
return NULL;
if (strncmp (module_name, "lib", 3) != 0)
lib_prefix = LIBPREFIX;
if (directory && *directory){
return g_strdup_printf ("%s/%s%s" LIBSUFFIX, directory, lib_prefix, module_name);
}
return g_strdup_printf ("%s%s" LIBSUFFIX, lib_prefix, module_name);
}
-3
View File
@@ -27,7 +27,4 @@ const gchar *g_module_error (void);
gboolean g_module_close (GModule *module);
gchar * g_module_build_path (const gchar *directory, const gchar *module_name);
extern char *gmodule_libprefix;
extern char *gmodule_libsuffix;
#endif
+1 -4
View File
@@ -73,11 +73,8 @@ g_logv (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format,
log_domain != NULL ? ": " : "",
msg);
free (msg);
if (log_level & fatal){
fflush (stdout);
fflush (stderr);
if (log_level & fatal)
abort ();
}
}
void
+161 -58
View File
@@ -29,15 +29,26 @@
#include <stdio.h>
#include <glib.h>
#include <errno.h>
#include <sys/types.h>
#ifdef G_OS_WIN32
#include <direct.h>
#ifdef G_OS_UNIX
#include <pthread.h>
#endif
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef G_OS_WIN32
#include <direct.h>
#include <io.h>
#endif
gchar *
g_build_path (const gchar *separator, const gchar *first_element, ...)
{
@@ -47,9 +58,7 @@ g_build_path (const gchar *separator, const gchar *first_element, ...)
va_list args;
g_return_val_if_fail (separator != NULL, NULL);
if (first_element == NULL)
return g_strdup ("");
g_return_val_if_fail (first_element != NULL, NULL);
result = g_string_sized_new (48);
@@ -68,8 +77,7 @@ g_build_path (const gchar *separator, const gchar *first_element, ...)
g_string_append_len (result, s, p - s);
if (next && *next){
if (strncmp (separator, result->str + strlen (result->str) - slen, slen))
g_string_append (result, separator);
g_string_append (result, separator);
for (; strncmp (next, separator, slen) == 0; )
next += slen;
@@ -134,59 +142,20 @@ g_path_get_basename (const char *filename)
return g_strdup (&r[1]);
}
#ifndef HAVE_STRTOK_R
// This is from BSD's strtok_r
char *
strtok_r(char *s, const char *delim, char **last)
gboolean
g_path_is_absolute (const char *filename)
{
char *spanp;
int c, sc;
char *tok;
if (s == NULL && (s = *last) == NULL)
return NULL;
/*
* Skip (span) leading delimiters (s += strspn(s, delim), sort of).
*/
cont:
c = *s++;
for (spanp = (char *)delim; (sc = *spanp++) != 0; ){
if (c == sc)
goto cont;
}
if (c == 0){ /* no non-delimiter characters */
*last = NULL;
return NULL;
}
tok = s - 1;
/*
* Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
* Note that delim must have one NUL; we stop if we see that, too.
*/
for (;;){
c = *s++;
spanp = (char *)delim;
do {
if ((sc = *spanp++) == c) {
if (c == 0)
s = NULL;
else {
char *w = s - 1;
*w = '\0';
}
*last = s;
return tok;
}
}
while (sc != 0);
}
/* NOTREACHED */
}
g_return_val_if_fail (filename != NULL, FALSE);
#ifdef G_OS_WIN32
if (filename[0] != '\0' && filename[1] != '\0' && filename[1] == ':' &&
filename[2] != '\0' && (filename[2] == '\\' || filename[2] == '/'))
return TRUE;
else
return FALSE;
#else
return (*filename == '/');
#endif
}
gchar *
g_find_program_in_path (const gchar *program)
@@ -220,6 +189,140 @@ g_find_program_in_path (const gchar *program)
return NULL;
}
gchar *
g_get_current_dir (void)
{
int s = 32;
char *buffer = NULL, *r;
gboolean fail;
do {
buffer = g_realloc (buffer, s);
r = getcwd (buffer, s);
fail = (r == NULL && errno == ERANGE);
if (fail) {
s <<= 1;
}
} while (fail);
return r;
}
#if defined (G_OS_UNIX)
static pthread_mutex_t home_lock = PTHREAD_MUTEX_INITIALIZER;
static const gchar *home_dir;
/* Give preference to /etc/passwd than HOME */
const gchar *
g_get_home_dir (void)
{
if (home_dir == NULL){
pthread_mutex_lock (&home_lock);
if (home_dir == NULL){
#ifdef HAVE_GETPWENT_R
struct passwd pwbuf, *track;
char buf [4096];
uid_t uid;
uid = getuid ();
setpwent ();
while (getpwent_r (&pwbuf, buf, sizeof (buf), &track) == 0){
if (pwbuf.pw_uid == uid){
home_dir = g_strdup (pwbuf.pw_dir);
break;
}
}
endpwent ();
#endif
if (home_dir == NULL)
home_dir = g_getenv ("HOME");
pthread_mutex_unlock (&home_lock);
}
}
return home_dir;
}
#elif defined (G_OS_WIN32)
#include <windows.h>
const gchar *
g_get_home_dir (void)
{
/* FIXME */
const gchar *drive = g_getenv ("HOMEDRIVE");
const gchar *path = g_getenv ("HOMEPATH");
gchar *home_dir = NULL;
if (drive && path) {
home_dir = malloc(strlen(drive) + strlen(path) +1);
if (home_dir) {
sprintf(home_dir, "%s%s", drive, path);
}
}
return home_dir;
}
#else
const gchar *
g_get_home_dir (void)
{
g_error ("%s", "g_get_home_dir not implemented on this platform");
return NULL;
}
#endif
static const char *tmp_dir;
#ifdef G_OS_UNIX
static pthread_mutex_t tmp_lock = PTHREAD_MUTEX_INITIALIZER;
#endif
const gchar *
g_get_tmp_dir (void)
{
if (tmp_dir == NULL){
#ifdef G_OS_UNIX
pthread_mutex_lock (&tmp_lock);
#endif
if (tmp_dir == NULL){
tmp_dir = g_getenv ("TMPDIR");
if (tmp_dir == NULL){
tmp_dir = g_getenv ("TMP");
if (tmp_dir == NULL){
tmp_dir = g_getenv ("TEMP");
if (tmp_dir == NULL)
#if defined (G_OS_WIN32)
tmp_dir = "C:\\temp";
#else
tmp_dir = "/tmp";
#endif
}
}
}
#ifdef G_OS_UNIX
pthread_mutex_unlock (&tmp_lock);
#endif
}
return tmp_dir;
}
const char *
g_get_user_name (void)
{
const char * retName = g_getenv ("USER");
#if defined (G_OS_WIN32)
if (!retName)
retName = g_getenv ("USERNAME");
#endif
return retName;
}
static char *name;
void
+2 -3
View File
@@ -37,8 +37,7 @@ typedef enum {
MATCH_LITERAL,
MATCH_ANYCHAR,
MATCH_ANYTHING,
MATCH_ANYTHING_END,
MATCH_INVALID = -1
MATCH_ANYTHING_END
} MatchType;
typedef struct {
@@ -57,7 +56,7 @@ compile_pattern (const gchar *pattern)
size_t i, len;
PData *data;
gchar c;
MatchType last = MATCH_INVALID;
MatchType last = -1;
GString *str;
gboolean free_str;
+12 -12
View File
@@ -40,7 +40,7 @@ g_strndup (const gchar *str, gsize n)
return strndup (str, n);
#else
if (str) {
char *retval = g_malloc(n+1);
char *retval = malloc(n+1);
if (retval) {
strncpy(retval, str, n)[n] = 0;
}
@@ -817,6 +817,15 @@ g_strescape (const gchar *source, const gchar *exceptions)
return result;
}
gchar *
g_strdup (const gchar *str)
{
if (str == NULL)
return NULL;
return strdup (str);
}
gint
g_ascii_xdigit_value (gchar c)
{
@@ -826,15 +835,6 @@ g_ascii_xdigit_value (gchar c)
(c - 'A' + 10))));
}
gchar *
g_strnfill (gsize length, gchar fill_char)
{
gchar *ret = g_new (gchar, length + 1);
int i;
for (i = 0; i < length; i++)
ret [i] = fill_char;
ret [length] = 0;
return ret;
}
+1 -1
View File
@@ -159,7 +159,7 @@ g_string_append_printf (GString *string, const gchar *format, ...)
va_end (args);
g_string_append (string, ret);
g_free (ret);
free (ret);
}
void
-96
View File
@@ -1,96 +0,0 @@
/*
* Timer
*
* Author:
* Gonzalo Paniagua Javier ([email protected]
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <glib.h>
#include <sys/time.h>
struct _GTimer {
struct timeval start;
struct timeval stop;
};
GTimer *g_timer_new (void)
{
GTimer *timer;
timer = g_new0 (GTimer, 1);
g_timer_start (timer);
return timer;
}
void
g_timer_destroy (GTimer *timer)
{
g_return_if_fail (timer != NULL);
g_free (timer);
}
void
g_timer_start (GTimer *timer)
{
g_return_if_fail (timer != NULL);
gettimeofday (&timer->start, NULL);
memset (&timer->stop, 0, sizeof (struct timeval));
}
void
g_timer_stop (GTimer *timer)
{
g_return_if_fail (timer != NULL);
gettimeofday (&timer->stop, NULL);
}
gdouble
g_timer_elapsed (GTimer *timer, gulong *microseconds)
{
struct timeval tv;
gulong seconds;
long usec;
gdouble result;
g_return_val_if_fail (timer != NULL, 0.0);
if (timer->stop.tv_sec == 0 && timer->stop.tv_usec == 0) {
gettimeofday (&tv, NULL);
} else {
tv = timer->stop;
}
usec = (tv.tv_usec) - (timer->start.tv_usec);
seconds = tv.tv_sec - timer->start.tv_sec;
if (microseconds) {
if (usec < 0) {
usec += 1000000;
seconds--;
}
*microseconds = usec;
}
result = seconds * 1000000 + usec;
return (result / 1000000);
}
-90
View File
@@ -1,90 +0,0 @@
/*
* Timer
*
* Author:
* Gonzalo Paniagua Javier ([email protected]
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <glib.h>
#include <windows.h>
struct _GTimer {
guint64 start;
guint64 stop;
};
GTimer *g_timer_new (void)
{
GTimer *timer;
timer = g_new0 (GTimer, 1);
g_timer_start (timer);
return timer;
}
void
g_timer_destroy (GTimer *timer)
{
g_return_if_fail (timer != NULL);
g_free (timer);
}
void
g_timer_start (GTimer *timer)
{
g_return_if_fail (timer != NULL);
QueryPerformanceCounter ((LARGE_INTEGER*)&timer->start);
}
void
g_timer_stop (GTimer *timer)
{
g_return_if_fail (timer != NULL);
QueryPerformanceCounter ((LARGE_INTEGER*)&timer->stop);
}
gdouble
g_timer_elapsed (GTimer *timer, gulong *microseconds)
{
guint64 stop;
guint64 freq;
gdouble seconds;
if (timer->stop == 0) {
QueryPerformanceCounter ((LARGE_INTEGER*)&stop);
}
else {
stop = timer->stop;
}
QueryPerformanceFrequency ((LARGE_INTEGER*)&freq);
seconds = 1.0 * (stop - timer->start) / freq;
if (microseconds) {
*microseconds = (gulong)(1000000.0 * (stop - timer->start) / freq);
}
return seconds;
}
+134
View File
@@ -0,0 +1,134 @@
/*
* Timer
*
* Author:
* Gonzalo Paniagua Javier ([email protected]
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <glib.h>
#ifdef _MSC_VER
#include <windows.h>
#else
#include <sys/time.h>
#endif
struct _GTimer {
#ifdef _MSC_VER
guint64 start;
guint64 stop;
#else
struct timeval start;
struct timeval stop;
#endif
};
GTimer *g_timer_new (void)
{
GTimer *timer;
timer = g_new0 (GTimer, 1);
g_timer_start (timer);
return timer;
}
void
g_timer_destroy (GTimer *timer)
{
g_return_if_fail (timer != NULL);
g_free (timer);
}
void
g_timer_start (GTimer *timer)
{
g_return_if_fail (timer != NULL);
#ifdef _MSC_VER
QueryPerformanceCounter ((LARGE_INTEGER*)&timer->start);
#else
gettimeofday (&timer->start, NULL);
memset (&timer->stop, 0, sizeof (struct timeval));
#endif
}
void
g_timer_stop (GTimer *timer)
{
g_return_if_fail (timer != NULL);
#ifdef _MSC_VER
QueryPerformanceCounter ((LARGE_INTEGER*)&timer->stop);
#else
gettimeofday (&timer->stop, NULL);
#endif
}
gdouble
g_timer_elapsed (GTimer *timer, gulong *microseconds)
{
#ifdef _MSC_VER
guint64 stop;
guint64 freq;
gdouble seconds;
if (timer->stop == 0) {
QueryPerformanceCounter ((LARGE_INTEGER*)&stop);
}
else {
stop = timer->stop;
}
QueryPerformanceFrequency ((LARGE_INTEGER*)&freq);
seconds = 1.0 * (stop - timer->start) / freq;
if (microseconds) {
*microseconds = (gulong)(1000000.0 * (stop - timer->start) / freq);
}
return seconds;
#else
struct timeval tv;
gulong seconds;
long usec;
gdouble result;
g_return_val_if_fail (timer != NULL, 0.0);
if (timer->stop.tv_sec == 0 && timer->stop.tv_usec == 0) {
gettimeofday (&tv, NULL);
} else {
tv = timer->stop;
}
usec = (tv.tv_usec) - (timer->start.tv_usec);
seconds = tv.tv_sec - timer->start.tv_sec;
if (microseconds) {
if (usec < 0) {
usec += 1000000;
seconds--;
}
*microseconds = usec;
}
result = seconds * 1000000 + usec;
return (result / 1000000);
#endif
}
+56 -219
View File
@@ -33,10 +33,8 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#include <config.h>
#include <stdio.h>
#include <glib.h>
#include <unicode-data.h>
#include <errno.h>
#ifdef _MSC_VER
/* FIXME */
@@ -45,138 +43,25 @@
typedef int iconv_t;
#else
#ifdef HAVE_LANGINFO_H
#include <langinfo.h>
#endif
#ifdef HAVE_ICONV_H
#include <iconv.h>
#endif
#endif
static char *my_charset;
static gboolean is_utf8;
/*
* Character set conversion
*/
/*
* Index into the table below with the first byte of a UTF-8 sequence to
* get the number of trailing bytes that are supposed to follow it.
* Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is
* left as-is for anyone who may want to do such conversion, which was
* allowed in earlier algorithms.
*/
const gchar g_trailingBytesForUTF8 [256] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,0,0
};
/*
* Magic values subtracted from a buffer value during UTF8 conversion.
* This table contains as many values as there might be trailing bytes
* in a UTF-8 sequence.
*/
static const gulong offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL,
0x03C82080UL, 0xFA082080UL, 0x82082080UL };
GUnicodeType
g_unichar_type (gunichar c)
{
int i;
guint16 cp = (guint16) c;
for (i = 0; i < unicode_category_ranges_count; i++) {
if (cp < unicode_category_ranges [i].start)
continue;
if (unicode_category_ranges [i].end <= cp)
continue;
return unicode_category [i] [cp - unicode_category_ranges [i].start];
}
/*
// 3400-4DB5: OtherLetter
// 4E00-9FC3: OtherLetter
// AC00-D7A3: OtherLetter
// D800-DFFF: OtherSurrogate
// E000-F8FF: OtherPrivateUse
// 20000-2A6D6 OtherLetter
// F0000-FFFFD OtherPrivateUse
// 100000-10FFFD OtherPrivateUse
*/
if (0x3400 <= cp && cp < 0x4DB5)
return G_UNICODE_OTHER_LETTER;
if (0x4E00 <= cp && cp < 0x9FC3)
return G_UNICODE_OTHER_LETTER;
if (0xAC00<= cp && cp < 0xD7A3)
return G_UNICODE_OTHER_LETTER;
if (0xD800 <= cp && cp < 0xDFFF)
return G_UNICODE_SURROGATE;
if (0xE000 <= cp && cp < 0xF8FF)
return G_UNICODE_PRIVATE_USE;
/* since the argument is UTF-16, we cannot check beyond FFFF */
/* It should match any of above */
g_error ("%s", "g_unichar_type is not implemented");
return 0;
}
gunichar
g_unichar_case (gunichar c, gboolean upper)
{
gint8 i, i2;
guint32 cp = (guint32) c, v;
for (i = 0; i < simple_case_map_ranges_count; i++) {
if (cp < simple_case_map_ranges [i].start)
return c;
if (simple_case_map_ranges [i].end <= cp)
continue;
if (c < 0x10000) {
const guint16 *tab = upper ? simple_upper_case_mapping_lowarea [i] : simple_lower_case_mapping_lowarea [i];
v = tab [cp - simple_case_map_ranges [i].start];
} else {
const guint32 *tab;
i2 = (gint8)(i - (upper ? simple_upper_case_mapping_lowarea_table_count : simple_lower_case_mapping_lowarea_table_count));
tab = upper ? simple_upper_case_mapping_higharea [i2] : simple_lower_case_mapping_higharea [i2];
v = tab [cp - simple_case_map_ranges [i].start];
}
return v != 0 ? (gunichar) v : c;
}
return c;
}
gunichar
g_unichar_toupper (gunichar c)
{
return g_unichar_case (c, TRUE);
}
gunichar
g_unichar_tolower (gunichar c)
{
return g_unichar_case (c, FALSE);
}
gunichar
g_unichar_totitle (gunichar c)
{
guint8 i;
guint32 cp;
cp = (guint32) c;
for (i = 0; i < simple_titlecase_mapping_count; i++) {
if (simple_titlecase_mapping [i].codepoint == cp)
return simple_titlecase_mapping [i].title;
if (simple_titlecase_mapping [i].codepoint > cp)
/* it is ordered, hence no more match */
break;
}
return g_unichar_toupper (c);
g_error ("%s", "g_unichar_type is not implemented");
return 0;
}
gboolean
@@ -205,7 +90,7 @@ g_convert (const gchar *str, gssize len,
{
char *result = NULL;
#ifdef G_OS_WIN32
#elif HAVE_ICONV_H
#else
iconv_t convertor;
char *buffer, *output;
const char *strptr = (const char *) str;
@@ -300,11 +185,7 @@ g_get_charset (G_CONST_RETURN char **charset)
is_utf8 = FALSE;
#else
if (my_charset == NULL){
#if HAVE_LANGINFO_H
my_charset = g_strdup (nl_langinfo (CODESET));
#else
my_charset = g_strdup ("UTF-8");
#endif
is_utf8 = strcmp (my_charset, "UTF-8") == 0;
}
@@ -344,105 +225,61 @@ g_locale_from_utf8 (const gchar *utf8string, gssize len, gsize *bytes_read, gsiz
* Return value: true if @utf is valid.
**/
gboolean
g_utf8_validate (const gchar *str, gssize max_len, const gchar **end)
g_utf8_validate (const gchar *utf, gssize max_len, const gchar **end)
{
gssize byteCount = 0;
gboolean retVal = TRUE;
gboolean lastRet = TRUE;
guchar* ptr = (guchar*) str;
guint length;
guchar a;
guchar* srcPtr;
if (max_len == 0)
return 0;
else if (max_len < 0)
byteCount = max_len;
while (*ptr != 0 && byteCount <= max_len) {
length = g_trailingBytesForUTF8 [*ptr] + 1;
srcPtr = (guchar*) ptr + length;
switch (length) {
default: retVal = FALSE;
/* Everything else falls through when "TRUE"... */
case 4: if ((a = (*--srcPtr)) < (guchar) 0x80 || a > (guchar) 0xBF) retVal = FALSE;
if ((a == (guchar) 0xBF || a == (guchar) 0xBE) && *(srcPtr-1) == (guchar) 0xBF) {
if (*(srcPtr-2) == (guchar) 0x8F || *(srcPtr-2) == (guchar) 0x9F ||
*(srcPtr-2) == (guchar) 0xAF || *(srcPtr-2) == (guchar) 0xBF)
retVal = FALSE;
}
case 3: if ((a = (*--srcPtr)) < (guchar) 0x80 || a > (guchar) 0xBF) retVal = FALSE;
case 2: if ((a = (*--srcPtr)) < (guchar) 0x80 || a > (guchar) 0xBF) retVal = FALSE;
int ix;
g_return_val_if_fail (utf != NULL, FALSE);
switch (*ptr) {
/* no fall-through in this inner switch */
case 0xE0: if (a < (guchar) 0xA0) retVal = FALSE; break;
case 0xED: if (a > (guchar) 0x9F) retVal = FALSE; break;
case 0xEF: if (a == (guchar)0xB7 && (*(srcPtr+1) > (guchar) 0x8F && *(srcPtr+1) < 0xB0)) retVal = FALSE;
if (a == (guchar)0xBF && (*(srcPtr+1) == (guchar) 0xBE || *(srcPtr+1) == 0xBF)) retVal = FALSE; break;
case 0xF0: if (a < (guchar) 0x90) retVal = FALSE; break;
case 0xF4: if (a > (guchar) 0x8F) retVal = FALSE; break;
default: if (a < (guchar) 0x80) retVal = FALSE;
}
case 1: if (*ptr >= (guchar ) 0x80 && *ptr < (guchar) 0xC2) retVal = FALSE;
}
if (*ptr > (guchar) 0xF4)
retVal = FALSE;
//If the string is invalid, set the end to the invalid byte.
if (!retVal && lastRet) {
if (max_len == -1)
max_len = strlen (utf);
/*
* utf is a string of 1, 2, 3 or 4 bytes. The valid strings
* are as follows (in "bit format"):
* 0xxxxxxx valid 1-byte
* 110xxxxx 10xxxxxx valid 2-byte
* 1110xxxx 10xxxxxx 10xxxxxx valid 3-byte
* 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx valid 4-byte
*/
for (ix = 0; ix < max_len;) { /* string is 0-terminated */
unsigned char c;
c = utf[ix];
if ((c & 0x80) == 0x00) { /* 1-byte code, starts with 10 */
ix++;
} else if ((c & 0xe0) == 0xc0) {/* 2-byte code, starts with 110 */
if (((ix+1) >= max_len) || (utf[ix+1] & 0xc0 ) != 0x80){
if (end != NULL)
*end = &utf [ix];
return FALSE;
}
ix += 2;
} else if ((c & 0xf0) == 0xe0) {/* 3-byte code, starts with 1110 */
if (((ix + 2) >= max_len) ||
((utf[ix+1] & 0xc0) != 0x80) ||
((utf[ix+2] & 0xc0) != 0x80)){
if (end != NULL)
*end = &utf [ix];
return FALSE;
}
ix += 3;
} else if ((c & 0xf8) == 0xf0) {/* 4-byte code, starts with 11110 */
if (((ix + 3) >= max_len) ||
((utf[ix+1] & 0xc0) != 0x80) ||
((utf[ix+2] & 0xc0) != 0x80) ||
((utf[ix+3] & 0xc0) != 0x80)){
if (end != NULL)
*end = &utf [ix];
return FALSE;
}
ix += 4;
} else {/* unknown encoding */
if (end != NULL)
*end = (gchar*) ptr;
lastRet = FALSE;
*end = &utf [ix];
return FALSE;
}
ptr += length;
if(max_len > 0)
byteCount += length;
}
if (retVal && end != NULL)
*end = (gchar*) ptr;
return retVal;
}
/**
* g_utf8_get_char
* @src: Pointer to UTF-8 encoded character.
*
* Return value: UTF-16 value of @src
**/
gunichar
g_utf8_get_char (const gchar *src)
{
gunichar ch = 0;
guchar* ptr = (guchar*) src;
gushort extraBytesToRead = g_trailingBytesForUTF8 [*ptr];
switch (extraBytesToRead) {
case 5: ch += *ptr++; ch <<= 6; // remember, illegal UTF-8
case 4: ch += *ptr++; ch <<= 6; // remember, illegal UTF-8
case 3: ch += *ptr++; ch <<= 6;
case 2: ch += *ptr++; ch <<= 6;
case 1: ch += *ptr++; ch <<= 6;
case 0: ch += *ptr;
}
ch -= offsetsFromUTF8 [extraBytesToRead];
return ch;
}
glong
g_utf8_strlen (const gchar *str, gssize max)
{
gssize byteCount = 0;
guchar* ptr = (guchar*) str;
glong length = 0;
if (max == 0)
return 0;
else if (max < 0)
byteCount = max;
while (*ptr != 0 && byteCount <= max) {
gssize cLen = g_trailingBytesForUTF8 [*ptr] + 1;
if (max > 0 && (byteCount + cLen) > max)
return length;
ptr += cLen;
length++;
if (max > 0)
byteCount += cLen;
}
return length;
return TRUE;
}
+3 -41
View File
@@ -21,40 +21,6 @@ g_convert_error_quark ()
return error_quark;
}
gunichar*
utf8_case_conv (const gchar *str, gssize len, gboolean upper)
{
glong i, u16len, u32len;
gunichar2 *u16str;
gunichar *u32str;
gchar *u8str;
GError **err = NULL;
u16str = g_utf8_to_utf16 (str, (glong)len, NULL, &u16len, err);
u32str = g_utf16_to_ucs4 (u16str, u16len, NULL, &u32len, err);
for (i = 0; i < u32len; i++) {
u32str [i] = upper ? g_unichar_toupper (u32str [i]) : g_unichar_tolower (u32str [i]);
}
g_free (u16str);
u16str = g_ucs4_to_utf16 (u32str, u32len, NULL, &u16len, err);
u8str = g_utf16_to_utf8 (u16str, u16len, NULL, NULL, err);
g_free (u32str);
g_free (u16str);
return (gunichar*)u8str;
}
gchar*
g_utf8_strup (const gchar *str, gssize len)
{
return (gchar*)utf8_case_conv (str, len, TRUE);
}
gchar*
g_utf8_strdown (const gchar *str, gssize len)
{
return (gchar*)utf8_case_conv (str, len, FALSE);
}
gunichar2*
g_utf8_to_utf16 (const gchar *str, glong len, glong *items_read, glong *items_written, GError **error)
{
@@ -302,14 +268,12 @@ g_utf16_to_utf8 (const gunichar2 *str, glong len, glong *items_read, glong *item
while (len < 0 ? str [in_pos] : in_pos < len) {
ch = str [in_pos];
if (surrogate) {
if (ch >= 0xDC00 && ch <= 0xDFFF) {
surrogate = 0;
if (ch >= 0xDC00 && ch <= 0xDFFF)
codepoint = 0x10000 + (ch - 0xDC00) + ((surrogate - 0xD800) << 10);
surrogate = 0;
} else {
surrogate = 0;
else
/* invalid surrogate pair */
continue;
}
} else {
/* fast path optimization */
if (ch < 0x80) {
@@ -332,8 +296,6 @@ g_utf16_to_utf8 (const gunichar2 *str, glong len, glong *items_read, glong *item
}
in_pos++;
if (surrogate != 0)
continue;
if (codepoint < 0x80)
ret [out_pos++] = (gchar) codepoint;
else if (codepoint < 0x0800) {
File diff suppressed because it is too large. Load diff
+20 -20
View File
@@ -4,27 +4,27 @@
int vasprintf(char **ret, const char *fmt, va_list ap)
{
char *buf;
int len;
size_t buflen;
va_list ap2;
char *buf;
int len;
size_t buflen;
va_list ap2;
#ifdef _MSC_VER
ap2 = ap;
len = _vscprintf(fmt, ap2); // NOTE MS specific extension ( :-( )
ap2 = ap;
len = _vscprintf(fmt, ap2); // NOTE MS specific extension ( :-( )
#else
va_copy(ap2, ap);
len = vsnprintf(NULL, 0, fmt, ap2);
va_copy(ap2, ap);
len = vsnprintf(NULL, 0, fmt, ap2);
#endif
if (len > 0 && (buf = malloc((buflen = (size_t) (len + 1)))) != NULL) {
len = vsnprintf(buf, buflen, fmt, ap);
*ret = buf;
} else {
*ret = NULL;
len = -1;
}
va_end(ap2);
return len;
if (len > 0 && (buf = malloc((buflen = (size_t) (len + 1)))) != NULL) {
len = vsnprintf(buf, buflen, fmt, ap);
*ret = buf;
} else {
*ret = NULL;
len = -1;
}
va_end(ap2);
return len;
}
+1 -3
View File
@@ -21,11 +21,9 @@ SOURCES = \
pattern.c \
dir.c \
markup.c \
unicode.c \
utf8.c \
endian.c \
module.c \
memory.c
module.c
test_eglib_SOURCES = $(SOURCES)
+1 -1
View File
@@ -238,7 +238,7 @@ gint main(gint argc, gchar **argv)
string_array_free(tests_to_run);
}
return global_tests - global_passed;
return 0;
}
-40
View File
@@ -1,40 +0,0 @@
#include <glib.h>
#include "test.h"
RESULT
test_memory_zero_size_allocations ()
{
gpointer p;
p = g_malloc (0);
if (p)
return FAILED ("Calling g_malloc with size zero should return NULL.");
p = g_malloc0 (0);
if (p)
return FAILED ("Calling g_malloc0 with size zero should return NULL.");
p = g_realloc (NULL, 0);
if (p)
return FAILED ("Calling g_realloc with size zero should return NULL.");
p = g_new (int, 0);
if (p)
return FAILED ("Calling g_new with size zero should return NULL.");
p = g_new0 (int, 0);
if (p)
return FAILED ("Calling g_new0 with size zero should return NULL.");
return OK;
}
static Test memory_tests [] = {
{ "zero_size_allocations", test_memory_zero_size_allocations},
{NULL, NULL}
};
DEFINE_TEST_GROUP_INIT(memory_tests_init, memory_tests)
+2 -23
View File
@@ -92,14 +92,7 @@ test_buildpath ()
if (strcmp (s, "/a/c/") != 0)
return FAILED ("14 Got wrong result, got: %s", s);
g_free (s);
/* Null */
s = g_build_path ("/", NULL);
if (s == NULL)
return FAILED ("must get a non-NULL return");
if (s [0] != 0)
return FAILED ("must get an empty string");
g_free (s);
return OK;
}
@@ -116,20 +109,6 @@ test_buildfname ()
#endif
return FAILED ("1 Got wrong result, got: %s", s);
g_free (s);
s = g_build_filename ("/", "a", NULL);
#ifdef G_OS_WIN32
if (strcmp (s, "\\a") != 0)
#else
if (strcmp (s, "/a") != 0)
#endif
return FAILED ("1 Got wrong result, got: %s", s);
#ifndef OS_WIN32
s = g_build_filename ("/", "foo", "/bar", "tolo/", "/meo/", NULL);
if (strcmp (s, "/foo/bar/tolo/meo/") != 0)
return FAILED ("1 Got wrong result, got: %s", s);
#endif
return OK;
}
@@ -305,8 +284,8 @@ test_misc ()
}
static Test path_tests [] = {
{"g_build_filename", test_buildfname},
{"g_buildpath", test_buildpath},
{"g_build_filename", test_buildfname},
{"g_path_get_dirname", test_dirname},
{"g_path_get_basename", test_basename},
{"g_find_program_in_path", test_ppath},
-4
View File
@@ -18,11 +18,9 @@ DEFINE_TEST_GROUP_INIT_H(file_tests_init);
DEFINE_TEST_GROUP_INIT_H(pattern_tests_init);
DEFINE_TEST_GROUP_INIT_H(dir_tests_init);
DEFINE_TEST_GROUP_INIT_H(markup_tests_init);
DEFINE_TEST_GROUP_INIT_H(unicode_tests_init);
DEFINE_TEST_GROUP_INIT_H(utf8_tests_init);
DEFINE_TEST_GROUP_INIT_H(endian_tests_init);
DEFINE_TEST_GROUP_INIT_H(module_tests_init);
DEFINE_TEST_GROUP_INIT_H(memory_tests_init);
static Group test_groups [] = {
{"string", string_tests_init},
@@ -43,11 +41,9 @@ static Group test_groups [] = {
{"file", file_tests_init},
{"pattern", pattern_tests_init},
{"dir", dir_tests_init},
{"unicode", unicode_tests_init},
{"utf8", utf8_tests_init},
{"endian", endian_tests_init},
{"module", module_tests_init},
{"memory", memory_tests_init},
{NULL, NULL}
};
-99
View File
@@ -1,99 +0,0 @@
#include "test.h"
/*
* g_unichar_type
*/
RESULT
test_g_unichar_type ()
{
if (g_unichar_type ('A') != G_UNICODE_UPPERCASE_LETTER)
return FAILED ("#1");
if (g_unichar_type ('a') != G_UNICODE_LOWERCASE_LETTER)
return FAILED ("#2");
if (g_unichar_type ('1') != G_UNICODE_DECIMAL_NUMBER)
return FAILED ("#3");
if (g_unichar_type (0xA3) != G_UNICODE_CURRENCY_SYMBOL)
return FAILED ("#4");
return NULL;
}
/*
* g_unichar_toupper
*/
RESULT
test_g_unichar_toupper ()
{
if (g_unichar_toupper (0) != 0)
return FAILED ("#0");
if (g_unichar_toupper ('a') != 'A')
return FAILED ("#1");
if (g_unichar_toupper ('1') != '1')
return FAILED ("#2");
if (g_unichar_toupper (0x1C4) != 0x1C4)
return FAILED ("#3");
if (g_unichar_toupper (0x1F2) != 0x1F1)
return FAILED ("#4");
if (g_unichar_toupper (0x1F3) != 0x1F1)
return FAILED ("#5");
if (g_unichar_toupper (0xFFFF) != 0xFFFF)
return FAILED ("#6");
if (g_unichar_toupper (0x10428) != 0x10400)
return FAILED ("#7");
return NULL;
}
/*
* g_unichar_tolower
*/
RESULT
test_g_unichar_tolower ()
{
if (g_unichar_tolower (0) != 0)
return FAILED ("#0");
if (g_unichar_tolower ('A') != 'a')
return FAILED ("#1");
if (g_unichar_tolower ('1') != '1')
return FAILED ("#2");
if (g_unichar_tolower (0x1C5) != 0x1C6)
return FAILED ("#3");
if (g_unichar_tolower (0x1F1) != 0x1F3)
return FAILED ("#4");
if (g_unichar_tolower (0x1F2) != 0x1F3)
return FAILED ("#5");
if (g_unichar_tolower (0xFFFF) != 0xFFFF)
return FAILED ("#6");
return NULL;
}
/*
* g_unichar_totitle
*/
RESULT
test_g_unichar_totitle ()
{
if (g_unichar_toupper (0) != 0)
return FAILED ("#0");
if (g_unichar_totitle ('a') != 'A')
return FAILED ("#1");
if (g_unichar_totitle ('1') != '1')
return FAILED ("#2");
if (g_unichar_totitle (0x1C4) != 0x1C5)
return FAILED ("#3");
if (g_unichar_totitle (0x1F2) != 0x1F2)
return FAILED ("#4");
if (g_unichar_totitle (0x1F3) != 0x1F2)
return FAILED ("#5");
if (g_unichar_toupper (0xFFFF) != 0xFFFF)
return FAILED ("#6");
return NULL;
}
static Test unicode_tests [] = {
{"g_unichar_type", test_g_unichar_type},
{"g_unichar_toupper", test_g_unichar_toupper},
{"g_unichar_tolower", test_g_unichar_tolower},
{"g_unichar_totitle", test_g_unichar_totitle},
{NULL, NULL}
};
DEFINE_TEST_GROUP_INIT(unicode_tests_init, unicode_tests)
+5 -292
View File
@@ -82,8 +82,8 @@ compare_utf16_to_utf8 (const gchar *expected, const gunichar2 *utf16, glong len_
RESULT
test_utf16_to_utf8 ()
{
const gchar *src0 = "", *src1 = "ABCDE", *src2 = "\xE5\xB9\xB4\x27", *src3 = "\xEF\xBC\xA1", *src4 = "\xEF\xBD\x81", *src5 = "\xF0\x90\x90\x80";
gunichar2 str0 [] = {0}, str1 [6], str2 [] = {0x5E74, 39, 0}, str3 [] = {0xFF21, 0}, str4 [] = {0xFF41, 0}, str5 [] = {0xD801, 0xDC00, 0};
const gchar *src0 = "", *src1 = "ABCDE", *src2 = "\xE5\xB9\xB4\x27";
gunichar2 str0 [] = {0}, str1 [6], str2 [] = {0x5E74, 39, 0};
RESULT result;
gchar_to_gunichar2 (str1, src1);
@@ -97,15 +97,6 @@ test_utf16_to_utf8 ()
if (result != OK)
return result;
result = compare_utf16_to_utf8 (src2, str2, 2, 4);
if (result != OK)
return result;
result = compare_utf16_to_utf8 (src3, str3, 1, 3);
if (result != OK)
return result;
result = compare_utf16_to_utf8 (src4, str4, 1, 3);
if (result != OK)
return result;
result = compare_utf16_to_utf8 (src5, str5, 2, 4);
if (result != OK)
return result;
@@ -203,7 +194,6 @@ test_utf8_seq ()
if (out_read != 2) {
return FAILED ("out_read is expected to be 2 but was %d\n", out_read);
}
g_free (dst);
return OK;
}
@@ -211,8 +201,8 @@ test_utf8_seq ()
RESULT
test_utf8_to_utf16 ()
{
const gchar *src0 = "", *src1 = "ABCDE", *src2 = "\xE5\xB9\xB4\x27", *src3 = "\xEF\xBC\xA1", *src4 = "\xEF\xBD\x81";
gunichar2 str0 [] = {0}, str1 [6], str2 [] = {0x5E74, 39, 0}, str3 [] = {0xFF21, 0}, str4 [] = {0xFF41, 0};
const gchar *src0 = "", *src1 = "ABCDE", *src2 = "\xE5\xB9\xB4\x27";
gunichar2 str0 [] = {0}, str1 [6], str2 [] = {0x5E74, 39, 0};
RESULT result;
gchar_to_gunichar2 (str1, src1);
@@ -226,12 +216,6 @@ test_utf8_to_utf16 ()
if (result != OK)
return result;
result = compare_utf8_to_utf16 (str2, src2, 4, 2);
if (result != OK)
return result;
result = compare_utf8_to_utf16 (str3, src3, 3, 1);
if (result != OK)
return result;
result = compare_utf8_to_utf16 (str4, src4, 3, 1);
if (result != OK)
return result;
@@ -326,8 +310,6 @@ test_ucs4_to_utf16 ()
static gunichar2 exp4[4] = {'h',0xdbff,0xdfff,'\0'};
static gunichar str5[7] = {0xD7FF,0xD800,0xDFFF,0xE000,0x110000,0x10FFFF,'\0'};
static gunichar2 exp5[5] = {0xD7FF,0xE000,0xdbff,0xdfff,'\0'};
static gunichar str6[2] = {0x10400, '\0'};
static gunichar2 exp6[3] = {0xD801, 0xDC00, '\0'};
static glong read_write[12] = {1,1,0,0,0,0,1,1,0,0,1,2};
gunichar2* res;
glong items_read, items_written, current_write_index;
@@ -355,8 +337,8 @@ test_ucs4_to_utf16 ()
items_read = items_written = 0;
res = g_ucs4_to_utf16 (str2, 2, &items_read, &items_written, &err);
check_result = ucs4_to_utf16_check_result (res, 0, items_read, 1, items_written, 0, err, TRUE);
g_free (res);
if (check_result) return check_result;
g_free (res);
items_read = items_written = 0;
err = 0;
@@ -385,13 +367,6 @@ test_ucs4_to_utf16 ()
current_write_index += items_written;
}
items_read = items_written = 0;
err = 0;
res = g_ucs4_to_utf16 (str6, 1, &items_read, &items_written, &err);
check_result = ucs4_to_utf16_check_result (res, exp6, items_read, 1, items_written, 2, err, FALSE);
if (check_result) return check_result;
g_free (res);
return OK;
}
@@ -436,8 +411,6 @@ test_utf16_to_ucs4 ()
static gunichar2 str4[20] = {0xDC00,0xDFFF,0xDFF,0xD800,0xDBFF,0xD800,0xDC00,0xD800,0xDFFF,
0xD800,0xE000,0xDBFF,0xDBFF,0xDBFF,0xDC00,0xDBFF,0xDFFF,0xDBFF,0xE000,'\0'};
static gunichar exp4[6] = {0xDFF,0x10000,0x103ff,0x10fc00,0x10FFFF,'\0'};
static gunichar2 str5[3] = {0xD801, 0xDC00, 0};
static gunichar exp5[2] = {0x10400, 0};
static glong read_write[33] = {1,0,0,1,0,0,1,1,1,2,1,0,2,2,1,2,2,1,2,1,0,2,1,0,2,2,1,2,2,1,2,1,0};
gunichar* res;
glong items_read, items_written, current_read_index,current_write_index;
@@ -508,260 +481,6 @@ test_utf16_to_ucs4 ()
current_write_index += items_written;
}
items_read = items_written = 0;
err = 0;
res = g_utf16_to_ucs4 (str5, 2, &items_read, &items_written, &err);
check_result = utf16_to_ucs4_check_result (res, exp5, items_read, 2, items_written, 1, err, FALSE);
if (check_result) return check_result;
g_free (res);
return OK;
}
RESULT
test_utf8_strlen ()
{
gchar word1 [] = {0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,0xF1, 0x82, 0x82, 0x82,'\0'};//Valid, len = 5
gchar word2 [] = {0xF1, 0x82, 0x82, 0x82,0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,'\0'};//Valid, len = 5
gchar word3 [] = {'h','e',0xC2, 0x82,0x45,'\0'}; //Valid, len = 4
gchar word4 [] = {0x62,0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,'\0'}; //Valid, len = 5
glong len = 0;
//Test word1
len = g_utf8_strlen (word1,-1);
if (len != 5)
return FAILED ("Word1 expected length of 5, but was %i", len);
//Do tests with different values for max parameter.
len = g_utf8_strlen (word1,1);
if (len != 0)
return FAILED ("Word1, max = 1, expected length of 0, but was %i", len);
len = g_utf8_strlen (word1,2);
if (len != 1)
return FAILED ("Word1, max = 1, expected length of 1, but was %i", len);
len = g_utf8_strlen (word1,3);
if (len != 2)
return FAILED ("Word1, max = 2, expected length of 2, but was %i", len);
//Test word2
len = g_utf8_strlen (word2,-1);
if (len != 5)
return FAILED ("Word2 expected length of 5, but was %i", len);
//Test word3
len = g_utf8_strlen (word3,-1);
if (len != 4)
return FAILED ("Word3 expected length of 4, but was %i", len);
//Test word4
len = g_utf8_strlen (word4,-1);
if (len != 5)
return FAILED ("Word4 expected length of 5, but was %i", len);
//Test null case
len = g_utf8_strlen(NULL,0);
if (len != 0)
return FAILED ("Expected passing null to result in a length of 0");
return OK;
}
RESULT
test_utf8_get_char()
{
gchar word1 [] = {0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,0xF1, 0x82, 0x82, 0x82,'\0'}; //Valid, len = 5
gunichar value = g_utf8_get_char (&word1 [0]);
if (value != 0x82UL)
return FAILED ("Expected value of 0x82, but was %x", value);
value = g_utf8_get_char (&word1 [2]);
if (value != 0x45UL)
return FAILED ("Expected value of 0x45, but was %x", value);
value = g_utf8_get_char (&word1 [3]);
if (value != 0x1043UL)
return FAILED ("Expected value of 0x1043, but was %x", value);
value = g_utf8_get_char (&word1 [6]);
if (value != 0x58UL)
return FAILED ("Expected value of 0x58, but was %x", value);
value = g_utf8_get_char (&word1 [7]);
if (value != 0x42082UL)
return FAILED ("Expected value of 0x42082, but was %x", value);
return OK;
}
RESULT
test_utf8_next_char()
{
gchar word1 [] = {0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,0xF1, 0x82, 0x82, 0x82,'\0'}; //Valid, len = 5
gchar word2 [] = {0xF1, 0x82, 0x82, 0x82,0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,'\0'}; //Valid, len = 5
gchar word1ExpectedValues [] = {0xC2, 0x45,0xE1, 0x58, 0xF1};
gchar word2ExpectedValues [] = {0xF1, 0xC2, 0x45, 0xE1, 0x58};
gchar* ptr = word1;
gint count = 0;
//Test word1
while (*ptr != 0) {
if (count > 4)
return FAILED ("Word1 has gone past its expected length");
if (*ptr != word1ExpectedValues[count])
return FAILED ("Word1 has an incorrect next_char at index %i", count);
ptr = g_utf8_next_char (ptr);
count++;
}
//Test word2
count = 0;
ptr = word2;
while (*ptr != 0) {
if (count > 4)
return FAILED ("Word2 has gone past its expected length");
if (*ptr != word2ExpectedValues[count])
return FAILED ("Word2 has an incorrect next_char at index %i", count);
ptr = g_utf8_next_char (ptr);
count++;
}
return OK;
}
RESULT
test_utf8_validate()
{
gchar invalidWord1 [] = {0xC3, 0x82, 0xC1,0x90,'\0'}; //Invalid, 1nd oct Can't be 0xC0 or 0xC1
gchar invalidWord2 [] = {0xC1, 0x89, 0x60, '\0'}; //Invalid, 1st oct can not be 0xC1
gchar invalidWord3 [] = {0xC2, 0x45,0xE1, 0x81, 0x83,0x58,'\0'}; //Invalid, oct after 0xC2 must be > 0x80
gchar validWord1 [] = {0xC2, 0x82, 0xC3,0xA0,'\0'}; //Valid
gchar validWord2 [] = {0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,0xF1, 0x82, 0x82, 0x82,'\0'}; //Valid
const gchar* end;
gboolean retVal = g_utf8_validate (invalidWord1, -1, &end);
if (retVal != FALSE)
return FAILED ("Expected invalidWord1 to be invalid");
if (end != &invalidWord1 [2])
return FAILED ("Expected end parameter to be pointing to invalidWord1[2]");
end = NULL;
retVal = g_utf8_validate (invalidWord2, -1, &end);
if (retVal != FALSE)
return FAILED ("Expected invalidWord2 to be invalid");
if (end != &invalidWord2 [0])
return FAILED ("Expected end parameter to be pointing to invalidWord2[0]");
end = NULL;
retVal = g_utf8_validate (invalidWord3, -1, &end);
if (retVal != FALSE)
return FAILED ("Expected invalidWord3 to be invalid");
if (end != &invalidWord3 [0])
return FAILED ("Expected end parameter to be pointing to invalidWord3[1]");
end = NULL;
retVal = g_utf8_validate (validWord1, -1, &end);
if (retVal != TRUE)
return FAILED ("Expected validWord1 to be valid");
if (end != &validWord1 [4])
return FAILED ("Expected end parameter to be pointing to validWord1[4]");
end = NULL;
retVal = g_utf8_validate (validWord2, -1, &end);
if (retVal != TRUE)
return FAILED ("Expected validWord2 to be valid");
if (end != &validWord2 [11])
return FAILED ("Expected end parameter to be pointing to validWord2[11]");
return OK;
}
glong
utf8_byteslen (const gchar *src)
{
int i = 0;
do {
if (src [i] == '\0')
return i;
i++;
} while (TRUE);
}
RESULT
test_utf8_strcase_each (const gchar *src, const gchar *expected, gboolean strup)
{
gchar *tmp;
glong len, len2;
RESULT r;
len = utf8_byteslen (src);
tmp = strup ? g_utf8_strup (src, len) : g_utf8_strdown (src, len);
len2 = utf8_byteslen (tmp);
r = compare_strings_utf8_RESULT (expected, tmp, len < len2 ? len2 : len);
g_free (tmp);
return r;
}
RESULT
test_utf8_strup_each (const gchar *src, const gchar *expected)
{
return test_utf8_strcase_each (src, expected, TRUE);
}
RESULT
test_utf8_strdown_each (const gchar *src, const gchar *expected)
{
return test_utf8_strcase_each (src, expected, FALSE);
}
/*
* g_utf8_strup
*/
RESULT
test_utf8_strup ()
{
RESULT r;
if ((r = test_utf8_strup_each ("aBc", "ABC")) != OK)
return r;
if ((r = test_utf8_strup_each ("x86-64", "X86-64")) != OK)
return r;
// U+3B1 U+392 -> U+391 U+392
if ((r = test_utf8_strup_each ("\xCE\xB1\xCE\x92", "\xCE\x91\xCE\x92")) != OK)
return r;
// U+FF21 -> U+FF21
if ((r = test_utf8_strup_each ("\xEF\xBC\xA1", "\xEF\xBC\xA1")) != OK)
return r;
// U+FF41 -> U+FF21
if ((r = test_utf8_strup_each ("\xEF\xBD\x81", "\xEF\xBC\xA1")) != OK)
return r;
// U+10428 -> U+10400
if ((r = test_utf8_strup_each ("\xF0\x90\x90\xA8", "\xF0\x90\x90\x80")) != OK)
return r;
return OK;
}
/*
* g_utf8_strdown
*/
RESULT
test_utf8_strdown ()
{
RESULT r;
if ((r = test_utf8_strdown_each ("aBc", "abc")) != OK)
return r;
if ((r = test_utf8_strdown_each ("X86-64", "x86-64")) != OK)
return r;
// U+391 U+3B2 -> U+3B1 U+3B2
if ((r = test_utf8_strdown_each ("\xCE\x91\xCE\xB2", "\xCE\xB1\xCE\xB2")) != OK)
return r;
/*
// U+FF41 -> U+FF41
if ((r = test_utf8_strdown_each ("\xEF\xBC\x81", "\xEF\xBC\x81")) != OK)
return r;
// U+FF21 -> U+FF41
if ((r = test_utf8_strdown_each ("\xEF\xBC\xA1", "\xEF\xBD\x81")) != OK)
return r;
// U+10400 -> U+10428
if ((r = test_utf8_strdown_each ("\xF0\x90\x90\x80", "\xF0\x90\x90\xA8")) != OK)
return r;
*/
return OK;
}
@@ -777,12 +496,6 @@ static Test utf8_tests [] = {
{"g_unichar_xdigit_value", test_xdigit },
{"g_ucs4_to_utf16", test_ucs4_to_utf16 },
{"g_utf16_to_ucs4", test_utf16_to_ucs4 },
{"g_utf8_strlen", test_utf8_strlen },
{"g_utf8_get_char", test_utf8_get_char },
{"g_utf8_next_char", test_utf8_next_char },
{"g_utf8_validate", test_utf8_validate },
{"g_utf8_strup", test_utf8_strup},
{"g_utf8_strdown", test_utf8_strdown},
{NULL, NULL}
};
-2
View File
@@ -72,5 +72,3 @@
/* Version number of package */
#define VERSION "0.1"
#define HAVE_STRTOK_R 1
+1 -1
View File
@@ -28,7 +28,7 @@
#include <malloc.h>
#define ALLOCA _alloca
#else
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#if defined(__FreeBSD__) || defined(__NetBSD__)
#include <stdlib.h>
#else
#include <alloca.h>
+2 -24
View File
@@ -1,14 +1,3 @@
2009-01-18 Zoltan Varga <[email protected]>
* include/private/gcconfig.h: Applied patch from Koushik Dutta
([email protected]). Define SEARCH_FOR_DATA_START for android.
2008-11-18 Mark Probst <[email protected]>
* include/private/gc_locks.h (test_and_set): The PPC64 case is
wrong, as it operates on 64 bit values, not on 32 bit ones as the
function requires. The PPC32 case is sufficient.
2008-09-29 Geoff Norton <[email protected]>
* include/private/gcconfig.h: Make Darwin/ARM use mmap() instead of
@@ -25,17 +14,6 @@
GC_setspecific define. Unfold the define into a static inline on all platforms
except ppc where it is a static leaf function.
2008-08-10 Zoltan Varga <[email protected]>
* include/private/gc_locks.h: Add amd64 support so parallel mark works on
amd64 too.
2008-08-05 Andreas Färber <[email protected]>
* autogen.sh: Suppress arguments warning for NOCONFIGURE.
Contributed under MIT/X11 license.
2008-08-03 Zoltan Varga <[email protected]>
* pthread_support.c (GC_thread_exit_proc): Null out the tls key to prevent the
@@ -54,8 +32,8 @@
* include/gc.h: Add GC_DllMain.
* win32_threads.c: Rename DllMain to GC_DllMain.
Contributed under MIT/X11 license.
Contributed under MIT/X11 license.
2008-04-15 Jonathan Chambers <[email protected]>
* include/private/gcconfig.h: Backport GC7 code to support Win64.
+1 -1
View File
@@ -67,7 +67,7 @@ if test "$DIE" -eq 1; then
exit 1
fi
if test x$NOCONFIGURE = x && test -z "$*"; then
if test -z "$*"; then
echo "**Warning**: I am going to run \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \`$0\'" command line."
+22 -2
View File
@@ -112,9 +112,29 @@ case "$THREADS" in
AC_DEFINE(THREAD_LOCAL_ALLOC)
THREADDLLIBS="-lpthread -lrt"
;;
*-*-freebsd*)
*-*-freebsd4*)
AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
AC_DEFINE(GC_FREEBSD_THREADS)
if test "x$PTHREAD_CFLAGS" != "x"; then
if test "x$PTHREAD_CFLAGS" = "x"; then
INCLUDES="$INCLUDES -pthread"
else
INCLUDES="$INCLUDES $PTHREAD_CFLAGS"
fi
if test "x$PTHREAD_LIBS" = "x"; then
THREADDLLIBS=-pthread
else
THREADDLLIBS=$PTHREAD_LIBS
fi
;;
*-*-freebsd5*)
AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
AC_DEFINE(GC_FREEBSD_THREADS)
INCLUDES="$INCLUDES -pthread"
THREADDLLIBS=-pthread
;;
*-*-freebsd6*)
AC_DEFINE(GC_FREEBSD_THREADS)
if test "x$PTHREAD_CFLAGS" != "x"; then
INCLUDES="$INCLUDES $PTHREAD_CFLAGS"
fi
if test "x$PTHREAD_LIBS" = "x"; then
+20 -23
View File
@@ -155,6 +155,25 @@
# define GC_TEST_AND_SET_DEFINED
# endif
# if defined(POWERPC)
# if CPP_WORDSZ == 64
inline static int GC_test_and_set(volatile unsigned int *addr) {
unsigned long oldval;
unsigned long temp = 1; /* locked value */
__asm__ __volatile__(
"1:\tldarx %0,0,%3\n" /* load and reserve */
"\tcmpdi %0, 0\n" /* if load is */
"\tbne 2f\n" /* non-zero, return already set */
"\tstdcx. %2,0,%1\n" /* else store conditional */
"\tbne- 1b\n" /* retry if lost reservation */
"\tsync\n" /* import barrier */
"2:\t\n" /* oldval is zero if we set */
: "=&r"(oldval), "=p"(addr)
: "r"(temp), "1"(addr)
: "cr0","memory");
return (int)oldval;
}
# else
inline static int GC_test_and_set(volatile unsigned int *addr) {
int oldval;
int temp = 1; /* locked value */
@@ -172,6 +191,7 @@
: "cr0","memory");
return oldval;
}
# endif
# define GC_TEST_AND_SET_DEFINED
inline static void GC_clear(volatile unsigned int *addr) {
__asm__ __volatile__("lwsync" : : : "memory");
@@ -417,29 +437,6 @@
}
# endif /* I386 */
# if defined(X86_64)
# if !defined(GENERIC_COMPARE_AND_SWAP)
/* Returns TRUE if the comparison succeeded. */
inline static GC_bool GC_compare_and_exchange(volatile GC_word *addr,
GC_word old,
GC_word new_val)
{
char result;
__asm__ __volatile__("lock; cmpxchgq %2, %0; setz %1"
: "+m"(*(addr)), "=r"(result)
: "r" (new_val), "a"(old) : "memory");
return (GC_bool) result;
}
# endif /* !GENERIC_COMPARE_AND_SWAP */
inline static void GC_memory_barrier()
{
/* We believe the processor ensures at least processor */
/* consistent ordering. Thus a compiler barrier */
/* should suffice. */
__asm__ __volatile__("" : : : "memory");
}
# endif /* X86_64 */
# if defined(POWERPC)
# if !defined(GENERIC_COMPARE_AND_SWAP)
# if CPP_WORDSZ == 64
-2
View File
@@ -1868,8 +1868,6 @@
# include <features.h>
# if defined(__GLIBC__) && __GLIBC__ >= 2
# define SEARCH_FOR_DATA_START
# elif defined(PLATFORM_ANDROID)
# define SEARCH_FOR_DATA_START
# else
extern char **__environ;
# define DATASTART ((ptr_t)(&__environ))
+1 -61
View File
@@ -1,75 +1,15 @@
2008-12-31 Massimiliano Mantione <[email protected]>
* mono.1: Updated the profiler documentation, removing the "ts"
option (it does not exist anymore) and explaining the defaults for
allocation and heap profiling.
2008-12-12 Rolf Bjarne Kvinge <[email protected]>
* Makefile.am, vbnc.1: Remove vbnc.1. It's living in the
mono-basic module now.
2008-11-20 Rodrigo Kumpera <[email protected]>
* mono.1: Document env vars MONO_XDEBUG and MONO_VERBOSE_METHOD.
2008-10-18 Jonathan Pryor <[email protected]>
* Makefile.am (man_MANS): Remove unpackaged files.
2008-10-18 Jonathan Pryor <[email protected]>
* mdvalidator.1: Rename to mdvalidater.1.
* Makefile.am (man_MANS): Rename to mdvalidator.1 to mdvalidater.1.
2008-10-18 Jonathan Pryor <[email protected]>
* Makefile.am (man_MANS): Add mdoc.5 and mono-config.5.
2008-10-18 Mark Probst <[email protected]>
* mono.1: Documentation for "--no-x86-stack-align" option.
2008-10-17 Jonathan Pryor <[email protected]>
* Makefile: Add man pages added from monodoc/man...
2008-10-12 Atsushi Enomoto <[email protected]>
* mono.1 : svn.myrealbox -> anonsvn.mono-project .
2008-10-10 Massimiliano Mantione <[email protected]>
* mono.1: Document the new "sas" option.
2008-09-11 Daniel Morgan <[email protected]>
* sqlsharp.1: added commands
\bcs, \cs, \listproviders, \p
2008-08-27 Zoltan Varga <[email protected]>
* mono-config.5: Fix a typo.
2008-08-22 Massimiliano Mantione <[email protected]>
* mono.1: Restore original nonvisible formatting (' ', '\-', and '"'
were added everywhere by mistake in r109428).
2008-08-21 Massimiliano Mantione <[email protected]>
* mono.1: Updated description of the logging profiler.
* mono.1: Updated description of the logging profiler from trunk.
2008-08-08 Zoltan Varga <[email protected]>
* mono.1: Remove no-dlsym aot option for now.
* mono.1: Document the 'static' aot option.
2008-08-01 Massimiliano Mantione <[email protected]>
* mono.1: Updated description of the logging profiler.
2008-04-22 Robert Jordan <[email protected]>
* mono.1: Document MONO_DEBUG=no-gdb-backtrace.
+5 -52
View File
@@ -1,54 +1,7 @@
man_MANS = \
al.1 \
cert2spc.1 \
certmgr.1 \
chktrust.1 \
cilc.1 \
csharp.1 \
disco.1 \
dtd2xsd.1 \
gacutil.1 \
genxs.1 \
httpcfg.1 \
ilasm.1 \
macpack.1 \
makecert.1 \
mconfig.1 \
mcs.1 \
mdassembler.1 \
mdoc.1 \
mdoc.5 \
mdoc-assemble.1 \
mdoc-export-html.1 \
mdoc-export-msxdoc.1 \
mdoc-update.1 \
mdoc-validate.1 \
mdvalidater.1 \
mkbundle.1 \
mono.1 \
mono-cil-strip.1 \
mono-config.5 \
monodocer.1 \
monodocs2html.1 \
monolinker.1 \
monop.1 \
mono-service.1 \
mono-shlib-cop.1 \
monostyle.1 \
mono-xmltool.1 \
mozroots.1 \
oldmono.1 \
permview.1 \
prj2make.1 \
resgen.1 \
secutil.1 \
setreg.1 \
sgen.1 \
signcode.1 \
sn.1 \
soapsuds.1 \
sqlsharp.1 \
wsdl.1 \
xsd.1
man_MANS = mcs.1 mono.1 monostyle.1 mono-config.5 sqlsharp.1 oldmono.1 ilasm.1 \
cert2spc.1 cilc.1 genxs.1 wsdl.1 disco.1 soapsuds.1 makecert.1 \
chktrust.1 setreg.1 sn.1 secutil.1 signcode.1 certmgr.1 monop.1 xsd.1 gacutil.1 \
macpack.1 mkbundle.1 dtd2xsd.1 permview.1 prj2make.1 mono-service.1 mono-shlib-cop.1 \
al.1 mozroots.1 mono-xmltool.1 sgen.1 httpcfg.1 vbnc.1 resgen.1 monolinker.1 mconfig.1
EXTRA_DIST = $(man_MANS)
-354
View File
@@ -1,354 +0,0 @@
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.TH csharp 1 "4 September 2008"
.SH NAME
csharp, gsharp \- Interactive C# Shell
.SH SYNOPSIS
.B csharp [--attach PID]
[options]
.P
.B gsharp [file1 [file2]]
.SH DESCRIPTION
The
.I csharp
is an interactive C# shell that allows the user to enter and evaluate
C# statements and expressions from the command line. The regular
.I mcs
command line options can be used in this version of the compiler.
.PP
The
.I gsharp
command is a GUI version of the C# interpreter that uses Gtk# and
provides an area to attach widgets as well. This version can be
attached to other Gtk# applications in a safe way as it injects itself
into the main loop of a Gtk# application, avoiding any problems
arising from the multi-threaded nature of injecting itself into a
target process.
.PP
This version allows a number of scripts to be specified in the command
line.
.SH OPTIONS
.TP
.I "\-\-attach"
This is an advanced option and should only be used if you have a deep
understanding of multi-threading. This option is availble on the
.I csharp
command and allows the compiler to be injected into other processes.
This is done by injecting the C# shell in a separate thread that runs
concurrently with your application. This means that you must take
special measures to avoid crashing the target application while using
it. For example, you might have to take the proper locks before
issuing any commands that might affect the target process state, or
sending commands through a method dispatcher.
.SH OPERATION
Once you launch the csharp command, you will be greeted with the
interactive prompt:
.PP
.nf
$ csharp
Mono C# Shell, type "help;" for help
Enter statements below.
csharp>
.fi
.PP
A number of namespaces are pre-defined with C# these include System,
System.Linq, System.Collections and System.Collections.Generic.
Unlike the compiled mode, it is possible to add new using statements
as you type code, for example:
.PP
.nf
csharp> new XmlDocument ();
<interactive>(1,6): error CS0246: The type or namespace name `XmlDocument' could not be found. Are you missing a using directive or an assembly reference?
csharp> using System.Xml;
csharp> new XmlDocument ();
System.Xml.XmlDocument
.fi
.PP
Every time a command is typed, the scope of that command is one of a
class that derives from the class Mono.CSharp.InteractiveBase. This
class defines a number of static properties and methods. To display
a list of available commands access the `help' property:
.nf
csharp> help;
"Static methods:
LoadPackage (pkg); - Loads the given Package (like -pkg:FILE)
[...]
ShowVars (); - Shows defined local variables.
ShowUsing (); - Show active using decltions.
help;
"
csharp>
.fi
.PP
When expressions are entered, the C# shell will display the result of
executing the expression:
.PP
.nf
csharp> Math.Sin (Math.PI/4);
0.707106781186547
csharp> 1+1;
2
csharp> "Hello, world".IndexOf (',');
5
.fi
.PP
The C# shell uses the ToString() method on the returned object to
display the object, this sometimes can be limiting since objects that
do not override the ToString() method will get the default behavior
from System.Object which is merely to display their type name:
.PP
.nf
csharp> var a = new XmlDocument ();
csharp> a;
System.Xml.Document
csharp> csharp> a.Name;
"#document"
csharp>
.fi
.PP
A few datatypes are handled specially by the C# interactive shell like
arrays, System.Collections.Hashtable, objects that implement
System.Collections.IEnumerable and IDictionary and are rendered
specially instead of just using ToString ():
.PP
.nf
csharp> var pages = new Hashtable () {
> { "Mono", "http://www.mono-project.com/" },
> { "Linux", "http://kernel.org" } };
csharp> pages;
{{ "Mono", "http://www.mono-project.com/" }, { "Linux", "http://kernel.org" }}
.fi
.PP
It is possible to use LINQ directly in the C# interactive shell since
the System.Linq namespace has been imported at startup. The
following sample gets a list of all the files that have not been
accessed in a week from /tmp:
.PP
.nf
csharp> using System.IO;
csharp> var last_week = DateTime.Now - TimeSpan.FromDays (7);
csharp> var old_files = from f in Directory.GetFiles ("/tmp")
> let fi = new FileInfo (f)
> where fi.LastAccessTime < LastWeek select f;
csharp>
.fi
.PP
You can of course print the results in a single statement as well:
.PP
.nf
csharp> using System.IO;
csharp> var last_week = DateTime.Now - TimeSpan.FromDays (7);
csharp> from f in Directory.GetFiles ("/tmp")
> let fi = new FileInfo (f)
> where fi.LastAccessTime < last_week select f;
[...]
csharp>
.fi
.PP
LINQ and its functional foundation produce on-demand code for
IEnumerable return values. For instance, the return value from a
using `from' is an IEnumerable that is evaluated on demand. The
automatic rendering of IEnumerables on the command line will trigger
the IEnumerable pipeline to execute at that point instead of having
its execution delayed until a later point.
.PP
If you want to avoid having the IEnumerable rendered at this point,
simply assign the value to a variable.
.PP
Unlike compiled C#, the type of a variable can be changed if a new
declaration is entered, for example:
.PP
.nf
csharp> var a = 1;
csharp> a.GetType ();
System.Int32
csharp> var a = "Hello";
csharp> a.GetType ();
System.String
csharp> ShowVars ();
string a = "Hello"
.fi
.PP
In the case that an expression or a statement is not completed in a
single line, a continuation prompt is displayed, for example:
.PP
.nf
csharp> var protocols = new string [] {
> "ftp",
> "http",
> "gopher"
> };
csharp> protocols;
{ "ftp", "http", "gopher" }
.fi
.PP
Long running computations can be interrupted by using the Control-C
sequence:
.PP
.nf
csharp> var done = false;
csharp> while (!done) { }
Interrupted!
System.Threading.ThreadAbortException: Thread was being aborted
at Class1.Host (System.Object& $retval) [0x00000]
at Mono.CSharp.InteractiveShell.ExecuteBlock (Mono.CSharp.Class host, Mono.CSharp.Undo undo) [0x00000]
csharp>
.fi
.PP
.SH INTERACTIVE EDITING
The C# interactive shell contains a line-editor that provides a more
advanced command line editing functionality than the operating system
provides. These are available in the command line version, the GUI
versions uses the standard Gtk# key bindings.
.PP
The command set is similar to many other applications (cursor keys)
and incorporates some of the Emacs commands for editing as well as a
history mechanism to
.PP
.PP
The following keyboard input is supported:
.TP
.I Home Key, Control-a
Goes to the beginning of the line.
.TP
.I End Key, Control-e
Goes to the end of the line.
.TP
.I Left Arrow Key, Control-b
Moves the cursor back one character.
.TP
.I Right Arrow Key, Control-f
Moves the cursor forward one character.
.TP
.I Up Arrow Key, Control-p
Goes back in the history, replaces the current line with the previous
line in the history.
.TP
.I Down Arrow Key, Control-n
Moves forward in the history, replaces the current line with the next
lien in the history.
.TP
.I Return
Executes the current line if the statement or expression is complete,
or waits for further input.
.TP
.I Control-C
Cancel the current line being edited. This will kill any currently
in-progress edits or partial editing and go back to a toplevel
definition.
.TP
.I Backspace Key
Deletes the character before the cursor
.TP
.I Delete Key, Control-d
Deletes the character at the current cursor position.
.TP
.I Control-k
Erases the contents of the line until the end of the line and places
the result in the cut and paste buffer.
.TP
.I Alt-D
Deletes the word starting at the cursor position and appends into the
cut and paste buffer. By pressing Alt-d repeatedly, multiple words
can be appended into the paste buffer.
.TP
.I Control-Y
Pastes the content of the kill buffer at the current cursor position.
.TP
.I Control-Q
This is the quote character. It allows the user to enter
control-characters that are otherwise taken by the command editing
facility. Press Control-Q followed by the character you want to
insert, and it will be inserted verbatim into the command line.
.TP
.I Control-D
Terminates the program. This terminates the input for the program.
.SH STATIC PROPERTIES AND METHODS
Since the methods and properties of the base class from where the
statements and expressions are executed are static, they can be
invoked directly from the shell. These are the available properties
and methods:
.TP
.I void LoadAssembly(string assembly)
Loads the given assembly. This is equivalent to passing the compiler
the -r: flag with the specified string.
.TP
.I void LoadPackage(string package)
Imports the package specified. This is equivalent to invoking the
compiler with the -pkg: flag with the specified string.
.TP
.I string Prompt { get; set }
The prompt used by the shell. It defaults to the value "csharp> ".
.I string ContinuationPrompt { get; set; }
The prompt used by the shell when further input is required to
complete the expression or statement.
.TP
.I void ShowVars()
Displays all the variables that have been defined so far and their
types. In the csharp shell declaring new variables will shadow
previous variable declarations, this is different than C# when
compiled.
.I void ShowUsing()
Displays all the using statements in effect.
.I TimeSpan Time (Action a)
Handy routine to time the time that some code takes to execute. The
parameter is an Action delegate, and the return value is a TimeSpan.
For example:
.PP
.nf
csharp> Time (() => { for (int i = 0; i < 5; i++) Console.WriteLine (i);});
0
1
2
3
4
00:00:00.0043230
csharp>
.fi
.PP
The return value is a TimeSpan, that you can store in a variable for
benchmarking purposes.
.SH GUI METHODS AND PROPERTIES
In addition to the methods and properties available in the console
version there are a handful of extra properties available on the GUI
version. For example a "PaneContainer" Gtk.Container is exposed that
you can use to host Gtk# widgets while prototyping or the "MainWindow"
property that gives you access to the current toplevel window.
.SH STARTUP FILES
The C# shell will load all the Mono assemblies and C# script files
located in the ~/.config/csharp directory on Unix. The assemblies are
loaded before the source files are loaded.
.PP
C# script files are files
that have the extension .cs and they should only contain statements
and expressions, they can not contain full class definitions (at least
not as of Mono 2.0). Full class definitions should be compiled into
dlls and stored in that directory.
.SH AUTHORS
The Mono C# Compiler was written by Miguel de Icaza, Ravi Pratap,
Martin Baulig, Marek Safar and Raja Harinath. The development was
funded by Ximian, Novell and Marek Safar.
.SH LICENSE
The Mono Compiler Suite is released under the terms of the GNU GPL or
the MIT X11. Please read the accompanying `COPYING' file for details.
Alternative licensing for the compiler is available from Novell.
.SH SEE ALSO
gmcs(1), mcs(1), mdb(1), mono(1), pkg-config(1)
.SH BUGS
To report bugs in the compiler, you must file them on our bug tracking
system, at:
http://www.mono-project.com/Bugs
.SH MAILING LIST
The Mono Mailing lists are listed at http://www.mono-project.com/Mailing_Lists
.SH MORE INFORMATION
The Mono C# compiler was developed by Novell, Inc
(http://www.novell.com, http) and is based on the
ECMA C# language standard available here:
http://www.ecma.ch/ecma1/STAND/ecma-334.htm
.PP
The home page for the Mono C# compiler is at
http://www.mono-project.com/CSharp_Compiler information about the
interactive mode for C# is available in http://mono-project.com/CsharpRepl
+23 -20
View File
@@ -18,13 +18,12 @@ prepending the @ symbol to the response file name.
The
.I mcs
compiler is used to compile against the 1.x profile and implements
C# 1.0 and parts of C# 2.0 and C# 3.0 specification which do not depend
on generics.
C# 1.0 and 2.0 with the exception of generics and nullable types.
.PP
The
.I gmcs
compiler is used to compile against the 2.0 profile and implements
the complete C# 3.0 specification.
the complete C# 2.0 specification including generics.
.PP
The
.I smcs
@@ -33,7 +32,8 @@ This profile is designed to be used for creating Silverlight/Moonlight
applications that will run on a web browser. The API exposed by this
profile is a small subset of the 3.5 API (even if it is commonly
referred as the 2.1 API, this API is a small subset of 2.0 with a few
extensions).
extensions), in addition this profile by default runs with
-langversion:linq which turns on the C# 3.0 language by default.
.PP
See the section on packages for more information.
.PP
@@ -108,7 +108,7 @@ SYMBOL. This can be tested in the source code by the pre-processor,
or can be used by methods that have been tagged with the Conditional
attribute.
.TP
.I \-debug, \-debug+
.I \-debug, \-debug+, \-g
Generate debugging information. To obtain stack traces with debugging
information, you need to invoke the mono runtime with the `--debug'
flag. This debugging information is stored inside the assembly as a
@@ -136,6 +136,10 @@ precedence over the attributes.
Extracts the C#/XML documentation from the source code and stores in in
the given FILE.
.TP
.I \-\-expect-error X L
The compiler will expect the code to generate an error
named `X' in line `L'. This is only used by the test suite.
.TP
.I \-\-fatal
This is used for debugging the compiler. This makes the error emission
generate an exception that can be caught by a debugger.
@@ -165,7 +169,7 @@ The possible values are:
.TP
.I "Default"
Instruct compiler to use the latest version. Equivalent is to omit the
switch (this currently defaults to the C# 3.0 language specification).
switch (this currently defaults to the C# 2.0 language specification).
.TP
.I "ISO-1"
Restrict compiler to use only first ISO standardized features.
@@ -176,6 +180,11 @@ methods will lead to error.
Restrict compiler to use only the second ISO standardized features.
This allows the use of generics, static classes, iterators and
anonymous methods for example.
.TP
.I "linq"
This enables the C# 3.0 support. Only a few features of C# 3.0 have
been implemented in the Mono C# compiler, so not everything is
available.
.PP
Notice that this flag only controls the language features available to
the programmer, it does not control the kind of assemblies produced.
@@ -330,12 +339,6 @@ shell will perform globbing, so you might want to use it like this:
$ mcs -recurse:'*.cs'
.fi
.TP
.I \-\-shell
Starts up the compiler in interactive mode, providing a C# shell for
statements and expressions. A shortcut is to use the
.I csharp
command directly.
.TP
.I \-\-stacktrace
Generates a stack trace at the time the error is reported, useful for
debugging the compiler.
@@ -355,18 +358,18 @@ Enables compilation of unsafe code.
.I \-v
Debugging. Turns on verbose yacc parsing.
.TP
.I \-v2
Turns on C# 2.0 language features.
.TP
.I \-\-version
Shows the compiler version.
.TP
.I \-warnaserror, \-warnaserror+
Treat warnings as errors.
.TP
.I \-warnaserror:W1,[Wn]
Treats one or more compiler warnings as errors.
.TP
.I \-warn:LEVEL
Sets the warning level. 0 is the lowest warning level, and 4 is the
highest. The default is 4.
highest. The default is 2.
.TP
.I \-win32res:FILE
Specifies a Win32 resource file (.res) to be bundled into the
@@ -502,12 +505,12 @@ Martin Baulig, Marek Safar and Raja Harinath. The development was
funded by Ximian, Novell and Marek Safar.
.PP
.SH LICENSE
The Mono Compiler Suite is released under the terms of the GNU GPL or
the MIT X11. Please read the accompanying `COPYING' file for details.
Alternative licensing for the compiler is available from Novell.
The Mono Compiler Suite is released under the terms of the GNU GPL.
Please read the accompanying `COPYING' file for details. Alternative
licensing for the compiler is available from Novell.
.PP
.SH SEE ALSO
csharp(1), mdb(1), mono(1), mopen(1), mint(1), pkg-config(1),sn(1)
mdb(1), mono(1), mopen(1), mint(1), sn(1)
.PP
.SH BUGS
To report bugs in the compiler, you must file them on our bug tracking
Loaded 100 of 15420 files, more files were not shown because too many files have changed in this diff. Show more