get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 136844,
    "url": "http://patches.dpdk.org/api/patches/136844/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240216102454.4156609-2-david.marchand@redhat.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": "<20240216102454.4156609-2-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240216102454.4156609-2-david.marchand@redhat.com",
    "date": "2024-02-16T10:24:52",
    "name": "[v2,1/3] eal: add helper to skip whitespaces",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "fa82ea8e2c7acf6078a255a8d4ac8e0d172310c9",
    "submitter": {
        "id": 1173,
        "url": "http://patches.dpdk.org/api/people/1173/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@redhat.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20240216102454.4156609-2-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 31127,
            "url": "http://patches.dpdk.org/api/series/31127/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31127",
            "date": "2024-02-16T10:24:51",
            "name": "add __extension__ keyword to statement expressions",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/31127/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/136844/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/136844/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 9BBDF43B30;\n\tFri, 16 Feb 2024 11:25:10 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8B46442F0F;\n\tFri, 16 Feb 2024 11:25:10 +0100 (CET)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by mails.dpdk.org (Postfix) with ESMTP id 2F45D42F0A\n for <dev@dpdk.org>; Fri, 16 Feb 2024 11:25:09 +0100 (CET)",
            "from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com\n [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-634-R7zqoM4EMca6VWSrkhQTGQ-1; Fri, 16 Feb 2024 05:25:05 -0500",
            "from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com\n [10.11.54.1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BF27484ACA3;\n Fri, 16 Feb 2024 10:25:04 +0000 (UTC)",
            "from dmarchan.redhat.com (unknown [10.45.225.53])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 93FB1AD75;\n Fri, 16 Feb 2024 10:25:02 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1708079108;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=w+pRqIiQ9P4Q1MFUJ1C7974i1B/CSpsbbafwStOP/JA=;\n b=Utz/mwwcm7GoG1vFvW7Sn4zSzg9UgvwnJmmTNLJBnw3cbdaiKaVNfCVcx3E5rTi8Kp3OBx\n cdvnKxgrYqCm8ZcMt7ejoASLjUCdUuYxuyFjwmWKTe3ikjgkCpHbHuhNjZ+z/aYCkMWwXy\n F9weU3C4lMNwm5OIaBZN95R5cyV0uSA=",
        "X-MC-Unique": "R7zqoM4EMca6VWSrkhQTGQ-1",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "Tyler Retzlaff <roretzla@linux.microsoft.com>,\n Sunil Kumar Kori <skori@marvell.com>,\n Rakesh Kudurumalla <rkudurumalla@marvell.com>,\n Jerin Jacob <jerinj@marvell.com>,\n Srikanth Yalavarthi <syalavarthi@marvell.com>,\n Cristian Dumitrescu <cristian.dumitrescu@intel.com>,\n Aman Singh <aman.deep.singh@intel.com>,\n Yuying Zhang <yuying.zhang@intel.com>,\n Brian Dooley <brian.dooley@intel.com>,\n Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>",
        "Subject": "[PATCH v2 1/3] eal: add helper to skip whitespaces",
        "Date": "Fri, 16 Feb 2024 11:24:52 +0100",
        "Message-ID": "<20240216102454.4156609-2-david.marchand@redhat.com>",
        "In-Reply-To": "<20240216102454.4156609-1-david.marchand@redhat.com>",
        "References": "<1700089378-26197-1-git-send-email-roretzla@linux.microsoft.com>\n <20240216102454.4156609-1-david.marchand@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.4.1 on 10.11.54.1",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "Reduce code duplication by providing a simple inline helper.\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\nAcked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\n---\n app/graph/utils.c                          | 13 ++------\n app/test-eventdev/parser.c                 | 14 ++++-----\n app/test-eventdev/parser.h                 |  8 -----\n app/test-mldev/parser.c                    | 17 ++++++-----\n app/test-mldev/parser.h                    |  8 -----\n app/test-pmd/cmdline_tm.c                  | 13 ++------\n app/test/test_string_fns.c                 | 35 ++++++++++++++++++++++\n examples/fips_validation/fips_validation.c | 16 +++-------\n examples/ip_pipeline/parser.c              | 14 ++++-----\n examples/ip_pipeline/parser.h              |  8 -----\n examples/pipeline/cli.c                    | 13 ++------\n lib/eal/include/rte_string_fns.h           | 27 +++++++++++++++++\n 12 files changed, 98 insertions(+), 88 deletions(-)",
    "diff": "diff --git a/app/graph/utils.c b/app/graph/utils.c\nindex c7b6ae83cf..3e8099ea88 100644\n--- a/app/graph/utils.c\n+++ b/app/graph/utils.c\n@@ -9,17 +9,10 @@\n #include <string.h>\n \n #include <rte_common.h>\n+#include <rte_string_fns.h>\n \n #include \"module_api.h\"\n \n-#define white_spaces_skip(pos)\t\t\t\\\n-({\t\t\t\t\t\t\\\n-\t__typeof__(pos) _p = (pos);\t\t\\\n-\tfor ( ; isspace(*_p); _p++)\t\t\\\n-\t\t;\t\t\t\t\\\n-\t_p;\t\t\t\t\t\\\n-})\n-\n static void\n hex_string_to_uint64(uint64_t *dst, const char *hexs)\n {\n@@ -47,7 +40,7 @@ parser_uint64_read(uint64_t *value, const char *p)\n \tchar *next;\n \tuint64_t val;\n \n-\tp = white_spaces_skip(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \tif (!isdigit(*p))\n \t\treturn -EINVAL;\n \n@@ -73,7 +66,7 @@ parser_uint64_read(uint64_t *value, const char *p)\n \t\tbreak;\n \t}\n \n-\tp = white_spaces_skip(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \tif (*p != '\\0')\n \t\treturn -EINVAL;\n \ndiff --git a/app/test-eventdev/parser.c b/app/test-eventdev/parser.c\nindex bbea47b87d..4fb6d43a06 100644\n--- a/app/test-eventdev/parser.c\n+++ b/app/test-eventdev/parser.c\n@@ -40,7 +40,7 @@ get_hex_val(char c)\n int\n parser_read_arg_bool(const char *p)\n {\n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \tint result = -EINVAL;\n \n \tif (((p[0] == 'y') && (p[1] == 'e') && (p[2] == 's')) ||\n@@ -67,7 +67,7 @@ parser_read_arg_bool(const char *p)\n \t\tresult = 0;\n \t}\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \n \tif (p[0] != '\\0')\n \t\treturn -EINVAL;\n@@ -81,7 +81,7 @@ parser_read_uint64(uint64_t *value, const char *p)\n \tchar *next;\n \tuint64_t val;\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \tif (!isdigit(*p))\n \t\treturn -EINVAL;\n \n@@ -107,7 +107,7 @@ parser_read_uint64(uint64_t *value, const char *p)\n \t\tbreak;\n \t}\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \tif (*p != '\\0')\n \t\treturn -EINVAL;\n \n@@ -121,7 +121,7 @@ parser_read_int32(int32_t *value, const char *p)\n \tchar *next;\n \tint32_t val;\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \tif (!isdigit(*p))\n \t\treturn -EINVAL;\n \n@@ -139,13 +139,13 @@ parser_read_uint64_hex(uint64_t *value, const char *p)\n \tchar *next;\n \tuint64_t val;\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \n \tval = strtoul(p, &next, 16);\n \tif (p == next)\n \t\treturn -EINVAL;\n \n-\tp = skip_white_spaces(next);\n+\tp = rte_str_skip_leading_spaces(next);\n \tif (*p != '\\0')\n \t\treturn -EINVAL;\n \ndiff --git a/app/test-eventdev/parser.h b/app/test-eventdev/parser.h\nindex 3617872997..6976efe877 100644\n--- a/app/test-eventdev/parser.h\n+++ b/app/test-eventdev/parser.h\n@@ -10,14 +10,6 @@\n \n #define PARSE_DELIMITER\t\t\t\t\" \\f\\n\\r\\t\\v\"\n \n-#define skip_white_spaces(pos)\t\t\t\\\n-({\t\t\t\t\t\t\\\n-\t__typeof__(pos) _p = (pos);\t\t\\\n-\tfor ( ; isspace(*_p); _p++)\t\t\\\n-\t\t;\t\t\t\t\\\n-\t_p;\t\t\t\t\t\\\n-})\n-\n static inline size_t\n skip_digits(const char *src)\n {\ndiff --git a/app/test-mldev/parser.c b/app/test-mldev/parser.c\nindex 277dcaedb2..ad761312fd 100644\n--- a/app/test-mldev/parser.c\n+++ b/app/test-mldev/parser.c\n@@ -12,6 +12,7 @@\n #include <string.h>\n \n #include <rte_common.h>\n+#include <rte_string_fns.h>\n \n #include \"parser.h\"\n \n@@ -52,7 +53,7 @@ get_hex_val(char c)\n int\n parser_read_arg_bool(const char *p)\n {\n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \tint result = -EINVAL;\n \n \tif (((p[0] == 'y') && (p[1] == 'e') && (p[2] == 's')) ||\n@@ -77,7 +78,7 @@ parser_read_arg_bool(const char *p)\n \t\tresult = 0;\n \t}\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \n \tif (p[0] != '\\0')\n \t\treturn -EINVAL;\n@@ -91,7 +92,7 @@ parser_read_uint64(uint64_t *value, const char *p)\n \tchar *next;\n \tuint64_t val;\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \tif (!isdigit(*p))\n \t\treturn -EINVAL;\n \n@@ -117,7 +118,7 @@ parser_read_uint64(uint64_t *value, const char *p)\n \t\tbreak;\n \t}\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \tif (*p != '\\0')\n \t\treturn -EINVAL;\n \n@@ -131,7 +132,7 @@ parser_read_int32(int32_t *value, const char *p)\n \tchar *next;\n \tint32_t val;\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \tif ((*p != '-') && (!isdigit(*p)))\n \t\treturn -EINVAL;\n \n@@ -149,7 +150,7 @@ parser_read_int16(int16_t *value, const char *p)\n \tchar *next;\n \tint16_t val;\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \tif ((*p != '-') && (!isdigit(*p)))\n \t\treturn -EINVAL;\n \n@@ -167,13 +168,13 @@ parser_read_uint64_hex(uint64_t *value, const char *p)\n \tchar *next;\n \tuint64_t val;\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \n \tval = strtoul(p, &next, 16);\n \tif (p == next)\n \t\treturn -EINVAL;\n \n-\tp = skip_white_spaces(next);\n+\tp = rte_str_skip_leading_spaces(next);\n \tif (*p != '\\0')\n \t\treturn -EINVAL;\n \ndiff --git a/app/test-mldev/parser.h b/app/test-mldev/parser.h\nindex 8b4207d0b0..b12b8f24c0 100644\n--- a/app/test-mldev/parser.h\n+++ b/app/test-mldev/parser.h\n@@ -12,14 +12,6 @@\n \n #define PARSE_DELIMITER \" \\f\\n\\r\\t\\v\"\n \n-#define skip_white_spaces(pos) \\\n-\t({ \\\n-\t\t__typeof__(pos) _p = (pos); \\\n-\t\tfor (; isspace(*_p); _p++) \\\n-\t\t\t; \\\n-\t\t_p; \\\n-\t})\n-\n static inline size_t\n skip_digits(const char *src)\n {\ndiff --git a/app/test-pmd/cmdline_tm.c b/app/test-pmd/cmdline_tm.c\nindex c11c80b158..6ce074f538 100644\n--- a/app/test-pmd/cmdline_tm.c\n+++ b/app/test-pmd/cmdline_tm.c\n@@ -11,6 +11,7 @@\n \n #include <rte_ethdev.h>\n #include <rte_flow.h>\n+#include <rte_string_fns.h>\n #include <rte_tm.h>\n \n #include \"testpmd.h\"\n@@ -19,14 +20,6 @@\n #define PARSE_DELIMITER\t\t\t\t\" \\f\\n\\r\\t\\v\"\n #define MAX_NUM_SHARED_SHAPERS\t\t256\n \n-#define skip_white_spaces(pos)\t\t\t\\\n-({\t\t\t\t\t\t\\\n-\t__typeof__(pos) _p = (pos);\t\t\\\n-\tfor ( ; isspace(*_p); _p++)\t\t\\\n-\t\t;\t\t\t\t\\\n-\t_p;\t\t\t\t\t\\\n-})\n-\n /** Display TM Error Message */\n static void\n print_err_msg(struct rte_tm_error *error)\n@@ -112,7 +105,7 @@ read_uint64(uint64_t *value, const char *p)\n \tchar *next;\n \tuint64_t val;\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \tif (!isdigit(*p))\n \t\treturn -EINVAL;\n \n@@ -138,7 +131,7 @@ read_uint64(uint64_t *value, const char *p)\n \t\tbreak;\n \t}\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \tif (*p != '\\0')\n \t\treturn -EINVAL;\n \ndiff --git a/app/test/test_string_fns.c b/app/test/test_string_fns.c\nindex ad41106df1..3b311325dc 100644\n--- a/app/test/test_string_fns.c\n+++ b/app/test/test_string_fns.c\n@@ -172,6 +172,39 @@ test_rte_strlcat(void)\n \treturn 0;\n }\n \n+static int\n+test_rte_str_skip_leading_spaces(void)\n+{\n+\tstatic const char empty[] = \"\";\n+\tstatic const char nowhitespace[] = \"Thereisreallynowhitespace\";\n+\tstatic const char somewhitespaces[] = \" \\f\\n\\r\\t\\vThere are some whitespaces\";\n+\tconst char *p;\n+\n+\tLOG(\"Checking '%s'\\n\", empty);\n+\tp = rte_str_skip_leading_spaces(empty);\n+\tif (p != empty) {\n+\t\tLOG(\"Returned address '%s' does not match expected result\\n\", p);\n+\t\treturn -1;\n+\t}\n+\tLOG(\"Got expected '%s'\\n\", p);\n+\tLOG(\"Checking '%s'\\n\", nowhitespace);\n+\tp = rte_str_skip_leading_spaces(nowhitespace);\n+\tif (p != nowhitespace) {\n+\t\tLOG(\"Returned address '%s' does not match expected result\\n\", p);\n+\t\treturn -1;\n+\t}\n+\tLOG(\"Got expected '%s'\\n\", p);\n+\tLOG(\"Checking '%s'\\n\", somewhitespaces);\n+\tp = rte_str_skip_leading_spaces(somewhitespaces);\n+\tif (p != strchr(somewhitespaces, 'T')) {\n+\t\tLOG(\"Returned address '%s' does not match expected result\\n\", p);\n+\t\treturn -1;\n+\t}\n+\tLOG(\"Got expected '%s'\\n\", p);\n+\n+\treturn 0;\n+}\n+\n static int\n test_string_fns(void)\n {\n@@ -179,6 +212,8 @@ test_string_fns(void)\n \t\treturn -1;\n \tif (test_rte_strlcat() < 0)\n \t\treturn -1;\n+\tif (test_rte_str_skip_leading_spaces() < 0)\n+\t\treturn -1;\n \treturn 0;\n }\n \ndiff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c\nindex f840804009..c15178e55b 100644\n--- a/examples/fips_validation/fips_validation.c\n+++ b/examples/fips_validation/fips_validation.c\n@@ -13,14 +13,6 @@\n \n #include \"fips_validation.h\"\n \n-#define skip_white_spaces(pos)\t\t\t\\\n-({\t\t\t\t\t\t\\\n-\t__typeof__(pos) _p = (pos);\t\t\\\n-\tfor ( ; isspace(*_p); _p++)\t\t\\\n-\t\t;\t\t\t\t\\\n-\t_p;\t\t\t\t\t\\\n-})\n-\n static int\n get_file_line(void)\n {\n@@ -579,13 +571,13 @@ parser_read_uint64_hex(uint64_t *value, const char *p)\n \tchar *next;\n \tuint64_t val;\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \n \tval = strtoul(p, &next, 16);\n \tif (p == next)\n \t\treturn -EINVAL;\n \n-\tp = skip_white_spaces(next);\n+\tp = rte_str_skip_leading_spaces(next);\n \tif (*p != '\\0')\n \t\treturn -EINVAL;\n \n@@ -759,7 +751,7 @@ parser_read_uint64(uint64_t *value, const char *p)\n \tchar *next;\n \tuint64_t val;\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \tif (!isdigit(*p))\n \t\treturn -EINVAL;\n \n@@ -785,7 +777,7 @@ parser_read_uint64(uint64_t *value, const char *p)\n \t\tbreak;\n \t}\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \tif (*p != '\\0')\n \t\treturn -EINVAL;\n \ndiff --git a/examples/ip_pipeline/parser.c b/examples/ip_pipeline/parser.c\nindex dfd71a71d3..62fc52f9db 100644\n--- a/examples/ip_pipeline/parser.c\n+++ b/examples/ip_pipeline/parser.c\n@@ -42,7 +42,7 @@ get_hex_val(char c)\n int\n parser_read_arg_bool(const char *p)\n {\n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \tint result = -EINVAL;\n \n \tif (((p[0] == 'y') && (p[1] == 'e') && (p[2] == 's')) ||\n@@ -69,7 +69,7 @@ parser_read_arg_bool(const char *p)\n \t\tresult = 0;\n \t}\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \n \tif (p[0] != '\\0')\n \t\treturn -EINVAL;\n@@ -83,7 +83,7 @@ parser_read_uint64(uint64_t *value, const char *p)\n \tchar *next;\n \tuint64_t val;\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \tif (!isdigit(*p))\n \t\treturn -EINVAL;\n \n@@ -109,7 +109,7 @@ parser_read_uint64(uint64_t *value, const char *p)\n \t\tbreak;\n \t}\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \tif (*p != '\\0')\n \t\treturn -EINVAL;\n \n@@ -123,13 +123,13 @@ parser_read_uint64_hex(uint64_t *value, const char *p)\n \tchar *next;\n \tuint64_t val;\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \n \tval = strtoul(p, &next, 16);\n \tif (p == next)\n \t\treturn -EINVAL;\n \n-\tp = skip_white_spaces(next);\n+\tp = rte_str_skip_leading_spaces(next);\n \tif (*p != '\\0')\n \t\treturn -EINVAL;\n \n@@ -420,7 +420,7 @@ parse_cpu_core(const char *entry,\n \n \tuint32_t s = 0, c = 0, h = 0, val;\n \tuint8_t s_parsed = 0, c_parsed = 0, h_parsed = 0;\n-\tconst char *next = skip_white_spaces(entry);\n+\tconst char *next = rte_str_skip_leading_spaces(entry);\n \tchar type;\n \n \tif (p == NULL)\ndiff --git a/examples/ip_pipeline/parser.h b/examples/ip_pipeline/parser.h\nindex 5224b18a89..32b5ff9976 100644\n--- a/examples/ip_pipeline/parser.h\n+++ b/examples/ip_pipeline/parser.h\n@@ -13,14 +13,6 @@\n \n #define PARSE_DELIMITER\t\t\t\t\" \\f\\n\\r\\t\\v\"\n \n-#define skip_white_spaces(pos)\t\t\t\\\n-({\t\t\t\t\t\t\\\n-\t__typeof__(pos) _p = (pos);\t\t\\\n-\tfor ( ; isspace(*_p); _p++)\t\t\\\n-\t\t;\t\t\t\t\\\n-\t_p;\t\t\t\t\t\\\n-})\n-\n static inline size_t\n skip_digits(const char *src)\n {\ndiff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c\nindex 2ae6cc579f..c1efea3c1a 100644\n--- a/examples/pipeline/cli.c\n+++ b/examples/pipeline/cli.c\n@@ -19,6 +19,7 @@\n #include <rte_swx_pipeline.h>\n #include <rte_swx_ctl.h>\n #include <rte_swx_ipsec.h>\n+#include <rte_string_fns.h>\n \n #include \"cli.h\"\n \n@@ -45,21 +46,13 @@\n #define MSG_FILE_NOT_ENOUGH \"Not enough rules in file \\\"%s\\\".\\n\"\n #define MSG_CMD_FAIL        \"Command \\\"%s\\\" failed.\\n\"\n \n-#define skip_white_spaces(pos)\t\t\t\\\n-({\t\t\t\t\t\t\\\n-\t__typeof__(pos) _p = (pos);\t\t\\\n-\tfor ( ; isspace(*_p); _p++)\t\t\\\n-\t\t;\t\t\t\t\\\n-\t_p;\t\t\t\t\t\\\n-})\n-\n static int\n parser_read_uint64(uint64_t *value, const char *p)\n {\n \tchar *next;\n \tuint64_t val;\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \tif (!isdigit(*p))\n \t\treturn -EINVAL;\n \n@@ -85,7 +78,7 @@ parser_read_uint64(uint64_t *value, const char *p)\n \t\tbreak;\n \t}\n \n-\tp = skip_white_spaces(p);\n+\tp = rte_str_skip_leading_spaces(p);\n \tif (*p != '\\0')\n \t\treturn -EINVAL;\n \ndiff --git a/lib/eal/include/rte_string_fns.h b/lib/eal/include/rte_string_fns.h\nindex bb43b2cba3..13badec7b3 100644\n--- a/lib/eal/include/rte_string_fns.h\n+++ b/lib/eal/include/rte_string_fns.h\n@@ -15,10 +15,12 @@\n extern \"C\" {\n #endif\n \n+#include <ctype.h>\n #include <stdio.h>\n #include <string.h>\n \n #include <rte_common.h>\n+#include <rte_compat.h>\n \n /**\n  * Takes string \"string\" parameter and splits it at character \"delim\"\n@@ -115,6 +117,31 @@ rte_strlcat(char *dst, const char *src, size_t size)\n ssize_t\n rte_strscpy(char *dst, const char *src, size_t dsize);\n \n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Search for the first non whitespace character.\n+ *\n+ * @param src\n+ *   The input string to be analysed.\n+ *\n+ * @return\n+ *  The address of the first non whitespace character.\n+ */\n+__rte_experimental\n+static inline const char *\n+rte_str_skip_leading_spaces(const char *src)\n+{\n+\tconst char *p = src;\n+\n+\twhile (isspace(*p))\n+\t\tp++;\n+\n+\treturn p;\n+}\n+\n+\n #ifdef __cplusplus\n }\n #endif\n",
    "prefixes": [
        "v2",
        "1/3"
    ]
}