📄 output.c
字号:
/* Copyright (c) 1985 Ceriel J.H. Jacobs *//* * Handle output to screen */# ifndef lintstatic char rcsid[] = "$Header: output.c,v 7.1 87/04/07 14:05:46 ceriel Exp $";# endif# define _OUTPUT_# include "in_all.h"# include "output.h"# include "main.h"# define OBUFSIZ 64*128static char _outbuf[OBUFSIZ];VOIDflush() { /* Flush output buffer, by writing it */ register char *p = _outbuf; _ocnt = OBUFSIZ; if (_optr) (VOID) write(1, p, _optr - p); _optr = p;}VOIDnflush() { /* Flush output buffer, ignoring it */ _ocnt = OBUFSIZ; _optr = _outbuf;}intfputch(ch) char ch; { /* print a character */ putch(ch);}VOIDputline(s) register char *s; { /* Print string s */ if (!s) return; while (*s) { putch(*s++); }}/* * A safe version of putline. All control characters are echoed as ^X */VOIDcputline(s) char *s; { register c; while (c = *s++) { if ((unsigned) c > 0177) c &= 0177; if (c < ' ' || c == 0177) { putch('^'); c ^= 0100; } putch(c); }}/* * Simple minded routine to print a number */VOIDprnum(n) long n; { putline(getnum(n));}static char *fillnum(n, p) long n; char *p;{ if (n >= 10) { p = fillnum(n / 10, p); } *p++ = (int) (n % 10) + '0'; *p = '\0'; return p;}char *getnum(n) long n;{ static char buf[20]; fillnum(n, buf); return buf;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -