@@ -485,51 +485,3 @@ int get_actions_nb_in_file(char* path_tofile){//weird memory allocation... ¿??
485485
486486 return actions_nb ;
487487}
488-
489-
490- /*
491- void get_nb_of_actions_in_actor(char* path, event_acum_per_action_* acum_per_action){
492- acum_per_action = malloc(sizeof(event_acum_per_action_));
493- acum_per_action->actions_nb = 0;
494- char* token;
495- char buf[1500];
496- FILE* ofile = fopen(path, "r");
497- int i, found = -1;
498- int result;
499-
500- fgets(buf,1500,ofile);
501- while(fgets(buf,1500,ofile)!=NULL){
502- token = strtok(buf,";");
503- token = strtok(NULL,";");//skip actor name
504- //printf("found action %s\n", token);
505- if(token!=NULL){
506- for(i=0; i<acum_per_action->actions_nb; i++){
507- //printf("comparing %s(%d) with %s(%d)\n", acum_per_action->action_name[i], strlen(acum_per_action->action_name[i]), token, strlen(token));
508- if((result = strncmp(acum_per_action->action_name[i],token,strlen(token))==0)){
509- //printf("action %s already exist\n", acum_per_action->action_name[i]);
510- found = i;
511- break;
512- }
513- }
514- if (found == -1){
515- printf("not found, adding action %s\n", token);
516- acum_per_action->action_name[acum_per_action->actions_nb] = malloc(strlen(token)+1);
517- strcpy(acum_per_action->action_name[acum_per_action->actions_nb],token);
518-
519- acum_per_action->actions_nb++;
520- }
521- else {
522- //already exists, sum acum on mark i
523- found = -1;
524- }
525- }
526- }
527- printf("struct test:\n");
528- printf("number of actions: %d\n", acum_per_action->actions_nb);
529- int j;
530- for(j = 0; j<=acum_per_action->actions_nb; j++){
531- printf("%s\n", acum_per_action->action_name[j]);
532- }
533-
534- fclose(ofile);
535- }*/
0 commit comments