Debian Codegraph @

developer/implement_style.html

raw symbols SCIP
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
2 "http://www.w3.org/TR/REC-html40/loose.dtd">
3
4 <HTML>
5 <!--
6 ***********************************************************************
7 FUNNELWEB MANUAL WEB PAGE
8 =========================
9 Copyright (c) Ross N. Williams 1992,1999. All rights reserved.
10
11 Permission is granted to redistribute and use this manual in
12 any medium, with or without modification, provided that all
13 notices (including, without limitation, the copyright
14 notice, this permission notice, any record of modification,
15 and all legal notices) are preserved on all copies, that all
16 modifications are clearly marked, and that modified versions
17 are not represented as the original version unless all the
18 modifications since the manual's original release by Ross N.
19 Williams (www.ross.net) consist of translations or other
20 transformations that alter only the manual's form, not its
21 content. THIS MANUAL IS PROVIDED "AS IS" AND WITHOUT ANY
22 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
23 LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND
24 FITNESS FOR A PARTICULAR PURPOSE. TO THE EXTENT PERMITTED BY
25 LAW THERE IS ABSOLUTELY NO WARRANTY.
26
27 ***********************************************************************
28 -->
29
30 <HEAD>
31 <TITLE>3.3 Coding Style</TITLE>
32 <STYLE TYPE="text/css"> <!-- A {text-decoration: none} // --> </STYLE>
33 </HEAD>
34 <BODY BACKGROUND="binary/background.gif"
35 BGCOLOR="#FFFFFF"
36 TEXT="#000000"
37 VLINK="#660000"
38 LINK="#FF0000"
39 ALINK="#CC0000">
40
41 <TABLE WIDTH="490">
42 <TR>
43 <TD WIDTH="130" VALIGN="top">
44 <IMG SRC="binary/d_clear.gif" ALT="" WIDTH="130" HEIGHT="1"><BR>
45
46 <FONT SIZE="2">
47 <BR>
48
49 <A HREF="http://www.ross.net/"
50 TARGET="rosshome"
51 onClick="window.open('','rosshome','location,status,menubar,scrollbars,resizable',false).focus(); return true;"
52 >
53 <IMG SRC="binary/rossnet_logo.gif"
54 WIDTH="64" HEIGHT="32"
55 BORDER="0" ALT="RossNet"
56 HSPACE="0" VSPACE="1"></A><BR>
57 <BR>
58
59 <A HREF="../index.shtml"
60 TARGET="funnelweb"
61 onClick="window.open('','funnelweb','location,status,menubar,scrollbars,resizable',false).focus(); return true;"
62 >
63 <IMG SRC="binary/linklogo.gif"
64 WIDTH="64" HEIGHT="32"
65 BORDER="0" ALT="FunnelWeb"
66 HSPACE="0" VSPACE="1"></A><BR>
67 <BR>
68 <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD BGCOLOR="#000000">
69 <A HREF="../reference/index.html"
70 TARGET="funnelwebreference"
71 onClick="window.open('','funnelwebreference','location,status,menubar,scrollbars,resizable',false).focus(); return true;"
72 ><FONT COLOR="#FFFFFF"><B>Reference</B></FONT></A><BR>
73 <BR>
74 <A HREF="../tutorial/index.html"
75 TARGET="funnelwebtutorial"
76 onClick="window.open('','funnelwebtutorial','location,status,menubar,scrollbars,resizable',false).focus(); return true;"
77 ><FONT COLOR="#FFFFFF"><B>Tutorial</B></FONT></A><BR>
78 <BR>
79 <A HREF="index.html"><FONT COLOR="#FFFFFF"><B>Developer</B></FONT></A><BR>
80 <A HREF="compile.html"><FONT COLOR="#FFFFFF">1 Compile</FONT></A><BR>
81 <A HREF="design.html"><FONT COLOR="#FFFFFF">2 Design</FONT></A><BR>
82 <A HREF="implement.html"><FONT COLOR="#FFFFFF">3 Implement</FONT></A><BR>
83 <A HREF="modify.html"><FONT COLOR="#FFFFFF">4 Modify</FONT></A><BR>
84 <A HREF="misc.html"><FONT COLOR="#FFFFFF">5 Misc</FONT></A><BR>
85 <A HREF="gpl.html"><FONT COLOR="#FFFFFF">6 Licence</FONT></A><BR>
86
87 <BR>
88 <A HREF="search.html"><FONT COLOR="#FFFFFF"><B>SEARCH</B></FONT></A><BR>
89 </FONT>
90 </TD></TR></TABLE>
91
92
93 </TD>
94 <TD WIDTH="360" VALIGN="top">
95 <FONT SIZE="3">
96
97
98 <A HREF="index.html"><IMG SRC="binary/title.gif"
99 WIDTH="316" HEIGHT="24"
100 BORDER="0" ALT="FunnelWeb Developer Manual"
101 HSPACE="0" VSPACE="0"></A>
102 <P><FONT SIZE="5">3.3 Coding Style</FONT><BR>
103
104
105
106 <P>Although FunnelWeb wasn't coded under any formal C
107 coding standard, it was coded in accordance with a fairly
108 strict personal style of C which developed during the
109 development of FunnelWeb. This section aims to describe some
110 of the more important elements of the coding style.
111
112 <P><B>Portability:</B> This was a major
113 goal of the FunnelWeb implementation. Two excellent books
114 guided this move to portability. They were
115 <STRONG>[Rabinowitz90]</STRONG> (which deals with C code itself)
116 and <STRONG>[Horton90]</STRONG> (which deals with the portability
117 of various library calls). Other works such as
118 <STRONG>[Kernighan88]</STRONG> and <STRONG>[ANSI]</STRONG> were also
119 helpful.
120
121 <P><B>Identifiers:</B>
122 <STRONG>[Rabinowitz90]</STRONG>
123 specifies that for wide portability, identifiers of block
124 and file scope should be unique to eight characters, and
125 identifiers of program scope should be unique to six
126 characters. I have gone further in FunnelWeb and actually
127 made these restrictions actual limits on identifier length.
128
129 <P>Because names must be so short, a system of
130 abbreviations was developed to organize the identifiers used
131 within FunnelWeb. Each abbreviation consists of a letter
132 pair. Here are most of the abbreviations
133 used:
134
135 <P>
136 <PRE>
137 bp - Body Part.
138 cm - Compare. Used to prefix comparison
139 routines that return [-1,0,1].
140 dc - Document component.
141 dm - Dump package.
142 el - Element.
143 eq - Equal. Used to prefix comparison
144 routines that return a boolean.
145 ex - Expression.
146 f - Global files.
147 ll - List of lists.
148 ln - Line record.
149 ls - List Package.
150 lr - Lister package.
151 ma - Macro.
152 mc - Macro Call.
153 mn - Macro Name.
154 op - Options package.
155 pr - Parser.
156 ps - Position record.
157 sc - Scrap record.
158 sn - Section.
159 tb - Table package.
160 ty - Typesetter directive.
161 wf - Write file package.
162 wl - Write with EOL (misc.c).
163 wr - Write (misc.c).
164 </PRE>
165
166 <P><B>Pointers:</B> Variables or types denoting
167 pointers start with "<TT>p_</TT>".
168
169 <P><B>Types:</B> Names denoting types end in
170 "<TT>_t</TT>". Thus, a type for a pointer to a table would
171 be named <SAMP>p_tb_t</SAMP>.
172
173 <P><B>File names:</B> All FunnelWeb source
174 files have file
175 names that are from one to eight characters long and file
176 extensions that are from one to three characters long. This
177 ensures that the FunnelWeb source code can be portably moved
178 to all kinds of machines, including MSDOS!
179
180
181 <P>
182 <TABLE WIDTH="100%">
183 <TR>
184 <TD ALIGN="left" VALIGN="bottom"><A HREF="implement_self.html"><IMG SRC="binary/fw_left.gif" HEIGHT="32" WIDTH="32" BORDER="0" ALT="Prev"></A></TD>
185 <TD ALIGN="center" VALIGN="bottom"><A HREF="implement.html"><IMG SRC="binary/fw_up.gif" HEIGHT="32" WIDTH="32" BORDER="0" ALT="Up"></A></TD>
186 <TD ALIGN="right" VALIGN="bottom"><A HREF="implement_memory.html"><IMG SRC="binary/fw_right.gif" HEIGHT="32" WIDTH="32" BORDER="0" ALT="Next"></A></TD>
187 </TR>
188 </TABLE>
189
190
191
192 <P>
193 <HR>
194 <FONT SIZE="2">
195 <A HREF="mailto:[email protected]">Webmaster</A>&nbsp;&nbsp;&nbsp;
196 <A HREF="copyright.html">Copyright &copy; Ross N. Williams 1992,1999. All rights reserved.</A><BR>
197 </FONT>
198
199 </FONT>
200 </TD>
201 </TR>
202 </TABLE>
203
204
205 </BODY>
206
207 <!-- *********************************************************************** -->
208 <!-- End Of A FunnelWeb Manual Web Page (www.ross.net/funnelweb/) -->
209 <!-- *********************************************************************** -->
210
211 </HTML>