diff options
Diffstat (limited to 'pkg/images/tv/imexamine/ieopenlog.x')
-rw-r--r-- | pkg/images/tv/imexamine/ieopenlog.x | 39 |
1 files changed, 39 insertions, 0 deletions
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 <error.h> +include <imhdr.h> +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 |