File: coding.txt

package info (click to toggle)
cdebconf 0.114etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 1,724 kB
  • ctags: 1,157
  • sloc: ansic: 12,182; makefile: 388; sh: 377; sql: 51; perl: 13
file content (24 lines) | stat: -rw-r--r-- 1,095 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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

$Id: coding.txt 11913 2004-03-25 04:52:51Z klfmanik-guest $