diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/osb/ipak32.c | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/osb/ipak32.c')
-rw-r--r-- | sys/osb/ipak32.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sys/osb/ipak32.c b/sys/osb/ipak32.c new file mode 100644 index 00000000..a4f5061b --- /dev/null +++ b/sys/osb/ipak32.c @@ -0,0 +1,23 @@ +#define import_spp +#define import_knames +#include <iraf.h> + +/* IPAK32 - Pack 64-bit int into and array of 32-bit int. + */ +void +IPAK32 (void *a, void *b, XINT *nelems) +{ + /* MACHDEP - Works only for little-endian systems (e.g. x86) + */ + XINT *ip = (XINT *) a; + int *op = (int *) calloc (*nelems, sizeof (int)); + int *tmp, i; + + tmp = op; + for (i=0; i < *nelems; i++, ip++) { + *tmp++ = (int) (*ip); + } + memmove (b, op, *nelems * sizeof (int)); + + free (op); +} |