Mercurial > pub > dyncall > bindings
annotate java/jdc/org_dyncall_DC.c @ 20:77ca609422f1
- first working build of new java binding
author | cslag |
---|---|
date | Wed, 30 Mar 2016 02:40:56 +0200 |
parents | 5b51738793c6 |
children | 40a2c4198016 |
rev | line source |
---|---|
0 | 1 #include "org_dyncall_DC.h" |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
2 #include "dyncall.h" |
20 | 3 #include "dynload.h" |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
4 |
20 | 5 jlong JNICALL Java_org_dyncall_DC_newCallVM(JNIEnv *pEnv, jclass clazz, jint size) |
0 | 6 { |
20 | 7 return (jlong)dcNewCallVM(size); |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
8 //@@@ free |
0 | 9 } |
10 | |
20 | 11 jlong JNICALL Java_org_dyncall_DC_load(JNIEnv *pEnv, jclass clazz, jstring s) |
0 | 12 { |
20 | 13 return (jlong)dlLoadLibrary((const char*)s); |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
14 //@@@ free |
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
15 } |
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
16 |
20 | 17 jlong JNICALL Java_org_dyncall_DC_find(JNIEnv *pEnv, jclass clazz, jlong libhandle, jstring s) |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
18 { |
20 | 19 return (jlong)dlFindSymbol((DLLib*)libhandle, (const char*)s); |
0 | 20 } |
21 | |
20 | 22 //jint JNICALL Java_org_dyncall_DC_symsCount(JNIEnv *pEnv, jclass clazz, jlong symshandle) |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
23 //{ |
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
24 // return dlSymsCount((DLSyms*)symshandle); |
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
25 //} |
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
26 |
20 | 27 //jstring JNICALL Java_org_dyncall_DC_symsName(JNIEnv *pEnv, jclass clazz, jlong symshandle, jint i) |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
28 //{ |
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
29 // return dlSymsName((DLSyms*)symshandle, i); |
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
30 //} |
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
31 |
20 | 32 void JNICALL Java_org_dyncall_DC_mode(JNIEnv *pEnv, jclass clazz, jlong vm, jint i) |
0 | 33 { |
20 | 34 dcMode((DCCallVM*)vm, i); |
0 | 35 } |
36 | |
20 | 37 void JNICALL Java_org_dyncall_DC_reset(JNIEnv *pEnv, jclass clazz, jlong vm) |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
38 { |
20 | 39 dcReset((DCCallVM*)vm); |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
40 } |
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
41 |
20 | 42 void JNICALL Java_org_dyncall_DC_argBool(JNIEnv *pEnv, jclass clazz, jlong vm, jboolean b) |
0 | 43 { |
20 | 44 dcArgBool((DCCallVM*)vm, b); |
0 | 45 } |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
46 |
20 | 47 void JNICALL Java_org_dyncall_DC_argChar(JNIEnv *pEnv, jclass clazz, jlong vm, jbyte b) |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
48 { |
20 | 49 dcArgChar((DCCallVM*)vm, b); |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
50 } |
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
51 |
20 | 52 void JNICALL Java_org_dyncall_DC_argShort(JNIEnv *pEnv, jclass clazz, jlong vm, jshort s) |
0 | 53 { |
20 | 54 dcArgShort((DCCallVM*)vm, s); |
0 | 55 } |
56 | |
20 | 57 void JNICALL Java_org_dyncall_DC_argInt(JNIEnv *pEnv, jclass clazz, jlong vm, jint i) |
0 | 58 { |
20 | 59 dcArgInt((DCCallVM*)vm, i); |
0 | 60 } |
61 | |
20 | 62 void JNICALL Java_org_dyncall_DC_argLong(JNIEnv *pEnv, jclass clazz, jlong vm, jlong l) |
0 | 63 { |
20 | 64 dcArgLong((DCCallVM*)vm, l); |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
65 } |
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
66 |
20 | 67 void JNICALL Java_org_dyncall_DC_argLongLong(JNIEnv *pEnv, jclass clazz, jlong vm, jlong l) |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
68 { |
20 | 69 dcArgLongLong((DCCallVM*)vm, l); |
0 | 70 } |
71 | |
20 | 72 void JNICALL Java_org_dyncall_DC_argFloat(JNIEnv *pEnv, jclass clazz, jlong vm, jfloat f) |
0 | 73 { |
20 | 74 dcArgFloat((DCCallVM*)vm, f); |
0 | 75 } |
76 | |
20 | 77 void JNICALL Java_org_dyncall_DC_argDouble(JNIEnv *pEnv, jclass clazz, jlong vm, jdouble d) |
0 | 78 { |
20 | 79 dcArgDouble((DCCallVM*)vm, d); |
0 | 80 } |
81 | |
20 | 82 void JNICALL Java_org_dyncall_DC_argPointer__JJ(JNIEnv *pEnv, jclass clazz, jlong vm, jlong l) |
0 | 83 { |
20 | 84 dcArgPointer((DCCallVM*)vm, (DCpointer)l); |
0 | 85 } |
86 | |
20 | 87 void JNICALL Java_org_dyncall_DC_argPointer__JLjava_lang_Object_2(JNIEnv *pEnv, jclass clazz, jlong vm, jobject o) |
0 | 88 { |
20 | 89 dcArgPointer((DCCallVM*)vm, (DCpointer)o); |
0 | 90 } |
91 | |
20 | 92 void JNICALL Java_org_dyncall_DC_argString(JNIEnv *pEnv, jclass clazz, jlong vm, jstring s) |
0 | 93 { |
20 | 94 dcArgPointer((DCCallVM*)vm, (DCpointer)s); |
0 | 95 } |
96 | |
20 | 97 void JNICALL Java_org_dyncall_DC_callVoid (JNIEnv *pEnv, jclass clazz, jlong vm, jlong target) |
0 | 98 { |
20 | 99 dcCallVoid((DCCallVM*)vm, (DCpointer)target); |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
100 } |
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
101 |
20 | 102 jboolean JNICALL Java_org_dyncall_DC_callBool(JNIEnv *pEnv, jclass clazz, jlong vm, jlong target) |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
103 { |
20 | 104 return dcCallBool((DCCallVM*)vm, (DCpointer)target); |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
105 } |
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
106 |
20 | 107 jbyte JNICALL Java_org_dyncall_DC_callChar(JNIEnv *pEnv, jclass clazz, jlong vm, jlong target) |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
108 { |
20 | 109 return dcCallChar((DCCallVM*)vm, (DCpointer)target); |
0 | 110 } |
111 | |
20 | 112 jshort JNICALL Java_org_dyncall_DC_callShort(JNIEnv *pEnv, jclass clazz, jlong vm, jlong target) |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
113 { |
20 | 114 return dcCallShort((DCCallVM*)vm, (DCpointer)target); |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
115 } |
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
116 |
20 | 117 jint JNICALL Java_org_dyncall_DC_callInt(JNIEnv *pEnv, jclass clazz, jlong vm, jlong target) |
0 | 118 { |
20 | 119 return dcCallInt((DCCallVM*)vm, (DCpointer)target); |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
120 } |
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
121 |
20 | 122 jlong JNICALL Java_org_dyncall_DC_callLong(JNIEnv *pEnv, jclass clazz, jlong vm, jlong target) |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
123 { |
20 | 124 return dcCallLong((DCCallVM*)vm, (DCpointer)target); |
0 | 125 } |
126 | |
20 | 127 jlong JNICALL Java_org_dyncall_DC_callLongLong(JNIEnv *pEnv, jclass clazz, jlong vm, jlong target) |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
128 { |
20 | 129 return dcCallLongLong((DCCallVM*)vm, (DCpointer)target); |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
130 } |
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
131 |
20 | 132 jfloat JNICALL Java_org_dyncall_DC_callFloat(JNIEnv *pEnv, jclass clazz, jlong vm, jlong target) |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
133 { |
20 | 134 return dcCallFloat((DCCallVM*)vm, (DCpointer)target); |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
135 } |
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
136 |
20 | 137 jdouble JNICALL Java_org_dyncall_DC_callDouble(JNIEnv *pEnv, jclass clazz, jlong vm, jlong target) |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
138 { |
20 | 139 return dcCallDouble((DCCallVM*)vm, (DCpointer)target); |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
140 } |
0 | 141 |
20 | 142 jlong JNICALL Java_org_dyncall_DC_callPointer(JNIEnv *pEnv, jclass clazz, jlong vm, jlong target) |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
143 { |
20 | 144 return (jlong)dcCallPointer((DCCallVM*)vm, (DCpointer)target); |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
145 } |
0 | 146 |
20 | 147 jstring JNICALL Java_org_dyncall_DC_callString(JNIEnv *pEnv, jclass clazz, jlong vm, jlong target) |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
148 { |
20 | 149 return dcCallPointer((DCCallVM*)vm, (DCpointer)target); |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
150 } |
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
151 |
20 | 152 jint JNICALL Java_org_dyncall_DC_getError(JNIEnv *pEnv, jclass clazz, jlong vm) |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
153 { |
20 | 154 return dcGetError((DCCallVM*)vm); |
18
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
155 } |
3bfef07b0cd9
- cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents:
0
diff
changeset
|
156 |