libnx/nx/include/switch/services/fatal.h
SciresM 97b295acbc Fatal: Only exit process if required, exit cleanly. (#127)
* Fatal: Only exit process if required, exit cleanly.
2018-06-26 11:28:07 -04:00

31 lines
773 B
C

/**
* @file fatal.h
* @brief Fatal error (fatal:u) service IPC wrapper.
* @author plutoo
* @copyright libnx Authors
*/
#pragma once
#include "../types.h"
/// Type of thrown fatal error.
typedef enum {
FatalType_ErrorReportAndErrorScreen = 0,
FatalType_ErrorReport = 1,
FatalType_ErrorScreen = 2
} FatalType;
/**
* @brief Triggers a system fatal error.
* @param err[in] Result code to throw.
* @note This function does not return.
*/
void NORETURN fatalSimple(Result err);
/**
* @brief Triggers a system fatal error with a custom FatalType.
* @param err[in] Result code to throw.
* @param err[in] Type of fatal error to throw.
* @note This function may not return, depending on \ref FatalType.
*/
void fatalWithType(Result err, FatalType type);