1 // IOFunctions.cs created with MonoDevelop
2 // User: alan at 14:43 20/10/2008
4 // To change standard headers go to Edit->Preferences->Coding->Standard Headers
8 using System.Runtime.InteropServices;
12 // this matches a native 'enum', don't modify
20 [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
21 internal delegate IntPtr OpenFileFunc (IntPtr opaque, string filename, int mode);
23 [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
24 internal delegate /* ulong */ IntPtr ReadFileFunc (IntPtr opaque, IntPtr stream, IntPtr buffer, /* ulong */ IntPtr size);
26 [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
27 internal delegate /* ulong */ IntPtr WriteFileFunc (IntPtr opaque, IntPtr stream, IntPtr buffer, /* ulong */ IntPtr size);
29 [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
30 internal delegate /* long */ IntPtr TellFileFunc (IntPtr opaque, IntPtr stream);
32 [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
33 internal delegate /* long */ IntPtr SeekFileFunc (IntPtr opaque, IntPtr stream, /* ulong */ IntPtr offset, int origin);
35 [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
36 internal delegate int CloseFileFunc (IntPtr opaque, IntPtr stream);
38 [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
39 internal delegate int TestErrorFileFunc (IntPtr opaque, IntPtr stream);
41 [StructLayout (LayoutKind.Sequential)]
42 internal struct ZlibFileFuncDef
44 [MarshalAs (UnmanagedType.FunctionPtr)] public OpenFileFunc zopen_file;
45 [MarshalAs (UnmanagedType.FunctionPtr)] public ReadFileFunc zread_file;
46 [MarshalAs (UnmanagedType.FunctionPtr)] public WriteFileFunc zwrite_file;
47 [MarshalAs (UnmanagedType.FunctionPtr)] public TellFileFunc ztell_file;
48 [MarshalAs (UnmanagedType.FunctionPtr)] public SeekFileFunc zseek_file;
49 [MarshalAs (UnmanagedType.FunctionPtr)] public CloseFileFunc zclose_file;
50 [MarshalAs (UnmanagedType.FunctionPtr)] public TestErrorFileFunc zerror_file;