comparison java/jdc/org/dyncall/DC.java @ 19:5b51738793c6

- layout restructuring
author cslag
date Wed, 30 Mar 2016 02:06:16 +0200
parents java/jdc/src/org/dyncall/DC.java@3bfef07b0cd9
children 77ca609422f1
comparison
equal deleted inserted replaced
18:3bfef07b0cd9 19:5b51738793c6
1 package org.dyncall;
2
3 public class DC
4 {
5 static
6 {
7 System.loadLibrary("jdc");
8 }
9
10 public static final int
11 // calling conventions
12 C_DEFAULT = 0
13 , C_ELLIPSIS = 100
14 , C_ELLIPSIS_VARARGS = 101
15 , C_X86_CDECL = 1
16 , C_X86_WIN32_STD = 2
17 , C_X86_WIN32_FAST_MS = 3
18 , C_X86_WIN32_FAST_GNU = 4
19 , C_X86_WIN32_THIS_MS = 5
20 , C_X86_WIN32_THIS_GNU = 6
21 , C_X64_WIN64 = 7
22 , C_X64_SYSV = 8
23 , C_PPC32_DARWIN = 9
24 , C_PPC32_OSX = 9 //C_PPC32_DARWIN /* alias */
25 , C_ARM_ARM_EABI = 10
26 , C_ARM_THUMB_EABI = 11
27 , C_ARM_ARMHF = 30
28 , C_MIPS32_EABI = 12
29 , C_MIPS32_PSPSDK = 12 //C_MIPS32_EABI /* alias - deprecated. */
30 , C_PPC32_SYSV = 13
31 , C_PPC32_LINUX = 13 //C_PPC32_SYSV /* alias */
32 , C_ARM_ARM = 14
33 , C_ARM_THUMB = 15
34 , C_MIPS32_O32 = 16
35 , C_MIPS64_N32 = 17
36 , C_MIPS64_N64 = 18
37 , C_X86_PLAN9 = 19
38 , C_SPARC32 = 20
39 , C_SPARC64 = 21
40 , C_ARM64 = 22
41 , C_PPC64 = 23
42 , C_PPC64_LINUX = 23 //C_PPC64 /* alias */
43 , SYS_DEFAULT = 200
44 , SYS_X86_INT80H_LINUX = 201
45 , SYS_X86_INT80H_BSD = 202
46 , SYS_PPC32 = 210
47 , SYS_PPC64 = 211
48 // error codes
49 , ERROR_NONE = 0
50 , ERROR_UNSUPPORTED_MODE = -1
51 ;
52
53 public static native long newCallVM(int type, int size);
54
55 public static native long load(String libname);
56 public static native long find(long libhandle, String symbol);
57 //public static native int symsCount(long libhandle);
58 //public static native String symsName (long libhandle, int index);
59
60 public static native void reset(long vmhandle);
61 public static native void mode(long vmhandle, int mode);
62
63 // Note that the function names mimic the C api, as C functions are called,
64 // meaning argChar takes a java byte (not char, as latter is 16 bit), argLongLong
65 // takes a java long (which is 64bit), etc..
66 public static native void argBool (long vmhandle, boolean b);
67 public static native void argChar (long vmhandle, byte b);
68 public static native void argShort (long vmhandle, short s);
69 public static native void argInt (long vmhandle, int i);
70 public static native void argLong (long vmhandle, long l);
71 public static native void argLongLong(long vmhandle, long l);
72 public static native void argFloat (long vmhandle, float f);
73 public static native void argDouble (long vmhandle, double d);
74 public static native void argPointer (long vmhandle, long l);
75 public static native void argPointer (long vmhandle, Object o);
76 public static native void argString (long vmhandle, String s);
77
78 public static native void callVoid (long vmhandle, long funcpointer);
79 public static native boolean callBool (long vmhandle, long funcpointer);
80 public static native byte callChar (long vmhandle, long funcpointer);
81 public static native short callShort (long vmhandle, long funcpointer);
82 public static native int callInt (long vmhandle, long funcpointer);
83 public static native long callLong (long vmhandle, long funcpointer);
84 public static native long callLongLong(long vmhandle, long funcpointer);
85 public static native float callFloat (long vmhandle, long funcpointer);
86 public static native double callDouble (long vmhandle, long funcpointer);
87 public static native long callPointer (long vmhandle, long funcpointer);
88 public static native String callString (long vmhandle, long funcpointer);
89
90 public static native int getError(long vmhandle);
91 };
92