MCPcopy Create free account
hub / github.com/devkitPro/libctru / archiveFindDevice

Function archiveFindDevice

libctru/source/archive_dev.c:109–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107/*! @endcond */
108
109static archive_fsdevice *archiveFindDevice(const char *name)
110{
111 u32 i;
112 u32 total = sizeof(archive_devices) / sizeof(archive_fsdevice);
113 archive_fsdevice *device = NULL;
114
115 if(!archive_initialized)
116 return NULL;
117
118 for(i=0; i<total; i++)
119 {
120 device = &archive_devices[i];
121
122 if(name==NULL) //Find an unused device entry.
123 {
124 if(!device->setup)
125 return device;
126 }
127 else if(device->setup) //Find the device with the input name.
128 {
129 size_t devnamelen = strlen(device->name);
130 if(strncmp(device->name, name, devnamelen)==0 && (name[devnamelen]=='\0' || name[devnamelen]==':'))
131 return device;
132 }
133 }
134
135 return NULL;
136}
137
138static const char*
139archive_fixpath(struct _reent *r,

Callers 4

archive_fixpathFunction · 0.85
_archiveMountDeviceFunction · 0.85
archiveCommitSaveDataFunction · 0.85
archiveUnmountFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected