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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
3 #include "dynload.h"
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
4
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
5 jlong JNICALL Java_org_dyncall_DC_newCallVM(JNIEnv *pEnv, jclass clazz, jint size)
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
6 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
9 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
10
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
11 jlong JNICALL Java_org_dyncall_DC_load(JNIEnv *pEnv, jclass clazz, jstring s)
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
12 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
19 return (jlong)dlFindSymbol((DLLib*)libhandle, (const char*)s);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
20 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
21
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
32 void JNICALL Java_org_dyncall_DC_mode(JNIEnv *pEnv, jclass clazz, jlong vm, jint i)
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
33 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
34 dcMode((DCCallVM*)vm, i);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
35 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
36
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
42 void JNICALL Java_org_dyncall_DC_argBool(JNIEnv *pEnv, jclass clazz, jlong vm, jboolean b)
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
43 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
44 dcArgBool((DCCallVM*)vm, b);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
45 }
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
46
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
52 void JNICALL Java_org_dyncall_DC_argShort(JNIEnv *pEnv, jclass clazz, jlong vm, jshort s)
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
53 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
54 dcArgShort((DCCallVM*)vm, s);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
55 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
56
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
57 void JNICALL Java_org_dyncall_DC_argInt(JNIEnv *pEnv, jclass clazz, jlong vm, jint i)
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
58 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
59 dcArgInt((DCCallVM*)vm, i);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
60 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
61
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
62 void JNICALL Java_org_dyncall_DC_argLong(JNIEnv *pEnv, jclass clazz, jlong vm, jlong l)
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
63 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
69 dcArgLongLong((DCCallVM*)vm, l);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
70 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
71
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
72 void JNICALL Java_org_dyncall_DC_argFloat(JNIEnv *pEnv, jclass clazz, jlong vm, jfloat f)
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
73 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
74 dcArgFloat((DCCallVM*)vm, f);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
75 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
76
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
77 void JNICALL Java_org_dyncall_DC_argDouble(JNIEnv *pEnv, jclass clazz, jlong vm, jdouble d)
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
78 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
79 dcArgDouble((DCCallVM*)vm, d);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
80 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
81
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
82 void JNICALL Java_org_dyncall_DC_argPointer__JJ(JNIEnv *pEnv, jclass clazz, jlong vm, jlong l)
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
83 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
84 dcArgPointer((DCCallVM*)vm, (DCpointer)l);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
85 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
86
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
87 void JNICALL Java_org_dyncall_DC_argPointer__JLjava_lang_Object_2(JNIEnv *pEnv, jclass clazz, jlong vm, jobject o)
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
88 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
89 dcArgPointer((DCCallVM*)vm, (DCpointer)o);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
90 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
91
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
92 void JNICALL Java_org_dyncall_DC_argString(JNIEnv *pEnv, jclass clazz, jlong vm, jstring s)
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
93 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
94 dcArgPointer((DCCallVM*)vm, (DCpointer)s);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
95 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
96
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
97 void JNICALL Java_org_dyncall_DC_callVoid (JNIEnv *pEnv, jclass clazz, jlong vm, jlong target)
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
98 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
109 return dcCallChar((DCCallVM*)vm, (DCpointer)target);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
110 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
111
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
117 jint JNICALL Java_org_dyncall_DC_callInt(JNIEnv *pEnv, jclass clazz, jlong vm, jlong target)
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
118 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
124 return dcCallLong((DCCallVM*)vm, (DCpointer)target);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
125 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
126
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
141
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
146
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
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