Mstdlib-1.24.0
m_io_jni.h
1/* The MIT License (MIT)
2 *
3 * Copyright (c) 2017 Monetra Technologies, LLC.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 * THE SOFTWARE.
22 */
23
24#ifndef __M_IO_JNI_H__
25#define __M_IO_JNI_H__
26
27#include <jni.h>
28
29#include <mstdlib/base/m_defs.h>
30#include <mstdlib/base/m_types.h>
31
32__BEGIN_DECLS
33
34/*! \addtogroup m_io_jni Java JNI helpers
35 * \ingroup m_eventio_semipublic
36 *
37 * Included using the semi-public header of <mstdlib/io/m_io_jni.h>
38 * This is not included by default because it is considered a stable API.
39 *
40 * Java JNI Helper Functions. Primarily used for Android integration where
41 * Bluetooth support requires it. However, nothing here is Android specific
42 * and will never be. This is purely JNI and does not use anything outside
43 * of what's provided by Java itself.
44 *
45 * @{
46 */
47
48
49/*! Initialization function to initialize the Java JNI environment.
50 *
51 * This routine must be called once at startup before any of the M_io_jni helper
52 * functions can be used.
53 *
54 * This implementation only supports a single Java VM instance, globally.
55 *
56 * \param[in] Jvm Initialized JavaVM to use. Must be specified.
57 * \return M_TRUE on success, M_FALSE on failure.
58 */
59M_API M_bool M_io_jni_init(JavaVM *Jvm);
60
61
62/*! Initialization function to initialize the io system for use on Android.
63 *
64 * M_io_jni_init must be called before this function.
65 * This should only be called when building for Android.
66 *
67 * This function must be called in order to use USB-HID devices.
68 *
69 * This function must be called before DNS resolution will work on Android 8
70 * (Oreo) or newer when built targeting SDK 26. Also, the ACCESS_NETWORK_STATE
71 * permission must be present in the Android application.
72 *
73 * \param[in] app_context Android application context. Can be accessed in Java from like so:
74 * getApplicationContext().
75 *
76 * \return M_TRUE on success, M_FALSE on failure.
77 */
78M_API M_bool M_io_jni_android_init(jobject app_context);
79
80
81/*! Retrieve JNI Environment Handle for current thread.
82 *
83 * If thread is not currently assigned a handle, a new one will be created,
84 * otherwise the existing handle will be returned.
85 *
86 * \return JNI Environment Handle or NULL on error
87 */
88M_API JNIEnv *M_io_jni_getenv(void);
89
90
91/*! Retrieve Android Applilcation Contect.
92 *
93 * M_io_jni_android_init must be called to set the context.
94 *
95 * \return Application Context
96 */
98
99
100/*! Output debug text relevant to JNI execution.
101 *
102 * If not using a debug build, this is a no-op, and no information will be output.
103 * This is mostly used internally by the implementation, but people wishing to
104 * implement additional JNI methods might find this useful for debug purposes.
105 *
106 * On Android, this uses the android logging functions, on other systems this
107 * simply outputs the message to stderr.
108 *
109 * \param[in] fmt Standard printf-style format string. A new line will be
110 * automatically added to the output.
111 * \param[in] ... Arguments as referenced in the format string
112 */
113M_API void M_io_jni_debug(const char *fmt, ...);
114
115
116/*! Look up a class based on its path.
117 *
118 * \param[in] env Optional. Java JNI Environment. If not passed will request it from
119 * the JVM. Passing it is an optimization.
120 * \param[in] path The path for the class, such as java/util/HashMap
121 * \return global class reference or NULL on failure.
122 */
123M_API jclass M_io_jni_find_class(JNIEnv *env, const char *path);
124
125
126/*! Convert a Java HashMap into an M_hash_dict_t *.
127 * \param[in] env Optional. Java JNI Environment. If not passed will request it from
128 * the JVM. Passing it is an optimization.
129 * \param[in] map Java Hash Map object to convert.
130 * \return Intialized M_hash_dict_t filled in with the map parameters or NULL on error.
131 */
132M_API M_hash_dict_t *M_io_jni_jhashmap_to_mhashdict(JNIEnv *env, jobject map);
133
134
135/*! Convert an M_hash_dict_t * into a Java HashMap object.
136 * \param[in] env Optional. Java JNI Environment. If not passed will request it from
137 * the JVM. Passing it is an optimization.
138 * \param[in] dict M_hash_dict_t to convert.
139 * \return HashMap Object or NULL on error. The returned object should be released with
140 * M_io_jni_deletelocalref() when no longer needed.
141 */
142M_API jobject M_io_jni_mhashdict_to_jhashmap(JNIEnv *env, M_hash_dict_t *dict);
143
144
145/*! Delete reference to object so garbage collector can destroy it.
146 *
147 * This isn't absolutely necessary to call, but is recommended for long-running routines,
148 * or if using many objects in a loop so you don't run out of descriptors. When control
149 * returns from JNI back to Java, any used JNI objects not manually deleted will be released
150 * if they were not returned into java scope. Once an object is deleted it can no longer
151 * be used, nor can it be returned to Java.
152 *
153 * \param[in] env Optional. Java JNI Environment. If not passed will request it from
154 * the JVM. Passing it is an optimization.
155 * \param[in,out] ref Object reference to be deleted, passed by reference. Will be set
156 * pointer will be set to NULL when dereferenced to ensure it won't
157 * be used again. */
158M_API void M_io_jni_deletelocalref(JNIEnv *env, jobject *ref);
159
160
161/*! Create a global JNI reference to prevent garbage collection of a Java object that may
162 * need to persist past the point where execution is returned to Java.
163 *
164 * If a Java object is held within a C object that needs to persist, and integrator
165 * must mark it as a global reference, then delete the global reference when no longer
166 * needed, otherwise the object will be cleaned up by Java.
167 *
168 * \param[in] env Optional. Java JNI Environment. If not passed will request it from
169 * the JVM. Passing it is an optimization.
170 * \param[in] ref Java object to create a global reference to.
171 * \return Java object with global reference. Must be cleaned up with M_io_jni_create_globalref()
172 * or will cause a resource leak.
173 */
174M_API jobject M_io_jni_create_globalref(JNIEnv *env, jobject ref);
175
176
177/*! Delete the global JNI reference created with M_io_jni_create_globalref()
178 *
179 * \param[in] env Optional. Java JNI Environment. If not passed will request it from
180 * the JVM. Passing it is an optimization.
181 * \param[in,out] ref Object reference to be deleted, passed by reference. Will be set
182 * pointer will be set to NULL when dereferenced to ensure it won't
183 * be used again.
184 */
185M_API void M_io_jni_delete_globalref(JNIEnv *env, jobject *ref);
186
187
188/*! Retrieve length of Array.
189 * \param[in] env Optional. Java JNI Environment. If not passed will request it from
190 * the JVM. Passing it is an optimization.
191 * \param[in] arr Array object to get count.
192 * \return length of array
193 */
194M_API size_t M_io_jni_array_length(JNIEnv *env, jobject arr);
195
196/*! Retrieve an element from an Array.
197 * \param[in] env Optional. Java JNI Environment. If not passed will request it from
198 * the JVM. Passing it is an optimization.
199 * \param[in] arr Array to retrieve element from.
200 * \param[in] idx Array index.
201 * \return Object retrieved from array or NULL on error. The returned object should be
202 * released using M_io_jni_deletelocalref() when no longer needed.
203 */
204M_API jobject M_io_jni_array_element(JNIEnv *env, jobject arr, size_t idx);
205
206
207/*! Convert jstring into C String (allocated, null terminated).
208 * \param[in] env Optional. Java JNI Environment. If not passed will request it from
209 * the JVM. Passing it is an optimization.
210 * \param[in] str jstring to convert into C String
211 * \return Allocated C String, must be freed with M_free(). NULL on error.
212 */
213M_API char *M_io_jni_jstring_to_pchar(JNIEnv *env, jstring str);
214
215
216/*! Convert a C String into a jstring
217 * \param[in] env Optional. Java JNI Environment. If not passed will request it from
218 * the JVM. Passing it is an optimization.
219 * \param[in] str C String to convert into a jstring.
220 * \return jstring object or NULL on error. The returned object should be released using
221 * M_io_jni_deletelocalref() when no longer needed.
222 */
223M_API jstring M_io_jni_pchar_to_jstring(JNIEnv *env, const char *str);
224
225
226/*! Convert a byte array into an unsigned character pointer
227 * \param[in] env Optional. Java JNI Environment. If not passed will request it from
228 * the JVM. Passing it is an optimization.
229 * \param[in] in Byte array to convert to unsigned character data.
230 * \param[in] max_len Maximum length to use, or 0 for full Byte Array.
231 * \param[out] size_out Size of returned buffer.
232 * \return unsigned character buffer, must be freed with M_free(). NULL on error.
233 */
234M_API unsigned char *M_io_jni_jbyteArray_to_puchar(JNIEnv *env, jbyteArray in, size_t max_len, size_t *size_out);
235
236/*! Convert an unsigned character buffer into a jbyteArray
237 * \param[in] env Optional. Java JNI Environment. If not passed will request it from
238 * the JVM. Passing it is an optimization.
239 * \param[in] data Unsigned character data.
240 * \param[in] data_size Size of character data buffer.
241 * \return jbyteArray object or NULL on error. The returned object should be released using
242 * M_io_jni_deletelocalref() when no longer needed.
243 */
244M_API jbyteArray M_io_jni_puchar_to_jbyteArray(JNIEnv *env, const unsigned char *data, size_t data_size);
245
246/*! Zeroize a Byte Array. Typically used for memory security reasons.
247 * \param[in] env Optional. Java JNI Environment. If not passed will request it from
248 * the JVM. Passing it is an optimization.
249 * \param[in] arr Byte Array to zeroize
250 */
251M_API void M_io_jni_jbyteArray_zeroize(JNIEnv *env, jbyteArray arr);
252
253/*! Copy the contents of a Byte Array to an M_buf_t up to the given size.
254 *
255 * \param[in] env Optional. Java JNI Environment. If not passed will request it from
256 * the JVM. Passing it is an optimization.
257 * \param[in] in Byte Array to copy
258 * \param[in] max_len Maximum length of byte array to copy, or 0 for full array.
259 * \param[out] out Initialized M_buf_t to copy data into
260 * \return Number of bytes copied or 0 on error
261 */
262M_API size_t M_io_jni_jbyteArray_to_buf(JNIEnv *env, jbyteArray in, size_t max_len, M_buf_t *out);
263
264/*! Create a new object using the specified method.
265 * \param[out] rv Returned object, passed by reference. Returned object should be
266 * released using M_io_jni_deletelocalref() when no longer needed.
267 * \param[out] error Optional. Buffer to hold error message.
268 * \param[in] error_len Error buffer size.
269 * \param[in] env Optional. Java JNI Environment. If not passed will request it from
270 * the JVM. Passing it is an optimization.
271 * \param[in] method The class initializer method. The method specified should
272 * be in the form of "path/to/class.<init>", and must have been one
273 * of the classes in the global initialization.
274 * \param[in] argc Count of arguments to follow.
275 * \param[in] ... Variable argument list depending on method being called.
276 * \return M_TRUE if the method was called successfully, M_FALSE if there was a usage error
277 * or exception. A value of M_TRUE doesn't mean the returned object was populated,
278 * the call may have resulted in an error that didn't raise an exception.
279 */
280M_API M_bool M_io_jni_new_object(jobject *rv, char *error, size_t error_len, JNIEnv *env, const char *method, size_t argc, ...);
281
282
283/*! Call an object method that returns jvoid (no result).
284 * \param[out] error Optional. Buffer to hold error message.
285 * \param[in] error_len Error buffer size.
286 * \param[in] env Optional. Java JNI Environment. If not passed will request it from
287 * the JVM. Passing it is an optimization.
288 * \param[in] classobj Class object to call method on. If the method being called is static,
289 * this parameter will be ignored, so should be passed as NULL.
290 * \param[in] method The method to be called. The method should be in the form of
291 * "path/to/class.method", and must have been one of the methods in the
292 * global initialization.
293 * \param[in] argc Count of argument to follow.
294 * \param[in] ... Variable argument list depending on method being called.
295 * \return M_TRUE if the method was called successfully, M_FALSE if there was a usage error
296 * or exception.
297 */
298M_API M_bool M_io_jni_call_jvoid(char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc, ...);
299
300
301/*! Call an object method that returns jobject.
302 * \param[out] rv Returned object, passed by reference. Returned object should be
303 * released using M_io_jni_deletelocalref() when no longer needed.
304 * \param[out] error Optional. Buffer to hold error message.
305 * \param[in] error_len Error buffer size.
306 * \param[in] env Optional. Java JNI Environment. If not passed will request it from
307 * the JVM. Passing it is an optimization.
308 * \param[in] classobj Class object to call method on. If the method being called is static,
309 * this parameter will be ignored, so should be passed as NULL.
310 * \param[in] method The method to be called. The method should be in the form of
311 * "path/to/class.method", and must have been one of the methods in the
312 * global initialization.
313 * \param[in] argc Count of arguments to follow.
314 * \param[in] ... Variable argument list depending on method being called.
315 * \return M_TRUE if the method was called successfully, M_FALSE if there was a usage error
316 * or exception. A value of M_TRUE doesn't mean the returned object was populated,
317 * the call may have resulted in an error that didn't raise an exception.
318 */
319M_API M_bool M_io_jni_call_jobject(jobject *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc, ...);
320
321
322/*! Call an object method that returns a jbyte.
323 *
324 * See M_io_jni_call_jobject() for usage information.
325 */
326M_API M_bool M_io_jni_call_jbyte(jbyte *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc, ...);
327
328
329/*! Call an object method that returns a jboolean.
330 *
331 * See M_io_jni_call_jobject() for usage information.
332 */
333M_API M_bool M_io_jni_call_jboolean(jboolean *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc, ...);
334
335
336/*! Call an object method that returns a jchar.
337 *
338 * See M_io_jni_call_jobject() for usage information.
339 */
340M_API M_bool M_io_jni_call_jchar(jchar *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc, ...);
341
342
343/*! Call an object method that returns a jint.
344 *
345 * See M_io_jni_call_jobject() for usage information.
346 */
347M_API M_bool M_io_jni_call_jint(jint *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc, ...);
348
349
350/*! Call an object method that returns a jlong.
351 *
352 * See M_io_jni_call_jobject() for usage information.
353 */
354M_API M_bool M_io_jni_call_jlong(jlong *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc, ...);
355
356
357/*! Call an object method that returns a jfloat.
358 *
359 * See M_io_jni_call_jobject() for usage information.
360 */
361M_API M_bool M_io_jni_call_jfloat(jfloat *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc, ...);
362
363
364/*! Call an object method that returns a jdouble.
365 *
366 * See M_io_jni_call_jobject() for usage information.
367 */
368M_API M_bool M_io_jni_call_jdouble(jdouble *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc, ...);
369
370
371/*! Call an object method that returns a jobjectArray.
372 *
373 * See M_io_jni_call_jobject() for usage information.
374 */
375M_API M_bool M_io_jni_call_jobjectArray(jobjectArray *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc, ...);
376
377
378/*! Call an object method that returns a jbyteArray.
379 *
380 * See M_io_jni_call_jobject() for usage information.
381 */
382M_API M_bool M_io_jni_call_jbyteArray(jbyteArray *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc, ...);
383
384
385/*! Call an object method that returns a jbooleanArray.
386 *
387 * See M_io_jni_call_jobject() for usage information.
388 */
389M_API M_bool M_io_jni_call_jbooleanArray(jbooleanArray *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc, ...);
390
391
392/*! Call an object method that returns a jcharArray.
393 *
394 * See M_io_jni_call_jobject() for usage information.
395 */
396M_API M_bool M_io_jni_call_jcharArray(jcharArray *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc, ...);
397
398
399/*! Call an object method that returns a jintArray.
400 *
401 * See M_io_jni_call_jobject() for usage information.
402 */
403M_API M_bool M_io_jni_call_jintArray(jintArray *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc, ...);
404
405
406/*! Call an object method that returns a jlongArray.
407 *
408 * See M_io_jni_call_jobject() for usage information.
409 */
410M_API M_bool M_io_jni_call_jlongArray(jlongArray *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc, ...);
411
412
413/*! Call an object method that returns a jfloatArray.
414 *
415 * See M_io_jni_call_jobject() for usage information.
416 */
417M_API M_bool M_io_jni_call_jfloatArray(jfloatArray *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc, ...);
418
419
420/*! Call an object method that returns a jdoubleArray.
421 *
422 * See M_io_jni_call_jobject() for usage information.
423 */
424M_API M_bool M_io_jni_call_jdoubleArray(jdoubleArray *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc, ...);
425
426
427/*! Call an object field that returns a jobject.
428 * \param[out] rv Returned value, passed by reference. Returned object should be
429 * released using M_io_jni_deletelocalref() when no longer needed.
430 * \param[out] error Optional. Buffer to hold error message.
431 * \param[in] error_len Error buffer size.
432 * \param[in] env Optional. Java JNI Environment. If not passed will request it from
433 * the JVM. Passing it is an optimization.
434 * \param[in] classobj Class object to call method on. If the method being called is static,
435 * this parameter will be ignored, so should be passed as NULL.
436 * \param[in] field The field to be called. The field should be in the form of
437 * "path/to/class.field", and must have been one of the fields in the
438 * global initialization.
439 * \return M_TRUE if the method was called successfully, M_FALSE if there was a usage error
440 * or exception. A value of M_TRUE doesn't mean the returned object was populated,
441 * the call may have resulted in an error that didn't raise an exception.
442 */
443M_API M_bool M_io_jni_call_jobjectField(jobject *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *field);
444
445
446/*! Call an object field that returns a jbyte.
447 *
448 * See M_io_jni_call_jobjectField() for usage information.
449 */
450M_API M_bool M_io_jni_call_jbyteField(jbyte *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *field);
451
452
453/*! Call an object field that returns a jboolean.
454 *
455 * See M_io_jni_call_jobjectField() for usage information.
456 */
457M_API M_bool M_io_jni_call_jbooleanField(jboolean *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *field);
458
459
460/*! Call an object field that returns a jchar.
461 *
462 * See M_io_jni_call_jobjectField() for usage information.
463 */
464M_API M_bool M_io_jni_call_jcharField(jchar *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *field);
465
466
467/*! Call an object field that returns a jint.
468 *
469 * See M_io_jni_call_jobjectField() for usage information.
470 */
471M_API M_bool M_io_jni_call_jintField(jint *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *field);
472
473
474/*! Call an object field that returns a jlong.
475 *
476 * See M_io_jni_call_jobjectField() for usage information.
477 */
478M_API M_bool M_io_jni_call_jlongField(jlong *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *field);
479
480
481/*! Call an object field that returns a jfloat.
482 *
483 * See M_io_jni_call_jobjectField() for usage information.
484 */
485M_API M_bool M_io_jni_call_jfloatField(jfloat *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *field);
486
487
488/*! Call an object field that returns a jdouble.
489 *
490 * See M_io_jni_call_jobjectField() for usage information.
491 */
492M_API M_bool M_io_jni_call_jdoubleField(jdouble *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *field);
493
494/*! @} */
495
496__END_DECLS
497
498#endif
struct M_buf M_buf_t
Definition: m_buf.h:77
struct M_hash_dict M_hash_dict_t
Definition: m_hash_dict.h:52
M_bool M_io_jni_call_jdoubleField(jdouble *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *field)
jbyteArray M_io_jni_puchar_to_jbyteArray(JNIEnv *env, const unsigned char *data, size_t data_size)
void M_io_jni_deletelocalref(JNIEnv *env, jobject *ref)
M_bool M_io_jni_call_jint(jint *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc,...)
M_bool M_io_jni_call_jbooleanArray(jbooleanArray *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc,...)
M_bool M_io_jni_call_jvoid(char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc,...)
M_bool M_io_jni_call_jbyte(jbyte *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc,...)
M_bool M_io_jni_init(JavaVM *Jvm)
M_bool M_io_jni_call_jlong(jlong *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc,...)
M_bool M_io_jni_call_jobjectField(jobject *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *field)
M_bool M_io_jni_call_jcharArray(jcharArray *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc,...)
M_bool M_io_jni_call_jdoubleArray(jdoubleArray *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc,...)
M_bool M_io_jni_call_jbooleanField(jboolean *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *field)
void M_io_jni_debug(const char *fmt,...)
M_bool M_io_jni_call_jintArray(jintArray *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc,...)
jobject M_io_jni_create_globalref(JNIEnv *env, jobject ref)
M_bool M_io_jni_call_jfloatField(jfloat *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *field)
unsigned char * M_io_jni_jbyteArray_to_puchar(JNIEnv *env, jbyteArray in, size_t max_len, size_t *size_out)
jstring M_io_jni_pchar_to_jstring(JNIEnv *env, const char *str)
M_bool M_io_jni_call_jbyteField(jbyte *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *field)
M_bool M_io_jni_call_jbyteArray(jbyteArray *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc,...)
M_bool M_io_jni_call_jcharField(jchar *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *field)
size_t M_io_jni_array_length(JNIEnv *env, jobject arr)
M_bool M_io_jni_call_jlongField(jlong *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *field)
M_bool M_io_jni_call_jfloat(jfloat *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc,...)
M_bool M_io_jni_call_jlongArray(jlongArray *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc,...)
M_bool M_io_jni_call_jfloatArray(jfloatArray *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc,...)
M_hash_dict_t * M_io_jni_jhashmap_to_mhashdict(JNIEnv *env, jobject map)
M_bool M_io_jni_new_object(jobject *rv, char *error, size_t error_len, JNIEnv *env, const char *method, size_t argc,...)
M_bool M_io_jni_call_jboolean(jboolean *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc,...)
M_bool M_io_jni_call_jobject(jobject *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc,...)
M_bool M_io_jni_android_init(jobject app_context)
char * M_io_jni_jstring_to_pchar(JNIEnv *env, jstring str)
size_t M_io_jni_jbyteArray_to_buf(JNIEnv *env, jbyteArray in, size_t max_len, M_buf_t *out)
M_bool M_io_jni_call_jdouble(jdouble *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc,...)
M_bool M_io_jni_call_jobjectArray(jobjectArray *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc,...)
JNIEnv * M_io_jni_getenv(void)
M_bool M_io_jni_call_jintField(jint *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *field)
void M_io_jni_delete_globalref(JNIEnv *env, jobject *ref)
void M_io_jni_jbyteArray_zeroize(JNIEnv *env, jbyteArray arr)
jclass M_io_jni_find_class(JNIEnv *env, const char *path)
jobject M_io_jni_get_android_app_context(void)
jobject M_io_jni_mhashdict_to_jhashmap(JNIEnv *env, M_hash_dict_t *dict)
M_bool M_io_jni_call_jchar(jchar *rv, char *error, size_t error_len, JNIEnv *env, jobject classobj, const char *method, size_t argc,...)
jobject M_io_jni_array_element(JNIEnv *env, jobject arr, size_t idx)