2 using System.Runtime.InteropServices;
6 [DllImport("cygwin1.dll", EntryPoint="puts", CharSet=CharSet.Ansi)]
7 public static extern int puts (string name);
9 [DllImport ("libtest.so", EntryPoint="mono_test_many_int_arguments")]
10 public static extern int mono_test_many_int_arguments (int a, int b, int c, int d, int e,
11 int f, int g, int h, int i, int j);
12 [DllImport ("libtest.so", EntryPoint="mono_test_many_short_arguments")]
13 public static extern int mono_test_many_short_arguments (short a, short b, short c, short d, short e,
14 short f, short g, short h, short i, short j);
15 [DllImport ("libtest.so", EntryPoint="mono_test_many_byte_arguments")]
16 public static extern int mono_test_many_byte_arguments (byte a, byte b, byte c, byte d, byte e,
17 byte f, byte g, byte h, byte i, byte j);
19 public static int Main () {
20 puts ("A simple Test for PInvoke");
22 if (Math.Cos (Math.PI) != -1)
24 if (Math.Acos (1) != 0)
26 if (mono_test_many_int_arguments (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) != 10)
28 if (mono_test_many_short_arguments (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) != 55)
30 if (mono_test_many_byte_arguments (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) != 55)