diff --git a/include/graphics/newcrt.h b/include/graphics/newcrt.h index 43afffe20b629e811cb61c31922c97b9ef9c8de3..37e6c2adf0fb72d15a47d82bab909d3efefb5502 100644 --- a/include/graphics/newcrt.h +++ b/include/graphics/newcrt.h @@ -209,29 +209,13 @@ void nc_unInit (); void nc_init (); void nc_setDevice (long newDevice); -char *nc_fgets (char *s, int n, FILE *stream); -char *nc_gets (char *s); /* added for C99 clang compatibility */ -void nc_putc (uchar c, FILE * outfile); void nc_putchar (uchar c); void nc_puts (char * s); -void nc_fputs (char * s, FILE *outfile); - +char *nc_fgets (char *s, int n, FILE *stream); void nc_printf (char * fmt, ...); -void nc_fprintf (FILE * outfile, char * fmt, ...); - -#define printf nc_printf -#define fprintf nc_fprintf -#define puts nc_puts -#undef putchar -#define putchar nc_putchar -#undef putc -#define putc nc_putc -#define fputs nc_fputs -#define gets nc_gets -#define fgets nc_fgets #endif /*NEWCRT_H*/ diff --git a/src/ana/globals.c b/src/ana/globals.c index e08d0042bbbcab637f68d78b8d00c28f27b9e6e0..2e91b4fcdf740071a2d6d2bf4ad5139698267c71 100644 --- a/src/ana/globals.c +++ b/src/ana/globals.c @@ -342,9 +342,9 @@ double *Value; m_alpha_on(); m_graphics_on(); - printf("\f"); - printf("%s[% .5E]:", Varname, *Value); - gets(Name); + nc_printf("\f"); + nc_printf("%s[% .5E]:", Varname, *Value); + nc_fgets(Name, 256, stdin); TRY(try1); Newval = strtod(Name, &STR3); *Value = Newval; @@ -1095,7 +1095,7 @@ int AnaQuit() stepcount++; if (timers_sysclock() > AnaStoptime) { - /* printf("Count = %d\n", stepcount); */ + /* nc_printf("Count = %d\n", stepcount); */ stepcount = 0; return true; } else { diff --git a/src/ana/inter.c b/src/ana/inter.c index d60ef3a91c7ccd4ac2dfc06b340dac4f688844bc..e5c7851c2a6e21de44a78b66542de898ef7d2426 100644 --- a/src/ana/inter.c +++ b/src/ana/inter.c @@ -112,7 +112,7 @@ static void log_edit_32(log_action_t *act) putchar('\n'); do { printf("<modulename>_<Procname> : "); - gets(Response); + nc_fgets(Response, 256, stdin); } while (strlen(Response) < 1); strcpy(STR1, strltrim(Response)); strcpy(Response, STR1); diff --git a/src/ana/main.c b/src/ana/main.c index e6ebcf3e3a53aa87c9de6bae80f4d1c98f867794..96a2db3727c0a9c768484c62e073840405b33891 100644 --- a/src/ana/main.c +++ b/src/ana/main.c @@ -61,15 +61,15 @@ void Analog_Status() if (AnaLogglobals->actflag) { if (AnaInuse) { - printf("Analog Status Display\n\n"); /*4*/ + nc_printf("Analog Status Display\n\n"); /*4*/ /*5*/ - printf("Analog Circuit State :\n"); /*6*/ - printf("Simulation State Machine :\n"); /*7*/ - printf("State of Timestep :\n"); /*8*/ - printf("Present Timestep :\n"); /*9*/ - printf("Present Time :\n"); /*10*/ + nc_printf("Analog Circuit State :\n"); /*6*/ + nc_printf("Simulation State Machine :\n"); /*7*/ + nc_printf("State of Timestep :\n"); /*8*/ + nc_printf("Present Timestep :\n"); /*9*/ + nc_printf("Present Time :\n"); /*10*/ } else - printf("Analog simulator not presently active\n"); + nc_printf("Analog simulator not presently active\n"); AnaLogglobals->actflag = false; return; } @@ -80,83 +80,83 @@ void Analog_Status() case true: if (AnaReady) - printf("Aborting simulation "); + nc_printf("Aborting simulation "); else - printf("Preparing for new extraction "); + nc_printf("Preparing for new extraction "); break; case false: if (AnaReady) { if (AnaStart) - printf("Doing first simulation pass "); + nc_printf("Doing first simulation pass "); else - printf("Simulation in progress "); + nc_printf("Simulation in progress "); } else - printf("Circuit not ready to simulate"); + nc_printf("Circuit not ready to simulate"); break; } nc_gotoXY(29, 7); /*Row 7*/ if (!AnaReady || AnaChanged) - printf(" "); + nc_printf(" "); else { switch (AnaEpoch) { case AnaE_Evaluate: - printf("Computing Gates "); + nc_printf("Computing Gates "); break; case AnaE_Solve: - printf("Solving Matrix "); + nc_printf("Solving Matrix "); break; case AnaE_Calculate: - printf("Computing New Voltages "); + nc_printf("Computing New Voltages "); break; case AnaE_Refresh: - printf("Updating New Voltages "); + nc_printf("Updating New Voltages "); break; case AnaE_Adapt: - printf("Testing For Convergence "); + nc_printf("Testing For Convergence "); break; case AnaE_Memory1: - printf("Finished the timestep "); + nc_printf("Finished the timestep "); break; case AnaE_Memory2: - printf("Updating Capacitors "); + nc_printf("Updating Capacitors "); break; case AnaE_Update: - printf("Not finished the timestep"); + nc_printf("Not finished the timestep"); break; } } nc_gotoXY(29, 8); /*Row 8*/ if (!AnaReady || AnaChanged) - printf(" "); + nc_printf(" "); else { if (AnaError) - printf("Matrix insolvable - gearshifting"); + nc_printf("Matrix insolvable - gearshifting"); else { if (AnaOverflow) - printf("Solution heading to infinity - gearshifting"); + nc_printf("Solution heading to infinity - gearshifting"); else { if (AnaToobig && AnaSuccess) - printf("Solution reached with a big voltage change "); + nc_printf("Solution reached with a big voltage change "); else { if (AnaToobig && !AnaSuccess) - printf("Voltage change too big - gearshifting"); + nc_printf("Voltage change too big - gearshifting"); else { if (AnaSuccess) - printf("Finished the timestep "); + nc_printf("Finished the timestep "); else { if (AnaItercount > AnaItermax) - printf("Taking too long to converge - gearshifting"); + nc_printf("Taking too long to converge - gearshifting"); else - printf("Iteration number - %ld ", + nc_printf("Iteration number - %ld ", AnaItercount); } } @@ -166,17 +166,17 @@ void Analog_Status() } nc_gotoXY(29, 9); /*Row 8*/ if (!AnaReady || AnaChanged) - printf(" "); + nc_printf(" "); else { (*AnaLogglobals->hook.realunit)(AnaDt, 3, "s", Temp); - printf("%s ", Temp); + nc_printf("%s ", Temp); } nc_gotoXY(29, 10); /*Row 8*/ if (!AnaReady || AnaChanged) - printf(" "); + nc_printf(" "); else { (*AnaLogglobals->hook.realunit)(AnaAccum, 3, "s", Temp); - printf("%s ", Temp); + nc_printf("%s ", Temp); } } diff --git a/src/graphics/newci.c b/src/graphics/newci.c index b1384a9ffe98b0cde278c6410f987391edd087c1..33ae09f238d2f4347eb0909c741778a99b93d814 100644 --- a/src/graphics/newci.c +++ b/src/graphics/newci.c @@ -23,7 +23,7 @@ void newci_inputstring(char *s) char buf[1024]; char *cp; - fgets(buf, 1024, stdin); + nc_fgets(buf, 1024, stdin); if ((cp = (char *) strchr(buf, '\n'))) *cp = '\0'; if (*buf) diff --git a/src/graphics/newcrt.c b/src/graphics/newcrt.c index 4ff471ddc728e439c27c439392d1815b39ce91ff..d33f1215212787cad5a9158d6445b2e963429137 100644 --- a/src/graphics/newcrt.c +++ b/src/graphics/newcrt.c @@ -777,7 +777,7 @@ void nc_scrollUp() } if (nc_initialized) { - /* fprintf(stdout, "nc_scrollUp()\n"); + /* nc_printf("nc_scrollUp()\n"); getchar(); */ XCopyArea(m_display, nc_window, nc_window, nc_gc, nc_curWindow->gleft, nc_curWindow->gtop+nc_fontheight, @@ -807,7 +807,7 @@ void nc_clearXY(int x, int y, int dx, int dy) } if (nc_initialized) { - /* fprintf(stdout, "nc_clearXY(%d, %d, %d, %d)\n", x, y, dx, dy); + /* nc_printf("nc_clearXY(%d, %d, %d, %d)\n", x, y, dx, dy); getchar(); */ if ((dx > 0) && (dy > 0)) { @@ -910,31 +910,6 @@ void nc_printf(char * fmt, ...) nc_writeStr(XPOS, YPOS, printbuffer2); } -void nc_fprintf(FILE * outfile, char * fmt, ...) -{ - va_list args; - char fmt2[1024]; - char printbuffer[2000], printbuffer2[2000]; - char *p1, *p2; - - va_start(args, fmt); - - if (nc_text_in_window && ((outfile == stdout)/* || (outfile == stderr) */)) { - vsprintf(printbuffer, fmt, args); - va_end(args); - for (p1 = printbuffer, p2 = printbuffer2; *p1 != '\0'; p1++, p2++) - if ((*p2 = *p1) == '\n') - *(++p2) = '\015'; - *p2 = '\0'; - - nc_writeStr(XPOS, YPOS, printbuffer2); - } else { - fix_string((unsigned char *) fmt, (unsigned char *) fmt2); - vfprintf(outfile, fmt2, args); - va_end(args); - } -} - void nc_puts(char * s) { char str2[1024]; @@ -942,9 +917,7 @@ void nc_puts(char * s) /* fprintf(stderr, "nc_puts() called, cursor at (%d,%d)\n", XPOS, YPOS); */ if (! nc_text_in_window) { fix_string((unsigned char *) s, (unsigned char *) str2); -#undef puts puts(str2); -#define puts nc_puts return; } nc_writeStr(XPOS, YPOS, s); @@ -952,34 +925,13 @@ void nc_puts(char * s) /* fprintf(stderr, "nc_puts() exits, cursor at (%d,%d)\n", XPOS, YPOS); */ } -void nc_fputs(char * s, FILE *outfile) -{ - char printbuffer[2000]; - char *p; - char str2[1024]; - - if (nc_text_in_window && ((outfile == stdout) || (outfile == stderr))) { - for (p = printbuffer; *s != '\0'; s++, p++) - if ((*p = *s) == '\n') - *(++p) = '\015'; - *p = '\0'; - nc_writeStr(XPOS, YPOS, printbuffer); - } else { - fix_string((unsigned char *) s, (unsigned char *) str2); -#undef fputs - fputs(str2, outfile); -#define fputs nc_fputs - } -} - - void nc_putchar(uchar c) { char buffer[2]; if (! nc_text_in_window) { if (c <= 127) - nc_putc(c, stdout); + putchar(c); return; } /* fprintf(stderr, "nc_putchar() called, cursor at (%d,%d)\n", XPOS, YPOS); */ @@ -993,14 +945,6 @@ void nc_putchar(uchar c) /* fprintf(stderr, "nc_putchar() exits, cursor at (%d,%d)\n", XPOS, YPOS); */ } -void nc_putc(uchar c, FILE *outfile) -{ - if (nc_text_in_window && ((outfile == stdout) || (outfile == stderr))) - nc_putchar(c); - else if (c <= 127) - fputc(c, outfile); -} - void nc_togglecursor() { if (! nc_initialized) @@ -1032,45 +976,46 @@ void nc_cursor_off() nc_togglecursor(); } -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" // what the heck, :/ - -char *nc_gets(char *buf) +char *nc_fgets(char *s, int n, FILE *stream) { int pos; uchar c; - if (! nc_text_in_window) { -#undef gets - return(gets(buf)); -#define gets nc_gets - } - if (! nc_initialized) + if (!nc_text_in_window || stream != stdin) + return(fgets(s, n, stream)); + + if (!nc_initialized) nc_initialize(); + pos = 0; - for (;;) { + while(true) { /* fprintf(stderr, "Text cursor at (%d, %d)\n", XPOS, YPOS); */ c = m_inkey(); + // Backspace if (c == '\10') { if (pos > 0) { pos--; nc_writeStr(XPOS, YPOS, "\b \b"); } + // Super backspace } else if (c == 'U' - '@') { while (pos > 0) { pos--; nc_writeStr(XPOS, YPOS, "\b \b"); } + // Enter key, or this is the end } else if (c == '\15') { XPOS = 0; if (++YPOS >= nc_curWindow->height) { YPOS--; nc_scrollUp(); } - buf[pos] = '\0'; - return(buf); - } else if (c >= ' ' && c < 127) { - buf[pos++] = c; + s[pos] = '\0'; + return(s); + // alphanumeric character + // A boundary check have been added to avoid overflow the size of the buffer + } else if (c >= ' ' && c < 127 && pos < (n-1)) { + s[pos++] = c; nc_putChar(XPOS, YPOS, c); if (++XPOS == nc_curWindow->width) { XPOS = 0; @@ -1083,18 +1028,6 @@ char *nc_gets(char *buf) } } -#pragma clang diagnostic pop - -char *nc_fgets(char *s, int n, FILE *stream) -{ - if (nc_text_in_window && (stream == stdin)) - return(nc_gets(s)); - else -#undef fgets - return(fgets(s, n, stream)); -#define fgets nc_fgets -} - short nc_gType() { diff --git a/src/log.c b/src/log.c index 95364ffc80843b9563eda9dbcfcd66b8a04c8117..f3f889f4f5acb119f774c2b9b64c6f4963ad3efe 100644 --- a/src/log.c +++ b/src/log.c @@ -379,15 +379,15 @@ void report(int num, char *s) } clearshowalpha(); nk_gotoxy(0, txdown - 1); - printf("\215--> Internal error %d in %s\210\n", num, s); + nc_printf("\215--> Internal error %d in %s\210\n", num, s); if (gg.traceflag) fprintf(tracefile, "--> Internal error %d in %s\n", num, s); m_alpha_on(); - printf(" Press any key to continue."); + nc_printf(" Press any key to continue."); ch = nk_getkey(); if (ch == 'N' || ch == 'n') reportnowait = true; - putchar('\n'); + nc_putchar('\n'); } @@ -919,7 +919,7 @@ void pen() RECOVER(try3); if (P_escapecode == -20) _Escape(P_escapecode); - printf("Graphics tablet error\n"); + nc_printf("Graphics tablet error\n"); m_init_pen(tabletaddr); m_alpha_on(); ENDTRY(try3); @@ -1348,7 +1348,7 @@ void beginerror() /// Clean up after displaying an error message. void enderror() { - printf(" Press any key to continue."); + nc_printf(" Press any key to continue."); m_alpha_on(); waitforkey(); endbottom(); @@ -2138,9 +2138,9 @@ log_tool *findsimtype(uchar st) stp->hattr = NULL; beginerror(); if (rdy) - printf("Tool %d is not a simulator!\n", st); + nc_printf("Tool %d is not a simulator!\n", st); else - printf("No program loaded for gate-simulation type %d\n", st); + nc_printf("No program loaded for gate-simulation type %d\n", st); enderror(); } stp->keep = true; @@ -2159,20 +2159,20 @@ static void dumpconflicts() n = nodeconflictbase; g = gateconflictbase; - printf("\f"); + nc_printf("\f"); if (n != NULL || g != NULL) { - printf("Conflicts:\n"); + nc_printf("Conflicts:\n"); while (n != NULL) { - printf(" Conflict node %ld c=%c delay=%d oc=%c\n", + nc_printf(" Conflict node %ld c=%c delay=%d oc=%c\n", (long)n, n->conflict ? 'T' : 'F', 3 - n->conflict - n->conflict2 * 2, n->oconflict ? 'T' : 'F'); n = n->confnext; } while (g != NULL) { - printf(" Conflict gate %ld c=%c delay=%d oc=%c\n", + nc_printf(" Conflict gate %ld c=%c delay=%d oc=%c\n", (long)g, g->conflict ? 'T' : 'F', 3 - g->conflict - g->conflict2 * 2, g->oconflict ? 'T' : 'F'); g = g->confnext; @@ -2180,7 +2180,7 @@ static void dumpconflicts() } else { - printf("No conflicts registered.\n"); + nc_printf("No conflicts registered.\n"); } m_alpha_on(); } @@ -2367,7 +2367,7 @@ short getsignal(int d, char *n_) if (i > gg.maxsignal) { beginerror(); - printf("Only %d distinct signal names are allowed!\n", gg.maxsignal); + nc_printf("Only %d distinct signal names are allowed!\n", gg.maxsignal); enderror(); i = 0; } @@ -2515,7 +2515,7 @@ static void readlnpass(char *s, short mode) { hidecursor(); nk_gotoxy((int)x, (int)y); - printf("%s\t", strsub(STR1, s, xleft, (int)(txacross - x))); + nc_printf("%s\t", strsub(STR1, s, xleft, (int)(txacross - x))); hidecursor(); oxleft = xleft; redraw = false; @@ -2573,7 +2573,7 @@ static void readlnpass(char *s, short mode) { *s = '\0'; nk_gotoxy((int)x, (int)y); - putchar('\t'); + nc_putchar('\t'); } if (gg.t.dn) { @@ -2990,7 +2990,7 @@ static void doimmedfunction() } beginbottom(); m_alpha_on(); - printf("Do: "); + nc_printf("Do: "); readlnpass(cmd, 0); endbottom(); assertfunc(cmd); @@ -5020,7 +5020,7 @@ static void openhoriz() else { beginerror(); - printf("Can't Open: Blocked by vertical wires\n"); + nc_printf("Can't Open: Blocked by vertical wires\n"); enderror(); } } @@ -5186,7 +5186,7 @@ static void openvert() else { beginerror(); - printf("Can't Open: Blocked by horizontal wires\n"); + nc_printf("Can't Open: Blocked by horizontal wires\n"); enderror(); } } @@ -5423,7 +5423,7 @@ static void closehoriz() else { beginerror(); - printf("Can't Close: Blocked by vertical wires\n"); + nc_printf("Can't Close: Blocked by vertical wires\n"); enderror(); } } @@ -5663,7 +5663,7 @@ static void closevert() else { beginerror(); - printf("Can't Close: Blocked by horizontal wires\n"); + nc_printf("Can't Close: Blocked by horizontal wires\n"); enderror(); } } @@ -6013,7 +6013,7 @@ static short readlibrary_at(char *n_, short where, int loadit) if (flag) { beginerror(); - printf("Maximum of %d gate types are in use.\n", maxkinds); + nc_printf("Maximum of %d gate types are in use.\n", maxkinds); enderror(); i = 0; goto _L1; @@ -6389,8 +6389,8 @@ static short readlibrary_at(char *n_, short where, int loadit) if (P_escapecode != 0) { beginerror(); - printf("%d/%d/%ld: ", P_escapecode, i, EXCP_LINE); - printf("Unable to read file \"%s\"\n", gatesname[V.f - 1]); + nc_printf("%d/%d/%ld: ", P_escapecode, i, EXCP_LINE); + nc_printf("Unable to read file \"%s\"\n", gatesname[V.f - 1]); enderror(); } i = 0; @@ -6415,7 +6415,7 @@ _L1: if (found) return Result; beginerror(); - printf("Can't find gate \"%s\"\n", n); + nc_printf("Can't find gate \"%s\"\n", n); enderror(); Result = 0; if (!gg.initdone) @@ -6728,7 +6728,7 @@ static void gatedefinitioncommand() beginbottom(); m_alpha_on(); nk_gotoxy(0, txdown - 1); - printf("Select a gate to view its simulator definition."); + nc_printf("Select a gate to view its simulator definition."); do { pass(); @@ -6846,15 +6846,14 @@ static void listlibrary() do { clearshowalpha(); - printf("Listing of gates "); + nc_printf("Listing of gates "); if (librgroupnames[curlistgroup] != NULL && strlen(librgroupnames[curlistgroup]) <= txacross - 26) - fputs(strcjust(STR1, librgroupnames[curlistgroup], txacross - 26L), - stdout); + nc_puts(strcjust(STR1, librgroupnames[curlistgroup], txacross - 26L)); else - printf("%*c", txacross - 26, ' '); + nc_printf("%*c", txacross - 26, ' '); - printf("Group%2d\n", curlistgroup); + nc_printf("Group%2d\n", curlistgroup); FORLIM = V.maxi; for (i = 0; i <= FORLIM; i++) { @@ -6872,8 +6871,8 @@ static void listlibrary() V.karr[i][j - 1] = nn; nk_gotoxy(i * 10 + 2, j + 1); if (P_getbits_UB(loadedgates, nn - 1, 0, 3)) - putchar(chryellow); - printf("%s%c", index_[nn - 1], chrgreen); + nc_putchar(chryellow); + nc_printf("%s%c", index_[nn - 1], chrgreen); j++; if (j > V.maxj) { @@ -6884,7 +6883,7 @@ static void listlibrary() nn++; } while (i <= V.maxi && nn <= idxsize); nk_gotoxy(0, txdown); - printf("+ for next group, - for last group, space bar to quit."); + nc_printf("+ for next group, - for last group, space bar to quit."); do { k = kfunc(&i, &j, &V); @@ -6897,15 +6896,15 @@ static void listlibrary() if (lsp != NULL) { nk_gotoxy(0, txdown - 1); - printf("%.*s", txacross, lsp->str); + nc_printf("%.*s", txacross, lsp->str); } } nk_gotoxy(i * 10 + 2, j + 1); if (k < huge_) { if (P_getbits_UB(loadedgates, k - 1, 0, 3)) - putchar(chryellow); - printf("%c%s%c%c", chrinverse, index_[k - 1], chrgreen, chrplain); + nc_putchar(chryellow); + nc_printf("%c%s%c%c", chrinverse, index_[k - 1], chrgreen, chrplain); } } else @@ -6919,17 +6918,17 @@ static void listlibrary() case -2: nk_gotoxy(49, txdown); - printf("%cquit%c.", chrinverse, chrplain); + nc_printf("%cquit%c.", chrinverse, chrplain); break; case -3: nk_gotoxy(0, txdown); - printf("%c+%c", chrinverse, chrplain); + nc_printf("%c+%c", chrinverse, chrplain); break; case -4: nk_gotoxy(18, txdown); - printf("%c-%c", chrinverse, chrplain); + nc_printf("%c-%c", chrinverse, chrplain); break; } } @@ -6953,12 +6952,12 @@ static void listlibrary() if (lsp != NULL) { nk_gotoxy(0, txdown - 1); - putchar('\t'); + nc_putchar('\t'); } nk_gotoxy(i * 10 + 2, j + 1); if (P_getbits_UB(loadedgates, k - 1, 0, 3)) - putchar(chryellow); - printf("%s%c", index_[k - 1], chrgreen); + nc_putchar(chryellow); + nc_printf("%s%c", index_[k - 1], chrgreen); } } else @@ -6972,17 +6971,17 @@ static void listlibrary() case -2: nk_gotoxy(49, txdown); - printf("quit."); + nc_printf("quit."); break; case -3: nk_gotoxy(0, txdown); - putchar('+'); + nc_putchar('+'); break; case -4: nk_gotoxy(18, txdown); - putchar('-'); + nc_putchar('-'); break; } } @@ -7003,7 +7002,7 @@ static void listlibrary() { remcursor(); nk_gotoxy(i * 10 + 2, j + 1); - printf("%c%s%c", chryellow, index_[k - 1], chrgreen); + nc_printf("%c%s%c", chryellow, index_[k - 1], chrgreen); } } else @@ -7243,7 +7242,7 @@ void setvlsimode(int flag) if (flag) { beginerror(); - printf("VLSI mode not supported in version %s\n", log_version); + nc_printf("VLSI mode not supported in version %s\n", log_version); enderror(); flag = false; } @@ -7429,7 +7428,7 @@ static void eraselabelline(long i, struct LOC_editattrs *LINK) { remcursor(); nk_gotoxy(0, (int)i); - putchar('\t'); + nc_putchar('\t'); } static void drawlabel(struct LOC_editattrs *LINK) @@ -7456,7 +7455,7 @@ static void drawvalue(short i, int highlight, struct LOC_editattrs *LINK) remcursor(); nk_gotoxy(WITH->x, WITH->y - LINK->ybase); if (highlight) - putchar(129); + nc_putchar(129); /* Note: WRITE statement contains color/attribute characters [203] */ if (!LINK->gattr[i - 1].blnk) { @@ -7464,51 +7463,50 @@ static void drawvalue(short i, int highlight, struct LOC_editattrs *LINK) { case 'R': - fputs(realstr(STR1, LINK->gattr[i - 1].UU.r, WITH->prec), stdout); + nc_puts(realstr(STR1, LINK->gattr[i - 1].UU.r, WITH->prec)); break; case 'U': - fputs(realunit(STR1, LINK->gattr[i - 1].UU.r, WITH->prec, - WITH->UU.U82.u, false), stdout); + nc_puts(realunit(STR1, LINK->gattr[i - 1].UU.r, WITH->prec, + WITH->UU.U82.u, false)); break; case 'F': - printf("%s%s", + nc_printf("%s%s", realstr(STR1, LINK->gattr[i - 1].UU.r, WITH->prec), WITH->UU.U82.u); break; case 'I': - printf("%*ld", WITH->prec, LINK->gattr[i - 1].UU.U73.i1); + nc_printf("%*ld", WITH->prec, LINK->gattr[i - 1].UU.U73.i1); break; case 'H': - fputs(strhex(STR4, LINK->gattr[i - 1].UU.U73.i1, (long)WITH->prec), - stdout); + nc_puts(strhex(STR4, LINK->gattr[i - 1].UU.U73.i1, (long)WITH->prec)); break; case 'C': - printf("%.*s", txacross - WITH->x + 1, LINK->gattr[i - 1].UU.c); + nc_printf("%.*s", txacross - WITH->x + 1, LINK->gattr[i - 1].UU.c); break; case 'A': - printf("%.*s", txacross - WITH->x + 1, LINK->gattr[i - 1].UU.sp); + nc_printf("%.*s", txacross - WITH->x + 1, LINK->gattr[i - 1].UU.sp); break; case 'B': if (WITH->prec == 1) { if (LINK->gattr[i - 1].UU.b) - printf("Yes"); + nc_printf("Yes"); else - printf("No"); + nc_printf("No"); } else { if (LINK->gattr[i - 1].UU.b) - printf("True"); + nc_printf("True"); else - printf("False"); + nc_printf("False"); } break; @@ -7517,17 +7515,17 @@ static void drawvalue(short i, int highlight, struct LOC_editattrs *LINK) while (l1 != NULL && (long)l1->value != LINK->gattr[i - 1].UU.nv) l1 = l1->next; if (l1 != NULL) - fputs(l1->s, stdout); + nc_puts(l1->s); else - printf("(value not found)"); + nc_printf("(value not found)"); break; } } if (WITH->x == XPOS) - putchar(' '); + nc_putchar(' '); LINK->gattr[i - 1].x2 = XPOS - 1; /*from CRT*/ /*prob. no longer used*/ - printf("\t\200"); + nc_printf("\t\200"); LINK->gattr[i - 1].changed = false; } @@ -8030,7 +8028,7 @@ end; */ if (!understood) { nk_gotoxy(V.kattr[V.p - 1].x, V.kattr[V.p - 1].y - V.ybase); - putchar('\t'); + nc_putchar('\t'); if (ch == '\015') ungetkey2('\003'); @@ -9510,7 +9508,7 @@ static void doshellescape(char *arg) if (i != -20) { beginerror(); - puts(_ShowEscape(STR1, i, j, "During shell escape")); + nc_puts(_ShowEscape(STR1, i, j, "During shell escape")); enderror(); } ENDTRY(try22); @@ -9527,25 +9525,25 @@ static void dumphistory() m_alpha_on(); hn = gg.hnbase; i = 0; - printf("Time "); + nc_printf("Time "); while (hn != NULL) { - printf("%s%*c", gg.signaltab[hn->sig - 1].name, (int)(15 - strlen(gg.signaltab[hn->sig - 1].name)), ' '); + nc_printf("%s%*c", gg.signaltab[hn->sig - 1].name, (int)(15 - strlen(gg.signaltab[hn->sig - 1].name)), ' '); hn = hn->next; i++; } - putchar('\n'); + nc_putchar('\n'); ht = gg.htbase; while (ht != NULL) { - printf("% .5E ", ht->time); + nc_printf("% .5E ", ht->time); FORLIM = hncount; for (i = 0; i < FORLIM; i++) - printf("%12.6f ", na_srtor(ht->val[i])); - putchar('\n'); + nc_printf("%12.6f ", na_srtor(ht->val[i])); + nc_putchar('\n'); ht = ht->next; } - printf("Press any key to continue.\n"); + nc_printf("Press any key to continue.\n"); waitforkey(); gg.showpage = 0; } @@ -10211,11 +10209,11 @@ static void dumpcmd(struct LOC_historycommand *LINK) drawstr2((int)dumppos, LINK->vmenu1, "Dump"); beginbottom(); m_alpha_on(); - printf("Dump file name"); + nc_printf("Dump file name"); if (*dumpfname != '\0') - printf(" [%s]", dumpfname); - printf(": "); + nc_printf(" [%s]", dumpfname); + nc_printf(": "); readlnpass(fn, 0); endbottom(); beginbottom(); @@ -10224,7 +10222,7 @@ static void dumpcmd(struct LOC_historycommand *LINK) if (*fn != '\0') setdumpname(fn); else - printf("Dump file is %s\n", dumpfname); + nc_printf("Dump file is %s\n", dumpfname); if (*dumpfname != '\0') { TRY(try23); @@ -10288,8 +10286,8 @@ static void dumpcmd(struct LOC_historycommand *LINK) j = P_escapecode; beginerror(); if (Debugging || debugprint) - printf("%ld/%d/%ld ", j, i, EXCP_LINE); - printf("Unable to write dump file \"%s\"\n", dumpfname); + nc_printf("%ld/%d/%ld ", j, i, EXCP_LINE); + nc_printf("Unable to write dump file \"%s\"\n", dumpfname); enderror(); ENDTRY(try23); } @@ -10349,7 +10347,7 @@ static void getexpr(struct LOC_historycommand *LINK) return; beginbottom(); m_alpha_on(); - printf("Expression to plot: "); + nc_printf("Expression to plot: "); readlnpass(expr, 0); endbottom(); strcompress(expr, " ", true); @@ -11118,7 +11116,7 @@ static void savecommand() else if (!strcmp(gg.funcarg, "*")) { beginbottom(); - printf("File name to save: "); + nc_printf("File name to save: "); if (curfilename[gg.curpage - 1] != NULL) strcpy(filename, curfilename[gg.curpage - 1]); else @@ -11143,10 +11141,10 @@ static void namecommand() if (*gg.funcarg == '\0') { beginbottom(); - printf("File name for page %ld", gg.curpage); + nc_printf("File name for page %ld", gg.curpage); if (curfilename[gg.curpage - 1] != NULL) - printf(" [%s]", curfilename[gg.curpage - 1]); - printf(": "); + nc_printf(" [%s]", curfilename[gg.curpage - 1]); + nc_printf(": "); readlnpass(filename, 0); endbottom(); } else if (!strcmp(gg.funcarg, "?")) @@ -11194,7 +11192,7 @@ static void loadcommand() if (!strcmp(gg.funcarg, "*")) { beginbottom(); - printf("Name of file to load: "); + nc_printf("Name of file to load: "); readlnpass(filename, 0); endbottom(); } @@ -11202,9 +11200,9 @@ static void loadcommand() { clearshowalpha(); nk_gotoxy(5, txdown - 1); - printf("Press ENTER alone to abort command.\n"); + nc_printf("Press ENTER alone to abort command.\n"); nk_gotoxy(2, txdown - 2); - printf("Name of file to load: "); + nc_printf("Name of file to load: "); *filename = '\0'; ch = '\015'; do @@ -11220,7 +11218,7 @@ static void loadcommand() else { nk_gotoxy(x * 15 + 2, y + 2); - printf("%c%s%c", chrinverse, dirs[x][y], chrplain); + nc_printf("%c%s%c", chrinverse, dirs[x][y], chrplain); } if (gg.t.near_ && gg.t.inalpha) @@ -11247,7 +11245,7 @@ if gg.t.y < 46 then y1 := 0; */ if (x != -1) { nk_gotoxy(x * 15 + 2, y + 2); - fputs(dirs[x][y], stdout); + nc_puts(dirs[x][y]); } } while (!(pollkbd2() || gg.t.dn)); @@ -11255,7 +11253,7 @@ if gg.t.y < 46 then y1 := 0; */ { strcpy(filename, dirs[x][y]); nk_gotoxy(24, txdown - 2); - printf("%s\t", filename); + nc_printf("%s\t", filename); } if (gg.t.dn) @@ -11266,13 +11264,13 @@ if gg.t.y < 46 then y1 := 0; */ if (ch == '\007' && *filename != '\0') { nk_gotoxy((int)(strlen(filename) + 23), txdown - 2); - putchar(' '); + nc_putchar(' '); filename[strlen(filename) - 1] = '\0'; } else if (ch >= ' ' && ch <= '~' && strlen(filename) < 255) { nk_gotoxy((int)(strlen(filename) + 24), txdown - 2); - putchar(ch); + nc_putchar(ch); strcat(filename, " "); filename[strlen(filename) - 1] = ch; } @@ -11306,7 +11304,7 @@ if gg.t.y < 46 then y1 := 0; */ { beginbottom(); TRY(try27); - printf("Loading file %s\n", filename); + nc_printf("Loading file %s\n", filename); m_alpha_on(); loadpage(filename, name); endbottom(); @@ -11316,15 +11314,15 @@ if gg.t.y < 46 then y1 := 0; */ endbottom(); beginerror(); if (Debugging || debugprint || gg.traceflag) - printf("%d/%d/%ld ", i, j, EXCP_LINE); + nc_printf("%d/%d/%ld ", i, j, EXCP_LINE); if (i == -10 && (unsigned)j < 32 && ((1L << j) & 0x600) != 0) - printf("Can't find file \"%s\"\n", filename); + nc_printf("Can't find file \"%s\"\n", filename); else if (i == -20) - printf("STOP key pressed while loading file.\n"); + nc_printf("STOP key pressed while loading file.\n"); else if (i > 0) - printf("Format error in file \"%s\" (%s)\n", filename, name); + nc_printf("Format error in file \"%s\" (%s)\n", filename, name); else - printf("Unable to load file \"%s\"\n", filename); + nc_printf("Unable to load file \"%s\"\n", filename); enderror(); ENDTRY(try27); } @@ -11344,7 +11342,7 @@ static void readcommand() if (*gg.funcarg == '\0' || !strcmp(gg.funcarg, "*")) { beginbottom(); - printf("Name of file to read: "); + nc_printf("Name of file to read: "); readlnpass(filename, 0); endbottom(); } @@ -11356,7 +11354,7 @@ static void readcommand() if (*filename != '\0') { beginbottom(); - printf("Reading file %s\n", filename); + nc_printf("Reading file %s\n", filename); deleverything(); garbagecoll(); TRY(try28); @@ -11369,16 +11367,16 @@ static void readcommand() endbottom(); beginerror(); if (Debugging || debugprint || gg.traceflag) - printf("%ld/%ld/%ld ", i, j, EXCP_LINE); + nc_printf("%ld/%ld/%ld ", i, j, EXCP_LINE); if (i == -10 && (unsigned long)j < 32 && ((1L << j) & 0x600) != 0) - printf("Can't find file \"%s\"\n", filename); + nc_printf("Can't find file \"%s\"\n", filename); else if (i == -20) - printf("STOP key pressed while reading file.\n"); + nc_printf("STOP key pressed while reading file.\n"); else if (i > 0) - printf("Format error in file \"%s\" (%s)\n", filename, reason); + nc_printf("Format error in file \"%s\" (%s)\n", filename, reason); else - printf("Unable to read file \"%s\"\n", filename); + nc_printf("Unable to read file \"%s\"\n", filename); enderror(); ENDTRY(try28); } @@ -11444,10 +11442,10 @@ static void describe(long i, struct LOC_toolcommand *LINK) remcursor(); nk_gotoxy(4, (int)i); if (LINK->ta[i]->ready) - putchar(chryellow); - printf("%16s ", LINK->ta[i]->name); - fputs(LINK->ta[i]->comment, stdout); - printf("%c\n", chrgreen); + nc_putchar(chryellow); + nc_printf("%16s ", LINK->ta[i]->name); + nc_puts(LINK->ta[i]->comment); + nc_printf("%c\n", chrgreen); } static long which(struct LOC_toolcommand *LINK) @@ -11506,7 +11504,7 @@ static void toolcommand() tp = tp->next; } clearshowalpha(); - printf("LOG tools available:\n"); + nc_printf("LOG tools available:\n"); for (i = 0; i <= maxtools; i++) describe(i, &V); exitflag = false; @@ -11518,9 +11516,9 @@ static void toolcommand() j = which(&V); if (j >= 0) { - putchar(chrinverse); + nc_putchar(chrinverse); describe(j, &V); - putchar(chrplain); + nc_putchar(chrplain); } if (gg.t.near_ && gg.t.inalpha) @@ -11629,23 +11627,23 @@ static void status_log() if (gg.actflag) { sysdate(&date); - printf(" Date %2d-%s-%02d Time\n", + nc_printf(" Date %2d-%s-%02d Time\n", date.day, months[date.month - 1], date.year); - printf(" Available memory: \n\n"); - printf(" Simulation time: \n"); - printf(" Simulation timestep:\n"); - printf(" Simulation status: \n\n\n"); - printf(" Invisible mode %s", onoff(STR2, gg.invisible)); - printf(" Invisible labels %s", onoff(STR2, gg.textinvisible)); - printf(" Glow mode %s\n", onoff(STR2, gg.glowmode)); - printf(" Simulation %s", onoff(STR2, gg.pwrflag)); - printf(" Snap-to-grid %s", onoff(STR2, snapflag)); - printf(" Markers %s\n", onoff(STR2, gg.markers)); - printf(" Quiet mode %s", onoff(STR2, gg.quiet)); - printf(" Verbose mode %s", onoff(STR2, gg.verbose)); - printf(" Trace mode %s\n", onoff(STR2, gg.traceflag)); + nc_printf(" Available memory: \n\n"); + nc_printf(" Simulation time: \n"); + nc_printf(" Simulation timestep:\n"); + nc_printf(" Simulation status: \n\n\n"); + nc_printf(" Invisible mode %s", onoff(STR2, gg.invisible)); + nc_printf(" Invisible labels %s", onoff(STR2, gg.textinvisible)); + nc_printf(" Glow mode %s\n", onoff(STR2, gg.glowmode)); + nc_printf(" Simulation %s", onoff(STR2, gg.pwrflag)); + nc_printf(" Snap-to-grid %s", onoff(STR2, snapflag)); + nc_printf(" Markers %s\n", onoff(STR2, gg.markers)); + nc_printf(" Quiet mode %s", onoff(STR2, gg.quiet)); + nc_printf(" Verbose mode %s", onoff(STR2, gg.verbose)); + nc_printf(" Trace mode %s\n", onoff(STR2, gg.traceflag)); nk_gotoxy(0, txdown - 3); - printf("Use the arrow keys to view status pages. Press the space bar to quit.\n"); + nc_printf("Use the arrow keys to view status pages. Press the space bar to quit.\n"); status_oldtime = -1.0; status_oldtstep = -1.0; status_oldmem = -1; @@ -11655,21 +11653,21 @@ static void status_log() { nk_gotoxy(25, 4); systime(&time); - printf("%2d:%02d:%02ld", time.hour, time.minute, time.centisecond / 100L); + nc_printf("%2d:%02d:%02ld", time.hour, time.minute, time.centisecond / 100L); gg.actx = timers_sysclock(); } if (gg.time != status_oldtime) { nk_gotoxy(23, 7); - printf("%s\t", realunit(STR3, gg.time, 4, "sec", false)); + nc_printf("%s\t", realunit(STR3, gg.time, 4, "sec", false)); status_oldtime = gg.time; } if (gg.prevtimestep != status_oldtstep) { nk_gotoxy(23, 8); - printf("%s\t", realunit(STR3, gg.prevtimestep, 4, "sec", false)); + nc_printf("%s\t", realunit(STR3, gg.prevtimestep, 4, "sec", false)); status_oldtstep = gg.prevtimestep; } @@ -11681,22 +11679,22 @@ static void status_log() { case simst_off: - printf("Off\t"); + nc_printf("Off\t"); break; case simst_notactive: - printf("Not active\t"); + nc_printf("Not active\t"); break; case simst_notready: - printf("Halted (%s)\t", gg.simstatetool->shortname); + nc_printf("Halted (%s)\t", gg.simstatetool->shortname); break; case simst_running: if (gg.simstatetool == NULL) - printf("Running (scope-mode interpolation)\t"); + nc_printf("Running (scope-mode interpolation)\t"); else - printf("Running (%s)\t", gg.simstatetool->shortname); + nc_printf("Running (%s)\t", gg.simstatetool->shortname); break; default: @@ -11719,12 +11717,12 @@ static void status_mem() if (!gg.actflag) return; - printf(" gates wires labels boxes changed filename\n"); + nc_printf(" gates wires labels boxes changed filename\n"); for (i = 0; i <= 8; i++) { if (i + 1 == gg.curpage) - putchar(chryellow); - printf("Page %ld -- ", i + 1); + nc_putchar(chryellow); + nc_printf("Page %ld -- ", i + 1); if (i + 1 <= gg.numpages) { g = gg.pages[i]->gbase; @@ -11734,7 +11732,7 @@ static void status_mem() j++; g = g->next; } - printf("%4ld", j); + nc_printf("%4ld", j); hw = gg.pages[i]->hwbase; j = 0; while (hw != NULL) @@ -11748,7 +11746,7 @@ static void status_mem() j++; vw = vw->next; } - printf("%7ld", j); + nc_printf("%7ld", j); l = gg.pages[i]->lbase; j = 0; while (l != NULL) @@ -11756,7 +11754,7 @@ static void status_mem() j++; l = l->next; } - printf("%7ld", j); + nc_printf("%7ld", j); b = gg.pages[i]->bbase; j = 0; while (b != NULL) @@ -11764,23 +11762,23 @@ static void status_mem() j++; b = b->next; } - printf("%7ld ", j); + nc_printf("%7ld ", j); if (isPageChanged(gg.pages[i])) - printf("Yes "); + nc_printf("Yes "); else - printf("No "); + nc_printf("No "); if (curfilename[i] != NULL) - fputs(curfilename[i], stdout); + nc_puts(curfilename[i]); } else { - printf("Empty."); + nc_printf("Empty."); } - printf("%c\n", chrgreen); + nc_printf("%c\n", chrgreen); } - printf("\nPaste -- "); + nc_printf("\nPaste -- "); if (copybuf.valid) { g = copybuf.gcopy; @@ -11790,7 +11788,7 @@ static void status_mem() j++; g = g->next; } - printf("%4ld", j); + nc_printf("%4ld", j); hw = copybuf.hwcopy; j = 0; while (hw != NULL) @@ -11804,7 +11802,7 @@ static void status_mem() j++; vw = vw->next; } - printf("%7ld", j); + nc_printf("%7ld", j); l = copybuf.lcopy; j = 0; while (l != NULL) @@ -11812,7 +11810,7 @@ static void status_mem() j++; l = l->next; } - printf("%7ld", j); + nc_printf("%7ld", j); b = copybuf.bcopy; j = 0; while (b != NULL) @@ -11820,13 +11818,13 @@ static void status_mem() j++; b = b->next; } - printf("%7ld\n", j); + nc_printf("%7ld\n", j); } else { - printf("Empty.\n"); + nc_printf("Empty.\n"); } - putchar('\n'); + nc_putchar('\n'); n = gg.nbase; j = 0; while (n != NULL) @@ -11834,7 +11832,7 @@ static void status_mem() j++; n = n->next; } - printf("Total nodes: %12ld\n", j); + nc_printf("Total nodes: %12ld\n", j); j = 0; FORLIM = gg.lastsignal; for (i = 0; i < FORLIM; i++) @@ -11842,7 +11840,7 @@ static void status_mem() if (gg.signaltab[i].np != NULL) j++; } - printf("Total signal names: %12ld\n", j); + nc_printf("Total signal names: %12ld\n", j); } static void status_macro(int v) @@ -11890,20 +11888,20 @@ static void status_macro(int v) nk_gotoxy((int)i, (int)j); ch = mp->key; if (ch == '\007') - printf("bs "); + nc_printf("bs "); else if (ch == '\t') - printf("tab"); + nc_printf("tab"); else if (ch == '\015') - printf("cr "); + nc_printf("cr "); else if (ch == ' ') - printf("sp "); + nc_printf("sp "); else if ((ch & 255) >= 168 && (ch & 255) <= 193) - printf("^%c ", (char)((uchar)ch - 'g')); + nc_printf("^%c ", (char)((uchar)ch - 'g')); else if (ch <= '\037' || (ch & (~127)) != 0) - printf("%3d", ch); + nc_printf("%3d", ch); else - printf("%c ", ch); - printf(" %s", mp->name); + nc_printf("%c ", ch); + nc_printf(" %s", mp->name); mp = mp->next; } j++; @@ -11920,7 +11918,7 @@ static void status_macro(int v) for (k=0; mp != NULL; k++, mp = mp->next) ; nk_gotoxy((int)2, (int)txdown); - printf("[%d of %d]",((n+1)/(n_displayed/2))+1,(n_macros/n_displayed)+1); + nc_printf("[%d of %d]",((n+1)/(n_displayed/2))+1,(n_macros/n_displayed)+1); } @@ -11971,29 +11969,29 @@ static void statusdisplay(char *name_) do { clearshowalpha(); - printf(" LOG V%s Status Display\n\n", + nc_printf(" LOG V%s Status Display\n\n", log_version); - printf("Status: "); + nc_printf("Status: "); switch (which) { case -2: - printf("LOG"); + nc_printf("LOG"); break; case -1: - printf("Memory"); + nc_printf("Memory"); break; case 0: - printf("Keyboard assignments"); + nc_printf("Keyboard assignments"); break; default: tp = counttool((long)which); - fputs(tp->name, stdout); + nc_puts(tp->name); if (*tp->comment != '\0') - printf(" (%s)", tp->comment); + nc_printf(" (%s)", tp->comment); break; } savex = 0; @@ -12026,9 +12024,9 @@ static void statusdisplay(char *name_) calltool(tp, act_status); if (gg.actflag) { if (tp->ready) - printf(" (No status for this tool)\n"); + nc_printf(" (No status for this tool)\n"); else - printf(" (Not yet activated)\n"); + nc_printf(" (Not yet activated)\n"); } break; } @@ -12588,7 +12586,7 @@ static void docnffunction() else if (gg.initdone) { beginerror(); - printf("No such color as \"%s\"\n", gg.funcarg); + nc_printf("No such color as \"%s\"\n", gg.funcarg); enderror(); } if (gg.initdone) @@ -12987,22 +12985,22 @@ static void dofunction() goto _Ltry30; } clearshowalpha(); - putchar('\n'); + nc_putchar('\n'); if (anychanged()) { - printf("The following page(s) have not been saved: "); + nc_printf("The following page(s) have not been saved: "); FORLIM = gg.numpages; for (i = 1; i <= FORLIM; i++) { if (isPageChanged(gg.pages[i - 1])) - printf("%d ", i); + nc_printf("%d ", i); } - putchar('\n'); + nc_putchar('\n'); } m_alpha_on(); m_graphics_off(); nk_gotoxy(31, 10); - printf("%c%cExit from program? %c", chryellow, chrplain, chrgreen); + nc_printf("%c%cExit from program? %c", chryellow, chrplain, chrgreen); do TEMP = nk_getkey(); while ((TEMP == 250)||(TEMP == 251)); @@ -13288,12 +13286,12 @@ static void beginfatal(struct LOC_initialize *LINK) if (P_escapecode == -20) _Escape(P_escapecode); clearshowalpha(); - printf("\n\n%c", chryellow); + nc_printf("\n\n%c", chryellow); } static void endfatal(struct LOC_initialize *LINK) { - printf("%c Program aborted.\n", chrgreen); + nc_printf("%c Program aborted.\n", chrgreen); _Escape(0); } @@ -13645,7 +13643,7 @@ static void readcnf(char *fn_, struct LOC_initialize *LINK) if (P_escapecode != 0) { beginfatal(LINK); - printf("Error in line %ld of configuration file \"%s\"\n", cnflin, fn); + nc_printf("Error in line %ld of configuration file \"%s\"\n", cnflin, fn); endfatal(LINK); } ENDTRY(try33); @@ -13701,8 +13699,8 @@ static void initialize() if (*V.cmdbuf != '\0') { if (*V.cmdbuf != '\0') - printf("Unrecognized option: -%s\n", V.cmdbuf); - printf("\nUsage: LOG [ -v ] [ -c cnffile ] [ -x X_display_name ] [ file ]\n"); + nc_printf("Unrecognized option: -%s\n", V.cmdbuf); + nc_printf("\nUsage: LOG [ -v ] [ -c cnffile ] [ -x X_display_name ] [ file ]\n"); _Escape(0); } @@ -13898,7 +13896,7 @@ static void initialize() if (P_escapecode == -20) _Escape(P_escapecode); beginfatal(&V); - printf("Can't find graphics tablet!\n"); + nc_printf("Can't find graphics tablet!\n"); endfatal(&V); ENDTRY(try34); if (gatefilenames == NULL) @@ -13991,7 +13989,7 @@ static void initialize() if (P_escapecode == -20) _Escape(P_escapecode); beginfatal(&V); - printf("Can't open gates file \"%s\"\n", gatesname[k]); + nc_printf("Can't open gates file \"%s\"\n", gatesname[k]); endfatal(&V); ENDTRY(try35); } @@ -13999,7 +13997,7 @@ static void initialize() if (idxsize == 0) { beginfatal(&V); - printf("No gates files!\n"); + nc_printf("No gates files!\n"); endfatal(&V); } index_ = (char(*)[9])Malloc(idxsize * 10L); @@ -14039,7 +14037,7 @@ static void initialize() if (P_escapecode == -20) _Escape(P_escapecode); beginfatal(&V); - printf("Can't read gates file \"%s\"\n", gatesname[i]); + nc_printf("Can't read gates file \"%s\"\n", gatesname[i]); endfatal(&V); ENDTRY(try38); } @@ -14266,7 +14264,7 @@ static void shownews() TEMP = (char *)strchr(s, '\n'); if (TEMP != NULL) *TEMP = '\0'; - puts(s); + nc_puts(s); } m_alpha_on(); noblink(); @@ -14308,7 +14306,7 @@ int main(int argc, char * argv[]) TRY(try40); initialize(); - printf("\210\f Starting\201\210 LOG\f\200"); + nc_printf("\210\f Starting\201\210 LOG\f\200"); do { gg.initdone = true; @@ -14404,7 +14402,7 @@ int main(int argc, char * argv[]) if (!commandfound) { beginerror(); - printf("Can't understand function %s\n", gg.func); + nc_printf("Can't understand function %s\n", gg.func); enderror(); clearfunc(); } @@ -14545,7 +14543,7 @@ int main(int argc, char * argv[]) if (P_escapecode != -20) goto _Ltry40; clearshowalpha(); - printf( "\n\n%c%cPress CLR I/O again to exit, any other key to continue.%c\n\n", + nc_printf( "\n\n%c%cPress CLR I/O again to exit, any other key to continue.%c\n\n", chryellow, chrplain, chrgreen); nk_keybufclear(); waitforkey(); @@ -14577,25 +14575,25 @@ int main(int argc, char * argv[]) else if (temp2 == -20 && timers_sysclock() < watchdog + watchdogtime) { clearshowalpha(); - printf("%c%c\n\n", chrgreen, chrplain); + nc_printf("%c%c\n\n", chrgreen, chrplain); } else { clearshowalpha(); - printf("\n\n%c%cUnexpected runtime error%c%c\n\n", + nc_printf("\n\n%c%cUnexpected runtime error%c%c\n\n", chryellow, chrunderl, chrplain, chrgreen); - printf(" Escapecode = %ld\n", temp2); + nc_printf(" Escapecode = %ld\n", temp2); if (temp2 == -10) - printf(" Ioresult = %ld = %s\n", + nc_printf(" Ioresult = %ld = %s\n", temp1, ioresult_message(str1, temp1)); if (excpline != -1) - printf(" Line num = %ld\n", excpline); - printf("\n Probable cause: "); + nc_printf(" Line num = %ld\n", excpline); + nc_printf("\n Probable cause: "); switch (-temp2) { case 2: - printf("Not enough memory\n"); + nc_printf("Not enough memory\n"); break; case 4: @@ -14607,36 +14605,36 @@ int main(int argc, char * argv[]) case 17: case 18: case 19: - printf("Arithmetic overflow\n"); + nc_printf("Arithmetic overflow\n"); break; case 20: - printf("Unexpected user termination\n"); + nc_printf("Unexpected user termination\n"); break; case 10: - printf("I/O problem\n"); + nc_printf("I/O problem\n"); break; case 26: - printf("Low-level I/O\n"); + nc_printf("Low-level I/O\n"); break; default: - putchar('\n'); + nc_putchar('\n'); break; } - putchar('\n'); + nc_putchar('\n'); nk_keybufclear(); if (gg.initdone) { - printf("Want debugging printout? "); + nc_printf("Want debugging printout? "); do { tempch = nk_getkey(); } while (tempch != 'n' && tempch != 'N' && tempch != 'y' && tempch != 'Y'); - printf("%c\n", tempch); + nc_printf("%c\n", tempch); if (tempch == 'y' || tempch == 'Y') { TRY(try43); @@ -14648,27 +14646,27 @@ int main(int argc, char * argv[]) fprintf(tracefile, "Current page: %ld\n", gg.curpage); dumpnodes(); RECOVER(try43); - printf("Debugging printout failed.\n"); + nc_printf("Debugging printout failed.\n"); ENDTRY(try43); } - putchar('\n'); + nc_putchar('\n'); } long for_limit = gg.numpages; for (temp1 = 1; temp1 <= for_limit; temp1++) { - printf("Try to save page %ld? ", temp1); + nc_printf("Try to save page %ld? ", temp1); do { tempch = nk_getkey(); } while (tempch != 'n' && tempch != 'N' && tempch != 'y' && tempch != 'Y'); - printf("%c\n", tempch); + nc_printf("%c\n", tempch); if (tempch == 'y' || tempch == 'Y') emergencysave((int)temp1); } } RECOVER(try42); - printf("Error %d in outer TRY-RECOVER\n", P_escapecode); + nc_printf("Error %d in outer TRY-RECOVER\n", P_escapecode); ENDTRY(try42); ENDTRY(try40); TRY(try44); diff --git a/src/logcom.c b/src/logcom.c index efd694b80497fa25f79f87c18f01c64168e1edfc..e0af9bb4b0825447df8aded650c66f3c7bdf11a2 100644 --- a/src/logcom.c +++ b/src/logcom.c @@ -149,18 +149,18 @@ long mode; return; } if (mode == 0) { - printf("\f"); - printf("Common-node gate\n\n"); - printf("Current signal name: "); + nc_printf("\f"); + nc_printf("Common-node gate\n\n"); + nc_printf("Current signal name: "); if (*buf == '\0') - printf("(no name)"); + nc_printf("(no name)"); else - fputs(buf, stdout); - printf("\n\nChange this? "); + nc_puts(buf); + nc_printf("\n\nChange this? "); ch = toupper(nk_getkey()); if (ch == 'Y') { - printf("\nNew name: "); - fgets(buf, 9, stdin); + nc_printf("\nNew name: "); + nc_fgets(buf, 9, stdin); TEMP = (char *) strchr(buf, '\n'); if (TEMP != NULL) *TEMP = 0; @@ -601,18 +601,18 @@ long mode; return; } if (mode == 0) { - printf("\f"); - printf("Procedural gate\n\n"); - printf("Current procedure name: "); + nc_printf("\f"); + nc_printf("Procedural gate\n\n"); + nc_printf("Current procedure name: "); if (*buf == '\0') - printf("(no name)"); + nc_printf("(no name)"); else - fputs(buf, stdout); - printf("\n\nChange this? "); + nc_puts(buf); + nc_printf("\n\nChange this? "); ch = toupper(nk_getkey()); if (ch == 'Y') { - printf("\nNew name: "); - fgets(buf, 101, stdin); + nc_printf("\nNew name: "); + nc_fgets(buf, 101, stdin); TEMP = (char *) strchr(buf, '\n'); if (TEMP != NULL) *TEMP = 0; diff --git a/src/loged.c b/src/loged.c index 320c96ca23d61d7bc8a8b8be10d787a63a2aea74..da10fd5483ac853f544df767f62072e6de4ea026 100644 --- a/src/loged.c +++ b/src/loged.c @@ -792,7 +792,7 @@ char *s; do { ch = toupper(nk_getkey()); } while (strposc(s, ch, 1L) == 0); - printf("%c\n", ch); + nc_printf("%c\n", ch); return ch; } @@ -1146,7 +1146,7 @@ static void wrmsg(s) char *s; { nc_gotoXY(0, (int)(scrheight - 5)); - printf("%s\007", s); + nc_printf("%s\007", s); nc_gotoXY(0, (int)(scrheight - 3)); errorflag = true; } @@ -1466,7 +1466,7 @@ char *s_; GETFBUF(V.f, filerec).pin[V.p].y = 0; GETFBUF(V.f, filerec).pin[V.p].s = 0; GETFBUF(V.f, filerec).pin[V.p].c = 0; - printf("Warning: missing pin %d of %s\n", i, k->name); + nc_printf("Warning: missing pin %d of %s\n", i, k->name); } else { GETFBUF(V.f, filerec).pin[V.p].x = k->pin[i - 1].x; GETFBUF(V.f, filerec).pin[V.p].y = k->pin[i - 1].y; @@ -1598,17 +1598,17 @@ char *s_; RECOVER2(try1,_Ltry1); j = P_ioresult; nc_gotoXY(0, (int)(scrheight - 5)); - putchar('\t'); + nc_putchar('\t'); if (j == 41) - printf("\007File %s is in use", s); + nc_printf("\007File %s is in use", s); else { sprintf(STR1, "Unable to save file %s", s); - printf("\007%s", _ShowEscape(STR3, P_escapecode, j, STR1)); + nc_printf("\007%s", _ShowEscape(STR3, P_escapecode, j, STR1)); } - printf("; new file name: "); - gets(s1); + nc_printf("; new file name: "); + nc_fgets(s1, 256, stdin); nc_gotoXY(0, (int)(scrheight - 3)); - putchar('\t'); + nc_putchar('\t'); success = false; if (*s1 == '\0') success = true; @@ -1712,7 +1712,7 @@ char *s_, *gname_; } RESETBUF(f, oldrec); nc_gotoXY(0, (int)(scrheight - 5)); - printf("Using file name /lib/log/%s\n", s); + nc_printf("Using file name /lib/log/%s\n", s); nc_gotoXY(0, (int)(scrheight - 3)); ENDTRY(try6); while (!P_eof(f)) { @@ -1722,7 +1722,7 @@ char *s_, *gname_; useit = false; if (comparestr(name, gname)) { if (verify) { - printf("Load %s? ", name); + nc_printf("Load %s? ", name); do { ch = nk_getkey(); } while (ch != ' ' && ch != 'R' && ch != 'r' && ch != 'N' && @@ -1730,8 +1730,8 @@ char *s_, *gname_; if (ch == ' ') ch = 'N'; if (ch == 'R' || ch == 'r') { - printf("Rename as: "); - fgets(name, 9, stdin); + nc_printf("Rename as: "); + nc_fgets(name, 9, stdin); TEMP = (char *) strchr(name, '\n'); if (TEMP != NULL) *TEMP = 0; @@ -1739,7 +1739,7 @@ char *s_, *gname_; if (*name == '\0') ch = 'N'; } else - printf("%c\n", ch); + nc_printf("%c\n", ch); useit = (ch == 'R' || ch == 'r' || ch == 'Y' || ch == 'y'); menuflag = true; } else @@ -1748,16 +1748,16 @@ char *s_, *gname_; if (useit) { if (addkind(name)) { if (*gname != '\0' && !verify) { - printf("Loaded: %s\n", name); + nc_printf("Loaded: %s\n", name); menuflag = true; } copykind(curkind, &GETFBUF(f, oldrec)); strcpy(curkind->name, name); } else if (verify) { - printf("%s already exists (overwritten)\n", name); + nc_printf("%s already exists (overwritten)\n", name); copykind(curkind, &GETFBUF(f, oldrec)); } else { - printf("%s already exists (not loaded)\n", name); + nc_printf("%s already exists (not loaded)\n", name); menuflag = true; } } @@ -1920,7 +1920,7 @@ char *s_, *gname_; } RESETBUF(V.f, filerec); nc_gotoXY(0, (int)(scrheight - 5)); - printf("Using file name %s\n", s1); + nc_printf("Using file name %s\n", s1); nc_gotoXY(0, (int)(scrheight - 3)); ENDTRY(try8); for (i = 1; i <= 4; i++) { @@ -1997,7 +1997,7 @@ char *s_, *gname_; useit = false; if (comparestr(name, gname) && comparegroup((int)gr, ggroup)) { if (verify) { - printf("Load %s? ", name); + nc_printf("Load %s? ", name); do { ch = nk_getkey(); } while (ch != ' ' && ch != 'R' && ch != 'r' && ch != 'N' && @@ -2005,8 +2005,8 @@ char *s_, *gname_; if (ch == ' ') ch = 'N'; if (ch == 'R' || ch == 'r') { - printf("Rename as: "); - fgets(name, 9, stdin); + nc_printf("Rename as: "); + nc_fgets(name, 9, stdin); TEMP = (char *) strchr(name, '\n'); if (TEMP != NULL) *TEMP = 0; @@ -2014,7 +2014,7 @@ char *s_, *gname_; if (*name == '\0') ch = 'N'; } else - printf("%c\n", ch); + nc_printf("%c\n", ch); useit = (ch == 'R' || ch == 'r' || ch == 'Y' || ch == 'y'); menuflag = true; } else @@ -2023,7 +2023,7 @@ char *s_, *gname_; if (useit) { if (addkind(name)) { if (*gname != '\0' && !verify) { - printf("Loaded: %s\n", name); + nc_printf("Loaded: %s\n", name); menuflag = true; } li[i] = curkind; @@ -2031,12 +2031,12 @@ char *s_, *gname_; loadany = true; strcpy(curkind->name, name); } else if (verify) { - printf("%s already exists (overwritten)\n", name); + nc_printf("%s already exists (overwritten)\n", name); loadany = true; li[i] = curkind; curkind->group = gr; } else { - printf("%s already exists (not loaded)\n", name); + nc_printf("%s already exists (not loaded)\n", name); menuflag = true; } } @@ -2213,7 +2213,7 @@ char *s_, *gname_; break; default: - printf("Error in annotations section\n"); + nc_printf("Error in annotations section\n"); k->numvects = 0; break; } @@ -2315,7 +2315,7 @@ static void clearalpha() { if (onescreen) m_nocursor(); - printf("\f"); + nc_printf("\f"); m_alpha_on(); nc_gotoXY(0, (int)P_imax2(scrheight - 24, 0L)); } @@ -3283,8 +3283,8 @@ static void cpyfunc() m_nocursor(); clearalpha(); dim(); - printf("Enter name of gate to copy: "); - fgets(n, 9, stdin); + nc_printf("Enter name of gate to copy: "); + nc_fgets(n, 9, stdin); TEMP = (char *) strchr(n, '\n'); if (TEMP != NULL) *TEMP = 0; @@ -3335,8 +3335,8 @@ static void shadowfunc() m_nocursor(); clearalpha(); dim(); - printf("Enter name of gate to shadow: "); - fgets(n, 9, stdin); + nc_printf("Enter name of gate to shadow: "); + nc_fgets(n, 9, stdin); TEMP = (char *) strchr(n, '\n'); if (TEMP != NULL) *TEMP = 0; @@ -4039,8 +4039,8 @@ struct LOC_drawcmd *LINK; m_nocursor(); clearalpha(); dim(); - printf("Enter number of marker: "); - gets(buf); + nc_printf("Enter number of marker: "); + nc_fgets(buf, 256, stdin); bright(); if (onescreen) { grid(); @@ -4067,8 +4067,8 @@ struct LOC_drawcmd *LINK; m_nocursor(); clearalpha(); dim(); - printf("Enter text to display: "); - gets(buf); + nc_printf("Enter text to display: "); + nc_fgets(buf, 256, stdin); bright(); if (onescreen) { grid(); @@ -4107,15 +4107,15 @@ struct LOC_drawcmd *LINK; { clearalpha(); dim(); - printf("Hit space bar to refresh and rescale.\n\n"); - printf("Press [ or ] to advance pin number menu.\n"); - printf("Press < or > to change scale.\n"); - printf("Press N or P to switch to next/previous gate.\n\n"); - printf("Press C to copy another gate's picture.\n"); - printf("Press S to set up a \"shadow\" gate.\n"); - printf("Press E to edit the gate's picture textually.\n"); + nc_printf("Hit space bar to refresh and rescale.\n\n"); + nc_printf("Press [ or ] to advance pin number menu.\n"); + nc_printf("Press < or > to change scale.\n"); + nc_printf("Press N or P to switch to next/previous gate.\n\n"); + nc_printf("Press C to copy another gate's picture.\n"); + nc_printf("Press S to set up a \"shadow\" gate.\n"); + nc_printf("Press E to edit the gate's picture textually.\n"); nc_gotoXY(0, (int)(scrheight - 2)); - printf("Press any key to continue... "); + nc_printf("Press any key to continue... "); m_inkey(); clearalpha(); bright(); @@ -4395,7 +4395,7 @@ static void drawcmd() case '!': dim(); - printf("\f"); + nc_printf("\f"); m_alpha_on(); newci_shellescape(""); initscreen(); @@ -4406,7 +4406,7 @@ static void drawcmd() case 'E': dim(); - printf("\f"); + nc_printf("\f"); m_alpha_on(); editcmd(""); bright(); @@ -4450,18 +4450,18 @@ static void libcmd() if (i == 2 && j == 2) { clearalpha(); nc_gotoXY(0, 0); - printf("Listing of gates%55cPage%3d\n", ' ', pg); + nc_printf("Listing of gates%55cPage%3d\n", ' ', pg); pg++; } nc_gotoXY(i, j); - fputs(k->name, stdout); + nc_puts(k->name); j++; if (j > scrheight - 4) { j = 2; i += 10; if (i > scrwidth - 10 && k != NULL) { nc_gotoXY(0, (int)(scrheight - 2)); - printf("Press SPACE to continue, any letter to quit. "); + nc_printf("Press SPACE to continue, any letter to quit. "); ch = nk_getkey(); i = 2; } @@ -4470,7 +4470,7 @@ static void libcmd() k = k->next; } nc_gotoXY(0, (int)(scrheight - 2)); - printf("Press SPACE to continue, any letter to quit. "); + nc_printf("Press SPACE to continue, any letter to quit. "); ch = nk_getkey(); menuflag = true; } @@ -4504,7 +4504,7 @@ static void defcmd() return; } m_nocursor(); - printf("\f"); + nc_printf("\f"); gg.action = act_edit; gg.acttool = NULL; reallocproc(&kind, 100L); @@ -4562,14 +4562,14 @@ static void simtypecmd() for (i = 1; i <= FORLIM; i++) { if (kind.pinsim[i - 1] != nopin && kind.pinsim[i - 1] != kind.simtype) { if (!flag) - printf("Main type is %d", kind.simtype); - printf(", pin %ld is %d", i, kind.pinsim[i - 1]); + nc_printf("Main type is %d", kind.simtype); + nc_printf(", pin %ld is %d", i, kind.pinsim[i - 1]); flag = true; } } if (!flag) - printf("This gate has simulation type %d", kind.simtype); - printf(".\n"); + nc_printf("This gate has simulation type %d", kind.simtype); + nc_printf(".\n"); RECOVER(try9); wrmsg("Bad number format!"); ENDTRY(try9); @@ -4651,27 +4651,27 @@ static void connectcmd() } } nc_gotoXY(0, (int)(scrheight - 5)); - printf("Connectivity: "); + nc_printf("Connectivity: "); P_expset(st, 0L); FORLIM = kind.numpins; for (i = 1; i <= FORLIM; i++) { if (kind.pinsim[i - 1] != nopin && kind.pincon[i - 1] != 0 && !P_inset((int)i, st)) { if (*st != 0L) - printf("; "); - printf("%ld", i); + nc_printf("; "); + nc_printf("%ld", i); n = i; do { n = kind.pincon[n - 1]; if (n != i) - printf(",%ld", n); + nc_printf(",%ld", n); P_addset(st, (int)n); } while (n != i); } } if (*st == 0L) - printf("None"); - printf(".\n"); + nc_printf("None"); + nc_printf(".\n"); /* recover wrmsg('Bad number format!'); */ } @@ -4771,12 +4771,12 @@ static void labelcmd() if (ch == '\b' && p > 1) { /*left*/ p--; if (kind.lbl[p - 1] != '\001') - putchar(ch); + nc_putchar(ch); else refr = true; } else if (ch == '\034' && p < len) { if (kind.lbl[p - 1] != '\001') - putchar(ch); + nc_putchar(ch); else refr = true; p++; @@ -4841,7 +4841,7 @@ static void labelcmd() if (ch != '\001') p++; if (ch >= ' ' && p == len) - putchar(ch); + nc_putchar(ch); else refr = true; savedflag = false; @@ -4924,7 +4924,7 @@ static void groupcmd() savedflag = false; } nc_gotoXY(0, (int)(scrheight - 5)); - printf("This gate is in group %d.\n", kind.group); + nc_printf("This gate is in group %d.\n", kind.group); RECOVER(try12); wrmsg("Bad number format!"); ENDTRY(try12); @@ -4965,15 +4965,15 @@ long mode; } } nc_gotoXY(0, (int)(scrheight - 5)); - printf("Flags Set:"); + nc_printf("Flags Set:"); for (i = 0; i <= 15; i++) { if ((kind->flag.a & (1 << i)) != 0 && strcmp(names[i], "Z")) - printf(" %s", names[i]); + nc_printf(" %s", names[i]); } - printf(" Clear:"); + nc_printf(" Clear:"); for (i = 0; i <= 15; i++) { if ((kind->flag.a & (1 << i)) == 0 && strcmp(names[i], "Z")) - printf(" %s", names[i]); + nc_printf(" %s", names[i]); } } break; @@ -5017,7 +5017,7 @@ static void copycmd() k1 = curkind; ch = 'Y'; if (!addkind(argument)) { - printf("\"%s\" already exists -- destroy it? ", argument); + nc_printf("\"%s\" already exists -- destroy it? ", argument); ch = readyn("YN"); } if (ch != 'Y') { @@ -5133,7 +5133,7 @@ static void deletecmd() if (verf) { nc_gotoXY(0, (int)(scrheight - 3)); anyfound = true; - printf("Delete %s? ", k2->name); + nc_printf("Delete %s? ", k2->name); ch = readyn("YNQ"); switch (ch) { @@ -5150,7 +5150,7 @@ static void deletecmd() break; } nc_gotoXY(0, (int)(scrheight - 3)); - putchar('\t'); + nc_putchar('\t'); } else found = true; } else @@ -6384,7 +6384,7 @@ static void load20cmd() if (*filename == '\0') { strcpy(filename, "log.gate"); nc_gotoXY(0, (int)(scrheight - 5)); - printf("Using file name %s\n", filename); + nc_printf("Using file name %s\n", filename); nc_gotoXY(0, (int)(scrheight - 3)); } roshapes(filename, gname); @@ -6406,7 +6406,7 @@ static void loadcmd() if (*filename == '\0') { strcpy(filename, "log.gate"); nc_gotoXY(0, (int)(scrheight - 5)); - printf("Using file name %s\n", filename); + nc_printf("Using file name %s\n", filename); nc_gotoXY(0, (int)(scrheight - 3)); } readfile(filename, gname); @@ -6451,7 +6451,7 @@ static void savecmd() else if (*filename == '\0') wrmsg("No file name"); else { - printf("Use file \"%s\" ? ", filename); + nc_printf("Use file \"%s\" ? ", filename); ch = readyn("YN"); } if (*filename != '\0' && ch == 'Y') @@ -6533,9 +6533,9 @@ static void memorycmd() nc_gotoXY(0, (int)(scrheight - 5)); TRY(try17); - printf("Memory available: %ld bytes.\n", 10000000L); + nc_printf("Memory available: %ld bytes.\n", 10000000L); RECOVER(try17); - puts(_ShowEscape(STR2, P_escapecode, P_ioresult, "na_memavail")); + nc_puts(_ShowEscape(STR2, P_escapecode, P_ioresult, "na_memavail")); ENDTRY(try17); } @@ -6771,40 +6771,40 @@ int main(int argc, char * argv[]) clearalpha(); bright(); if (firsttime) { - printf("Welcome to New, Improved LOGED!\n\n"); - printf("LOGED now works on Bobcats as well as Chipmunks.\n\n"); - printf("The DRAW command has been totally redone and is now,\n"); + nc_printf("Welcome to New, Improved LOGED!\n\n"); + nc_printf("LOGED now works on Bobcats as well as Chipmunks.\n\n"); + nc_printf("The DRAW command has been totally redone and is now,\n"); /* p2c: loged.text, line 6245: Note: characters >= 128 encountered [281] */ /* p2c: loged.text, line 6245: * Note: WRITE statement contains color/attribute characters [203] */ - printf("incredibly enough, \213\202*reasonably nice to use*\200\210!\n"); - printf("The program now uses LOG-like pen motions to draw,\n"); - printf("move, and throw away lines and pin numbers.\n"); - printf("(To create a pin, grab a number from the left edge.)\n"); - printf("Hit '?' in DRAW for further commands.\n\n"); - printf("The command OLD switches to old-style DRAW mode, and NEW\n"); - printf("switches back to the new DRAW editor. The old version of\n"); - printf("the program is available as OLOGED.\n\n"); - printf("Please let me know what you think,\n"); - printf(" -- Dave\n"); + nc_printf("incredibly enough, \213\202*reasonably nice to use*\200\210!\n"); + nc_printf("The program now uses LOG-like pen motions to draw,\n"); + nc_printf("move, and throw away lines and pin numbers.\n"); + nc_printf("(To create a pin, grab a number from the left edge.)\n"); + nc_printf("Hit '?' in DRAW for further commands.\n\n"); + nc_printf("The command OLD switches to old-style DRAW mode, and NEW\n"); + nc_printf("switches back to the new DRAW editor. The old version of\n"); + nc_printf("the program is available as OLOGED.\n\n"); + nc_printf("Please let me know what you think,\n"); + nc_printf(" -- Dave\n"); } else { - printf("\n\nLIB [gates] to list all gates\n"); - printf("GATE name to choose or make a gate\n"); - printf("DRAW [name] to edit a gate's picture\n"); - printf("DEF [name] to edit a gate's definition\n"); - printf("SIMTYPE [num [pin]] to edit a gate's simulation type (0-255)\n"); - printf("CONNECT pin1 [pin2] to edit a gate's connectivity\n"); - printf("LABEL [name] to edit a gate's labels\n"); - printf("GROUP [code] to edit a gate's group number (0-8)\n"); - printf("COPY name to make a copy of this gate\n"); - printf("RENAME name to rename this gate\n"); - printf("DELETE [gates] to delete a gate (or this gate)\n"); - printf("NEXT [gates] to move to the next gate\n"); - printf("LOAD file [gates] to load a gates file\n"); - printf("SAVE [file] to save the gates\n"); - printf("DUMP [file.ps] to print gate info \n"); - printf("HELP to get Help\n"); - printf("EXIT to exit the program\n"); + nc_printf("\n\nLIB [gates] to list all gates\n"); + nc_printf("GATE name to choose or make a gate\n"); + nc_printf("DRAW [name] to edit a gate's picture\n"); + nc_printf("DEF [name] to edit a gate's definition\n"); + nc_printf("SIMTYPE [num [pin]] to edit a gate's simulation type (0-255)\n"); + nc_printf("CONNECT pin1 [pin2] to edit a gate's connectivity\n"); + nc_printf("LABEL [name] to edit a gate's labels\n"); + nc_printf("GROUP [code] to edit a gate's group number (0-8)\n"); + nc_printf("COPY name to make a copy of this gate\n"); + nc_printf("RENAME name to rename this gate\n"); + nc_printf("DELETE [gates] to delete a gate (or this gate)\n"); + nc_printf("NEXT [gates] to move to the next gate\n"); + nc_printf("LOAD file [gates] to load a gates file\n"); + nc_printf("SAVE [file] to save the gates\n"); + nc_printf("DUMP [file.ps] to print gate info \n"); + nc_printf("HELP to get Help\n"); + nc_printf("EXIT to exit the program\n"); } refrkind = !firsttime; menuflag = false; @@ -6823,22 +6823,22 @@ int main(int argc, char * argv[]) if (refrkind) { nc_gotoXY(0, (int)P_imax2(scrheight - 24, 0L)); if (curkind != NULL) - printf("Current gate: %s\t", kind.name); + nc_printf("Current gate: %s\t", kind.name); else - printf("No gate selected\t"); + nc_printf("No gate selected\t"); refrname(); refrkind = false; } nc_gotoXY(0, (int)(scrheight - 4)); - printf("-> \013"); - gets(command); + nc_printf("-> \013"); + nc_fgets(command, 256, stdin); if (firsttime) { - printf("\f"); + nc_printf("\f"); menuflag = true; firsttime = false; } nc_gotoXY(0, (int)(scrheight - 5)); - putchar('\t'); + nc_putchar('\t'); nc_gotoXY(0, (int)(scrheight - 3)); strcpy(STR3, strltrim(command)); strcpy(command, STR3); @@ -6857,7 +6857,7 @@ int main(int argc, char * argv[]) RECOVER(try19); if (P_escapecode != -20) goto _Ltry18; - putchar('\007'); + nc_putchar('\007'); menuflag = true; needrefr = true; ENDTRY(try19); @@ -6865,15 +6865,15 @@ int main(int argc, char * argv[]) } while (!exitflag); if (!savedflag) { if (*filename == '\0') { - printf("Save file? "); + nc_printf("Save file? "); if (readyn("YNQ") == 'Y') { - printf("Enter name of file to save: "); - gets(argument); + nc_printf("Enter name of file to save: "); + nc_fgets(argument, 256, stdin); if (*argument != '\0') writefile(argument, ""); else { - printf("Enter name of file to save: "); - gets(argument); + nc_printf("Enter name of file to save: "); + nc_fgets(argument, 256, stdin); if (*argument != '\0') writefile(argument, ""); else @@ -6882,7 +6882,7 @@ int main(int argc, char * argv[]) } else savedflag = true; } else { - printf("Save file \"%s\"? ", filename); + nc_printf("Save file \"%s\"? ", filename); if (readyn("YNQ") == 'Y') writefile(filename, ""); else @@ -6894,13 +6894,13 @@ int main(int argc, char * argv[]) iores = P_ioresult; esc = P_escapecode; if (esc != -20) { - printf("\007%s\n\n", _ShowEscape(STR2, esc, iores, "Internal error")); - printf("Press Enter key to continue."); + nc_printf("\007%s\n\n", _ShowEscape(STR2, esc, iores, "Internal error")); + nc_printf("Press Enter key to continue."); scanf("%*[^\n]"); getchar(); } initscreen(); - printf("\f"); + nc_printf("\f"); if (esc == -20) _Escape((int)esc); ENDTRY(try18); diff --git a/src/logntk.c b/src/logntk.c index b54777b08d8b242d91ca834e5281c274c0ba023e..5b97674639b19b88c40eaded92fe40572c831cf5 100644 --- a/src/logntk.c +++ b/src/logntk.c @@ -1459,7 +1459,7 @@ struct LOC_Log_logntk_proc *LINK; } (*LINK->act->hook.beginbottom)(); m_alpha_on(); - printf( + nc_printf( "Move to a gate/node to see its name; press left button to finish.\n"); nc_getXY(&xpos, &ypos); exitflag = true; @@ -1574,7 +1574,7 @@ struct LOC_Log_logntk_proc *LINK; } if (strcmp(buf, obuf)) { nc_gotoXY((int)xpos, (int)ypos); - fputs(buf, stdout); + nc_puts(buf); } } while (!(*LINK->act->func != '\0' || LINK->act->t.dn)); (*LINK->act->hook.endbottom)(); @@ -1716,7 +1716,7 @@ log_action_t *act_; esc = P_escapecode; ior = P_ioresult; (*WITH->hook.beginerror)(); - puts(_ShowEscape(STR1, esc, ior, "Error during LOGNTK")); + nc_puts(_ShowEscape(STR1, esc, ior, "Error during LOGNTK")); (*WITH->hook.enderror)(); } ENDTRY(try1); diff --git a/src/logsim.c b/src/logsim.c index 65f689dc6131e1b8a27b1265de0bbf94ca0947bc..887905235fdf2a6ef516554b84c59c303539b17a 100644 --- a/src/logsim.c +++ b/src/logsim.c @@ -1270,9 +1270,9 @@ static void status_16(int *flag) WITH = logsima_action.lact; nk_gotoxy(0, 4); (*WITH->hook.realunit)(nexttimebid, 4, "s", s); - printf("Next time bid: %s\t\n", s); - printf("Pass ready: %5s\n", passready ? "TRUE" : "FALSE"); - printf("Stabilizing: %5s\n", stabilizing ? "TRUE" : "FALSE"); + nc_printf("Next time bid: %s\t\n", s); + nc_printf("Pass ready: %5s\n", passready ? "TRUE" : "FALSE"); + nc_printf("Stabilizing: %5s\n", stabilizing ? "TRUE" : "FALSE"); WITH->actflag = false; } diff --git a/src/logsimasm.c b/src/logsimasm.c index ea3b25da69b4cf2417152a27c24d34550fd933c3..d2c8ad251103eedd60de33e05a7237571af9750f 100644 --- a/src/logsimasm.c +++ b/src/logsimasm.c @@ -98,7 +98,7 @@ void copynodes(log_nrec *n, int *stable) if ((nip->truev = newv = nip->v0) == log_none) newv = nip->defv; if (TRACE_COPY) - printf("Setting node %x to %d\n", (unsigned int)nip, newv); + nc_printf("Setting node %x to %d\n", (unsigned int)nip, newv); if (newv != (nip->v00 = nip->v)) { nip->v = newv; @@ -150,7 +150,7 @@ static void processcall(log_16_actionkinds action) } else { - printf("Could not resolve %s\n", namebuf); + nc_printf("Could not resolve %s\n", namebuf); g_proc[-2] = 32; log_16_noprog(&logsima_action); } @@ -265,7 +265,7 @@ static log_nrec *g_pinnum() { register uchar ch; - if (TRACE_OPS) printf("g_pinnum: %s\n", debug_dasm()); + if (TRACE_OPS) nc_printf("g_pinnum: %s\n", debug_dasm()); switch ((ch = *g_proc++)) { case 0xab: /* internal node */ @@ -294,7 +294,7 @@ static log_16_value g_expr() register uchar ch; register nodeinfo *nip; - if (TRACE_OPS) printf("g_expr: %s\n", debug_dasm()); + if (TRACE_OPS) nc_printf("g_expr: %s\n", debug_dasm()); switch ((ch = *g_proc++)) { case 0xa0: /* AND */ @@ -359,7 +359,7 @@ static log_16_value g_expr() case 0xb0: /* high pin */ nip = g_pins[*g_proc++]->info; - if (TRACE_VAL) printf(" Value of %x is %d\n", (unsigned int)nip, (int)nip->v - 1); + if (TRACE_VAL) nc_printf(" Value of %x is %d\n", (unsigned int)nip, (int)nip->v - 1); return nip->v; case 0xb1: /* STRONG */ @@ -369,17 +369,17 @@ static log_16_value g_expr() case16(0xc0): /* pin */ case16(0xd0): nip = g_pins[ch & 0x1f]->info; - if (TRACE_VAL) printf(" Value of %x is %d\n", (unsigned int)nip, (int)nip->v - 1); + if (TRACE_VAL) nc_printf(" Value of %x is %d\n", (unsigned int)nip, (int)nip->v - 1); return nip->v; case16(0xe0): /* var */ - if (TRACE_VAL) printf(" Value of %c is %d\n", + if (TRACE_VAL) nc_printf(" Value of %c is %d\n", 'A' + (ch % 0x0f), (g_vars & REGMASK(ch & 0x0f)) != 0); return (g_vars & REGMASK(ch & 0x0f)) ? log_one : log_zero; case16(0xf0): /* NOT var */ - if (TRACE_VAL) printf(" Value of %c is %d\n", + if (TRACE_VAL) nc_printf(" Value of %c is %d\n", 'A' + (ch % 0x0f), (g_vars & REGMASK(ch & 0x0f)) != 0); return (g_vars & REGMASK(ch & 0x0f)) ? log_zero : log_one; @@ -400,7 +400,7 @@ static void g_stmts() for (;;) { - if (TRACE_OPS) printf("g_stmts: %s\n", debug_dasm()); + if (TRACE_OPS) nc_printf("g_stmts: %s\n", debug_dasm()); switch ((ch = *g_proc++)) { case 0x00: /* end-of-procedure */ @@ -421,7 +421,7 @@ static void g_stmts() case 0x0c: case 0x0d: case 0x0e: case 0x0f: /* ELSE */ if_skip: - if (TRACE_OPS) printf("Skipping...\n"); + if (TRACE_OPS) nc_printf("Skipping...\n"); temp = 0; for (;;) { @@ -571,7 +571,7 @@ out_node: { case log_zero: nip = np->info; - if (TRACE_VAL) printf(" Output 0 to %x (was %d)\n", (unsigned int)nip, nip->v0); + if (TRACE_VAL) nc_printf(" Output 0 to %x (was %d)\n", (unsigned int)nip, nip->v0); if (nip->v0 == log_one) record_conflict(np); else @@ -580,7 +580,7 @@ out_node: case log_one: nip = np->info; - if (TRACE_VAL) printf(" Output 1 to %x (was %d)\n", (unsigned int)nip, nip->v0); + if (TRACE_VAL) nc_printf(" Output 1 to %x (was %d)\n", (unsigned int)nip, nip->v0); if (nip->v0 == log_zero) record_conflict(np); else @@ -600,7 +600,7 @@ oc_out_node: if (g_expr() == log_zero) { nip = np->info; - if (TRACE_VAL) printf(" Output 0 to %x (was %d)\n", (unsigned int)nip, nip->v0); + if (TRACE_VAL) nc_printf(" Output 0 to %x (was %d)\n", (unsigned int)nip, nip->v0); if (nip->v0 == log_one) record_conflict(np); else @@ -612,30 +612,30 @@ oc_out_node: case16(0x60): /* var = x */ if (g_expr() != log_zero) { - if (TRACE_VAL) printf(" Store 1 in %c\n", 'A' + (ch % 0x0f)); + if (TRACE_VAL) nc_printf(" Store 1 in %c\n", 'A' + (ch % 0x0f)); g_vars |= REGMASK(ch & 0x0f); } else { - if (TRACE_VAL) printf(" Store 0 in %c\n", 'A' + (ch % 0x0f)); + if (TRACE_VAL) nc_printf(" Store 0 in %c\n", 'A' + (ch % 0x0f)); g_vars &= ~REGMASK(ch & 0x0f); } break; case16(0x70): /* var = NOT var */ g_vars ^= REGMASK(ch & 0x0f); - if (TRACE_VAL) printf(" Store %d in %c\n", + if (TRACE_VAL) nc_printf(" Store %d in %c\n", ((g_vars & REGMASK(ch & 0x0f)) != 0), 'A' + (ch % 0x0f)); break; case16(0x80): /* var = ZERO */ - if (TRACE_VAL) printf(" Store 0 in %c\n", 'A' + (ch % 0x0f)); + if (TRACE_VAL) nc_printf(" Store 0 in %c\n", 'A' + (ch % 0x0f)); g_vars &= ~REGMASK(ch & 0x0f); break; case16(0x90): /* var = ONE */ - if (TRACE_VAL) printf(" Store 1 in %c\n", 'A' + (ch % 0x0f)); + if (TRACE_VAL) nc_printf(" Store 1 in %c\n", 'A' + (ch % 0x0f)); g_vars |= REGMASK(ch & 0x0f); break; @@ -676,14 +676,14 @@ void executegates(int *active, log_grec *g) g = g->next; if (!g) return; - if (TRACE_COPY) printf("\n"); + if (TRACE_COPY) nc_printf("\n"); *active = true; while (g) { if (g->kind->simtype == tool16) { - if (TRACE_GATES) printf("\nexecutegates: %s\n", g->kind->name); + if (TRACE_GATES) nc_printf("\nexecutegates: %s\n", g->kind->name); g_proc = g->kind->proc; g_pins = g->pin; g_gate = g; diff --git a/src/logsimed.c b/src/logsimed.c index 307dcea83d07c700324083eb6a81c58c82bde6f0..f8c382aa37c393e6840fbb12279966f669305bb4 100644 --- a/src/logsimed.c +++ b/src/logsimed.c @@ -1377,15 +1377,15 @@ struct LOC_edit_16 *LINK; ind = indent_16(*LINK->proc, LINK->pc); if (ind < 0) { if (LINK->indent >= -ind) { - printf("\b\b\b"); + nc_printf("\b\b\b"); LINK->indent += ind; } } else if (ind > 0) LINK->indent += ind; else if ((*LINK->proc)[LINK->pc - 1] == '\017' && LINK->indent >= 3) - printf("\b\b\b"); + nc_printf("\b\b\b"); buf = dasm_16(*LINK->proc, &LINK->pc); - printf("%s\t", buf); + nc_printf("%s\t", buf); Free(buf); } @@ -1413,11 +1413,11 @@ struct LOC_edit_16 *LINK; } nk_gotoxy(0, (int)i); if (LINK->indent != 0) - printf("%*c", (int)LINK->indent, ' '); + nc_printf("%*c", (int)LINK->indent, ' '); dasminst(LINK); if (i == 0) { nk_gotoxy(nc_curWindow->width - 10, 0); - fputs(LINK->name, stdout); + nc_puts(LINK->name); } } if (LINK->y < 0) @@ -1530,21 +1530,21 @@ char *name_; pc0++; nc_gotoXY(0, (int)P_imax2(nc_curWindow->height - (pc0 + 15) / 16 - 1, 0L)); - putchar('\013'); + nc_putchar('\013'); pc0 = 1; pc1 = length_16(*V.proc, pc0); while ((*V.proc)[pc0 - 1] != '\0') { if ((pc0 & 15) == 1 && pc0 > 1) - putchar('\n'); + nc_putchar('\n'); if (pc0 == V.pc) - putchar(137); + nc_putchar(137); /* p2c: logsimed.text, line 1313: * Note: character >= 128 encountered [281] */ /* p2c: logsimed.text, line 1313: * Note: WRITE statement contains color/attribute characters [203] */ - printf("%.2X", (*V.proc)[pc0 - 1] & 0xff); + nc_printf("%.2X", (*V.proc)[pc0 - 1] & 0xff); if (pc0 == V.pc) - putchar(136); + nc_putchar(136); /* p2c: logsimed.text, line 1316: * Note: character >= 128 encountered [281] */ /* p2c: logsimed.text, line 1316: @@ -1552,20 +1552,20 @@ char *name_; pc0++; pc1--; if (pc1 <= 0) { - putchar('|'); + nc_putchar('|'); pc1 = length_16(*V.proc, pc0); } else - putchar(' '); + nc_putchar(' '); } if (pc0 == V.pc) - printf("\21100\210\n"); + nc_printf("\21100\210\n"); else - printf("00\n"); + nc_printf("00\n"); /* p2c: logsimed.text, line 1328: * Note: characters >= 128 encountered [281] */ /* p2c: logsimed.text, line 1328: * Note: WRITE statement contains color/attribute characters [203] */ - printf("Press any key to continue..."); + nc_printf("Press any key to continue..."); V.ch = nk_getkey(); V.ch = '\0'; showdef(&V); /* was 152 */ @@ -1623,7 +1623,7 @@ char *name_; bogusreadln(sbuf, editing, &V); y1 = doassem(sbuf, editing, &V); if (y1 == 0) { - putchar('\007'); + nc_putchar('\007'); STR1 = (char*)Malloc(strlen(sbuf) + strlen("# ") + 1); sprintf(STR1, "# %s", sbuf); y1 = doassem(STR1, false, &V); @@ -1646,7 +1646,7 @@ char *name_; V.x = 0; if (V.y >= V.height) { nk_gotoxy(0, (int)V.height); - putchar('\n'); + nc_putchar('\n'); if ((*V.proc)[V.pctop - 1] < 32 && ((1L << (*V.proc)[V.pctop - 1]) & 0x7ff8) != 0) V.indtop += 3; @@ -1689,13 +1689,13 @@ char *name_; showdef(&V); } else { nk_gotoxy(nc_curWindow->width - 10, 0); - printf("%8c", ' '); + nc_printf("%8c", ' '); nk_gotoxy(0, 0); - putchar('\037'); + nc_putchar('\037'); V.y = 1; nk_gotoxy((int)V.indtop, 0); if ((*V.proc)[V.pctop - 1] == '\002') - printf(" "); + nc_printf(" "); V.pc = V.pctop; V.indent = V.indtop + 3; showdef(&V); diff --git a/src/logsimh.c b/src/logsimh.c index 2da6725c9bbb5928d2e9f7252378ec6f5c0fd0e4..1d721dee0ef8d7a8fd341293b9a950564c2ec882 100644 --- a/src/logsimh.c +++ b/src/logsimh.c @@ -1714,7 +1714,7 @@ static void parsegates(struct LOC_compilepage *LINK) LINK->ip1->opcode = op_iffalse; if (LINK->isverbose) { - printf("parsed: "); + nc_printf("parsed: "); dumptree(stdout, LINK->ip1, NULL, LINK); } *ipp = LINK->ip1; @@ -4426,7 +4426,7 @@ static void compilepage(hdefrec *hdef_) V.gcontrol = NULL; if (V.isverbose) - printf("\f"); + nc_printf("\f"); V.ipbase = NULL; if (V.okay) @@ -4536,9 +4536,9 @@ static void compilepage(hdefrec *hdef_) scan(V.ipbase, 1L, &V); if (V.isverbose) { - printf("after simplify:\n"); + nc_printf("after simplify:\n"); dumptree(stdout, V.ipbase, NULL, &V); - putchar('\n'); + nc_putchar('\n'); } } diff --git a/src/logspc.c b/src/logspc.c index c4c9708fb433d1e347cb6991e6befccbeb53f9dc..4e9b19f9fa629d9d7495386630d80a9d05931c23 100644 --- a/src/logspc.c +++ b/src/logspc.c @@ -135,7 +135,6 @@ char pre_file[256] = "", post_file[256] = ""; /* for #include-esque stuff */ /* End Of Spice Globals */ #include <string.h> -#include <utils/p2c.h> #include <utils/strings.h> #include "logspc.h" @@ -2155,7 +2154,7 @@ struct LOC_Log_logspc_proc *LINK; } (*LINK->act->hook.beginbottom)(); m_alpha_on(); - printf( + nc_printf( "Move to a gate/node to see its name; press left button to finish.\n"); nc_getXY(&xpos, &ypos); exitflag = true; @@ -2266,7 +2265,7 @@ struct LOC_Log_logspc_proc *LINK; } if (strcmp(buf, obuf)) { nc_gotoXY((int)xpos, (int)ypos); - fputs(buf, stdout); + nc_puts(buf); } } while (!(*LINK->act->func != '\0' || LINK->act->t.dn)); (*LINK->act->hook.endbottom)(); @@ -2412,7 +2411,7 @@ log_action_t *act_; esc = P_escapecode; ior = P_ioresult; (*WITH->hook.beginerror)(); - puts(_ShowEscape(STR1, esc, ior, "Error during LOGSPC")); + nc_puts(_ShowEscape(STR1, esc, ior, "Error during LOGSPC")); (*WITH->hook.enderror)(); } ENDTRY(try1); diff --git a/src/logstuff.c b/src/logstuff.c index 86539f076088f89a9468b5e0df7a15794c339761..3c9e097fbde4e557e0dfd17878718fb99e054a07 100644 --- a/src/logstuff.c +++ b/src/logstuff.c @@ -221,8 +221,7 @@ void newci_inputunmap() { } -void nc_insLine(x, dx) -int x, dx; +void nc_insLine(int x, int dx) { - printf("nc_insLine not implemented\n"); + printf("nc_insLine not implemented\n"); } diff --git a/src/pagewriter.c b/src/pagewriter.c index 42525654796e370230e2b5e07139deb6a9d59702..92e5752b992b4653ed77704ca539f75d91daefca 100644 --- a/src/pagewriter.c +++ b/src/pagewriter.c @@ -29,7 +29,7 @@ short counthw(log_hwrec *hw, struct LOC_savepage *LINK) hw1 = (log_hwrec *)hw1->temp; } if (hw1 == NULL) - printf("\007Unable to find hwire %ld\n", (long)hw); + nc_printf("\007Unable to find hwire %ld\n", (long)hw); return i; } @@ -47,7 +47,7 @@ short countvw(log_vwrec *vw, struct LOC_savepage *LINK) } if (vw1 == NULL) - printf("\007Unable to find vwire %ld\n", (long)vw); + nc_printf("\007Unable to find vwire %ld\n", (long)vw); return (i + LINK->numhw); } @@ -497,17 +497,17 @@ void emergencysave(short pgnum) char filename[256]; TRY(try25); - printf("File name"); + nc_printf("File name"); if (curfilename[pgnum - 1] != NULL) - printf("(was %s)", curfilename[pgnum - 1]); - printf(": "); - gets(filename); + nc_printf("(was %s)", curfilename[pgnum - 1]); + nc_printf(": "); + nc_fgets(filename, 256, stdin); if (*filename != '\0') savepage(pgnum, filename); RECOVER(try25); if (P_escapecode == -20) _Escape(P_escapecode); - printf("Saving page %d failed.\n", pgnum); + nc_printf("Saving page %d failed.\n", pgnum); ENDTRY(try25); } @@ -520,7 +520,7 @@ void safesavepage(short pgnum, char *fn) return; beginbottom(); TRY(try26); - printf("Saving file %s\n", fn); + nc_printf("Saving file %s\n", fn); m_alpha_on(); savepage(pgnum, fn); endbottom(); @@ -530,8 +530,8 @@ void safesavepage(short pgnum, char *fn) endbottom(); beginerror(); if (Debugging || debugprint || gg.traceflag) - printf("%ld/%ld/%ld ", i, j, EXCP_LINE); - printf("Unable to save file %s\n", fn); + nc_printf("%ld/%ld/%ld ", i, j, EXCP_LINE); + nc_printf("Unable to save file %s\n", fn); char *fn; enderror(); ENDTRY(try26); diff --git a/src/screen.c b/src/screen.c index a008c866f6905f61a043829776defc148d361a25..97e49cbcdcf897679d5353b4162c614fdbaff6d6 100644 --- a/src/screen.c +++ b/src/screen.c @@ -103,7 +103,7 @@ void initscreen() kindgroupstart = kindgroupleft + kindgroupspacing / 2; kindgroupbase = (baseline + down) / 2; - printf("\200\210"); + nc_printf("\200\210"); cursorflag = false; gg.stillnear = true; @@ -135,7 +135,7 @@ void clearalpha() { if (!onescreen) { - printf("\f"); + nc_printf("\f"); noblink(); m_alpha_off(); } @@ -669,7 +669,7 @@ void clearshowalpha() { if (onescreen) clearscreen(); - printf("\f"); + nc_printf("\f"); nk_gotoxy(0, 0); noblink(); showalpha();