From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/osb/nminelem.x | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 sys/osb/nminelem.x (limited to 'sys/osb/nminelem.x') diff --git a/sys/osb/nminelem.x b/sys/osb/nminelem.x new file mode 100644 index 00000000..4a21c3e6 --- /dev/null +++ b/sys/osb/nminelem.x @@ -0,0 +1,20 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include + +# 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 -- cgit