From owner-freebsd-arch@FreeBSD.ORG Sun Jul 7 15:56:21 2013 Return-Path: Delivered-To: arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F35C244C; Sun, 7 Jul 2013 15:56:20 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id BB5C11966; Sun, 7 Jul 2013 15:56:20 +0000 (UTC) Received: from critter.freebsd.dk (unknown [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id B8E783EB70; Sun, 7 Jul 2013 15:56:13 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.7/8.14.7) with ESMTP id r67FuDsH002870; Sun, 7 Jul 2013 15:56:13 GMT (envelope-from phk@phk.freebsd.dk) To: Pawel Jakub Dawidek Subject: Re: General purpose library for name/value pairs. In-reply-to: <20130706194124.GE25842@garage.freebsd.pl> From: "Poul-Henning Kamp" References: <20130704215329.GG1402@garage.freebsd.pl> <4818.1373008073@critter.freebsd.dk> <20130705195255.GB25842@garage.freebsd.pl> <60317.1373055040@critter.freebsd.dk> <20130706194124.GE25842@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1 Date: Sun, 07 Jul 2013 15:56:13 +0000 Message-ID: <2869.1373212573@critter.freebsd.dk> Cc: arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 15:56:21 -0000 In message <20130706194124.GE25842@garage.freebsd.pl>, Pawel Jakub Dawidek writ es: >> Maybe the basic n/v should just do strings, and interpretation of >> strings be a layer above ? > >It would make getting values from the nvlist a hell - dealing with >strto* functions and checking if conversion succeeded, that just too >complex. If you look at the functionality it doesn't look that bad. >atomic(9) has the same "problem" with multiple types. Which is why I'm not too happy about atomic(9) either :-) In the end it is a deficiency in the ISO-C standardiszation lacking ambition :-/ >> You know ? Screw that! Having usable errors only in english is >> far better than having only "Invalid argument" in all the languages >> of the world. > >Well, can't we do better than that? This argument goes both ways. Indeed it does. But I don't see anyone talking about translating everything that goes into dmesg og syslog, so for now our kernel and systems functions are english only. Once somebody figures out the _method_ for handling those translations, we can start to talk about it. In the meantime, it would be a big mistake to restrict ourselves to "Invalid Argument" for complex API's -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.