#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  Makefile README Xdig Xdig.1
# Wrapped by davecb@nexus.yorku.ca on Wed Mar 25 21:33:54 1992
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Makefile'\"
else
echo shar: Extracting \"'Makefile'\" \(357 characters\)
sed "s/^X//" >'Makefile' <<'END_OF_FILE'
X#
X# A somewhat generic makefile
X#
XROOT=
XDESTDIR=${ROOT}/usr/local/bin
XMANDIR=${ROOT}/usr/local/man/man1
X
Xall: 
X	@echo "The only significant make command is install"
X
Xinstall: Xdig
X	suid install -m 755 Xdig ${DESTDIR}
X	suid cp Xdig.1 ${MANDIR}/Xdig.1
Xdeinstall:
X	suid rm -f ${DESTDIR}/Xdig
X	suid rm -f ${MANDIR}/Xdig.1
Xclean:
X	-rm *.dvi *.ps *.log *.bak *~
X
END_OF_FILE
if test 357 -ne `wc -c <'Makefile'`; then
    echo shar: \"'Makefile'\" unpacked with wrong size!
fi
chmod +x 'Makefile'
# end of 'Makefile'
fi
if test -f 'README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'README'\"
else
echo shar: Extracting \"'README'\" \(163 characters\)
sed "s/^X//" >'README' <<'END_OF_FILE'
XThis is a wish script to provide a simple interface to
Xdig, the Domain Internet Groper.  It's my first program
Xusing byo, so don't expect real polish (:-))
X--dave
END_OF_FILE
if test 163 -ne `wc -c <'README'`; then
    echo shar: \"'README'\" unpacked with wrong size!
