[Mono-list] patches

Sean MacIsaac macisaac@ximian.com
11 Nov 2001 16:32:13 -0500


--=-CRIr8wg7hU4OjBpvGMSy
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

I worked some things out with Paolo and the attached diffs are what I
commited.

The only big change was that I'm using C structs that match the C#
objects instead of dynamically getting the offsets of the C# fields.

Sean

--=-CRIr8wg7hU4OjBpvGMSy
Content-Disposition: attachment; filename=mcs.diff
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=ISO-8859-1

Index: class/corlib/corlib.build
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mcs/class/corlib/corlib.build,v
retrieving revision 1.8
diff -u -r1.8 corlib.build
--- class/corlib/corlib.build	2001/11/08 06:14:03	1.8
+++ class/corlib/corlib.build	2001/11/11 15:51:04
@@ -74,6 +74,7 @@
 				<excludes name=3D"System/Object.cs"/>
 				<excludes name=3D"System/ValueType.cs"/>
 				<excludes name=3D"System/Type.cs"/>
+				<excludes name=3D"System/MonoType.cs"/>
 				<excludes name=3D"System/Array.cs"/>
 				<excludes name=3D"System/String.cs"/>
 				<excludes name=3D"System/Console.cs"/>
Index: class/corlib/Linux/Linux.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mcs/class/corlib/Linux/Linux.cs,v
retrieving revision 1.4
diff -u -r1.4 Linux.cs
--- class/corlib/Linux/Linux.cs	2001/10/17 17:36:03	1.4
+++ class/corlib/Linux/Linux.cs	2001/11/11 15:51:04
@@ -22,6 +22,7 @@
 using System.Text;=0D
 using System.IO;=0D
 using System.Collections;=0D
+using System.Reflection;
=20=0D
 namespace System.PAL=0D
 {=0D
@@ -283,12 +284,9 @@
 			return new DateTime(0);=0D
 		}=0D
=20=0D
-		public string GetCurrentDirectory()=0D
-		{=0D
-			System.Diagnostics.Debug.WriteLine("Linux:GetCurrentDirectory(): Stub M=
ethod");=0D
-			return null;=0D
-		}=0D
-=0D
+		[System.Runtime.CompilerServices.MethodImplAttribute(System.Runtime.Comp=
ilerServices.MethodImplOptions.InternalCall)]
+		public extern string GetCurrentDirectory();
+
 		public string[]	GetDirectories(string path, string searchPattern)=0D
 		{=0D
 			System.Diagnostics.Debug.WriteLine("Linux:GetDirectories(System.String,=
System.String): Stub Method");=0D
@@ -602,7 +600,5 @@
=20
 		[ DllImport("libm", EntryPoint=3D"tanh") ]
 		public extern static double Tanh(double d);
-
-
 	}=0D
 }=0D
