summaryrefslogtreecommitdiffstats
path: root/icu/src/main/native/ErrorCode.h
blob: e42a519df8400ae5a9e25fd2bb1e2eb3bffdfefd (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
29
30
31
32
33
34
35
/**
*******************************************************************************
* Copyright (C) 1996-2005, International Business Machines Corporation and    *
* others. All Rights Reserved.                                                *
*******************************************************************************
*******************************************************************************
*/

#ifndef ERRORCODE_H
#define ERRORCODE_H

#include <jni.h>
#include "unicode/utypes.h"
#include "unicode/putil.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* Checks if an error has occured. 
* Throws a generic Java RuntimeException if an error has occured.
* @param env JNI environment variable
* @param errorcode code to determine if it is an erro
* @return 0 if errorcode is not an error, 1 if errorcode is an error, but the 
*         creation of the exception to be thrown fails
* @exception thrown if errorcode represents an error
*/
UBool icu4jni_error(JNIEnv *env, UErrorCode errorcode);

#ifdef __cplusplus
}
#endif

#endif