From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 3 12:51:22 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7226162; Wed, 3 Dec 2014 12:51:22 +0000 (UTC) Received: from mailout03.t-online.de (mailout03.t-online.de [194.25.134.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8DE9116; Wed, 3 Dec 2014 12:51:22 +0000 (UTC) Received: from fwd26.aul.t-online.de (fwd26.aul.t-online.de [172.20.26.131]) by mailout03.t-online.de (Postfix) with SMTP id 3502E8CF33; Wed, 3 Dec 2014 13:51:14 +0100 (CET) Received: from [192.168.119.11] (JOMvUmZVrh4b9zlthkYwFYPROTLKO3ndXkFr8lRrq1Klb6ItYCGcs8bm4lwqGQcZ-l@[84.154.125.71]) by fwd26.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1Xw9Oh-1XM7VY0; Wed, 3 Dec 2014 13:51:11 +0100 Message-ID: <547F073A.2090502@freebsd.org> Date: Wed, 03 Dec 2014 13:51:06 +0100 From: Stefan Esser User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: "freebsd-hackers@freebsd.org" Subject: [Review] pciconf converted to use libxo [D1206] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-ID: JOMvUmZVrh4b9zlthkYwFYPROTLKO3ndXkFr8lRrq1Klb6ItYCGcs8bm4lwqGQcZ-l X-TOI-MSGID: 1ee32d57-af6a-4c71-8294-ac956104ae95 Cc: phil Shafer , "Simon J. Gerraty" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 12:51:23 -0000 Hi all, the following review URL shows my proposed changes to make pciconf optionally output XML or JSON formatted data via libxo: https://reviews.freebsd.org/D1206 I wanted to see how much effort the conversion of a utility that was not written with libxo in mind makes - and I'm pleased by the possibility to mostly mechanically replace printf/err/warn calls with their libxo counterparts. The documentation of libxo seems incomplete (e.g. no mention of xo_error() that I could find), and some functions do not seem to produce the expected result (xo_err() prints the message as given in the format string, but does not automatically append strerror() as err() does ...). A FreeBSD man-page that lists all functions and that can be used as a reference when libxo principles are already known would be really great. ;-) Since the behaviour of pciconf has not changed unless invoked with "--libxo", I could check in this version without worrying about a violation of POLA. But I thought I might learn how to use Phabricator and offer an opportunity to comment on proposed XML/JSON tags or my general use of libxo features ... Please let me know whether these is something wrong in the XML or JSON output (bad tags names, bad use of xo_ functions to generate the output, ...). The HTML-Output looks ugly if directly viewed in a web browser, but that's not different than what other utilities converted to use libxo produce ... Regards, STefan