Index: class/corlib/System/AttributeUsage.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mcs/class/corlib/System/AttributeUsage.cs,v
retrieving revision 1.1
diff -u -r1.1 AttributeUsage.cs
--- class/corlib/System/AttributeUsage.cs	2001/09/29 16:57:38	1.1
+++ class/corlib/System/AttributeUsage.cs	2001/11/11 15:51:04
@@ -10,11 +10,11 @@
 namespace System {=0D
=20=0D
 	[AttributeUsage(AttributeTargets.All)]=0D
-	public class AttributeUsage : Attribute {=0D
+	public class AttributeUsageAttribute : Attribute {=0D
 		AttributeTargets valid_on;=0D
 		bool allow_multiple, inherited;=0D
 	=09=0D
-		public AttributeUsage (AttributeTargets validOn)=0D
+		public AttributeUsageAttribute (AttributeTargets validOn)=0D
 		{=0D
 			valid_on =3D validOn;=0D
 		}=0D
Index: class/corlib/System/CLSCompliantAttribute.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mcs/class/corlib/System/CLSCompliantAttribute.cs,v
retrieving revision 1.1
diff -u -r1.1 CLSCompliantAttribute.cs
--- class/corlib/System/CLSCompliantAttribute.cs	2001/08/19 22:59:11	1.1
+++ class/corlib/System/CLSCompliantAttribute.cs	2001/11/11 15:51:04
@@ -15,11 +15,12 @@
 	///
 	/// <remarks>
 	/// </remarks>
-	public class CLSCompliant : Attribute {
+	[AttributeUsage(AttributeTargets.All)]
+	public class CLSCompliant: Attribute {
=20
 		bool is_compliant;
=20
-		public CLSCompliant (bool is_compliant)
+		public CLSCompliant(bool is_compliant)
 		{
 			this.is_compliant =3D is_compliant;
 		}
Index: class/corlib/System/ChangeLog
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mcs/class/corlib/System/ChangeLog,v
retrieving revision 1.72
diff -u -r1.72 ChangeLog
--- class/corlib/System/ChangeLog	2001/11/06 06:50:13	1.72
+++ class/corlib/System/ChangeLog	2001/11/11 15:51:04
@@ -1,3 +1,19 @@
+2001-11-10  Sean MacIsaac  <macisaac@ximian.com>
+
+	* AttributeUseage.cs: Should define AttributeUsageAttribute.
+
+	* CLSCompliant.cs: Marked with AttributeUsage attribute.
+
+	* Decimal.cs: Fixed CLSCompliant attributes.
+
+	* Type.cs: changed _impl to internal (needs to be accessable by
+	subclasses).
+
+	(TypeHandle): Marked as abstract, implementation removed.
+
+	(IsNotPublic, IsPublic, GetMethods, GetPropery, GetConstructor,
+	GetMethod): Added stub implementations so NUnit would link against
+	corlib
=20
 Tue Nov 6 09:11:43 CET 2001 Paolo Molaro <lupus@ximian.com>
=20
Index: class/corlib/System/Decimal.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mcs/class/corlib/System/Decimal.cs,v
retrieving revision 1.2
diff -u -r1.2 Decimal.cs
--- class/corlib/System/Decimal.cs	2001/10/20 17:00:59	1.2
+++ class/corlib/System/Decimal.cs	2001/11/11 15:51:05
@@ -92,7 +92,7 @@
             }=0D
         }=0D
=20=0D
-        [CLSCompliantAttribute(false)]=0D
+        [CLSCompliant(false)]=0D
         public Decimal(uint val)=20=0D
         {=0D
             lo32 =3D val;=0D
@@ -121,7 +121,7 @@
             }=0D
         }=0D
=20=0D
-        [CLSCompliantAttribute(false)]=0D
+        [CLSCompliant(false)]=0D
         public Decimal(ulong uval)=20=0D
         {=0D
             unchecked=20=0D
Index: class/corlib/System/RuntimeTypeHandle.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mcs/class/corlib/System/RuntimeTypeHandle.cs,v
retrieving revision 1.4
diff -u -r1.4 RuntimeTypeHandle.cs
--- class/corlib/System/RuntimeTypeHandle.cs	2001/08/10 07:03:40	1.4
+++ class/corlib/System/RuntimeTypeHandle.cs	2001/11/11 15:51:05
@@ -21,11 +21,10 @@
 			}
 		}
 	=09
-                // This is from ISerializable
-                public void GetObjectData (SerializationInfo info, Streami=
ngContext context)
-                {
-                        // TODO: IMPLEMENT ME.
-                }
-
+    // This is from ISerializable
+		public void GetObjectData (SerializationInfo info, StreamingContext cont=
ext)
+		{
+			// TODO: IMPLEMENT ME.
+		}
 	}
 }
