mbox series

[v3,0/7] cmdline: support Windows

Message ID 20200928215052.23627-1-dmitry.kozliuk@gmail.com (mailing list archive)
Headers show
Series cmdline: support Windows | expand

Message

Dmitry Kozlyuk Sept. 28, 2020, 9:50 p.m. UTC
This patchset enables librte_cmdline on Windows. To do that, it creates
a number of wrappers for OS-dependent terminal handling and I/O.
Considered alternative was to revive [1] and use libedit (Unix-only)
for terminal handling. However, testing revealed that WinEditLine [2]
is not a drop-in replacement for libedit, so this solution wouldn't be
universal.

[1]: http://patchwork.dpdk.org/patch/38561
[2]: http://mingweditline.sourceforge.net

v3:
    * Add #ifdef workaround to keep API/ABI for Unices (Olivier).
    * Fix missing cmdline_free() in test (Olivier).
    * Rebase on ToT (Khoa).

Dmitry Kozlyuk (7):
  cmdline: make implementation logically opaque
  cmdline: add internal wrappers for terminal handling
  cmdline: add internal wrappers for character input
  cmdline: add internal wrapper for vdprintf
  eal/windows: improve compatibility networking headers
  cmdline: support Windows
  examples/cmdline: build on Windows

 app/test-cmdline/commands.c                 |   8 +-
 app/test/test_cmdline_lib.c                 |  44 ++---
 config/meson.build                          |   2 +
 doc/guides/rel_notes/deprecation.rst        |   4 +
 examples/cmdline/commands.c                 |   1 -
 examples/cmdline/main.c                     |   1 -
 examples/meson.build                        |   6 +-
 lib/librte_cmdline/cmdline.c                |  30 +--
 lib/librte_cmdline/cmdline.h                |  18 +-
 lib/librte_cmdline/cmdline_os_unix.c        |  53 +++++
 lib/librte_cmdline/cmdline_os_windows.c     | 207 ++++++++++++++++++++
 lib/librte_cmdline/cmdline_parse.c          |   5 +-
 lib/librte_cmdline/cmdline_private.h        |  53 +++++
 lib/librte_cmdline/cmdline_socket.c         |  25 +--
 lib/librte_cmdline/cmdline_vt100.c          |   1 -
 lib/librte_cmdline/cmdline_vt100.h          |   4 +
 lib/librte_cmdline/meson.build              |   6 +
 lib/librte_cmdline/rte_cmdline_version.map  |   8 +
 lib/librte_eal/windows/include/arpa/inet.h  |  30 +++
 lib/librte_eal/windows/include/netinet/in.h |  12 ++
 lib/librte_eal/windows/include/sys/socket.h |  24 +++
 lib/meson.build                             |   1 +
 22 files changed, 475 insertions(+), 68 deletions(-)
 create mode 100644 lib/librte_cmdline/cmdline_os_unix.c
 create mode 100644 lib/librte_cmdline/cmdline_os_windows.c
 create mode 100644 lib/librte_cmdline/cmdline_private.h
 create mode 100644 lib/librte_eal/windows/include/arpa/inet.h
 create mode 100644 lib/librte_eal/windows/include/sys/socket.h

Comments

Olivier Matz Oct. 5, 2020, 3:33 p.m. UTC | #1
Hi Dmitry,

On Tue, Sep 29, 2020 at 12:50:45AM +0300, Dmitry Kozlyuk wrote:
> This patchset enables librte_cmdline on Windows. To do that, it creates
> a number of wrappers for OS-dependent terminal handling and I/O.
> Considered alternative was to revive [1] and use libedit (Unix-only)
> for terminal handling. However, testing revealed that WinEditLine [2]
> is not a drop-in replacement for libedit, so this solution wouldn't be
> universal.
> 
> [1]: http://patchwork.dpdk.org/patch/38561
> [2]: http://mingweditline.sourceforge.net
> 
> v3:
>     * Add #ifdef workaround to keep API/ABI for Unices (Olivier).
>     * Fix missing cmdline_free() in test (Olivier).
>     * Rebase on ToT (Khoa).
> 
> Dmitry Kozlyuk (7):
>   cmdline: make implementation logically opaque
>   cmdline: add internal wrappers for terminal handling
>   cmdline: add internal wrappers for character input
>   cmdline: add internal wrapper for vdprintf
>   eal/windows: improve compatibility networking headers
>   cmdline: support Windows
>   examples/cmdline: build on Windows
> 
>  app/test-cmdline/commands.c                 |   8 +-
>  app/test/test_cmdline_lib.c                 |  44 ++---
>  config/meson.build                          |   2 +
>  doc/guides/rel_notes/deprecation.rst        |   4 +
>  examples/cmdline/commands.c                 |   1 -
>  examples/cmdline/main.c                     |   1 -
>  examples/meson.build                        |   6 +-
>  lib/librte_cmdline/cmdline.c                |  30 +--
>  lib/librte_cmdline/cmdline.h                |  18 +-
>  lib/librte_cmdline/cmdline_os_unix.c        |  53 +++++
>  lib/librte_cmdline/cmdline_os_windows.c     | 207 ++++++++++++++++++++
>  lib/librte_cmdline/cmdline_parse.c          |   5 +-
>  lib/librte_cmdline/cmdline_private.h        |  53 +++++
>  lib/librte_cmdline/cmdline_socket.c         |  25 +--
>  lib/librte_cmdline/cmdline_vt100.c          |   1 -
>  lib/librte_cmdline/cmdline_vt100.h          |   4 +
>  lib/librte_cmdline/meson.build              |   6 +
>  lib/librte_cmdline/rte_cmdline_version.map  |   8 +
>  lib/librte_eal/windows/include/arpa/inet.h  |  30 +++
>  lib/librte_eal/windows/include/netinet/in.h |  12 ++
>  lib/librte_eal/windows/include/sys/socket.h |  24 +++
>  lib/meson.build                             |   1 +
>  22 files changed, 475 insertions(+), 68 deletions(-)
>  create mode 100644 lib/librte_cmdline/cmdline_os_unix.c
>  create mode 100644 lib/librte_cmdline/cmdline_os_windows.c
>  create mode 100644 lib/librte_cmdline/cmdline_private.h
>  create mode 100644 lib/librte_eal/windows/include/arpa/inet.h
>  create mode 100644 lib/librte_eal/windows/include/sys/socket.h

For series:
Acked-by: Olivier Matz <olivier.matz@6wind.com>

Thanks!
Thomas Monjalon Oct. 14, 2020, 10:41 p.m. UTC | #2
> > Dmitry Kozlyuk (7):
> >   cmdline: make implementation logically opaque
> >   cmdline: add internal wrappers for terminal handling
> >   cmdline: add internal wrappers for character input
> >   cmdline: add internal wrapper for vdprintf
> >   eal/windows: improve compatibility networking headers
> >   cmdline: support Windows
> >   examples/cmdline: build on Windows
> 
> For series:
> Acked-by: Olivier Matz <olivier.matz@6wind.com>

Applied with few changes described in the thread, thanks.