[comp.unix.ultrix] Where is endian.h

madhu@hubcap.UUCP (Raman Madhusudan) (11/09/88)

Reply-to: madhu@hubcap.UUCP (Raman Madhusudan)

Greetings:
	 Where do I find endian.h ( we run ULTRIX on a VAX-8810).
(No it is not under /usr/include/machine, yes I am trying to get
BIND to run). Totally clueless, will wash your car if you are passing
through this area (Clemson SC). Please reply to:

	madhu@hubcap.clemson.edu (on the Internet).

		--thanks.

marc@okeeffe.Berkeley.EDU (Marc Teitelbaum) (11/23/88)

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