Show a patch.

GET /api/1.1/patches/2163/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2163,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/2163/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/2163/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20191012184407.31684-3-laurent.pinchart@ideasonboard.com>",
    "date": "2019-10-12T18:43:55",
    "name": "[libcamera-devel,v2,02/14] libcamera: control_ids: Fix documentation for controls namespace",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "8283befa1c5a53d11e4bd5e36cf195eb14d651b5",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/2163/mbox/",
    "series": [
        {
            "id": 531,
            "url": "https://patchwork.libcamera.org/api/1.1/series/531/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=531",
            "date": "2019-10-12T18:43:53",
            "name": "Use ControlList for both libcamera and V4L2 controls",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/531/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/2163/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/2163/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 1192B6196E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 12 Oct 2019 20:44:16 +0200 (CEST)",
            "from pendragon.bb.dnainternet.fi\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6D9BA33A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 12 Oct 2019 20:44:15 +0200 (CEST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1570905855;\n\tbh=SsVqKXaIVcdlWRXP2hsy95tJFefEHTZPpJr/BetEt8w=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=bFTGZU01ICwYWQFqcMoVsGuQbVKUwHfDC+NcD01OSIp7G7DFvKDtk2V/9AjoBYlDy\n\tnxK830fxvvQnaU6GK3XKNB041DC7vfAJnOp5qTAh4IaY7J1GwCSfgerlUgRvY3zDdW\n\tu0myajHAG6gd02K6GbDwkt3wSoypNZLJ/MYaJ+kY=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Sat, 12 Oct 2019 21:43:55 +0300",
        "Message-Id": "<20191012184407.31684-3-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20191012184407.31684-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20191012184407.31684-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 02/14] libcamera: control_ids: Fix\n\tdocumentation for controls namespace",
        "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": "Sat, 12 Oct 2019 18:44:16 -0000"
    },
    "content": "The controls namespace isn't documenting, making it impossible to\nreference the variables it contains. Furthermore, within the\ndocumentation page for the control_ids.h file, links from overview to\ndetailed variable documentation are broken for the same reason. Both\nissues can be fixed by documenting the controls namespace.\n\nUnfortunately doxygen then fails to parse the initialisers for the\ncontrols global variables correctly and considers them as functions. To\nwork around this, modify the control_ids.cpp generation script to hide\nthe variables from doxygen, but still expose their documentation.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/control_ids.cpp.in | 13 ++++++++++++-\n src/libcamera/gen-controls.py    | 18 ++++++++++++------\n 2 files changed, 24 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/src/libcamera/control_ids.cpp.in b/src/libcamera/control_ids.cpp.in\nindex f699ac9eea54..dd5433820a8b 100644\n--- a/src/libcamera/control_ids.cpp.in\n+++ b/src/libcamera/control_ids.cpp.in\n@@ -16,9 +16,20 @@\n \n namespace libcamera {\n \n+/**\n+ * \\brief Namespace for libcamera controls\n+ */\n namespace controls {\n \n-${controls}\n+${controls_doc}\n+\n+#ifndef __DOXYGEN__\n+/*\n+ * Keep the controls definitions hidden from doxygen as it incorrectly parses\n+ * them as functions.\n+ */\n+${controls_def}\n+#endif\n \n } /* namespace controls */\n \ndiff --git a/src/libcamera/gen-controls.py b/src/libcamera/gen-controls.py\nindex 0899e40b4080..a3e52fb36f7a 100755\n--- a/src/libcamera/gen-controls.py\n+++ b/src/libcamera/gen-controls.py\n@@ -17,12 +17,14 @@ def snake_case(s):\n \n \n def generate_cpp(controls):\n-    template = string.Template('''/**\n+    doc_template = string.Template('''/**\n+ * \\\\var extern const Control<${type}> ${name}\n ${description}\n- */\n-extern const Control<${type}> ${name}(${id_name}, \"${name}\");''')\n+ */''')\n+    def_template = string.Template('extern const Control<${type}> ${name}(${id_name}, \"${name}\");')\n \n-    ctrls = []\n+    ctrls_doc = []\n+    ctrls_def = []\n \n     for ctrl in controls:\n         name, ctrl = ctrl.popitem()\n@@ -39,9 +41,13 @@ extern const Control<${type}> ${name}(${id_name}, \"${name}\");''')\n             'id_name': id_name,\n         }\n \n-        ctrls.append(template.substitute(info))\n+        ctrls_doc.append(doc_template.substitute(info))\n+        ctrls_def.append(def_template.substitute(info))\n \n-    return {'controls': '\\n\\n'.join(ctrls)}\n+    return {\n+        'controls_doc': '\\n\\n'.join(ctrls_doc),\n+        'controls_def': '\\n'.join(ctrls_def),\n+    }\n \n \n def generate_h(controls):\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "02/14"
    ]
}