/* * Print a line with a number. */ int numbline(int i, int max) { if (shudclob) slobber(' '); max -= printf("%6d ", i); return normline(0, max); }
/* * Print a line with a number. */ void numbline(int i) { if (shudclob) slobber(' '); ex_printf("%6d ", i); normline(); }
/* * Normal line output, no numbering. */ int normline(int unused, int max) { extern short vcntcol, lastsc; short ovc = -1; register char *cp; int (*OO)(int); int c, n; int ret = 0; if (max > 0) vcntcol = 0; if (shudclob) slobber(linebuf[0]); /* pdp-11 doprnt is not reentrant so can't use "printf" here in case we are tracing */ cp = linebuf; vcolbp = cp; while (*cp && max) { vcolbp = cp; nextc(c, cp, n); cp += n; if (max > 0) { if (Outchar != qcount) { OO = Outchar; Outchar = qcount; putchar(c); Outchar = OO; } else putchar(c); if ((vcntcol-1) % WCOLS == 0 && lastsc > 1) vcntcol++; if (vcntcol >= max) { putchar('@'); vcntcol = ovc + 1; lastsc = 1; ret = 1; break; } ovc = vcntcol; if (Outchar != qcount) putchar(c); } else putchar(c); } if (!inopen) { putchar('\n' | QUOTE); } return ret; }
/* * Normal line output, no numbering. */ void normline(void) { register char *cp; if (shudclob) slobber(linebuf[0]); /* pdp-11 doprnt is not reentrant so can't use "printf" here in case we are tracing */ for (cp = linebuf; *cp;) ex_putchar(*cp++); if (!inopen) ex_putchar('\n' | QUOTE); }