Skip to content

Commit

Permalink
boa parte do programa colorida // falta so concluir o arquivo functio…
Browse files Browse the repository at this point in the history
…ns_system
  • Loading branch information
lukaian-k committed Jul 3, 2022
1 parent 229ee2c commit d95dca3
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 87 deletions.
66 changes: 13 additions & 53 deletions .vscode/targets.log
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ make: *** No rule to make target 'all'. Stop.
# This is free software: you are free to change and redistribute it.
# There is NO WARRANTY, to the extent permitted by law.

<<<<<<< HEAD
# Make data base, printed on Sat Jul 2 12:30:58 2022
=======
# Make data base, printed on Sat Jul 2 19:11:47 2022
>>>>>>> 7b7cef9 (pequeno ajuste no remover encomenda)
# Make data base, printed on Sun Jul 3 11:03:16 2022

# Variables

Expand All @@ -25,11 +21,7 @@ NO_AT_BRIDGE = 1
# environment
GJS_DEBUG_OUTPUT = stderr
# environment
<<<<<<< HEAD
VSCODE_IPC_HOOK_EXTHOST = /run/user/1000/vscode-ipc-21b6637e-e4e6-470f-af21-84da88e37917.sock
=======
VSCODE_IPC_HOOK_EXTHOST = /run/user/1000/vscode-ipc-13b267ee-3384-46aa-879e-dbe7c22cb969.sock
>>>>>>> 7b7cef9 (pequeno ajuste no remover encomenda)
VSCODE_IPC_HOOK_EXTHOST = /run/user/1000/vscode-ipc-34593c4a-3714-4c53-a2f2-923c055441bd.sock
# environment
VSCODE_CWD = /home/lukaian
# environment
Expand Down Expand Up @@ -71,11 +63,7 @@ VSCODE_CODE_CACHE_PATH = /home/lukaian/.config/Code/CachedData/30d9c6cd9483b2cc5
# environment
LANG = C
# environment
<<<<<<< HEAD
XAUTHORITY = /run/user/1000/.mutter-Xwaylandauth.AIRSO1
=======
XAUTHORITY = /run/user/1000/.mutter-Xwaylandauth.7MXXO1
>>>>>>> 7b7cef9 (pequeno ajuste no remover encomenda)
XAUTHORITY = /run/user/1000/.mutter-Xwaylandauth.GWN5O1
# default
.LOADED :=
# default
Expand Down Expand Up @@ -113,17 +101,13 @@ MAKEFILE_LIST :=
# environment
VSCODE_VERBOSE_LOGGING = true
# environment
<<<<<<< HEAD
VSCODE_PID = 2819
=======
VSCODE_PID = 2523
>>>>>>> 7b7cef9 (pequeno ajuste no remover encomenda)
VSCODE_PID = 2552
# environment
XDG_SESSION_TYPE = wayland
# automatic
?D = $(patsubst %/,%,$(dir $?))
# environment
SESSION_MANAGER = local/unix:@/tmp/.ICE-unix/1665,unix/unix:/tmp/.ICE-unix/1665
SESSION_MANAGER = local/unix:@/tmp/.ICE-unix/1689,unix/unix:/tmp/.ICE-unix/1689
# automatic
*F = $(notdir $*)
# environment
Expand All @@ -148,6 +132,7 @@ GJS_DEBUG_TOPICS = JS ERROR;JS LOG
SHLVL = 0
# environment
MAKELEVEL := 0

# default
MAKE = $(MAKE_COMMAND)
# environment
Expand All @@ -161,11 +146,7 @@ MAKEFILES :=
# automatic
^F = $(notdir $^)
# environment
<<<<<<< HEAD
INVOCATION_ID = 995a6d7d7cc04bb48ca31a298c98e21c
=======
INVOCATION_ID = 6312d7f4c02b45049d1763b64137711e
>>>>>>> 7b7cef9 (pequeno ajuste no remover encomenda)
INVOCATION_ID = 1ed3ac3bb3eb4716a5a6486b20da4962
# environment
VSCODE_LOG_NATIVE = false
# environment
Expand Down Expand Up @@ -195,11 +176,7 @@ GIO_LAUNCHED_DESKTOP_FILE = /usr/share/applications/code.desktop
# makefile
.DEFAULT_GOAL :=
# environment
<<<<<<< HEAD
SYSTEMD_EXEC_PID = 1725
=======
SYSTEMD_EXEC_PID = 1722
>>>>>>> 7b7cef9 (pequeno ajuste no remover encomenda)
SYSTEMD_EXEC_PID = 1741
# environment
HISTCONTROL = ignoredups
# environment
Expand All @@ -211,31 +188,19 @@ USER = lukaian
# default
MAKE_VERSION := 4.3
# environment
<<<<<<< HEAD
MANAGERPID = 1550
=======
MANAGERPID = 1548
>>>>>>> 7b7cef9 (pequeno ajuste no remover encomenda)
MANAGERPID = 1574
# environment
which_declare = declare -f
# environment
DEBUGINFOD_URLS = https://debuginfod.fedoraproject.org/
# environment
<<<<<<< HEAD
GIO_LAUNCHED_DESKTOP_FILE_PID = 2819
=======
GIO_LAUNCHED_DESKTOP_FILE_PID = 2523
>>>>>>> 7b7cef9 (pequeno ajuste no remover encomenda)
GIO_LAUNCHED_DESKTOP_FILE_PID = 2552
# environment
_ = /usr/bin/make
# environment
XDG_RUNTIME_DIR = /run/user/1000
# environment
<<<<<<< HEAD
JOURNAL_STREAM = 8:28545
=======
JOURNAL_STREAM = 8:29064
>>>>>>> 7b7cef9 (pequeno ajuste no remover encomenda)
JOURNAL_STREAM = 8:27635
# environment
XDG_SESSION_CLASS = user
# environment
Expand All @@ -257,10 +222,10 @@ SUFFIXES :=
# default
.FEATURES := target-specific order-only second-expansion else-if shortest-stem undefine oneshell nocomment grouped-target extra-prereqs archives jobserver output-sync check-symlink guile load
# environment

