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_API_H_
14 #define NN_TEMP_TEMP_API_H_
15 
16 #include <nn/temp/temp_Types.h>
17 #include <cafe/fs.h>
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 /*!
24 @ingroup  nn_temp
25 @defgroup nn_temp_api  Temporary Directory (TEMP) API
26 @brief  A list of TEMP library members. (Includes only C API members.))
27     @{
28 */
29 
30 /*!
31 @brief  Initializes the <tt>TEMP</tt> library. The <tt>TEMPInit</tt> function always succeeds.
32 
33 @return  Returns the result of the function.
34 @retval TEMP_STATUS_OK  The process ended normally.
35 */
36 TEMPStatus TEMPInit(void);
37 
38 /*!
39 @brief  Shuts down the <tt>TEMP</tt> library.
40 The time it takes for the <tt>TEMPShutdown</tt> function to complete varies depending on the number and size of files created in the <tt>TEMP</tt> directory in addition to the structure of the directory.
41 
42 @return  None.
43 */
44 void TEMPShutdown(void);
45 
46 /*!
47 @brief  Creates and initializes the <tt>TEMP</tt> directory.
48 
49 The <var>maxSize</var> and <var>pref</var> parameters are used to select the target device where the system creates the region for the temporary directory.
50 
51 
52 @param[in] maxSize  Specifies the maximum size (in bytes) for the total size of all files that the application might store in the temporary directory. The maximum value of this parameter is 4,294,967,295 bytes. This value is used when selecting the storage device where the system creates the region for the <tt>TEMP</tt> directory.
53 @param[in] pref  The setting for selecting the target device when the system creates the temporary directory. This value is used when selecting the storage device where the system creates the region for the <tt>TEMP</tt> directory.
54 @param[out] pDirID  Pointer fo the ID of the <tt>TEMP</tt> directory.
55 
56 @return  Returns the result of the function.
57 @retval TEMP_STATUS_OK  The process ended normally.
58 @retval TEMP_STATUS_EXISTS  That temporary directory already exists.
59 @retval TEMP_STATUS_STORAGE_FULL  Indicates that a data region for updating the directory tree cannot be allocated.
60 @retval TEMP_STATUS_INVALID_PARAM  Invalid parameter.
61 @retval TEMP_STATUS_FATAL_ERROR  The library is not initialized.
62 
63 */
64 TEMPStatus TEMPCreateAndInitTempDir(
65             u32 maxSize,
66             TEMPDevicePreference pref,
67             TEMPDirID *pDirID
68             );
69 
70 /*!
71 @brief  Deletes the <tt>TEMP</tt> directory, including all of its contents.
72 The time it takes for the <tt>TEMPShutdownTempDir</tt> function to complete varies depending on the number and size of files created in the <tt>TEMP</tt> directory and the structure of the directory.
73 
74 @param[in] dirID  The <tt>TEMP</tt> directory ID.
75 
76 @return  Returns the result of the function.
77 @retval TEMP_STATUS_OK  The process ended normally.
78 @retval TEMP_STATUS_ALREADY_OPEN  The <tt>TEMP</tt> directory cannot be deleted because one or more of its files or directories is still open.
79 @retval TEMP_STATUS_FATAL_ERROR  The library is not initialized.
80 */
81 TEMPStatus TEMPShutdownTempDir( TEMPDirID dirID );
82 
83 /*!
84 @brief  Gets the amount of free space remaining in the temporary directory.
85 
86 @param[in] pClient  Pointer to the client buffer.
87 @param[in] pCmd  The command block.
88 @param[in] dirID  The <tt>TEMP</tt> directory ID.
89 @param[out] pSize  Amount of free space, in bytes.
90 @param[in] errHandling  Flag for automatic error handling. Only reported errors are returned.
91 
92 
93 @return  Returns the result of the function.
94 @retval TEMP_STATUS_OK  The process ended normally.
95 @retval TEMP_STATUS_CANCELED  The command was canceled.
96 @retval TEMP_STATUS_NOT_FOUND  Target not found.
97 @retval TEMP_STATUS_PERMISSION_ERROR  The caller does not have the appropriate access permissions.
98 
99 */
100 TEMPStatus TEMPGetFreeSpaceSize(
101             FSClient                *pClient,
102             FSCmdBlock              *pCmd,
103             TEMPDirID               dirID,
104             FSFreeSpaceSize         *pSize,
105             FSRetFlag               errHandling
106             );
107 
108 /*!
109 @brief  Gets the amount of free space remaining in the temporary directory. (Asynchronous version.)
110 
111 @param[in] pClient  Pointer to the client buffer.
112 @param[in] pCmd  The command block.
113 @param[in] dirID  The <tt>TEMP</tt> directory ID.
114 @param[out] pSize  Amount of free space, in bytes.
115 @param[in] errHandling  Flag for automatic error handling. Only reported errors are returned.
116 @param[in] pAsyncParams  Notification parameters for asynchronous calls.
117 
118 
119 @return  Returns the function execution result using a callback.
120 @retval TEMP_STATUS_OK  The process ended normally.
121 @retval TEMP_STATUS_CANCELED  The command was canceled.
122 @retval TEMP_STATUS_NOT_FOUND  Target not found.
123 @retval TEMP_STATUS_PERMISSION_ERROR  The caller does not have the appropriate access permissions.
124 
125 @return  Immediate return values for asynchronous API functions.
126 @retval TEMP_STATUS_OK  The request was issued normally.
127 @retval TEMP_STATUS_FATAL_ERROR  Invalid parameter.
128 
129 */
130 TEMPStatus TEMPGetFreeSpaceSizeAsync(
131             FSClient                *pClient,
132             FSCmdBlock              *pCmd,
133             TEMPDirID               dirID,
134             FSFreeSpaceSize         *pSize,
135             FSRetFlag               errHandling,
136             const FSAsyncParams     *pAsyncParams
137             );
138 
139 /*!
140 @brief  Opens a file.
141 
142 @param[in] pClient  Pointer to the client buffer.
143 @param[in] pCmd  The command block.
144 @param[in] dirID  The <tt>TEMP</tt> directory ID.
145 @param[in] path  The relative path from the root path of the temporary directory specified by the <tt>TEMP</tt> directory ID.
146 The length must be less than <tt>FS_MAX_ARGPATH_SIZE</tt>.
147 @param[in] mode  A short string parameter that specifies the access mode. The length must be less than <tt>FS_MAX_MODE_SIZE</tt>.
148 The following values can be specified with the parameter. <br>
149 "r" : Opens a file for reading. The file must exist already. <br>
150 "w" : Creates an empty file for writing. If a file with the same name already exists, the content is erased and the file is treated as a new, empty file. <br>
151 "a" : Adds data to a file. When writing, data is added to the end of the file. If the file does not exist, it is created. <br>
152 "r+" : Opens a file for reading and writing so it can be updated. The specified file must exist already. <br>
153 "w+" : Creates an empty file for reading and writing. If a file with the same name already exists, the content is erased and the file is treated as a new, empty file. <br>
154 "a+" : Opens a file for reading and adding data. All writing is done to the end of the file to prevent the previous content from being overwritten. The internal pointer can be relocated to any position in the file when reading, but it gets returned to the end of the file when writing. If the file does not exist, it is created.
155 @param[out] pFileHandle  Pointer to the file stream handle associated with the file being opened.
156 @param[in] errHandling  Flag for automatic error handling. Only reported errors are returned.
157 
158 @return  Returns the result of the function.
159 @retval TEMP_STATUS_OK  The process ended normally.
160 @retval TEMP_STATUS_CANCELED  The command was canceled.
161 @retval TEMP_STATUS_ALREADY_OPEN  This file is already open. Attempted to open the file using an invalid procedure.
162 @retval TEMP_STATUS_NOT_FOUND  Target not found.
163 @retval TEMP_STATUS_NOT_FILE  The specified path is not a file path (not a file).
164 @retval TEMP_STATUS_MAX  No more files can be created because the number of system file points is too large.
165 @retval TEMP_STATUS_PERMISSION_ERROR  The caller does not have the appropriate access permissions.
166 @retval TEMP_STATUS_STORAGE_FULL  Indicates that a data region for updating the directory tree cannot be allocated.
167 */
168 TEMPStatus TEMPOpenFile(
169             FSClient *pClient,
170             FSCmdBlock *pCmd,
171             TEMPDirID dirID,
172             const char *path,
173             const char *mode,
174             FSFileHandle *pFileHandle,
175             FSRetFlag errHandling
176             );
177 
178 /*!
179 @brief  Opens a file.
180 
181 @param[in] pClient  Pointer to the client buffer.
182 @param[in] pCmd  The command block.
183 @param[in] dirID  The <tt>TEMP</tt> directory ID.
184 @param[in] path  The relative path from the root path of the temporary directory specified by the <tt>TEMP</tt> directory ID.
185 The length must be less than <tt>FS_MAX_ARGPATH_SIZE</tt>.
186 @param[in] mode  A short string parameter that specifies the access mode. The length must be less than <tt>FS_MAX_MODE_SIZE</tt>.
187 The following values can be specified with the parameter. <br>
188 "r" : Opens a file for reading. The file must exist already. <br>
189 "w" : Creates an empty file for writing. If a file with the same name already exists, the content is erased and the file is treated as a new, empty file. <br>
190 "a" : Adds data to a file. When writing, data is added to the end of the file. If the file does not exist, it is created. <br>
191 "r+" : Opens a file for reading and writing so it can be updated. The specified file must exist already. <br>
192 "w+" : Creates an empty file for reading and writing. If a file with the same name already exists, the content is erased and the file is treated as a new, empty file. <br>
193 "a+" : Opens a file for reading and adding data. All writing is done to the end of the file to prevent the previous content from being overwritten. The internal pointer can be relocated to any position in the file when reading, but it gets returned to the end of the file when writing. If the file does not exist, it is created.
194 @param[out] pFileHandle  Pointer to the file stream handle associated with the file being opened.
195 @param[in] errHandling  Flag for automatic error handling. Only reported errors are returned.
196 @param[in] pAsyncParams  Notification parameters for asynchronous calls.
197 
198 @return  Returns the function execution result using a callback.
199 @retval TEMP_STATUS_OK  The process ended normally.
200 @retval TEMP_STATUS_CANCELED  The command was canceled.
201 @retval TEMP_STATUS_ALREADY_OPEN  This file is already open. Attempted to open the file using an invalid procedure.
202 @retval TEMP_STATUS_NOT_FOUND  Target not found.
203 @retval TEMP_STATUS_NOT_FILE  The specified path is not a file path (not a file).
204 @retval TEMP_STATUS_MAX  No more files can be created because the number of system file points is too large.
205 @retval TEMP_STATUS_PERMISSION_ERROR  The caller does not have the appropriate access permissions.
206 @retval TEMP_STATUS_STORAGE_FULL  Indicates that a data region for updating the directory tree cannot be allocated.
207 
208 @return  Immediate return values for asynchronous API functions.
209 @retval TEMP_STATUS_OK  The request was issued normally.
210 @retval TEMP_STATUS_FATAL_ERROR  Invalid parameter.
211 */
212 TEMPStatus TEMPOpenFileAsync(
213             FSClient *pClient,
214             FSCmdBlock *pCmd,
215             TEMPDirID dirID,
216             const char *path,
217             const char *mode,
218             FSFileHandle *pFileHandle,
219             FSRetFlag errHandling,
220             const FSAsyncParams     *pAsyncParams
221             );
222 
223 /*!
224 @brief  Opens and appends a new file to the <tt>TEMP</tt> directory.
225 This function has not yet been fully implemented, so it currently returns <tt>TEMP_STATUS_UNSUPPORTED_CMD</tt>.
226 
227 @param[in] pClient  Pointer to the client buffer.
228 @param[in] pCmd  The command block.
229 @param[in] dirID  The <tt>TEMP</tt> directory ID.
230 @param[in] path  The relative path from the root path of the temporary directory specified by the <tt>TEMP</tt> directory ID.
231 The length must be less than <tt>FS_MAX_ARGPATH_SIZE</tt>.
232 @param[in] mode  A short string parameter that specifies the access mode. The length must be less than <tt>FS_MAX_MODE_SIZE</tt>.
233 The following values can be specified with the parameter. <br>
234 "r" : Opens a file for reading. The file must exist already. <br>
235 "w" : Creates an empty file for writing. If a file with the same name already exists, the content is erased and the file is treated as a new, empty file. <br>
236 "a" : Adds data to a file. When writing, data is added to the end of the file. If the file does not exist, it is created. <br>
237 "r+" : Opens a file for reading and writing so it can be updated. The specified file must exist already. <br>
238 "w+" : Creates an empty file for reading and writing. If a file with the same name already exists, the content is erased and the file is treated as a new, empty file. <br>
239 "a+" : Opens a file for reading and adding data. All writing is done to the end of the file to prevent the previous content from being overwritten. The internal pointer can be relocated to any position in the file when reading, but it gets returned to the end of the file when writing. If the file does not exist, it is created.
240 @param[out] pFileHandle  Pointer to the file stream handle associated with the file being opened.
241 @param[in] errHandling  Flag for automatic error handling. Only reported errors are returned.
242 
243 @return  Returns the result of the function.
244 @retval TEMP_STATUS_OK  The process ended normally.
245 @retval TEMP_STATUS_CANCELED  The command was canceled.
246 @retval TEMP_STATUS_ALREADY_OPEN  This file is already open. Attempted to open the file using an invalid procedure.
247 @retval TEMP_STATUS_NOT_FOUND  Target not found.
248 @retval TEMP_STATUS_NOT_FILE  The specified path is not a file path (not a file).
249 @retval TEMP_STATUS_MAX  No more files can be created because the number of system file points is too large.
250 @retval TEMP_STATUS_PERMISSION_ERROR  The caller does not have the appropriate access permissions.
251 @retval TEMP_STATUS_STORAGE_FULL  Indicates that a data region for updating the directory tree cannot be allocated.
252 */
253 TEMPStatus TEMPOpenNewFile(
254             FSClient *pClient,
255             FSCmdBlock *pCmd,
256             TEMPDirID dirID,
257             const char *path,
258             const char *mode,
259             u32 size,
260             FSFileHandle *pFileHandle,
261             FSRetFlag errHandling
262             );
263 
264 /*!
265 @brief  Opens and appends a new file to the <tt>TEMP</tt> directory.
266 This function has not yet been fully implemented, so it currently returns <tt>TEMP_STATUS_UNSUPPORTED_CMD</tt>.
267 
268 @param[in] pClient  Pointer to the client buffer.
269 @param[in] pCmd  The command block.
270 @param[in] dirID  The <tt>TEMP</tt> directory ID.
271 @param[in] path  The relative path from the root path of the temporary directory specified by the <tt>TEMP</tt> directory ID.
272 The length must be less than <tt>FS_MAX_ARGPATH_SIZE</tt>.
273 @param[in] mode  A short string parameter that specifies the access mode. The length must be less than <tt>FS_MAX_MODE_SIZE</tt>.
274 The following values can be specified with the parameter. <br>
275 "r" : Opens a file for reading. The file must exist already. <br>
276 "w" : Creates an empty file for writing. If a file with the same name already exists, the content is erased and the file is treated as a new, empty file. <br>
277 "a" : Adds data to a file. When writing, data is added to the end of the file. If the file does not exist, it is created. <br>
278 "r+" : Opens a file for reading and writing so it can be updated. The specified file must exist already. <br>
279 "w+" : Creates an empty file for reading and writing. If a file with the same name already exists, the content is erased and the file is treated as a new, empty file. <br>
280 "a+" : Opens a file for reading and adding data. All writing is done to the end of the file to prevent the previous content from being overwritten. The internal pointer can be relocated to any position in the file when reading, but it gets returned to the end of the file when writing. If the file does not exist, it is created.
281 @param[out] pFileHandle  Pointer to the file stream handle associated with the file being opened.
282 @param[in] errHandling  Flag for automatic error handling. Only reported errors are returned.
283 @param[in] pAsyncParams  Notification parameters for asynchronous calls.
284 
285 @return  Returns the result of the function.
286 @retval TEMP_STATUS_OK  The process ended normally.
287 @retval TEMP_STATUS_CANCELED  The command was canceled.
288 @retval TEMP_STATUS_ALREADY_OPEN  This file is already open. Attempted to open the file using an invalid procedure.
289 @retval TEMP_STATUS_NOT_FOUND  Target not found.
290 @retval TEMP_STATUS_NOT_FILE  The specified path is not a file path (not a file).
291 @retval TEMP_STATUS_MAX  No more files can be created because the number of system file points is too large.
292 @retval TEMP_STATUS_PERMISSION_ERROR  The caller does not have the appropriate access permissions.
293 @retval TEMP_STATUS_STORAGE_FULL  Indicates that a data region for updating the directory tree cannot be allocated.
294 
295 @return  Immediate return values for asynchronous API functions.
296 @retval TEMP_STATUS_OK  The request was issued normally.
297 @retval TEMP_STATUS_FATAL_ERROR  Invalid parameter.
298 */
299 TEMPStatus TEMPOpenNewFileAsync(
300             FSClient *pClient,
301             FSCmdBlock *pCmd,
302             TEMPDirID dirID,
303             const char *path,
304             const char *mode,
305             u32 size,
306             FSFileHandle *pFileHandle,
307             FSRetFlag errHandling,
308             const FSAsyncParams     *pAsyncParams
309             );
310 
311 /*!
312 @brief  Opens a directory and creates a directory stream.
313 
314 @param[in] pClient  Pointer to the client buffer.
315 @param[in] pCmd  The command block.
316 @param[in] dirID  The <tt>TEMP</tt> directory ID.
317 @param[in] path  The relative path from the root path of the temporary directory specified by the <tt>TEMP</tt> directory ID.
318 The length must be less than <tt>FS_MAX_ARGPATH_SIZE</tt>.
319 @param[out] pDirHandle  Pointer to the directory stream handle associated with the directory being opened.
320 @param[in] errHandling  Flag for automatic error handling. Only reported errors are returned.
321 
322 @return  Returns the result of the function.
323 @retval TEMP_STATUS_OK  The process ended normally.
324 @retval TEMP_STATUS_CANCELED  The command was canceled.
325 @retval TEMP_STATUS_NOT_FOUND  Target not found.
326 @retval TEMP_STATUS_NOT_DIR  The specified path is not a directory path (not a directory).
327 @retval TEMP_STATUS_PERMISSION_ERROR  The caller does not have the appropriate access permissions.
328 */
329 TEMPStatus TEMPOpenDir(
330             FSClient *pClient,
331             FSCmdBlock *pCmd,
332             TEMPDirID dirID,
333             const char *path,
334             FSDirHandle *pDirHandle,
335             FSRetFlag errHandling
336             );
337 
338 /*!
339 @brief  Opens a directory and creates a directory stream.
340 
341 @param[in] pClient  Pointer to the client buffer.
342 @param[in] pCmd  The command block.
343 @param[in] dirID  The <tt>TEMP</tt> directory ID.
344 @param[in] path  The relative path from the root path of the temporary directory specified by the <tt>TEMP</tt> directory ID.
345 The length must be less than <tt>FS_MAX_ARGPATH_SIZE</tt>.
346 @param[out] pDirHandle  Pointer to the directory stream handle associated with the directory being opened.
347 @param[in] errHandling  Flag for automatic error handling. Only reported errors are returned.
348 @param[in] pAsyncParams  Notification parameters for asynchronous calls.
349 
350 @return  Returns the function execution result using a callback.
351 @retval TEMP_STATUS_OK  The process ended normally.
352 @retval TEMP_STATUS_CANCELED  The command was canceled.
353 @retval TEMP_STATUS_NOT_FOUND  Target not found.
354 @retval TEMP_STATUS_NOT_DIR  The specified path is not a directory path (not a directory).
355 @retval TEMP_STATUS_PERMISSION_ERROR  The caller does not have the appropriate access permissions.
356 
357 @return  Immediate return values for asynchronous API functions.
358 @retval TEMP_STATUS_OK  The request was issued normally.
359 @retval TEMP_STATUS_FATAL_ERROR  Invalid parameter.
360 */
361 TEMPStatus TEMPOpenDirAsync(
362             FSClient *pClient,
363             FSCmdBlock *pCmd,
364             TEMPDirID dirID,
365             const char *path,
366             FSDirHandle *pDirHandle,
367             FSRetFlag errHandling,
368             const FSAsyncParams     *pAsyncParams
369             );
370 
371 /*!
372 @brief  Creates a directory.
373 
374 @param[in] pClient  Pointer to the client buffer.
375 @param[in] pCmd  The command block.
376 @param[in] dirID  The <tt>TEMP</tt> directory ID.
377 @param[in] path  The relative path from the root path of the temporary directory specified by the <tt>TEMP</tt> directory ID.
378 The length must be less than <tt>FS_MAX_ARGPATH_SIZE</tt>.
379 @param[in] errHandling  Flag for automatic error handling. Only reported errors are returned.
380 
381 @return  Returns the result of the function.
382 @retval TEMP_STATUS_OK  The process ended normally.
383 @retval TEMP_STATUS_CANCELED  The command was canceled.
384 @retval TEMP_STATUS_EXISTS  A directory with the target path already exists.
385 @retval TEMP_STATUS_NOT_FOUND  Target not found.
386 @retval TEMP_STATUS_PERMISSION_ERROR  The caller does not have the appropriate access permissions.
387 @retval TEMP_STATUS_STORAGE_FULL  Indicates that a data region for updating the directory tree cannot be allocated.
388 @retval TEMP_STATUS_JOURNAL_FULL  The journaling region is full. A new journaling block cannot be allocated.
389 */
390 TEMPStatus TEMPMakeDir(
391             FSClient *pClient,
392             FSCmdBlock *pCmd,
393             TEMPDirID dirID,
394             const char *path,
395             FSRetFlag errHandling
396             );
397 
398 /*!
399 @brief  Creates a directory.
400 
401 @param[in] pClient  Pointer to the client buffer.
402 @param[in] pCmd  The command block.
403 @param[in] dirID  The <tt>TEMP</tt> directory ID.
404 @param[in] path  The relative path from the root path of the temporary directory specified by the <tt>TEMP</tt> directory ID.
405 The length must be less than <tt>FS_MAX_ARGPATH_SIZE</tt>.
406 @param[in] errHandling  Flag for automatic error handling. Only reported errors are returned.
407 @param[in] pAsyncParams  Notification parameters for asynchronous calls.
408 
409 @return  Returns the function execution result using a callback.
410 @retval TEMP_STATUS_OK  The process ended normally.
411 @retval TEMP_STATUS_CANCELED  The command was canceled.
412 @retval TEMP_STATUS_EXISTS  A directory with the target path already exists.
413 @retval TEMP_STATUS_NOT_FOUND  Target not found.
414 @retval TEMP_STATUS_PERMISSION_ERROR  The caller does not have the appropriate access permissions.
415 @retval TEMP_STATUS_STORAGE_FULL  Indicates that a data region for updating the directory tree cannot be allocated.
416 @retval TEMP_STATUS_JOURNAL_FULL  The journaling region is full. A new journaling block cannot be allocated.
417 
418 @return  Immediate return values for asynchronous API functions.
419 @retval TEMP_STATUS_OK  The request was issued normally.
420 @retval TEMP_STATUS_FATAL_ERROR  Invalid parameter.
421 */
422 TEMPStatus TEMPMakeDirAsync(
423             FSClient *pClient,
424             FSCmdBlock *pCmd,
425             TEMPDirID dirID,
426             const char *path,
427             FSRetFlag errHandling,
428             const FSAsyncParams     *pAsyncParams
429             );
430 
431 /*!
432 @brief  Removes the target object.
433 
434 @param[in] pClient  Pointer to the client buffer.
435 @param[in] pCmd  The command block.
436 @param[in] dirID  The <tt>TEMP</tt> directory ID.
437 @param[in] path  Path of the file or directory to delete. This path is the relative path from the root path of the temporary directory specified by the <tt>TEMP</tt> directory ID.
438 The length must be less than <tt>FS_MAX_ARGPATH_SIZE</tt>.
439 @param[in] errHandling  Flag for automatic error handling. Only reported errors are returned.
440 
441 @return  Returns the result of the function.
442 @retval TEMP_STATUS_OK  The process ended normally.
443 @retval TEMP_STATUS_CANCELED  The command was canceled.
444 @retval TEMP_STATUS_NOT_FOUND  Target not found.
445 @retval TEMP_STATUS_PERMISSION_ERROR  The caller does not have the appropriate access permissions.
446 @retval TEMP_STATUS_ALREADY_OPEN  The file or directory with the specified path is still open.
447 @retval TEMP_STATUS_STORAGE_FULL  Indicates that a data region for updating the directory tree cannot be allocated.
448 @retval TEMP_STATUS_JOURNAL_FULL  The journaling region is full. A new journaling block cannot be allocated.
449 */
450 TEMPStatus TEMPRemove(
451             FSClient *pClient,
452             FSCmdBlock *pCmd,
453             TEMPDirID dirID,
454             const char *path,
455             FSRetFlag errHandling
456             );
457 
458 /*!
459 @brief  Removes the target object.
460 
461 @param[in] pClient  Pointer to the client buffer.
462 @param[in] pCmd  The command block.
463 @param[in] dirID  The <tt>TEMP</tt> directory ID.
464 @param[in] path  Path of the file or directory to delete. This path is the relative path from the root path of the temporary directory specified by the <tt>TEMP</tt> directory ID.
465 The length must be less than <tt>FS_MAX_ARGPATH_SIZE</tt>.
466 @param[in] errHandling  Flag for automatic error handling. Only reported errors are returned.
467 @param[in] pAsyncParams  Notification parameters for asynchronous calls.
468 
469 @return  Returns the function execution result using a callback.
470 @retval TEMP_STATUS_OK  The process ended normally.
471 @retval TEMP_STATUS_CANCELED  The command was canceled.
472 @retval TEMP_STATUS_NOT_FOUND  Target not found.
473 @retval TEMP_STATUS_PERMISSION_ERROR  The caller does not have the appropriate access permissions.
474 @retval TEMP_STATUS_ALREADY_OPEN  The file or directory with the specified path is still open.
475 @retval TEMP_STATUS_STORAGE_FULL  Indicates that a data region for updating the directory tree cannot be allocated.
476 @retval TEMP_STATUS_JOURNAL_FULL  The journaling region is full. A new journaling block cannot be allocated.
477 
478 @return  Immediate return values for asynchronous API functions.
479 @retval TEMP_STATUS_OK  The request was issued normally.
480 @retval TEMP_STATUS_FATAL_ERROR  Invalid parameter.
481 */
482 TEMPStatus TEMPRemoveAsync(
483             FSClient *pClient,
484             FSCmdBlock *pCmd,
485             TEMPDirID dirID,
486             const char *path,
487             FSRetFlag errHandling,
488             const FSAsyncParams     *pAsyncParams
489             );
490 
491 /*!
492 @brief  Modifies the name of the target object.
493 
494 @param[in] pClient  Pointer to the client buffer.
495 @param[in] pCmd  The command block.
496 @param[in] dirID  The <tt>TEMP</tt> directory ID.
497 @param[in] oldPath  Path of the file or directory whose name is being changed. This path is the relative path from the root path of the temporary directory specified by the <tt>TEMP</tt> directory ID.
498 The length must be less than <tt>FS_MAX_ARGPATH_SIZE</tt>.
499 @param[in] newPath  The new path to the new file or directory This path is the relative path from the root path of the temporary directory specified by the <tt>TEMP</tt> directory ID.
500 The length must be less than <tt>FS_MAX_ARGPATH_SIZE</tt>.
501 @param[in] errHandling  Flag for automatic error handling. Only reported errors are returned.
502 
503 @return  Returns the result of the function.
504 @retval TEMP_STATUS_OK  The process ended normally.
505 @retval TEMP_STATUS_CANCELED  The command was canceled.
506 @retval TEMP_STATUS_NOT_FOUND  Target not found.
507 @retval TEMP_STATUS_PERMISSION_ERROR  The caller does not have the appropriate access permissions.
508 @retval TEMP_STATUS_ALREADY_OPEN  One or more files or directories in the source path or path to modify is already open.
509 @retval TEMP_STATUS_STORAGE_FULL  Indicates that a data region for updating the directory tree cannot be allocated.
510 @retval TEMP_STATUS_JOURNAL_FULL  The journaling region is full. A new journaling block cannot be allocated.
511 */
512 TEMPStatus TEMPRename(
513             FSClient *pClient,
514             FSCmdBlock *pCmd,
515             TEMPDirID dirID,
516             const char *oldPath,
517             const char *newPath,
518             FSRetFlag errHandling
519             );
520 
521 /*!
522 @brief  Modifies the name of the target object.
523 
524 @param[in] pClient  Pointer to the client buffer.
525 @param[in] pCmd  The command block.
526 @param[in] dirID  The <tt>TEMP</tt> directory ID.
527 @param[in] oldPath  Path of the file or directory whose name is being changed. This path is the relative path from the root path of the temporary directory specified by the <tt>TEMP</tt> directory ID.
528 The length must be less than <tt>FS_MAX_ARGPATH_SIZE</tt>.
529 @param[in] newPath  The new path to the new file or directory This path is the relative path from the root path of the temporary directory specified by the <tt>TEMP</tt> directory ID.
530 The length must be less than <tt>FS_MAX_ARGPATH_SIZE</tt>.
531 @param[in] errHandling  Flag for automatic error handling. Only reported errors are returned.
532 @param[in] pAsyncParams  Notification parameters for asynchronous calls.
533 
534 @return  Returns the function execution result using a callback.
535 @retval TEMP_STATUS_OK  The process ended normally.
536 @retval TEMP_STATUS_CANCELED  The command was canceled.
537 @retval TEMP_STATUS_NOT_FOUND  Target not found.
538 @retval TEMP_STATUS_PERMISSION_ERROR  The caller does not have the appropriate access permissions.
539 @retval TEMP_STATUS_ALREADY_OPEN  One or more files or directories in the source path or path to modify is already open.
540 @retval TEMP_STATUS_STORAGE_FULL  Indicates that a data region for updating the directory tree cannot be allocated.
541 @retval TEMP_STATUS_JOURNAL_FULL  The journaling region is full. A new journaling block cannot be allocated.
542 
543 @return  Immediate return values for asynchronous API functions.
544 @retval TEMP_STATUS_OK  The request was issued normally.
545 @retval TEMP_STATUS_FATAL_ERROR  Invalid parameter.
546 */
547 TEMPStatus TEMPRenameAsync(
548             FSClient *pClient,
549             FSCmdBlock *pCmd,
550             TEMPDirID dirID,
551             const char *oldPath,
552             const char *newPath,
553             FSRetFlag errHandling,
554             const FSAsyncParams     *pAsyncParams
555             );
556 
557 /*!
558 @brief  Gets the <tt>Stat</tt> information for the target.
559 
560 @param[in] pClient  Pointer to the client buffer.
561 @param[in] pCmd  The command block.
562 @param[in] dirID  The <tt>TEMP</tt> directory ID.
563 @param[in] path  The file path to follow to get the status information. This path is the relative path from the root path of the temporary directory specified by the <tt>TEMP</tt> directory ID.
564 The length must be less than <tt>FS_MAX_ARGPATH_SIZE</tt>.
565 @param[out]   *pReturnedStat  Pointer to the status information.
566 @param[in] errHandling  Flag for automatic error handling. Only reported errors are returned.
567 
568 @return  Returns the result of the function.
569 @retval TEMP_STATUS_OK  The process ended normally.
570 @retval TEMP_STATUS_CANCELED  The command was canceled.
571 @retval TEMP_STATUS_NOT_FOUND  Target not found.
572 @retval TEMP_STATUS_FATAL_ERROR  Invalid parameter or the library is not initialized.
573 */
574 TEMPStatus TEMPGetStat(
575             FSClient *pClient,
576             FSCmdBlock *pCmd,
577             TEMPDirID dirID,
578             const char *path,
579             FSStat *pReturnedStat,
580             FSRetFlag errHandling
581             );
582 
583 /*!
584 @brief  Gets the <tt>Stat</tt> information for the target.
585 
586 @param[in] pClient  Pointer to the client buffer.
587 @param[in] pCmd  The command block.
588 @param[in] dirID  The <tt>TEMP</tt> directory ID.
589 @param[in] path  The file path to follow to get the status information. This path is the relative path from the root path of the temporary directory specified by the <tt>TEMP</tt> directory ID.
590 The length must be less than <tt>FS_MAX_ARGPATH_SIZE</tt>.
591 @param[out]   *pReturnedStat  Pointer to the status information.
592 @param[in] errHandling  Flag for automatic error handling. Only reported errors are returned.
593 @param[in] pAsyncParams  Notification parameters for asynchronous calls.
594 
595 @return  Returns the function execution result using a callback.
596 @retval TEMP_STATUS_OK  The process ended normally.
597 @retval TEMP_STATUS_CANCELED  The command was canceled.
598 @retval TEMP_STATUS_NOT_FOUND  Target not found.
599 @retval TEMP_STATUS_FATAL_ERROR  Invalid parameter or the library is not initialized.
600 
601 @return  Immediate return values for asynchronous API functions.
602 @retval TEMP_STATUS_OK  The request was issued normally.
603 @retval TEMP_STATUS_FATAL_ERROR  Invalid parameter.
604 */
605 TEMPStatus TEMPGetStatAsync(
606             FSClient *pClient,
607             FSCmdBlock *pCmd,
608             TEMPDirID dirID,
609             const char *path,
610             FSStat *pReturnedStat,
611             FSRetFlag errHandling,
612             const FSAsyncParams     *pAsyncParams
613             );
614 
615 /*!
616 @brief  Changes the current directory.
617 
618 @param[in] pClient  Pointer to the client buffer.
619 @param[in] pCmd  The command block.
620 @param[in] dirID  The <tt>TEMP</tt> directory ID.
621 @param[in] path  The path to the directory to change the current directory to. This path is the relative path from the root path of the temporary directory specified by the <tt>TEMP</tt> directory ID.
622 The length must be less than <tt>FS_MAX_ARGPATH_SIZE</tt>.
623 @param[in] errHandling  Flag for automatic error handling. Only reported errors are returned.
624 
625 @return  Returns the result of the function.
626 @retval TEMP_STATUS_OK  The process ended normally.
627 @retval TEMP_STATUS_CANCELED  The command was canceled.
628 */
629 TEMPStatus TEMPChangeDir(
630             FSClient *pClient,
631             FSCmdBlock *pCmd,
632             TEMPDirID dirID,
633             const char *path,
634             FSRetFlag errHandling
635             );
636 
637 /*!
638 @brief  Changes the current directory.
639 
640 @param[in] pClient  Pointer to the client buffer.
641 @param[in] pCmd  The command block.
642 @param[in] dirID  The <tt>TEMP</tt> directory ID.
643 @param[in] path  The path to the directory to change the current directory to. This path is the relative path from the root path of the temporary directory specified by the <tt>TEMP</tt> directory ID.
644 The length must be less than <tt>FS_MAX_ARGPATH_SIZE</tt>.
645 @param[in] errHandling  Flag for automatic error handling. Only reported errors are returned.
646 @param[in] pAsyncParams  Notification parameters for asynchronous calls.
647 
648 @return  Returns the function execution result using a callback.
649 @retval TEMP_STATUS_OK  The process ended normally.
650 @retval TEMP_STATUS_CANCELED  The command was canceled.
651 
652 @return  Immediate return values for asynchronous API functions.
653 @retval TEMP_STATUS_OK  The request was issued normally.
654 @retval TEMP_STATUS_FATAL_ERROR  Invalid parameter.
655 */
656 TEMPStatus TEMPChangeDirAsync(
657             FSClient *pClient,
658             FSCmdBlock *pCmd,
659             TEMPDirID dirID,
660             const char *path,
661             FSRetFlag errHandling,
662             const FSAsyncParams     *pAsyncParams
663             );
664 
665 //! @}
666 
667 #ifdef __cplusplus
668 }
669 #endif
670 
671 #endif // NN_TEMP_TEMP_API_H_
672