@@ -183,8 +183,8 @@ void search_and_plot(char *path) {
183183 FILE * datafile = fopen (path_to_totals ,"w" );
184184 fclose (datafile );
185185
186- int actors_nb = get_nb_of_actors_in_dir (path );
187- event_acum_for_actor * data [ actors_nb ] ;
186+ // int actors_nb = get_nb_of_actors_in_dir(path);
187+ event_acum_for_actor * data ;
188188
189189 struct dirent * pDirent ;
190190 DIR * pDir ;
@@ -205,8 +205,10 @@ void search_and_plot(char *path) {
205205 strcat (path_to_csv ,"/" );
206206 strcat (path_to_csv ,pDirent -> d_name );
207207 //printf("plot of %s\n", pDirent->d_name);
208+ data = process_data (path , path_to_csv , pDirent -> d_name , path_to_totals );
208209 //plot(path_to_csv, pDirent->d_name);
209- data [i ] = process_data (path , path_to_csv , pDirent -> d_name , path_to_totals );
210+ //remove temp files
211+ //free
210212 //struct_test(data[i++]);
211213 }
212214 }
@@ -316,12 +318,13 @@ event_acum_for_actor* process_data (char* path_todir, char* path_tofile, char* f
316318
317319 fclose (ofile );
318320
321+ struct_test (actor );
319322
320323 //writing events per action
321324 FILE * datafile = fopen (path_todatafile ,"w" );
322325 fprintf (datafile ,"Action;" );
323326 for (i = 0 ;i < events_nb ;i ++ )
324- fprintf (datafile ,"%s;" ,actor -> actions [0 ]-> acumulator [0 ]-> event_name );
327+ fprintf (datafile ,"%s;" ,actor -> actions [0 ]-> acumulator [i ]-> event_name );
325328 fprintf (datafile ,"\n" );
326329
327330 for (i = 0 ; i < actions_nb ;i ++ ){
@@ -332,8 +335,8 @@ event_acum_for_actor* process_data (char* path_todir, char* path_tofile, char* f
332335 fprintf (datafile ,"\n" );
333336 }
334337 fclose (datafile );
335- //adding to totals per actor
336338
339+ //adding to totals per actor
337340 int label_set = 0 ;
338341 datafile = fopen (path_to_totals ,"r" );
339342 fgets (buf ,1500 ,datafile );
@@ -345,7 +348,7 @@ event_acum_for_actor* process_data (char* path_todir, char* path_tofile, char* f
345348 if (label_set == 0 ){
346349 fprintf (datafile ,"Actor;" );
347350 for (i = 0 ;i < events_nb ;i ++ )
348- fprintf (datafile ,"%s;" ,actor -> actions [0 ]-> acumulator [0 ]-> event_name );
351+ fprintf (datafile ,"%s;" ,actor -> actions [0 ]-> acumulator [i ]-> event_name );
349352 fprintf (datafile ,"\n" );
350353 }
351354
0 commit comments