pjsip logo pjsip.org
Open source SIP stack and media stack for presence, im/instant messaging, and multimedia communication

HOME

SIP/media Features
High Performance SIP
Small Footprint SIP
Symbian Port

FAQ

Documentation

Licensing

Download

Development (Trac)

Projects using pjsip

Mailing List

Open Source Links


About: PJLIB, PJLIB-UTIL, PJSIP, and PJMEDIA are created by: Benny Prijono
<bennylp@pjsip.org>


 

Home --> Documentations --> PJLIB Reference

Coding Convention

Before you submit your code/patches to be included with PJLIB, you must make sure that your code is compliant with PJLIB coding convention. This is very important! Otherwise we would not accept your code.

Editor Settings

The single most important thing in the whole coding convention is editor settings. It's more important than the correctness of your code (bugs will only crash the system, but incorrect tab size is mental!).

Kindly set your editor as follows:

  • tab size to 8.
  • indentation to 4.

With vi, you can do it with:

  :se ts=8
  :se sts=4
 

You should replace tab with eight spaces.

Coding Style

Coding style MUST strictly follow K&R style. The rest of coding style must follow current style. You SHOULD be able to observe the style currently used by PJLIB from PJLIB sources, and apply the style to your code. If you're not able to do simple thing like to observe PJLIB coding style from the sources, then logic dictates that your ability to observe more difficult area in PJLIB such as memory allocation strategy, concurrency, etc is questionable.

Commenting Your Code

Public API (e.g. in header files) MUST have doxygen compliant comments.

 


PJLIB Open Source, high performance, small footprint, and very very portable framework
(C)2001-2008 Benny Prijono