1 /* 2 * Copyright (c) 2023 Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef NSI_COMMON_SRC_INCL_NSI_MAIN_H 8 #define NSI_COMMON_SRC_INCL_NSI_MAIN_H 9 10 #include "nsi_utils.h" 11 12 #ifdef __cplusplus 13 extern "C" { 14 #endif 15 16 /** 17 * @brief Like nsi_exit(), do all cleanup required to terminate the 18 * execution of the native_simulator, but instead of exiting, 19 * return to the caller what would have been passed to exit() 20 * 21 * @param[in] exit_code: Requested exit code to the shell 22 * Note that other components may have requested a different 23 * exit code which may have precedence if it was !=0 24 * 25 * @returns Code which would have been passed to exit() 26 */ 27 int nsi_exit_inner(int exit_code); 28 29 /** 30 * @brief Terminate the execution of the native simulator 31 * 32 * @param[in] exit_code: Requested exit code to the shell 33 * Note that other components may have requested a different 34 * exit code which may have precedence if it was !=0 35 */ 36 NSI_FUNC_NORETURN void nsi_exit(int exit_code); 37 38 #ifdef __cplusplus 39 } 40 #endif 41 42 #endif /* NSI_COMMON_SRC_INCL_NSI_MAIN_H */ 43