• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *                                                                            *
3  * Copyright (C) 2018 The Android Open Source Project
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *****************************************************************************
18  * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19 */
20 #ifndef IXHEAACD_ERROR_HANDLER_H
21 #define IXHEAACD_ERROR_HANDLER_H
22 
23 #define IA_ERROR_NON_FATAL_IDX 0x0
24 #define IA_ERROR_FATAL_IDX 0x1
25 
26 #define IA_ERROR_CLASS_0 0x0
27 #define IA_ERROR_CLASS_1 0x1
28 #define IA_ERROR_CLASS_2 0x2
29 #define IA_ERROR_CLASS_3 0x3
30 #define IA_ERROR_CLASS_4 0x4
31 #define IA_ERROR_CLASS_5 0x5
32 #define IA_ERROR_CLASS_6 0x6
33 #define IA_ERROR_CLASS_7 0x7
34 #define IA_ERROR_CLASS_8 0x8
35 #define IA_ERROR_CLASS_9 0x9
36 #define IA_ERROR_CLASS_A 0xA
37 #define IA_ERROR_CLASS_B 0xB
38 #define IA_ERROR_CLASS_C 0xC
39 #define IA_ERROR_CLASS_D 0xD
40 #define IA_ERROR_CLASS_E 0xE
41 #define IA_ERROR_CLASS_F 0xF
42 
43 typedef struct {
44   pWORD8 pb_module_name;
45   pWORD8 ppb_class_names[16];
46   WORD8 **ppppb_error_msg_pointers[2][16];
47 } ia_error_info_struct;
48 
49 IA_ERRORCODE ixheaacd_error_handler(ia_error_info_struct *p_mod_err_info,
50                                     WORD8 *pb_context, IA_ERRORCODE code);
51 
52 #define _IA_HANDLE_ERROR(p_mod_err_info, context, e)          \
53   if ((e) != IA_NO_ERROR) {                                   \
54     ixheaacd_error_handler((p_mod_err_info), (context), (e)); \
55     if ((e)&IA_FATAL_ERROR) return (e);                       \
56   }
57 
58 #endif /* IXHEAACD_ERROR_HANDLER_H */
59