diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /sys/osb/miipak16.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/osb/miipak16.x')
-rw-r--r-- | sys/osb/miipak16.x | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/sys/osb/miipak16.x b/sys/osb/miipak16.x new file mode 100644 index 00000000..d972c0fa --- /dev/null +++ b/sys/osb/miipak16.x @@ -0,0 +1,39 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <mach.h> + +# MIIPAK16 -- Pack an SPP array of the indicated datatype into an 16 bit +# signed MII array. + +procedure miipak16 (spp, mii, nelems, spp_datatype) + +int spp[ARB] #I input array of SPP integers +int mii[ARB] #O output MII format array +int nelems #I number of integers to be converted +int spp_datatype #I SPP datatype code + +begin + switch (spp_datatype) { + case TY_UBYTE: + call achtbs (spp, mii, nelems) + case TY_USHORT: + call achtus (spp, mii, nelems) + case TY_CHAR: + call achtcs (spp, mii, nelems) + case TY_SHORT: + call achtss (spp, mii, nelems) + case TY_INT, TY_POINTER, TY_STRUCT: + call achtis (spp, mii, nelems) + case TY_LONG: + call achtls (spp, mii, nelems) + case TY_REAL: + call achtrs (spp, mii, nelems) + case TY_DOUBLE: + call achtds (spp, mii, nelems) + case TY_COMPLEX: + call achtxs (spp, mii, nelems) + } + + if (BYTE_SWAP2 == YES) + call bswap2 (mii, 1, mii, 1, nelems * (16 / NBITS_BYTE)) +end |