aboutsummaryrefslogtreecommitdiff
path: root/unix/os/net/htons.c
blob: 9f390c29fcc5e0e917cd66d2eab4dad628b4f697 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
 */

/* HTONS -- [MACHDEP] Convert a short integer in host format to net format.
 */
htons (word)
short	word;
{
	register char *wp;
	static	short w;

	w = word;
	wp = (char *)&w;

	return ((wp[0] << 8) | wp[1]);
}