annotate java/jdc/org_dyncall_DC.c @ 36:b84064293541

- bugfix
author Tassilo Philipp
date Mon, 13 Apr 2020 16:28:47 +0200
parents 87fd9f34eaa0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
1 #include <stdlib.h>
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
2 #include "org_dyncall_DC.h"
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
3 #include "dyncall.h"
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
4 #include "dynload.h"
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
5
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
6 // Bookkeping to clean up on reset.
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
7 static int gc_snum = 0;
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
8 static jobject* gc_jstr = NULL;
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
9 static const char** gc_cstr = NULL;
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
10 static void cleanupHeldStrings(JNIEnv *pEnv)
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
11 {
23
87fd9f34eaa0 - pre-C99 syntax fix
cslag
parents: 22
diff changeset
12 int i;
87fd9f34eaa0 - pre-C99 syntax fix
cslag
parents: 22
diff changeset
13 for(i=0; i<gc_snum; ++i)
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
14 (*pEnv)->ReleaseStringUTFChars(pEnv, gc_jstr[i], gc_cstr[i]);
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
15
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
16 free(gc_jstr); gc_jstr = NULL;
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
17 free(gc_cstr); gc_cstr = NULL;
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
18 gc_snum = 0;
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
19
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
20 }
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
21
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
22
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
23 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
24 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
25 return (jlong)dcNewCallVM(size);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
26 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
27
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
28 void JNICALL Java_org_dyncall_DC_freeCallVM(JNIEnv *pEnv, jclass clazz, jlong vm)
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
29 {
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
30 cleanupHeldStrings(pEnv);
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
31 dcFree((DCCallVM*)vm);
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
32 }
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
33
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
34 jlong JNICALL Java_org_dyncall_DC_loadLibrary(JNIEnv *pEnv, jclass clazz, jstring s)
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
35 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
36 jlong l = 0;
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
37 const char *sz = (*pEnv)->GetStringUTFChars(pEnv, s, NULL);
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
38 if(sz != NULL) {
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
39 l = (jlong)dlLoadLibrary(sz);
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
40 (*pEnv)->ReleaseStringUTFChars(pEnv, s, sz);
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
41 }
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
42 return l;
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
43 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
44
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
45 void JNICALL Java_org_dyncall_DC_freeLibrary(JNIEnv *pEnv, jclass clazz, jlong libhandle)
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
46 {
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
47 dlFreeLibrary((DLLib*)libhandle);
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
48 }
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
49
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
50 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
51 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
52 jlong l = 0;
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
53 const char *sz = (*pEnv)->GetStringUTFChars(pEnv, s, NULL);
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
54 if(sz != NULL) {
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
55 l = (jlong)dlFindSymbol((DLLib*)libhandle, sz);
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
56 (*pEnv)->ReleaseStringUTFChars(pEnv, s, sz);
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
57 }
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
58 return l;
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
59 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
60
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
61 //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
62 //{
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
63 // return dlSymsCount((DLSyms*)symshandle);
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
64 //}
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
65
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
66 //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
67 //{
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
68 // return dlSymsName((DLSyms*)symshandle, i);
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
69 //}
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
70
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
71 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
72 {
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
73 dcMode((DCCallVM*)vm, i);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
74 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
75
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
76 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
77 {
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
78 cleanupHeldStrings(pEnv);
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
79 dcReset((DCCallVM*)vm);
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
80 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
81
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
82 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
83 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
84 dcArgBool((DCCallVM*)vm, b);//@@@test
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
85 }
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
86
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
87 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
88 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
89 dcArgChar((DCCallVM*)vm, b);//@@@test
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
90 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
91
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
92 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
93 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
94 dcArgShort((DCCallVM*)vm, s);//@@@test
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_argInt(JNIEnv *pEnv, jclass clazz, jlong vm, jint i)
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
98 {
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
99 dcArgInt((DCCallVM*)vm, i);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
100 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
101
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
102 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
103 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
104 dcArgLong((DCCallVM*)vm, l);//@@@test
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 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
108 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
109 dcArgLongLong((DCCallVM*)vm, l);//@@@test
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 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
113 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
114 dcArgFloat((DCCallVM*)vm, f);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
115 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
116
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
117 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
118 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
119 dcArgDouble((DCCallVM*)vm, d);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
120 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
121
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
122 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
123 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
124 dcArgPointer((DCCallVM*)vm, (DCpointer)l);//@@@test
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 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
128 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
129 dcArgPointer((DCCallVM*)vm, (DCpointer)o);//@@@test
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
130 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
131
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
132 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
133 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
134 const char *sz = (*pEnv)->GetStringUTFChars(pEnv, s, NULL);
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
135 if(sz != NULL) {
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
136 dcArgPointer((DCCallVM*)vm, (DCpointer)sz);
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
137
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
138 // Bookkeeping, to later release on reset or destruction of vm.
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
139 gc_jstr = realloc(gc_jstr, (gc_snum+1)*sizeof(jobject));
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
140 gc_cstr = realloc(gc_cstr, (gc_snum+1)*sizeof(const char*));
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
141 gc_jstr[gc_snum] = s;
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
142 gc_cstr[gc_snum] = sz;
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
143 ++gc_snum;
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
144 }
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
145 }
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 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
148 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
149 dcCallVoid((DCCallVM*)vm, (DCpointer)target);//@@@test
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 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
153 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
154 return dcCallBool((DCCallVM*)vm, (DCpointer)target);//@@@test
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
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
157 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
158 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
159 return dcCallChar((DCCallVM*)vm, (DCpointer)target);//@@@test
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
160 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
161
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
162 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
163 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
164 return dcCallShort((DCCallVM*)vm, (DCpointer)target);//@@@test
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
165 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
166
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
167 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
168 {
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
169 return dcCallInt((DCCallVM*)vm, (DCpointer)target);
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
170 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
171
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
172 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
173 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
174 return dcCallLong((DCCallVM*)vm, (DCpointer)target);//@@@test
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
175 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
176
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
177 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
178 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
179 return dcCallLongLong((DCCallVM*)vm, (DCpointer)target);//@@@test
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
180 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
181
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
182 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
183 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
184 return dcCallFloat((DCCallVM*)vm, (DCpointer)target);
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
185 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
186
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
187 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
188 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
189 return dcCallDouble((DCCallVM*)vm, (DCpointer)target);
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
190 }
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
191
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
192 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
193 {
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
194 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
195 }
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
196
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
197 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
198 {
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
199 return (*pEnv)->NewStringUTF(pEnv, dcCallPointer((DCCallVM*)vm, (DCpointer)target));
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
200 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
201
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
202 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
203 {
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
204 return dcGetError((DCCallVM*)vm);
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
205 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
206