File: endian.h

package info (click to toggle)
libforms1 1.0-8
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 6,648 kB
  • ctags: 14,351
  • sloc: ansic: 90,441; makefile: 9,902; sh: 8
file content (41 lines) | stat: -rw-r--r-- 998 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef _SUN4_ENDIAN_H_
#define	_SUN4_ENDIAN_H_

/*
 * Define the order of 32-bit words in 64-bit words.
 */
#define _QUAD_HIGHWORD 1
#define _QUAD_LOWWORD 0


#ifndef _POSIX_SOURCE
/*
 * Definitions for byte order, according to byte significance from low
 * address to high.
 */
#define	LITTLE_ENDIAN	1234	/* LSB first: i386, vax */
#define	BIG_ENDIAN	4321	/* MSB first: 68000, ibm, net */
#define	PDP_ENDIAN	3412	/* LSB first in word, MSW first in long */

#define	BYTE_ORDER	BIG_ENDIAN

#if 0				/* not needed by snprintf() -- spl */
#include <sys/cdefs.h>
#endif
#ifdef __STDC__
#define __P(x) x		/* prototypes */
#else
#define __P(x)			/* no prototypes */
#endif

/*
 * Macros for network/external number representation conversion.
 */
#define	NTOHL(x)	(x) = ntohl((unsigned long)(x))
#define	NTOHS(x)	(x) = ntohs((unsigned short)(x))
#define	HTONL(x)	(x) = htonl((unsigned long)(x))
#define	HTONS(x)	(x) = htons((unsigned short)(x))

#endif /* _POSIX_SOURCE */

#endif /* !_SUN4_ENDIAN_H_ */