MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / MakeCachePath

Function MakeCachePath

src/TexturePack.c:344–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342}
343
344CC_NOINLINE static void MakeCachePath(cc_string* mainPath, cc_string* altPath, const cc_string* url) {
345 cc_string key; char keyBuffer[STRING_INT_CHARS];
346 String_InitArray(key, keyBuffer);
347 HashUrl(&key, url);
348
349 if (UseDedicatedCache(mainPath, &key)) {
350 /* If using dedicated cache directory, also fallback to default cache directory */
351 String_Format1(altPath, "texturecache/%s", &key);
352 } else {
353 mainPath->length = 0;
354 String_Format1(mainPath, "texturecache/%s", &key);
355 }
356}
357
358/* Returns non-zero if given URL has been cached */
359static int IsCached(const cc_string* url) {

Callers 3

IsCachedFunction · 0.85
OpenCachedDataFunction · 0.85
UpdateCacheFunction · 0.85

Calls 3

HashUrlFunction · 0.85
UseDedicatedCacheFunction · 0.85
String_Format1Function · 0.85

Tested by

no test coverage detected