get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 79060,
    "url": "https://patches.dpdk.org/api/patches/79060/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200928215052.23627-3-dmitry.kozliuk@gmail.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20200928215052.23627-3-dmitry.kozliuk@gmail.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200928215052.23627-3-dmitry.kozliuk@gmail.com",
    "date": "2020-09-28T21:50:47",
    "name": "[v3,2/7] cmdline: add internal wrappers for terminal handling",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "6beffc7e2cbc4776cc3280d9fd7ae10a3042be88",
    "submitter": {
        "id": 1581,
        "url": "https://patches.dpdk.org/api/people/1581/?format=api",
        "name": "Dmitry Kozlyuk",
        "email": "dmitry.kozliuk@gmail.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200928215052.23627-3-dmitry.kozliuk@gmail.com/mbox/",
    "series": [
        {
            "id": 12564,
            "url": "https://patches.dpdk.org/api/series/12564/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=12564",
            "date": "2020-09-28T21:50:45",
            "name": "cmdline: support Windows",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/12564/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/79060/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/79060/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 47FB8A04C0;\n\tMon, 28 Sep 2020 23:52:10 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 8FFA11D6DF;\n\tMon, 28 Sep 2020 23:51:39 +0200 (CEST)",
            "from mail-lj1-f196.google.com (mail-lj1-f196.google.com\n [209.85.208.196]) by dpdk.org (Postfix) with ESMTP id 815071D6BF\n for <dev@dpdk.org>; Mon, 28 Sep 2020 23:51:35 +0200 (CEST)",
            "by mail-lj1-f196.google.com with SMTP id u4so2268735ljd.10\n for <dev@dpdk.org>; Mon, 28 Sep 2020 14:51:35 -0700 (PDT)",
            "from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru.\n [37.110.65.23])\n by smtp.gmail.com with ESMTPSA id l11sm2954893lfk.113.2020.09.28.14.51.32\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 28 Sep 2020 14:51:33 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=MCsgmi+B1iYyuYfYEGUH8jUBju8b4BGi/vJmbVVi3P8=;\n b=PdAdJsABAZjP95ZIT4kHu50yVbd0QCzbIwq6lHA1lGq6cTeu2PZT4h69HmHjSY73Ft\n KTh1CwvfuHKmI7H9BC1hDI22w1XZmEim29/vQs6tq53E1Ut5xL0jnpegneoXT0MpZrUj\n 2gUdBEm+Ji2m5EpoxJHH1H983wqmAcBtrCxFak2Gz5iYViW5FrUdYIlG3MMOhlYLW1W4\n wv70qtl6Np7EWmOVk0WUlUBHOAbG30f8nov3k82HLuWHwYR1TKL/KGeC3RqBeyzFiQrM\n eKRJy/KZy/ZqQqvmgkGVcxjiYTvw0bK0fig5+3BxnqcDKKnaypO7rJDnNvQ3y1DTv0fl\n eICA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=MCsgmi+B1iYyuYfYEGUH8jUBju8b4BGi/vJmbVVi3P8=;\n b=eIPu4w/Oypnk5VAriHbrI7OHGAmY6lzPwjoRJ8HE4Cem2B0PoeEL2/O5KBXnqSAE8s\n fmmJVaFjNN5IG5Fz+yY97JQ/mlFgM+XX1MH2AUIb5K4QqBm+pAVh9boiQ20jMXuEuHsU\n Mhnmx9SvueWxnfN5ZF+tRiKA9Wg7erU4lx7tu/GssbHU5BxbcruqDIIBtfZbG4guMuE7\n jxvumMEBqHH3jsx4CqeJ/j/ddmJ/aFEPyv5JwoYfkofGPCE3Jxk8yy2pSbpREaAcbF4g\n aRm+Mo9AKcvHhRaZWi/XClulPPvIlTsO1XUjs7FmbtjBqrc6W3ckr5klHizFQnosR5Wr\n mdYQ==",
        "X-Gm-Message-State": "AOAM5302CbW8EVXYtdwIAN93+kiYdzWGQ5rpmpVMzsCqSV1GQwGhCQhd\n GQFnULxF+P8Rsz1OgAVps9j069kSYmCzs4dv",
        "X-Google-Smtp-Source": "\n ABdhPJyo+uyfQJ0exCmP72DQZoPx8swYlHY/Na74BBNt58L2yfyGtJ8kAHhqPTuY03I2v6nuABVawA==",
        "X-Received": "by 2002:a2e:9089:: with SMTP id l9mr178015ljg.118.1601329893718;\n Mon, 28 Sep 2020 14:51:33 -0700 (PDT)",
        "From": "Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>",
        "To": "dev@dpdk.org",
        "Cc": "\"Kinsella, Ray\" <mdr@ashroe.eu>, Khoa To <khot@microsoft.com>,\n Stephen Hemminger <stephen@networkplumber.org>,\n Ferruh Yigit <ferruh.yigit@intel.com>,\n Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,\n Olivier Matz <olivier.matz@6wind.com>",
        "Date": "Tue, 29 Sep 2020 00:50:47 +0300",
        "Message-Id": "<20200928215052.23627-3-dmitry.kozliuk@gmail.com>",
        "X-Mailer": "git-send-email 2.28.0",
        "In-Reply-To": "<20200928215052.23627-1-dmitry.kozliuk@gmail.com>",
        "References": "<20200730210652.14568-1-dmitry.kozliuk@gmail.com>\n <20200928215052.23627-1-dmitry.kozliuk@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 2/7] cmdline: add internal wrappers for\n\tterminal handling",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Add functions that set up, save, and restore terminal parameters.\nUse existing code as Unix implementation.\n\nSigned-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>\n---\n lib/librte_cmdline/cmdline_os_unix.c | 27 +++++++++++++++++++++++++++\n lib/librte_cmdline/cmdline_private.h | 16 ++++++++++++++++\n lib/librte_cmdline/cmdline_socket.c  | 16 +++++-----------\n lib/librte_cmdline/cmdline_vt100.c   |  1 -\n lib/librte_cmdline/meson.build       |  4 ++++\n 5 files changed, 52 insertions(+), 12 deletions(-)\n create mode 100644 lib/librte_cmdline/cmdline_os_unix.c\n create mode 100644 lib/librte_cmdline/cmdline_private.h",
    "diff": "diff --git a/lib/librte_cmdline/cmdline_os_unix.c b/lib/librte_cmdline/cmdline_os_unix.c\nnew file mode 100644\nindex 000000000..d50eb1c65\n--- /dev/null\n+++ b/lib/librte_cmdline/cmdline_os_unix.c\n@@ -0,0 +1,27 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright (c) 2020 Dmitry Kozlyuk\n+ */\n+\n+#include <string.h>\n+\n+#include \"cmdline_private.h\"\n+\n+void\n+terminal_adjust(struct cmdline *cl)\n+{\n+\tstruct termios term;\n+\n+\ttcgetattr(0, &cl->oldterm);\n+\n+\tmemcpy(&term, &cl->oldterm, sizeof(term));\n+\tterm.c_lflag &= ~(ICANON | ECHO | ISIG);\n+\ttcsetattr(0, TCSANOW, &term);\n+\n+\tsetbuf(stdin, NULL);\n+}\n+\n+void\n+terminal_restore(const struct cmdline *cl)\n+{\n+\ttcsetattr(fileno(stdin), TCSANOW, &cl->oldterm);\n+}\ndiff --git a/lib/librte_cmdline/cmdline_private.h b/lib/librte_cmdline/cmdline_private.h\nnew file mode 100644\nindex 000000000..50326e8a4\n--- /dev/null\n+++ b/lib/librte_cmdline/cmdline_private.h\n@@ -0,0 +1,16 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright (c) 2020 Dmitry Kozlyuk\n+ */\n+\n+#ifndef _CMDLINE_PRIVATE_H_\n+#define _CMDLINE_PRIVATE_H_\n+\n+#include <cmdline.h>\n+\n+/* Disable buffering and echoing, save previous settings to oldterm. */\n+void terminal_adjust(struct cmdline *cl);\n+\n+/* Restore terminal settings form oldterm. */\n+void terminal_restore(const struct cmdline *cl);\n+\n+#endif\ndiff --git a/lib/librte_cmdline/cmdline_socket.c b/lib/librte_cmdline/cmdline_socket.c\nindex 6c89d2171..998e8ade2 100644\n--- a/lib/librte_cmdline/cmdline_socket.c\n+++ b/lib/librte_cmdline/cmdline_socket.c\n@@ -13,6 +13,7 @@\n #include <fcntl.h>\n \n #include \"cmdline.h\"\n+#include \"cmdline_private.h\"\n #include \"cmdline_socket.h\"\n \n struct cmdline *\n@@ -36,18 +37,11 @@ struct cmdline *\n cmdline_stdin_new(cmdline_parse_ctx_t *ctx, const char *prompt)\n {\n \tstruct cmdline *cl;\n-\tstruct termios oldterm, term;\n-\n-\ttcgetattr(0, &oldterm);\n-\tmemcpy(&term, &oldterm, sizeof(term));\n-\tterm.c_lflag &= ~(ICANON | ECHO | ISIG);\n-\ttcsetattr(0, TCSANOW, &term);\n-\tsetbuf(stdin, NULL);\n \n \tcl = cmdline_new(ctx, prompt, 0, 1);\n \n-\tif (cl)\n-\t\tmemcpy(&cl->oldterm, &oldterm, sizeof(term));\n+\tif (cl != NULL)\n+\t\tterminal_adjust(cl);\n \n \treturn cl;\n }\n@@ -55,8 +49,8 @@ cmdline_stdin_new(cmdline_parse_ctx_t *ctx, const char *prompt)\n void\n cmdline_stdin_exit(struct cmdline *cl)\n {\n-\tif (!cl)\n+\tif (cl == NULL)\n \t\treturn;\n \n-\ttcsetattr(fileno(stdin), TCSANOW, &cl->oldterm);\n+\tterminal_restore(cl);\n }\ndiff --git a/lib/librte_cmdline/cmdline_vt100.c b/lib/librte_cmdline/cmdline_vt100.c\nindex 662fc7345..bb968dd5f 100644\n--- a/lib/librte_cmdline/cmdline_vt100.c\n+++ b/lib/librte_cmdline/cmdline_vt100.c\n@@ -10,7 +10,6 @@\n #include <string.h>\n #include <stdarg.h>\n #include <ctype.h>\n-#include <termios.h>\n \n #include \"cmdline_vt100.h\"\n \ndiff --git a/lib/librte_cmdline/meson.build b/lib/librte_cmdline/meson.build\nindex 7fc54ff1a..5c9e8886d 100644\n--- a/lib/librte_cmdline/meson.build\n+++ b/lib/librte_cmdline/meson.build\n@@ -25,4 +25,8 @@ headers = files('cmdline.h',\n \t'cmdline_cirbuf.h',\n \t'cmdline_parse_portlist.h')\n \n+if not is_windows\n+\tsources += files('cmdline_os_unix.c')\n+endif\n+\n deps += ['net']\n",
    "prefixes": [
        "v3",
        "2/7"
    ]
}