| 1 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 6. Coding Suggestions</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="SAMBA Developers Guide"><link rel="up" href="pt02.html" title="Part II. Samba Basics"><link rel="prev" href="internals.html" title="Chapter 5. Samba Internals"><link rel="next" href="contributing.html" title="Chapter 7. Contributing code"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 6. Coding Suggestions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="internals.html">Prev</a> </td><th width="60%" align="center">Part II. Samba Basics</th><td width="20%" align="right"> <a accesskey="n" href="contributing.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="CodingSuggestions"></a>Chapter 6. Coding Suggestions</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Steve</span> <span class="surname">French</span></h3></div></div><div><div class="author"><h3 class="author"><span class="firstname">Simo</span> <span class="surname">Sorce</span></h3></div></div><div><div class="author"><h3 class="author"><span class="firstname">Andrew</span> <span class="surname">Bartlett</span></h3></div></div><div><div class="author"><h3 class="author"><span class="firstname">Tim</span> <span class="surname">Potter</span></h3></div></div><div><div class="author"><h3 class="author"><span class="firstname">Martin</span> <span class="surname">Pool</span></h3></div></div></div></div><p>
|
|---|
| 2 | So you want to add code to Samba ...
|
|---|
| 3 | </p><p>
|
|---|
| 4 | One of the daunting tasks facing a programmer attempting to write code for
|
|---|
| 5 | Samba is understanding the various coding conventions used by those most
|
|---|
| 6 | active in the project. These conventions were mostly unwritten and helped
|
|---|
| 7 | improve either the portability, stability or consistency of the code. This
|
|---|
| 8 | document will attempt to document a few of the more important coding
|
|---|
| 9 | practices used at this time on the Samba project. The coding practices are
|
|---|
| 10 | expected to change slightly over time, and even to grow as more is learned
|
|---|
| 11 | about obscure portability considerations. Two existing documents
|
|---|
| 12 | <code class="filename">samba/source/internals.doc</code> and
|
|---|
| 13 | <code class="filename">samba/source/architecture.doc</code> provide
|
|---|
| 14 | additional information.
|
|---|
| 15 | </p><p>
|
|---|
| 16 | The loosely related question of coding style is very personal and this
|
|---|
|
|---|