aboutsummaryrefslogtreecommitdiff
path: root/sys/osb/nminelem.x
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /sys/osb/nminelem.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/osb/nminelem.x')
-rw-r--r--sys/osb/nminelem.x20
1 files changed, 20 insertions, 0 deletions
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 <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