From c9bd23515a8c152a4472b0ad44c447d132bac3cd Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Sun, 28 Oct 2012 16:03:59 +0100 Subject: [PATCH] Added a note about the Contiki code style GNU Indent script --- doc/code-style.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/doc/code-style.c b/doc/code-style.c index cc56a649c..37736aa31 100644 --- a/doc/code-style.c +++ b/doc/code-style.c @@ -7,6 +7,16 @@ * belong to the same module. Typically, the \defgroup is placed in * the .h file and \addtogroup in the .c file. * + * The Contiki source code contains a GNU Indent script that can + * automatically format a C code file to match the Contiki code + * style. The Indent configuration is in contiki/tools/indent.pro and + * a small helper script is in contiki/tools/contiki-indent. Note that + * this is not a silver bullet - for example, the script does not add + * separators between functions, nor does it format comments + * correctly. The script should be treated as an aid in formatting + * code: first run the formatter on the source code, then manually + * edit the file. + * * @{ */ @@ -14,8 +24,8 @@ * \file * A brief description of what this file is. * \author - * Adam Dunkels - * + * Adam Dunkels + * * Every file that is part of a documented module has to have * a \file block, else it will not show up in the Doxygen * "Modules" * section. @@ -42,7 +52,7 @@ static int flag; * to know where to look for function and variable definitions. * * Put dividers (a single-line comment consisting only of dashes) - * between functions. + * between functions. */ /*---------------------------------------------------------------------------*/ /** @@ -101,12 +111,12 @@ code_style_example_function(void) /* * Static (non-global) functions do not need Doxygen comments. The * name should not be prepended with the module name - doing so would - * create confusion. + * create confusion. */ static void an_example_function(void) { - + } /*---------------------------------------------------------------------------*/