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 --- pkg/images/tv/imexamine/ieopenlog.x | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 pkg/images/tv/imexamine/ieopenlog.x (limited to 'pkg/images/tv/imexamine/ieopenlog.x') diff --git a/pkg/images/tv/imexamine/ieopenlog.x b/pkg/images/tv/imexamine/ieopenlog.x new file mode 100644 index 00000000..08f754f9 --- /dev/null +++ b/pkg/images/tv/imexamine/ieopenlog.x @@ -0,0 +1,39 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include +include +include "imexam.h" + + +# IE_OPENLOG -- Open the log file. + +procedure ie_openlog (ie) + +pointer ie #I imexamine descriptor + +int nowhite(), open() +errchk open, close + +begin + if (IE_LOGFD(ie) != NULL) { + call close (IE_LOGFD(ie)) + IE_LOGFD(ie) = NULL + } + + if (nowhite (IE_LOGFILE(ie), IE_LOGFILE(ie), SZ_FNAME) > 0) { + iferr { + IE_LOGFD(ie) = open (IE_LOGFILE(ie), APPEND, TEXT_FILE) + call printf ("Log file %s open\n") + call pargstr (IE_LOGFILE(ie)) + + if (IE_IM(ie) != NULL) { + call fprintf (IE_LOGFD(ie), "# [%d] %s - %s\n") + call pargi (IE_INDEX(ie)) + call pargstr (IE_IMNAME(ie)) + call pargstr (IM_TITLE(IE_IM(ie))) + } + + } then + call erract (EA_WARN) + } +end -- cgit