You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by li...@apache.org on 2005/10/11 20:37:01 UTC
svn commit: r312934 -
/webservices/axis2/trunk/c/xdocs/axis2_coding_convention.html
Author: lilantha
Date: Tue Oct 11 11:36:55 2005
New Revision: 312934
URL: http://svn.apache.org/viewcvs?rev=312934&view=rev
Log:
Few minor changes
Modified:
webservices/axis2/trunk/c/xdocs/axis2_coding_convention.html
Modified: webservices/axis2/trunk/c/xdocs/axis2_coding_convention.html
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/xdocs/axis2_coding_convention.html?rev=312934&r1=312933&r2=312934&view=diff
==============================================================================
--- webservices/axis2/trunk/c/xdocs/axis2_coding_convention.html (original)
+++ webservices/axis2/trunk/c/xdocs/axis2_coding_convention.html Tue Oct 11 11:36:55 2005
@@ -23,14 +23,15 @@
<h3> 1.1 Variables</h3>
-<p>Use meaningful nouns. Use all lower case letters. If it is a local
-variable or a member of a struct, no need to prefix it with axis2_</p>
+<p>Use meaningful nouns. Use all lower case letters for private & public variables.
+Use uppercase names for constant. If it is a local variable or a member of a struct,
+no need to prefix it with axis2_</p>
<p>e.g. </p>
-
-<p>int count = 0;</p>
-
-<p>char* prefix = NULL;</p>
+<pre>
+int count = 0;
+char *prefix = NULL;
+</pre>
<h3>1.2 Functions </h3>
@@ -40,24 +41,21 @@
<p></p>
<p>e.g. </p>
-
-<p>axis2_om_node_t *axis2_om_node_create(axis2_environment_t
-*environment);</p>
+<pre>
+<p>axis2_om_node_t * axis2_om_node_create(axis2_environment_t *environment);</p>
+</pre>
<p></p>
<h3>1.3 Structures and User Defined Data Types </h3>
<p>e.g.</p>
-
-<p>typedef struct axis2_om_namespace {</p>
-
-<p> char *uri;</p>
-
-<p> char *prefix;</p>
-
-<p>} axis2_om_namespace_t;</p>
-
+<pre>
+typedef struct axis2_om_namespace {
+ char *uri;
+ char *prefix;
+} axis2_om_namespace_t;
+</pre>
<p></p>
<p>Note the _t suffix in the type name.</p>
@@ -73,26 +71,21 @@
structs or is a type definition.</p>
<p>e.g.</p>
-
+<pre>
<p>#define AXIS2_H</p>
-
-<p>#define axis2_error_get_message(error)
-((error)->ops->get_message())</p>
-
+<p>#define axis2_error_get_message(error) ((error)->ops->get_message())</p>
+</pre>
<p></p>
<h3>1.5 Enumerations</h3>
<p>e.g.</p>
-
-<p>typedef enum axis2_status_codes {</p>
-
-<p> AXIS2_FAILURE = 0,</p>
-
-<p> AXIS2_SUCCESS</p>
-
-<p>} axis2_status_codes_t;</p>
-
+<pre>
+typedef enum axis2_status_codes {
+ AXIS2_FAILURE = 0,
+ AXIS2_SUCCESS
+} axis2_status_codes_t;
+</pre>
<p></p>
<h2>2 Indentation</h2>
@@ -119,7 +112,7 @@
<h2>4 Function Parameters and Return Value Conventions</h2>
<p>Each function should be passed a pointer to an instance of
-axis2_environment_t struct as the first parameter. If the function is tightly
+axis2_environment_t struct as the first parameter. If the function is tightly
bound to a struct, the second parameter is a pointer to an instance of that
struct.</p>
@@ -127,9 +120,21 @@
developer should make sure to set the relavant error code in environment's
error struct.</p>
-<p>Functions returning non pointer values should always return AXIS2_FAILURE
+<p>Functions returning none pointer values should always return AXIS2_FAILURE
status code on error whenever possible, or some defined error value (in case
of returning a struct may be). A relavant error code must also be set in
environment's error struct.</p>
+
+<h2>5 Include Directives</h2>
+<p>It is prefereable to include header files in following fashion:</p>
+
+<pre>
+<standard header files>
+<other system headers>
+"local header files"
+</pre>
+
+
+
</body>
</html>