| 1353 | } |
| 1354 | |
| 1355 | int 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 | |
| 1383 | int fs_makedir(const char *path) |
| 1384 | { |
nothing calls this directly
no outgoing calls
no test coverage detected