Added existing source files
This commit is contained in:
parent
d3b6a9324a
commit
86cb29c825
5 changed files with 206 additions and 0 deletions
26
Makefile
Normal file
26
Makefile
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
# limpador do luca0N! 2
|
||||||
|
# Copyright (C) 2020 luca0N!
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
# Contact me by e-mail via <mailto:luca0n@protonmail.com>
|
||||||
|
|
||||||
|
ldl2: main.o about.h str.h colors.h
|
||||||
|
gcc main.o about.h str.h colors.h -s -o ldl2
|
||||||
|
|
||||||
|
main.o: main.c
|
||||||
|
gcc -c main.c
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm *.o *.exe
|
36
about.h
Normal file
36
about.h
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
/*
|
||||||
|
limpador do luca0N! 2
|
||||||
|
Copyright (C) 2020 luca0N!
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Contact me by e-mail via <mailto:luca0n@protonmail.com>
|
||||||
|
*/
|
||||||
|
#ifndef ABOUT_DEF
|
||||||
|
#define ABOUT_DEF
|
||||||
|
|
||||||
|
#define LICENSE_0 "limpador do luca0N! 2 Copyright (C) 2020 luca0N!"
|
||||||
|
#define LICENSE_1 "This program comes with ABSOLUTELY NO WARRANTY; for details type `w'."
|
||||||
|
#define LICENSE_2 "This is free software, and you are welcome to redistribute it"
|
||||||
|
#define LICENSE_3 "under certain conditions; type `c' for details."
|
||||||
|
|
||||||
|
#define PROGRAM_NAME "limpador do luca0N!"
|
||||||
|
#define PROGRAM_SEASON 2
|
||||||
|
#define PROGRAM_VERSION "v2.0"
|
||||||
|
#define PROGRAM_VERSION_TIMESTAMP "26/04/2020"
|
||||||
|
|
||||||
|
#define PROGRAM_AUTHOR "luca0N!"
|
||||||
|
#define PROGRAM_COPYRIGHT "software do luca0N! 2020"
|
||||||
|
|
||||||
|
#endif
|
30
colors.h
Normal file
30
colors.h
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
/*
|
||||||
|
limpador do luca0N! 2
|
||||||
|
Copyright (C) 2020 luca0N!
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Contact me by e-mail via <mailto:luca0n@protonmail.com>
|
||||||
|
*/
|
||||||
|
#ifndef COLORS_DEF
|
||||||
|
#define COLORS_DEF
|
||||||
|
|
||||||
|
#define ANSI_COLOR_RED "\x1b[31m"
|
||||||
|
#define ANSI_COLOR_GREEN "\x1b[32m"
|
||||||
|
#define ANSI_COLOR_YELLOW "\x1b[33m"
|
||||||
|
#define ANSI_COLOR_BLUE "\x1b[34m"
|
||||||
|
#define ANSI_COLOR_MAGENTA "\x1b[35m"
|
||||||
|
#define ANSI_COLOR_CYAN "\x1b[36m"
|
||||||
|
|
||||||
|
#endif
|
81
main.c
Normal file
81
main.c
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
/*
|
||||||
|
limpador do luca0N! 2
|
||||||
|
Copyright (C) 2020 luca0N!
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Contact me by e-mail via <mailto:luca0n@protonmail.com>
|
||||||
|
*/
|
||||||
|
#include "about.h"
|
||||||
|
#include "str.h"
|
||||||
|
#include "colors.h"
|
||||||
|
|
||||||
|
#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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void getAdditionalDirs(){
|
||||||
|
printf("%sRecolhendo pastas adicionais...\n", ANSI_COLOR_CYAN);
|
||||||
|
FILE* adf = fopen("./adf.txt", "r");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void cleanLoadedDirs(){
|
||||||
|
printf("%s%s...\n", ANSI_COLOR_CYAN, STR_CLEANING_DIRS);
|
||||||
|
|
||||||
|
// TODO: Limpar pastas.
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(void){
|
||||||
|
printLicense(0);
|
||||||
|
|
||||||
|
printf("--------------------\n%s %d, %s\n", PROGRAM_NAME, PROGRAM_SEASON, PROGRAM_VERSION);
|
||||||
|
printf("%s\n--------------------\n\n", PROGRAM_COPYRIGHT);
|
||||||
|
|
||||||
|
printf("%s%s\n", ANSI_COLOR_YELLOW, STR_USE_WARNING);
|
||||||
|
const char* in;
|
||||||
|
//printf(ANSI_COLOR_RESET);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
scanf("%c", &in);
|
||||||
|
|
||||||
|
if (in == 'w' || in == 'c')
|
||||||
|
if (printLicense(1) != 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (in != 's' && in != 'S' && in != 'y' && in != 'Y')
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
//getAdditionalDirs();
|
||||||
|
cleanLoadedDirs();
|
||||||
|
return 0;
|
||||||
|
}
|
33
str.h
Normal file
33
str.h
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
limpador do luca0N! 2
|
||||||
|
Copyright (C) 2020 luca0N!
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Contact me by e-mail via <mailto:luca0n@protonmail.com>
|
||||||
|
*/
|
||||||
|
#ifndef STR_DEF
|
||||||
|
#define STR_DEF
|
||||||
|
|
||||||
|
#define STR_USE_WARNING "Aviso: é recomendado fechar todos os programas abertos antes de utilizar este programa para poder remover mais arquivos temporários. Deseja continuar? (S/n)"
|
||||||
|
|
||||||
|
#define STR_FETCHING_ADD "Recolhendo pastas adicionais..."
|
||||||
|
#define STR_CLEANING_DIRS "Limpando pastas carregadas..."
|
||||||
|
|
||||||
|
#define STR_REMOVED_FILE "[Arquivo removido] "
|
||||||
|
#define STR_REMOVED_DIR "[Pasta removida] "
|
||||||
|
|
||||||
|
#define STR_ERROR_LIC "Falha ao ler arquivo de licença. Visite <https://www.gnu.org/licenses/> para mais informações."
|
||||||
|
|
||||||
|
#endif
|
Reference in a new issue