From owner-cvs-src@FreeBSD.ORG Thu Apr 3 15:56:28 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB3CA37B401; Thu, 3 Apr 2003 15:56:28 -0800 (PST) Received: from espresso.bsdmike.org (espresso.bsdmike.org [65.39.129.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4C9DD43FBF; Thu, 3 Apr 2003 15:56:28 -0800 (PST) (envelope-from mike@espresso.bsdmike.org) Received: by espresso.bsdmike.org (Postfix, from userid 1002) id A4D829C5B; Thu, 3 Apr 2003 18:42:29 -0500 (EST) Date: Thu, 3 Apr 2003 18:42:29 -0500 From: Mike Barcroft To: Nate Lawson Message-ID: <20030403184229.D18209@espresso.bsdmike.org> References: <20030403085821.AD2A537B407@hub.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ; from nate@root.org on Thu, Apr 03, 2003 at 03:49:08PM -0800 Organization: The FreeBSD Project cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: Poul-Henning Kamp cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys endian.h src/share/man/man9 byteorder.9 X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2003 23:56:29 -0000 Nate Lawson writes: > On Thu, 3 Apr 2003, Poul-Henning Kamp wrote: > > Modified files: > > sys/sys endian.h > > share/man/man9 byteorder.9 > > Log: > > Add inline functions {be,le}{16,32,64}{enc,dec}() for encoding decoding > > into byte strings of unknown alignment. > > > > Revision Changes Path > > 1.3 +39 -1 src/share/man/man9/byteorder.9 > > 1.3 +108 -0 src/sys/sys/endian.h > > This is really great! I have wanted this for a while. Just a few > questions. Have the standards folks had a look at the API? Second, it > appears the *enc functions have args in reverse order (void *, uint32_t > for example). Any thoughts on bcopy vs. memcpy ordering of args? There aren't any standards that have these type of functions. The closest thing is ntohl() and friends. We copied OpenBSD for the function and header names, so it might be worthwhile seeing if they want to provide these functions too. Best regards, Mike Barcroft