Date: Mon, 9 Dec 2002 09:05:23 -0800 From: Luigi Rizzo <rizzo@icir.org> To: "M. Warner Losh" <imp@bsdimp.com> Cc: arch@FreeBSD.ORG Subject: Re: le??toh, etc in userland Message-ID: <20021209090523.A75689@xorpc.icir.org> In-Reply-To: <20021209.095032.102181079.imp@bsdimp.com>; from imp@bsdimp.com on Mon, Dec 09, 2002 at 09:50:32AM -0700 References: <20021209.095032.102181079.imp@bsdimp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Dec 09, 2002 at 09:50:32AM -0700, M. Warner Losh wrote: > We should provide an implementation of {b,l}e{16,32}toh and > hto{b,l}e{16,32} in libc. Any objections? I have one on the names. Historical functions (htonl(), ntohs() and friend) put the operand size at the end, and this to me makes sense because the size refers to both operands. The names you propose link the size to the {b,l}e operand only. Does it mean that we have the following interfaces ? int be16toh(u_int16_t) int le16toh(u_int16_t) int be32toh(u_int32_t) int le32toh(u_int32_t) u_int16_t htobe16(int) u_int16_t htole16(int) u_int32_t htobe32(int) u_int32_t htole32(int) (i.e. the host side has the same type) ? I remember last time we discussed the issue on the kernel you said that it was too late to change, but if we don't have such APIs in userland, then we could at least use a more consistent naming scheme. cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021209090523.A75689>