Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- * Vinícius Marquez Candelária Professora: Jussara
- DCC UFMG 2º Semestre 2009
- ------------------------------------------------------------------------------------------
- TAD FCFS */
- //includes
- #include <stdlib.h>
- #include <stdio.h>
- #include "FCFS.h"
- //funções
- void FFVazia(Fila *F)
- {
- F->Inicio = (Apontador) malloc(sizeof(Processo));
- F->Fim = F->Inicio;
- F->Inicio->Prox = NULL;
- }
- int Vazia(Fila F)
- {
- return (F.Inicio == F.Fim);
- }
- void IncluiProcesso(Processo *x,Fila *F)
- {
- F->Fim->Prox= x;
- F->Fim = F->Fim->Prox;
- }
- void RetiraProcesso(Fila *F)
- {
- Apontador aux;
- if (Vazia(*F))
- {
- printf("ERRO: A fila está vazia.\n");
- return;
- }
- aux = F->Inicio;
- F->Inicio = F->Inicio->Prox;
- free(aux);
- }
Add Comment
Please, Sign In to add comment