WARNING: The online documentation has moved to https://docs.pjsip.org.

Visit the new documentation at https://docs.pjsip.org:

BLOG | DOCUMENTATION | GITHUB

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
Copyright (C) 2006-2009 Teluu Inc.