MCPcopy Create free account
hub / github.com/cppla/ServerStatus / fs_storage_path

Function fs_storage_path

server/src/system.c:1355–1381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1353}
1354
1355int fs_storage_path(const char *appname, char *path, int max)
1356{
1357#if defined(CONF_FAMILY_WINDOWS)
1358 char *home = getenv("APPDATA");
1359 if(!home)
1360 return -1;
1361 _snprintf(path, max, "%s/%s", home, appname);
1362 return 0;
1363#else
1364 char *home = getenv("HOME");
1365#if !defined(CONF_PLATFORM_MACOSX)
1366 int i;
1367#endif
1368 if(!home)
1369 return -1;
1370
1371#if defined(CONF_PLATFORM_MACOSX)
1372 snprintf(path, max, "%s/Library/Application Support/%s", home, appname);
1373#else
1374 snprintf(path, max, "%s/.%s", home, appname);
1375 for(i = strlen(home)+2; path[i]; i++)
1376 path[i] = tolower(path[i]);
1377#endif
1378
1379 return 0;
1380#endif
1381}
1382
1383int fs_makedir(const char *path)
1384{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected