[edk2-devel] [PATCH v12 0/6] jansson edk2 port

Michael D Kinney michael.d.kinney at intel.com
Wed Jan 6 17:26:37 UTC 2021


Hi Abner,

I was looking at the PrintLib class documentation and did not see '.'
mentioned.  I agree the BasePrintLib implementation does support '.'.
I think we need to update the PrintLib class header file.

I agree your code supports/preserves the [flags][width][.precision][length] specifiers.

Thanks,

Mike

> -----Original Message-----
> From: Chang, Abner (HPS SW/FW Technologist) <abner.chang at hpe.com>
> Sent: Monday, January 4, 2021 11:12 PM
> To: Kinney, Michael D <michael.d.kinney at intel.com>; devel at edk2.groups.io
> Cc: Sean Brogan <sean.brogan at microsoft.com>; Bret Barkelew <Bret.Barkelew at microsoft.com>; Andrew Fish <afish at apple.com>;
> Laszlo Ersek <lersek at redhat.com>; Leif Lindholm <leif at nuviainc.com>; Liming Gao <gaoliming at byosoft.com.cn>; Wang, Nickle
> (HPS SW) <nickle.wang at hpe.com>; O'Hanley, Peter (EXL) <peter.ohanley at hpe.com>
> Subject: RE: [edk2-devel] [PATCH v12 0/6] jansson edk2 port
> 
> Hi Mike,
> I had corrected code to support %[flags][width][.precision][length]s format and replace 's' with 'a'.
> I wrote some code using RedfishCrtLib to test print strings, edk2  PrintLib does support '.'  with number to limit the
> length of string, '-', '+','*' and number for the width are supported as well.
> 
> Abner
> 
> > -----Original Message-----
> > From: Kinney, Michael D [mailto:michael.d.kinney at intel.com]
> > Sent: Tuesday, January 5, 2021 9:09 AM
> > To: devel at edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> > <abner.chang at hpe.com>; Kinney, Michael D <michael.d.kinney at intel.com>
> > Cc: Sean Brogan <sean.brogan at microsoft.com>; Bret Barkelew
> > <Bret.Barkelew at microsoft.com>; Andrew Fish <afish at apple.com>; Laszlo
> > Ersek <lersek at redhat.com>; Leif Lindholm <leif at nuviainc.com>; Liming Gao
> > <gaoliming at byosoft.com.cn>; Wang, Nickle (HPS SW)
> > <nickle.wang at hpe.com>; O'Hanley, Peter (EXL) <peter.ohanley at hpe.com>
> > Subject: RE: [edk2-devel] [PATCH v12 0/6] jansson edk2 port
> >
> > Hi Abner,
> >
> > I do see a few uses of the width field through error_set() calls.
> >
> >                     error_set(error, lex, json_error_invalid_syntax,
> >                               "invalid Unicode escape '%.6s'", p - 1);
> >
> >
> > The EDK II PrintLib does not support the precision '.' specifier.
> >
> > Mike
> >
> > > -----Original Message-----
> > > From: Kinney, Michael D <michael.d.kinney at intel.com>
> > > Sent: Monday, January 4, 2021 3:02 PM
> > > To: devel at edk2.groups.io; abner.chang at hpe.com; Kinney, Michael D
> > > <michael.d.kinney at intel.com>
> > > Cc: Sean Brogan <sean.brogan at microsoft.com>; Bret Barkelew
> > > <Bret.Barkelew at microsoft.com>; Andrew Fish <afish at apple.com>; Laszlo
> > > Ersek <lersek at redhat.com>; Leif Lindholm <leif at nuviainc.com>; Liming
> > > Gao <gaoliming at byosoft.com.cn>; Nickle Wang <nickle.wang at hpe.com>;
> > > Peter O'Hanley <peter.ohanley at hpe.com>
> > > Subject: RE: [edk2-devel] [PATCH v12 0/6] jansson edk2 port
> > >
> > > Hi Abner,
> > >
> > > The format conversion functions do not handle field withs (e.g. %20s, %-
> > 10s).
> > >
> > > Also, I see the attribution to edk2-libc, but the implementations of
> > > some of those functions and the function descriptions do not match the
> > > edk2-libc versions.  Can you verify with the contributors on where
> > > this content came from?  The reason I ask is that the file has
> > > Intel/HP copyright and a BSD-2-Clause-Patent license and I want to make
> > sure those are correct.
> > >
> > > Thanks,
> > >
> > > Mike
> > >
> > > > -----Original Message-----
> > > > From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of
> > Abner
> > > > Chang
> > > > Sent: Monday, December 28, 2020 9:56 PM
> > > > To: devel at edk2.groups.io
> > > > Cc: Sean Brogan <sean.brogan at microsoft.com>; Bret Barkelew
> > > > <Bret.Barkelew at microsoft.com>; Andrew Fish <afish at apple.com>;
> > Laszlo
> > > > Ersek <lersek at redhat.com>; Leif Lindholm <leif at nuviainc.com>;
> > > > Kinney, Michael D <michael.d.kinney at intel.com>; Liming Gao
> > > > <gaoliming at byosoft.com.cn>; Nickle Wang <nickle.wang at hpe.com>;
> > Peter
> > > > O'Hanley <peter.ohanley at hpe.com>
> > > > Subject: [edk2-devel] [PATCH v12 0/6] jansson edk2 port
> > > >
> > > > In v12, - Convert Ascii(V)SPrint format string to ASCII format.
> > > > In v11, - Move RedfishCrtLib to under /PrivateLibrary
> > > >         - Optimize /wdxxxx build options for IA32/X64 In v10, -
> > > > Rename CrtLib to RedfishCrtLib
> > > >         - Review JsonLib /wd build options for Visual Studio.
> > > > In v9, - Address comments given by Mike Kinney on 12/21 In v8, -
> > > > Assigne patch file order
> > > >        - Add Acked-by tags
> > > > In v7, - Remove C RTC header files to under [Include.Common.Private]
> > > >          in RedfishPkg.dec.
> > > >        - address comments given by Mike Kinney.
> > > > In v6, Remove JanssonJsonMapping.h
> > > > In v5, move BaseUcs2Utf8Lib to under RedfishPkg.
> > > > In v4,
> > > >        - Address review comments
> > > >        - Seperate CRT functions to a individule library CrtLib under
> > > >          RedfishPkg.
> > > >        - Seperate UCS2-UTF8 functions to a individule library
> > > >          BaseUcs2Utf8Lib under MdeModulePkg.
> > > >
> > > > In v3, Add jansson library as the required submoudle in
> > > >        CiSettings.py for CI test.
> > > > In v2, JsonLib is moved to under RedfishPkg.
> > > >
> > > > edk2 JSON library is based on jansson open source
> > > > (https://github.com/akheron/jansson) and wrapped as an edk2 library.
> > > > edk2 JsonLib will be used by edk2 Redfish feature drivers (not
> > > > contributed yet) and the edk2 port of libredfish library (not
> > > > contributed yet) based on DMTF GitHub
> > > > (https://github.com/DMTF/libredfish).
> > > >
> > > > Jansson is licensed under the MIT license(refer to ReadMe.rst under
> > edk2).
> > > > It is used in production and its API is stable. In UEFI/EDKII
> > > > environment, Redfish project consumes jansson to achieve JSON
> > operations.
> > > >
> > > > * Jansson version on edk2: 2.13.1
> > > >
> > > > * EDKII jansson library wrapper:
> > > >    - JsonLib.h:
> > > >      This is the denifitions of EDKII JSON APIs which are mapped to
> > > >      jannson funcitons accordingly.
> > > >
> > > >    - JanssonJsonLibMapping.h:
> > > >      This is the wrapper file to map funcitons and definitions used in
> > > >      native jannson applications to edk2 JsonLib. This avoids the
> > > >      modifications on native jannson applications to be built under
> > > >      edk2 environment.
> > > >
> > > > *Known issue:
> > > >   Build fail with jansson/src/load.c, overrride and add code in load.c
> > > >   to conditionally use stdin according to HAVE_UNISTD_H macro.
> > > >   The PR is submitted to jansson open source community.
> > > >   https://github.com/akheron/jansson/pull/558
> > > >
> > > > Signed-off-by: Abner Chang <abner.chang at hpe.com>
> > > >
> > > > Cc: Sean Brogan <sean.brogan at microsoft.com>
> > > > Cc: Bret Barkelew <Bret.Barkelew at microsoft.com>
> > > > Cc: Andrew Fish <afish at apple.com>
> > > > Cc: Laszlo Ersek <lersek at redhat.com>
> > > > Cc: Leif Lindholm <leif at nuviainc.com>
> > > > Cc: Michael D Kinney <michael.d.kinney at intel.com>
> > > > Cc: Liming Gao <gaoliming at byosoft.com.cn>
> > > > Cc: Nickle Wang <nickle.wang at hpe.com>
> > > > Cc: Peter O'Hanley <peter.ohanley at hpe.com>
> > > >
> > > > Abner Chang (6):
> > > >   RedfishPkg/Ucs2Utf8lib: UCS2 to UFT8 manipulation library
> > > >   edk2: jansson submodule for edk2 JSON library
> > > >   RedfishPkg/CrtLib: C runtime library
> > > >   RedfishPkg/library: EDK2 port of jansson library
> > > >   RedfishPkg: Add EDK2 port of jansson library to build
> > > >   .pytool: Add required submodule for JsonLib
> > > >
> > > >  .gitmodules                                   |    3 +
> > > >  .pytool/CISettings.py                         |    2 +
> > > >  ReadMe.rst                                    |    1 +
> > > >  RedfishPkg/Include/Crt/assert.h               |   16 +
> > > >  RedfishPkg/Include/Crt/errno.h                |   16 +
> > > >  RedfishPkg/Include/Crt/limits.h               |   16 +
> > > >  RedfishPkg/Include/Crt/math.h                 |   16 +
> > > >  RedfishPkg/Include/Crt/stdarg.h               |   15 +
> > > >  RedfishPkg/Include/Crt/stddef.h               |   16 +
> > > >  RedfishPkg/Include/Crt/stdio.h                |   15 +
> > > >  RedfishPkg/Include/Crt/stdlib.h               |   16 +
> > > >  RedfishPkg/Include/Crt/string.h               |   16 +
> > > >  RedfishPkg/Include/Crt/sys/time.h             |   15 +
> > > >  RedfishPkg/Include/Crt/sys/types.h            |   15 +
> > > >  RedfishPkg/Include/Crt/time.h                 |   15 +
> > > >  RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h  |   61 +
> > > >  RedfishPkg/Include/Library/CrtLib.h           |  191 +++
> > > >  RedfishPkg/Include/Library/JsonLib.h          |  763 +++++++++++
> > > >  .../Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c |  421 +++++++
> > > >  .../BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf       |   31 +
> > > >  RedfishPkg/Library/CrtLib/CrtLib.c            |  595 +++++++++
> > > >  RedfishPkg/Library/CrtLib/CrtLib.inf          |   38 +
> > > >  RedfishPkg/Library/JsonLib/JsonLib.c          |  964 ++++++++++++++
> > > >  RedfishPkg/Library/JsonLib/JsonLib.inf        |   89 ++
> > > >  RedfishPkg/Library/JsonLib/Readme.rst         |   40 +
> > > >  RedfishPkg/Library/JsonLib/jansson            |    1 +
> > > >  RedfishPkg/Library/JsonLib/jansson_config.h   |   41 +
> > > >  .../Library/JsonLib/jansson_private_config.h  |   19 +
> > > >  RedfishPkg/Library/JsonLib/load.c             | 1111 +++++++++++++++++
> > > >  RedfishPkg/RedfishLibs.dsc.inc                |    3 +
> > > >  RedfishPkg/RedfishPkg.ci.yaml                 |   25 +
> > > >  RedfishPkg/RedfishPkg.dec                     |   25 +
> > > >  RedfishPkg/RedfishPkg.dsc                     |    3 +
> > > >  33 files changed, 4614 insertions(+)  create mode 100644
> > > > RedfishPkg/Include/Crt/assert.h  create mode 100644
> > > > RedfishPkg/Include/Crt/errno.h  create mode 100644
> > > > RedfishPkg/Include/Crt/limits.h  create mode 100644
> > > > RedfishPkg/Include/Crt/math.h  create mode 100644
> > > > RedfishPkg/Include/Crt/stdarg.h  create mode 100644
> > > > RedfishPkg/Include/Crt/stddef.h  create mode 100644
> > > > RedfishPkg/Include/Crt/stdio.h  create mode 100644
> > > > RedfishPkg/Include/Crt/stdlib.h  create mode 100644
> > > > RedfishPkg/Include/Crt/string.h  create mode 100644
> > > > RedfishPkg/Include/Crt/sys/time.h  create mode 100644
> > > > RedfishPkg/Include/Crt/sys/types.h
> > > >  create mode 100644 RedfishPkg/Include/Crt/time.h  create mode
> > > > 100644 RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h
> > > >  create mode 100644 RedfishPkg/Include/Library/CrtLib.h
> > > >  create mode 100644 RedfishPkg/Include/Library/JsonLib.h
> > > >  create mode 100644
> > > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c
> > > >  create mode 100644
> > > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf
> > > >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.c
> > > >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.inf
> > > >  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.c
> > > >  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.inf
> > > >  create mode 100644 RedfishPkg/Library/JsonLib/Readme.rst
> > > >  create mode 160000 RedfishPkg/Library/JsonLib/jansson
> > > >  create mode 100644 RedfishPkg/Library/JsonLib/jansson_config.h
> > > >  create mode 100644
> > > > RedfishPkg/Library/JsonLib/jansson_private_config.h
> > > >  create mode 100644 RedfishPkg/Library/JsonLib/load.c
> > > >
> > > > --
> > > > 2.17.1
> > > >
> > > >
> > > >
> > > > 
> > > >
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#69852): https://edk2.groups.io/g/devel/message/69852
Mute This Topic: https://groups.io/mt/79286358/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list