Merge "Apply model-config.xml" into tizen_2.2
[platform/framework/native/appfw.git] / inc / FBaseErrorDefine.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file                FBaseErrorDefine.h
19  * @brief               This header file defines common error codes.
20  *
21  * This header file contains the definitions of error codes.
22  */
23
24 #ifndef _FBASE_ERROR_DEFINE_H_
25 #define _FBASE_ERROR_DEFINE_H_
26
27 #include <FBaseTypes.h>
28
29
30 #define E_SEVERITY_POS                  31
31 #define E_TYPE_POS                      29
32
33 #define SET_E_SEVERITY(X)               (static_cast<unsigned long>(PUT_MASK(0, (X), E_SEVERITY_POS)))
34 #define SET_E_TYPE(X)                   (static_cast<unsigned long>(PUT_MASK(0, (X), E_TYPE_POS)))
35 #define SET_E_CAUSE(X)                  (static_cast<unsigned long>(X))
36
37
38 // Error severities
39 #define E_SUCCESS                       (SET_E_SEVERITY(0))
40 #define E_FAILURE                       (SET_E_SEVERITY(1))
41
42
43 // Error types
44 #define ERR_SRC_FRAMEWORK               (E_FAILURE + SET_E_TYPE(1))
45 #define ERR_SRC_USER                    (E_FAILURE + SET_E_TYPE(2))
46
47
48 // Macros for error codes
49 #define IsFailed(X)                     (static_cast<long>(X) != E_SUCCESS)
50
51
52 #endif //_FBASE_ERROR_DEFINE_H_