In our previous episode, Reinier Olislagers said:
> 
> Also, I'm sure there must be functions to convert endianness - at least
> network byte order (big endian) to host order.
> I found e.g. Synapse synsock:
>   function ntohs(netshort: word): word;
>   function ntohl(netlong: longword): longword;
>   function htons(hostshort: word): word;
>   function htonl(hostlong: longword): longword;
> 
> Are there an equivalent RTL/FCL functions?

Yes, but don't use them.

There are independent endian routines in system.  Search for swapendian and
BEtoN, NtoBE etc.

Do not abuse network routines for non network usage.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to