get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 13575,
    "url": "http://patches.dpdk.org/api/patches/13575/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1465830465-30058-4-git-send-email-viktorin@rehivetech.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<1465830465-30058-4-git-send-email-viktorin@rehivetech.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1465830465-30058-4-git-send-email-viktorin@rehivetech.com",
    "date": "2016-06-13T15:07:38",
    "name": "[dpdk-dev,v5,03/10] app/test: support resources externally linked",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "16dbdcdf6188f025691ebeb7648f160bb712aae6",
    "submitter": {
        "id": 292,
        "url": "http://patches.dpdk.org/api/people/292/?format=api",
        "name": "Jan Viktorin",
        "email": "viktorin@rehivetech.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1465830465-30058-4-git-send-email-viktorin@rehivetech.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/13575/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/13575/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id C07E4568D;\n\tMon, 13 Jun 2016 17:13:00 +0200 (CEST)",
            "from wes1-so1.wedos.net (wes1-so1.wedos.net [46.28.106.15])\n\tby dpdk.org (Postfix) with ESMTP id E27895591\n\tfor <dev@dpdk.org>; Mon, 13 Jun 2016 17:12:55 +0200 (CEST)",
            "from pcviktorin.fit.vutbr.cz (pcviktorin.fit.vutbr.cz\n\t[147.229.13.147])\n\tby wes1-so1.wedos.net (Postfix) with ESMTPSA id 3rSx9M55SKzCCx;\n\tMon, 13 Jun 2016 17:12:55 +0200 (CEST)"
        ],
        "From": "Jan Viktorin <viktorin@rehivetech.com>",
        "To": "dev@dpdk.org",
        "Cc": "Jan Viktorin <viktorin@rehivetech.com>,\n\tThomas Monjalon <thomas.monjalon@6wind.com>,\n\tDavid Marchand <david.marchand@6wind.com>,\n\tBruce Richardson <bruce.richardson@intel.com>",
        "Date": "Mon, 13 Jun 2016 17:07:38 +0200",
        "Message-Id": "<1465830465-30058-4-git-send-email-viktorin@rehivetech.com>",
        "X-Mailer": "git-send-email 2.8.0",
        "In-Reply-To": [
            "<1465830465-30058-1-git-send-email-viktorin@rehivetech.com>",
            "<1465805550-30640-1-git-send-email-viktorin@rehivetech.com>"
        ],
        "References": [
            "<1465830465-30058-1-git-send-email-viktorin@rehivetech.com>",
            "<1465805550-30640-1-git-send-email-viktorin@rehivetech.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v5 03/10] app/test: support resources externally\n\tlinked",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "To include resources from other source that the C source code we\ncan take advantage of the objcopy behaviour, i.e. packing of an\narbitrary file as an object file that is linked to the target program.\n\nA linked object file is always accessible as a pair\n\nextern const char beg_<name>;\nextern const char end_<name>;\n(extern const char siz_<name>;)\n\nA unit test that packs the resource.c source file is included.\n\nSigned-off-by: Jan Viktorin <viktorin@rehivetech.com>\n---\nv4\n* fixed trailing semicolon in REGISTER_LINKED_RESOURCE\n---\n app/test/Makefile        | 19 +++++++++++++++++++\n app/test/resource.h      | 10 ++++++++++\n app/test/test_resource.c | 18 ++++++++++++++++++\n 3 files changed, 47 insertions(+)",
    "diff": "diff --git a/app/test/Makefile b/app/test/Makefile\nindex 1a13fb2..fe67eee 100644\n--- a/app/test/Makefile\n+++ b/app/test/Makefile\n@@ -33,6 +33,24 @@ include $(RTE_SDK)/mk/rte.vars.mk\n \n ifeq ($(CONFIG_RTE_APP_TEST),y)\n \n+# Define an externally linked resource. A linked resource is an arbitrary\n+# file that is linked into the test binary. The application refers to this\n+# resource by name. The linked generates identifiers beg_<name> and end_<name>\n+# for referencing by the C code.\n+#\n+# Parameters: <unique name>, <file to be linked>\n+define linked_resource\n+SRCS-y += $(1).res.o\n+$(1).res.o: $(2)\n+\t$(OBJCOPY) -I binary -B $(RTE_OBJCOPY_ARCH) -O $(RTE_OBJCOPY_TARGET) \\\n+\t\t--rename-section                                         \\\n+\t\t\t.data=.rodata,alloc,load,data,contents,readonly  \\\n+\t\t--redefine-sym _binary__dev_stdin_start=beg_$(1)         \\\n+\t\t--redefine-sym _binary__dev_stdin_end=end_$(1)           \\\n+\t\t--redefine-sym _binary__dev_stdin_size=siz_$(1)          \\\n+\t\t/dev/stdin $$@ < $$<\n+endef\n+\n #\n # library name\n #\n@@ -45,6 +63,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) := commands.c\n SRCS-y += test.c\n SRCS-y += resource.c\n SRCS-y += test_resource.c\n+$(eval $(call linked_resource,test_resource_c,resource.c))\n SRCS-y += test_pci.c\n SRCS-y += test_prefetch.c\n SRCS-y += test_byteorder.c\ndiff --git a/app/test/resource.h b/app/test/resource.h\nindex 9af8415..966fc24 100644\n--- a/app/test/resource.h\n+++ b/app/test/resource.h\n@@ -82,6 +82,16 @@ const struct resource *resource_find(const char *name);\n void resource_register(struct resource *r);\n \n /**\n+ * Definition of a resource linked externally (by means of the used toolchain).\n+ * Only the base name of the resource is expected. The name refers to the\n+ * linked pointers beg_<name> and end_<name> provided externally.\n+ */\n+#define REGISTER_LINKED_RESOURCE(n) \\\n+extern const char beg_ ##n;         \\\n+extern const char end_ ##n;         \\\n+REGISTER_RESOURCE(n, &beg_ ##n, &end_ ##n) \\\n+\n+/**\n  * Definition of a resource described by its name, and pointers begin, end.\n  */\n #define REGISTER_RESOURCE(n, b, e) \\\ndiff --git a/app/test/test_resource.c b/app/test/test_resource.c\nindex 69391ad..b397fa8 100644\n--- a/app/test/test_resource.c\n+++ b/app/test/test_resource.c\n@@ -60,11 +60,29 @@ static int test_resource_dpdk(void)\n \treturn 0;\n }\n \n+REGISTER_LINKED_RESOURCE(test_resource_c);\n+\n+static int test_resource_c(void)\n+{\n+\tconst struct resource *r;\n+\n+\tr = resource_find(\"test_resource_c\");\n+\tTEST_ASSERT_NOT_NULL(r, \"No test_resource_c found\");\n+\tTEST_ASSERT(!strcmp(r->name, \"test_resource_c\"),\n+\t\t\t\"Found resource %s, expected test_resource_c\",\n+\t\t\tr->name);\n+\n+\treturn 0;\n+}\n+\n static int test_resource(void)\n {\n \tif (test_resource_dpdk())\n \t\treturn -1;\n \n+\tif (test_resource_c())\n+\t\treturn -1;\n+\n \treturn 0;\n }\n \n",
    "prefixes": [
        "dpdk-dev",
        "v5",
        "03/10"
    ]
}