1 /*---------------------------------------------------------------------------*
2 
3   Copyright (C) Nintendo.  All rights reserved.
4 
5   These coded instructions, statements, and computer programs contain
6   proprietary information of Nintendo of America Inc. and/or Nintendo
7   Company Ltd., and are protected by Federal copyright law.  They may
8   not be disclosed to third parties or copied or duplicated in any form,
9   in whole or in part, without the prior written consent of Nintendo.
10 
11  *---------------------------------------------------------------------------*/
12 
13 #ifndef NN_TEMP_TEMP_TYPES_H_
14 #define NN_TEMP_TEMP_TYPES_H_
15 
16 //! @addtogroup  nn_temp_status
17 //! @{
18 
19 /*!
20     @typedef   TEMPStatus
21     @brief  Status codes for the <tt>TEMP</tt> library.
22 */
23 typedef s32 TEMPStatus;
24 
25 /*!
26     @def  TEMP_STATUS_OK
27     @brief  The process ended normally.
28 */
29 #define TEMP_STATUS_OK                  FS_STATUS_OK
30 
31 /*!
32     @def  TEMP_STATUS_CANCELED
33     @brief  The command was canceled.
34 */
35 #define TEMP_STATUS_CANCELED            FS_STATUS_CANCELED
36 
37 /*!
38     @def  TEMP_STATUS_END
39     @brief  Indicates the end of a file or directory.
40 */
41 #define TEMP_STATUS_END                 FS_STATUS_END
42 
43 /*!
44     @def  TEMP_STATUS_MAX
45     @brief  Reached the maximum number of mounting points, clients, file handles, or directory handles.
46 */
47 #define TEMP_STATUS_MAX                 FS_STATUS_MAX
48 
49 /*!
50     @def  TEMP_STATUS_ALREADY_OPEN
51     @brief  The target is already open or has been locked by another transaction.
52 */
53 #define TEMP_STATUS_ALREADY_OPEN        FS_STATUS_ALREADY_OPEN
54 
55 /*!
56     @def  TEMP_STATUS_EXISTS
57     @brief  The specified path already exists.
58 */
59 #define TEMP_STATUS_EXISTS              FS_STATUS_EXISTS
60 
61 /*!
62     @def  TEMP_STATUS_NOT_FOUND
63     @brief  The specified path was not found.
64 */
65 #define TEMP_STATUS_NOT_FOUND           FS_STATUS_NOT_FOUND
66 
67 /*!
68     @def  TEMP_STATUS_NOT_FILE
69     @brief  The specified path is a directory path, not a file path (not a file).
70 */
71 #define TEMP_STATUS_NOT_FILE            FS_STATUS_NOT_FILE
72 
73 /*!
74     @def  TEMP_STATUS_NOT_DIR
75     @brief  The specified path is not a directory path (not a directory).
76 */
77 #define TEMP_STATUS_NOT_DIR             FS_STATUS_NOT_DIR
78 
79 /*!
80     @def  TEMP_STATUS_ACCESS_ERROR
81     @brief  Attempted to access the file in an invalid file mode.
82 */
83 #define TEMP_STATUS_ACCESS_ERROR        FS_STATUS_ACCESS_ERROR
84 
85 /*!
86     @def  TEMP_STATUS_PERMISSION_ERROR
87     @brief  You do not have the permissions required to perform this operation.
88 */
89 #define TEMP_STATUS_PERMISSION_ERROR    FS_STATUS_PERMISSION_ERROR
90 
91 /*!
92     @def  TEMP_STATUS_FILE_TOO_BIG
93     @brief  This request pushes a file that exceeds the size limit (not related to the limits on memory allocation).
94 */
95 #define TEMP_STATUS_FILE_TOO_BIG        FS_STATUS_FILE_TOO_BIG
96 
97 /*!
98     @def  TEMP_STATUS_STORAGE_FULL
99     @brief  This request requires allocation of a new directory that would exceed the storage space available, or there is no more free storage space.
100 */
101 #define TEMP_STATUS_STORAGE_FULL        FS_STATUS_STORAGE_FULL
102 
103 
104 /*!
105     @def  TEMP_STATUS_JOURNAL_FULL
106     @brief  The transaction journal is full. It must be flushed.
107 */
108 #define TEMP_STATUS_JOURNAL_FULL        FS_STATUS_JOURNAL_FULL
109 
110 /*!
111     @def  TEMP_STATUS_UNSUPPORTED_CMD
112     @brief  The file system does not support this command.
113 */
114 #define TEMP_STATUS_UNSUPPORTED_CMD     FS_STATUS_UNSUPPORTED_CMD
115 
116 /*!
117     @def  TEMP_STATUS_FATAL_ERROR
118     @brief  A fatal error has occurred.
119 */
120 #define TEMP_STATUS_FATAL_ERROR         FS_STATUS_FATAL_ERROR
121 
122 /*!
123     @def  TEMP_STATUS_INVALID_PARAM
124     @brief  Invalid parameter.
125 */
126 #define TEMP_STATUS_INVALID_PARAM       (TEMP_STATUS_FATAL_ERROR - 1)
127 
128 //! @}
129 
130 //! @addtogroup  nn_temp_api
131 //! @{
132 
133 /*!
134     @typedef   TEMPDirID
135     @brief  <tt>TEMP</tt> directory ID.
136 */
137 typedef u64 TEMPDirID;
138 
139 /*!
140     @def  TEMP_DIR_ID_INVALID
141     @brief  Invalid <tt>TEMP</tt> directory ID.
142 */
143 static const TEMPDirID TEMP_DIR_ID_INVALID = 0;
144 
145 /*!
146     @typedef   TEMPDevicePreference
147     @brief  Specifies criteria for selecting the device to use when creating the <tt>TEMP</tt> directory.
148 */
149 typedef enum
150 {
151     TEMP_DEVICE_PREFERENCE_FREE_SPACE   = 0,                                ///< Prioritize free space: Select the device with the most free storage space.
152     TEMP_DEVICE_PREFERENCE_ACCESS_SPEED = 1,                                ///< Prioritize speed: Select the device with the fastest access speed.
153     TEMP_DEVICE_PREFERENCE_DEFAULT      = TEMP_DEVICE_PREFERENCE_FREE_SPACE ///< Default setting: Prioritize free space.
154 } TEMPDevicePreference;
155 
156 //! @}
157 
158 #endif // NN_TEMP_TEMP_TYPES_H_
159