Dec 072017
C Users Group - Vol. 150.
File CUG150.ZIP from The Programmer’s Corner in
Category C Source Code
C Users Group – Vol. 150.
File Name File Size Zip Size Zip Type
AFT8087.MAC 3456 1334 deflated
BIOS.MAC 9088 2103 deflated
CLINK.ASM 3584 1337 deflated
CLINK.COM 256 187 deflated
DOS.MAC 11904 2735 deflated
HEADER.CUG 11776 2570 deflated
HP.C 3072 1177 deflated
LDIR.C 12032 4367 deflated
LDIR.EXE 14080 7592 deflated
LTYPE.C 4352 1695 deflated
LTYPE.EXE 12800 6627 deflated
ROFF.DOC 7296 2920 deflated
ROFF.EXE 18688 9073 deflated
ROFF.H 3200 1295 deflated
ROFF.HE 3456 1297 deflated
ROFF1.C 12672 4124 deflated
ROFF2.C 10752 3194 deflated
TRAN.C 1920 832 deflated
XENIX.ASM 7296 2768 deflated

Download File CUG150.ZIP Here

Contents of the ROFF.DOC file

August 28, 1982 /* Modified for IBM PC by MSZachmann */
May 7, 1981


This version of ROFF, based on the formatter in Kernighan
and Plauger's book SOFTWARE TOOLS, is written in BDS C, and employs
the directed i/o functions that go along with that package. Well,
half of the directed I/O anyway - it doesn't use redirected input
because I wanted to be able to format more than one file at a run.
Please ignore any "odd" comments to myself in ROFF1.C and ROFF2.C;
I tried to find them all but there may be a few extra silly remarks

For more details on the directed I/O (NDIO in our version)
see NDIO.C

Sample calls:

A> roff filename

This will send the formatted output to the Console (display)

A> roff >filename2 filename

This will send the formatted output to filename2

A> roff >PRN: filename

This will send the formatted output to the printer.

Using ROFF, you can make nice printouts of a file, with as
little or as much help from the program as you want, depending on the
commands. There are default values for all parameters, so if you
don't put any commands in at all, your file will come out with filled,
right-justified lines. The default line-length is 80 characters;
the default page-length is 66 lines per page. "Filled lines" means
that as many input words as possible are packed onto a line before it
is printed; "non-filled" lines go through the formatter w/o
rearrangement. "Right-justified" simply means that spaces are added
between words to make all the right margins line up nicely.
To set a parameter, use the appropriate commands below. All
commands have the form of a period followed by two letters. A command
line should have nothing on it but the command and its arguments (if
any); any text would be lost.

A command argument can be either ABSOLUTE or RELATIVE :

.in5sets the indent value to 5 spaces

.in+5sets the indent value to the CURRENT value plus 5

.ls -1sets the line spacing value to the current value
minus one

Also, all commands have a minimum and maximum value that will
weed out any odd command settings (like setting the line spacing to
zero, for example. It won't let you do that, but it could be changed
if you REALLY have a burning desire to do so).

Some commands cause a "break", which is noted in the table
below. Before such a command goes into effect, the current line of
text is put out, whether it is completely filled or not. (this is
what happens at the end of a paragraph, for example.) A line
beginning with spaces or a tab will cause a break, and will be
indented by that many spaces (or tabs) regardless of the indent value
at that time (this is a "temporary indent", which can also be set
explicitly). An all blank line also causes a break. If you find that
seem to have some lines that are indented strangely, and it's not
obvious WHY, look at which commands are causing a break, and which
aren't. For instance:

.ti 0
this is a line of text
.in 8
<- blank line
more text for the machine to play with

At first glance it seems obvious that the line "this is a line of text"
will be indented zero spaces, but it won't - it will be indented 8.
The indent command does NOT cause a break (although the .ti does)
so it will not cause the line to be put out before setting the indent
value to 8. Then, when the blank line is encountered, it will cause
a break - and "this is a line of text" will be indented incorrectly.

*********************** Table of Commands *****************************

Command Break?DefaultFunction
------- ------ ------- ---------
.bp nyesn = +1begin page numbered n

.bryescause a break

.ce nyesn = 1center next n lines

.fiyesstart filling lines

.fo stringnoemptysets footer to string

.he stringnoemptysets header to string

.in nnon = 0sets indent value to n

.ls nnon = 1sets line spacing to n

.m1non = 2sets topmost margin to n

.m2non = 2sets 2nd top margin to n lines

.m3no n = 21st bottom margin to n lines

.m4non = 2bottom-most margin to n lines

.nfyesstop filling lines

.pl nno n = 66sets page length to n

.rm nnon = 80sets right margin to n

.sp nyesn = 1space down n lines

.ti nyesn = 0sets temporary indent of n

.ul nnon = 1underline next n lines


Here's what the page parameters look like:

||top margin - (includes header)|
||top margin 2|
E|:lots and lots of silly text and:|
L|:other garbage. Get the picture?:|
E| :This is a temp. indentation:|
G|:right margin -> 😐
||margin 3|
||margin 4 - (includes footer)|

To change the default for any parameter, simply alter ROFFGLOB
recompile ROFF1.c and ROFF2.c, and re-clink them with NDIO.CRL
(you can use DIO.CRL, but it doesn't have all the features of

A Few Extra Comments on Some of the Commands:

If you want to center lots of lines, but don't
want to count them, do something like this:

lots and
lots of words to
be centered
.ce 0


To underline a few words on a line:

of the words in
sentence are


Some of the words in this sentence are underlined.
---- ---- -----------

(obviously you don't have to turn the fill on and off if it's
already on )


A new paragrah may be caused by using the temporary indent
command, like

.ti +5

or by simply beginning the paragraph with a tab, as you would if
you were just typing.


Headers and Footers.

A page number can be incorporated into any header or
footer by putting a "#" in the title where you want the number
to go:

.heThis is a witty header title for page #

Each time this is printed at the top of a page, the current
page number will be substituted for the "#".

If you want to send the output to a file, and don't want the page
breaks in there ( that's what I did for this ) set margins 1-4 to
tFv0=>utF0=>vuFdFv0Ft)@^0%uF=}[email protected]

 December 7, 2017  Add comments

Leave a Reply