90844440898949863afb77c3ae71476d73173707
[framework/multimedia/audio-session-manager.git] / include / asm-error.h
1 /*
2  * audio-session-manager
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Seungbae Shin <seungbae.shin@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #ifndef __ASM_ERROR_H__
23 #define __ASM_ERROR_H__
24
25 #ifdef __cplusplus
26         extern "C" {
27 #endif
28
29 /**
30   * ASM CLASS
31   */
32 #define ASM_STATE_SUCCESS                 (0x00000000)                    /**< No Error */
33 #define ASM_STATE_ERROR                   (0x80000000)                    /**< Error Class */
34 #define ASM_STATE_WARING                  (0x70000000)                    /**< Waring Class */
35
36 /*
37  * Detail enumeration
38  */
39 enum {
40     ASM_IN_UNKNOWN = 0,
41     ASM_IN_PARAMETER,
42     ASM_IN_HANDLE,
43     ASM_IN_MEMORY,
44 };
45
46 /*
47  * ASM_WARING
48  */
49 #define ASM_STATE_WAR_INVALID_PARAMETER   (ASM_STATE_WARING | ASM_IN_PARAMETER)
50 #define ASM_STATE_WAR_INVALID_HANDLE      (ASM_STATE_WARING | ASM_IN_HANDLE)
51 #define ASM_STATE_WAR_INVALID_MEMORY       (ASM_STATE_WARING | ASM_IN_MEMORY)
52
53
54 /**
55  *  ASM_ERROR
56  */
57 #define ASM_STATE_ERR_INVALID_PARAMETER   (ASM_STATE_ERROR | ASM_IN_PARAMETER)
58 #define ASM_STATE_ERR_INVALID_HANDLE      (ASM_STATE_ERROR | ASM_IN_HANDLE)
59 #define ASM_STATE_ERR_INVALID_MEMORY       (ASM_STATE_ERROR | ASM_IN_MEMORY)
60
61
62 #define ASM_FAIL(_A_)                     (ASM_STATE_ERROR & (_A_))
63 #define ASM_SUCCESS(_A_)                  (!ASM_FAIL(_A_))
64 #define ASM_WARING(_A_)                   (ASM_STATE_WARING & (_A_))
65 #define ASM_ERROR(_A_)                    (ASM_STATE_ERROR & (_A_))
66
67 #ifdef __cplusplus
68         }
69 #endif
70
71 #endif  /* __ASM_ERROR_H__ */