File: coding.txt

package info (click to toggle)
cdebconf 0.182
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,668 kB
  • sloc: ansic: 16,289; sh: 547; makefile: 438; sql: 52; perl: 13
file content (22 lines) | stat: -rw-r--r-- 1,034 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Coding style/standards
----------------------

This is another one of those "object-oriented" C programs. Each "class" is
associated with one program file, which defines a data-structure and a set of 
methods that operate on that structure. All the methods take the class data 
structure as the first parameter. The exception to this is the _new method, 
which is the constructor for the class. It takes whatever initialization 
parameters are needed, and returns a pointer to a class structure. The 
destructor, if one exists, is canonically named class_delete.

Macros are used for various convenience things, and follow the naming convention
of their C++ or perl counterparts.

In general the code follows the following conventions:

- variables and functions are lower-case. multi-word identifiers are joined
  by underbars (like_this). 
- tabs are 4 spaces. Avoid using ^I
- braces are always on a line by itself, and line up with the controlling
  block construct.
- in general, keep things consistent with the surrounding code