Debian Codegraph @

lang-maps/jni/src/bmjni.c

raw
1 #include "io_bitmagic_core_BVector0.h"
2 #include "io_bitmagic_core_BVIterator0.h"
3 #include "libbm.h"
4
5 #include <string.h>
6 #include <stdio.h>
7
8 #define exec(x) \
9 switch(x) { \
10 case BM_OK: \
11 break; \
12 case BM_ERR_BADALLOC: \
13 { \
14 jclass ex = (*env)->FindClass(env, "java/lang/RuntimeException"); \
15 (*env)->ThrowNew(env, ex, BM_ERR_BADALLOC_MSG " in native call: " #x); \
16 break; \
17 } \
18 case BM_ERR_BADARG: \
19 { \
20 jclass ex = (*env)->FindClass(env, "java/lang/IllegalArgumentException"); \
21 (*env)->ThrowNew(env, ex, BM_ERR_BADARG_MSG " in: " #x); \
22 break; \
23 } \
24 case BM_ERR_RANGE: \
25 { \
26 jclass ex = (*env)->FindClass(env, "java/lang/IndexOutOfBoundsException"); \
27 (*env)->ThrowNew(env, ex, BM_ERR_RANGE_MSG " in: " #x); \
28 break; \
29 } \
30 case BM_ERR_CPU: \
31 { \
32 jclass ex = (*env)->FindClass(env, "java/lang/RuntimeException"); \
33 (*env)->ThrowNew(env, ex, BM_ERR_CPU_MSG " in: " #x); \
34 break; \
35 } \
36 default: \
37 { \
38 jclass ex = (*env)->FindClass(env, "java/lang/RuntimeException"); \
39 (*env)->ThrowNew(env, ex, "Unknown error in native call: " #x); \
40 break; \
41 }}
42
43 #define null_out_of_memory(x) \
44 if ((x) == NULL) { \
45 jclass ex = (*env)->FindClass(env, "java/lang/OutOfMemoryError"); \
46 (*env)->ThrowNew(env, ex, "Out of memory error in native call andArr0()"); \
47 return; \
48 }
49
50 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVector0_init0
51 (JNIEnv *env, jclass clazz, jlong ptr) {
52 exec(BM_init((void*)ptr));
53 }
54
55 /*
56 * Class: io_bitmagic_core_BVector0
57 * Method: create0
58 * Signature: (IJ)J
59 */
60 JNIEXPORT jlong JNICALL Java_io_bitmagic_core_BVector0_create0
61 (JNIEnv *env, jclass clazz, jint strategy, jlong size) {
62 BM_BVHANDLE ptr;
63 exec(BM_bvector_construct(&ptr, size));
64 return (jlong)ptr;
65 }
66
67 /*
68 * Class: io_bitmagic_core_BVector0
69 * Method: clone0
70 * Signature: (J)J
71 */
72 JNIEXPORT jlong JNICALL Java_io_bitmagic_core_BVector0_copy0
73 (JNIEnv *env, jclass clazz, jlong ptr) {
74 BM_BVHANDLE cptr;
75 exec(BM_bvector_construct_copy(&cptr, (BM_BVHANDLE)ptr));
76 return (jlong)cptr;
77 }
78
79 /*
80 * Class: io_bitmagic_core_BVector0
81 * Method: dispose0
82 * Signature: (J)V
83 */
84 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVector0_dispose0
85 (JNIEnv *env, jclass clazz, jlong ptr) {
86 exec(BM_bvector_free((BM_BVHANDLE)ptr));
87 }
88
89 /*
90 * Class: io_bitmagic_core_BVector0
91 * Method: version0
92 * Signature: ()Ljava/lang/String;
93 */
94 JNIEXPORT jstring JNICALL Java_io_bitmagic_core_BVector0_version0
95 (JNIEnv *env, jclass clazz) {
96 int major;
97 int minor;
98 int patch;
99 BM_version(&major, &minor, &patch);
100
101 char version[64];
102 snprintf(version, 64, "%d.%d.%d", major, minor, patch);
103 return (*env)->NewStringUTF(env, version);
104 }
105
106 /*
107 * Class: io_bitmagic_core_BVector0
108 * Method: copyright0
109 * Signature: ()Ljava/lang/String;
110 */
111 JNIEXPORT jstring JNICALL Java_io_bitmagic_core_BVector0_copyright0
112 (JNIEnv *env, jclass clazz) {
113 return (*env)->NewStringUTF(env, BM_version(0, 0, 0));
114 }
115
116 /*
117 * Class: io_bitmagic_core_BVector0
118 * Method: getSize0
119 * Signature: (J)J
120 */
121 JNIEXPORT jlong JNICALL Java_io_bitmagic_core_BVector0_getSize0
122 (JNIEnv *env, jclass clazz, jlong ptr) {
123 unsigned int size;
124 exec(BM_bvector_get_size((BM_BVHANDLE)ptr, &size));
125 return (jlong)size;
126 }
127
128 /*
129 * Class: io_bitmagic_core_BVector0
130 * Method: setSize0
131 * Signature: (JJ)V
132 */
133 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVector0_setSize0
134 (JNIEnv *env, jclass clazz, jlong ptr, jlong size) {
135 exec(BM_bvector_set_size((BM_BVHANDLE)ptr, size));
136 }
137
138 /*
139 * Class: io_bitmagic_core_BVector0
140 * Method: set0
141 * Signature: (JJZ)V
142 */
143 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVector0_set0
144 (JNIEnv *env, jclass clazz, jlong ptr, jlong idx, jboolean bit) {
145 exec(BM_bvector_set_bit((BM_BVHANDLE)ptr, (unsigned int)idx, bit & 1));
146 }
147
148 /*
149 * Class: io_bitmagic_core_BVector0
150 * Method: inc0
151 * Signature: (JJ)I
152 */
153 JNIEXPORT jint JNICALL Java_io_bitmagic_core_BVector0_inc0
154 (JNIEnv *env, jclass clazz, jlong ptr, jlong idx) {
155 int co;
156 exec(BM_bvector_inc_bit((BM_BVHANDLE)ptr, (unsigned int)idx, &co));
157 return (jint)co;
158 }
159
160 /*
161 * Class: io_bitmagic_core_BVector0
162 * Method: setConditional0
163 * Signature: (JJZZ)Z
164 */
165 JNIEXPORT jboolean JNICALL Java_io_bitmagic_core_BVector0_setConditional0
166 (JNIEnv *env, jclass clazz, jlong ptr, jlong idx, jboolean bit, jboolean condition) {
167 int changed;
168 exec(BM_bvector_set_bit_conditional((BM_BVHANDLE)ptr, (unsigned int)idx, bit ? 1 : 0, condition ? 1 : 0, &changed));
169 return (jboolean)changed;
170 }
171
172 /*
173 * Class: io_bitmagic_core_BVector0
174 * Method: flip0
175 * Signature: (JJ)V
176 */
177 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVector0_flip0
178 (JNIEnv *env, jclass clazz, jlong ptr, jlong idx) {
179 exec(BM_bvector_flip_bit((BM_BVHANDLE)ptr, (unsigned int)idx))
180 }
181
182 /*
183 * Class: io_bitmagic_core_BVector0
184 * Method: setAll0
185 * Signature: (J)V
186 */
187 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVector0_setAll0
188 (JNIEnv *env, jclass clazz, jlong ptr) {
189 exec(BM_bvector_set((BM_BVHANDLE)ptr));
190 }
191
192 /*
193 * Class: io_bitmagic_core_BVector0
194 * Method: setRange0
195 * Signature: (JJJZ)V
196 */
197 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVector0_setRange0
198 (JNIEnv *env, jclass clazz, jlong ptr, jlong left, jlong right, jboolean bit) {
199 exec(BM_bvector_set_range((BM_BVHANDLE)ptr, (unsigned int)left, (unsigned int)right, bit ? 1 : 0));
200 }
201
202 /*
203 * Class: io_bitmagic_core_BVector0
204 * Method: invert0
205 * Signature: (J)V
206 */
207 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVector0_invert0
208 (JNIEnv *env, jclass clazz, jlong ptr) {
209 exec(BM_bvector_invert((BM_BVHANDLE)ptr));
210 }
211
212 /*
213 * Class: io_bitmagic_core_BVector0
214 * Method: clear0
215 * Signature: (JI)V
216 */
217 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVector0_clear0
218 (JNIEnv *env, jclass clazz, jlong ptr, jint free_mem) {
219 exec(BM_bvector_clear((BM_BVHANDLE)ptr, free_mem));
220 }
221
222 /*
223 * Class: io_bitmagic_core_BVector0
224 * Method: extract0
225 * Signature: (JJ)J
226 */
227 JNIEXPORT jlong JNICALL Java_io_bitmagic_core_BVector0_extract0
228 (JNIEnv *env, jclass clazz, jlong ptr, jlong start) {
229 unsigned int next;
230 exec(BM_bvector_extract_next((BM_BVHANDLE)ptr, (unsigned int)start, &next));
231 return next == 0 ? -1 : (jlong)next;
232 }
233
234 /*
235 * Class: io_bitmagic_core_BVector0
236 * Method: get0
237 * Signature: (JJ)Z
238 */
239 JNIEXPORT jboolean JNICALL Java_io_bitmagic_core_BVector0_get0
240 (JNIEnv *env, jclass clazz, jlong ptr, jlong idx) {
241 int ret;
242 exec(BM_bvector_get_bit((BM_BVHANDLE)ptr, (unsigned int)idx, &ret));
243 return (jboolean)ret;
244 }
245
246 /*
247 * Class: io_bitmagic_core_BVector0
248 * Method: count0
249 * Signature: (J)J
250 */
251 JNIEXPORT jlong JNICALL Java_io_bitmagic_core_BVector0_count0
252 (JNIEnv *env, jclass clazz, jlong ptr) {
253 unsigned int count;
254 exec(BM_bvector_count((BM_BVHANDLE)ptr, &count));
255 return (jlong)count;
256 }
257
258 /*
259 * Class: io_bitmagic_core_BVector0
260 * Method: countInRange0
261 * Signature: (JJJ)J
262 */
263 JNIEXPORT jlong JNICALL Java_io_bitmagic_core_BVector0_countInRange0
264 (JNIEnv *env, jclass clazz, jlong ptr, jlong left, jlong right) {
265 unsigned int count;
266 exec(BM_bvector_count_range((BM_BVHANDLE)ptr, (unsigned int)left, (unsigned int)right, &count));
267 return (jlong)count;
268 }
269
270 /*
271 * Class: io_bitmagic_core_BVector0
272 * Method: nonEmpty0
273 * Signature: (J)Z
274 */
275 JNIEXPORT jboolean JNICALL Java_io_bitmagic_core_BVector0_nonEmpty0
276 (JNIEnv *env, jclass clazz, jlong ptr) {
277 int val;
278 exec(BM_bvector_any((BM_BVHANDLE)ptr, &val));
279 return (jboolean)val;
280 }
281
282 /*
283 * Class: io_bitmagic_core_BVector0
284 * Method: findFirst0
285 * Signature: (JJ)J
286 */
287 JNIEXPORT jlong JNICALL Java_io_bitmagic_core_BVector0_findFirst0
288 (JNIEnv *env, jclass clazz, jlong ptr, jlong start) {
289 int found;
290 unsigned int pos;
291 exec(BM_bvector_find((BM_BVHANDLE)ptr, (unsigned int)start, &pos, &found));
292 if (found)
293 return (jlong)pos;
294 else
295 return (jlong)-1;
296 }
297
298 /*
299 * Class: io_bitmagic_core_BVector0
300 * Method: findLast0
301 * Signature: (J)J
302 */
303 JNIEXPORT jlong JNICALL Java_io_bitmagic_core_BVector0_findReverse0
304 (JNIEnv *env, jclass clazz, jlong ptr) {
305 int found;
306 unsigned int pos;
307 exec(BM_bvector_find_reverse((BM_BVHANDLE)ptr, &pos, &found));
308 if (found)
309 return (jlong)pos;
310 else
311 return (jlong)-1;
312 }
313
314 /*
315 * Class: io_bitmagic_core_BVector0
316 * Method: compare0
317 * Signature: (JJ)I
318 */
319 JNIEXPORT jint JNICALL Java_io_bitmagic_core_BVector0_compare0
320 (JNIEnv *env, jclass clazz, jlong ptr1, jlong ptr2) {
321 int comp;
322 exec(BM_bvector_compare((BM_BVHANDLE)ptr1, (BM_BVHANDLE)ptr2, &comp));
323 return (jint)comp;
324 }
325
326 /*
327 * Class: io_bitmagic_core_BVector0
328 * Method: optimize0
329 * Signature: (JI)Lio/bitmagic/BitVectorStat;
330 */
331 JNIEXPORT jobject JNICALL Java_io_bitmagic_core_BVector0_optimize0
332 (JNIEnv *env, jclass clazz, jlong ptr, jint opt_mode) {
333 struct BM_bvector_statistics stat;
334 jclass clazzect;
335 jmethodID constructor;
336 jobject cls;
337
338 exec(BM_bvector_optimize((BM_BVHANDLE)ptr, opt_mode, &stat));
339 cls = (*env)->FindClass(env, "io/bitmagic/core/BitVectorStat");
340 constructor = (*env)->GetMethodID(env, cls, "<init>", "(JJJJ)V");
341 jobject object = (*env)->NewObject(env, cls, constructor, (jlong)stat.bit_blocks, (jlong)stat.gap_blocks, (jlong)stat.max_serialize_mem, (jlong)stat.memory_used);
342 return object;
343 }
344
345 /*
346 * Class: io_bitmagic_core_BVector0
347 * Method: calcStat0
348 * Signature: (J)Lio/bitmagic/BitVectorStat;
349 */
350 JNIEXPORT jobject JNICALL Java_io_bitmagic_core_BVector0_calcStat0
351 (JNIEnv *env, jclass clazz, jlong ptr) {
352 struct BM_bvector_statistics stat;
353 jclass clazzect;
354 jmethodID constructor;
355 jobject cls;
356
357 exec(BM_bvector_calc_stat((BM_BVHANDLE)ptr, &stat));
358 cls = (*env)->FindClass(env, "io/bitmagic/core/BitVectorStat");
359 constructor = (*env)->GetMethodID(env, cls, "<init>", "(JJJJ)V");
360 jobject object = (*env)->NewObject(env, cls, constructor, (jlong)stat.bit_blocks, (jlong)stat.gap_blocks, (jlong)stat.max_serialize_mem, (jlong)stat.memory_used);
361 return object;
362 }
363
364 /***************************************** BitVector operations ****************************************/
365
366 /*
367 * Class: io_bitmagic_core_BVector0
368 * Method: operation0
369 * Signature: (JJI)V
370 */
371 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVector0_operation0
372 (JNIEnv *env, jclass clazz, jlong dst, jlong src, jint op) {
373 exec(BM_bvector_combine_operation((BM_BVHANDLE)dst, (BM_BVHANDLE)src, op));
374 }
375
376 /*
377 * Class: io_bitmagic_core_BVector0
378 * Method: and0
379 * Signature: (JJ)V
380 */
381 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVector0_and0
382 (JNIEnv *env, jclass clazz, jlong dst, jlong src) {
383 exec(BM_bvector_combine_AND((BM_BVHANDLE)dst, (BM_BVHANDLE)src));
384 }
385
386 /*
387 * Class: io_bitmagic_core_BVector0
388 * Method: or0
389 * Signature: (JJ)V
390 */
391 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVector0_or0
392 (JNIEnv *env, jclass clazz, jlong dst, jlong src) {
393 exec(BM_bvector_combine_OR((BM_BVHANDLE)dst, (BM_BVHANDLE)src));
394 }
395
396 /*
397 * Class: io_bitmagic_core_BVector0
398 * Method: sub0
399 * Signature: (JJ)V
400 */
401 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVector0_sub0
402 (JNIEnv *env, jclass clazz, jlong dst, jlong src) {
403 exec(BM_bvector_combine_SUB((BM_BVHANDLE)dst, (BM_BVHANDLE)src));
404 }
405
406 /*
407 * Class: io_bitmagic_core_BVector0
408 * Method: xor0
409 * Signature: (JJ)V
410 */
411 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVector0_xor0
412 (JNIEnv *env, jclass clazz, jlong dst, jlong src) {
413 exec(BM_bvector_combine_XOR((BM_BVHANDLE)dst, (BM_BVHANDLE)src));
414 }
415
416 /***************************************** BitVector operations with arrays ****************************************/
417
418 /*
419 * Class: io_bitmagic_core_BVector0
420 * Method: andArr0
421 * Signature: (J[I)V
422 */
423 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVector0_andArr0
424 (JNIEnv *env, jclass class, jlong dst, jintArray arr) {
425 unsigned int *start = (unsigned int*)(*env)->GetPrimitiveArrayCritical(env, arr, 0);
426 null_out_of_memory(start);
427 jsize size = (*env)->GetArrayLength(env, arr);
428 exec(BM_bvector_combine_AND_arr((BM_BVHANDLE)dst, start, start + size));
429 (*env)->ReleasePrimitiveArrayCritical(env, arr, start, JNI_ABORT); // The array is read-only
430 }
431
432 /*
433 * Class: io_bitmagic_core_BVector0
434 * Method: andArrSorted0
435 * Signature: (J[I)V
436 */
437 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVector0_andArrSorted0
438 (JNIEnv *env, jclass class, jlong dst, jintArray arr) {
439 unsigned int *start = (unsigned int*)(*env)->GetPrimitiveArrayCritical(env, arr, 0);
440 null_out_of_memory(start);
441 jsize size = (*env)->GetArrayLength(env, arr);
442 exec(BM_bvector_combine_AND_arr_sorted((BM_BVHANDLE)dst, start, start + size));
443 (*env)->ReleasePrimitiveArrayCritical(env, arr, start, JNI_ABORT); // The array is read-only
444 }
445
446 /*
447 * Class: io_bitmagic_core_BVector0
448 * Method: orArr0
449 * Signature: (J[I)V
450 */
451 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVector0_orArr0
452 (JNIEnv *env, jclass class, jlong dst, jintArray arr) {
453 unsigned int *start = (unsigned int*)(*env)->GetPrimitiveArrayCritical(env, arr, 0);
454 null_out_of_memory(start);
455 jsize size = (*env)->GetArrayLength(env, arr);
456 exec(BM_bvector_combine_OR_arr((BM_BVHANDLE)dst, start, start + size));
457 (*env)->ReleasePrimitiveArrayCritical(env, arr, start, JNI_ABORT); // The array is read-only
458 }
459
460 /*
461 * Class: io_bitmagic_core_BVector0
462 * Method: xorArr0
463 * Signature: (J[I)V
464 */
465 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVector0_xorArr0
466 (JNIEnv *env, jclass class, jlong dst, jintArray arr) {
467 unsigned int *start = (unsigned int*)(*env)->GetPrimitiveArrayCritical(env, arr, 0);
468 null_out_of_memory(start);
469 jsize size = (*env)->GetArrayLength(env, arr);
470 exec(BM_bvector_combine_XOR_arr((BM_BVHANDLE)dst, start, start + size));
471 (*env)->ReleasePrimitiveArrayCritical(env, arr, start, JNI_ABORT); // The array is read-only
472 }
473
474 /*
475 * Class: io_bitmagic_core_BVector0
476 * Method: subArr0
477 * Signature: (J[I)V
478 */
479 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVector0_subArr0
480 (JNIEnv *env, jclass class, jlong dst, jintArray arr) {
481 unsigned int *start = (unsigned int*)(*env)->GetPrimitiveArrayCritical(env, arr, 0);
482 null_out_of_memory(start);
483 jsize size = (*env)->GetArrayLength(env, arr);
484 exec(BM_bvector_combine_SUB_arr((BM_BVHANDLE)dst, start, start + size));
485 (*env)->ReleasePrimitiveArrayCritical(env, arr, start, JNI_ABORT); // The array is read-only
486 }
487
488 /***************************************** BitVector serialization ****************************************/
489 /*
490 * Class: io_bitmagic_core_BVector0
491 * Method: deserialize0
492 * Signature: (J[B)V
493 */
494 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVector0_deserialize0
495 (JNIEnv *env, jclass clazz, jlong ptr, jbyteArray ba) {
496 void *start = (*env)->GetPrimitiveArrayCritical(env, ba, 0);
497 if (start == NULL) {
498 jclass ex = (*env)->FindClass(env, "java/lang/OutOfMemoryError");
499 (*env)->ThrowNew(env, ex, "Out of memory error in native call deserailize0()");
500 return;
501 }
502 jsize size = (*env)->GetArrayLength(env, ba);
503 exec(BM_bvector_deserialize((BM_BVHANDLE)ptr, (const char*)start, size));
504 (*env)->ReleasePrimitiveArrayCritical(env, ba, start, JNI_ABORT); // The array is read-only
505 }
506
507 /*
508 * Class: io_bitmagic_core_BVector0
509 * Method: serialize0
510 * Signature: (J[B)J
511 */
512 JNIEXPORT jlong JNICALL Java_io_bitmagic_core_BVector0_serialize0
513 (JNIEnv *env, jclass clazz, jlong ptr, jbyteArray ba) {
514 void *start = (*env)->GetPrimitiveArrayCritical(env, ba, 0);
515 if (start == NULL) {
516 jclass ex = (*env)->FindClass(env, "java/lang/OutOfMemoryError");
517 (*env)->ThrowNew(env, ex, "Out of memory error in native call serailize0()");
518 return 0;
519 }
520 jsize size = (*env)->GetArrayLength(env, ba);
521 size_t actualSize;
522
523 exec(BM_bvector_serialize((BM_BVHANDLE)ptr, start, size, &actualSize));
524 (*env)->ReleasePrimitiveArrayCritical(env, ba, start, 0);
525 return actualSize;
526 }
527
528 /***************************************** BitVector Iterator ****************************************/
529 /*
530 * Class: io_bitmagic_core_BVIterator0
531 * Method: create0
532 * Signature: (J)J
533 */
534 JNIEXPORT jlong JNICALL Java_io_bitmagic_core_BVIterator0_create0
535 (JNIEnv *env, jclass clazz, jlong bvPtr) {
536 BM_BVEHANDLE eh;
537 exec(BM_bvector_enumerator_construct((BM_BVHANDLE)bvPtr, &eh));
538 return (jlong)eh;
539 }
540
541 /*
542 * Class: io_bitmagic_core_BVIterator0
543 * Method: dispose0
544 * Signature: (J)V
545 */
546 JNIEXPORT void JNICALL Java_io_bitmagic_core_BVIterator0_dispose0
547 (JNIEnv *env, jclass clazz, jlong ptr) {
548 exec(BM_bvector_enumerator_free((BM_BVEHANDLE)ptr));
549 }
550
551 /*
552 * Class: io_bitmagic_core_BVIterator0
553 * Method: isValid0
554 * Signature: (J)Z
555 */
556 JNIEXPORT jboolean JNICALL Java_io_bitmagic_core_BVIterator0_isValid0
557 (JNIEnv *env, jclass clazz, jlong ptr) {
558 int valid;
559 exec(BM_bvector_enumerator_is_valid((BM_BVEHANDLE)ptr, &valid));
560 return (jboolean)(valid != 0);
561 }
562
563 /*
564 * Class: io_bitmagic_core_BVIterator0
565 * Method: get0
566 * Signature: (J)J
567 */
568 JNIEXPORT jlong JNICALL Java_io_bitmagic_core_BVIterator0_get0
569 (JNIEnv *env, jclass clazz, jlong ptr) {
570 unsigned int value;
571 exec(BM_bvector_enumerator_get_value((BM_BVEHANDLE)ptr, &value));
572 return (jlong)value;
573 }
574
575 /*
576 * Class: io_bitmagic_core_BVIterator0
577 * Method: next0
578 * Signature: (J)Z
579 */
580 JNIEXPORT jboolean JNICALL Java_io_bitmagic_core_BVIterator0_next0
581 (JNIEnv *env, jclass clazz, jlong ptr) {
582 unsigned int value;
583 int valid;
584 exec(BM_bvector_enumerator_next((BM_BVEHANDLE)ptr, &valid, &value));
585 return (jboolean)(valid != 0);
586 }