int main(int argc, char *argv[]) { char* issueid; struct json_object* issue; char* token = config_get_token(); char* repo = repo_get_repo(); if (token == NULL || repo == NULL) return 1; if (argc <= 1) { fprintf(stderr, "Usage: git detail <issue_id>\n"); return 1; } issueid = argv[1]; issue = github_get_issue(repo, issueid, token); if (issue) { print_issue(issue, token, repo); return 0; } return 1; }
void fetch() { printf("In Fetch\n"); printf("Issue Queue\n"); print_issue(issue_head); int fetch_count = fetch_size; while(fscanf(fp,"%lx %d %d %d %d",&(PC),&(instruction_type),&(destination),&(source_1),&(source_2))==5 && fetch_count!=0 && dispatch_list_counter!=2*fetch_size) { // fgetc(fp); ROB[counter].destination=destination; ROB[counter].type=instruction_type; ROB[counter].source_1=source_1; ROB[counter].source_2=source_2; ROB[counter].current_state=0; if(ROB[counter].type==0) ROB[counter].timer=1; else if(ROB[counter].type==1) ROB[counter].timer=2; else if(ROB[counter].type==2) ROB[counter].timer=5; ROB[counter].arrival_clock=clock; fetch_count--; dispatch_list_counter++; struct dispatch_list* newnode; struct dispatch_list* current; newnode=malloc(sizeof (struct dispatch_list)); if(newnode==NULL) return; newnode->tag=counter; newnode->next=NULL; if(dispatch_head==NULL) { dispatch_head=newnode; } else { current=dispatch_head; while (current->next!=NULL) { current=current->next; } current->next=newnode; } counter++; } printf("Out of Fetch\n"); }