aboutsummaryrefslogtreecommitdiff
path: root/unix/os/net/htonl.c
blob: e9c57280ec5019c7cc00fa490a274f3c083735d9 (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.
 */

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

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

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

	return (netw);
}