void check_assumption_list(void){ calllistptr tempin,in=assumption_list_gl; call2listptr marked_ptr; callnodeptr c; while(in){ tempin=in->next; marked_ptr=in->item2; c=marked_ptr->item; if(c->outcount>0){ delete_callnode(marked_ptr); SM_DeallocateStruct(smCall2List,marked_ptr); #ifdef INCR_DEBUG1 printf("in check assumption ");printcall(c);printf("\n"); #endif if(c->deleted) unmark(c); } SM_DeallocateStruct(smCallList, in); in=tempin; } assumption_list_gl=NULL; return; }
void mark_for_incr_abol(callnodeptr c){ calllistptr in=c->inedges; call2listptr markedlistptr; callnodeptr c1; #ifdef INCR_DEBUG1 printf("marking ");printcall(c);printf("\n"); #endif c->deleted=1; markedlistptr=insert_cdbllist(marked_list_gl,c); if(c->outcount) ecall3(&assumption_list_gl,markedlistptr); while(IsNonNULL(in)){ c1=in->inedge_node->callnode; c1->outcount--; if(c1->deleted==0){ mark_for_incr_abol(c1); } in=in->next; } return; }
/* KILLTASK -- Abort the currently executing task. Only call this when a task * is to be killed spontaneously, as from interrupt, not when it is just dying * due to a "bye" or eof. * Close all pipes and pseudofiles, being careful not to close any that * are real stdio files. * Note that our function is to kill an external task, not the process in which * it resides. The process is left running in the cache in case it is needed * again. */ void killtask ( register struct task *tp ) { char buf[128]; /* Print stack trace, with arguments. */ if (!(tp->t_ltp->lt_flags<_INVIS) && !(firstask->t_flags&T_BATCH) && !(strcmp (tp->t_ltp->lt_lname, "error") == 0)) printcall (currentask->t_stderr, tp); /* If task is running in a subprocess, interrupt it and read the ERROR * message. Not certain there isn't some case where this could cause * deadlock, but it does not seem so. Interrupts are disabled during * process startup. If task issues ERROR then it is popped before * we are called, without issuing the signal. */ if (tp->t_pid != -1) { fflush (tp->t_out); c_prsignal (tp->t_pid, X_INT); fgets (buf, 128, tp->t_in); } iofinish (tp); }
void delete_qso(void) { int x; struct stat statbuf; int lfile; char logline[100]; char call[15], bandmode[6]; mvprintw(13, 29, "OK to delete last qso (y/n)?"); x = key_get(); if ((x == 'y') || (x == 'Y')) { if ((lfile = open(logfile, O_RDWR)) < 0) { TLF_LOG_WARN("I can not find the logfile..."); } else { fstat(lfile, &statbuf); if (statbuf.st_size >= LOGLINELEN) { if (qtcdirection > 0) { // read band, mode and call from last QSO line lseek(lfile, ((int)statbuf.st_size - LOGLINELEN), SEEK_SET); IGNORE(read(lfile, logline, LOGLINELEN - 1));; g_strlcpy(bandmode, logline, 6); g_strlcpy(call, logline + 29, 15); g_strchomp(call); // delete QTC's for that combination of band, mode and call delete_last_qtcs(call, bandmode); } IGNORE(ftruncate(lfile, statbuf.st_size - LOGLINELEN)); } fsync(lfile); close(lfile); if (qsos[nr_qsos][0] != ';') { band_score[bandinx]--; qsonum--; qsonr_to_str(); } nr_qsos--; qsos[nr_qsos][0] = '\0'; } scroll_log(); } attron(COLOR_PAIR(C_LOG) | A_STANDOUT); mvprintw(13, 29, " "); printcall(); clear_display(); }
void unmark(callnodeptr c){ callnodeptr c1; calllistptr in=c->inedges; #ifdef INCR_DEBUG1 printf("unmarking ");printcall(c);printf("\n"); #endif c->deleted=0; while(IsNonNULL(in)){ c1=in->inedge_node->callnode; c1->outcount++; if(c1->deleted) unmark(c1); in=in->next; } return; }
int getwwv(void) { extern char lastwwv[]; extern char backgrnd_str[]; extern double r; extern int mycountrynr; extern int timeoffset; char printbuffer[81] = ""; char *i; char r_value[6]; char sf_value[6]; char timebuff[80]; double sfi, d; time_t now; struct tm *ptr1; attron(COLOR_PAIR(C_HEADER) | A_STANDOUT); mvprintw(24, 0, backgrnd_str); if (strlen(lastwwv) >= 2) { lastwwv[78] = '\0'; /* cut the bell chars */ if ((strncmp(lastwwv, "WCY", 3) == 0) || (strncmp(lastwwv, "WWV", 3) == 0)) { strcat(printbuffer, "Condx: "); i = strstr(lastwwv, "<"); if (i != NULL) { strncat(printbuffer, i + 1, 2); strcat(printbuffer, " GMT "); } i = strstr(lastwwv, "R="); if (i != NULL) { strncat(printbuffer, i, 5); r_value[0] = '\0'; strncat(r_value, i + 2, 3); r = atof(r_value); } strcat(printbuffer, " "); i = strstr(lastwwv, "SFI="); if (i != NULL) { strncat(printbuffer, i, 7); sf_value[0] = '\0'; strncat(sf_value, i + 4, 3); sfi = atof(sf_value); r = ((sfi - 70.0) * (200.0 / 180.0)); } i = strstr(lastwwv, "eru"); if (i != NULL) strcat(printbuffer, " eruptive "); i = strstr(lastwwv, "act"); if (i != NULL) strcat(printbuffer, " act "); i = strstr(lastwwv, "Au=au"); if (i != NULL) strcat(printbuffer, " AURORA!"); strcpy(lastwwv, printbuffer); mvprintw(24, 0, lastwwv); /* print WWV info */ d = dxcc_by_index(mycountrynr) -> timezone; // d -= timeoffset; now = (time(0) + ((timeoffset - d) * 3600)); ptr1 = gmtime(&now); strftime(timebuff, 80, "%H:%M", ptr1); printbuffer[0] = '\0'; mvprintw(24, 64, "local time %s", timebuff); } printcall(); } return (0); }
void time_update(void) { extern struct tm *time_ptr; extern char qsonrstr[]; extern int bandinx; extern int this_second; extern int system_secs; extern int miniterm; char time_buf[11]; int currentterm = 0; static int s = 0; static int m = 0; static int oldsecs = -1; /* trigger immediate update */ get_time(); this_second = time_ptr->tm_sec; /* seconds */ system_secs = time_ptr->tm_min * 60 + time_ptr->tm_sec; if (this_second != oldsecs) { /* do it every second */ oldsecs = this_second; if (wpx == 1) { if (minute_timer > 0) minute_timer--; } s = (s + 1) % 2; if (s > 0) { /* every 2 seconds */ strftime(time_buf, 10, "%H:%M:%S", time_ptr); time_buf[5] = '\0'; if ((time_buf[6] == '1') && (m >= 30)) { m = 0; getwwv(); } else { m++; } currentterm = miniterm; miniterm = 0; broadcast_lan(); update_line(time_buf); show_freq(); clusterinfo(); /* update cluster info (2 seconds) */ attron(COLOR_PAIR(C_LOG) | A_STANDOUT); mvprintw(7, 0, logline0); mvprintw(8, 0, logline1); mvprintw(9, 0, logline2); mvprintw(10, 0, logline3); mvprintw(11, 0, logline4); mvprintw(13, 0, " "); attron(COLOR_PAIR(C_WINDOW)); mvprintw(12, 23, qsonrstr); printcall(); showscore(); /* update score window every 2 seconds */ show_zones(bandinx); miniterm = currentterm; } } }
BOOLEAN bpact() { register BPINFO *p; BPINFO *prev, *next; BOOLEAN found; ADDRESS oldpc; delayed = NONE; found = FALSE; prev = NIL; for (p = bphead; p != NIL; p = next) { next = p->bpnext; if (p->bpaddr == pc) { prbpfound(p); found = TRUE; if (p->bpcond == NIL || isswitch(p->bptype) || cond(p->bpcond)) { prbphandled(); if (handlebp(p) == NOSAVE) { prbpnosave(); if (prev == NIL) { bphead = next; } else { prev->bpnext = next; } dispose(p); } else { prbpsave(); prev = p; } } else { prev = p; } } else { prev = p; } } if (delayed != NONE) { oldpc = pc; runtofirst(); if ((delayed&DELAY_CALL) == DELAY_CALL) { SYM *s, *t; s = curfunc; t = whatblock(return_addr()); if (t == NIL) { panic("can't find block for caller addr %d", caller_addr()); } printcall(s, t); addbp(return_addr(), RETURN, s, NIL, NIL, 0); } if (pc != oldpc) { bpact(); } if (isstopped) { printstatus(); } } else { if (isstopped) { printstatus(); } } fflush(stdout); return(found); }