File: README_c.tex

package info (click to toggle)
cxref 1.5c-9
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,504 kB
  • ctags: 1,359
  • sloc: ansic: 16,721; yacc: 1,930; sh: 722; lex: 416; makefile: 345; lisp: 256; python: 80; perl: 78
file content (303 lines) | stat: -rw-r--r-- 6,406 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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
% This LaTeX file generated by cxref
% cxref program (c) Andrew M. Bishop 1995,96,97,98,99.

% Cxref: /home/amb/cxref/cxref -O/home/amb/cxref/doc -NREADME -xref -latex2e -html32-src -rtf -sgml README.c
% CPP  : gcc -E -C -dD -dI

\markboth{File README.c}{File README.c}
\section{File README.c}
\label{file_README.c}

{\bf RCS Header: /home/amb/cxref/RCS/README.c 1.4 1997/05/26 11:23:40 amb Exp }

\smallskip

  A comment for the file, RCS header comments are treated specially when first.


\subsection*{Included Files}

 A \#include comment 

\smallskip
\begin{cxreftabi}
{\stt \#include <stdio.h>} &\\
\end{cxreftabi}

\medskip
 An alternative \#include comment. 

\smallskip
\begin{cxreftabi}
{\stt \#include <math.h>} &\\
\end{cxreftabi}


\subsection*{Preprocessor definitions}

 A \#define comment. 

\smallskip
{\stt \#define def1 1}

\medskip
 An alternative \#define comment. 

\smallskip
{\stt \#define def2 2}

\medskip
  A \#define with args

\smallskip
{\stt \#define def3( arg1, arg2 )}

\smallskip
\begin{cxrefarglist}
\cxrefargitem{arg1} The first arg
\cxrefargitem{arg2} The second arg
\end{cxrefarglist}

\medskip
 An alternative \#define with args. 

\smallskip
{\stt \#define def4( arg1, arg2 )}

\smallskip
\begin{cxrefarglist}
\cxrefargitem{arg1}  The first arg  
\cxrefargitem{arg2}  The second arg 
\end{cxrefarglist}


\subsection{Type definitions}


\subsubsection{Typedef type1}
\label{type_type1_README.c}

 An example typedef comment 

\smallskip
{\stt typedef enum \{...\} type1}

\smallskip
\begin{cxreftabiia}
\hspace*{0.0in}{\stt enum} &\\
\hspace*{0.1in}{\stt \{} &\\
\hspace*{0.2in}{\stt one;} &  one value  \\
\hspace*{0.2in}{\stt two;} &  another value  \\
\hspace*{0.1in}{\stt \}} &\\
\end{cxreftabiia}


\subsubsection{Type union bar}
\label{type_union_bar_README.c}

 Nested structs and unions also work. 

\smallskip
\smallskip
\begin{cxreftabiia}
\hspace*{0.0in}{\stt union bar} &\\
\hspace*{0.1in}{\stt \{} &\\
\hspace*{0.2in}{\stt char a;} &  Each element  \\
\hspace*{0.2in}{\stt int b;} &  of a struct  \\
\hspace*{0.2in}{\stt int c;} &  or a union  \\
\cxreftabbreak{cxreftabiia}
\hspace*{0.2in}{\stt long d;} &  can have a comment  \\
\hspace*{0.1in}{\stt \}} &\\
\end{cxreftabiia}


\subsubsection{Typedef type2}
\label{type_type2_README.c}

 Another example typedef comment,   a type that is a struct. 

\smallskip
{\stt typedef struct \{...\} type2}

\smallskip
\begin{cxreftabiia}
\hspace*{0.0in}{\stt struct} &\\
\hspace*{0.1in}{\stt \{} &\\
\hspace*{0.2in}{\stt int a;} &  A variable in a struct.  \\
\hspace*{0.2in}{\stt union bar} &\\
\hspace*{0.3in}{\stt \{} &\\
\hspace*{0.4in}{\stt char a;} &  Each element  \\
\cxreftabbreak{cxreftabiia}
\hspace*{0.4in}{\stt int b;} &  of a struct  \\
\hspace*{0.4in}{\stt int c;} &  or a union  \\
\hspace*{0.4in}{\stt long d;} &  can have a comment  \\
\hspace*{0.3in}{\stt \}} &\\
\hspace*{0.3in}{\stt e;} &  Nested structs and unions also work.  \\
\hspace*{0.1in}{\stt \}} &\\
\end{cxreftabiia}


\subsubsection{Typedef ptype2}
\label{type_ptype2_README.c}

 Another example typedef comment,   a pointer to a struct type. 

\smallskip
{\stt typedef struct \{...\}* ptype2}

\smallskip
\begin{cxreftabii}
See:& Typedef type2 & \cxreftype{type2}{README.c}\\
\end{cxreftabii}


\subsection{Variables}


\subsubsection{Variable var1}
\label{var_var1_README.c}

 A leading comment only. 

\smallskip
{\stt int var1}

\smallskip
\begin{cxreftabiii}
Visible in:\ & README.c & \ & \cxreffile{README.c}\\
Used in:\ & function1() & README.c & \cxreffunc{function1}{README.c}\\
\end{cxreftabiii}


\subsubsection{Variable var2}
\label{var_var2_README.c}

 A leading comment only. 

\smallskip
{\stt int var2}

\smallskip
\begin{cxreftabiii}
Visible in:\ & README.c & \ & \cxreffile{README.c}\\
\end{cxreftabiii}


\subsubsection{Variable var4}
\label{var_var4_README.c}

 A variable for   one thing. 

\smallskip
{\stt int var4}

\smallskip
\begin{cxreftabiii}
Visible in:\ & README.c & \ & \cxreffile{README.c}\\
Used in:\ & function1() & README.c & \cxreffunc{function1}{README.c}\\
\end{cxreftabiii}


\subsubsection{Variable var5}
\label{var_var5_README.c}

 A variable for   a second thing. 

\smallskip
{\stt int var5}

\smallskip
\begin{cxreftabiii}
Visible in:\ & README.c & \ & \cxreffile{README.c}\\
\end{cxreftabiii}


\subsubsection{Variable var6}
\label{var_var6_README.c}

 A variable for   a third thing. 

\smallskip
{\stt int var6}

\smallskip
\begin{cxreftabiii}
Visible in:\ & README.c & \ & \cxreffile{README.c}\\
\end{cxreftabiii}


\subsubsection{Local Variables}

{\bf var3}
\label{var_var3_README.c}

 A trailing comment only. 

\smallskip
{\stt static int var3}

\smallskip
\begin{cxreftabiii}
Used in:\ & function1() & \ & \cxreffunc{function1}{README.c}\\
\end{cxreftabiii}


\subsection{Functions}


\subsubsection{Global Function function1()}
\label{func_function1_README.c}

  A function comment (the comments for the args need to be separated by a blank line).

\smallskip
{\stt int function1 ( int arg1, int arg2 )}

\smallskip
\begin{cxrefarglist}
\cxrefargitem{int function1} The return value.
\cxrefargitem{int arg1} The first argument.
\cxrefargitem{int arg2} The second argument.
\end{cxrefarglist}

\smallskip
  Some more comments

 This comment is only visible in the \LaTeX output, and can contain \LaTeX markup.

 An internal comment in a function that appears as a
   new paragraph at the end of the comment. 

\smallskip
\begin{cxreftabiii}
Calls:\ & function2() & README.c & \cxreffunc{function2}{README.c}\\
Used in:\ & function2() & README.c & \cxreffunc{function2}{README.c}\\
Refs Var:\ & var1 & README.c & \cxrefvar{var1}{README.c}\\
\ & var3 & README.c & \cxrefvar{var3}{README.c}\\
\cxreftabbreak{cxreftabiii}
\ & var4 & README.c & \cxrefvar{var4}{README.c}\\
\end{cxreftabiii}


\subsubsection{Global Function function2()}
\label{func_function2_README.c}

 An alternative function comment 

\smallskip
{\stt int function2 ( int arg1, int arg2, void )}

\smallskip
\begin{cxrefarglist}
\cxrefargitem{int function2}  Returns a value 
\cxrefargitem{int arg1}  The first argument.  
\cxrefargitem{int arg2}  The second argument. 
\cxrefargitem{void} \ 
\end{cxrefarglist}

\smallskip
\begin{cxreftabiii}
Called by:\ & function1() & README.c & \cxreffunc{function1}{README.c}\\
Refs Func:\ & function1() & README.c & \cxreffunc{function1}{README.c}\\
\end{cxreftabiii}