wkt@csadfa.cs.adfa.oz.au (Warren Toomey) (12/19/89)
These patches help Andy's nroff produce reasonable manuals! --------------------- cut here ---------------------------- echo x - README.ptch sed '/^X/s///' > README.ptch << '/' XThe NRO(ff) package that Andy Tanenbaum posted recently had several Xannoying features. I have made a few patches to make it now give Xreasonable manuals. The fixes are: X X - to prevent use of linefeeds, which gave less a hernia X - to put error messages on stderr X - to allow single character macros [ see the tmac.an ] X - to prevent $1 .. $9 from being `expanded' when they were null X XI have also altered some of the man macros, and included manuals for them. XIf anybody can now improve these `bandaid' patches & macros, please do! X X Warren Toomey - wkt@csadfa.oz.au@munnari.oz.au[@uunet] / echo x - nroff1.cdif sed '/^X/s///' > nroff1.cdif << '/' X39c39,40 X< printf("nro: unable to open file %s\n",argv[i]); X--- X> fprintf(stderr, /* wkt */ X> "nroff: unable to open file %s\n",argv[i]); X51c52,53 X< puts("Usage: nroff [-n] [+n] [-pxx] [-v] [-b] [-mmacfile] infile ... [>outfile]\n"); X--- X> fprintf(stderr, /* wkt */ X> "Usage: nroff [-n] [+n] [-pxx] [-v] [-b] [-mmacfile] infile ... [>outfile]\n"); X162c164,165 X< c = getc(infp); X--- X> c = getc(infp); /* Ignore backslashes - wkt */ X> if (c=='\\') c = getc(infp); X210c213,214 X< printf("***nro: unable to open file %s\n",p); X--- X> fprintf(stderr, /* wkt */ X> "nroff: unable to open file %s\n",p); X252c256 X< printf("nro: illegal switch %s\n",p); X--- X> fprintf(stderr,"nroff: illegal switch %s\n",p); /* wkt */ / echo x - nroff2.cdif sed '/^X/s///' > nroff2.cdif << '/' X27c27,28 X< printf("*** nro: unrecognized command %s\n",p); X--- X> fprintf(stderr, /* wkt */ X> "nroff: unrecognized command %s\n",p); X70c71 X< puts("***nro: missing .de command\n"); X--- X> fprintf(stderr,"nroff: missing .de command\n"); /* wkt */ X128c129,130 X< puts("***nro: invalid or missing number register name\n"); X--- X> fprintf(stderr, /* wkt */ X> "nroff: invalid or missing number register name\n"); X163c165,166 X< puts("***nro: .so commands nested too deeply\n"); X--- X> fprintf(stderr, /* wkt */ X> "nroff: .so commands nested too deeply\n"); X167c170,171 X< printf("***nro: unable to open %s\n",name); X--- X> fprintf(stderr, /* wkt */ X> "nroff: unable to open %s\n",name); X208,210c212,214 X< co.outbuf[co.outp] = '\r'; X< co.outbuf[co.outp + 1] = '\n'; X< co.outbuf[co.outp + 2] = EOS; X--- X> /* co.outbuf[co.outp] = '\r'; wkt */ X> co.outbuf[co.outp ] = '\n'; X> co.outbuf[co.outp + 1] = EOS; X346c350,351 X< puts("***nro: missing or illegal macro definition name\n"); X--- X> fprintf(stderr, /* wkt */ X> "nroff: missing or illegal macro definition name\n"); X359c364,365 X< puts("***nro: macro definition too long\n"); X--- X> fprintf(stderr, /* wkt */ X> "nroff: macro definition too long\n"); X364c370,371 X< puts("***nro: macro definition table full\n"); X--- X> fprintf(stderr, /* wkt */ X> "nroff: macro definition table full\n"); X478,481c485,487 X< * initialize argp array to substitute command X< * string for any undefined argument X< */ X< for (i=0; i<10; ++i) argp[i] = p; X--- X> * initialize argp array to be all spaces - wkt X> */ X> for (i=0; i<10; ++i) argp[i] = " "; X545c551,552 X< puts("***nro: push back buffer overflow\n"); X--- X> fprintf(stderr, /* wkt */ X> "nroff: push back buffer overflow\n"); / echo x - nroff3.cdif sed '/^X/s///' > nroff3.cdif << '/' X443c443 X< h[++i] = '\r'; X--- X> /* h[++i] = '\r'; wkt */ X512c512 X< prchar('\r',pout); X--- X> /* prchar('\r',pout); wkt */ X582c582 X< *q++ = '\r'; X--- X> /* *q++ = '\r'; wkt */ / echo x - tmac.an sed '/^X/s///' > tmac.an << '/' X.de T0 X.bs X.m1 1 X.in 0 X.rm 75 X.he |$0 ($1)|$2|$0 ($1)| X.fo | |-#-| | X.in 5 X.rm 70 X.. X.de TH X.T0 $0 $1 "Minix Manuals" X.. X.de T1 X.T0 $0 $1 "Minix Commands" X.. X.de T2 X.T0 $0 $1 "Minix System Calls" X.. X.de T3 X.T0 $0 $1 "Minix Library Calls" X.. X.de T4 X.T0 $0 $1 "Minix Special Files" X.. X.de T5 X.T0 $0 $1 "Minix File Formats" X.. X.de T6 X.T0 $0 $1 "Minix Games" X.. X.de T7 X.T0 $0 $1 "Minix Typesetting" X.. X.de T8 X.T0 $0 $1 "Minix System Maintenance" X.. X.de PP X.sp 1 X.in 5 X.. X.de SH X.sp 1 X.in 5 X.ti 0 X.bo X$0 $1 $2 $3 $4 $5 X.br X.. X.de B Xh.bo X$0 $1 $2 $3 $4 $5 X.. X.de I Xh.ul X$0 $1 $2 $3 $4 $5 X.. X.de TP X.sp X.in 13 X.br X.ti 5 X.. / echo x - man.7 sed '/^X/s///' > man.7 << '/' X.T7 man 7 X.SH NAME Xman \- nroff macros for Minix manuals X.SH SYNTAX Xnroff \-man file... X.SH DESCRIPTION XThese macros are used by X.I nroff Xto prepare Minix's manuals. Not all of the Unix macros are provided, Xdue to limitations with Minix's nroff, and apathy on the part of the Xauthor. The following macros are provided, and a skeleton manual entry Xcan be found in the file /usr/man/man.skel. X.PP XPlease note that one of the .TH, .T1 ... .T8 macros must be called on Xthe first line. These set up the style of the manual layout. X.PP XNroff's basic macros are also available for use, but may differ from other Xflavours of nroff (e.g Unix nroff). X.SH FILES X.TP 8 X/usr/lib/tmac/tmac.an \- the file which holds these macros X.TP 8 X/usr/man/man.skel \- a skeleton manual X.SH SEE ALSO X.I nroff(1), man(1) X.SH Macros X.TP 8 X.B TH, T1, T2 ... T8 X\- Initialise the layout of the manual page, and set the header to either X`Minix Manuals' X.B (TH), Xor to a header appropriate to that section of the manuals. X.TP 8 X.B SH X\- Give a section heading to the manual. An example is the X.B DESCRIPTION Xheading above. X.TP 8 X.B PP X\- Force a space of 1 line between blocks of text. X.TP 8 X.B TP X\- Indent text until the next X.B SH. XCurrently any value after the TP macro is ignored. X.TP 8 X.B B X\- Bold everything on the line with the B macro. X.TP 8 X.B I X\- Underline everything on the line with the I macro. / echo x - man.skel sed '/^X/s///' > man.skel << '/' X.TH man.skel 0 X.SH NAME Xman.skel \- skeleton manual for creation of new manuals X.SH SYNTAX XSyntax such as man [-k] [section] title go here. X.SH OPTIONS XThe options are listed, usually using the TP macro. Such as X.TP 8 X.B \-k XIn X.I man(1) Xthis is used to print only the appropriate line in X.B /usr/man/whatis. X.TP 8 XEach option follows after a TP macro, which is turned off by a SH macro. X.SH DESCRIPTION XA description of the program/file/routine is given i.e how to use it etc. X.PP XPP macros are used like thus. X.SH BUGS XAny bugs, shortcomings and unavailable features of the program are listed. X.SH SPECIAL CONSIDERATIONS XThis section may be included if the program is dangerous, or does unobvious Xthings, and warns the user about these. X.SH FILES XAny files that are used, updated. X.SH SEE ALSO XRelated manuals are given. / Warren Toomey VK2XWT, electric guitar licker. Deep in the bowels of ADFA Comp Science. Canberra. ACT. 2600. Email: wkt@csadfa.oz.au `Worth the money but not the risk -CC'
jeff@questar.QUESTAR.MN.ORG (Jeff Holmes) (01/10/90)
Could some kind soul email me the nroff postings that appeared here a few days ago? Thanks much in advance! Jeff -- Jeff Holmes DOMAIN: jeff@questar.mn.org Questar Data Systems UUCP: amdahl!bungia!questar!jeff St. Paul, MN 55121 AT&T: +1 612 688 0089