libctru  v2.4.1
error.h
Go to the documentation of this file.
1 /**
2  * @file error.h
3  * @brief Error applet.
4  */
5 #pragma once
6 #include <3ds/types.h>
7 
8  enum
9 {
10  ERROR_LANGUAGE_FLAG = 0x100, ///<??-Unknown flag
11  ERROR_WORD_WRAP_FLAG = 0x200 ///<??-Unknown flag
12 };
13 
14 
15 ///< Type of Error applet to be called
16 
17 typedef enum
18 {
19  ERROR_CODE = 0, ///< Displays the infrastructure communications-related error message corresponding to the error code.
20  ERROR_TEXT, ///< Displays text passed to this applet.
21  ERROR_EULA, ///< Displays the EULA
22  ERROR_TYPE_EULA_FIRST_BOOT, ///< Use prohibited.
23  ERROR_TYPE_EULA_DRAW_ONLY, ///< Use prohibited.
24  ERROR_TYPE_AGREE, ///< Use prohibited.
25  ERROR_CODE_LANGUAGE = ERROR_CODE | ERROR_LANGUAGE_FLAG, ///< Displays a network error message in a specified language.
26  ERROR_TEXT_LANGUAGE = ERROR_TEXT | ERROR_LANGUAGE_FLAG, ///< Displays text passed to this applet in a specified language.
27  ERROR_EULA_LANGUAGE = ERROR_EULA | ERROR_LANGUAGE_FLAG, ///< Displays EULA in a specified language.
28  ERROR_TEXT_WORD_WRAP = ERROR_TEXT | ERROR_WORD_WRAP_FLAG,///< Displays the custom error message passed to this applet with automatic line wrapping
29  ERROR_TEXT_LANGUAGE_WORD_WRAP = ERROR_TEXT | ERROR_LANGUAGE_FLAG | ERROR_WORD_WRAP_FLAG ///< Displays the custom error message with automatic line wrapping and in the specified language.
31 
32 ///< Flags for the Upper Screen.Does nothing even if specified.
33 
34 typedef enum
35 {
36  ERROR_NORMAL = 0,
37  ERROR_STEREO
38 }errorScreenFlag;
39 
40 ///< Return code of the Error module.Use UNKNOWN for simple apps.
41 
42 typedef enum
43 {
44  ERROR_UNKNOWN = -1,
45  ERROR_NONE = 0,
46  ERROR_SUCCESS,
47  ERROR_NOT_SUPPORTED,
48  ERROR_HOME_BUTTON = 10,
49  ERROR_SOFTWARE_RESET,
50  ERROR_POWER_BUTTON
51 }errorReturnCode;
52 
53 ///< Structure to be passed to the applet.Shouldn't be modified directly.
54 
55 typedef struct
56 {
57  errorType type;
58  int errorCode;
59  errorScreenFlag upperScreenFlag;
60  u16 useLanguage;
61  u16 Text[1900];
62  bool homeButton;
63  bool softwareReset;
64  bool appJump;
65  errorReturnCode returnCode;
66  u16 eulaVersion;
67 }errorConf;
68 /**
69 * @brief Init the error applet.
70 * @param err Pointer to errorConf.
71 * @param type errorType Type of error.
72 * @param lang CFG_Language Lang of error.
73 */
74 void errorInit(errorConf* err, errorType type, CFG_Language lang);
75 /**
76 * @brief Sets error code to display.
77 * @param err Pointer to errorConf.
78 * @param error Error-code to display.
79 */
80 void errorCode(errorConf* err, int error);
81 /**
82 * @brief Sets error text to display.
83 * @param err Pointer to errorConf.
84 * @param text Error-text to display.
85 */
86 void errorText(errorConf* err, const char* text);
87 /**
88 * @brief Displays the error applet.
89 * @param err Pointer to errorConf.
90 */
91 void errorDisp(errorConf* err);
CFG_Language
Configuration language values.
Definition: cfgu.h:22
errorType
Definition: error.h:18
@ ERROR_TYPE_EULA_DRAW_ONLY
Use prohibited.
Definition: error.h:23
@ ERROR_EULA_LANGUAGE
Displays EULA in a specified language.
Definition: error.h:27
@ ERROR_TEXT_WORD_WRAP
Displays the custom error message passed to this applet with automatic line wrapping.
Definition: error.h:28
@ ERROR_TYPE_EULA_FIRST_BOOT
Use prohibited.
Definition: error.h:22
@ ERROR_EULA
Displays the EULA.
Definition: error.h:21
@ ERROR_TEXT_LANGUAGE_WORD_WRAP
Displays the custom error message with automatic line wrapping and in the specified language.
Definition: error.h:29
@ ERROR_TYPE_AGREE
Use prohibited.
Definition: error.h:24
@ ERROR_CODE_LANGUAGE
Displays a network error message in a specified language.
Definition: error.h:25
@ ERROR_TEXT
Displays text passed to this applet.
Definition: error.h:20
@ ERROR_TEXT_LANGUAGE
Displays text passed to this applet in a specified language.
Definition: error.h:26
@ ERROR_CODE
Displays the infrastructure communications-related error message corresponding to the error code.
Definition: error.h:19
@ ERROR_WORD_WRAP_FLAG
??-Unknown flag
Definition: error.h:11
@ ERROR_LANGUAGE_FLAG
??-Unknown flag
Definition: error.h:10
void errorInit(errorConf *err, errorType type, CFG_Language lang)
Init the error applet.
void errorDisp(errorConf *err)
Displays the error applet.
void errorText(errorConf *err, const char *text)
Sets error text to display.
void errorCode(errorConf *err, int error)
Sets error code to display.
Definition: error.h:56
Various system types.
uint16_t u16
16-bit unsigned integer
Definition: types.h:22