Commit d43550c9 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Add examples and guidelines for coding.

parent 9fafe071
......@@ -29,6 +29,9 @@ config/mkinstalldirs -text
/configure.ac -text
doc/cdi_cman.pdf -text
doc/cdi_fman.pdf -text
doc/coding_standards/README -text
doc/coding_standards/footer.c -text
doc/coding_standards/ref-example.c -text
doc/tex/FUNCTIONS -text
doc/tex/Modules -text
doc/tex/attribute.tex -text
......
All CDI C files (.h/.c) should obey the formatting shown in
ref-example.c:
* Only use spaces for indentation, i.e. no tabs.
* Indent by 2 spaces per level.
* Indent the braces of blocks following an operator such as for,if,while.
(but not those following the function signature).
* Opening and closing braces should be placed on a line of their own.
To ensure the corresponding settings are automatically in place, in case
you are using
* Emacs: use the appended local variables or set your Emacs environment
accordingly.
* vi: ?
/*
* Local Variables:
* c-file-style: "Java"
* c-basic-offset: 2
* indent-tabs-mode: nil
* show-trailing-whitespace: t
* require-trailing-newline: t
* End:
*/
enum foo
{
bar = 1,
};
void func()
{
int var;
for ()
{
int x = 2;
if ()
{
var = x;
}
}
}
/*
* Local Variables:
* c-file-style: "Java"
* c-basic-offset: 2
* indent-tabs-mode: nil
* show-trailing-whitespace: t
* require-trailing-newline: t
* End:
*/
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment