aboutsummaryrefslogtreecommitdiff
path: root/vendor/x11iraf/xtapemon
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /vendor/x11iraf/xtapemon
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'vendor/x11iraf/xtapemon')
-rw-r--r--vendor/x11iraf/xtapemon/Imakefile69
-rw-r--r--vendor/x11iraf/xtapemon/Imakefile.orig33
-rw-r--r--vendor/x11iraf/xtapemon/XTapemon.ad168
-rw-r--r--vendor/x11iraf/xtapemon/XTapemon.ad.h132
-rwxr-xr-xvendor/x11iraf/xtapemon/ad2c.sh62
-rw-r--r--vendor/x11iraf/xtapemon/appres.h21
-rw-r--r--vendor/x11iraf/xtapemon/classnames.c80
-rw-r--r--vendor/x11iraf/xtapemon/classnames.h8
-rw-r--r--vendor/x11iraf/xtapemon/gui2c.sed6
-rw-r--r--vendor/x11iraf/xtapemon/patchlevel.h6
-rw-r--r--vendor/x11iraf/xtapemon/types.c78
-rw-r--r--vendor/x11iraf/xtapemon/types.h22
-rw-r--r--vendor/x11iraf/xtapemon/xtapemon.c736
-rw-r--r--vendor/x11iraf/xtapemon/xtapemon.h29
-rw-r--r--vendor/x11iraf/xtapemon/xtapemon.man135
-rw-r--r--vendor/x11iraf/xtapemon/xtapemon.ps361
-rw-r--r--vendor/x11iraf/xtapemon/zzdebug.c62
17 files changed, 2008 insertions, 0 deletions
diff --git a/vendor/x11iraf/xtapemon/Imakefile b/vendor/x11iraf/xtapemon/Imakefile
new file mode 100644
index 00000000..8c745346
--- /dev/null
+++ b/vendor/x11iraf/xtapemon/Imakefile
@@ -0,0 +1,69 @@
+#
+# Imakefile for xtapemon : X11 based tape monitoring utility for IRAF.
+#
+
+X11IRAFDIR = ../
+#include <../X11IRAF.tmpl>
+
+/* Hack to build on NOAO HP systems where the Xmu and Xaw libs had to be added
+ * specially to the system they don't come with the default X11 development
+ * system. This also avoids the binary requiring the shared lib version on
+ * systems which may not have it.
+ */
+#if defined(HPArchitecture) && OSMajorVersion >= 10
+ XMULIB = /usr/lib/X11R6/libXmu.a
+ XAWLIB = /usr/lib/X11R6/libXaw.a
+#endif
+
+
+ CDEBUGFLAGS = -g
+ XAWLIB = LibXaw3d
+
+##############################################################################
+# Nothing to change below here...
+
+SRCS= classnames.c types.c xtapemon.c
+OBJS= classnames.o types.o xtapemon.o
+DEFINES= -DXTAPEMON
+INCLUDES= -I. $(X11IRAF_INCLUDES)
+DEPLIBS= XawClientDepLibs
+LOCAL_LIBRARIES= XawClientLibs
+LOCAL_LDFLAGS= -L../lib $(X11IRAF_LDFLAGS)
+OBMLIBS = LibObm LibXpm
+MATHLIB = -lm
+
+
+
+AllTarget(xtapemon)
+
+NormalProgramTarget(xtapemon,$(OBJS),,${OBMLIBS} XawClientLibs,$(MATHLIB))
+
+#if InstallAppdefs
+install:: XTapemon.ad
+ MakeDir(X11irafAppDir)
+ $(CP) XTapemon.ad X11irafAppDir/XTapemon
+#endif
+
+#if InstallManuals
+install::
+ MakeDir(X11irafManDir)
+ $(CP) xtapemon.man X11irafManDir/xtapemon.1
+#endif
+
+#if InstallBinaries
+install:: xtapemon
+ -@if [ -d X11irafBinDir ]; then set +x; \
+ else (set -x; $(MKDIRHIER) X11irafBinDir); fi
+ $(CP) xtapemon X11irafBinDir
+#endif
+
+xtapemon.o: XTapemon.ad.h
+xtapemon.c: XTapemon.ad.h
+
+XTapemon.ad.h: XTapemon.ad
+ ad2c.sh XTapemon.ad > XTapemon.ad.h
+
+clean::
+ rm -f *.o xtapemon
+
+DependTarget()
diff --git a/vendor/x11iraf/xtapemon/Imakefile.orig b/vendor/x11iraf/xtapemon/Imakefile.orig
new file mode 100644
index 00000000..b0953dcf
--- /dev/null
+++ b/vendor/x11iraf/xtapemon/Imakefile.orig
@@ -0,0 +1,33 @@
+#
+# Imakefile for xtapemon : X11 based tape monitoring utility for IRAF.
+#
+ CDEBUGFLAGS = -g
+ XAWLIB = -lXaw3d # set to Xaw3d for 3d look
+
+##############################################################################
+# Nothing to change below here...
+
+SRCS= classnames.c types.c xtapemon.c
+OBJS= classnames.o types.o xtapemon.o
+DEFINES= -DXTAPEMON
+INCLUDES= -I.
+DEPLIBS= XawClientDepLibs
+LOCAL_LIBRARIES= XawClientLibs
+LOCAL_LDFLAGS= -L../lib
+
+ComplexProgramTarget(xtapemon)
+InstallAppDefaults(Xtapemon)
+
+install.xtapemon: xtapemon Xtapemon.ad xtapemon.man
+ $(INSTALL) -c $(INSTPGMFLAGS) xtapemon $(BINDIR)
+ $(INSTALL) -c $(INSTAPPFLAGS) Xtapemon.ad $(XAPPLOADDIR)/Xtapemon
+ $(INSTALL) -c $(INSTMANFLAGS) xtapemon.man $(MANDIR)/xtapemon.1
+
+xtapemon.o: XTapemon.ad.h
+xtapemon.c: XTapemon.ad.h
+
+XTapemon.ad.h: XTapemon.ad
+ ad2c.sh XTapemon.ad > XTapemon.ad.h
+
+clean::
+ rm -f *.o xtapemon
diff --git a/vendor/x11iraf/xtapemon/XTapemon.ad b/vendor/x11iraf/xtapemon/XTapemon.ad
new file mode 100644
index 00000000..9438d2c4
--- /dev/null
+++ b/vendor/x11iraf/xtapemon/XTapemon.ad
@@ -0,0 +1,168 @@
+!
+! XTapemon.ad : Application defaults for the X11 tape monitor utility.
+!
+
+XTapemon.port: 5138
+XTapemon.alternate: 0
+XTapemon.debug: 0
+
+! Main display widget hierachy:
+XTapemon.widgets: \
+ toplevel Paned panel \
+\
+ panel Form statusForm \
+ panel.statusForm Label statusLabel \
+ panel.statusForm AsciiText statusText \
+ panel.statusForm Command quitButton \
+\
+ panel AsciiText messages \
+\
+ panel Form stringForm \
+ panel.stringForm Label devtypeLabel \
+ panel.stringForm AsciiText devtypeText \
+ panel.stringForm Label tapetypeLabel \
+ panel.stringForm AsciiText tapetypeText \
+ panel.stringForm Label tapesizeLabel \
+ panel.stringForm AsciiText tapesizeText \
+ panel.stringForm Label tapeusedLabel \
+ panel.stringForm AsciiText tapeusedText \
+ panel.stringForm Label acmodeLabel \
+ panel.stringForm AsciiText acmodeText \
+ panel.stringForm Label densityLabel \
+ panel.stringForm AsciiText densityText \
+ panel.stringForm Label blksizeLabel \
+ panel.stringForm AsciiText blksizeText \
+ panel.stringForm Label nfilesLabel \
+ panel.stringForm AsciiText nfilesText \
+ panel.stringForm Label fileLabel \
+ panel.stringForm AsciiText fileText \
+ panel.stringForm Label recordLabel \
+ panel.stringForm AsciiText recordText \
+ panel.stringForm Label recsizeLabel \
+ panel.stringForm AsciiText recsizeText
+
+! Overall Paned widget
+*panel.orientation: vertical
+*showGrip: false
+
+! Status window
+*statusForm.background: lightgray
+*statusForm*statusLabel.label: Status:
+*statusForm*statusLabel.background: lightgray
+*statusForm*statusText.fromHoriz: statusLabel
+*statusForm*statusText*width: 370
+*statusForm*statusText*editType: read
+*statusForm*statusText.borderWidth: 0
+*statusForm*statusText*translations: #override\n
+*statusForm*statusText.background: lightgray
+
+*statusForm*quitButton.label: Quit
+*statusForm*quitButton.fromHoriz: statusText
+*statusForm*quitButton.background: lightgray
+
+! AsciiText scrolling widget for messages
+*messages.scrollVertical: always
+*messages.scrollHorizontal: whenNeeded
+*messages*editType: append
+*messages*Scrollbar.thickness: 10
+*messages*displayCaret: False
+*messages*string: idle\n
+
+!
+! Defaults for all the classes of widgets
+!
+
+*input: True
+*Grip*height: 5
+*Grip*width: 5
+*Label.borderWidth: 0
+*Label.internalWidth: 0
+*Text*borderWidth: 1
+*Text*font: fixed
+*Text*Scrollbar.thickness: 5
+*Text*editType: read
+*Text.scrollHorizontal: whenNeeded
+*Text*displayCaret: False
+
+!
+! Bottom String Form
+!
+! These keep the strings from getting bigger or smaller when the panes
+! resize. Thus only the message region grows.
+*stringForm.min: 100
+*stringForm.max: 100
+*stringForm.background: lightgray
+*stringForm*Label.background: lightgray
+
+*stringForm*devtypeLabel.label: Device Type:
+*stringForm*devtypeText*width: 415
+*stringForm*devtypeText.fromHoriz: devtypeLabel
+
+*stringForm*tapetypeLabel.label: \ \ Tape Type:
+*stringForm*tapetypeLabel.fromVert: devtypeLabel
+*stringForm*tapetypeText.fromVert: devtypeLabel
+*stringForm*tapetypeText.fromHoriz: tapetypeLabel
+*stringForm*tapetypeText.width: 105
+
+*stringForm*tapesizeLabel.label: Capacity:
+*stringForm*tapesizeLabel.fromVert: devtypeLabel
+*stringForm*tapesizeLabel.fromHoriz: tapetypeText
+*stringForm*tapesizeText.fromVert: devtypeLabel
+*stringForm*tapesizeText.fromHoriz: tapesizeLabel
+*stringForm*tapesizeText.width: 75
+
+*stringForm*tapeusedLabel.label: Used:
+*stringForm*tapeusedLabel.fromVert: devtypeLabel
+*stringForm*tapeusedLabel.fromHoriz: tapesizeText
+*stringForm*tapeusedText.fromVert: devtypeLabel
+*stringForm*tapeusedText.fromHoriz: tapeusedLabel
+*stringForm*tapeusedText.width: 117
+
+*stringForm*acmodeLabel.label: Access Mode:
+*stringForm*acmodeLabel.fromVert: tapeusedLabel
+*stringForm*acmodeText.fromVert: tapeusedLabel
+*stringForm*acmodeText.fromHoriz: acmodeLabel
+*stringForm*acmodeText.width: 70
+
+*stringForm*densityLabel.label: Density:
+*stringForm*densityLabel.fromVert: tapeusedLabel
+*stringForm*densityLabel.fromHoriz: acmodeText
+*stringForm*densityText.fromVert: tapeusedLabel
+*stringForm*densityText.fromHoriz: densityLabel
+*stringForm*densityText.width: 72
+
+*stringForm*blksizeLabel.label: Device Block Size:
+*stringForm*blksizeLabel.fromVert: tapeusedLabel
+*stringForm*blksizeLabel.fromHoriz: densityText
+*stringForm*blksizeText.fromVert: tapeusedLabel
+*stringForm*blksizeText.fromHoriz: blksizeLabel
+*stringForm*blksizeText.width: 71
+
+*stringForm*nfilesLabel.label: Total Files:
+*stringForm*nfilesLabel.fromVert: acmodeLabel
+*stringForm*nfilesText.fromVert: acmodeLabel
+*stringForm*nfilesText.fromHoriz: nfilesLabel
+*stringForm*nfilesText.width: 55
+
+*stringForm*fileLabel.label: File:
+*stringForm*fileLabel.fromVert: acmodeLabel
+*stringForm*fileLabel.fromHoriz: nfilesText
+*stringForm*fileText.fromVert: acmodeLabel
+*stringForm*fileText.fromHoriz: fileLabel
+*stringForm*fileText.width: 62
+
+*stringForm*recordLabel.label: Record:
+*stringForm*recordLabel.fromVert: acmodeLabel
+*stringForm*recordLabel.fromHoriz: fileText
+*stringForm*recordText.fromVert: acmodeLabel
+*stringForm*recordText.fromHoriz: recordLabel
+*stringForm*recordText.width: 50
+
+*stringForm*recsizeLabel.label: Record Size:
+*stringForm*recsizeLabel.fromVert: acmodeLabel
+*stringForm*recsizeLabel.fromHoriz: recordText
+*stringForm*recsizeText.fromVert: acmodeLabel
+*stringForm*recsizeText.fromHoriz: recsizeLabel
+*stringForm*recsizeText.width: 50
+
+*beNiceToColormap: False
diff --git a/vendor/x11iraf/xtapemon/XTapemon.ad.h b/vendor/x11iraf/xtapemon/XTapemon.ad.h
new file mode 100644
index 00000000..b602e0a1
--- /dev/null
+++ b/vendor/x11iraf/xtapemon/XTapemon.ad.h
@@ -0,0 +1,132 @@
+"XTapemon.port: 5138",
+"XTapemon.alternate: 0",
+"XTapemon.debug: 0",
+"XTapemon.widgets: \
+ toplevel Paned panel \
+\
+ panel Form statusForm \
+ panel.statusForm Label statusLabel \
+ panel.statusForm AsciiText statusText \
+ panel.statusForm Command quitButton \
+\
+ panel AsciiText messages \
+\
+ panel Form stringForm \
+ panel.stringForm Label devtypeLabel \
+ panel.stringForm AsciiText devtypeText \
+ panel.stringForm Label tapetypeLabel \
+ panel.stringForm AsciiText tapetypeText \
+ panel.stringForm Label tapesizeLabel \
+ panel.stringForm AsciiText tapesizeText \
+ panel.stringForm Label tapeusedLabel \
+ panel.stringForm AsciiText tapeusedText \
+ panel.stringForm Label acmodeLabel \
+ panel.stringForm AsciiText acmodeText \
+ panel.stringForm Label densityLabel \
+ panel.stringForm AsciiText densityText \
+ panel.stringForm Label blksizeLabel \
+ panel.stringForm AsciiText blksizeText \
+ panel.stringForm Label nfilesLabel \
+ panel.stringForm AsciiText nfilesText \
+ panel.stringForm Label fileLabel \
+ panel.stringForm AsciiText fileText \
+ panel.stringForm Label recordLabel \
+ panel.stringForm AsciiText recordText \
+ panel.stringForm Label recsizeLabel \
+ panel.stringForm AsciiText recsizeText",
+"*panel.orientation: vertical",
+"*showGrip: false",
+"*statusForm.background: lightgray",
+"*statusForm*statusLabel.label: Status:",
+"*statusForm*statusLabel.background: lightgray",
+"*statusForm*statusText.fromHoriz: statusLabel",
+"*statusForm*statusText*width: 370",
+"*statusForm*statusText*editType: read",
+"*statusForm*statusText.borderWidth: 0",
+"*statusForm*statusText*translations: #override\\n",
+"*statusForm*statusText.background: lightgray",
+"*statusForm*quitButton.label: Quit",
+"*statusForm*quitButton.fromHoriz: statusText",
+"*statusForm*quitButton.background: lightgray",
+"*messages.scrollVertical: always",
+"*messages.scrollHorizontal: whenNeeded",
+"*messages*editType: append",
+"*messages*Scrollbar.thickness: 10",
+"*messages*displayCaret: False",
+"*messages*string: idle\\n",
+"*input: True",
+"*Grip*height: 5",
+"*Grip*width: 5",
+"*Label.borderWidth: 0",
+"*Label.internalWidth: 0",
+"*Text*borderWidth: 1",
+"*Text*font: fixed",
+"*Text*Scrollbar.thickness: 5",
+"*Text*editType: read",
+"*Text.scrollHorizontal: whenNeeded",
+"*Text*displayCaret: False",
+"*stringForm.min: 100",
+"*stringForm.max: 100",
+"*stringForm.background: lightgray",
+"*stringForm*Label.background: lightgray",
+"*stringForm*devtypeLabel.label: Device Type:",
+"*stringForm*devtypeText*width: 415",
+"*stringForm*devtypeText.fromHoriz: devtypeLabel",
+"*stringForm*tapetypeLabel.label: \\ \\ Tape Type:",
+"*stringForm*tapetypeLabel.fromVert: devtypeLabel",
+"*stringForm*tapetypeText.fromVert: devtypeLabel",
+"*stringForm*tapetypeText.fromHoriz: tapetypeLabel",
+"*stringForm*tapetypeText.width: 105",
+"*stringForm*tapesizeLabel.label: Capacity:",
+"*stringForm*tapesizeLabel.fromVert: devtypeLabel",
+"*stringForm*tapesizeLabel.fromHoriz: tapetypeText",
+"*stringForm*tapesizeText.fromVert: devtypeLabel",
+"*stringForm*tapesizeText.fromHoriz: tapesizeLabel",
+"*stringForm*tapesizeText.width: 75",
+"*stringForm*tapeusedLabel.label: Used:",
+"*stringForm*tapeusedLabel.fromVert: devtypeLabel",
+"*stringForm*tapeusedLabel.fromHoriz: tapesizeText",
+"*stringForm*tapeusedText.fromVert: devtypeLabel",
+"*stringForm*tapeusedText.fromHoriz: tapeusedLabel",
+"*stringForm*tapeusedText.width: 117",
+"*stringForm*acmodeLabel.label: Access Mode:",
+"*stringForm*acmodeLabel.fromVert: tapeusedLabel",
+"*stringForm*acmodeText.fromVert: tapeusedLabel",
+"*stringForm*acmodeText.fromHoriz: acmodeLabel",
+"*stringForm*acmodeText.width: 70",
+"*stringForm*densityLabel.label: Density:",
+"*stringForm*densityLabel.fromVert: tapeusedLabel",
+"*stringForm*densityLabel.fromHoriz: acmodeText",
+"*stringForm*densityText.fromVert: tapeusedLabel",
+"*stringForm*densityText.fromHoriz: densityLabel",
+"*stringForm*densityText.width: 72",
+"*stringForm*blksizeLabel.label: Device Block Size:",
+"*stringForm*blksizeLabel.fromVert: tapeusedLabel",
+"*stringForm*blksizeLabel.fromHoriz: densityText",
+"*stringForm*blksizeText.fromVert: tapeusedLabel",
+"*stringForm*blksizeText.fromHoriz: blksizeLabel",
+"*stringForm*blksizeText.width: 71",
+"*stringForm*nfilesLabel.label: Total Files:",
+"*stringForm*nfilesLabel.fromVert: acmodeLabel",
+"*stringForm*nfilesText.fromVert: acmodeLabel",
+"*stringForm*nfilesText.fromHoriz: nfilesLabel",
+"*stringForm*nfilesText.width: 55",
+"*stringForm*fileLabel.label: File:",
+"*stringForm*fileLabel.fromVert: acmodeLabel",
+"*stringForm*fileLabel.fromHoriz: nfilesText",
+"*stringForm*fileText.fromVert: acmodeLabel",
+"*stringForm*fileText.fromHoriz: fileLabel",
+"*stringForm*fileText.width: 62",
+"*stringForm*recordLabel.label: Record:",
+"*stringForm*recordLabel.fromVert: acmodeLabel",
+"*stringForm*recordLabel.fromHoriz: fileText",
+"*stringForm*recordText.fromVert: acmodeLabel",
+"*stringForm*recordText.fromHoriz: recordLabel",
+"*stringForm*recordText.width: 50",
+"*stringForm*recsizeLabel.label: Record Size:",
+"*stringForm*recsizeLabel.fromVert: acmodeLabel",
+"*stringForm*recsizeLabel.fromHoriz: recordText",
+"*stringForm*recsizeText.fromVert: acmodeLabel",
+"*stringForm*recsizeText.fromHoriz: recsizeLabel",
+"*stringForm*recsizeText.width: 50",
+"*beNiceToColormap: False",
diff --git a/vendor/x11iraf/xtapemon/ad2c.sh b/vendor/x11iraf/xtapemon/ad2c.sh
new file mode 100755
index 00000000..651ab8c4
--- /dev/null
+++ b/vendor/x11iraf/xtapemon/ad2c.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+#
+# ad2c : Convert app-defaults file to C strings decls.
+#
+# George Ferguson, ferguson@cs.rcohester.edu, 12 Nov 1990.
+# 19 Mar 1991: gf
+# Made it self-contained.
+# 6 Jan 1992: mycroft@gnu.ai.mit.edu (Charles Hannum)
+# Removed use of "-n" and ":read" label since Gnu and
+# IBM sed print pattern space on "n" command. Still works
+# with Sun sed, of course.
+# 7 Jan 1992: matthew@sunpix.East.Sun.COM (Matthew Stier)
+# Escape quotes after escaping backslashes.
+# 8 Jul 1992: Version 1.6
+# Manpage fixes.
+# 19 Apr 1993: Version 1.7
+# Remove comments that were inside the sed command since
+# some versions of sed don't like them. The comments are
+# now given here in the header.
+#
+# Comments on the script by line:
+# /^!/d Remove comments
+# /^$/d Remove blanks
+# s/\\/\\\\/g Escape backslashes...
+# s/\\$//g ...except the line continuation ones
+# s/"/\\"/g Escape quotes
+# s/^/"/ Add leading quote
+# : test Establish label for later branch
+# /\\$/b slash Branch to label "slash" if line ends in backslash
+# s/$/",/ Otherwise add closing quote and comma...
+# p ...output the line...
+# d ...and clear the pattern space so it's not printed again
+# : slash Branch comes here if line ends in backslash
+# n Read next line, append to pattern space
+# [...] The "d" and "s" commands that follow just delete
+# comments and blank lines and escape control sequences
+# b test Branch up to see if the line ends in backslash or not
+#
+
+sed '
+/^!/d
+/^$/d
+s/\\/\\\\/g
+s/\\$//g
+s/"/\\"/g
+s/^/"/
+: test
+/\\$/b slash
+s/$/",/
+p
+d
+: slash
+n
+/^!/d
+/^$/d
+s/"/\\"/g
+s/\\\\/\\/g
+s/\\n/\\\\n/g
+s/\\t/\\\\t/g
+s/\\f/\\\\f/g
+s/\\b/\\\\b/g
+b test' "$@"
diff --git a/vendor/x11iraf/xtapemon/appres.h b/vendor/x11iraf/xtapemon/appres.h
new file mode 100644
index 00000000..dabd5f1c
--- /dev/null
+++ b/vendor/x11iraf/xtapemon/appres.h
@@ -0,0 +1,21 @@
+/*
+ * appres.h : External defs for files needing the application
+ * resources.
+ *
+ * George Ferguson, ferguson@cs.rochester.edu, 12 Sep 1991.
+ *
+ */
+
+#ifndef APP_RESOURCES_H
+#define APP_RESOURCES_H
+
+typedef struct {
+ String widgets;
+ int alternate;
+ int port;
+ int debug;
+} AppResources;
+
+extern AppResources appResources;
+
+#endif /* APP_RESOURCES_H */
diff --git a/vendor/x11iraf/xtapemon/classnames.c b/vendor/x11iraf/xtapemon/classnames.c
new file mode 100644
index 00000000..20d307d6
--- /dev/null
+++ b/vendor/x11iraf/xtapemon/classnames.c
@@ -0,0 +1,80 @@
+/*
+ * classnames.c : Map class names to classes. This code is totally
+ * self-contained and so can be used for other projects. A smaller
+ * executable might result from only including the classes an
+ * application needs.
+ *
+ * George Ferguson, ferguson@cs.rochester.edu, 4 Sep 1991.
+ *
+ */
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Shell.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Grip.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/List.h>
+#include <X11/Xaw/Scrollbar.h>
+#include <X11/Xaw/StripChart.h>
+#include <X11/Xaw/Toggle.h>
+#include <X11/Xaw/SimpleMenu.h>
+#include <X11/Xaw/SmeBSB.h>
+#include <X11/Xaw/SmeLine.h>
+#include <X11/Xaw/MenuButton.h>
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/Box.h>
+#include <X11/Xaw/Dialog.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Paned.h>
+#include <X11/Xaw/Viewport.h>
+
+static struct tableRec {
+ char *name;
+ WidgetClass *class;
+ Boolean isShell;
+} table[] = {
+ { "Command", &commandWidgetClass, False },
+ { "Grip", &gripWidgetClass, False },
+ { "Label", &labelWidgetClass, False },
+ { "List", &listWidgetClass, False },
+ { "Scrollbar", &scrollbarWidgetClass, False },
+ { "StripChart", &stripChartWidgetClass, False },
+ { "Toggle", &toggleWidgetClass, False },
+ { "SimpleMenu", &simpleMenuWidgetClass, True },
+ { "SmeBSB", &smeBSBObjectClass, False },
+ { "SmeLine", &smeLineObjectClass, False },
+ { "MenuButton", &menuButtonWidgetClass, False },
+ { "AsciiText", &asciiTextWidgetClass, False },
+ { "Box", &boxWidgetClass, False },
+ { "Dialog", &dialogWidgetClass, False },
+ { "Form", &formWidgetClass, False },
+ { "Paned", &panedWidgetClass, False },
+ { "Viewport", &viewportWidgetClass, False },
+ { "Shell", &shellWidgetClass, True },
+ { "OverrideShell", &overrideShellWidgetClass, True },
+ { "WMShell", &wmShellWidgetClass, True },
+ { "TransientShell", &transientShellWidgetClass, True },
+ { "TopLevelShell", &topLevelShellWidgetClass, True },
+ { "ApplicationShell", &applicationShellWidgetClass, True },
+};
+
+/*
+ * classNameToWidgetClass : Returns the WidgetClass with the given "name".
+ * In addition, sets the isShell flag to True or False depending on
+ * whether the class is a Shell class or not.
+ * Return NULL if the name is not the name of any WidgetClass.
+ */
+WidgetClass
+classNameToWidgetClass(name,isShellp)
+char *name;
+Boolean *isShellp;
+{
+ int i;
+
+ for (i=0; i < XtNumber(table); i++)
+ if (strcmp(name,table[i].name) == 0) {
+ *isShellp = table[i].isShell;
+ return(*(table[i].class));
+ }
+ return((WidgetClass)NULL);
+}
diff --git a/vendor/x11iraf/xtapemon/classnames.h b/vendor/x11iraf/xtapemon/classnames.h
new file mode 100644
index 00000000..8fc7cc63
--- /dev/null
+++ b/vendor/x11iraf/xtapemon/classnames.h
@@ -0,0 +1,8 @@
+/*
+ * classnames.h : External defs for the classname converter
+ *
+ * George Ferguson, ferguson@cs.rochester.edu, 4 Sep 1991.
+ *
+ */
+
+extern WidgetClass classNameToWidgetClass(/* name,isShellp */);
diff --git a/vendor/x11iraf/xtapemon/gui2c.sed b/vendor/x11iraf/xtapemon/gui2c.sed
new file mode 100644
index 00000000..9a70a93c
--- /dev/null
+++ b/vendor/x11iraf/xtapemon/gui2c.sed
@@ -0,0 +1,6 @@
+s/\\/\\\\/g
+s/"/\\"/g
+s/^/"/
+s/$/",/
+p
+d
diff --git a/vendor/x11iraf/xtapemon/patchlevel.h b/vendor/x11iraf/xtapemon/patchlevel.h
new file mode 100644
index 00000000..4d4a5a5c
--- /dev/null
+++ b/vendor/x11iraf/xtapemon/patchlevel.h
@@ -0,0 +1,6 @@
+/*
+ * patchlevel.h : xtapemon version control
+ */
+
+int xtapemonMajorVersion = 1;
+int xtapemonMinorVersion = 0;
diff --git a/vendor/x11iraf/xtapemon/types.c b/vendor/x11iraf/xtapemon/types.c
new file mode 100644
index 00000000..b26a7abf
--- /dev/null
+++ b/vendor/x11iraf/xtapemon/types.c
@@ -0,0 +1,78 @@
+/*
+ * types.c : Converters for SearchType and SortType, and an improved
+ * converter for Widget that allows "NULL" to be specified.
+ *
+ * George Ferguson, ferguson@cs.rochester.edu, 12 Sep 1991.
+ *
+ */
+
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <X11/Xmu/CharSet.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Cardinals.h>
+#include "types.h"
+extern void XmuConvertStringToWidget(); /* original converter */
+
+/*
+ * Functions defined here:
+ */
+void initConverters();
+
+void cvtStringToWidget();
+
+/* Straight from the Xt manual... */
+#define done(VALUE,TYPE)\
+{ \
+ if (toVal->addr != NULL) { \
+ if (toVal->size < sizeof(TYPE)) { \
+ toVal->size = sizeof(TYPE); \
+ return(False); \
+ } \
+ *(TYPE *)(toVal->addr) = (VALUE); \
+ } else { \
+ static TYPE static_val; \
+ static_val = (VALUE); \
+ toVal->addr = (XtPointer)&static_val; \
+ } \
+ toVal->size = sizeof(TYPE); \
+ return(True); \
+}
+
+void
+initConverters(appContext)
+XtAppContext appContext;
+{
+ static XtConvertArgRec parentCvtArgs[] = {
+ {XtBaseOffset, (caddr_t)XtOffset(Widget, core.parent), sizeof(Widget)}
+ };
+
+ /* Have to initialize Form class first or our converter will be */
+ /* overidden by the class initialization function. */
+ /* Use the old style here on purpose since that what the default is.*/
+ XtInitializeWidgetClass(formWidgetClass);
+ XtAppAddConverter(appContext,XtRString,XtRWidget,cvtStringToWidget,
+ parentCvtArgs,XtNumber(parentCvtArgs));
+}
+
+/*
+ * cvtStringToWidget() : Allows us to specify "NULL" as a widget name in
+ * a resource file to override compiled-in defaults for composite
+ * widget layouts. Simply calls the regular converter if the string
+ * is not "NULL". Note that this must be registered *after* the
+ * Form class is initialized.
+ */
+void
+cvtStringToWidget(args,num_args,fromVal,toVal)
+XrmValuePtr args;
+Cardinal *num_args;
+XrmValuePtr fromVal;
+XrmValuePtr toVal;
+{
+ if (XmuCompareISOLatin1(fromVal->addr,"NULL") == 0) {
+ toVal->addr = NULL;
+ toVal->size = 0;
+ } else {
+ XmuCvtStringToWidget(args,num_args,fromVal,toVal);
+ }
+}
diff --git a/vendor/x11iraf/xtapemon/types.h b/vendor/x11iraf/xtapemon/types.h
new file mode 100644
index 00000000..106fd717
--- /dev/null
+++ b/vendor/x11iraf/xtapemon/types.h
@@ -0,0 +1,22 @@
+/*
+ * types.h : Definitions of SearchType and SortType and external defs
+ * of their resource converters and the improved Widget converter.
+ *
+ * George Ferguson, ferguson@cs.rochester.edu, 4 Sep 1991.
+ *
+ */
+
+#ifndef CONVERT_H
+#define CONVERT_H
+
+/* This puke is so the bloody converters work. Argh! */
+#define GfDefault '\000'
+#define GfInvdate '\001'
+
+#define GfNDefault "default"
+#define GfNInvdate "invdate"
+
+extern void initConverters();
+extern void cvtStringToWidget();
+
+#endif /* CONVERT_H */
diff --git a/vendor/x11iraf/xtapemon/xtapemon.c b/vendor/x11iraf/xtapemon/xtapemon.c
new file mode 100644
index 00000000..1cd7f35d
--- /dev/null
+++ b/vendor/x11iraf/xtapemon/xtapemon.c
@@ -0,0 +1,736 @@
+#include <stdio.h>
+#include <sys/errno.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+
+/* #ifndef AUX */
+#include <fcntl.h>
+/* #endif */
+
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Shell.h>
+#include <X11/Xaw/Paned.h>
+#include <X11/Xaw/Viewport.h>
+#include <X11/Xaw/List.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Box.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Cardinals.h>
+
+#include "appres.h"
+#include "xtapemon.h"
+#include "classnames.h"
+#include "patchlevel.h"
+
+/*
+ * XTAPEMON -- X window system based tape monitoring utility.
+ *
+ * Monitors the raw ascii status output of the iraf tape driver and
+ * maintains a graphical display of the tape status in a window.
+ *
+ */
+
+/* Local definitions.
+ */
+#define MAXCONN 0
+#define MAXPORTS 2
+#define ERR (-1)
+#define EOS '\0'
+#define SZ_FNAME 256
+#define SZ_LINE 512
+#define SZ_MSGBUF 2048
+
+extern errno;
+
+/* Functions defined in this file.
+ */
+int main();
+void doPendingEvents();
+void initWidgetsFromString();
+void setText(), setLabel();
+void status0(), status1(), status2();
+void fail0(), fail1();
+
+static int portSetup(), portOpen();
+static void initGraphics(), initWidgets();
+static void selectItem(), portClose();
+static void syntax(), appendText();
+static void Quit();
+static XtInputCallbackProc connectToClient(), readClientData();
+
+/* Global graphics data.
+ */
+Display *display;
+Screen *screen;
+Window root;
+int server_socket;
+int server_port;
+
+/* Global widget data.
+ */
+XtAppContext appContext;
+Widget toplevel;
+
+static Widget statusText, messages, quitButton, recordLabel;
+static Widget devtypeText, tapetypeText, tapesizeText, tapeusedText;
+static Widget acmodeText, densityText, blksizeText, fileText, recordText;
+static Widget recsizeText, nfilesText;
+
+/* Other global data.
+ */
+char *progname;
+AppResources appResources;
+
+/* Non-widget resources obtained from resource manager.
+ */
+static XtResource resources[] = {
+ { "widgets", "Widgets", XtRString, sizeof(String),
+ XtOffset(AppResources *,widgets), XtRImmediate, "" },
+ { "port", "Port", XtRInt, sizeof(int),
+ XtOffset(AppResources *,port), XtRImmediate, (XtPointer)5138 },
+ { "alternate", "Alternate", XtRInt, sizeof(int),
+ XtOffset(AppResources *,alternate), XtRImmediate, (XtPointer)0 },
+ { "debug", "Debug", XtRInt, sizeof(int),
+ XtOffset(AppResources *,debug), XtRImmediate, (XtPointer)0 },
+};
+
+/* Non-widget resources set on command line.
+ */
+static XrmOptionDescRec options[] = {
+ { "-port", ".port", XrmoptionSepArg, (XtPointer)"5138" },
+ { "-a", ".alternate", XrmoptionNoArg, (XtPointer)"1" },
+ { "-d", ".debug", XrmoptionNoArg, (XtPointer)"1" },
+};
+
+/* Widget and non-widget resources if the application defaults file can't
+ * be found. Generated automatically from XTapemon.ad by "ad2c".
+ */
+static String fallbackResources[] = {
+#include "XTapemon.ad.h"
+ NULL
+};
+
+/* Compatibility hacks. */
+#ifdef AUX
+void *memmove(a,b,n) void *a; const void *b; size_t n; { bcopy(b,a,n); }
+#else
+#if defined(sun) && !defined(SYSV)
+void *memmove(a,b,n) void *a, *b; int n; { bcopy(b,a,n); }
+#endif
+#endif
+
+/*
+ * The main program.
+ */
+main(argc,argv)
+int argc;
+char **argv;
+{
+ char buf[80];
+ int port;
+
+ progname = argv[0];
+ initGraphics(&argc,argv);
+ if (argc > 1) {
+ syntax(argc,argv);
+ XtDestroyApplicationContext(appContext);
+ exit(1);
+ }
+ initWidgets();
+ XtRealizeWidget(toplevel);
+ /* Set window title to indicate version */
+ sprintf (buf, "xtapemon %d.%d - IRAF Tape Monitor Utility",
+ xtapemonMajorVersion, xtapemonMinorVersion);
+ XStoreName(display,XtWindow(toplevel),buf);
+ sprintf(buf, "Welcome to xtapemon %d.%d",
+ xtapemonMajorVersion, xtapemonMinorVersion);
+ status0(buf);
+
+ /* Prepare to receive a connection, set up Xt callback to accept a
+ * client connection when one arrives.
+ */
+ port = appResources.port + appResources.alternate;
+ if ((server_socket = portSetup(port)) >= 0)
+ XtAppAddInput (appContext, server_socket, (XtPointer)XtInputReadMask,
+ (XtInputCallbackProc)connectToClient, (XtPointer)server_socket);
+
+ /* Identify port in use. */
+ sprintf (buf, "ready on port %s (%d)",
+ (server_port == appResources.port) ? "A" : "B", server_port);
+ setText (messages, buf);
+
+ /* do it */
+ XtAppMainLoop(appContext);
+ /*NOTREACHED*/
+}
+
+
+void
+doPendingEvents()
+{
+ while (XtAppPending(appContext))
+ XtAppProcessEvent(appContext,XtIMAll);
+}
+
+static void
+initGraphics(argcp,argv)
+int *argcp;
+char **argv;
+{
+ toplevel = XtAppInitialize(&appContext, "XTapemon",
+ options, XtNumber(options),
+ argcp,argv,fallbackResources,NULL,ZERO);
+ initConverters(appContext);
+ /* XawSimpleMenuAddGlobalActions(appContext); */
+ /* XtAppAddActions(appContext,actionTable,XtNumber(actionTable)); */
+ XtGetApplicationResources(toplevel,(XtPointer)&appResources,
+ resources,XtNumber(resources),NULL,ZERO);
+ display = XtDisplay(toplevel);
+ screen = XtScreen(toplevel);
+ root = RootWindowOfScreen(screen);
+}
+
+
+/* initWidgets -- Initialize the widgets given in the .widgets resource,
+ * check for required widgets, and set globals vars.
+ */
+static void
+initWidgets()
+{
+ initWidgetsFromString(appResources.widgets,".widgets");
+
+ /* set globals for optional widgets */
+ statusText = XtNameToWidget (toplevel, "*statusText");
+ messages = XtNameToWidget (toplevel, "*messages");
+ quitButton = XtNameToWidget (toplevel, "*quitButton");
+ devtypeText = XtNameToWidget (toplevel, "*devtypeText");
+ tapetypeText = XtNameToWidget (toplevel, "*tapetypeText");
+ tapesizeText = XtNameToWidget (toplevel, "*tapesizeText");
+ tapeusedText = XtNameToWidget (toplevel, "*tapeusedText");
+ acmodeText = XtNameToWidget (toplevel, "*acmodeText");
+ densityText = XtNameToWidget (toplevel, "*densityText");
+ blksizeText = XtNameToWidget (toplevel, "*blksizeText");
+ fileText = XtNameToWidget (toplevel, "*fileText");
+ recordText = XtNameToWidget (toplevel, "*recordText");
+ recordLabel = XtNameToWidget (toplevel, "*recordLabel");
+ recsizeText = XtNameToWidget (toplevel, "*recsizeText");
+ nfilesText = XtNameToWidget (toplevel, "*nfilesText");
+
+ /* Set up Quit button callback. */
+ XtAddCallback (quitButton, XtNcallback, Quit, (XtPointer)NULL);
+}
+
+static void
+Quit(w, call_data, client_data)
+Widget w;
+XtPointer call_data, client_data;
+{
+ XtDestroyApplicationContext(XtWidgetToApplicationContext(w));
+ exit(0);
+}
+
+#define ISSPACE(c) ((c) == ' ' || (c) == '\t' || (c) == '\n')
+#define NUL '\0'
+
+/* initWidgetsFromString -- Create the widgets specified in resourceStr as
+ * "parent class name" triples. The resourceName is used for error messages.
+ */
+void
+initWidgetsFromString(resourceStr,resourceName)
+char *resourceStr,*resourceName;
+{
+ char name[32],class[32],parent[256];
+ char *s,*t;
+ Boolean isShell;
+ WidgetClass wc;
+ Widget pw;
+
+ if ((s=resourceStr) == NULL)
+ fail1("no widgets specified in %s resource!",resourceName);
+ while (*s) {
+ /* skip leading whitespace */
+ while (ISSPACE(*s))
+ s += 1;
+ if (!*s)
+ break;
+ /* Gather the parent widget name */
+ t = parent;
+ while (*s && !ISSPACE(*s))
+ *t++ = *s++;
+ *t = NUL;
+ /* skip whitespace */
+ while (ISSPACE(*s))
+ s += 1;
+ if (!*s)
+ fail1("missing widget class and name in %s resource",resourceName);
+ /* Gather the class name */
+ t = class;
+ while (*s && !ISSPACE(*s))
+ *t++ = *s++;
+ *t = NUL;
+ /* skip whitespace */
+ while (ISSPACE(*s))
+ s += 1;
+ if (!*s)
+ fail1("missing widget name in %s resource",resourceName);
+ /* Gather the widget's name */
+ t = name;
+ while (*s && !ISSPACE(*s))
+ *t++ = *s++;
+ *t = NUL;
+ /* convert class name to WidgetClass */
+ if ((wc=classNameToWidgetClass(class,&isShell)) == NULL)
+ fail1("can't convert string \"%s\" to widgetClass",class);
+ /* convert parent name to Widget */
+ if (strcmp(parent,"toplevel") == 0)
+ pw = toplevel;
+ else if ((pw=XtNameToWidget(toplevel,parent)) == NULL)
+ fail1("can't convert string \"%s\" to widget",parent);
+ /* finally create the widget */
+ if (isShell)
+ (void)XtCreatePopupShell(name,wc,pw,NULL,ZERO);
+ else
+ (void)XtCreateManagedWidget(name,wc,pw,NULL,ZERO);
+ }
+}
+
+
+/*
+ * Client actions.
+ * --------------------------
+ */
+
+/* connectToClient -- Called when a client has attempted a connection on
+ * the xtapemon socket. Accept the connection and open a file pointer on
+ * the status output stream of the client.
+ */
+static XtInputCallbackProc
+connectToClient (client_data, source, id)
+XtPointer client_data;
+int *source;
+XtInputId *id;
+{
+ int fd;
+
+ setText (statusText, "connecting to client...");
+ if ((fd = portOpen ((int)*source)) < 0)
+ setText (statusText, "connection failed");
+ else {
+ setText (statusText, "connection established");
+ if (fcntl (fd, F_SETFD, O_RDWR|O_NDELAY) < 0) {
+ char buf[80];
+ sprintf (buf, "fcntl failed, errno=%d", errno);
+ setText (statusText, buf);
+ portClose (fd);
+ } else {
+ /* Enable the following to prohibit multiple clients.
+ * XtRemoveInput (*id);
+ */
+ XtAppAddInput (appContext, fd, (XtPointer)XtInputReadMask,
+ (XtInputCallbackProc)readClientData, (XtPointer)NULL);
+ }
+ }
+
+ doPendingEvents();
+}
+
+
+/* readClientData -- Called when there is client data to be read and
+ * displayed.
+ */
+static XtInputCallbackProc
+readClientData (client_data, source, id)
+XtPointer client_data;
+int *source;
+XtInputId *id;
+{
+ register int fd = *source;
+ register char *ip, *op;
+ static char msg[SZ_MSGBUF];
+ static int nleft, tapesize, blksize;
+ char word[SZ_LINE], value[SZ_LINE];
+ char obuf[SZ_LINE], iodev[SZ_FNAME];
+ int nchars, newline, maxch, ival;
+ char *start;
+
+ start = msg + nleft;
+ maxch = SZ_MSGBUF - nleft;
+ nleft = 0;
+
+ /* Read a block of text from the input socket and process each line to
+ * the monitor window. Messages may be batched for efficiency, i.e.,
+ * the text block may contain several lines. Since socket i/o is stream
+ * based we can't assume that lines are not broken over read transfer
+ * boundaries, so it is necessary to save any partial line at the end of
+ * a read and join the line when the next data block is read.
+ */
+ nchars = read (fd, start, maxch);
+ if (nchars >= 0) {
+ if (appResources.debug)
+ write (2, start, nchars);
+ *(start + nchars) = EOS;
+ }
+ ip = msg;
+
+ while (*ip) {
+ start = ip;
+ newline = 0;
+
+ /* Get first whitespace delimited word. */
+ for (op=word; *ip && !isspace(*ip); )
+ *op++ = *ip++;
+ *op = EOS;
+ while (*ip && *ip == ' ')
+ ip++;
+
+ /* Anything other than "keyword = value" is a message and is sent
+ * to the message window. Messages are newline delimited. The
+ * newline is required to delimit records. To include a newline
+ * in a message one must pass an explicit \n, e.g, "foo\\n\n".
+ */
+ if (*ip == '=') {
+ for (ip++, op=value; *ip; ) {
+ if (*ip == '\n') {
+ ip++;
+ newline++;
+ break;
+ } else
+ *op++ = *ip++;
+ }
+ *op = EOS;
+ } else {
+ for (ip=start, op=value; *ip; ) {
+ if (*ip == '\n') {
+ ip++;
+ newline++;
+ break;
+ } else if (*ip == '\\' && *(ip+1) == 'n') {
+ *op++ = '\n';
+ ip += 2;
+ } else
+ *op++ = *ip++;
+ }
+ *op = EOS;
+ if (newline) {
+ appendText (value);
+ continue;
+ }
+ }
+
+ /* Save any partial line for next time. */
+ if (!newline) {
+ strcpy (msg, start);
+ nleft = strlen (msg);
+ break;
+ }
+
+ /* Set the value of a keyword. */
+ if (word[0] == EOS) {
+ continue;
+ } else if (strcmp (word, "iodev") == 0) {
+ strcpy (iodev, value+1);
+ } else if (strcmp (word, "host") == 0) {
+ sprintf (obuf, "connected to %s,%s on port %s (%d)",
+ value+1, iodev,
+ (server_port == appResources.port) ? "A" : "B", server_port);
+ setText (statusText, obuf);
+
+ } else if (strcmp (word, "devtype") == 0) {
+ setText (devtypeText, value);
+ } else if (strcmp (word, "tapetype") == 0) {
+ setText (tapetypeText, value);
+
+ } else if (strcmp (word, "tapesize") == 0) {
+ ival = atoi (value);
+ sprintf (obuf, " %d.%02d Mb", ival / 1000, ((ival%1000) + 5) / 10);
+ setText (tapesizeText, obuf);
+ tapesize = ival;
+
+ } else if (strcmp (word, "tapeused") == 0) {
+ ival = atoi (value);
+ sprintf (obuf, " %d.%02d Mb (%02d%%)",
+ ival / 1000, ((ival % 1000) + 5) / 10,
+ (ival / tapesize) * 100);
+ setText (tapeusedText, obuf);
+
+ } else if (strcmp (word, "blksize") == 0) {
+ ival = atoi (value);
+ if (ival != blksize) {
+ setLabel (recordLabel, ival ? " Block:" : "Record:");
+ blksize = ival;
+ }
+ setText (blksizeText, !strcmp(value," 0") ? " variable" : value);
+
+ } else if (strcmp (word, "acmode") == 0) {
+ setText (acmodeText, value);
+ } else if (strcmp (word, "density") == 0) {
+ setText (densityText, value);
+ } else if (strcmp (word, "file") == 0) {
+ setText (fileText, value);
+ } else if (strcmp (word, "nfiles") == 0) {
+ setText (nfilesText, !strcmp(value," 0") ? " unknown" : value);
+ } else if (strcmp (word, "record") == 0) {
+ setText (recordText, value);
+ } else if (strcmp (word, "recsize") == 0) {
+ setText (recsizeText, value);
+ } else {
+ sprintf (obuf, "%s = %s", word, value);
+ appendText (obuf);
+ }
+ }
+
+ /* Close connection, and ready to receive further connection. */
+ if (nchars <= 0) {
+ close (fd);
+ XtRemoveInput (*id);
+ setText (statusText, "connection closed");
+
+ /* Enable the following if XtRemoveInput is used in XtInputCallback
+ * XtAppAddInput (appContext, server_socket, XtInputReadMask,
+ * (XtInputCallbackProc)connectToClient, (XtPointer)server_socket);
+ */
+ }
+
+done:
+
+ XFlush (display);
+ doPendingEvents();
+}
+
+
+/* appendText -- Append some text to the message buffer.
+ */
+static void
+appendText (text)
+char *text;
+{
+ register char *ip, *op;
+ static XawTextPosition pos = 0;
+ static int newline = 0;
+ XawTextBlock tx;
+ char buf[1024];
+
+ if (pos == 0)
+ setText (messages, "");
+
+ op = buf;
+ if (newline)
+ *op++ = '\n';
+
+ for (ip=text; *ip; )
+ *op++ = *ip++;
+
+ if (newline = (*(ip-1) == '\n'))
+ op--;
+
+ *op = EOS;
+
+ tx.ptr = buf;
+ tx.length = op - buf;
+ tx.format = FMT8BIT;
+ tx.firstPos = 0;
+
+ XawTextReplace (messages, pos, pos, &tx);
+ XawTextSetInsertionPoint (messages, (pos += (op - buf)));
+}
+
+
+/*
+ * Socket i/o code.
+ * --------------------------
+ */
+
+
+/* portSetup -- Set up the tape status port, used by remote tape driver client
+ * to send messages to xtapemon.
+ */
+static int
+portSetup (first_port)
+int first_port;
+{
+ struct sockaddr_in sockaddr;
+ int bound, reuse=1;
+ int s, port, i;
+
+ if ((s = socket (AF_INET, SOCK_STREAM, 0)) < 0) {
+ status1 ("socket creation fails, errno=%d", errno);
+ return (ERR);
+ }
+
+ /* Try to bind an address to the socket. If the first try doesn't
+ * succeed it may be because a server is already bound to the port,
+ * so try a higher numbered port.
+ */
+ for (bound=i=0; i < MAXPORTS; i++) {
+ port = first_port + i;
+ memset ((char *)&sockaddr, 0, sizeof(sockaddr));
+ sockaddr.sin_family = AF_INET;
+ sockaddr.sin_port = htons((short)port);
+ sockaddr.sin_addr.s_addr = INADDR_ANY;
+
+ if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&reuse,
+ sizeof(reuse)) < 0) {
+ close (s);
+ return (ERR);
+ }
+
+ if (bind (s, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) >= 0) {
+ server_port = port;
+ bound++;
+ break;
+ }
+ }
+
+ if (!bound) {
+ status1 ("bind on socket fails, errno=%d", errno);
+ close (s);
+ return (ERR);
+ }
+
+ if (listen (s, MAXCONN) < 0) {
+ status1 ("listen on socket fails, errno=%d", errno);
+ close (s);
+ return (ERR);
+ }
+
+ return (s);
+}
+
+
+/* portOpen -- Called when processing is needed on a socket, either when
+ * a client is requesting a connection or when data is ready on a connected
+ * socket.
+ */
+static int
+portOpen (s)
+int s;
+{
+ int fd;
+ if ((fd = accept (s, (struct sockaddr *)0, (int *)0)) < 0)
+ return (ERR);
+ else
+ return (fd);
+}
+
+
+/* portClose -- Close a file descriptor opened on an active server socket.
+ */
+static void
+portClose (fd)
+int fd;
+{
+ close (fd);
+}
+
+
+/*
+ * Utility routines.
+ * --------------------------
+ */
+
+/* setText -- Set the given Text item's value to the given string.
+ */
+void
+setText(item,text)
+Widget item;
+char *text;
+{
+ Arg args[1];
+
+ if (item != NULL) {
+ XtSetArg(args[0],XtNstring,text);
+ XtSetValues(item,args,ONE);
+ }
+}
+
+
+/* setLabel -- Set the given Label item's value to the given string.
+ */
+void
+setLabel(item,text)
+Widget item;
+char *text;
+{
+ Arg args[1];
+
+ if (item != NULL) {
+ XtSetArg(args[0],XtNlabel,text);
+ XtSetValues(item,args,ONE);
+ }
+}
+
+void
+status0(str)
+char *str;
+{
+ if (statusText != NULL)
+ setText(statusText,str);
+ doPendingEvents();
+}
+
+void
+status1(fmt,arg)
+char *fmt,*arg;
+{
+ char buf[256];
+
+ sprintf(buf,fmt,arg);
+ status0(buf);
+}
+
+void
+status2(fmt,arg1,arg2)
+char *fmt,*arg1,*arg2;
+{
+ char buf[256];
+
+ sprintf(buf,fmt,arg1,arg2);
+ status0(buf);
+}
+
+void
+fail0(str)
+char *str;
+{
+ fprintf(stderr,"%s: %s\n",progname,str);
+ XtDestroyApplicationContext(appContext);
+ exit(1);
+}
+
+void
+fail1(fmt,arg)
+char *fmt,*arg;
+{
+ char buf[256];
+
+ sprintf(buf,fmt,arg);
+ fail0(buf);
+}
+
+/* syntax -- Print whatever caused the error and the usage message.
+ */
+static void
+syntax(argc,argv)
+int argc;
+char **argv;
+{
+ char *program;
+
+ program = *argv;
+ argv += 1;
+ if (argc > 2 || (strcmp(*argv,"-help") != 0 && strcmp(*argv,"-?") != 0)) {
+ fprintf(stderr,"%s: bad argument(s): ",program);
+ while (--argc)
+ fprintf(stderr,"%s ",*argv++);
+ fprintf(stderr,"\n");
+ }
+ fprintf(stderr,"Valid options (in addition to X Toolkit options) are:\n");
+ fprintf(stderr," -port N\tlisten on port number N\n");
+ fprintf(stderr," -a\tlisten on alternate port\n");
+ fprintf(stderr," -d\tpass client messages to standard out\n");
+ fprintf(stderr,"Options can be abbreviated to their shortest unique prefix.\n");
+}
diff --git a/vendor/x11iraf/xtapemon/xtapemon.h b/vendor/x11iraf/xtapemon/xtapemon.h
new file mode 100644
index 00000000..4fdafc13
--- /dev/null
+++ b/vendor/x11iraf/xtapemon/xtapemon.h
@@ -0,0 +1,29 @@
+/*
+ * xarchie.h : Definitions of the X globals and misc. functions
+ *
+ * George Ferguson, ferguson@cs.rochester.edu, 4 Sep 1991.
+ *
+ */
+
+#ifndef XARCHIE_H
+#define XARCHIE_H
+
+extern Display *display;
+extern Screen *screen;
+extern Window root;
+
+extern XtAppContext appContext;
+extern Widget toplevel;
+extern Widget hostList,locationList,fileList;
+extern Widget searchText;
+
+extern void doPendingEvents();
+extern void initWidgetsFromString();
+extern void displayHostInfo(), clearHostInfo();
+extern void displayLocationInfo(), clearLocationInfo();
+extern void displayFileInfo(), clearFileInfo();
+extern void setText(), setLabel();
+extern void status0(), status1(), status2();
+extern void fail0(), fail1();
+
+#endif /* XARCHIE_H */
diff --git a/vendor/x11iraf/xtapemon/xtapemon.man b/vendor/x11iraf/xtapemon/xtapemon.man
new file mode 100644
index 00000000..359c7bd3
--- /dev/null
+++ b/vendor/x11iraf/xtapemon/xtapemon.man
@@ -0,0 +1,135 @@
+.\" @(#)xtapemon.1 1.1 11-Dec-96 MJF
+.TH XTAPEMON 1 "11 Dec 1996" "X11IRAF Project"
+.SH NAME
+XTapemon \- magtape I/O status monitor and display utility for IRAF
+.SH SYNOPSIS
+\fBxtapemon\fP
+[\-\fItoolkitoption\fP ...] [ \fI-port\fP <port> ] [ \fI\-a\fP ] [ \fI-d\fP ]
+.SH OPTIONS
+In addition to the X Toolkit options, the following are supported:
+.TP 5
+.B "-port \fIport\fP"
+Set the primary port to listen on for client connections. The default
+is 5138.
+.TP 5
+.B "-a"
+Listen on alternate port, this is the primary port number plus one.
+The default is 5139.
+.TP 5
+.B "-d"
+Debug mode, pass client message to the standard out. The default is false.
+
+.SH "X RESOURCES"
+\fBXTapemon\fP options can appear on the command line or in your X
+resource file. Options on the command line supercede values
+specified in your X resource file.
+
+.TP 12
+.B "port"
+Set the primary port to listen on for client connections. The default
+is 5138.
+.TP 12
+.B "alternate"
+Listen on alternate port, this is the primary port number plus one.
+The default is 5139.
+.TP 12
+.B "debug"
+Debug mode, pass client message to the standard out. The default is false.
+.SH DESCRIPTION
+.LP
+Xtapemon is a magtape status monitor and display utility. You use it to
+display the status of a IRAF tape job while it is running. TCP/IP sockets
+are used for communication, so the IRAF tape job and xtapemon may be on
+the same host machine or on different hosts. All V2.10 versions of IRAF
+support tape status output (including even VMS/IRAF). For example, suppose
+our workstation is named \fIcygnus\fP and we are running IRAF on host
+\fIregulus\fP, using magtape device mta. The first step is to
+start xtapemon on cygnus:
+
+ % xtapemon &
+
+Then in IRAF on regulus we might do the following:
+
+ cl> set tapecap = ":so=cygnus"
+ cl> allocate mta
+ cl> rewind mta
+
+At this point the IRAF magtape i/o driver executing on regulus should open
+a connection to the xtapemon tape monitoring server running on cygnus, and
+indicate that a rewind operation is taking place.
+
+If both xtapemon and the IRAF tape job are running on the same host then
+the hostname can be omitted, e.g. "set tapecap = :so". The use of
+"set tapecap" assumes that the default IRAF tapecap is being used. If
+the user has a private tapecap, the syntax is
+
+ cl> set tapecap = "<my-tapecap-file>:so=hostname"
+
+In general you can append any number of tapecap device capability overrides
+(the :xx fields) to the tapecap environment specification. Alternatively,
+the :so can be specified on the command line, e.g.
+
+ cl> rewind "mta[:so=cygnus]"
+
+But in general it will be more convenient to use set tapecap.
+
+It is safe to have :so (status output) enabled even if there is no xtapemon
+server; IRAF will try to make the connection but will proceed without any
+indication of an error if the status output connection cannot be established.
+
+
+The amount of tape read or written in Mb will be accurate only if the IRAF
+magtape driver actually reads or writes all the data between the beginning
+of tape and the current position of the tape. Hence, if one rewinds the
+tape and then reads or writes a number of tiles, the Mb used field will be
+accurate. If however one does a skip to a random file somewhere far down on
+the tape, IRAF will not have read the data and the tape used field will
+indicate only the data actually read or written. For example, a rewind
+followed by a \fImtexamine\fP will reliably indicate the actual amount of data
+on the tape, leaving the tape positioned to EOT. If one then appends new files
+to the tape the tape used field will still be accurate. If however one pops
+in a new tape and then appends a file at EOT, tape used will be invalid as
+the drive will rapidly skip forward to the EOT.
+
+.SH "ADVANCED USAGE"
+
+By default xtapemon listens on the port 5138, called port A. If when you
+start the xtapemon server this port is already busy, xtapemon will
+automatically switch to port B instead (the alternate port, 5139). This
+makes it possible to monitor two tape jobs at the same time.
+
+If you have xtapemon servers running on two ports it will be necessary to
+tell the second IRAF tape job what port to use, since the magtape driver
+will use port A by default. For example,
+
+ cl> set tapecap = ":so=cygnus,5139"
+or
+ cl> mtexamine "mta[:so=,5139]"
+
+If there is some problem using the builtin port defaults you can use any
+port you want. The following resources tell which port to use.
+
+ XTapemon.port # port A
+ XTapemon.alternate # port B
+
+Or you can specify the ports with the argument "-port" or "-a" (alternate)
+on the command line when xtapemon is started.
+.SH BUGS
+You can't necessarily trust displayed information such as the device type and
+tape type. On most platforms this information is taken from the tapecap
+entry for the device, and the accuracy of this information will depend upon
+the diligence of your IRAF system adminstrator when they configured tapecap
+for your site (and on whether you use the correct logical device name for
+the drive and tape capacity you are using).
+
+Xtapemon tries to keep track of the amount of tape used: the number of Mb
+(megabytes) read or written is displayed, along with the percent of the tape
+used. Whether or not the percent used field is accurate depends upon a
+number of factors. First the tape capacity given in the tapecap file must
+match the actual tape being used. Second, if data compression is in use on
+the drive, xtapemon will display the uncompressed quantity of data written.
+On a compression drive percent used can be greater than 100%!
+.SH SEE ALSO
+xgterm(1), ximtool(1)
+.SH COPYRIGHT
+Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
diff --git a/vendor/x11iraf/xtapemon/xtapemon.ps b/vendor/x11iraf/xtapemon/xtapemon.ps
new file mode 100644
index 00000000..bab4ba17
--- /dev/null
+++ b/vendor/x11iraf/xtapemon/xtapemon.ps
@@ -0,0 +1,361 @@
+%!PS-Adobe-3.0
+%%Creator: groff version 1.09
+%%CreationDate: Sat Apr 5 14:54:31 1997
+%%DocumentNeededResources: font Times-Roman
+%%+ font Times-Bold
+%%+ font Times-Italic
+%%DocumentSuppliedResources: procset grops 1.09 0
+%%Pages: 2
+%%PageOrder: Ascend
+%%Orientation: Portrait
+%%EndComments
+%%BeginProlog
+%%BeginResource: procset grops 1.09 0
+/setpacking where{
+pop
+currentpacking
+true setpacking
+}if
+/grops 120 dict dup begin
+/SC 32 def
+/A/show load def
+/B{0 SC 3 -1 roll widthshow}bind def
+/C{0 exch ashow}bind def
+/D{0 exch 0 SC 5 2 roll awidthshow}bind def
+/E{0 rmoveto show}bind def
+/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
+/G{0 rmoveto 0 exch ashow}bind def
+/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
+/I{0 exch rmoveto show}bind def
+/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
+/K{0 exch rmoveto 0 exch ashow}bind def
+/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
+/M{rmoveto show}bind def
+/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
+/O{rmoveto 0 exch ashow}bind def
+/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
+/Q{moveto show}bind def
+/R{moveto 0 SC 3 -1 roll widthshow}bind def
+/S{moveto 0 exch ashow}bind def
+/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
+/SF{
+findfont exch
+[exch dup 0 exch 0 exch neg 0 0]makefont
+dup setfont
+[exch/setfont cvx]cvx bind def
+}bind def
+/MF{
+findfont
+[5 2 roll
+0 3 1 roll
+neg 0 0]makefont
+dup setfont
+[exch/setfont cvx]cvx bind def
+}bind def
+/level0 0 def
+/RES 0 def
+/PL 0 def
+/LS 0 def
+/PLG{
+gsave newpath clippath pathbbox grestore
+exch pop add exch pop
+}bind def
+/BP{
+/level0 save def
+1 setlinecap
+1 setlinejoin
+72 RES div dup scale
+LS{
+90 rotate
+}{
+0 PL translate
+}ifelse
+1 -1 scale
+}bind def
+/EP{
+level0 restore
+showpage
+}bind def
+/DA{
+newpath arcn stroke
+}bind def
+/SN{
+transform
+.25 sub exch .25 sub exch
+round .25 add exch round .25 add exch
+itransform
+}bind def
+/DL{
+SN
+moveto
+SN
+lineto stroke
+}bind def
+/DC{
+newpath 0 360 arc closepath
+}bind def
+/TM matrix def
+/DE{
+TM currentmatrix pop
+translate scale newpath 0 0 .5 0 360 arc closepath
+TM setmatrix
+}bind def
+/RC/rcurveto load def
+/RL/rlineto load def
+/ST/stroke load def
+/MT/moveto load def
+/CL/closepath load def
+/FL{
+currentgray exch setgray fill setgray
+}bind def
+/BL/fill load def
+/LW/setlinewidth load def
+/RE{
+findfont
+dup maxlength 1 index/FontName known not{1 add}if dict begin
+{
+1 index/FID ne{def}{pop pop}ifelse
+}forall
+/Encoding exch def
+dup/FontName exch def
+currentdict end definefont pop
+}bind def
+/DEFS 0 def
+/EBEGIN{
+moveto
+DEFS begin
+}bind def
+/EEND/end load def
+/CNT 0 def
+/level1 0 def
+/PBEGIN{
+/level1 save def
+translate
+div 3 1 roll div exch scale
+neg exch neg exch translate
+0 setgray
+0 setlinecap
+1 setlinewidth
+0 setlinejoin
+10 setmiterlimit
+[]0 setdash
+/setstrokeadjust where{
+pop
+false setstrokeadjust
+}if
+/setoverprint where{
+pop
+false setoverprint
+}if
+newpath
+/CNT countdictstack def
+userdict begin
+/showpage{}def
+}bind def
+/PEND{
+clear
+countdictstack CNT sub{end}repeat
+level1 restore
+}bind def
+end def
+/setpacking where{
+pop
+setpacking
+}if
+%%EndResource
+%%IncludeResource: font Times-Roman
+%%IncludeResource: font Times-Bold
+%%IncludeResource: font Times-Italic
+grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
+def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
+/scaron/zcaron/Ydieresis/trademark/quotesingle/.notdef/.notdef/.notdef
+/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
+/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
+/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
+/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
+/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
+/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
+/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
+/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
+/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
+/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
+/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
+/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
+/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
+/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
+/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
+/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
+/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
+/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
+/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
+/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
+/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
+/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
+/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
+/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
+/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
+/Times-Italic@0 ENC0/Times-Italic RE/Times-Bold@0 ENC0/Times-Bold RE
+/Times-Roman@0 ENC0/Times-Roman RE
+%%EndProlog
+%%Page: 1 1
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman@0 SF(XT)72 48 Q 332.94(APEMON\(1\) XT)-.93 F
+(APEMON\(1\))-.93 E/F1 9/Times-Bold@0 SF -.18(NA)72 84 S(ME).18 E F0(XT)
+108 96 Q
+(apemon \255 magtape I/O status monitor and display utility for IRAF)-.8
+E F1(SYNOPSIS)72 112.8 Q/F2 10/Times-Bold@0 SF(xtapemon)108 124.8 Q F0
+<5bad>2.5 E/F3 10/Times-Italic@0 SF(toolkitoption)A F0(...] [)2.5 E F3
+(-port)2.5 E F0(<port> ] [)2.5 E F3<ad61>2.5 E F0 2.5(][)2.5 G F3(-d)A
+F0(])2.5 E F1(OPTIONS)72 141.6 Q F0(In addition to the X T)108 153.6 Q
+(oolkit options, the follo)-.8 E(wing are supported:)-.25 E F2(-port)108
+170.4 Q F3(port)2.5 E F0
+(Set the primary port to listen on for client connections.)133 182.4 Q
+(The def)5 E(ault is 5138.)-.1 E F2(-a)108 199.2 Q F0
+(Listen on alternate port, this is the primary port number plus one.)
+16.67 E(The def)5 E(ault is 5139.)-.1 E F2(-d)108 216 Q F0(Deb)16.11 E
+(ug mode, pass client message to the standard out.)-.2 E(The def)5 E
+(ault is f)-.1 E(alse.)-.1 E F1 2.25(XR)72 244.8 S(ESOURCES)-2.25 E F2
+(XT)108 256.8 Q(apemon)-.92 E F0 .551
+(options can appear on the command line or in your X resource \214le.)
+3.051 F .55(Options on the command)5.55 F(line supercede v)108 268.8 Q
+(alues speci\214ed in your X resource \214le.)-.25 E F2(port)108 297.6 Q
+F0(Set the primary port to listen on for client connections.)41.67 E
+(The def)5 E(ault is 5138.)-.1 E F2(alter)108 314.4 Q(nate)-.15 E F0
+(Listen on alternate port, this is the primary port number plus one.)
+21.83 E(The def)5 E(ault is 5139.)-.1 E F2(deb)108 331.2 Q(ug)-.2 E F0
+(Deb)34.08 E(ug mode, pass client message to the standard out.)-.2 E
+(The def)5 E(ault is f)-.1 E(alse.)-.1 E F1(DESCRIPTION)72 348 Q F0 .68
+(Xtapemon is a magtape status monitor and display utility)108 360 R 5.68
+(.Y)-.65 G .681(ou use it to display the status of a IRAF tape)-6.78 F
+.746(job while it is running.)108 372 R .746(TCP/IP sock)5.746 F .746
+(ets are used for communication, so the IRAF tape job and xtapemon)-.1 F
+.984(may be on the same host machine or on dif)108 384 R .984
+(ferent hosts.)-.25 F .985(All V2.10 v)5.985 F .985
+(ersions of IRAF support tape status)-.15 F 1.018(output \(including e)
+108 396 R -.15(ve)-.25 G 3.517(nV).15 G 3.517(MS/IRAF\). F)-3.517 F
+1.017(or e)-.15 F 1.017(xample, suppose our w)-.15 F 1.017
+(orkstation is named)-.1 F F3(cygnus)3.517 E F0 1.017(and we are)3.517 F
+(running IRAF on host)108 408 Q F3 -.37(re)2.5 G(gulus)-.03 E F0 2.5(,u)
+C(sing magtape de)-2.5 E(vice mta.)-.25 E
+(The \214rst step is to start xtapemon on c)5 E(ygnus:)-.15 E 2.5(%x)128
+432 S(tapemon &)-2.5 E(Then in IRAF on re)108 456 Q
+(gulus we might do the follo)-.15 E(wing:)-.25 E
+(cl> set tapecap = ":so=c)128 480 Q(ygnus")-.15 E(cl> allocate mta)128
+492 Q(cl> re)128 504 Q(wind mta)-.25 E .578
+(At this point the IRAF magtape i/o dri)108 528 R -.15(ve)-.25 G 3.078
+(re).15 G -.15(xe)-3.228 G .578(cuting on re).15 F .579
+(gulus should open a connection to the xtapemon)-.15 F
+(tape monitoring serv)108 540 Q(er running on c)-.15 E
+(ygnus, and indicate that a re)-.15 E(wind operation is taking place.)
+-.25 E .781(If both xtapemon and the IRAF tape job are running on the s\
+ame host then the hostname can be omitted,)108 564 R .552
+(e.g. "set tapecap = :so".)108 576 R .553
+(The use of "set tapecap" assumes that the def)5.552 F .553
+(ault IRAF tapecap is being used.)-.1 F(If)5.553 E(the user has a pri)
+108 588 Q -.25(va)-.25 G(te tapecap, the syntax is).25 E
+(cl> set tapecap = "<my-tapecap-\214le>:so=hostname")128 612 Q .247
+(In general you can append an)108 636 R 2.747(yn)-.15 G .247
+(umber of tapecap de)-2.747 F .247(vice capability o)-.25 F -.15(ve)-.15
+G .247(rrides \(the :xx \214elds\) to the tapecap).15 F(en)108 648 Q
+(vironment speci\214cation.)-.4 E(Alternati)5 E -.15(ve)-.25 G(ly).15 E
+2.5(,t)-.65 G(he :so can be speci\214ed on the command line, e.g.)-2.5 E
+(cl> re)128 672 Q(wind "mta[:so=c)-.25 E(ygnus]")-.15 E
+(But in general it will be more con)108 696 Q -.15(ve)-.4 G
+(nient to use set tapecap.).15 E .251(It is safe to ha)108 720 R .551
+-.15(ve :)-.2 H .251(so \(status output\) enabled e).15 F -.15(ve)-.25 G
+2.751(ni).15 G 2.751(ft)-2.751 G .252(here is no xtapemon serv)-2.751 F
+2.752(er; IRAF)-.15 F .252(will try to mak)2.752 F 2.752(et)-.1 G(he)
+-2.752 E(X11IRAF Project)72 768 Q(11 Dec 1996)137.62 E(1)203.45 E EP
+%%Page: 2 2
+%%BeginPageSetup
+BP
+%%EndPageSetup
+/F0 10/Times-Roman@0 SF(XT)72 48 Q 332.94(APEMON\(1\) XT)-.93 F
+(APEMON\(1\))-.93 E 1.227(connection b)108 84 R 1.227
+(ut will proceed without an)-.2 F 3.727(yi)-.15 G 1.227
+(ndication of an error if the status output connection cannot be)-3.727
+F(established.)108 96 Q .013(The amount of tape read or written in Mb w\
+ill be accurate only if the IRAF magtape dri)108 132 R -.15(ve)-.25 G
+2.514(ra).15 G .014(ctually reads or)-2.514 F .073
+(writes all the data between the be)108 144 R .073
+(ginning of tape and the current position of the tape.)-.15 F .072
+(Hence, if one re)5.072 F(winds)-.25 E .184(the tape and then reads or \
+writes a number of tiles, the Mb used \214eld will be accurate.)108 156
+R .184(If ho)5.184 F(we)-.25 E -.15(ve)-.25 G 2.684(ro).15 G .184
+(ne does)-2.684 F 2.651(as)108 168 S .151(kip to a random \214le some)
+-2.651 F .151(where f)-.25 F .151(ar do)-.1 F .15
+(wn on the tape, IRAF will not ha)-.25 F .45 -.15(ve r)-.2 H .15
+(ead the data and the tape used).15 F .736
+(\214eld will indicate only the data actually read or written.)108 180 R
+-.15(Fo)5.737 G 3.237(re).15 G .737(xample, a re)-3.387 F .737
+(wind follo)-.25 F .737(wed by a)-.25 F/F1 10/Times-Italic@0 SF(mte)
+3.237 E(xamine)-.2 E F0 .267
+(will reliably indicate the actual amount of data on the tape, lea)108
+192 R .267(ving the tape positioned to EO)-.2 F 4.246 -.74(T. I)-.4 H
+2.766(fo).74 G .266(ne then)-2.766 F .696(appends ne)108 204 R 3.196
+<778c>-.25 G .696
+(les to the tape the tape used \214eld will still be accurate.)-3.196 F
+.696(If ho)5.696 F(we)-.25 E -.15(ve)-.25 G 3.196(ro).15 G .697
+(ne pops in a ne)-3.196 F 3.197(wt)-.25 G(ape)-3.197 E
+(and then appends a \214le at EO)108 216 Q 1.48 -.74(T, t)-.4 H
+(ape used will be in).74 E -.25(va)-.4 G(lid as the dri).25 E .3 -.15
+(ve w)-.25 H(ill rapidly skip forw).15 E(ard to the EO)-.1 E -.74(T.)-.4
+G/F2 9/Times-Bold@0 SF(AD)72 244.8 Q -1.215(VA)-.36 G(NCED USA)1.215 E
+(GE)-.495 E F0 .005(By def)108 256.8 R .004
+(ault xtapemon listens on the port 5138, called port A.)-.1 F .004
+(If when you start the xtapemon serv)5.004 F .004(er this port)-.15 F
+.048(is already b)108 268.8 R(usy)-.2 E 2.548(,x)-.65 G .048(tapemon wi\
+ll automatically switch to port B instead \(the alternate port, 5139\).)
+-2.548 F .049(This mak)5.049 F(es)-.1 E(it possible to monitor tw)108
+280.8 Q 2.5(ot)-.1 G(ape jobs at the same time.)-2.5 E .974(If you ha)
+108 304.8 R 1.274 -.15(ve x)-.2 H .973(tapemon serv).15 F .973
+(ers running on tw)-.15 F 3.473(op)-.1 G .973
+(orts it will be necessary to tell the second IRAF tape job)-3.473 F
+(what port to use, since the magtape dri)108 316.8 Q -.15(ve)-.25 G 2.5
+(rw).15 G(ill use port A by def)-2.5 E 2.5(ault. F)-.1 F(or e)-.15 E
+(xample,)-.15 E(cl> set tapecap = ":so=c)128 340.8 Q(ygnus,5139" or)-.15
+E(cl> mte)128 352.8 Q(xamine "mta[:so=,5139]")-.15 E 1.423
+(If there is some problem using the b)108 376.8 R 1.423(uiltin port def)
+-.2 F 1.423(aults you can use an)-.1 F 3.924(yp)-.15 G 1.424(ort you w)
+-3.924 F 3.924(ant. The)-.1 F(follo)3.924 E(wing)-.25 E
+(resources tell which port to use.)108 388.8 Q(XT)128 412.8 Q 58.7
+(apemon.port #)-.8 F(port A)2.5 E(XT)128 424.8 Q 40.38
+(apemon.alternate #)-.8 F(port B)2.5 E .146
+(Or you can specify the ports with the ar)108 448.8 R .145
+(gument "-port" or "-a" \(alternate\) on the command line when xtape-)
+-.18 F(mon is started.)108 460.8 Q F2 -.09(BU)72 477.6 S(GS).09 E F0
+-1.1(Yo)108 489.6 S 2.69(uc)1.1 G(an')-2.69 E 2.69(tn)-.18 G .19
+(ecessarily trust displayed information such as the de)-2.69 F .19
+(vice type and tape type.)-.25 F .19(On most platforms)5.19 F 1.002
+(this information is tak)108 501.6 R 1.001
+(en from the tapecap entry for the de)-.1 F 1.001(vice, and the accurac)
+-.25 F 3.501(yo)-.15 G 3.501(ft)-3.501 G 1.001(his information will)
+-3.501 F .87
+(depend upon the diligence of your IRAF system adminstrator when the)108
+513.6 R 3.37(yc)-.15 G .87(on\214gured tapecap for your site)-3.37 F
+(\(and on whether you use the correct logical de)108 525.6 Q
+(vice name for the dri)-.25 E .3 -.15(ve a)-.25 H
+(nd tape capacity you are using\).).15 E .404(Xtapemon tries to k)108
+549.6 R .403
+(eep track of the amount of tape used: the number of Mb \(me)-.1 F -.05
+(ga)-.15 G .403(bytes\) read or written is).05 F 1.953
+(displayed, along with the percent of the tape used.)108 561.6 R 1.953
+(Whether or not the percent used \214eld is accurate)6.953 F .73
+(depends upon a number of f)108 573.6 R 3.23(actors. First)-.1 F .729
+(the tape capacity gi)3.23 F -.15(ve)-.25 G 3.229(ni).15 G 3.229(nt)
+-3.229 G .729(he tapecap \214le must match the actual)-3.229 F 1.336
+(tape being used.)108 585.6 R 1.336
+(Second, if data compression is in use on the dri)6.336 F -.15(ve)-.25 G
+3.837(,x).15 G 1.337(tapemon will display the uncom-)-3.837 F
+(pressed quantity of data written.)108 597.6 Q(On a compression dri)5 E
+.3 -.15(ve p)-.25 H(ercent used can be greater than 100%!).15 E F2
+(SEE ALSO)72 614.4 Q F0(xgterm\(1\), ximtool\(1\))108 626.4 Q F2
+(COPYRIGHT)72 643.2 Q F0(Cop)108 655.2 Q
+(yright\(c\) 1986 Association of Uni)-.1 E -.15(ve)-.25 G
+(rsities for Research in Astronomy Inc.).15 E(X11IRAF Project)72 768 Q
+(11 Dec 1996)137.62 E(2)203.45 E EP
+%%Trailer
+end
+%%EOF
diff --git a/vendor/x11iraf/xtapemon/zzdebug.c b/vendor/x11iraf/xtapemon/zzdebug.c
new file mode 100644
index 00000000..6a6c51cf
--- /dev/null
+++ b/vendor/x11iraf/xtapemon/zzdebug.c
@@ -0,0 +1,62 @@
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <fcntl.h>
+
+#define PORT 5138
+
+/*
+ * Dummy client to test xtapemon server.
+ */
+
+main()
+{
+ struct sockaddr_in sockaddr;
+ struct hostent *hp;
+ unsigned short portaddr;
+ static char msg[] = "hello, world!\\n\n";
+ int connected;
+ int port, s, i;
+
+ if ((hp = gethostbyname ("lepus")) == NULL)
+ fprintf (stderr, "host lookup fails\n");
+ if ((s = socket (AF_INET, SOCK_STREAM, 0)) < 0)
+ fprintf (stderr, "cannot open socket\n");
+ fcntl (s, F_SETFD, O_RDWR|O_NDELAY);
+
+ for (connected=i=0; i < 2; i++) {
+ port = PORT + i;
+ portaddr = htons((short)port);
+ memset ((char *)&sockaddr, 0, sizeof(sockaddr));
+ memmove ((char *)&sockaddr.sin_addr, (char *)hp->h_addr,
+ hp->h_length);
+ sockaddr.sin_family = AF_INET;
+ sockaddr.sin_port = portaddr;
+
+ if (connect (s,(struct sockaddr *)&sockaddr,sizeof(sockaddr))>=0) {
+ fprintf (stderr, "connected on port %d\n", port);
+ connected++;
+ break;
+ }
+ }
+
+ if (!connected)
+ fprintf (stderr, "cannot connect socket\n");
+
+ write (s, msg, strlen(msg));
+ sleep (5);
+ for (i=1; i <= 10; i++) {
+ sprintf (msg, "message %d\\n\nfile = %d\n", i, i);
+ write (s, msg, strlen(msg));
+ sleep (3);
+ }
+
+ for (i=1; i <= 500; i++) {
+ sprintf (msg, "record = %d\n", i);
+ write (s, msg, strlen(msg));
+ }
+
+ close (s);
+}