Category : C Source Code
Archive   : CUG236A.ZIP
Filename : CB.DOC

 
Output of file : CB.DOC contained in archive : CUG236A.ZIP
/*
HEADER: CUG236;
TITLE: C Source Formatter Manual Page;
DATE: 04/04/1987;
VERSION: 2.1;
FILENAME: CB.DOC;
SEE-ALSO: CB.C;
AUTHORS: W. C. Colley III, J. W. Kindschi Jr.;
*/

"C" Source Formatter 'Pretty Printer'


DESCRIPTION:

This program takes as input a "C" source program file and

formats it with the proper indents for each statement. The

formatted output is placed in a specified file, or by

default, to the standard output.

INVOCATION:

CB inputfile { outputfile }

inputfile Input "C" source program. This file should
be a file that has compiled error free, as
the formatter is not smart enough to pick up
syntax errors.

outputfile This is the formatted output file. If this
argument is omitted, the formatted output
goes to the standard output stream.

HELP:

Typing CB with no file name displays a short help reminder.

EXAMPLE:

Run CB on file test, send the output to stdout:

CB TEST


*** ***

#include "stdio.h"
double ran()
/* Generate a random number between 0.0 and 1.0 */
{
double r;
static unsigned int seed = 0;
struct regval {
int ax,bx,cx,dx,si,di,ds,es;
};
struct regval regs;

if (seed==0) {
regs.ax = 0x2C00; /* Set up the function */
sysint(0x21,®s,®s);
seed = regs.dx;
}
r = seed / 65536.;
seed = (25173 * seed + 13849) % 65536;
return(r);
}


*** ***

#include "stdio.h"
double ran()
/* Generate a random number between 0.0 and 1.0 */
{
double r;
static unsigned int seed = 0;
struct regval {
int ax,bx,cx,dx,si,di,ds,es;
};
struct regval regs;

if (seed==0) {
regs.ax = 0x2C00; /* Set up the function */
sysint(0x21,®s,®s);
seed = regs.dx;
}
r = seed / 65536.;
seed = (25173 * seed + 13849) % 65536;
}


  3 Responses to “Category : C Source Code
Archive   : CUG236A.ZIP
Filename : CB.DOC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. 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/