cvs commit: src/sys/sys endian.h src/share/man/man9 byteorder.9

Mike Barcroft mike at FreeBSD.org
Thu Apr 3 15:56:29 PST 2003


Nate Lawson <nate at root.org> 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


More information about the cvs-src mailing list