aboutsummaryrefslogtreecommitdiff
path: root/unix/os/net/ntohl.c
blob: 34d6b07ab8e9e40d008e923e0c14b97858ccb0a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
 */

/* NTOHL -- [MACHDEP] Convert a long integer in net format to host format.
 */
ntohl (lword)
long	lword;
{
	register char *ip, *op;
	static	long hostw, netw;

	netw = lword;
	ip = (char *)&netw;
	op = (char *)&hostw + 4;

	*--op = *ip++;
	*--op = *ip++;
	*--op = *ip++;
	*--op = *ip++;

	return (hostw);
}