[sane-devel] genesys endianess

Pierre Willenbrock pierre at pirsoft.dnsalias.org
Wed Mar 8 13:08:08 UTC 2006

Hi Jon,

Jon Chambers schrieb:
> On Tue, 7 Mar 2006, Pierre Willenbrock wrote:
>> [...] I am planning to add a function that swaps the
>> bytes in place if needed which should be called on the pixel data.
> You may find the byte ordering calls built into the socket library
> (htons, htonl, etc) useful.

htons/ntohs, htonl/ntohl convert between host byte order and network
byte order, which is big endian. Those functions are a noop for a big
endian system. It is a common mistake to think htons and co will
unconditionally swap bytes.

I need a function that converts between host byte order and little
endian, and i already know how to do that.


More information about the sane-devel mailing list