sigar/bindings/java/src/jni/win32/win32bindings.h

56 lines
1.5 KiB
C
Raw Normal View History

2006-07-16 01:46:36 +08:00
/*
* Copyright (C) [2004, 2005, 2006], Hyperic, Inc.
* This file is part of SIGAR.
*
* SIGAR is free software; you can redistribute it and/or modify
* it under the terms version 2 of the GNU General Public License as
* published by the Free Software Foundation. This program is distributed
* in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*/
2004-11-21 05:01:16 +08:00
#ifndef WIN32_BINDINGS_H
#define WIN32_BINDINGS_H
/* Exclude rarely-used stuff from windows headers */
#define WIN32_LEAN_AND_MEAN
/* Windows Header Files */
#include <windows.h>
#include <tchar.h>
/* Include java jni headers */
#include <jni.h>
#define WIN32_PACKAGE "org/hyperic/sigar/win32/"
2004-11-21 05:01:16 +08:00
#define WIN32_FIND_CLASS(name) \
JENV->FindClass(env, WIN32_PACKAGE name)
#define WIN32_ALLOC_OBJECT(name) \
JENV->AllocObject(env, WIN32_FIND_CLASS(name))
#define SetStringField(env, obj, fieldID, val) \
JENV->SetObjectField(env, obj, fieldID, JENV->NewStringUTF(env, val))
2005-06-27 06:01:04 +08:00
#ifdef __cplusplus
extern "C" {
#endif
void win32_throw_exception(JNIEnv *env, char *msg);
2004-11-21 05:01:16 +08:00
2005-06-27 12:22:36 +08:00
void win32_throw_error(JNIEnv *env, LONG err);
2005-06-27 06:01:04 +08:00
void win32_throw_last_error(JNIEnv *env);
#ifdef __cplusplus
}
#endif
2004-11-21 05:01:16 +08:00
#endif