Skip to content

C code style

Michał Zalewski edited this page Mar 6, 2020 · 2 revisions

Throughout the project's C code the Linux kernel coding style is used with following amendments:

1) Indentation

Indentation is realised with tab characters, so indentation width is to be set on the side of the developer.

4) Naming

Global variables

Module-scope variable names should be prefixed with g_. Program-scope variables should be avoided.

Function names

Function names should be prefixed with <name of module>_. Functions not belonging to modules public interface should also be prefixed with _.

5) Typedefs

When typedefs are used, type names should end with _t.

7) Centralized exiting of functions

goto instructions should not be used.