1
// Test file for make-map.cs
3
using System.Runtime.InteropServices;
6
// Make sure that a null namespace doesn't kill make-map
9
namespace MakeMap.Test {
10
struct ForDelegate {int i;}
12
delegate string MyDelegate (
13
bool b1, byte b2, sbyte b3, short s1, ushort us1,
14
int i1, uint ui1, long l1, ulong ul1,
15
IntPtr p1, UIntPtr p2, string s2, StringBuilder sb1,
16
HandleRef h, ForDelegate fd);
19
enum TestEnum : long {
27
enum SimpleFlagsEnum {
44
S_IFMT = 0xF000, // Bits which determine file type
45
[Map(SuppressFlags="S_IFMT")]
46
S_IFDIR = 0x4000, // Directory
47
[Map(SuppressFlags="S_IFMT")]
48
S_IFCHR = 0x2000, // Character device
49
[Map(SuppressFlags="S_IFMT")]
50
S_IFBLK = 0x6000, // Block device
51
[Map(SuppressFlags="S_IFMT")]
52
S_IFREG = 0x8000, // Regular file
53
[Map(SuppressFlags="S_IFMT")]
54
S_IFIFO = 0x1000, // FIFO
55
[Map(SuppressFlags="S_IFMT")]
56
S_IFLNK = 0xA000, // Symbolic link
57
[Map(SuppressFlags="S_IFMT")]
58
S_IFSOCK = 0xC000, // Socket
67
// this should be within a #ifdef HAVE_AUTOCONF_ME block, due to
69
public long autoconf_me;
72
[Map ("struct foo_holder")]
78
delegate void DelFoo (int i, Foo f);
79
delegate void DelRefFoo (int i, ref Foo f);
80
delegate void DelArrayFoo (int i, Foo[] f);
81
delegate void DelRefArrayFoo (int i, ref Foo[] f);
82
delegate void DelBaz (int i, Baz b);
83
delegate void DelRefBaz (int i, ref Baz b);
84
delegate void DelArrayBaz (int i, Baz[] b);
85
delegate void DelRefArrayBaz (int i, ref Baz[] b);
87
[StructLayout (LayoutKind.Sequential)]
91
public DelArrayFoo b3;
92
public DelRefArrayFoo b4;
95
public DelArrayBaz b7;
96
public DelRefArrayBaz b8;
99
[StructLayout (LayoutKind.Sequential)]
105
class NativeMethods {
106
[DllImport ("NativeLib")]
107
private static extern void UseQux (DelFoo b, ref Qux q);
109
// This shouldn't appear in test.h, due to --exclude-native-symbol
110
[DllImport ("NativeLib")]
111
private static extern void exclude_native_symbol ();
115
// Testing namespace renaming; this should be NSTo within test.h
116
namespace MakeMap.ToBeRenamed {
119
// this should be st_atime_ in test.h due to --rename-member.
120
[Map ("time_t")] public long st_atime;