Category : C Source Code
Archive   : SMALLC.ZIP
Filename : FORMAT0.C
* Software Tools by Kernighan and Plauger
*
* Source: format0.c
* Version: Jan. 1, 1980.
*/
/* Define global constants */
#define PAGEWIDTH 60 /* default page width */
#define PAGELEN 66 /* default page length */
#define MAXLINE 255 /* max size of output line */
#define INSIZE 255 /* max size of input lines */
#define MAXOUT 255 /* max size of output buffer */
/* Define special characters */
#define PAGECHAR '#' /* page number escape char */
#define SQUOTE 39 /* single quote */
#define DQUOTE 34 /* double quote */
#define TAB 9 /* tab character */
#define BACKSPACE 8 /* back space */
#define UNDERLINE 95 /* underline character */
#define NEWLINE 13 /* end of line character */
#define EOS 0 /* end of string char */
#define CR 13 /* carriage return */
#define LF 10 /* line feed */
/* Define miscellaneous constants */
#define HUGE 32000
#define NULL 0
#define YES 1
#define NO 2
#define OK 1
#define EOF 3
/* Define global variables for user parameters.
* From common block /cparam/
* See init() for initial settings of these variables.
*/
int fill; /* in fill mode if YES */
int lsval; /* current line spacing */
int inval; /* current indent; >= 0 */
int rmval; /* current right margin */
int tival; /* current temporarty indent */
int ceval; /* number of lines to center */
int ulval; /* number of lines to underline */
/* Define global variables describing current page.
* From common block /cpage/
* See init() for initial settings of these variables.
*/
int curpag; /* current output page number */
int newpag; /* next output page number */
int lineno; /* next line to be printed */
int plval; /* page length in lines */
int m1val; /* top margin, including header */
int m2val; /* margin after header */
int m3val; /* margin after last text line */
int m4val; /* bottom margin, including footer */
int bottom; /* last live line on page: */
/* = plval - m3val - m4val */
char header[MAXLINE]; /* top of page title */
char footer[MAXLINE]; /* bottom of page title */
/* Define variables needed for file I/O routines */
int ineof; /* input file EOF flag */
/* Define global variables associated with
* the current output line.
* From common block /cout/.
* See init() for initial settings.
*/
int outp; /* index into outbuf */
int outw; /* width of text in outbuf */
int outwds; /* number of words in outbuf */
char outbuf[MAXOUT]; /* lines to be filled go here */
/* Define direction variable for spread() */
int dir; /* directions flag */
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/