Index: class/corlib/System/Type.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mcs/class/corlib/System/Type.cs,v
retrieving revision 1.12
diff -u -r1.12 Type.cs
--- class/corlib/System/Type.cs	2001/11/05 06:18:33	1.12
+++ class/corlib/System/Type.cs	2001/11/11 15:51:05
@@ -19,7 +19,8 @@
 	//
 =09
 	public abstract class Type : MemberInfo /* IReflect */ {
-		private RuntimeTypeHandle _impl;
+	=09
+		internal RuntimeTypeHandle _impl;
=20
 		/// <summary>
 		///   The assembly where the type is defined.
@@ -98,16 +99,18 @@
 			return internal_from_name (typeName);
 		}
=20
+		public static Type GetType(string typeName, bool throwOnError)
+		{
+			// LAMESPEC: what kinds of errors cause exception to be thrown?
+			return internal_from_name (typeName);
+		}
+
 		public static Type GetTypeFromHandle (RuntimeTypeHandle handle)
 		{=20
 			return internal_from_handle (handle);
 		}
=20
-		public RuntimeTypeHandle TypeHandle {
-			get {
-				return _impl;
-			}
-		}
+		public abstract RuntimeTypeHandle TypeHandle { get; }
 	=09
 		public bool IsValueType {
 			get {
@@ -183,6 +186,50 @@
 			get {
 				return typeof (ContextBoundObject).IsAssignableFrom (this);
 			}
+		}
+
+		public bool IsNotPublic {
+			get {
+				// FIXME
+				return false;
+			}
+		}
+
+		public bool IsPublic {
+			get {
+				// FIXME
+				return false;
+			}
+		}
+
+		public MethodInfo[] GetMethods ()
+		{
+			// FIXME
+			return null;
+		}
+
+		public MethodInfo[] GetMethods (BindingFlags bindingAttr)
+		{
+			// FIXME
+			return null;
+		}
+
+		public PropertyInfo GetProperty (string name, Type[] types)
+		{
+			// FIXME
+			return null;
+		}
+
+		public ConstructorInfo GetConstructor (Type[] types)
+		{
+			// FIXME
+			return null;
+		}
+
+		public MethodInfo GetMethod (string name, Type[] types)
+		{
+			// FIXME
+			return null;
 		}
 	}
 }
Index: class/corlib/System.IO/ChangeLog
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mcs/class/corlib/System.IO/ChangeLog,v
retrieving revision 1.10
diff -u -r1.10 ChangeLog
--- class/corlib/System.IO/ChangeLog	2001/11/05 06:18:33	1.10
+++ class/corlib/System.IO/ChangeLog	2001/11/11 15:51:05
@@ -1,3 +1,8 @@
+2001-11-10  Sean MacIsaac  <macisaac@ximian.com>
+
+	* FileNotFoundException.cs: Added some constructors
+
+	* Path.cs (GetFullPath): Fixed implementation
=20
 Fri Nov 2 18:27:58 CET 2001 Paolo Molaro <lupus@ximian.com>
