1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 3.2//EN">
3 <!-- This HTML file generated by cxref. -->
4 <!-- cxref program (c) Andrew M. Bishop 1995,96,97,98,99. -->
7 Cxref: /home/amb/cxref/cxref -O/home/amb/cxref/doc -NREADME -xref -latex2e -html32-src -rtf -sgml README.c
8 CPP : /home/amb/cxref/cpp/cxref-cpp -cxref-cpp-defines /home/amb/cxref/cpp/cxref-cpp.defines -C -dD -dI
14 <TITLE>Source File README.c
</TITLE>
20 <a name=
"line1">1 |
</a> /*****************
21 <a name=
"line2">2 |
</a> $Header$
22 <a name=
"line3">3 |
</a>
23 <a name=
"line4">4 |
</a> A comment for the file, RCS header comments are treated specially when first.
24 <a name=
"line5">5 |
</a> *****************/
25 <a name=
"line6">6 |
</a>
26 <a name=
"line7">7 |
</a>
27 <a name=
"line8">8 |
</a>
28 <a name=
"line9">9 |
</a> /*+ A #include comment +*/
29 <a name=
"line10">10 |
</a> #include
<stdio.h
>
30 <a name=
"line11">11 |
</a>
31 <a name=
"line12">12 |
</a>
32 <a name=
"line13">13 |
</a> #include
<math.h
> /*+ An alternative #include comment. +*/
33 <a name=
"line14">14 |
</a>
34 <a name=
"line15">15 |
</a>
35 <a name=
"line16">16 |
</a> /*+ A #define comment. +*/
36 <a name=
"line17">17 |
</a> #define def1
1
37 <a name=
"line18">18 |
</a>
38 <a name=
"line19">19 |
</a>
39 <a name=
"line20">20 |
</a> #define def2
2 /*+ An alternative #define comment. +*/
40 <a name=
"line21">21 |
</a>
41 <a name=
"line22">22 |
</a>
42 <a name=
"line23">23 |
</a> /*+++++++++++
43 <a name=
"line24">24 |
</a> A #define with args
44 <a name=
"line25">25 |
</a>
45 <a name=
"line26">26 |
</a> arg1 The first arg
46 <a name=
"line27">27 |
</a>
47 <a name=
"line28">28 |
</a> arg2 The second arg
48 <a name=
"line29">29 |
</a> +++++++++++*/
49 <a name=
"line30">30 |
</a>
50 <a name=
"line31">31 |
</a> #define def3(arg1,arg2) (arg1+arg2)
51 <a name=
"line32">32 |
</a>
52 <a name=
"line33">33 |
</a>
53 <a name=
"line34">34 |
</a> /*+ An alternative #define with args. +*/
54 <a name=
"line35">35 |
</a>
55 <a name=
"line36">36 |
</a> #define def4(arg1 /*+ The first arg +*/, \
56 <a name=
"line37">37 |
</a> arg2 /*+ The second arg +*/) \
57 <a name=
"line38">38 |
</a> (arg1+arg2)
58 <a name=
"line39">39 |
</a>
59 <a name=
"line40">40 |
</a>
60 <a name=
"line41">41 |
</a> /*+ An example typedef comment +*/
61 <a name=
"line42">42 |
</a> typedef enum
62 <a name=
"line43">43 |
</a> {
63 <a name=
"line44">44 |
</a> one, /*+ one value +*/
64 <a name=
"line45">45 |
</a> two /*+ another value +*/
65 <a name=
"line46">46 |
</a> }
66 <a name=
"line47">47 |
</a> type1;
67 <a name=
"line48">48 |
</a>
68 <a name=
"line49">49 |
</a>
69 <a name=
"line50">50 |
</a> /*+ Another example typedef comment, +*/
70 <a name=
"line51">51 |
</a> typedef struct
71 <a name=
"line52">52 |
</a> {
72 <a name=
"line53">53 |
</a> int a; /*+ A variable in a struct. +*/
73 <a name=
"line54">54 |
</a> union bar
74 <a name=
"line55">55 |
</a> {
75 <a name=
"line56">56 |
</a> char a; /*+ Each element +*/
76 <a name=
"line57">57 |
</a> int b, /*+ of a struct +*/
77 <a name=
"line58">58 |
</a> c; /*+ or a union +*/
78 <a name=
"line59">59 |
</a> long d; /*+ can have a comment +*/
79 <a name=
"line60">60 |
</a> }
80 <a name=
"line61">61 |
</a> e; /*+ Nested structs and unions also work. +*/
81 <a name=
"line62">62 |
</a> }
82 <a name=
"line63">63 |
</a> type2, /*+ a type that is a struct. +*/
83 <a name=
"line64">64 |
</a> *ptype2; /*+ a pointer to a struct type. +*/
84 <a name=
"line65">65 |
</a>
85 <a name=
"line66">66 |
</a>
86 <a name=
"line67">67 |
</a> /*+ A leading comment only. +*/
87 <a name=
"line68">68 |
</a> int var1,var2;
88 <a name=
"line69">69 |
</a>
89 <a name=
"line70">70 |
</a>
90 <a name=
"line71">71 |
</a> static int var3; /*+ A trailing comment only. +*/
91 <a name=
"line72">72 |
</a>
92 <a name=
"line73">73 |
</a>
93 <a name=
"line74">74 |
</a> /*+ A variable for +*/
94 <a name=
"line75">75 |
</a> int var4, /*+ one thing. +*/
95 <a name=
"line76">76 |
</a> var5, /*+ a second thing. +*/
96 <a name=
"line77">77 |
</a> var6; /*+ a third thing. +*/
97 <a name=
"line78">78 |
</a>
98 <a name=
"line79">79 |
</a> /* Note: The leading comment is combined with each of the trailing comments. */
99 <a name=
"line80">80 |
</a> /* Note: the push through of the comment above on the ',' and ';', see README. */
100 <a name=
"line81">81 |
</a>
101 <a name=
"line82">82 |
</a>
102 <a name=
"line83">83 |
</a> /*+++++++++++
103 <a name=
"line84">84 |
</a> A function comment (the comments for the args need to be separated by a blank line).
104 <a name=
"line85">85 |
</a>
105 <a name=
"line86">86 |
</a> int function1 The return value.
106 <a name=
"line87">87 |
</a>
107 <a name=
"line88">88 |
</a> int arg1 The first argument.
108 <a name=
"line89">89 |
</a>
109 <a name=
"line90">90 |
</a> int arg2 The second argument.
110 <a name=
"line91">91 |
</a>
111 <a name=
"line92">92 |
</a> Some more comments
112 <a name=
"line93">93 |
</a>
113 <a name=
"line94">94 |
</a> +none+ Note: this line and the two below are processed specially.
114 <a name=
"line95">95 |
</a> +html+ This comment is only visible in the HTML output, and can contain HTML markup.
115 <a name=
"line96">96 |
</a> +latex+ This comment is only visible in the \LaTeX output, and can contain \LaTeX markup.
116 <a name=
"line97">97 |
</a> +++++++++++*/
117 <a name=
"line98">98 |
</a>
118 <a name=
"line99">99 |
</a> int function1(int arg1,int arg2)
119 <a name=
"line100">100 |
</a> {
120 <a name=
"line101">101 |
</a> /*+ An internal comment in a function that appears as a
121 <a name=
"line102">102 |
</a> new paragraph at the end of the comment. +*/
122 <a name=
"line103">103 |
</a>
123 <a name=
"line104">104 |
</a> var1=
0;
124 <a name=
"line105">105 |
</a>
125 <a name=
"line106">106 |
</a> function2(var3,var4);
126 <a name=
"line107">107 |
</a> }
127 <a name=
"line108">108 |
</a>
128 <a name=
"line109">109 |
</a>
129 <a name=
"line110">110 |
</a> /*+ An alternative function comment +*/
130 <a name=
"line111">111 |
</a>
131 <a name=
"line112">112 |
</a> int function2(int arg1, /*+ The first argument. +*/
132 <a name=
"line113">113 |
</a> int arg2) /*+ The second argument. +*/
133 <a name=
"line114">114 |
</a> /*+ Returns a value +*/
134 <a name=
"line115">115 |
</a> {
135 <a name=
"line116">116 |
</a> int (*funcp)()=
&function1;
136 <a name=
"line117">117 |
</a> }
137 <a name=
"line118">118 |
</a>
138 <a name=
"line119">119 |
</a> /* Note: the push through of the comment above on the ',' and ')', see README. */