httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r816210 - in /websites/staging/httpd/trunk/content: ./ dev/styleguide.html
Date Mon, 07 May 2012 00:19:38 GMT
Author: buildbot
Date: Mon May  7 00:19:37 2012
New Revision: 816210

Log:
Staging update by buildbot for httpd

Modified:
    websites/staging/httpd/trunk/content/   (props changed)
    websites/staging/httpd/trunk/content/dev/styleguide.html

Propchange: websites/staging/httpd/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon May  7 00:19:37 2012
@@ -1 +1 @@
-1334838
+1334842

Modified: websites/staging/httpd/trunk/content/dev/styleguide.html
==============================================================================
--- websites/staging/httpd/trunk/content/dev/styleguide.html (original)
+++ websites/staging/httpd/trunk/content/dev/styleguide.html Mon May  7 00:19:37 2012
@@ -172,15 +172,17 @@ of code.</li>
 
 
 <ol>
-<li>
-<p><strong>Function Declaration and Layout</strong> 
-Functions are laid out as follows:</p>
-<p>int main(int argc, char **argv)
-{
-    code;
-}</p>
-</li>
+<li><strong>Function Declaration and Layout</strong> 
+Functions are laid out as follows:</li>
 </ol>
+<p>Example:</p>
+<div class="codehilite"><pre><span class="nb">int</span> <span
class="n">main</span><span class="p">(</span><span class="nb">int</span>
<span class="n">argc</span><span class="p">,</span> <span class="n">char</span>
<span class="o">**</span><span class="n">argv</span><span class="p">)</span>
+<span class="p">{</span>
+    <span class="n">code</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+
+
 <p>The return type is placed on the same line as the function. Arguments (if
 any) are given in ANSI style. If no arguments, declare function
 as <code>void</code>. No space between function name and opening bracket,
@@ -191,29 +193,33 @@ closing brace is indented to line up wit
 section on indenting<A HREF="#long-exps">long declarations and
 invocations</A>.</strong> </p>
 <ol>
-<li>
-<p><strong>Function Calls</strong> 
+<li><strong>Function Calls</strong> 
 Space after commas in function calls. No space between function name and
-opening bracket.</p>
-<p>f(a, b);</p>
-</li>
+opening bracket.</li>
 </ol>
+<p>Example:</p>
+<div class="codehilite"><pre><span class="n">f</span><span class="p">(</span><span
class="n">a</span><span class="p">,</span> <span class="n">b</span><span
class="p">);</span>
+</pre></div>
+
+
 <p><strong>Also see the section on indenting<A HREF="#long-exps">long declarations
 and invocations</A>.</strong> </p>
 <ol>
-<li>
-<p><strong>Flow-Control Layout</strong> 
+<li><strong>Flow-Control Layout</strong> 
 Flow-control statements
 (<code>if</code>, <code>while</code>, <code>for</code>,
<em>etc.</em>) are
-laid out as in this example:</p>
-<p>if (expr) {
-    code;
-}
-else {
-    code;
-}</p>
-</li>
+laid out as in this</li>
 </ol>
+<p>Example:</p>
+<div class="codehilite"><pre><span class="k">if</span> <span class="p">(</span><span
class="n">expr</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">code</span><span class="p">;</span>
+<span class="p">}</span>
+<span class="k">else</span> <span class="p">{</span>
+    <span class="n">code</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+
+
 <p>There is a space between the keyword and the opening bracket. Opening brace
 placed on same line as the flow keyword. The code itself is indented by
 four spaces. The closing brace is indented to line up with the opening
@@ -222,40 +228,48 @@ placed on the line following the closing
 with the corresponding <code>if</code>. <strong>Also see the section on
 indenting<A HREF="#long-exps">long expressions</A>.</strong> </p>
 <ol>
-<li>
-<p><strong><code>for</code> Layout</strong> 
-Space after the semi-colons. Example:</p>
-<p>for (a; b; c)</p>
-</li>
-<li>
-<p><strong><code>switch</code> Layout</strong> 
+<li><strong><code>for</code> Layout</strong> 
+Space after the semi-colons.</li>
+</ol>
+<p>Example:</p>
+<div class="codehilite"><pre><span class="k">for</span> <span
class="p">(</span><span class="n">a</span><span class="p">;</span>
<span class="n">b</span><span class="p">;</span> <span class="n">c</span><span
class="p">)</span>
+</pre></div>
+
+
+<ol>
+<li><strong><code>switch</code> Layout</strong> 
 <code>case</code> lines within a <code>switch()</code> are indented
to same
 level as the switch statement itself. The code for each case is indented by
-four spaces. Braces are laid out as for other control-flow keywords.
-Example:</p>
-<p>switch (x) {
-case a:
-    code;
-case b:
-    code;
-}</p>
-</li>
-<li>
-<p><strong>Expressions</strong> 
+four spaces. Braces are laid out as for other control-flow keywords.</li>
+</ol>
+<p>Example:</p>
+<div class="codehilite"><pre><span class="n">switch</span> <span
class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="p">{</span>
+<span class="k">case</span> <span class="n">a:</span>
+    <span class="n">code</span><span class="p">;</span>
+<span class="k">case</span> <span class="n">b:</span>
+    <span class="n">code</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<ol>
+<li><strong>Expressions</strong> 
 Space before and after assignment and other and operators. No space between
-unary operators (increment, decrement, and negation) and the lvalue.
-Examples:</p>
-<p>a = b
-a + b
-a &lt; b
-a = -b
-a = !b
-++a</p>
-</li>
-<li>
-<p><strong>Capitalisation of Enums</strong> 
-No rule.</p>
-</li>
+unary operators (increment, decrement, and negation) and the lvalue.</li>
+</ol>
+<p>Examples:</p>
+<div class="codehilite"><pre><span class="n">a</span> <span class="o">=</span>
<span class="n">b</span>
+<span class="n">a</span> <span class="o">+</span> <span class="n">b</span>
+<span class="n">a</span> <span class="o">&amp;</span><span
class="ow">lt</span><span class="p">;</span> <span class="n">b</span>
+<span class="n">a</span> <span class="o">=</span> <span class="o">-</span><span
class="n">b</span>
+<span class="n">a</span> <span class="o">=</span> <span class="o">!</span><span
class="n">b</span>
+<span class="o">++</span><span class="n">a</span>
+</pre></div>
+
+
+<ol>
+<li><strong>Capitalisation of Enums</strong> 
+No rule.</li>
 </ol>
             
 



Mime
View raw message