{"id":2212,"url":"https://patchwork.libcamera.org/api/patches/2212/?format=json","web_url":"https://patchwork.libcamera.org/patch/2212/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20191023135258.32256-2-laurent.pinchart@ideasonboard.com>","date":"2019-10-23T13:52:56","name":"[libcamera-devel,2/4] Documentation: coding-style: Document order of includes","commit_ref":"73a11cbf78342ecc875709e92abacee165530823","pull_url":null,"state":"accepted","archived":false,"hash":"9272047097b19053cb9a55c8d4d845b221db0478","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/2212/mbox/","series":[{"id":543,"url":"https://patchwork.libcamera.org/api/series/543/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=543","date":"2019-10-23T13:52:55","name":"[libcamera-devel,1/4] Documentation: coding-style: Document usage of C compatibility headers","version":1,"mbox":"https://patchwork.libcamera.org/series/543/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/2212/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/2212/checks/","tags":{},"headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3FB2C6138D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Oct 2019 15:54:01 +0200 (CEST)","from pendragon.ideasonboard.com (143.121.2.93.rev.sfr.net\n\t[93.2.121.143])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D946F814\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Oct 2019 15:54:00 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1571838840;\n\tbh=0qI1bjkBKakM0C0NEQRoFbFrjCAnpDloioehclwe/hQ=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=DHCmyPXfFpc7DSpkSbOnq5eO7c1n7NlrAeVw5N2YkpDCyrGx69kdziJ/v91va1mxS\n\t/fAhbXLvjap2nSZmmmJhXin5aG3GDOneOkwqxVzPe+6t796TbCNYw1OFWeBfqGdlKl\n\tUt+oeLB8Xgzu/eLCECgxkO+v8h/DcgHuyT1Mv7ds=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 23 Oct 2019 16:52:56 +0300","Message-Id":"<20191023135258.32256-2-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.23.0","In-Reply-To":"<20191023135258.32256-1-laurent.pinchart@ideasonboard.com>","References":"<20191023135258.32256-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 2/4] Documentation: coding-style: Document\n\torder of includes","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Wed, 23 Oct 2019 13:54:01 -0000"},"content":"We follow the Google C++ Style Guide rule on include ordering with a few\ntweaks. Document our rule explicitly.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n Documentation/coding-style.rst | 23 +++++++++++++++++++++++\n 1 file changed, 23 insertions(+)","diff":"diff --git a/Documentation/coding-style.rst b/Documentation/coding-style.rst\nindex ced3155169a6..c53248234c34 100644\n--- a/Documentation/coding-style.rst\n+++ b/Documentation/coding-style.rst\n@@ -61,6 +61,29 @@ document:\n   Code Style for indentation, braces, spacing, etc\n * Header guards are formatted as '__LIBCAMERA_FILE_NAME_H__'\n \n+Order of Includes\n+~~~~~~~~~~~~~~~~~\n+\n+Headers shall be included at the beginning of .c, .cpp and .h files, right\n+after the file description comment block and, for .h files, the header guard\n+macro. For .cpp files, if the file implements an API declared in a header file,\n+that header file shall be included first in order to ensure it is\n+self-contained.\n+\n+The headers shall be grouped and ordered as follows.\n+\n+ # The header declaring the API being implemented (if any)\n+ # The C and C++ system and standard library headers\n+ # Other libraries' headers, with one group per library\n+ # Other project's headers\n+\n+Groups of headers shall be separated by a single blank line. Headers within\n+each group shall be sorted alphabetically.\n+\n+System and library headers shall be included with angle brackets. Project\n+headers shall be included with angle brackets for the libcamera public API\n+headers, and with double quotes for other libcamera headers.\n+\n \n C++ Specific Rules\n ------------------\n","prefixes":["libcamera-devel","2/4"]}