Menu_RouteListClose::Menu_RouteListClose(QWidget *parent) : NaviBaseWnd(parent) { ui.setupUi(this); connect(ui.btn_back,SIGNAL(clicked()),this,SLOT(slotback()),Qt::QueuedConnection); connect(ui.btn_map,SIGNAL(clicked()),this,SLOT(mapSlot()),Qt::QueuedConnection); connect(ui.lst_route,SIGNAL(itemClicked(QListWidgetItem*)),this,SLOT(itemSelectSlot(QListWidgetItem*)), Qt::QueuedConnection); updatelist(); }
void senddata(int new_fd, struct sockaddr_in clnt_addr, char *datafile) { FILE *infp; time_t now, start; struct tm starttime; char *data, ch; char *frame; int offset, dataLen, tOffset; int timeFlag; time(&start); memcpy(&starttime, gmtime(&start), sizeof(struct tm)); starttime.tm_sec = 0; starttime.tm_min = 0; starttime.tm_hour = 10; start = mktime(&starttime); infp = fopen(datafile , "r"); if (infp == NULL) { perror("Data File Open Failed"); exit(errno); } data = (char *)malloc(sizeof(char) * 512); frame = (char *)malloc(sizeof(char)*256); readdata(infp, data, 282); dataLen = compressData(data); memset(frame, 0, sizeof(frame)); frame[0] = 'D'; frame[1] = dataLen; memcpy(frame + 2, data, dataLen); if (send(new_fd, frame, 256, 0) == -1) { perror("send"); close(new_fd); exit(errno); } while (1) { updatelist(clnt_addr); sleep(2); time(&now); tOffset=(int)difftime(now,start); if(tOffset>9000) tOffset-=7200; offset = 246 * tOffset / 2 + 282 - ftell(infp); if (fseek(infp, offset, SEEK_CUR)) printf("fseek failed!\n"); timeFlag = 0; while (timeFlag != 2) { fread(&ch, sizeof(char), 1, infp); if (ch == ':') timeFlag++; } fseek(infp, -7, SEEK_CUR); readdata(infp, data, 246); dataLen = compressData(data); memset(frame, 0, sizeof(frame)); frame[0] = 'D'; frame[1] = dataLen; memcpy(frame + 2, data, dataLen); if (send(new_fd, frame, 256, 0) == -1) { perror("send"); close(new_fd); fclose(infp); exit(errno); } } }
void init() { if (detectproxyusers) updatelist(); inited = true; }
void dag(qcode_t *first, qcode_t *last){ qcode_t p = *first, ret = 0, q; nodelist nr; dnode node, x, y, z, cur_inst = 0, new_inst; ident_t nid; if(p->code == NOP){ q = p; ret = q; } while(p && p->code != RET && (p->code < JGT || p->code > JMP)){ if(p->code == MOV){ nr = findlist(p->op1); if(!nr){ node = createLeaf(p->op1); updatelist(p->op1, node); }else{ node = nr->addr; } updatelist(p->opr, node); } else if(p->code!= CMP && p->code!=FCMP && p->code >= ADD && p->code <=FNEG){ nr = findlist(p->op1); if(!nr){ node = createLeaf(p->op1); updatelist(p->op1, node); }else{ node = nr->addr; } x = node; y = 0; if(p->op2){ nr = findlist(p->op2); if(!nr){ node = createLeaf(p->op2); updatelist(p->op2, node); }else{ node = nr->addr; } y = node; } nr = dnodelist; while(nr){ z = nr->addr; if(z->op == p->code && z->x == x && z->y == y) break; nr = nr->next; } if(!nr){ z = createNode(DAG_OP, p->code, 0, x, y); }else{ z = nr->addr; } updatelist(p->opr, z); } else { if(p->op1){ nr = findlist(p->op1); if(!nr){ x = createLeaf(p->op1); updatelist(p->op1, x); }else{ x = nr->addr; } }else{ x = 0; } if(p->op2){ nr = findlist(p->op2); if(!nr){ y = createLeaf(p->op2); updatelist(p->op2, y); }else{ y = nr->addr; } }else{ y = 0; } new_inst = createNode(DAG_INST, p->code, cur_inst, x, y); cur_inst = new_inst; if(p->opr){ nid = createIdent(); nid->name = ccgenname(namenum++, '$'); nid->type = TEMP; nid->subtype = p->opr->subtype; nid->loc = LOC_LOCAL; insertTable(stab, nid); cur_inst->oprand = nid; cur_inst->vartype = nid->subtype; updatelist(p->opr, cur_inst); }else{ cur_inst->vartype = TVOID; } } p = p->next; } if(ret) ret->next = undag(); else ret = undag(); *first = ret; q = ret; while(q->next){ q = q->next; } if(p){ if(p->code == RET && p->opr){ nr = findlist(p->opr); p->opr = nr->addr->oprand; } *last = p; q->next = p; p->next = 0; }else{ *last = q; } deleteNodes(); clearnodelist(); }
static void varchanged() { if (!inited) return; if (detectproxyusers) updatelist(); }