fi
# end of 'README'
fi
if test -f 'Xdig' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Xdig'\"
else
echo shar: Extracting \"'Xdig'\" \(6835 characters\)
sed "s/^X//" >'Xdig' <<'END_OF_FILE'
X#!/usr/local/bin/wish -f
X# BYO Development Team - Victoria University Wellington NZ
X# v0.6 alpha release 5 March 1992
X
Xframe .fm3 -background {white}  -borderwidth {2}  -geometry {20x20}  -relief {raised} 
X
Xframe .fm3.fm12 -background {white} 
X
Xmessage .result
X
Xentry .fm3.fm12.ent -background {white}  -font {-adobe-courier-medium-r-*-*-12-*-*-*-*-*-*-*}  -foreground {black}  -selectborderwidth {0}  -width {59} 
X
Xbind .fm3.fm12.ent  <Return> {
X
X	%W delete cursor
X	view2cursor %W
X	set hostName [.fm3.fm12.ent get];  
X
X	pack append . .result {bottom fillx}
X	if { "$queryType" == "-x" } {
X		#puts stdout "/usr/local/bin/dig -x $hostName"
X		.result configure -foreground {black} -text \
X			[exec /usr/local/bin/dig -x $hostName]
X	} else {
X		#puts stdout "/usr/local/bin/dig $hostName $queryType in"
X		.result configure -foreground {black} -text \
X			[exec /usr/local/bin/dig $hostName $queryType in]
X	}
X
X}
Xbind . <q> {destroy .}
Xbind . <Control-c> {destroy .}
Xbind .fm3.fm12.ent <q> {destroy .}
Xbind .fm3.fm12.ent <Control-c> {destroy .}
Xbind .fm3.fm12.ent <B3-Motion> {%W scan dragto %x}
Xbind .fm3.fm12.ent <Button-3> {%W scan mark %x}
Xbind .fm3.fm12.ent <Shift-B1-Motion> {%W select to @%x}
Xbind .fm3.fm12.ent <Shift-Button-1> {%W select adjust @%x}
Xbind .fm3.fm12.ent <B1-Motion> {%W select to @%x}
Xbind .fm3.fm12.ent <Button-1> {%W cursor @%x; focus %W; %W select from @%x}
Xbind .fm3.fm12.ent <Control-Button-2> {rpl %W}
Xbind .fm3.fm12.ent <Button-2> {%W insert cursor [selection.get]}
Xbind .fm3.fm12.ent <Control-u> {%W delete 0 end}
Xbind .fm3.fm12.ent <Control-v> {%W insert cursor [selection.get]; view2cursor %W}
Xbind .fm3.fm12.ent <Control-Mod1-d> {%W delete sel.first sel.last; view2cursor %W}
Xbind .fm3.fm12.ent <Control-d> {%W delete cursor; view2cursor %W}
Xbind .fm3.fm12.ent <Control-l> {view2cursor %W}
Xbind .fm3.fm12.ent <Control-k> {%W delete cursor end; view2cursor %W}
Xbind .fm3.fm12.ent <Control-Mod1-h> {%W delete 0 cursor; %W view cursor}
Xbind .fm3.fm12.ent <Control-Mod1-Delete> {%W delete 0 cursor; %W view 0 }
Xbind .fm3.fm12.ent <Mod1-Delete> {%W delete 0 cursor; %W view 0 }
Xbind .fm3.fm12.ent <Control-Mod1-BackSpace> {%W delete 0 cursor; %W view 0}
Xbind .fm3.fm12.ent <Mod1-BackSpace> {%W delete 0 cursor; %W view 0}
Xbind .fm3.fm12.ent <Control-h> {bs %W}
Xbind .fm3.fm12.ent <BackSpace> {bs %W}
Xbind .fm3.fm12.ent <Delete> {bs %W}
Xbind .fm3.fm12.ent <Control-e> {%W cursor end; view2cursor %W}
Xbind .fm3.fm12.ent <Control-a> {%W cursor 0; %W view 0}
Xbind .fm3.fm12.ent <Control-f> {%W cursor [expr [%W index cursor]+1]; view2cursor %W }
Xbind .fm3.fm12.ent <Control-b> {%W cursor [expr [%W index cursor]-1]; view2cursor %W }
Xbind .fm3.fm12.ent <Right> {%W cursor [expr [%W index cursor]+1]; view2cursor %W }
Xbind .fm3.fm12.ent <Left> {%W cursor [expr [%W index cursor]-1]; view2cursor %W }
Xbind .fm3.fm12.ent <space> {%W insert cursor " "; view2cursor %W}
Xbind .fm3.fm12.ent <Any-Key> {%W insert cursor "%A"; view2cursor %W}
X
Xlabel .fm3.fm12.lab -background {white}  -font {-adobe-courier-medium-r-*-*-12-*-*-*-*-*-*-*}  -foreground {black}  -text {Name: } 
X
Xpack append .fm3.fm12 \
X              .fm3.fm12.lab {left frame center} \
X              .fm3.fm12.ent {left frame center} 
Xpack append .fm3 \
X              .fm3.fm12 {top frame center} 
Xframe .fm2 -background {white}  -borderwidth {2}  -geometry {20x20}  -relief {raised} 
X
Xbutton .fm2.butt13 -background {white}  -command {destroy .}  -font {-adobe-courier-medium-r-*-*-12-*-*-*-*-*-*-*}  -foreground {black}  -text {Quit} 
X
Xradiobutton .fm2.rbt11 -background {white}  -font {-adobe-courier-medium-r-*-*-12-*-*-*-*-*-*-*}  -foreground {black}  -text {Name}  -value {-x}  -variable {queryType} -command { .fm3.fm12.lab configure -text "Number: "}
X
Xradiobutton .fm2.rbt10 -background {white}  -font {-adobe-courier-medium-r-*-*-12-*-*-*-*-*-*-*}  -foreground {black}  -text {Text}  -value {txt}  -variable {queryType} -command { .fm3.fm12.lab configure -text "Name: "}
X
Xradiobutton .fm2.rbt9 -background {white}  -font {-adobe-courier-medium-r-*-*-12-*-*-*-*-*-*-*}  -foreground {black}  -text {Any}  -value {any}  -variable {queryType} -command { .fm3.fm12.lab configure -text "Name: "}
X
Xradiobutton .fm2.rbt8 -background {white}  -font {-adobe-courier-medium-r-*-*-12-*-*-*-*-*-*-*}  -foreground {black}  -text {NS}  -value {ns}  -variable {queryType} -command { .fm3.fm12.lab configure -text "Name: "}
X
Xradiobutton .fm2.rbt7 -background {white}  -font {-adobe-courier-medium-r-*-*-12-*-*-*-*-*-*-*}  -foreground {black}  -text {SOA}  -value {soa}  -variable {queryType} -command { .fm3.fm12.lab configure -text "Name: "}
X
Xradiobutton .fm2.rbt6 -background {white}  -font {-adobe-courier-medium-r-*-*-12-*-*-*-*-*-*-*}  -foreground {black}  -text {Host Info}  -value {hinfo}  -variable {queryType} -command { .fm3.fm12.lab configure -text "Name: "}
X
Xradiobutton .fm2.rbt5 -background {white}  -font {-adobe-courier-medium-r-*-*-12-*-*-*-*-*-*-*}  -foreground {black}  -text {MX}  -value {mx}  -variable {queryType} -command { .fm3.fm12.lab configure -text "Name: "}
X
Xradiobutton .fm2.rbt4 -background {white}  -font {-adobe-courier-medium-r-*-*-12-*-*-*-*-*-*-*}  -foreground {black}  -text {Address}  -value {a}  -variable {queryType} -command { .fm3.fm12.lab configure -text "Name: "}
X
X.fm2.rbt4 select
Xpack append .fm2 \
X              .fm2.rbt4 {left frame nw} \
X              .fm2.rbt5 {left frame center} \
X              .fm2.rbt6 {left frame center} \
X              .fm2.rbt7 {left frame center} \
X              .fm2.rbt8 {left frame center} \
X              .fm2.rbt9 {left frame center} \
X              .fm2.rbt10 {left frame center} \
X              .fm2.rbt11 {left frame center} \
X              .fm2.butt13 {top frame center} 
Xpack append . \
X              .fm2 {top frame nw} \
X              .fm3 {top frame center} 
X
X
Xproc selection.get {} {if {[catch {selection get} s]} {return ""} {return $s}}
X
X
X
Xproc view2cursor { win} {
X set left_extent [$win index @0]
X set right_extent [$win index @[winfo width $win]]
X set cursor_position [$win index cursor]
X set entry_length [expr "$right_extent - $left_extent"]
X if {$cursor_position > $left_extent} {
X    if {$cursor_position > $right_extent} {
X        #handle cursor too far to the right
X        $win view [expr "$cursor_position - $entry_length + 1"]
X        }
X    } { 
X        #handle cursor too far to the left
X        $win view [expr "$cursor_position - 1"]
X    }
X}
X
X
X
Xproc selection.valid {} {expr "! [catch {selection get}]"}
X
X
X
Xproc bs { win} {
X    set x [expr {[$win index cursor] - 1}]
X    if {$x != -1} {$win delete $x}
X    view2cursor $win
X}
X
X
X
Xproc rpl { win} {
X set x [selection.get]
X $win delete 0 end; 
X $win insert cursor $x
X}
X
Xproc tkerror {message} {
X	pack append . .result {bottom fillx}
X	.result configure -foreground {red} \
X		-text "Dig reported an error...$message"
X}
END_OF_FILE
if test 6835 -ne `wc -c <'Xdig'`; then
    echo shar: \"'Xdig'\" unpacked with wrong size!
