|
1182 | 1182 | if(extenstion || (file->d_type == 2)) { |
1183 | 1183 | SEEK[ROMS.total+1] = telldir(directory); |
1184 | 1184 | ROMS.total++; |
1185 | | - |
1186 | | - //add_games(EXTENSIONS[STEP], file->d_name); |
1187 | 1185 | } |
1188 | 1186 | } |
1189 | 1187 | free(file); |
|
1283 | 1281 | } |
1284 | 1282 |
|
1285 | 1283 | void get_files() { |
1286 | | - //create_games_file(DIRECTORIES[STEP]); |
1287 | 1284 | delete_numbers(); |
1288 | 1285 | count_files(); |
1289 | 1286 | seek_files(); |
|
1356 | 1353 | } |
1357 | 1354 | //}#pragma endregion Files |
1358 | 1355 |
|
1359 | | -//{#pragma region File Manager |
1360 | | - char** GAMES; |
1361 | | - void create_games_file(char *emulator) { |
1362 | | - printf("\n----- %s(%s) START -----", __func__, emulator); |
1363 | | - char file[256] = "/sd/odroid/data"; |
1364 | | - sprintf(file, "%s/%s", file, RETROESP_FOLDER); |
1365 | | - sprintf(file, "%s/%s.txt", file, emulator); |
1366 | | - |
1367 | | - struct stat st; if (stat(file, &st) == 0) {unlink(file);} |
1368 | | - |
1369 | | - FILE *f; |
1370 | | - f = fopen(file, "rb"); |
1371 | | - if(f == NULL) { |
1372 | | - f = fopen(file, "w+"); |
1373 | | - // printf("\nCREATING: %s", file); |
1374 | | - } else { |
1375 | | - read_favorites(); |
1376 | | - } |
1377 | | - // printf("\nCLOSING: %s", file); |
1378 | | - fclose(f); |
1379 | | - printf("\n----- %s END -----", __func__); |
1380 | | - } |
1381 | | - |
1382 | | - void read_games_file(char *emulator) { |
1383 | | - printf("\n----- %s START -----", __func__); |
1384 | | - char file[256] = "/sd/odroid/data"; |
1385 | | - sprintf(file, "%s/%s", file, RETROESP_FOLDER); |
1386 | | - sprintf(file, "%s/%s.txt", file, emulator); |
1387 | | - |
1388 | | - FILE *f; |
1389 | | - f = fopen(file, "rb"); |
1390 | | - if(f) { |
1391 | | - // printf("\nREADING: %s\n", file); |
1392 | | - char line[256]; |
1393 | | - while (fgets(line, sizeof(line), f)) { |
1394 | | - char *ep = &line[strlen(line)-1]; |
1395 | | - while (*ep == '\n' || *ep == '\r'){*ep-- = '\0';} |
1396 | | - printf("\n%s", line); |
1397 | | - } |
1398 | | - } |
1399 | | - fclose(f); |
1400 | | - |
1401 | | - printf("\n----- %s END -----", __func__); |
1402 | | - } |
1403 | | - |
1404 | | - void add_games(char *emulator, char *game) { |
1405 | | - printf("\n----- %s START -----", __func__); |
1406 | | - |
1407 | | - char file[256] = "/sd/odroid/data"; |
1408 | | - sprintf(file, "%s/%s", file, RETROESP_FOLDER); |
1409 | | - sprintf(file, "%s/%s.txt", file, emulator); |
1410 | | - |
1411 | | - printf("%s\n", game); |
1412 | | - |
1413 | | - printf("\n----- %s END -----", __func__); |
1414 | | - } |
1415 | | -//}#pragma endregion File Manager |
1416 | | - |
1417 | 1356 | //{#pragma region Favorites |
1418 | 1357 | void create_favorites() { |
1419 | 1358 | // printf("\n----- %s START -----", __func__); |
|
0 commit comments