• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This file is part of the openHiTLS project.
3  *
4  * openHiTLS is licensed under the Mulan PSL v2.
5  * You can use this software according to the terms and conditions of the Mulan PSL v2.
6  * You may obtain a copy of Mulan PSL v2 at:
7  *
8  *     http://license.coscl.org.cn/MulanPSL2
9  *
10  * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
11  * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
12  * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
13  * See the Mulan PSL v2 for more details.
14  */
15 
16 #ifndef BSL_ERR_INTERNAL_H
17 #define BSL_ERR_INTERNAL_H
18 
19 #include <stdint.h>
20 #include "hitls_build.h"
21 #include "bsl_err.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #ifdef HITLS_BSL_ERR
28 
29 /**
30  * @ingroup bsl_err
31  * @brief Save the error information to the error information stack.
32  *
33  * @par Description:
34  * Save the error information to the error information stack.
35  *
36  * @attention err cannot be 0.
37  * @param err [IN] Error code. The most significant 16 bits indicate the submodule ID,
38  *                 and the least significant 16 bits indicate the error ID.
39  * @param file [IN] File name, excluding the directory path
40  * @param lineNo [IN] Number of the line where the error occurs.
41  */
42 void BSL_ERR_PushError(int32_t err, const char *file, uint32_t lineNo);
43 
44 /**
45  * @ingroup bsl_err
46  * @brief Save the error information to the error information stack.
47  *
48  * @par Description:
49  * Save the error information to the error information stack.
50  *
51  * @attention e cannot be 0.
52  */
53 #define BSL_ERR_PUSH_ERROR(e) BSL_ERR_PushError((e), __FILENAME__, __LINE__)
54 
55 #else
56 
57 #define BSL_ERR_PUSH_ERROR(e)
58 
59 #endif /* HITLS_BSL_ERR */
60 
61 #ifdef __cplusplus
62 }
63 #endif
64 
65 #endif // BSL_ERR_INTERNAL_H
66