replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / service / notification / android / notification-service / src / main / jni / common / JniNotificationCommon.h
1 //******************************************************************\r
2 //\r
3 // Copyright 2016 Samsung Electronics All Rights Reserved.\r
4 //\r
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
6 //\r
7 // Licensed under the Apache License, Version 2.0 (the "License");\r
8 // you may not use this file except in compliance with the License.\r
9 // You may obtain a copy of the License at\r
10 //\r
11 //      http://www.apache.org/licenses/LICENSE-2.0\r
12 //\r
13 // Unless required by applicable law or agreed to in writing, software\r
14 // distributed under the License is distributed on an "AS IS" BASIS,\r
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16 // See the License for the specific language governing permissions and\r
17 // limitations under the License.\r
18 //\r
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
20 \r
21 #ifndef _JNI_NOTIFICATION_COMMON_H_\r
22 #define _JNI_NOTIFICATION_COMMON_H_\r
23 \r
24 #include <jni.h>\r
25 #include <android/log.h>\r
26 #include "JniSharedObjectHolder.h"\r
27 \r
28 \r
29 #define  NSTAG    "NotificationService_JNI"\r
30 \r
31 #define JNI_CURRENT_VERSION JNI_VERSION_1_6\r
32 \r
33 #define NS_LOGI(...) __android_log_print(ANDROID_LOG_INFO, NSTAG, __VA_ARGS__)\r
34 #define NS_LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, NSTAG, __VA_ARGS__)\r
35 #define NS_LOGE(...) __android_log_print(ANDROID_LOG_ERROR, NSTAG, __VA_ARGS__)\r
36 \r
37 #ifdef __cplusplus\r
38 extern "C" {\r
39 #endif\r
40 \r
41 #define JNI_EXCEPTION 1000\r
42 #define JNI_NO_NATIVE_POINTER 1001\r
43 #define JNI_INVALID_VALUE 1002\r
44 #define NATIVE_EXCEPTION 1003\r
45 \r
46 #define JNI_NS_OK 100\r
47 #define JNI_NS_ERROR 200\r
48 #define JNI_NS_SUCCESS 300\r
49 #define JNI_NS_FAIL 400\r
50 #define JNI_NS_ALLOW 500\r
51 #define JNI_NS_DENY 600\r
52 \r
53 jobject getNSException(JNIEnv *env, const char *file, const char *functionName, const int line,\r
54                        const int code, const char *message);\r
55 void throwNSException(JNIEnv *env, jobject ex);\r
56 \r
57 #define GetNSException(code, message) getNSException(env, __FILE__, __func__, __LINE__, code, message)\r
58 #define ThrowNSException(code, message) throwNSException(env, GetNSException(code, message))\r
59 \r
60 static const char *NSResultToChar(const int nsresult);\r
61 int NSExceptionInit(JNIEnv *env);\r
62 \r
63 #ifdef __cplusplus\r
64 }\r
65 #endif\r
66 \r
67 #endif // _JNI_NOTIFICATION_COMMON_H_\r