@@ -318,22 +318,22 @@ void search_and_plot(char *path) {
318318
319319 while ((pDirent = readdir (pDir )) != NULL ) {
320320 if (is_papioutput (pDirent -> d_name )) {
321- printf ("going for %s\n" , pDirent -> d_name );
321+ // printf("going for %s\n", pDirent->d_name);
322322 path_to_csv = malloc (strlen (path )+ strlen (pDirent -> d_name )+ 2 );
323323 strcpy (path_to_csv , path );
324324 strcat (path_to_csv ,"/" );
325325 strcat (path_to_csv ,pDirent -> d_name );
326326 data = process_data (path , path_to_csv , pDirent -> d_name , path_to_totals );
327327 plot (path , data -> proc_file_path , data -> actor_name , data -> actions_nb , data -> actions [0 ]-> events_nb );
328328 html_actor (htmlfile , data );
329- // remove(data->proc_file_path);
329+ remove (data -> proc_file_path );
330330 free (data );
331331 }
332332 }
333333 plot_overall (path , path_to_totals , actors_nb , get_events_nb (path_to_totals )+ 1 );
334334
335335 html_close (htmlfile );
336- // remove(path_to_totals);
336+ remove (path_to_totals );
337337
338338 fclose (htmlfile );
339339 closedir (pDir );
@@ -366,9 +366,8 @@ event_acum_for_actor* process_data (char* path_todir, char* path_tofile, char* f
366366 actor -> actions_nb = actions_nb ;
367367 int i , j ;
368368
369- printf ("has %d actions\n" , actions_nb );
370369 for (i = 0 ;i < actions_nb * 3 ;i ++ ){
371- actor -> actions [i ] = malloc (sizeof (event_acum_for_action )* 2 + sizeof (event_acumulator )* events_nb * 3 );
370+ actor -> actions [i ] = malloc (sizeof (event_acum_for_action )* 2 + sizeof (event_acumulator )* events_nb * 3 );//weird memory is weird..
372371 actor -> actions [i ]-> events_nb = events_nb ;
373372 //actor->actions[i]->action_name
374373 for (j = 0 ;j < events_nb ;j ++ ){
@@ -412,38 +411,27 @@ event_acum_for_actor* process_data (char* path_todir, char* path_tofile, char* f
412411
413412 //acumuating structures
414413 int result ; //borrar
415- int temp = 0 ; //borrar
416414 while (fgets (buf ,1500 ,ofile )!= NULL ){
417415 token = strtok (buf ,";" );
418416 token = strtok (NULL ,";" );//read action name
419- printf ("%d\n" , ++ temp );
420417
421418 for (i = 0 ; i < actor -> actions_nb ; i ++ ){
422- printf ("continuing with %s (action %d)\n" , actor -> actions [i ]-> action_name , i );
423- printf (" beg cos found = %d, i = %d, actions_nb = %d\n" , found , i , actions_nb );
424419 if (actor -> actions [i ]-> action_name == NULL )
425420 break ;
426421 else {
427- printf ("comparing %s with %s\n" , actor -> actions [i ]-> action_name , token );
428- printf ("result = %d\n" ,strcmp (actor -> actions [i ]-> action_name ,token ));
429422 result = strcmp (actor -> actions [i ]-> action_name ,token );
430- printf ("ea, result was %d\n" , result );
431423 if (result == 0 ){
432- printf ("action %s already exists\n" , actor -> actions [i ]-> action_name );
433424 found = i ;
434425 break ;
435426 }
436427 else {
437- printf ("eaea\n" );
438- printf ("end? cos found = %d, i = %d, actions_nb = %d\n" , found , i , actions_nb );
439428 }
440429 }
441430 }
442431 if (found == -1 ){
443- printf ("not found, adding action %s\n" , token );
432+ // printf("not found, adding action %s\n", token);
444433 actor -> actions [found_actions ]-> action_name = malloc (strlen (token )+ 1 );
445434 strcpy (actor -> actions [found_actions ]-> action_name ,token );
446- printf ("%s added!\n" , actor -> actions [i ]-> action_name );
447435 }
448436
449437 current = (found == -1 )? found_actions ++ : found ;
0 commit comments