DPDK patches and discussions
 help / color / Atom feed
From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
To: dev@dpdk.org
Cc: "Kinsella, Ray" <mdr@ashroe.eu>, Khoa To <khot@microsoft.com>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,
	Olivier Matz <olivier.matz@6wind.com>
Subject: [dpdk-dev] [PATCH v3 4/7] cmdline: add internal wrapper for vdprintf
Date: Tue, 29 Sep 2020 00:50:49 +0300
Message-ID: <20200928215052.23627-5-dmitry.kozliuk@gmail.com> (raw)
In-Reply-To: <20200928215052.23627-1-dmitry.kozliuk@gmail.com>

Add internal wrapper for vdprintf(3) that is only available on Unix.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
 lib/librte_cmdline/cmdline.c         | 2 +-
 lib/librte_cmdline/cmdline_os_unix.c | 6 ++++++
 lib/librte_cmdline/cmdline_private.h | 8 ++++++++
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/lib/librte_cmdline/cmdline.c b/lib/librte_cmdline/cmdline.c
index 0b2e1e30b..49770869b 100644
--- a/lib/librte_cmdline/cmdline.c
+++ b/lib/librte_cmdline/cmdline.c
@@ -131,7 +131,7 @@ cmdline_printf(const struct cmdline *cl, const char *fmt, ...)
 	if (cl->s_out < 0)
 		return;
 	va_start(ap, fmt);
-	vdprintf(cl->s_out, fmt, ap);
+	cmdline_vdprintf(cl->s_out, fmt, ap);
 	va_end(ap);
 }
 
diff --git a/lib/librte_cmdline/cmdline_os_unix.c b/lib/librte_cmdline/cmdline_os_unix.c
index a4916c197..64a945a34 100644
--- a/lib/librte_cmdline/cmdline_os_unix.c
+++ b/lib/librte_cmdline/cmdline_os_unix.c
@@ -45,3 +45,9 @@ cmdline_read_char(struct cmdline *cl, char *c)
 {
 	return read(cl->s_in, c, 1);
 }
+
+int
+cmdline_vdprintf(int fd, const char *format, va_list op)
+{
+	return vdprintf(fd, format, op);
+}
diff --git a/lib/librte_cmdline/cmdline_private.h b/lib/librte_cmdline/cmdline_private.h
index ac10de4f8..4d9ea33f0 100644
--- a/lib/librte_cmdline/cmdline_private.h
+++ b/lib/librte_cmdline/cmdline_private.h
@@ -5,6 +5,10 @@
 #ifndef _CMDLINE_PRIVATE_H_
 #define _CMDLINE_PRIVATE_H_
 
+#include <stdarg.h>
+
+#include <rte_common.h>
+
 #include <cmdline.h>
 
 /* Disable buffering and echoing, save previous settings to oldterm. */
@@ -19,4 +23,8 @@ int cmdline_poll_char(struct cmdline *cl);
 /* Read one character from input. */
 ssize_t cmdline_read_char(struct cmdline *cl, char *c);
 
+/* vdprintf(3) */
+__rte_format_printf(2, 0)
+int cmdline_vdprintf(int fd, const char *format, va_list op);
+
 #endif
