File: defs.tex

package info (click to toggle)
oskit 0.97.20000202-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 58,008 kB
  • ctags: 172,612
  • sloc: ansic: 832,827; asm: 7,640; sh: 3,920; yacc: 3,664; perl: 1,457; lex: 427; makefile: 337; csh: 141; awk: 78
file content (278 lines) | stat: -rw-r--r-- 9,271 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
%
% Copyright (c) 1996-1999 University of Utah and the Flux Group.
% All rights reserved.
% 
% The University of Utah grants you the right to copy and reproduce this
% document or portions thereof for academic, research, evaluation, and
% personal use only, provided that (1) the title page appears prominently,
% and (2) these copyright and permission notices are retained in all copies.
% To arrange for alternate terms, contact the University of Utah at
% csl-dist@cs.utah.edu or +1-801-585-3271.
%
\usepackage{epsfig}
\usepackage{html}

\newcommand{\oskitversion}{0.97}

\title{{\tt D R A F T} \\[5ex]
The OSKit: The Flux Operating System Toolkit\\
Version \oskitversion\\
(SnapShot 990722)}

\author{The Flux Research Group \\[1ex]
	Department of Computer Science \\
	University of Utah \\[1ex]
	{\normalsize Salt Lake City, UT, USA 84112} \\[2ex]
	{\small	\em \htmladdnormallink{http://www.cs.utah.edu/flux/oskit/}%
		{http://www.cs.utah.edu/flux/oskit/}} \\
	{\small \em oskit@flux.cs.utah.edu}
}

\newcommand{\oskitcopyright}{%
Copyright \copyright\ 1996-1999, University of Utah.  All rights reserved.
The University of Utah grants you the right to copy and reproduce this
document or portions thereof for academic, research, evaluation, and
personal use only, provided that this title page appears prominently.
To arrange for alternate terms, contact the University at csl-dist@cs.utah.edu
or +1-801-585-3271.}

% We don't need no steenkin' equations - just gimme a working underscore!
\catcode`\_=\active 

\newcommand{\fluke}{Fluke}
\newcommand{\oskit}{OSKit}
\newcommand{\posix}{\textsc{posix}}
\newcommand{\freebsd}{FreeBSD}

\newcommand{\com}[1]{}
\newcommand{\rat}[1]{\footnote{{\bf Rationale:} #1} }
\newcommand{\xxx}[1]{{\em {\bf Fix: } #1}}

\setlength{\textheight}{9in}
\setlength{\textwidth}{6.5in}
\setlength{\topmargin}{-0.5in}
\setlength{\oddsidemargin}{0in}
\setlength{\evensidemargin}{0in}

\newcommand{\psfigure}[2]{
\begin{figure}
\epsfig{file=#1.eps}
\caption{\footnotesize #2}
\label{fig-#1}
\end{figure}
}

% simple, inline code fragment
% from Leigh
\latex{
  \newenvironment{codefrag}{
   \begin{trivlist}
   \leftskip .5in
   \item[]
   \begin{minipage}[c]{.9\linewidth}
  }{
    \end{minipage}
    \end{trivlist}}
}
\html{
  \newenvironment{codefrag}{}{}
}

% "Icons" flagging processor- and machine-dependent sections
\latex{
  \newcommand{\boxed}[1]{{~\vbox{\hrule\hbox{\vrule{\vbox{\vskip 1pt\hbox{%
  \hskip 1pt\rm\tiny\uppercase{#1}\hskip 1pt}\vskip 1pt}}\vrule}\hrule}~}}
  \newcommand{\pc}{\boxed{pc}}
  \newcommand{\intel}{\boxed{x86}}
  \newcommand{\intelpc}{\boxed{x86 pc}}
  \newcommand{\parisc}{\boxed{pa-risc}}
}
\html{
  \newcommand{\pc}{(PC)}
  \newcommand{\intel}{(X86)}
  \newcommand{\intelpc}{(X86 PC)}
  \newcommand{\parisc}{(PA-RISC)}
}

% Devices.
\def\ostodrv{\begin{apipart}{Direction}OS $\rightarrow$ Component\end{apipart}}
\def\drvtoosn{\begin{apipart}{Direction}Component $\rightarrow$ OS,
					Nonblocking\end{apipart}}
\def\drvtoosb{\begin{apipart}{Direction}Component $\rightarrow$ OS,
					Blocking\end{apipart}}
% Network.
\def\ostonet{\begin{apipart}{Direction}OS $\rightarrow$ 
			Network stack\end{apipart}}
\def\nettoos{\begin{apipart}{Direction}Network stack $\rightarrow$ 
			OS \end{apipart}}
% Filesystem.
\def\ostofs{\begin{apipart}{Direction}client OS $\rightarrow$ filesystem library\end{apipart}}
\def\fstoos{\begin{apipart}{Direction}filesystem library $\rightarrow$ client OS\end{apipart}}


% Macro to generate index entries in a typewriter font
\newcommand{\ttindex}[1]{\index{#1@{\texttt{#1}}}}

% C symbol definitions - leave the space after \bf,
% otherwise latex2html will screw it up.
\newcommand{\csymbol}[1]{{\large\bf #1}\ttindex{#1}}

% C function prototypes
% These sorta work with latex2html, funcproto args are just passed on as is.
\def\funcparamname[#1#2]{\if*#1{\tt *}\funcparamname[#2]\else{\em #1#2}\fi}
\def\funcparams[#1 #2, #3]{%
{\tt #1} \funcparamname[#2]%
\if!#3\else, \funcparams[#3]\fi}
\def\funcparamlistnonempty(#1){(\funcparams[#1, !])}
\def\funcparamlistvoid[#1(void)#2]{%
\if!#2\funcparamlistnonempty#1\else({\tt void})\fi}
\def\funcparamlist(#1){\funcparamlistvoid[(#1)(void)!]}
\def\funcproto#1 #2#3(#4);{%
\if*#2{\tt #1 #2}\csymbol{#3}\else{\tt #1} \csymbol{#2#3}\fi%
\funcparamlist(#4);}
\def\outparam{{\rm [out] }}
\def\inoutparam{{\rm [in/out] }}

% Lists of function definitions
% This won't work with latex2html.
\newenvironment{funcdefs}{\list{}{\def\makelabel##1{\funcproto##1}}\catcode`\_=\active}{\endlist}

% C structure declarations
\def\cstructelements[ #1 #2; /*#3*/#4]{\if!#3\else~&{\tt#1}&{\tt#2};&/* #3 &*/\\
	\cstructelements[#4]\fi}
\def\cstructhairy#1\{#2\};{\par\noindent{\tt struct }\csymbol{#1} \{\\
	\begin{tabular}{lllll}\cstructelements[#2 ; /*!*/]\end{tabular} \\ \}}
\latex{
	\newcommand{\cstruct}[2]{\cstructhairy #1\{#2\};}
}
\html{
	\newcommand{\cstruct}[2]{%
		\par\texttt{struct} \csymbol{#1} \{%
		\begin{rawhtml} <pre> \end{rawhtml}%
		#2%
		\begin{rawhtml} </pre> \end{rawhtml}%
		\}}
}

% Miscellaneous C stuff
\newcommand{\cinclude}[1]{\texttt{\#include $<$#1$>$}}
\latex{
	\newenvironment{csymlist}{\begin{list}{}{\def\makelabel##1{{\tt##1}\/:
		}}}{\end{list}}
	\newenvironment{icsymlist}{\begin{list}{}{\def
		\makelabel##1{\ttindex{##1}{\tt##1}\/:
		}}}{\end{list}}
}
\html{
	\newenvironment{csymlist}{\begin{description}}{\end{description}}
	\newenvironment{icsymlist}{\begin{description}}{\end{description}}
}

% API definitions and sections
\newcommand{\apisec}[1]{\newpage\section{#1}}
\newcommand{\apiintf}[2]{\newpage\section{{\tt #1}: #2}\ttindex{#1}}
% This works pretty well: gives a little extra space over just \subsection.
\newcommand{\api}[2]{\pagebreak[1]\subsection{{\tt #1}: #2}\ttindex{#1}}
\newenvironment{apipart}[1]{\subsubsection*{{\sc#1}} \begin{quote}}{\end{quote}}
\newenvironment{apisyn}{\begin{apipart}{Synopsis}}{\end{apipart}}
\newenvironment{apidesc}{\begin{apipart}{Description}}{\end{apipart}}
\latex{
	\newenvironment{apiparm}{\begin{apipart}{Parameters}
		\begin{list}{}{\def\makelabel##1{{\em##1}\/: }}}{
		\end{list}\end{apipart}}
}
\html{
	\newenvironment{apiparm}{\begin{apipart}{Parameters}\begin{description}}
	    {\end{description}\end{apipart}}
}
\newenvironment{apiret}{\begin{apipart}{Returns}}{\end{apipart}}
\newenvironment{apierr}{\begin{apipart}{Errors}}{\end{apipart}}
\newenvironment{apirel}{\begin{apipart}{Related Information}}{\end{apipart}}
\newenvironment{apidep}{\begin{apipart}{Dependencies}\begin{csymlist}}{
	\end{csymlist}\end{apipart}}

% Define a copyright environment that won't waste a lot of paper...
\latex{
	\newenvironment{copyrightEnv}%
		{\tt \obeylines \noindent \footnotesize \catcode`\&=11}%
		{\dotfill\vskip 6pt}
}
\html{
	%% Latex2html is a big piece of shit and it stinketh.
	%% I have to do this nonsense because the \begin{rawhtml}
	%% thing doesn't work here.
	%% So I have to run a script over the output and substitute
	%% <pre> </pre> for these.
	%% Also, I need to put a \end{rawhtml} here to keep it from
	%% complaining about the one above!
	\newenvironment{copyrightEnv}%
		{LATEX2HTML_SUCKS_MULES_PRE}%
		{LATEX2HTML_SUCKS_MULES_UNPRE}
}

% Redefine the "theindex" env so it makes a TOC entry.  This is verbatim from
% book.cls with one line added.
\makeatletter
\renewenvironment{theindex}
               {\if@twocolumn
                  \@restonecolfalse
                \else
                  \@restonecoltrue
                \fi
                \columnseprule \z@
                \columnsep 35\p@
                \twocolumn[\@makeschapterhead{\indexname}]%
                \addcontentsline{toc}{chapter}{\indexname}
                \@mkboth{\uppercase{\indexname}}%
                        {\uppercase{\indexname}}%
                \thispagestyle{plain}\parindent\z@
                \parskip\z@ \@plus .3\p@\relax
                \let\item\@idxitem}
               {\if@restonecol\onecolumn\else\clearpage\fi}
\makeatother

% Redefine \maketitle to put the copyright at the bottom.
% We only need this for the latex version,
% there are other hacks for the html one.
% This is almost verbatim from book.cls.
%
% We have to do this in a braindamaged fashion so it will work with
% stupid latex and its retarded cousin latex2html.
% latex2html doesn't really honor the \latex{...} construct which is supposed
% to throw its argument away.
% It does, however, grok \begin{latexonly}...\end{latexonly} but alas
% latex won't let you redefine a name in there since the \begin introduces
% a new scope.
\makeatletter
\latex{
  \newcommand{\fuckyou}{\begin{titlepage}%
  \let\footnotesize\small
  \let\footnoterule\relax
  \null\vfil
  \vskip 60\p@
  \begin{center}%
    {\LARGE \@title \par}%
    \vskip 3em%
    {\large
     \lineskip .75em%
      \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
      \vskip 1.5em%
    {\large \@date \par}%       % Set date in \large size.
  \end{center}\par
  \vfill			% <<< new
  \noindent\oskitcopyright	% <<< new
  \@thanks
  \vfil\null
  \end{titlepage}%
  \setcounter{footnote}{0}%
  \let\thanks\relax\let\maketitle\relax
  \gdef\@thanks{}\gdef\@author{}\gdef\@title{}}
}
\makeatother
\html{
  \newcommand{\fuckyou}{\maketitle}
}
\renewcommand{\maketitle}{\fuckyou}