aboutsummaryrefslogtreecommitdiff
path: root/sys/imio/tf/imflsi.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/imio/tf/imflsi.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/imio/tf/imflsi.x')
-rw-r--r--sys/imio/tf/imflsi.x34
1 files changed, 34 insertions, 0 deletions
diff --git a/sys/imio/tf/imflsi.x b/sys/imio/tf/imflsi.x
new file mode 100644
index 00000000..b7a4b4fb
--- /dev/null
+++ b/sys/imio/tf/imflsi.x
@@ -0,0 +1,34 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <imhdr.h>
+include <imio.h>
+
+# IMFLS? -- Flush the output buffer, if necessary. Convert the datatype
+# of the pixels upon output, if the datatype of the pixels in the imagefile
+# is different than that requested by the calling program.
+
+procedure imflsi (imdes)
+
+pointer imdes
+pointer bdes, bp
+errchk imflsh
+
+begin
+ # Ignore the flush request if the output buffer has already been
+ # flushed.
+
+ if (IM_FLUSH(imdes) == YES) {
+ bdes = IM_OBDES(imdes)
+ bp = BD_BUFPTR(bdes)
+
+ # Convert datatype of pixels, if necessary, and flush buffer.
+ if (IM_PIXTYPE(imdes) != TY_INT || SZ_INT != SZ_INT32) {
+ call impaki (Memc[bp], Memc[bp], BD_NPIX(bdes),
+ IM_PIXTYPE(imdes))
+ }
+
+ call imflsh (imdes, bp, BD_VS(bdes,1), BD_VE(bdes,1), BD_NDIM(bdes))
+
+ IM_FLUSH(imdes) = NO
+ }
+end