MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / stbi__fopen

Function stbi__fopen

Source/Utils/stb_image.h:1336–1362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1334#endif
1335
1336static FILE *stbi__fopen(char const *filename, char const *mode)
1337{
1338 FILE *f;
1339#if defined(_WIN32) && defined(STBI_WINDOWS_UTF8)
1340 wchar_t wMode[64];
1341 wchar_t wFilename[1024];
1342 if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, filename, -1, wFilename, sizeof(wFilename)/sizeof(*wFilename)))
1343 return 0;
1344
1345 if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, mode, -1, wMode, sizeof(wMode)/sizeof(*wMode)))
1346 return 0;
1347
1348#if defined(_MSC_VER) && _MSC_VER >= 1400
1349 if (0 != _wfopen_s(&f, wFilename, wMode))
1350 f = 0;
1351#else
1352 f = _wfopen(wFilename, wMode);
1353#endif
1354
1355#elif defined(_MSC_VER) && _MSC_VER >= 1400
1356 if (0 != fopen_s(&f, filename, mode))
1357 f=0;
1358#else
1359 f = fopen(filename, mode);
1360#endif
1361 return f;
1362}
1363
1364
1365STBIDEF stbi_uc *stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp)

Callers 6

stbi_loadFunction · 0.85
stbi_load_16Function · 0.85
stbi_loadfFunction · 0.85
stbi_is_hdrFunction · 0.85
stbi_infoFunction · 0.85
stbi_is_16_bitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected