From owner-freebsd-current@FreeBSD.ORG Tue Apr 12 19:12:09 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CA50416A4CE for ; Tue, 12 Apr 2005 19:12:09 +0000 (GMT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6F75643D39 for ; Tue, 12 Apr 2005 19:12:09 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id j3CJC9YY023701; Tue, 12 Apr 2005 12:12:09 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id j3CJC8ZE023700; Tue, 12 Apr 2005 12:12:08 -0700 Date: Tue, 12 Apr 2005 12:12:08 -0700 From: Brooks Davis To: "R. Tyler Ballance" Message-ID: <20050412191208.GA12516@odin.ac.hmc.edu> References: <1113332762.27362.29.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bp/iNruPH9dso1Pn" Content-Disposition: inline In-Reply-To: <1113332762.27362.29.camel@localhost.localdomain> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu cc: FreeBSD Current Subject: Re: strtonum(3) in FreeBSD? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2005 19:12:09 -0000 --bp/iNruPH9dso1Pn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 12, 2005 at 02:06:02PM -0500, R. Tyler Ballance wrote: > Quick, sort of, question. Is it worth it to bring strtonum(3) from > OpenBSD into FreeBSD-CURRENT. I have the diffs if that's the case, I > know that the newer packet filter code from OPENBSD_3_7 that mlaier@ and > I are working on uses it in a few places (see: pflogd) but I'm not sure > of the merits of bringing strtonum(3) into lib/libc/stdlib... >=20 > In theory, it should be a better implementation of what atoi(3) and > strtol(3) do, but as tg@(mirbsd.org) pointed out to the OpenBSD fellows > and myself, it doesn't take hexadecimal values well... >=20 > Somebody let me know, i've got diffs ready, sort of ;) > (or let me know why it's a bad idea) The lack of base handling argument does make it less appealing, but now that OpenBSD has used this name, we're stuck with the API. I would request that you use intmax_t rather than "long long" for the integers. Then the API scales cleanly when some future processor adds 128-bit ints. Since intmax_t is "long long" on all current platforms that wouldn't cause compatability problems with OpenBSD. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --bp/iNruPH9dso1Pn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFCXB2IXY6L6fI4GtQRAhKPAJ9LfujeK9u1yOF4yjd2BhX9q39vngCggE2r V3uU1ELwGqeJijQlDpOhrLc= =jRqB -----END PGP SIGNATURE----- --bp/iNruPH9dso1Pn--