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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Rules of the Code</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<meta name="description" content="Coding conventions for xmlroff code">
<link rel="start" href="index.html" title="xmlroff Reference Manual">
<link rel="up" href="developers.html" title="Developers' Guide">
<link rel="prev" href="developers.html" title="Developers' Guide">
<link rel="next" href="directory-structure.html" title="Directory Structure">
<meta name="generator" content="GTK-Doc V1.10 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="users.html" title="Users' Guide">
<link rel="chapter" href="developers.html" title="Developers' Guide">
<link rel="chapter" href="object-hierarchy.html" title="Object Hierarchy">
<link rel="chapter" href="object.html" title="FoObject is wonderful">
<link rel="chapter" href="node.html" title="FoNode is wonderful">
<link rel="chapter" href="interfaces.html" title="Interfaces are truly wonderful">
<link rel="chapter" href="formatting-objects.html" title="Formatting Objects are truly wonderful">
<link rel="chapter" href="properties.html" title="Properties">
<link rel="chapter" href="areas.html" title="Area Objects">
<link rel="chapter" href="datatypes.html" title="Datatype Objects">
<link rel="chapter" href="context.html" title="Property Context Object">
<link rel="chapter" href="other-objects.html" title="Other Objects">
<link rel="chapter" href="utility-objects.html" title="Utility Objects">
<link rel="chapter" href="utility-modules.html" title="Utility Modules">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
<td><a accesskey="p" href="developers.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="developers.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">xmlroff Reference Manual</th>
<td><a accesskey="n" href="directory-structure.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
<div class="section" lang="en">
<div class="titlepage"><div>
<div><h2 class="title" style="clear: both">
<a name="xmlroff-code-rules"></a>Rules of the Code</h2></div>
<div><h2 class="subtitle">xmlroff Code Rules</h2></div>
<div><div class="abstract">
<p class="title"><b>Abstract</b></p>
<p>Coding conventions for xmlroff code</p>
</div></div>
</div></div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="abbreviations"></a>Abbreviations</h3></div></div></div>
<p>
The following abbreviations are used in file, variable, function, and
parameter names.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
Formatting Object and property names are <span class="emphasis"><em>NOT</em></span> abbreviated
when used in class and property names. For example,
“block-progression-dimension” is abbreviated to
“bpdim” in function names, but when used as a property
name (in the GObject sense), it remains
“block-progression-dimension”
</p>
</div>
<div class="informaltable"><table border="1">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>Abbreviation</th>
<th>Term</th>
</tr></thead>
<tbody>
<tr>
<td>bp</td>
<td>block-progression</td>
</tr>
<tr>
<td>bpd</td>
<td>block-progression-direction</td>
</tr>
<tr>
<td>bpdim</td>
<td>block-progression-dimension</td>
</tr>
<tr>
<td>cond</td>
<td>conditional</td>
</tr>
<tr>
<td>condity</td>
<td>conditionality</td>
</tr>
<tr>
<td>expr</td>
<td>expression</td>
</tr>
<tr>
<td>ip</td>
<td>inline-progression</td>
</tr>
<tr>
<td>ipd</td>
<td>inline-progression-direction</td>
</tr>
<tr>
<td>ipdim</td>
<td>inline-progression-dimension</td>
</tr>
</tbody>
</table></div>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="compare-pointers-to-null"></a>Compare pointers to NULL</h3></div></div></div>
<p>
From Section 17.1, Boolean Expressions, of “Code Complete”
by Steve McConnell.
</p>
<p>For pointers, write:
</p>
<pre class="programlisting">while (buffer != NULL) ...</pre>
<p>
rather than
</p>
<pre class="programlisting">while (buffer) ...</pre>
<p>
</p>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.10</div>
</body>
</html>
|