annotate java/jdc/org_dyncall_DC.c @ 22:4ee8d6aa7721

- java binding cleanup, exposed free functions (not very oo, this entire binding) - java binding examples
author cslag
date Sat, 09 Apr 2016 18:18:34 -0500
parents 40a2c4198016
children 87fd9f34eaa0
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 {
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
12 for(int i=0; i<gc_snum; ++i)
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
13 (*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
14
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
15 free(gc_jstr); gc_jstr = NULL;
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
16 free(gc_cstr); gc_cstr = NULL;
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
17 gc_snum = 0;
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
18
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
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
22 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
23 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
24 return (jlong)dcNewCallVM(size);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
25 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
26
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
27 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
28 {
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
29 cleanupHeldStrings(pEnv);
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
30 dcFree((DCCallVM*)vm);
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
31 }
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 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
34 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
35 jlong l = 0;
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
36 const char *sz = (*pEnv)->GetStringUTFChars(pEnv, s, NULL);
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
37 if(sz != NULL) {
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
38 l = (jlong)dlLoadLibrary(sz);
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
39 (*pEnv)->ReleaseStringUTFChars(pEnv, s, sz);
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
40 }
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
41 return l;
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
42 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
43
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
44 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
45 {
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
46 dlFreeLibrary((DLLib*)libhandle);
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
47 }
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
48
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
49 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
50 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
51 jlong l = 0;
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
52 const char *sz = (*pEnv)->GetStringUTFChars(pEnv, s, NULL);
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
53 if(sz != NULL) {
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
54 l = (jlong)dlFindSymbol((DLLib*)libhandle, sz);
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
55 (*pEnv)->ReleaseStringUTFChars(pEnv, s, sz);
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
56 }
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
57 return l;
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
58 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
59
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
60 //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
61 //{
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
62 // return dlSymsCount((DLSyms*)symshandle);
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
63 //}
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
64
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
65 //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
66 //{
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
67 // return dlSymsName((DLSyms*)symshandle, i);
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
68 //}
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
69
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
70 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
71 {
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
72 dcMode((DCCallVM*)vm, i);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
73 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
74
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
75 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
76 {
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
77 cleanupHeldStrings(pEnv);
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
78 dcReset((DCCallVM*)vm);
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
79 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
80
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
81 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
82 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
83 dcArgBool((DCCallVM*)vm, b);//@@@test
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
84 }
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
85
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
86 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
87 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
88 dcArgChar((DCCallVM*)vm, b);//@@@test
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
89 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
90
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
91 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
92 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
93 dcArgShort((DCCallVM*)vm, s);//@@@test
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
94 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
95
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
96 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
97 {
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
98 dcArgInt((DCCallVM*)vm, i);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
99 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
100
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
101 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
102 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
103 dcArgLong((DCCallVM*)vm, l);//@@@test
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
104 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
105
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
106 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
107 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
108 dcArgLongLong((DCCallVM*)vm, l);//@@@test
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
109 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
110
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
111 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
112 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
113 dcArgFloat((DCCallVM*)vm, f);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
114 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
115
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
116 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
117 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
118 dcArgDouble((DCCallVM*)vm, d);
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
119 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
120
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
121 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
122 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
123 dcArgPointer((DCCallVM*)vm, (DCpointer)l);//@@@test
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
124 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
125
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
126 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
127 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
128 dcArgPointer((DCCallVM*)vm, (DCpointer)o);//@@@test
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
129 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
130
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
131 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
132 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
133 const char *sz = (*pEnv)->GetStringUTFChars(pEnv, s, NULL);
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
134 if(sz != NULL) {
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
135 dcArgPointer((DCCallVM*)vm, (DCpointer)sz);
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
136
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
137 // 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
138 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
139 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
140 gc_jstr[gc_snum] = s;
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
141 gc_cstr[gc_snum] = sz;
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
142 ++gc_snum;
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
143 }
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
144 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
145
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
146 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
147 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
148 dcCallVoid((DCCallVM*)vm, (DCpointer)target);//@@@test
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
149 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
150
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
151 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
152 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
153 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
154 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
155
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
156 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
157 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
158 return dcCallChar((DCCallVM*)vm, (DCpointer)target);//@@@test
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
159 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
160
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
161 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
162 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
163 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
164 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
165
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
166 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
167 {
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
168 return dcCallInt((DCCallVM*)vm, (DCpointer)target);
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
169 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
170
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
171 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
172 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
173 return dcCallLong((DCCallVM*)vm, (DCpointer)target);//@@@test
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
174 }
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
175
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
176 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
177 {
21
40a2c4198016 - working jdc (but with memleaks, currently)
cslag
parents: 20
diff changeset
178 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
179 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
180
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
181 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
182 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
183 return dcCallFloat((DCCallVM*)vm, (DCpointer)target);
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
184 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
185
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
186 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
187 {
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
188 return dcCallDouble((DCCallVM*)vm, (DCpointer)target);
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
189 }
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
190
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
191 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
192 {
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
193 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
194 }
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
195
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
196 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
197 {
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
198 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
199 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
200
20
77ca609422f1 - first working build of new java binding
cslag
parents: 19
diff changeset
201 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
202 {
22
4ee8d6aa7721 - java binding cleanup, exposed free functions (not very oo, this entire binding)
cslag
parents: 21
diff changeset
203 return dcGetError((DCCallVM*)vm);
18
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
204 }
3bfef07b0cd9 - cleanup of non-working java binding, restart work, somewhat different interface
cslag
parents: 0
diff changeset
205