This repository has been archived on 2020-12-25. You can view files and clone it, but cannot push or open issues or pull requests.
ldl3/main.c

84 lines
2.1 KiB
C
Raw Normal View History

2020-04-26 21:55:11 +00:00
/*
limpador do luca0N! 3
Copyright (C) 2020 luca0N!
2020-04-26 21:55:11 +00:00
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
2020-04-26 21:55:11 +00:00
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
2020-04-26 21:55:11 +00:00
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
2020-04-26 21:55:11 +00:00
Contact me by e-mail via <mailto:luca0n@protonmail.com>
2020-04-26 21:55:11 +00:00
*/
#include "about.h"
#include "str.h"
#include "colors.h"
#include <windows.h>
2020-04-26 21:55:11 +00:00
#include <stdio.h>
int printLicense(int full){
if (full == 0) {
printf("%s\n", LICENSE_0);
printf("%s\n", LICENSE_1);
printf("%s\n", LICENSE_2);
printf("%s\n", LICENSE_3);
return 0;
} else {
FILE* flic = fopen("./LICENSE", "r");
if (flic == NULL){
printf("%s\n", STR_ERROR_LIC);
return -1;
}
char c;
while ((c = fgetc(flic)) != EOF) {
printf("%c", c);
}
}
2020-04-26 21:55:11 +00:00
}
void getAdditionalDirs(){
printf("%sRecolhendo pastas adicionais...\n", ANSI_COLOR_CYAN);
//FILE* adf = fopen("./adf.txt", "r");
int dirs;
dirs = GetPrivateProfileInt("Pastas", "Pastas", 3, ".\\cfg\\pastas.ini");
printf("%s %d\n", STR_DIR_COUNT, dirs);
2020-04-26 21:55:11 +00:00
}
void cleanLoadedDirs(){
printf("%s%s\n", ANSI_COLOR_CYAN, STR_CLEANING_DIRS);
2020-04-26 21:55:11 +00:00
// TODO: Limpar pastas.
2020-04-26 21:55:11 +00:00
}
int main(void){
printLicense(0);
2020-04-26 21:55:11 +00:00
printf("--------------------\n%s %d, %s\n", PROGRAM_NAME, PROGRAM_SEASON, PROGRAM_VERSION);
printf("%s\n--------------------\n\n", PROGRAM_COPYRIGHT);
2020-04-26 21:55:11 +00:00
printf("%s%s\n", ANSI_COLOR_YELLOW, STR_USE_WARNING);
char in;
printf(ANSI_COLOR_RESET);
fflush(stdout);
2020-04-26 21:55:11 +00:00
scanf("%c", &in);
2020-04-26 21:55:11 +00:00
if (in == 'w' || in == 'c')
if (printLicense(1) != 0)
return 0;
2020-04-26 21:55:11 +00:00
if (in != 's' && in != 'S' && in != 'y' && in != 'Y')
return 0;
getAdditionalDirs();
cleanLoadedDirs();
printf("%s\n", ANSI_COLOR_RESET);
return 0;
2020-04-26 21:55:11 +00:00
}