Added INI cfg
Signed-off-by: luca0N! <63941044+luca0N@users.noreply.github.com>
This commit is contained in:
parent
fb58d0819f
commit
a96bac1756
|
@ -0,0 +1,17 @@
|
||||||
|
;
|
||||||
|
; ┌──┐ │ ┌── ┌──┐ ─┬─ ┌──┐ │
|
||||||
|
; ├──┤ │ ├─ ├──┘ │ ├──┤ │
|
||||||
|
; │ │ └── └── │ \ │ │ │ •
|
||||||
|
;
|
||||||
|
; ALERTA!
|
||||||
|
;
|
||||||
|
; O limpador do luca0N! vai limpar as pastas especificadas abaixo.
|
||||||
|
; Tome cuidado! Certifique-se de que nenhuma pasta indesejada esteja listada abaixo.
|
||||||
|
; Após execução, não será possível restaurar os arquivos removidos.
|
||||||
|
;
|
||||||
|
|
||||||
|
[Pastas]
|
||||||
|
Pastas=3
|
||||||
|
Pasta1=%appdata%
|
||||||
|
Pasta2=%tmp%
|
||||||
|
Pasta3=C:\Windows\Temp\
|
17
main.c
17
main.c
|
@ -21,6 +21,7 @@
|
||||||
#include "str.h"
|
#include "str.h"
|
||||||
#include "colors.h"
|
#include "colors.h"
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int printLicense(int full){
|
int printLicense(int full){
|
||||||
|
@ -45,12 +46,14 @@ 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");
|
//FILE* adf = fopen("./adf.txt", "r");
|
||||||
|
int dirs;
|
||||||
|
dirs = GetPrivateProfileInt("Pastas", "Pastas", 3, ".\\cfg\\pastas.ini");
|
||||||
|
printf("%s %d\n", STR_DIR_COUNT, dirs);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cleanLoadedDirs(){
|
void cleanLoadedDirs(){
|
||||||
printf("%s%s...\n", ANSI_COLOR_CYAN, STR_CLEANING_DIRS);
|
printf("%s%s\n", ANSI_COLOR_CYAN, STR_CLEANING_DIRS);
|
||||||
|
|
||||||
// TODO: Limpar pastas.
|
// TODO: Limpar pastas.
|
||||||
}
|
}
|
||||||
|
@ -62,8 +65,8 @@ int main(void){
|
||||||
printf("%s\n--------------------\n\n", PROGRAM_COPYRIGHT);
|
printf("%s\n--------------------\n\n", PROGRAM_COPYRIGHT);
|
||||||
|
|
||||||
printf("%s%s\n", ANSI_COLOR_YELLOW, STR_USE_WARNING);
|
printf("%s%s\n", ANSI_COLOR_YELLOW, STR_USE_WARNING);
|
||||||
const char* in;
|
char in;
|
||||||
//printf(ANSI_COLOR_RESET);
|
printf(ANSI_COLOR_RESET);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
scanf("%c", &in);
|
scanf("%c", &in);
|
||||||
|
@ -74,8 +77,8 @@ int main(void){
|
||||||
|
|
||||||
if (in != 's' && in != 'S' && in != 'y' && in != 'Y')
|
if (in != 's' && in != 'S' && in != 'y' && in != 'Y')
|
||||||
return 0;
|
return 0;
|
||||||
|
getAdditionalDirs();
|
||||||
//getAdditionalDirs();
|
|
||||||
cleanLoadedDirs();
|
cleanLoadedDirs();
|
||||||
|
printf("%s\n", ANSI_COLOR_RESET);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
1
str.h
1
str.h
|
@ -27,6 +27,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_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