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

Function archive_utf16path

libctru/source/archive_dev.c:223–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223static const FS_Path
224archive_utf16path(struct _reent *r,
225 const char *path,
226 archive_fsdevice **device)
227{
228 ssize_t units;
229 FS_Path fspath;
230
231 fspath.data = NULL;
232
233 if(archive_fixpath(r, path, device) == NULL)
234 return fspath;
235
236 units = utf8_to_utf16(__ctru_dev_utf16_buf, (const uint8_t*)__ctru_dev_path_buf, PATH_MAX);
237 if(units < 0)
238 {
239 r->_errno = EILSEQ;
240 return fspath;
241 }
242 if(units > PATH_MAX)
243 {
244 r->_errno = ENAMETOOLONG;
245 return fspath;
246 }
247
248 __ctru_dev_utf16_buf[units] = 0;
249
250 fspath.type = PATH_UTF16;
251 fspath.size = (units+1)*sizeof(uint16_t);
252 fspath.data = __ctru_dev_utf16_buf;
253
254 return fspath;
255}
256
257extern int __system_argc;
258extern char** __system_argv;

Callers 9

archive_openFunction · 0.85
archive_statFunction · 0.85
archive_unlinkFunction · 0.85
archive_chdirFunction · 0.85
archive_renameFunction · 0.85
archive_mkdirFunction · 0.85
archive_diropenFunction · 0.85
archive_rmdirFunction · 0.85
archive_getmtimeFunction · 0.85

Calls 2

archive_fixpathFunction · 0.85
utf8_to_utf16Function · 0.85

Tested by

no test coverage detected