libctru  v1.6.0
sdmc.h
Go to the documentation of this file.
1 /**
2  * @file sdmc.h
3  * @brief SDMC driver.
4  */
5 #pragma once
6 
7 #include <sys/types.h>
8 
9 #include <3ds/types.h>
10 #include <3ds/services/fs.h>
11 
12 #define SDMC_DIRITER_MAGIC 0x73646D63 /* "sdmc" */
13 
14 /*! Open directory struct */
15 typedef struct
16 {
17  u32 magic; /*! "sdmc" */
18  Handle fd; /*! CTRU handle */
19  ssize_t index; /*! Current entry index */
20  size_t size; /*! Current batch size */
21  FS_DirectoryEntry entry_data[32]; /*! Temporary storage for reading entries */
22 } sdmc_dir_t;
23 
24 /// Initializes the SDMC driver.
25 Result sdmcInit(void);
26 
27 /// Enable/disable copy in sdmc_write
28 void sdmcWriteSafe(bool enable);
29 
30 /// Exits the SDMC driver.
31 Result sdmcExit(void);
32 
33 /// Get a file's mtime
34 Result sdmc_getmtime(const char *name, u64 *mtime);
void sdmcWriteSafe(bool enable)
Enable/disable copy in sdmc_write.
Various system types.
s32 Result
Function result.
Definition: types.h:42
Filesystem Services.
u32 Handle
Resource handle.
Definition: types.h:41
uint64_t u64
64-bit unsigned integer
Definition: types.h:24
Open directory struct.
Definition: sdmc.h:15
uint32_t u32
32-bit unsigned integer
Definition: types.h:23
ssize_t index
CTRU handle.
Definition: sdmc.h:19
Result sdmc_getmtime(const char *name, u64 *mtime)
Get a file's mtime.
Directory entry.
Definition: fs.h:160
Handle fd
"sdmc"
Definition: sdmc.h:18
size_t size
Current entry index.
Definition: sdmc.h:20
Result sdmcExit(void)
Exits the SDMC driver.
Result sdmcInit(void)
Initializes the SDMC driver.