Hi all, This is the result of my work during the latest Hack Week at SUSE:
https://hackweek.suse.com/19/projects/dmidecode-no-more-open-coded-printfs I came up with a set of 11 print helper functions to replace all the random printf() calls throughout the dmidecode source code. These helper functions have a meaning attached, so we move from a dumb character-level output to something more symbolic. The default implementation for these functions generates exactly the same output as before, so there are no functional changes included in this patch set from the user's perspective (that was actually a project design goal). The idea is that these functions can later be replaced by alternatives which would generate a different, possibly structured output format, like XML or JSON. We are not there yet but I believe this is a necessary first step into this direction. [PATCH 01/11] dmidecode: Add helper function pr_comment [PATCH 02/11] dmidecode: Add helper function pr_info [PATCH 03/11] dmidecode: Protect dmidecode.h against double inclusion [PATCH 04/11] dmidecode: Add helper function pr_handle [PATCH 05/11] dmidecode: Add helper function pr_handle_name [PATCH 06/11] dmidecode: Add helper function pr_attr [PATCH 07/11] dmidecode: Add helper functions pr_list_start/item/end [PATCH 08/11] dmidecode: Add helper function pr_subattr [PATCH 09/11] dmidecode: Use the print helpers in dump mode too [PATCH 10/11] dmidecode: Add helper function for separators [PATCH 11/11] dmidecode: Add helper function for structure errors -- Jean Delvare SUSE L3 Support _______________________________________________ https://lists.nongnu.org/mailman/listinfo/dmidecode-devel