summaryrefslogtreecommitdiff
path: root/src/runtime/java/jni_utils.h
blob: c587346bc938b7288e1dac95743418d62f213662 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef JNI_UTILS
#define JNI_UTILS

#define l2p(x) ((void*) (intptr_t) (x))
#define p2l(x) ((jlong) (intptr_t) (x))

jstring
gu2j_string(JNIEnv *env, GuString s);

GuString
j2gu_string(JNIEnv *env, jstring s, GuPool* pool);

size_t
gu2j_string_offset(GuString s, size_t offset);

size_t
j2gu_string_offset(GuString s, size_t joffset);

void*
get_ref(JNIEnv *env, jobject self);

void
throw_jstring_exception(JNIEnv *env, const char* class_name, jstring msg);

void
throw_string_exception(JNIEnv *env, const char* class_name, const char* msg);

#endif