-- 
2.28.0


  parent reply index

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-20 21:05 [dpdk-dev] [PATCH 0/7] cmdline: support Windows Dmitry Kozlyuk
2020-06-20 21:05 ` [dpdk-dev] [PATCH 1/7] cmdline: make implementation opaque Dmitry Kozlyuk
2020-06-20 21:05 ` [dpdk-dev] [PATCH 2/7] cmdline: add internal wrappers for terminal handling Dmitry Kozlyuk
2020-06-20 21:05 ` [dpdk-dev] [PATCH 3/7] cmdline: add internal wrappers for character input Dmitry Kozlyuk
2020-06-20 21:05 ` [dpdk-dev] [PATCH 4/7] cmdline: add internal wrapper for vdprintf Dmitry Kozlyuk
2020-06-20 21:05 ` [dpdk-dev] [PATCH 5/7] eal/windows: improve compatibility networking headers Dmitry Kozlyuk
2020-06-20 21:05 ` [dpdk-dev] [PATCH 6/7] cmdline: support Windows Dmitry Kozlyuk
2020-06-28 14:20   ` Fady Bader
2020-06-29  6:23     ` Ranjit Menon
2020-06-29  7:42       ` Dmitry Kozlyuk
2020-06-29  8:12         ` Tal Shnaiderman
2020-06-29 23:56           ` Dmitry Kozlyuk
2020-07-08  1:09             ` Dmitry Kozlyuk
2020-06-20 21:05 ` [dpdk-dev] [PATCH 7/7] examples/cmdline: build on Windows Dmitry Kozlyuk
2020-07-17 22:16 ` [dpdk-dev] [PATCH 0/7] cmdline: support Windows Narcisa Ana Maria Vasile
2020-07-30 18:08 ` Kadam, Pallavi
2020-07-30 21:06 ` [dpdk-dev] [PATCH v2 " Dmitry Kozlyuk
2020-07-30 21:06   ` [dpdk-dev] [PATCH v2 1/7] cmdline: make implementation opaque Dmitry Kozlyuk
2020-08-05  9:31     ` Kinsella, Ray
2020-08-05 11:17       ` Dmitry Kozlyuk
2020-09-30  8:11         ` Kinsella, Ray
2020-09-30 15:26           ` Dmitry Kozlyuk
2020-09-17 13:34     ` Olivier Matz
2020-09-17 17:05       ` Stephen Hemminger
2020-09-18  8:33         ` Bruce Richardson
2020-09-18 12:13           ` Ferruh Yigit
2020-09-18 13:23         ` Kinsella, Ray
2020-09-17 23:13       ` Dmitry Kozlyuk
2020-09-18 13:31       ` Kinsella, Ray
2020-07-30 21:06   ` [dpdk-dev] [PATCH v2 2/7] cmdline: add internal wrappers for terminal handling Dmitry Kozlyuk
2020-07-30 21:06   ` [dpdk-dev] [PATCH v2 3/7] cmdline: add internal wrappers for character input Dmitry Kozlyuk
2020-07-30 21:06   ` [dpdk-dev] [PATCH v2 4/7] cmdline: add internal wrapper for vdprintf Dmitry Kozlyuk
2020-07-30 21:06   ` [dpdk-dev] [PATCH v2 5/7] eal/windows: improve compatibility networking headers Dmitry Kozlyuk
2020-07-30 21:06   ` [dpdk-dev] [PATCH v2 6/7] cmdline: support Windows Dmitry Kozlyuk
2020-07-30 21:06   ` [dpdk-dev] [PATCH v2 7/7] examples/cmdline: build on Windows Dmitry Kozlyuk
2020-09-26  1:33     ` [dpdk-dev] [EXTERNAL] " Narcisa Ana Maria Vasile
2020-09-26  6:03       ` Khoa To
2020-09-28 21:50   ` [dpdk-dev] [PATCH v3 0/7] cmdline: support Windows Dmitry Kozlyuk
2020-09-28 21:50     ` [dpdk-dev] [PATCH v3 1/7] cmdline: make implementation logically opaque Dmitry Kozlyuk
2020-09-30  8:12       ` Kinsella, Ray
2020-09-28 21:50     ` [dpdk-dev] [PATCH v3 2/7] cmdline: add internal wrappers for terminal handling Dmitry Kozlyuk
2020-09-28 21:50     ` [dpdk-dev] [PATCH v3 3/7] cmdline: add internal wrappers for character input Dmitry Kozlyuk
2020-09-28 21:50     ` Dmitry Kozlyuk [this message]
2020-09-28 21:50     ` [dpdk-dev] [PATCH v3 5/7] eal/windows: improve compatibility networking headers Dmitry Kozlyuk
2020-09-28 21:50     ` [dpdk-dev] [PATCH v3 6/7] cmdline: support Windows Dmitry Kozlyuk
2020-10-14 22:31       ` Thomas Monjalon
2020-09-28 21:50     ` [dpdk-dev] [PATCH v3 7/7] examples/cmdline: build on Windows Dmitry Kozlyuk
2020-10-14 22:33       ` Thomas Monjalon
2020-10-05 15:33     ` [dpdk-dev] [PATCH v3 0/7] cmdline: support Windows Olivier Matz
2020-10-14 22:41       ` Thomas Monjalon

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200928215052.23627-5-dmitry.kozliuk@gmail.com \
    --to=dmitry.kozliuk@gmail.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=khot@microsoft.com \
    --cc=mdr@ashroe.eu \
    --cc=olivier.matz@6wind.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox