2 using System.Runtime.InteropServices;
6 public static int delegate_test (int a)
8 Console.WriteLine ("Delegate: " + a);
16 [StructLayout (LayoutKind.Sequential)]
17 public struct SimpleStruct {
24 [DllImport ("libtest.so", EntryPoint="mono_test_marshal_char")]
25 public static extern int mono_test_marshal_char (char a1);
27 [DllImport ("libtest.so", EntryPoint="mono_test_marshal_array")]
28 public static extern int mono_test_marshal_array (int [] a1);
30 [DllImport ("libtest.so", EntryPoint="mono_test_marshal_struct")]
31 public static extern int mono_test_marshal_struct (SimpleStruct ss);
33 [DllImport ("libtest.so", EntryPoint="mono_test_marshal_delegate")]
34 public static extern int mono_test_marshal_delegate (SimpleDelegate d);
36 public delegate int SimpleDelegate (int a);
38 public static int Main () {
39 if (mono_test_marshal_char ('a') != 0)
42 int [] a1 = new int [50];
43 for (int i = 0; i < 50; i++)
46 if (mono_test_marshal_array (a1) != 1225)
49 SimpleStruct ss = new SimpleStruct ();
52 mono_test_marshal_struct (ss);
54 SimpleDelegate d = new SimpleDelegate (delegate_test);
56 if (mono_test_marshal_delegate (d) != 0)