Debian Codegraph @

bindings/jni/czmq-jni/src/main/c/org_zeromq_czmq_Zosc.c

raw
1 /*
2 ################################################################################
3 # THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
4 # Read the zproject/README.md for information about making permanent changes. #
5 ################################################################################
6 */
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <jni.h>
10 #include "czmq.h"
11 #include "org_zeromq_czmq_Zosc.h"
12
13 JNIEXPORT jlong JNICALL
14 Java_org_zeromq_czmq_Zosc__1_1new (JNIEnv *env, jclass c, jstring address)
15 {
16 char *address_ = (char *) (*env)->GetStringUTFChars (env, address, NULL);
17 // Disable CZMQ signal handling; allow Java to deal with it
18 zsys_handler_set (NULL);
19 jlong new_ = (jlong) (intptr_t) zosc_new (address_);
20 (*env)->ReleaseStringUTFChars (env, address, address_);
21 return new_;
22 }
23
24 JNIEXPORT jlong JNICALL
25 Java_org_zeromq_czmq_Zosc__1_1fromframe (JNIEnv *env, jclass c, jlong frame)
26 {
27 jlong fromframe_ = (jlong) (intptr_t) zosc_fromframe ((zframe_t *) (intptr_t) frame);
28 return fromframe_;
29 }
30
31 JNIEXPORT jlong JNICALL
32 Java_org_zeromq_czmq_Zosc__1_1frommem (JNIEnv *env, jclass c, jbyteArray data, jlong size)
33 {
34 jbyte *data_ = (byte *) (*env)->GetByteArrayElements (env, data, 0);
35 jlong frommem_ = (jlong) (intptr_t) zosc_frommem (data_, (size_t) size);
36 (*env)->ReleaseByteArrayElements (env, data, (jbyte *) data_, 0);
37 return frommem_;
38 }
39
40 JNIEXPORT jlong JNICALL
41 Java_org_zeromq_czmq_Zosc__1_1create (JNIEnv *env, jclass c, jstring address, jstring format)
42 {
43 char *address_ = (char *) (*env)->GetStringUTFChars (env, address, NULL);
44 char *format_ = (char *) (*env)->GetStringUTFChars (env, format, NULL);
45 jlong create_ = (jlong) (intptr_t) zosc_create (address_, format_);
46 (*env)->ReleaseStringUTFChars (env, address, address_);
47 (*env)->ReleaseStringUTFChars (env, format, format_);
48 return create_;
49 }
50
51 JNIEXPORT void JNICALL
52 Java_org_zeromq_czmq_Zosc__1_1destroy (JNIEnv *env, jclass c, jlong self)
53 {
54 zosc_destroy ((zosc_t **) &self);
55 }
56
57 JNIEXPORT jlong JNICALL
58 Java_org_zeromq_czmq_Zosc__1_1size (JNIEnv *env, jclass c, jlong self)
59 {
60 jlong size_ = (jlong) zosc_size ((zosc_t *) (intptr_t) self);
61 return size_;
62 }
63
64 JNIEXPORT jbyteArray JNICALL
65 Java_org_zeromq_czmq_Zosc__1_1data (JNIEnv *env, jclass c, jlong self)
66 {
67 jbyte *data_ = (jbyte *) zosc_data ((zosc_t *) (intptr_t) self);
68 jint return_size_ = (jint) zosc_size ((zosc_t *) (intptr_t) self);
69 jbyteArray return_data_ = (*env)->NewByteArray (env, return_size_);
70 (*env)->SetByteArrayRegion (env, return_data_, 0, return_size_, (jbyte *) data_);
71 return return_data_;
72 }
73
74 JNIEXPORT jstring JNICALL
75 Java_org_zeromq_czmq_Zosc__1_1address (JNIEnv *env, jclass c, jlong self)
76 {
77 char *address_ = (char *) zosc_address ((zosc_t *) (intptr_t) self);
78 jstring return_string_ = (*env)->NewStringUTF (env, address_);
79 return return_string_;
80 }
81
82 JNIEXPORT jstring JNICALL
83 Java_org_zeromq_czmq_Zosc__1_1format (JNIEnv *env, jclass c, jlong self)
84 {
85 char *format_ = (char *) zosc_format ((zosc_t *) (intptr_t) self);
86 jstring return_string_ = (*env)->NewStringUTF (env, format_);
87 return return_string_;
88 }
89
90 JNIEXPORT jint JNICALL
91 Java_org_zeromq_czmq_Zosc__1_1append (JNIEnv *env, jclass c, jlong self, jstring format)
92 {
93 char *format_ = (char *) (*env)->GetStringUTFChars (env, format, NULL);
94 jint append_ = (jint) zosc_append ((zosc_t *) (intptr_t) self, format_);
95 (*env)->ReleaseStringUTFChars (env, format, format_);
96 return append_;
97 }
98
99 JNIEXPORT jint JNICALL
100 Java_org_zeromq_czmq_Zosc__1_1retr (JNIEnv *env, jclass c, jlong self, jstring format)
101 {
102 char *format_ = (char *) (*env)->GetStringUTFChars (env, format, NULL);
103 jint retr_ = (jint) zosc_retr ((zosc_t *) (intptr_t) self, format_);
104 (*env)->ReleaseStringUTFChars (env, format, format_);
105 return retr_;
106 }
107
108 JNIEXPORT jlong JNICALL
109 Java_org_zeromq_czmq_Zosc__1_1dup (JNIEnv *env, jclass c, jlong self)
110 {
111 jlong dup_ = (jlong) (intptr_t) zosc_dup ((zosc_t *) (intptr_t) self);
112 return dup_;
113 }
114
115 JNIEXPORT jlong JNICALL
116 Java_org_zeromq_czmq_Zosc__1_1pack (JNIEnv *env, jclass c, jlong self)
117 {
118 jlong pack_ = (jlong) (intptr_t) zosc_pack ((zosc_t *) (intptr_t) self);
119 return pack_;
120 }
121
122 JNIEXPORT jlong JNICALL
123 Java_org_zeromq_czmq_Zosc__1_1packx (JNIEnv *env, jclass c, jlong self)
124 {
125 jlong packx_ = (jlong) (intptr_t) zosc_packx ((zosc_t **) &self);
126 return packx_;
127 }
128
129 JNIEXPORT jlong JNICALL
130 Java_org_zeromq_czmq_Zosc__1_1unpack (JNIEnv *env, jclass c, jlong frame)
131 {
132 jlong unpack_ = (jlong) (intptr_t) zosc_unpack ((zframe_t *) (intptr_t) frame);
133 return unpack_;
134 }
135
136 JNIEXPORT void JNICALL
137 Java_org_zeromq_czmq_Zosc__1_1print (JNIEnv *env, jclass c, jlong self)
138 {
139 zosc_print ((zosc_t *) (intptr_t) self);
140 }
141
142 JNIEXPORT jboolean JNICALL
143 Java_org_zeromq_czmq_Zosc__1_1is (JNIEnv *env, jclass c, jlong self)
144 {
145 jboolean is_ = (jboolean) zosc_is ((void *) (intptr_t) self);
146 return is_;
147 }
148
149 JNIEXPORT jlong JNICALL
150 Java_org_zeromq_czmq_Zosc__1_1first (JNIEnv *env, jclass c, jlong self, jchar type)
151 {
152 jlong first_ = (jlong) (intptr_t) zosc_first ((zosc_t *) (intptr_t) self, (char *) (intptr_t) &type);
153 return first_;
154 }
155
156 JNIEXPORT jlong JNICALL
157 Java_org_zeromq_czmq_Zosc__1_1next (JNIEnv *env, jclass c, jlong self, jchar type)
158 {
159 jlong next_ = (jlong) (intptr_t) zosc_next ((zosc_t *) (intptr_t) self, (char *) (intptr_t) &type);
160 return next_;
161 }
162
163 JNIEXPORT jlong JNICALL
164 Java_org_zeromq_czmq_Zosc__1_1last (JNIEnv *env, jclass c, jlong self, jchar type)
165 {
166 jlong last_ = (jlong) (intptr_t) zosc_last ((zosc_t *) (intptr_t) self, (char *) (intptr_t) &type);
167 return last_;
168 }
169
170 JNIEXPORT jint JNICALL
171 Java_org_zeromq_czmq_Zosc__1_1popInt32 (JNIEnv *env, jclass c, jlong self, jint val)
172 {
173 jint pop_int32_ = (jint) zosc_pop_int32 ((zosc_t *) (intptr_t) self, (int *) (intptr_t) &val);
174 return pop_int32_;
175 }
176
177 JNIEXPORT jint JNICALL
178 Java_org_zeromq_czmq_Zosc__1_1popInt64 (JNIEnv *env, jclass c, jlong self, jlong val)
179 {
180 jint pop_int64_ = (jint) zosc_pop_int64 ((zosc_t *) (intptr_t) self, (int64_t *) (intptr_t) &val);
181 return pop_int64_;
182 }
183
184 JNIEXPORT jint JNICALL
185 Java_org_zeromq_czmq_Zosc__1_1popFloat (JNIEnv *env, jclass c, jlong self, jfloat val)
186 {
187 jint pop_float_ = (jint) zosc_pop_float ((zosc_t *) (intptr_t) self, (float *) (intptr_t) &val);
188 return pop_float_;
189 }
190
191 JNIEXPORT jint JNICALL
192 Java_org_zeromq_czmq_Zosc__1_1popDouble (JNIEnv *env, jclass c, jlong self, jdouble val)
193 {
194 jint pop_double_ = (jint) zosc_pop_double ((zosc_t *) (intptr_t) self, (double *) (intptr_t) &val);
195 return pop_double_;
196 }
197
198 JNIEXPORT jint JNICALL
199 Java_org_zeromq_czmq_Zosc__1_1popChar (JNIEnv *env, jclass c, jlong self, jchar val)
200 {
201 jint pop_char_ = (jint) zosc_pop_char ((zosc_t *) (intptr_t) self, (char *) (intptr_t) &val);
202 return pop_char_;
203 }
204
205 JNIEXPORT jint JNICALL
206 Java_org_zeromq_czmq_Zosc__1_1popBool (JNIEnv *env, jclass c, jlong self, jboolean val)
207 {
208 jint pop_bool_ = (jint) zosc_pop_bool ((zosc_t *) (intptr_t) self, (bool *) (intptr_t) &val);
209 return pop_bool_;
210 }
211
212 JNIEXPORT jint JNICALL
213 Java_org_zeromq_czmq_Zosc__1_1popMidi (JNIEnv *env, jclass c, jlong self, jint val)
214 {
215 jint pop_midi_ = (jint) zosc_pop_midi ((zosc_t *) (intptr_t) self, (uint32_t *) (intptr_t) &val);
216 return pop_midi_;
217 }
218
219 JNIEXPORT void JNICALL
220 Java_org_zeromq_czmq_Zosc__1_1test (JNIEnv *env, jclass c, jboolean verbose)
221 {
222 zosc_test ((bool) verbose);
223 }
224