diff --git a/bindings/java/src/jni/javasigar.c b/bindings/java/src/jni/javasigar.c index 0ee179d1..3ee9ff02 100644 --- a/bindings/java/src/jni/javasigar.c +++ b/bindings/java/src/jni/javasigar.c @@ -218,6 +218,13 @@ static void sigar_set_pointer(JNIEnv *env, jobject obj, const void *ptr) { #endif } +/* for jni/win32 */ +sigar_t *jsigar_get_sigar(JNIEnv *env, jobject sigar_obj) +{ + dSIGAR(NULL); + return jsigar->sigar; +} + int jsigar_list_init(JNIEnv *env, jsigar_list_t *obj) { jclass listclass = diff --git a/bindings/java/src/jni/javasigar.h b/bindings/java/src/jni/javasigar.h index 43093b9d..a3415610 100644 --- a/bindings/java/src/jni/javasigar.h +++ b/bindings/java/src/jni/javasigar.h @@ -17,6 +17,7 @@ */ #include +#include "sigar.h" #define JENV (*env) @@ -46,6 +47,8 @@ int jsigar_list_init(JNIEnv *env, jsigar_list_t *obj); int jsigar_list_add(void *data, char *value, int len); +sigar_t *jsigar_get_sigar(JNIEnv *env, jobject sigar_obj); + #ifdef __cplusplus } #endif