Path: utzoo!attcan!uunet!pyrdc!jetson!decuac!felix!info-ultrix From: marc@okeeffe.Berkeley.EDU (Marc Teitelbaum) Newsgroups: comp.unix.ultrix Subject: Re: Where is endian.h Message-ID: <71179@felix.UUCP> Date: 22 Nov 88 17:32:54 GMT Sender: info-ultrix@felix.UUCP Reply-To: marc@okeeffe.Berkeley.EDU (Marc Teitelbaum) Lines: 66 Approved: zemon@felix.UUCP Reply-Path: Reply-to: marc@okeeffe.Berkeley.EDU (Marc Teitelbaum) It's in stock 4.3BSD, i think (i don't have a pristine copy of 4.3 to tell from right now). There was a point where we had ENDIAN defined as either BIG or LITTLE, and the code looked like #if ENDIAN == BIG ... but that went away, and now it's BYTE_ORDER defined as either BIG_ENDIAN or LITTLE_ENDIAN (or pdp, the crooked endian...). I'll append our current endian.h for the vax. Marc ------------------------------- Marc Teitelbaum +1-415-643-6448 457 Evans Hall Computer Systems Research Group, CSRG / DEC University of California Berkeley, CA 94720 ================ snip snip ================= /* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that the above copyright notice and this paragraph are * duplicated in all such forms and that any documentation, * advertising materials, and other materials related to such * distribution and use acknowledge that the software was developed * by the University of California, Berkeley. The name of the * University may not be used to endorse or promote products derived * from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * @(#)endian.h 7.3 (Berkeley) 6/29/88 */ /* * Definitions for byte order, * according to byte significance from low address to high. */ #define LITTLE_ENDIAN 1234 /* least-significant byte first (vax) */ #define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */ #define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp) */ #define BYTE_ORDER LITTLE_ENDIAN /* byte order on vax */ /* * Macros for network/external number representation conversion. */ #if BYTE_ORDER == BIG_ENDIAN && !defined(lint) #define ntohl(x) (x) #define ntohs(x) (x) #define htonl(x) (x) #define htons(x) (x) #else unsigned short ntohs(), htons(); unsigned long ntohl(), htonl(); #endif