[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [dmidecode] [PATCH] dmidecode: Prepare for alternative output format

From: Jean Delvare
Subject: Re: [dmidecode] [PATCH] dmidecode: Prepare for alternative output formats
Date: Wed, 08 Apr 2020 10:21:00 +0200

Hi Petter,

On Tue, 2020-04-07 at 20:20 +0200, Petter Reinholdtsen wrote:
> [Jean Delvare]
> > Declare the output functions as function pointers, and assign the
> > default plain text output functions to them at run time. In the
> > future, alternative output formats can be added.
> What about providing the set of functions as a struct instead of
> assiging to a "static" set of pointers?  It allow for some extra
> flexibility.

Thanks for the feedback. I also had a struct in mind originally, but
changed my mind to what I posted, mainly to avoir having to rewrite the
562 calls to print functions to use a different syntax.

Thinking about it again, maybe we can have both, a nice structure with
all the functions pointers, and a set of macros to translate from
pr_attr() etc. to the equivalent struct member. I'll give it a try.

Jean Delvare
SUSE L3 Support

reply via email to

[Prev in Thread] Current Thread [Next in Thread]