[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / CONTRIB / pphs / docs / Code.tex
1 \chapter{Project code}
2
3 \section{The program code - {\tt pphs.c}} \label{prog-code}
4
5 \newpage                    % 8 pages of code a2ps (21.4.94)
6 \setcounter{page}{50}
7
8 \section{The style file - {\tt pphs.sty}} \label{style-code}
9
10 \begin{verbatim}
11 % =========================================
12 % Definitions for use with the pphs program
13 % =========================================
14
15 \typeout{For use with the pphs program}
16
17 % Definitions of commands used by pphs
18
19 \newbox\foo
20 \def\skipover#1{\setbox\foo\hbox{#1}\hskip\wd\foo}
21 \def\plusplus{\hbox{$+\mkern-7.5mu+$}}
22 \def\xspa#1{\hskip#1ex}
23 \def\bareq{\setbox\foo\hbox{$=$}\makebox[\wd\foo]{$|$}}
24
25 % User-redefinable commands - typefaces
26
27 \def\keyword{\bf}
28 \def\iden{\it}
29 \def\stri{\rm}
30 \def\com{\rm}
31 \def\numb{\rm}
32
33 % User-redefinable commands - quote marks
34
35 \def\forquo{\hbox{\rm '}}
36 \def\escquo{\hbox{\rm '}}
37 \end{verbatim}
38
39 \section{The make file - {\tt Makefile}} \label{make-code}
40
41 \begin{verbatim}
42 # Makefile for A Preece's program... etc.
43
44 default:
45         @echo "Type make pphs to create the program."
46
47 pphs: pphs.c
48         cc -o pphs pphs.c
49
50 test: pphs
51         pphs test
52         latex test.tex
53 \end{verbatim}