Added INI dir check
Signed-off-by: luca0N! <63941044+luca0N@users.noreply.github.com>
This commit is contained in:
parent
1972eed113
commit
97dafa0ac2
15
main.c
15
main.c
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
int printLicense(int full){
|
int printLicense(int full){
|
||||||
if (full == 0) {
|
if (full == 0) {
|
||||||
|
@ -46,10 +47,20 @@ int printLicense(int full){
|
||||||
|
|
||||||
void getAdditionalDirs(){
|
void getAdditionalDirs(){
|
||||||
printf("%sRecolhendo pastas adicionais...\n", ANSI_COLOR_CYAN);
|
printf("%sRecolhendo pastas adicionais...\n", ANSI_COLOR_CYAN);
|
||||||
//FILE* adf = fopen("./adf.txt", "r");
|
|
||||||
int dirs;
|
int dirs;
|
||||||
dirs = GetPrivateProfileInt("Pastas", "Pastas", 3, ".\\cfg\\pastas.ini");
|
dirs = GetPrivateProfileInt("Pastas", "Pastas", 3, ".\\cfg\\pastas.ini");
|
||||||
printf("%s %d\n", STR_DIR_COUNT, dirs);
|
printf("%s %d\n", STR_DIR_COUNT, dirs);
|
||||||
|
fflush(stdout);
|
||||||
|
for(unsigned short x = 0; x < dirs; x++){
|
||||||
|
char dirKey[7] = "Pasta"; // PastaX...
|
||||||
|
//strcpy(dirKey, "Pasta");
|
||||||
|
char* intPtr = (x + 1) + '0';
|
||||||
|
strcat(dirKey, &intPtr);
|
||||||
|
_TCHAR currentPath[128];
|
||||||
|
GetPrivateProfileString("Pastas", dirKey, "null", currentPath,
|
||||||
|
sizeof(currentPath) / sizeof(currentPath[0]), ".\\cfg\\pastas.ini");
|
||||||
|
printf("%s [%s] %s\n", STR_FOUND_DIR, dirKey, currentPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cleanLoadedDirs(){
|
void cleanLoadedDirs(){
|
||||||
|
@ -79,6 +90,6 @@ int main(void){
|
||||||
return 0;
|
return 0;
|
||||||
getAdditionalDirs();
|
getAdditionalDirs();
|
||||||
cleanLoadedDirs();
|
cleanLoadedDirs();
|
||||||
printf("%s\n", ANSI_COLOR_RESET);
|
printf("%s", ANSI_COLOR_RESET);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
1
str.h
1
str.h
|
@ -28,6 +28,7 @@
|
||||||
#define STR_REMOVED_FILE "[Arquivo removido]"
|
#define STR_REMOVED_FILE "[Arquivo removido]"
|
||||||
#define STR_REMOVED_DIR "[Pasta removida]"
|
#define STR_REMOVED_DIR "[Pasta removida]"
|
||||||
#define STR_DIR_COUNT "[Contagem de pastas]"
|
#define STR_DIR_COUNT "[Contagem de pastas]"
|
||||||
|
#define STR_FOUND_DIR "[Pasta encontrada]"
|
||||||
|
|
||||||
#define STR_ERROR_LIC "Falha ao ler arquivo de licença. Visite <https://www.gnu.org/licenses/> para mais informações."
|
#define STR_ERROR_LIC "Falha ao ler arquivo de licença. Visite <https://www.gnu.org/licenses/> para mais informações."
|
||||||
|
|
||||||
|
|
Reference in New Issue