From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- unix/as.freebsd/bytmov.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 unix/as.freebsd/bytmov.c (limited to 'unix/as.freebsd/bytmov.c') diff --git a/unix/as.freebsd/bytmov.c b/unix/as.freebsd/bytmov.c new file mode 100644 index 00000000..aa43f6d1 --- /dev/null +++ b/unix/as.freebsd/bytmov.c @@ -0,0 +1,23 @@ +/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + */ + +#define import_spp +#define import_knames +#include + +/* BYTMOV -- Byte move from array "a" to array "b". The move must be + * nondestructive, allowing a byte array to be shifted left or right a + * few bytes, hence comparison of the addresses of the arrays is necessary + * to determine if they overlap. + * [Specially optimized version for Sun/IRAF]. + */ +BYTMOV (a, aoff, b, boff, nbytes) +XCHAR *a; /* input byte array */ +XINT *aoff; /* first byte in A to be moved */ +XCHAR *b; /* output byte array */ +XINT *boff; /* first byte in B to be written */ +XINT *nbytes; /* number of bytes to move */ +{ + if ((a + *aoff) != (b + *boff)) + memmove ((char *)b + (*boff-1), (char *)a + (*aoff-1), *nbytes); +} -- cgit