XDG_MENU_PREFIX = gnome-
# environment
GDMSESSION = gnome

# variable set hash-table stats:
# Load=104/1024=10%, Rehash=0, Collisions=4/131=3%

Expand Down Expand Up @@ -327,12 +292,7 @@ GNUmakefile:

# strcache performance: lookups = 23 / hit rate = 13%
# hash-table stats:

# Load=20/8192=0%, Rehash=0, Collisions=0/23=0%
<<<<<<< HEAD
# Finished Make data base on Sat Jul 2 12:30:58 2022
=======
# Finished Make data base on Sat Jul 2 19:11:47 2022
>>>>>>> 7b7cef9 (pequeno ajuste no remover encomenda)
# Finished Make data base on Sun Jul 3 11:03:16 2022


19 changes: 10 additions & 9 deletions abb.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void add_abb(Abb_node *new, Abb_node *aux, int id){

Abb_node *remover_abb(Abb_node *root, int id, Abb_node *backup){
if (root == NULL){
printf("Valor nao encontrado!\n"); return NULL;}
printf(BOLD BACKGROUND_WHITE FONT_RED "Valor nao encontrado!\n" RESET); return NULL;}

else { //procura o nó a remover
if (root->id == id){ //remove nós, caso nao tenha filhos
Expand Down Expand Up @@ -69,16 +69,16 @@ void in_ordem(Abb_node *aux){
if (aux != NULL){
if (aux->left != NULL){in_ordem(aux->left);}

printf("===ENCOMENDA=== ID: ");
printf("%d\n", aux->id);
printf("%s\n", aux->nome_aluno);
printf("%d\n", aux->matricula);
printf("%s\n", aux->descricao);
printf("===============\n\n");
printf(BOLD BACKGROUND_BLUE "<<<ENCOMENDA>>> ID:");
printf(FONT_GREEN " %d \n" RESET, aux->id);
printf(BACKGROUND_WHITE FONT_BLACK " Nome do aluno: %s \n", aux->nome_aluno);
printf(" Matricula do aluno: %d \n", aux->matricula);
printf(" Descrição do livro: %s \n" RESET, aux->descricao);
printf(BOLD BACKGROUND_BLUE"-----------------------\n" RESET);

if (aux->right != NULL){in_ordem(aux->right);}}

else {printf("\nNão foi encontrada nenhuma encomenda pendente.\n\n");}}
else {printf(BOLD BACKGROUND_WHITE FONT_RED "\n Não foi encontrada nenhuma encomenda pendente. \n" RESET);}}


void node_imprimir(int id, int espaco) { //funcao aux da: abb_exibir_estrutura
Expand All @@ -87,8 +87,9 @@ void node_imprimir(int id, int espaco) { //funcao aux da: abb_exibir_estrutura
//exibe a estrutura da abb de forma grafica
void abb_exibir_estrutura(Abb_node *node, int espaco) {
if (node == NULL) {
printf(FONT_RED);
node_imprimir(-1, espaco); return;}

abb_exibir_estrutura(node->right, espaco+1);
node_imprimir(node->id, espaco);
printf(FONT_GREEN); node_imprimir(node->id, espaco);
abb_exibir_estrutura(node->left, espaco+1);}
4 changes: 2 additions & 2 deletions fila_pre_cadastrados.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ void fifopre_add(char *nome, char *senha, int cpf, char cargo){

void fifopre_imprimir(Fifopre_node *aux){
if (aux != NULL){
printf("%s - Cargo: %c\n", aux->admin.nome, aux->admin.cargo);
printf("--------------------------------------------\n");
printf(BACKGROUND_WHITE FONT_BLACK " %s - Cargo: %c \n" RESET, aux->admin.nome, aux->admin.cargo);
printf(BOLD FONT_GREEN "-----------------------------\n" RESET);
fifopre_imprimir(aux->next);}}


Expand Down
10 changes: 9 additions & 1 deletion fila_prioridade.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,15 @@ void add_fila(int id, int prioridade, char *nome_aluno, int matricula, char *des

void imprimir(Fifop_node *aux){
if (aux != NULL){
printf("Identificador: %d\n", aux->pedido->id);
printf(BOLD BACKGROUND_WHITE FONT_GREEN " Identificador: %d \n", aux->pedido->id);
printf(FONT_BLUE " Nome do responsavel: %s \n", aux->pedido->nome_responsavel);
printf(FONT_BLACK " Nome do aluno: %s \n", aux->pedido->nome_aluno);
printf(" Matricula do aluno: %d \n", aux->pedido->matricula);
printf(" Nome do campus do aluno: %s \n", aux->pedido->nome_campus_aluno);
printf(" Descrição do livro: %s \n", aux->pedido->descricao);
printf(" Campus onde o livro se encontra: %s \n", aux->pedido->nome_campus_livro);
printf(FONT_RED " Prioridade do pedido: %d \n" RESET, aux->pedido->prioridade);
printf(BOLD FONT_GREEN "-----------------------------\n" RESET);
imprimir(aux->next);}}


Expand Down
2 changes: 1 addition & 1 deletion fuctions_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ int add_esq_ou_dir = 0;
//fuctions

void quit(char *text){
while (getchar() != 'q'){printf("\n\nPressione: q, para %s: ", text);};}
while (getchar() != 'q'){printf(BOLD BACKGROUND_WHITE FONT_RED "\n\nPressione: q, para %s: " RESET, text);};}


Fifopre_node *verificar_senha(Fifopre_node *aux, char cargo){
Expand Down
Binary file modified principal
Binary file not shown.
25 changes: 4 additions & 21 deletions principal.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,16 @@

#endif

//definindo cores (ANSI)
#define RESET "\033[0;0m"
#define BOLD "\033[;1m"
//fonts
#define FONT_WHITE "\033[1;97m"
#define FONT_GRAY "\033[1;37m"
#define FONT_BLACK "\033[1;30m"
#define FONT_RED "\033[1;31m"
#define FONT_BLUE "\033[1;34m"
#define FONT_GREEN "\033[1;32m"
//backgrounds
#define BACKGROUND_WHITE "\033[1;107m"
#define BACKGROUND_GRAY "\033[1;47m"
#define BACKGROUND_BLACK "\033[1;40m"
#define BACKGROUND_RED "\033[1;41m"
#define BACKGROUND_BLUE "\033[1;44m"
#define BACKGROUND_GREEN "\033[1;42m"


int main(){
add_pre_cadastrados();

//create variables
int resp;

while (1){
system(clear);
printf(BOLD BACKGROUND_BLACK "\n<<< SISTEMA DE ENCOMENDA DE LIVRO >>>\n-------------------------------------\n");
printf(BOLD BACKGROUND_BLUE "\n<<< SISTEMA DE ENCOMENDA DE LIVRO >>>\n-------------------------------------\n");
printf(RESET BACKGROUND_WHITE FONT_BLUE " 1 - Encomendar um livro. \n" //sem pedir senha
" 2 - Remover uma encomenda de livro. \n" //secretario - pedir senha
" 3 - Remover um pedido de livro. \n" //transportadores - pedir senha
Expand All @@ -65,11 +49,10 @@ int main(){
system(clear);
if (fifop_start != NULL){imprimir(fifop_start);}
else {printf(BOLD BACKGROUND_WHITE FONT_RED "\nNão existe nenhum pedido cadastrado no momento.\n\n" RESET);}

quit("voltar"); break;

case 6:
system(clear); printf(BOLD BACKGROUND_BLACK "\n<<< Usuarios cadastrados >>>\n\n" RESET);
system(clear); printf(BOLD BACKGROUND_BLUE "\n<<< Usuarios cadastrados >>>\n\n" RESET);
fifopre_imprimir(fifopre_start);
quit("voltar"); break;

Expand Down
19 changes: 19 additions & 0 deletions structs.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
//definindo cores (ANSI)
#define RESET "\033[0;0m"
#define BOLD "\033[;1m"
//fonts
#define FONT_WHITE "\033[1;97m"
#define FONT_GRAY "\033[1;37m"
#define FONT_BLACK "\033[1;30m"
#define FONT_RED "\033[1;31m"
#define FONT_BLUE "\033[1;34m"
#define FONT_GREEN "\033[1;32m"
//backgrounds
#define BACKGROUND_WHITE "\033[1;107m"
#define BACKGROUND_GRAY "\033[1;47m"
#define BACKGROUND_BLACK "\033[1;40m"
#define BACKGROUND_RED "\033[1;41m"
#define BACKGROUND_BLUE "\033[1;44m"
#define BACKGROUND_GREEN "\033[1;42m"


typedef struct pedido { //struct do pedido
int id; //identificador
int prioridade; //de 0 à 100
Expand Down

0 comments on commit d95dca3

Please sign in to comment.