=20
Index: class/corlib/System.IO/FileNotFoundException.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mcs/class/corlib/System.IO/FileNotFoundException.cs,v
retrieving revision 1.2
diff -u -r1.2 FileNotFoundException.cs
--- class/corlib/System.IO/FileNotFoundException.cs	2001/10/17 03:54:00	1.2
+++ class/corlib/System.IO/FileNotFoundException.cs	2001/11/11 15:51:05
@@ -10,6 +10,8 @@
 namespace System.IO {
=20
 	public class FileNotFoundException : SystemException {
+		private string _fileName;
+
 		// Constructors
 		public FileNotFoundException ()
 			: base ("File not found")
@@ -24,6 +26,18 @@
 		public FileNotFoundException (string message, Exception inner)
 			: base (message, inner)
 		{
+		}
+
+		public FileNotFoundException (string message, string fileName)
+			: base (message)
+		{
+			_fileName =3D fileName;
+		}
+
+		public string FileName {
+			get {
+				return _fileName;
+			}
 		}
=20
 		public string FusionLog {
Index: class/corlib/System.IO/Path.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mcs/class/corlib/System.IO/Path.cs,v
retrieving revision 1.5
diff -u -r1.5 Path.cs
--- class/corlib/System.IO/Path.cs	2001/09/26 09:11:28	1.5
+++ class/corlib/System.IO/Path.cs	2001/11/11 15:51:05
@@ -165,12 +165,14 @@
=20
 		public static string GetFullPath(string path)
 		{
-			if(path !=3D null)
-			{
-				//TODO: Implement this correctly
+			if (path =3D=3D null)
+				throw(new ArgumentNullException("path", "You must specify a path when =
calling System.IO.Path.GetFullPath"));
+
+			if (path.StartsWith(new string(DirectorySeparatorChar, 1)) ||
+						path.StartsWith(new string(AltDirectorySeparatorChar, 1)))
 				return path;
-			}
-			return null;
+
+			return _os.GetCurrentDirectory() + new string(DirectorySeparatorChar, 1=
) + path;
 		}
=20
 		public static string GetPathRoot(string path)
Index: class/corlib/System.Reflection/Assembly.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mcs/class/corlib/System.Reflection/Assembly.cs,v
retrieving revision 1.5
diff -u -r1.5 Assembly.cs
--- class/corlib/System.Reflection/Assembly.cs	2001/11/05 06:18:33	1.5
+++ class/corlib/System.Reflection/Assembly.cs	2001/11/11 15:51:05
@@ -13,12 +13,13 @@
 using System.Reflection.Emit;
 using System.IO;
 using System.Globalization;
+using System.Runtime.CompilerServices;
=20
 namespace System.Reflection {
=20
 	public class Assembly : System.Reflection.ICustomAttributeProvider,
 		System.Security.IEvidenceFactory, System.Runtime.Serialization.ISerializ=
able {
-		private IntPtr mono_assembly;
+		private IntPtr _mono_assembly;
=20
 		public virtual string CodeBase { get {return null;} }
=20
@@ -124,12 +125,15 @@
=20
 		public virtual Type GetType(String name, Boolean throwOnError)
 		{
-			return null;
+			return GetType (name, throwOnError, false);
 		}
+
+		[MethodImplAttribute(MethodImplOptions.InternalCall)]
+		public extern virtual Type GetType(String name);
=20
-		public virtual Type GetType(String name)
+		public Type GetType(String name, Boolean throwOnError, Boolean ignoreCas=
e)
 		{
-			return GetType (name, true);
+			return null;
 		}
 	=09
 		public virtual AssemblyName GetName(Boolean copiedName)
@@ -162,11 +166,6 @@
 			return null;
 		}
=20
-		public Type GetType(String name, Boolean throwOnError, Boolean ignoreCas=
e)
-		{
-			return null;
-		}
-
 		public Assembly GetSatelliteAssembly(CultureInfo culture)
 		{
 			return null;
@@ -174,13 +173,11 @@
=20
 		public static Assembly LoadFrom(String assemblyFile)
 		{
-			return null;
+			return LoadFrom (assemblyFile, new Evidence());
 		}
=20
-		public static Assembly LoadFrom(String assemblyFile, Evidence securityEv=
idence)
-		{
-			return null;
-		}
+		[MethodImplAttribute(MethodImplOptions.InternalCall)]
+		public static extern Assembly LoadFrom(String assemblyFile, Evidence sec=
urityEvidence);
=20
 		public static Assembly Load(String assemblyString)
 		{
Index: class/corlib/System.Reflection/ChangeLog
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mcs/class/corlib/System.Reflection/ChangeLog,v
retrieving revision 1.5
diff -u -r1.5 ChangeLog
--- class/corlib/System.Reflection/ChangeLog	2001/11/05 06:18:33	1.5
+++ class/corlib/System.Reflection/ChangeLog	2001/11/11 15:51:05
@@ -1,3 +1,8 @@
+2001-11-10  Sean MacIsaac  <macisaac@ximian.com>=0D
+=0D
+	* Assembly.cs: Filled in some stub implementations=0D
+=0D
+	* ConstructorInfo.cs: Added some stub functions for NUnit=0D
=20=0D
 Fri Nov 2 18:29:36 CET 2001 Paolo Molaro <lupus@ximian.com>=0D
=20=0D
Index: class/corlib/System.Reflection/ConstructorInfo.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mcs/class/corlib/System.Reflection/ConstructorInfo.cs=
,v
retrieving revision 1.2
diff -u -r1.2 ConstructorInfo.cs
--- class/corlib/System.Reflection/ConstructorInfo.cs	2001/10/08 12:02:19	1=
.2
+++ class/corlib/System.Reflection/ConstructorInfo.cs	2001/11/11 15:51:05
@@ -15,5 +15,11 @@
 		public override MemberTypes MemberType {
 			get {return MemberTypes.Constructor;}
 		}
+
+		public object Invoke (object[] parameters)
+		{
+			//FIXME
+			return null;
+		}
 	}
 }
Index: class/corlib/System.Reflection.Emit/ChangeLog
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mcs/class/corlib/System.Reflection.Emit/ChangeLog,v
retrieving revision 1.4
diff -u -r1.4 ChangeLog
--- class/corlib/System.Reflection.Emit/ChangeLog	2001/11/06 06:50:13	1.4
+++ class/corlib/System.Reflection.Emit/ChangeLog	2001/11/11 15:51:05
@@ -1,3 +1,6 @@
+2001-11-10  Sean MacIsaac  <macisaac@ximian.com>
+
+	* TypeBuilder.cs: Added implementation for TypeHandle.
=20
 Tue Nov 6 09:13:45 CET 2001 Paolo Molaro <lupus@ximian.com>
=20
Index: class/corlib/System.Reflection.Emit/TypeBuilder.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.c=
s,v
retrieving revision 1.6
diff -u -r1.6 TypeBuilder.cs
--- class/corlib/System.Reflection.Emit/TypeBuilder.cs	2001/11/05 06:18:33	=
1.6
+++ class/corlib/System.Reflection.Emit/TypeBuilder.cs	2001/11/11 15:51:06
@@ -129,5 +129,7 @@
 		public override Type GetElementType () { return null; }
=20
 		public override Type[] GetInterfaces () { return null; }
+
+		public override RuntimeTypeHandle TypeHandle { get { return _impl; } }
 	}
 }
Index: mcs/.cvsignore
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mcs/mcs/.cvsignore,v
retrieving revision 1.2
diff -u -r1.2 .cvsignore
--- mcs/.cvsignore	2001/07/15 04:21:26	1.2
+++ mcs/.cvsignore	2001/11/11 15:51:06
@@ -2,3 +2,4 @@
 compiler.exe
 cs-parser.cs
 y.output
+*.pdb

--=-CRIr8wg7hU4OjBpvGMSy
Content-Disposition: attachment; filename=mono.diff
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=ISO-8859-1

Index: mono/metadata/ChangeLog
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mono/mono/metadata/ChangeLog,v
retrieving revision 1.87
diff -u -r1.87 ChangeLog
--- mono/metadata/ChangeLog	2001/11/09 22:20:33	1.87
+++ mono/metadata/ChangeLog	2001/11/11 15:47:53
@@ -1,3 +1,28 @@
+2001-11-10  Sean MacIsaac  <macisaac@ximian.com>
+
+	* loader.h: Removed type class from MonoDefaults, added monotype
+
+	* loader.c: Loaded MonoType, removed loading of Type
+
+	* icall.c (my_mono_new_object): Now returns a System.MonoType,
+	and fills in System.Type._impl with a RuntimeTypeHandle rather
+	than the actual MonoClass *
+
+	(ves_icall_type_from_handle): change from type_class to
+	monotype_class
+
+	(ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr):
+	implemented
+
+	(ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAuto):
+	implemented
+
+	(ves_icall_System_Reflection_Assembly_LoadFrom): implemented
+
+	(ves_icall_System_Reflection_Assembly_GetType): implemented
+
+	(ves_icall_System_MonoType_assQualifiedName): implemented
+
 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
=20
 	* assembly.c (mono_assembly_open): Implement a cache for the
Index: mono/metadata/icall.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mono/mono/metadata/icall.c,v
retrieving revision 1.24
diff -u -r1.24 icall.c
--- mono/metadata/icall.c	2001/11/09 10:53:55	1.24
+++ mono/metadata/icall.c	2001/11/11 15:47:53
@@ -15,6 +15,7 @@
 #include <mono/metadata/object.h>
 #include <mono/metadata/threads.h>
 #include <mono/metadata/reflection.h>
+#include <mono/metadata/assembly.h>
 #include "decimal.h"
=20
 static MonoObject *
@@ -141,16 +142,13 @@
 	return mono_object_new (klass);
 }
=20
-static MonoObject *
+static MonoReflectionType *
 my_mono_new_object (MonoClass *klass, gpointer data)
 {
-	MonoClassField *field;
-	MonoObject *res =3D mono_object_new (klass);
-	gpointer *slot;
-
-	field =3D mono_class_get_field_from_name (klass, "_impl");
-	slot =3D (gpointer*)((char*)res + field->offset);
-	*slot =3D data;
+	MonoReflectionType *res =3D (MonoReflectionType *)mono_object_new (klass)=
;
+
+	res->type =3D (MonoType *)data;
+
 	return res;
 }
=20
@@ -182,10 +180,106 @@
 	return NULL;
 }
=20
-static MonoObject*
+static MonoReflectionType*
 ves_icall_type_from_handle (gpointer handle)
+{
+	return my_mono_new_object (mono_defaults.monotype_class, handle);
+}
+
+static gpointer
+ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr (gpointer ptr)
+{
+	return (gpointer)(*(int *)ptr);
+}
+
+static MonoString*
+ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAuto (gpointer=
 ptr)
+{
+	return mono_string_new ((char *)ptr);
+}
+
+static MonoReflectionAssembly*
+ves_icall_System_Reflection_Assembly_LoadFrom (MonoString *assName, MonoOb=
ject *evidence)
+{
+	/* FIXME : examine evidence? */
+	char *name =3D mono_string_to_utf8 (assName);
+	enum MonoImageOpenStatus status =3D MONO_IMAGE_OK;
+	MonoClass *klass =3D mono_class_from_name (mono_defaults.corlib, "System.=
Reflection", "Assembly");
+	MonoAssembly *ass =3D mono_assembly_open (name, NULL, &status);
+	MonoReflectionAssembly *res;
+
+	g_assert (ass !=3D NULL);
+	g_assert (status =3D=3D MONO_IMAGE_OK);
+
+	res =3D (MonoReflectionAssembly *)mono_object_new (klass);
+	res->assembly =3D ass;
+
+	g_free (name);
+
+	return res;
+}
+
+static MonoReflectionType*
+ves_icall_System_Reflection_Assembly_GetType (MonoReflectionAssembly *asse=
mbly, MonoString *type) /* , char throwOnError, char ignoreCase) */
+{
+	/* FIXME : use throwOnError and ignoreCase */
+	gchar *name, *namespace, **parts;
+	MonoClass *klass;
+	int j =3D 0;
+
+	name =3D mono_string_to_utf8 (type);
+
+	parts =3D g_strsplit (name, ".", 0);
+	g_free (name);
+
+	while (parts[j])
+		j++;
+
+	name =3D parts[j-1];
+	parts[j-1] =3D NULL;
+	namespace =3D g_strjoinv (".", parts);
+	g_strfreev (parts);
+
+	klass =3D mono_class_from_name (assembly->assembly->image, namespace, nam=
e);
+	if (!klass->metadata_inited)
+		mono_class_metadata_init (klass);
+
+	g_free (name);
+	g_free (namespace);
+
+	return my_mono_new_object (mono_defaults.monotype_class, &klass->byval_ar=
g);
+}
+
+static MonoString *
+ves_icall_System_MonoType_assQualifiedName (MonoReflectionType *object)
+{
+	/* FIXME : real rules are more complicated (internal classes,
+	  reference types, array types, etc. */
+
+
+	MonoString *res;
+	gchar *fullname;
+	MonoClass *klass;
+
+	klass =3D object->type->data.klass;
+
+	fullname =3D g_strconcat (klass->name_space, ".",
+	                           klass->name, ",",
+	                           klass->image->assembly_name);
+  res =3D mono_string_new (fullname);
+	g_free (fullname);
+
+	return res;
+}
+
+static MonoString *
+ves_icall_System_PAL_GetCurrentDirectory (MonoObject *object)
 {
-	return my_mono_new_object (mono_defaults.type_class, handle);
+	MonoString *res;
+	gchar *path =3D g_get_current_dir ();
+	res =3D mono_string_new (path);
+	g_free (path);
+	return res;
 }
=20
 static gpointer icall_map [] =3D {
@@ -284,6 +378,15 @@
 	"System.Threading.Monitor::Monitor_try_enter", ves_icall_System_Threading=
_Monitor_Monitor_try_enter,
 	"System.Threading.Monitor::Monitor_wait", ves_icall_System_Threading_Moni=
tor_Monitor_wait,
=20
+	"System.Runtime.InteropServices.Marshal::ReadIntPtr", ves_icall_System_Ru=
ntime_InteropServices_Marshal_ReadIntPtr,
+	"System.Runtime.InteropServices.Marshal::PtrToStringAuto", ves_icall_Syst=
em_Runtime_InteropServices_Marshal_PtrToStringAuto,
+
+	"System.Reflection.Assembly::LoadFrom", ves_icall_System_Reflection_Assem=
bly_LoadFrom,
+	"System.Reflection.Assembly::GetType", ves_icall_System_Reflection_Assemb=
ly_GetType,
+
+	"System.MonoType::assQualifiedName", ves_icall_System_MonoType_assQualifi=
edName,
+
+	"System.PAL.OpSys::GetCurrentDirectory", ves_icall_System_PAL_GetCurrentD=
irectory,
 	/*
 	 * add other internal calls here
 	 */
Index: mono/metadata/loader.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mono/mono/metadata/loader.c,v
retrieving revision 1.43
diff -u -r1.43 loader.c
--- mono/metadata/loader.c	2001/11/07 11:02:31	1.43
+++ mono/metadata/loader.c	2001/11/11 15:47:53
@@ -166,10 +166,9 @@
                 mono_defaults.corlib, "System", "RuntimeFieldHandle");
 	g_assert (mono_defaults.fieldhandle_class !=3D 0);
=20
-	mono_defaults.type_class =3D mono_class_from_name (
-                mono_defaults.corlib, "System", "Type");
-	g_assert (mono_defaults.type_class !=3D 0);
-
+	mono_defaults.monotype_class =3D mono_class_from_name (
+                mono_defaults.corlib, "System", "MonoType");
+	g_assert (mono_defaults.monotype_class !=3D 0);
 }
=20
 static GHashTable *icall_hash =3D NULL;
Index: mono/metadata/loader.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mono/mono/metadata/loader.h,v
retrieving revision 1.12
diff -u -r1.12 loader.h
--- mono/metadata/loader.h	2001/10/10 07:47:05	1.12
+++ mono/metadata/loader.h	2001/11/11 15:47:53
@@ -51,7 +51,7 @@
 	MonoClass *typehandle_class;
 	MonoClass *fieldhandle_class;
 	MonoClass *methodhandle_class;
-	MonoClass *type_class;
+	MonoClass *monotype_class;
 } MonoDefaults;
=20
 extern MonoDefaults mono_defaults;

--=-CRIr8wg7hU4OjBpvGMSy--