fi
chmod +x 'Xdig'
# end of 'Xdig'
fi
if test -f 'Xdig.1' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Xdig.1'\"
else
echo shar: Extracting \"'Xdig.1'\" \(1273 characters\)
sed "s/^X//" >'Xdig.1' <<'END_OF_FILE'
X.TH XDIG 1
X.SH NAME
XXdig \- an X Domain Internet Groper
X.SH SYNOPSIS
XInteractive wish script.
X
X.SH DESCRIPTION
X.I Xdig
Xdisplays information from the Domain Name System selected via an
Xinteractive interface.  
X.PP
XThe top row is a set of buttons to select the type of records
Xto be requested: Adresses, Mail Exchanger records, Start of Authority
Xrecords, Name Server records or all of the above, or reverse lookups
Xof names given internet addresses.
X.PP
XThe remaining row is an entry field for the name or address to be looked
Xup.  Pressing return in this field triggers the lookup.
X.PP
XResults are displayed in a dynamically created window immediately below.
XErrors are displayed in red.
X.SH SEE ALSO
Xdig(1), wish(1), byo(1).
X
X.SH FILES
XThis program requires the standard dig(1) be on the system and
Xits full pathname be inserted in the Xdig script.  Wish(1)
Xis required to interpret the script.
X
X.SH AUTHORS
XDave Collier-Brown (davecb@nexus.yorku.ca), courtesy of the byo
Xdevelopment team at Victoria University of Wellington, New Zealand
X(byo@comp.vuw.ac.nz).
X
X.SH BUGS
XThe foregound colors of the results window are fixed: this may
Xmess up people with reverse-video defaults.
X.PP 
XSOA only works on domains and TXT isn't usually implemented:
XHS should be there instead.
END_OF_FILE
if test 1273 -ne `wc -c <'Xdig.1'`; then
    echo shar: \"'Xdig.1'\" unpacked with wrong size!
fi
chmod +x 'Xdig.1'
# end of 'Xdig.1'
fi
echo shar: End of shell archive.
exit 0
