Advertisement
Kimossab

ParqueToHist

Jun 28th, 2015
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.64 KB | None | 0 0
  1. void CarregarParqueToHistorico(ptGES gestor)
  2. {
  3.     if (!gestor || !gestor->Parque)//brb
  4.         return;
  5.    
  6.     NOLUG *L;
  7.     NOAFE *A;
  8.  
  9.     gestor->Historico = fopen("Historico.csv", "a");
  10.  
  11.     for(int i=0;i<MAX_FILAS_PARQUE; i++)
  12.     {
  13.         L=gestor->Parque->hash[i];
  14.         while(L)
  15.         {
  16.             if(L->info->sit != 0)
  17.             {
  18.                 A = gestor->Afetacao->ult;
  19.  
  20.                 while (A)
  21.                 {
  22.                     if (A->info->id_cam = C->info->id)
  23.                         break;
  24.                     A = A->ant;
  25.                 }
  26.                 fprintf(gestor->Historico, "%s;%s;%d;%s;%d;%d\n", __FUNCTION__, __DATE__, L->info->id_cam, L->info->cod, L->info->sit, SearchMot(gestor, A->info->id));
  27.             }
  28.             L=L->seg;
  29.         }
  30.     }
  31.  
  32.     fclose(gestor->Historico);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement