From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id DB29511C5 for ; Thu, 2 Jul 2015 15:51:03 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 02 Jul 2015 06:51:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,393,1432623600"; d="scan'208";a="721746710" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 02 Jul 2015 06:51:00 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t62Dp0Vj018975; Thu, 2 Jul 2015 14:51:00 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t62Dp0v8017621; Thu, 2 Jul 2015 14:51:00 +0100 Received: (from jmcnam2x@localhost) by sivswdev02.ir.intel.com with id t62Dp0rL017617; Thu, 2 Jul 2015 14:51:00 +0100 From: John McNamara To: dev@dpdk.org Date: Thu, 2 Jul 2015 14:50:53 +0100 Message-Id: <1435845053-17203-4-git-send-email-john.mcnamara@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1435845053-17203-1-git-send-email-john.mcnamara@intel.com> References: <1435845053-17203-1-git-send-email-john.mcnamara@intel.com> Subject: [dpdk-dev] [PATCH 3/3] doc: moved doxygen section to the doc guidelines X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 13:51:04 -0000 Moved and refactored the Doxygen guidelines from the Coding Style doc to the Documentation Guidelines doc. Replaced the existing section with a link. Signed-off-by: John McNamara --- doc/guides/guidelines/coding_style.rst | 126 ++------------------------------- 1 file changed, 7 insertions(+), 119 deletions(-) diff --git a/doc/guides/guidelines/coding_style.rst b/doc/guides/guidelines/coding_style.rst index c27fef4..12315bb 100644 --- a/doc/guides/guidelines/coding_style.rst +++ b/doc/guides/guidelines/coding_style.rst @@ -1,5 +1,7 @@ -Coding Style -============ +.. _coding_style: + +DPDK Coding Style +================= Description ----------- @@ -687,123 +689,9 @@ Control Statements Doxygen Documentation --------------------- -The API documentation is automatically generated in the DPDK framework. +The API documentation is automatically generated in the DPDK framework using `Doxygen `_. That is why all files that are part of the public API must be documented using Doxygen syntax. The public API comprises functions of DPDK that can be used by an external application that will use the SDK. -Only the Doxygen syntax described in the coding rules (this document) should be used in the code. -All the Doxygen features are described in the Doxygen manual online. - -Documenting a Function -~~~~~~~~~~~~~~~~~~~~~~ - -All public functions must be documented. The documentation is placed in the header file, above the declaration of the function. -The definition of the function may be documented, but using standard comments (not in doxygen format). -The following is an example of function documentation: - -.. code-block:: c - - /** - * Summary here; one sentence on one line (should not exceed 80 chars). - * - * A more detailed description goes here. - * - * A blank line forms a paragraph. There should be no trailing white-space - * anywhere. - * - * @param first - * "@param" is a Doxygen directive to describe a function parameter. Like - * some other directives, it takes a term/summary on the same line and a - * description (this text) indented by 2 spaces on the next line. All - * descriptive text should wrap at 80 chars, without going over. - * Newlines are NOT supported within directives; if a newline would be - * before this text, it would be appended to the general description above. - * @param second - * There should be no newline between multiple directives (of the same - * type). - * - * @return - * "@return" is a different Doxygen directive to describe the return value - * of a function, if there is any. - */ - int rte_foo(int first, int second) - - -Documenting Files -~~~~~~~~~~~~~~~~~ - -Each public file may start with a comment describing what the file does. For example: - -.. code-block:: c - - /** - * @file - * This file describes the coding rules of RTE. - * - * It contains the coding rules of C code, ASM code, reStructured - * Text documentation, and of course how to use doxygen to document - * public API. - */ - - -Documenting Constants and Variables -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Examples: - -.. code-block:: c - - /** - * The definition of a funny TRUE. - */ - #define TRUE 0 - - #define TRUE 1 /**< another way to document a macro */ - - /** - * Frequency of the HPET counter in Hz - * - * @see rte_eal_hpet_init() - */ - extern uint64_t eal_hpet_resolution_hz; - - -Documenting Structures -~~~~~~~~~~~~~~~~~~~~~~ - -Public structures should also be documented. -The ``/**<`` sequence can be used to documented the fields of the structure, as shown in the following example: - -.. code-block:: c - - /** - * Structure describing a memzone, which is a contiguous portions of - * physical memory identified by a name. - */ - struct rte_memzone { - - #define MEMZONE_NAMESIZE 32 - char name[MEMZONE_NAMESIZE]; /**< name of the memory zone */ - - phys_addr_t phys_addr; /**< start physical address */ - void *addr; /**< start virtual address */ - uint64_t len; /**< len of the memzone */ - - int socket_id; /**< NUMA socket id */ - }; - - -See Also Sections -~~~~~~~~~~~~~~~~~ - -The @see keyword can be used to highlight a link to an existing function, file, or URL. -This directive should be placed on one line, without anything else, at the bottom of the documentation header. - -.. code-block:: c - - /** - * (documentation of function, file, ...) - * - * @see rte_foo() - * @see eal_memzone.c - */ +Only the Doxygen syntax described in the :ref:`doxygen_guidelines` should be used in the code. +Other Doxygen features are described in the Doxygen manual online. -- 1.8.1.4