aboutsummaryrefslogtreecommitdiff
path: root/sys/osb/nminelem.x
blob: 4a21c3e69ad64797f5e5e80b73dae98264807d11 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include	<mach.h>

# NMINELEM -- Determine the number of NMI elements of the given datatype
# which can be stored in an SPP char array of the indicated length.
# The nmi_type codes are defined in nmi.h; we assume here that the codes
# used are the number of bits in each NMI type.

int procedure nminelem (nchars, nmi_type)

int	nchars			#I size in chars of packed array
int	nmi_type		#I NMI type of packed data

int	nbits

begin
	nbits = abs (nmi_type)
	return ((nchars * SZB_CHAR * NBITS_BYTE) / nbits)
end