1 |
using System; |
2 |
using System.Runtime.InteropServices; |
3 |
|
4 |
using gr2lib.core.typedefs; |
5 |
//using gr2lib.core.coretypes; |
6 |
|
7 |
namespace gr2lib.core |
8 |
{ |
9 |
public class coreapi |
10 |
{ |
11 |
#region Granny2 API Version Support |
12 |
[DllImport("granny2.dll", EntryPoint = "GrannyVersionsMatch_", CallingConvention = CallingConvention.StdCall)] |
13 |
internal static extern bool GrannyVersionsMatch(granny_int32x MajorVersion, granny_int32x MinorVersion, granny_int32x Customization, granny_int32x BuildNumber); |
14 |
[DllImport("granny2.dll", EntryPoint = "GrannyGetVersion", CallingConvention = CallingConvention.StdCall)] |
15 |
internal static extern void GrannyGetVersion(ref granny_int32x MajorVersion, ref granny_int32x MinorVersion, ref granny_int32x Customization, ref granny_int32x BuildNumber); |
16 |
[DllImport("granny2.dll", EntryPoint = "GrannyGetVersionString", CallingConvention = CallingConvention.StdCall)] |
17 |
internal static extern string GrannyGetVersionString(); |
18 |
#endregion |
19 |
|
20 |
#region Granny2 API File Loading Support |
21 |
[DllImport("granny2.dll", EntryPoint = "GrannyReadEntireFile", CallingConvention = CallingConvention.StdCall)] |
22 |
public static extern IntPtr GrannyReadEntireFile(string fileName); |
23 |
[DllImport("granny2.dll", EntryPoint = "GrannyGetFileInfo", CallingConvention = CallingConvention.StdCall)] |
24 |
public static extern IntPtr GetFileInfo(IntPtr file); |
25 |
[DllImport("granny2.dll", EntryPoint = "GrannyFreeFile", CallingConvention = CallingConvention.StdCall)] |
26 |
public static extern void FreeFile(IntPtr pointer); |
27 |
#endregion |
28 |
|
29 |
#region Granny2 API Header Support |
30 |
[DllImport("granny2.dll", EntryPoint = "GrannyGetFileTypeTag", CallingConvention = CallingConvention.StdCall)] |
31 |
public static extern int GrannyGetFileTypeTag(IntPtr File); |
32 |
#endregion |
33 |
|
34 |
|
35 |
} |
36 |
} |