[jit] Use MONO_INS_IS_PCONST_NULL () macro in more places.
[mono.git] / mcs / class / WindowsBase / ZipSharp / IOFunctions.cs
1 // IOFunctions.cs created with MonoDevelop
2 // User: alan at 14:43 20/10/2008
3 //
4 // To change standard headers go to Edit->Preferences->Coding->Standard Headers
5 //
6
7 using System;
8 using System.Runtime.InteropServices;
9
10 namespace zipsharp
11 {
12         // this matches a native 'enum', don't modify
13         enum Append
14         {
15                 Create = 0,
16                 CreateAfter = 1,
17                 AddInZip = 2
18         }
19         
20         [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
21         internal delegate IntPtr OpenFileFunc (IntPtr opaque, string filename, int mode);
22
23         [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
24         internal delegate /* ulong */ IntPtr ReadFileFunc (IntPtr opaque, IntPtr stream, IntPtr buffer, /* ulong */ IntPtr size);
25
26         [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
27         internal delegate /* ulong */ IntPtr WriteFileFunc (IntPtr opaque, IntPtr stream, IntPtr buffer, /* ulong */ IntPtr size);
28
29         [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
30         internal delegate /* long */ IntPtr TellFileFunc (IntPtr opaque, IntPtr stream);
31
32         [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
33         internal delegate /* long */ IntPtr SeekFileFunc (IntPtr opaque, IntPtr stream, /* ulong */ IntPtr offset, int origin);
34
35         [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
36         internal delegate int CloseFileFunc (IntPtr opaque, IntPtr stream);
37
38         [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
39         internal delegate int TestErrorFileFunc (IntPtr opaque, IntPtr stream);
40
41         [StructLayout (LayoutKind.Sequential)]
42         internal struct ZlibFileFuncDef
43         {
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;
51                 public IntPtr            opaque;
52         }
53 }