home *** CD-ROM | disk | FTP | other *** search
- #ifndef __sys_byteorder_h
- #define __sys_byteorder_h
-
- /* Freenet programmers library - sys/byteorder.h - 23/5/95 */
-
- /*
- * Byte order definitions
- */
- #define LITTLE_ENDIAN 1234 /* Arcs, Vaxen, Motorola chips */
- #define BIG_ENDIAN 4321 /* Intel chips, Net byte order */
- #define PDP_ENDIAN 3412 /* DEC PDP machines */
-
- /*
- * Acorn machines use the ARM in little endian form
- */
- #define BYTE_ORDER LITTLE_ENDIAN
-
- /*
- * Convert a 32 bit word from host to net byte order
- */
- extern u_long htonl(u_long);
-
- /*
- * Convert a 32 bit word from net to host byte order
- */
- extern u_long ntohl(u_long);
-
- /*
- * Convert a 16 bit word from host to net byte order
- */
- extern u_short htons(u_short);
-
- /*
- * Convert a 16 bit word from net to host byte order
- */
- extern u_short ntohs(u_short);
-
- #endif
-