From 657e6c5d664c5fa7c36d306f8bc937bec9317e2d Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 26 Mar 2008 17:27:09 +0000 Subject: [PATCH] add jsigar_get_sigar util --- bindings/java/src/jni/javasigar.c | 7 +++++++ bindings/java/src/jni/javasigar.h | 3 +++ 2 files changed, 10 insertions(+) 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