richb@sunchat.oz.AU (Rich Burridge) (12/24/88)
Posting-number: Volume 5, Issue 92 Submitted-By: Rich Burridge <richb@sunchat.oz.AU> Archive-name: faces-1.3/part01 This is the second general release of a face server for monitoring mail and print jobs. It is based on the Bell Labs v8 vismon program, and this version is vismon compatible, but is not derived from AT&T sources. This version contains drivers for SunView and NeWS graphics systems. Permission is given to distribute these sources, as long as the copyright messages are not removed, and no monies are exchanged. See the README and manual page for more details. Save this, and subsequent messages in a new directory, strip off the beginning down to and including the CUT HERE line, unpack with sh, then type "make sunview" for the SunView version or "make news" for the NeWS version. Then install with "make install". Note that you might need super-user permission to do this successfully. Create your face directory, hostname sub-directories username ikons/icons, machine and people tables, and you're set. Note that if you are compiling faces under v3.x of the SunOS, then there is a line in the Makefile starting with OSTYPE, that needs to be uncommented. If anybody can work out what needs to be done to fix the problem of the window/icon always moving back to the initial position (see the BUGS section of the man page), then I'll be very pleased to hear from them. If you already have your face scanned in and iconised and would like to add it to the library I'm building up, please feel free to email it to me. Bugs, flames and suggestions to me please. Acknowledgements. Thanks go to Guy Harris for the basis of the latest manual page, Dave Lemke for many excellent suggestions including the animated postscript faces, to Andrew Nicholson for help with some of the trickier NeWS code, to Dan Heller for writing the 'watch' program which was consulted in the early days, to Rob Pike for sending me a copy of the Pike/Presotto paper "Face the Nation", which I used to get vismon compatibility, and to everybody else who suggested enhancements, and fixed bugs in the previous version. Rich Burridge - December 1988. ------CUT HERE------CUT HERE------ #! /bin/sh # this is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh to create the files: # README # faces.1 # faces.ps # machine.tab # people.tab # Makefile # extern.h # faces.h # patchlevel.h # noface.icon # nomail.icon # noprint.icon # nopaper.icon # This archive created: Sun Dec 11 14:57:20 EST 1988 # # export PATH; PATH=/bin:$PATH # if [ -f README ] then echo shar: will not over-write existing file README else echo shar: extracting 'README', 2703 characters cat > README <<'Funky_Stuff' README for faces, the visual mail and print monitor. Version 1.3 December 1988. Permission is given to distribute these sources, as long as the copyright messages are not removed, and no monies are exchanged. This is the second general release of a "faces" server for monitoring mail or print jobs. It contains graphical interfaces for SunView and NeWS. The X11 and blit versions are being worked on. Expect them in the near future. Faces has three different modes of operation: The default will monitor for new mail. Only the last ten messages are displayed. In its iconic form, it is also possible to display the timestamp of each message, and the open window format can give the username. The second choice is to monitor the whole of a mail file. The icon and open window display the appropriate faces, and dynamically change size as a new check is made and if the mail file has altered size. In the iconic form, a timestamp of the last message plus the number of mail messages from this person are optional display parameters. The final option allows this program to monitor a given print queue. This will generate a single face icon showing the job at the top of the print queue, and a text message will display the number of messages to be printed. Opening the window will show all the jobs in the queue with the owners' name and the size of the job in bytes. Faces is based on the AT&T v8 face server called vismon, but is not derived from vismon sources. With this version comes vismon compatibility. Note that this has resulted in a few changes from the way faces v1.1 worked. Please see the manual pages for details. There is a face directory, and under that are directories which are hostnames. Under that are username directories, and this is where the face images are placed. The face images are currently stored in one of three ways: 1. NeWS .ps format, called face.ps. 2. Sun icon format, called sun.icon. 3. Blit ikon format, called 48x48x1. The NeWS .ps allow for animation with the users' face. These files are drawn when the rest of the static faces have been displayed. They will be redrawn every time the mail or print queue is recheck or when the faces window or icon is damaged. See the manual page for details on the conditions imposed on these NeWS .ps files. By default, after every sixty seconds, faces will recheck the mail file or the print queue. If the mail spool file has changed size, it will produce a chain of records for which it has face icons. I welcome bug reports and suggestions for improvements. Rich. Rich Burridge, DOMAIN: richb@sunaus.oz.au PHONE: +61 2 413 2666 UUCP: {uunet,mcvax,ukc}!munnari!sunaus.oz!richb Funky_Stuff len=`wc -c < README` if [ $len != 2703 ] ; then echo error: README was $len bytes long, should have been 2703 fi fi # end of overwriting check if [ -f faces.1 ] then echo shar: will not over-write existing file faces.1 else echo shar: extracting 'faces.1', 6804 characters cat > faces.1 <<'Funky_Stuff' .\" @(#)faces.1 1.2 88/12/11 .TH FACES 1L "2 December 1988" .SH NAME faces \- visual mail and print face server for the Sun workstation .SH SYNOPSIS .B "faces [ .B \-P .I printer ] [ .B \-a ] [ .B \-b .I background ] [ .B \-f .I facedir ] [ .B \-i ] [ .B \-n ] [ .B \-p .I period ] [ .B \-s .I spoolfile ] [ .B \-t ] [ .B \-u ] [ .B \-v ] [ .B \-Wi ] [ .B \-Wp .I x y ] [ .B \-WP .I x y ] .SH DESCRIPTION .B faces is a window based tool for monitoring mail or print queues. It contains graphical interfaces for SunView and NeWS. It has three different modes of operation: .LP The default will monitor for new mail. Only the last ten messages are displayed. In its iconic form, it is also possible to display the timestamp of each message, and the open window format can give the username. .LP The second choice is to monitor the whole of a mail file. The icon and open window display the appropriate faces, and dynamically change size as a new check is made and if the mail file has altered size. In the iconic form, a timestamp of the last message plus the number of mail messages from this person are optional display parameters. .LP The final option allows this program to monitor a given print queue. This will generate a single face icon showing the job at the top of the print queue, and a text message will display the number of messages to be printed. Opening the window will show all the jobs in the queue with the owners' name and the size of the job in bytes. .LP There are special displays for no mail, no faces found, no print jobs, and no paper in the printer. .LP .B faces is based on the AT&T v8 program .B vismon. This program is not derived from .B vismon source. .LP There is a special faces directory containing a fixed three-level hierarchy, which by default is .I /usr/local/faces. The first level is a machine name, the second level a user name, and the third level is the actual face image, which can be stored in three formats. If the file is named .I 48x48x1 then it is a Blit ikon, and if it is called .I sun.icon then the image is stored in Sun icon format, and if the file is named .I face.ps then it contains executable NeWS code. .LP To access the face for a mail name .I machine!uid take the result of the first successful open from the following list of files: .LP /usr/local/faces/machine/uid/face.ps .br /usr/local/faces/machine/uid/sun.icon .br /usr/local/faces/machine/uid/48x48x1 .br /usr/local/faces/misc./uid/face.ps .br /usr/local/faces/misc./uid/sun.icon .br /usr/local/faces/misc./uid/48x48x1 .br /usr/local/faces/machine/unknown/face.ps .br /usr/local/faces/machine/unknown/sun.icon .br /usr/local/faces/machine/unknown/48x48x1 .br /usr/local/faces/misc./unknown/face.ps .br /usr/local/faces/misc./unknown/sun.icon .br /usr/local/faces/misc./unknown/48x48x1 .LP The directory .I misc. hold faces for generic users such as .I root and .I uucp. .LP Faces information is administered by a pair of ASCII files that associate related machines and faces. The machine table .I machine.tab attaches machines to communities; the line .LP stard=sunaus .LP puts the machine .I stard in community .I sunaus. The people table associates a community/alias pair, with a real username. .LP sunaus/rburridge=richb .LP causes the alias .I rburridge to be translated into the real username .I richb for the community .I sunaus .LP Domain name structure would be handled in the same way. For example: .LP sunaus.sun.oz=sunaus .LP would map the full domain name in the community .I sunaus. .LP If the faces directory hierarchy is not found, then a blank face image will be used. .LP Note that you still need to use .I mailtool or some other mail reading utility to actually read the mail that this program monitors; .I faces simply displays who the mail is from. .LP When new mail arrives, .B faces will beep and flash appropriately, depending upon the set parameters in the users .I .mailrc file. .LP If you are using the NeWS version and creating face images of the .I face.ps form, then the following points should be noted: .LP All graphics operations should be performed on the unit square. .br The final image will be translated to a 64 x 64 square image at .br the appropriate position in the faces display. .br .SH OPTIONS .TP .BI \-P " printer" Printer name to monitor. If this and a mail spool file are given with the -s option, .B faces will monitor the print queue. .TP .B \-a Monitor the whole of the specified mail file. The icon and open window display the appropriate faces, and dynamically change size as a new check is made and if the mail file has altered size. .TP .BI \-b " background" Sun icon file containing an alternate background pattern. The default is root grey. .TP .BI \-f " facedir" Use an alternate name for the faces directory. The default is .BR /usr/local/faces . .TP .B \-i Invert the faces images before displaying them. For use by people who started SunView with the .B \-i option. .TP .B \-n Do not display the number of messages from this person. The default is to display, and a count is shown at the bottom right corner of the face for this person. .TP .BI \-p " period" The period in seconds before the mail spool file or the print queue is scanned again for new mail. The default is 60 seconds. .TP .BI \-s " spoolfile" Use an alternate mail spool file to monitor. The default is .BI /var/spool/mail/ username where .I username is the name of the user currently logged in. .TP .B \-t Do not display a timestamp of the last message from this person. The default is to display, and a timestamp is shown at the bottom left corner of the face for this person. .TP .B \-u Do not display the username on the face icon. The default is to display, and the username will appear over the face icon, when the window is opened. .TP .B \-v Print the version number of this release of the .B faces program. .TP .B \-Wi Start the .B faces program up in iconic form. SunView automatically uses this flag, but the NeWS version will also. .TP .BI \-Wp " x y" Start the open window position at .I x y .TP .BI \-WP " x y" Start the icon position at .I x y .SH FILES .TP .B /var/spool/mail directory for system mailboxes .TP .B /.mailrc mail startup file .TP .B /usr/local/faces main directory containing the face icons. .TP .B /usr/local/faces/people.tab people/file equivalences .TP .B /usr/local/faces/machine.tab machine/community equivalences .SH BUGS The machine and people table lookup is hopelessly inefficient and will need to be improved as the faces database gets larger. .br If the window/icon for the NeWS version is moved, then the window or icon is redrawn at the original position. .SH AUTHOR Rich Burridge, DOMAIN: richb@sunaus.oz.au .nf PHONE: +61 2 413 2666 UUCP: {uunet,mcvax,ukc}!munnari!sunaus.oz!richb .fi Funky_Stuff len=`wc -c < faces.1` if [ $len != 6804 ] ; then echo error: faces.1 was $len bytes long, should have been 6804 fi fi # end of overwriting check if [ -f faces.ps ] then echo shar: will not over-write existing file faces.ps else echo shar: extracting 'faces.ps', 3760 characters cat > faces.ps <<'Funky_Stuff' % These are NeWS dependent graphics routines used by faces. % % @(#)faces.ps 1.3 88/12/11 % % Copyright (c) Rich Burridge - Sun Microsystems Australia. % All rights reserved. % % Permission is given to distribute these sources, as long as the % copyright messages are not removed, and no monies are exchanged. % % No responsibility is taken for any errors or inaccuracies inherent % either to the comments or the code of this program, but if reported % to me, then an attempt will be made to fix them. /ClearBox % x y width height canvas => - { setcanvas rectpath 0 setgray fill } def /DoPixrects % width height canvas => - { dup setcanvas 3 1 roll 0 0 4 -2 roll rectpath reshapecanvas } def /ExecFile % psfile width height x y => - { Frame /Iconic? get { Frame /IconCanvas get } { Frame /ClientCanvas get } ifelse setcanvas translate scale (r) file cvx exec } def /InitFont % - => - { /Font /Courier findfont 7 scalefont def } def /MakeFrame % wx wy width height ix iy iconic => - { [ /IsIcon /IconY /IconX /FrameHeight /FrameWidth /FrameY /FrameX ] { exch def } forall /DIED 100 def /PAINTED 101 def /ClientHeight FrameHeight 10 sub def /ClientWidth FrameWidth 10 sub def /IconHeight FrameHeight def /IconWidth FrameWidth def /PR framebuffer newcanvas def PR /Transparent false put PR /Mapped false put PR /Retained true put /MPR framebuffer newcanvas def MPR /Transparent false put MPR /Mapped false put MPR /Retained true put /Frame framebuffer /new DefaultWindow send def { /IconX IconX def /IconY IconY def /BorderTop 5 def /BorderLeft 5 def /BorderBottom 5 def /BorderRight 5 def /ControlSize 0 def /ForkPaintClient? false def /destroy { DIED typedprint DestroyFrame DestroyClient } def /flipiconic { PAINTED typedprint /unmap self send /Iconic? Iconic? not def IconX null eq { FrameX FrameY FrameHeight add IconHeight sub /move self send } if ZoomProc /map self send } def /PaintClient { gsave 1 fillcanvas ClientWidth ClientHeight scale 0 setgray Invert PR imagemaskcanvas grestore } def /PaintIcon { gsave 1 fillcanvas IconWidth IconHeight scale 0 setgray Invert MPR imagemaskcanvas grestore } def } Frame send IsIcon 1 eq { /flipiconic Frame send } if } def /MakeText % string x y canvas => - { setcanvas Font setfont 1 setgray moveto show } def /MoveImage % srccanvas width height x y destcanvas => - { setcanvas gsave translate scale imagecanvas grestore } def /SetBackground % - => - { PR setcanvas 0.88 fillcanvas 5 setrasteropcode clippath fill MPR setcanvas 0.88 fillcanvas 5 setrasteropcode clippath fill } def /ShiftImage % dx dy width height canvas => - { setcanvas 0 0 4 -2 roll rectpath copyarea } def /ShowDisplay % framewidth frameheight iconwidth iconheight => - { [ /IconHeight /IconWidth /ClientHeight /ClientWidth ] { exch def } forall /FrameHeight ClientHeight 10 add def /FrameWidth ClientWidth 10 add def FrameX FrameY FrameWidth FrameHeight /reshape Frame send Frame /IconWidth IconWidth put Frame /IconHeight IconHeight put /ShapeIconCanvas Frame send /painticon Frame send Frame /ClientHeight ClientHeight put Frame /ClientWidth ClientWidth put /ShapeClientCanvas Frame send /paintclient Frame send /map Frame send } def Funky_Stuff len=`wc -c < faces.ps` if [ $len != 3760 ] ; then echo error: faces.ps was $len bytes long, should have been 3760 fi fi # end of overwriting check if [ -f machine.tab ] then echo shar: will not over-write existing file machine.tab else echo shar: extracting 'machine.tab', 383 characters cat > machine.tab <<'Funky_Stuff' stard=sunaus extra=sunaus sunchat=sunaus garfield=sunaus tom=sunaus felix=sunaus sunk=sunaus sunsa=sunaus misaus=sunaus maverick=sunaus misaus1=sunaus nimbin=sunaus redgum=sunaus palette=sunaus sunwa=sunaus sunact=sunaus basset=basser castor.cs.su.oz=basser cluster.cs.su.oz=basser orwell=basser sarad=basser sasha=basser sunrise=basser gris=softway softway.sw.oz=softway arakis=sun Funky_Stuff len=`wc -c < machine.tab` if [ $len != 383 ] ; then echo error: machine.tab was $len bytes long, should have been 383 fi fi # end of overwriting check if [ -f people.tab ] then echo shar: will not over-write existing file people.tab else echo shar: extracting 'people.tab', 1663 characters cat > people.tab <<'Funky_Stuff' sunaus/rallen=bob sunaus/ballen=bob sunaus/bbaker=bruceb sunaus/mbosch=mike sunaus/eddy=eddie sunaus/eevans=eddie sunaus/ggrell=grell sunaus/gene=grell sunaus/jingall=johni sunaus/ijeffery=ian sunaus/glynne=gjl sunaus/tmcentee=tim sunaus/jnoonan=johnn sunaus/apappas=arie sunaus/jennie=jenny sunaus/jrendell=jenny sunaus/gsearle=gjs sunaus/gsitters=greg sunaus/bscott=brad sunaus/rstewart=ruth sunaus/jteasdale=jim sunaus/loraine=lori sunaus/lorraine=lori sunaus/lunicomb=lori sunaus/pvrbancich=paula sunaus/swoodhead=simon sunaus/jy=yo sunaus/jyoung=yo sunaus/rboden=richard sunaus/rbodin=richard sunaus/rburridge=richb sunaus/rich=richb sunaus/mcunningham=mary sunaus/sduchesne=sue sunaus/mfredericks=max sunaus/mfredricks=max sunaus/bgeneralis=bill sunaus/shulbert=susanh sunaus/susan=susanh sunaus/gmason=gregm sunaus/vmickan=val sunaus/trogge=tony sunaus/andy=aspiers sunaus/bwiggins=bruce sunaus/ryeap=ron sunaus/cbreen=colinb sunaus/rdesalis=roger sunaus/mfort=markf sunaus/mark=markg sunaus/mgurvis=markg sunaus/mnegri=manuel sunaus/npettitt=noel sunaus/jraine=john sunaus/paul=paulr sunaus/prosham=paulr sunaus/gsweigert=geo sunaus/rbowman=robb sunaus/bbowman=robb sunaus/krees=kim sunaus/mikes=mslee sunaus/gshepherd=george sunaus/aweller=andrew sunaus/kbeavan=kevin sunaus/rbradford=rhonda sunaus/ckeith=colin sunaus/mmccann=mmc sunaus/ksterry=kaylene sunaus/rwilliams=rex sunaus/gdonin=gary sunaus/dshea=dennis sunaus/doshea=dennis sunaus/hprotoolis=harry sunaus/rschrader=robert sunaus/bschrader=robert sunaus/bobs=robert sunaus/jvermeulen=jeff sunaus/MAILER-DAEMON=mailer-daemon sunaus/Mailer-Daemon=mailer-daemon sunaus/mailer-daemon=mailer-daemon Funky_Stuff len=`wc -c < people.tab` if [ $len != 1663 ] ; then echo error: people.tab was $len bytes long, should have been 1663 fi fi # end of overwriting check if [ -f Makefile ] then echo shar: will not over-write existing file Makefile else echo shar: extracting 'Makefile', 4323 characters cat > Makefile <<'Funky_Stuff' # # Makefile for faces, an icon face server, plus associated software. # # @(#)Makefile 1.1 88/12/04 # # Copyright (c) Rich Burridge. # Sun Microsystems, Australia - All rights reserved. # # Permission is given to distribute these sources, as long as the # copyright messages are not removed, and no monies are exchanged. # # Version 1.3 - December 1988. # # No responsibility is taken for any errors inherent either # to the comments or the code of this program, but if reported # to me then an attempt will be made to fix them. # #------------------------------------------------------------------ # There are various command line options with the faces program. # They can also be defined at compile time. If they are not present # here, then sensible default values are used. The values given # below are the defaults, except for the spoolfile name where the # default is obtained from the users' passwd entry. # # # Monitor type (0 = monitor all, 1 = monitor new, 2 = monitor printer). # FMONTYPE = -DFMONTYPE=1 # # Alternate background pattern instead of root gray. # BACKGROUND = -DBACKGROUND=\"\" # # Different directory for face icons, # FACEDIR = /usr/local/faces FACEPARAM = -DFACEDIR=\"$(FACEDIR)\" # # If nonzero, then display face images in reverse video. # INVERT = -DINVERT=0 # # Period in seconds for checking for new mail or print jobs, # PERIOD = -DPERIOD=60 # # If nonzero, do not show number of messages on the face icon, # DONTSHOWNO = -DDONTSHOWNO=0 # # Alternative spoolfile to monitor, # eg: SPOOLFILE = -DSPOOLFILE=\"/usr/richb/Mail/pending\" # #SPOOLFILE = # # If nonzero, do not show timestamp on the face icon. # DONTSHOWTIME = -DDONTSHOWTIME=0 # # If nonzero, do not show username on the face icon. # DONTSHOWUSER = -DDONTSHOWUSER=0 #------------------------------------------------------------------- VARIABLES = $(FMONTYPE) $(BACKGROUND) $(FACEPARAM) \ $(INVERT) $(PERIOD) $(DONTSHOWNO) $(SPOOLFILE) \ $(DONTSHOWTIME) $(DONTSHOWUSER) BINARIES = ps_faces sv_faces BINDIR = /usr/local/bin FACES = facedir LIBDIR = /usr/local/lib NEWSFILE = -DNEWSGIVEN -DNEWSFILE=\"$(LIBDIR)/faces.ps\" MANDIR = /usr/man/man$(MANSECT) MANSECT = l # # If you are compiling faces under v3.x of SunOS, then uncomment this line. #OSTYPE = -DSUNOS3.x CFLAGS = -g $(NEWSFILE) $(OSTYPE) $(VARIABLES) HDRS = extern.h faces.h patchlevel.h IMAGES = noface.icon nomail.icon noprint.icon nopaper.icon PSLIBS = $$NEWSHOME/lib/libcps.a PSOBJS = get.o main.o mon.o news.o rec.o PSSRCS = get.c main.c mon.c news.c rec.c SVLIBS = -lsuntool -lsunwindow -lpixrect SVOBJS = get.o main.o mon.o rec.o sunview.o SVSRCS = get.c main.c mon.c rec.c sunview.c OTHERS = README faces.1 faces.ps machine.tab people.tab Makefile SRCS = get.c main.c mon.c news.c rec.c sunview.c all: sunview news news: ps_faces cp ps_faces faces sunview: sv_faces cp sv_faces faces ps_faces: $(PSOBJS) cc -o ps_faces $(CFLAGS) $(PSOBJS) $(PSLIBS) sv_faces: $(SVOBJS) cc -o sv_faces $(CFLAGS) $(SVOBJS) $(SVLIBS) install: $(BINARIES) install -s -m 751 faces $(BINDIR) install -c -m 644 faces.ps $(LIBDIR) install -c -m 644 machine.tab $(FACEDIR) install -c -m 644 people.tab $(FACEDIR) install -c -m 644 faces.1 $(MANDIR)/faces.$(MANSECT) backup:; cp -r $(SRCS) $(HDRS) $(IMAGES) $(OTHERS) $(FACES) backdir clean:; rm -f *.o $(BINARIES) faces core lint:; lint -DNEWSGIVEN -DNEWSFILE=\"$(LIBDIR)/faces.ps\" $(PSSRCS) lint $(SVSRCS) $(SVLIBS) shar:; shar.script $(OTHERS) $(HDRS) $(IMAGES) > archive.1 shar.script $(SRCS) > archive.2 shar.script $(FACES) > archive.3 create: SCCS -sccs create $(SRCS) $(HDRS) $(IMAGES) $(OTHERS) SCCS: mkdir SCCS chmod 755 SCCS get.o: get.c faces.h extern.h patchlevel.h main.o: main.c faces.h Makefile mon.o: mon.c faces.h extern.h news.o: news.c faces.h extern.h rec.o: rec.c faces.h extern.h sunview.o: sunview.c extern.h $(IMAGES) Funky_Stuff len=`wc -c < Makefile` if [ $len != 4323 ] ; then echo error: Makefile was $len bytes long, should have been 4323 fi fi # end of overwriting check if [ -f extern.h ] then echo shar: will not over-write existing file extern.h else echo shar: extracting 'extern.h', 3566 characters cat > extern.h <<'Funky_Stuff' /* @(#)extern.h 1.2 88/12/11 * * Contains the external variable definitions used by faces. * * Copyright (c) Rich Burridge. * Sun Microsystems, Australia - All rights reserved. * * Permission is given to distribute these sources, as long as the * copyright messages are not removed, and no monies are exchanged. * * No responsibility is taken for any errors or inaccuracies inherent * either to the comments or the code of this program, but if * reported to me then an attempt will be made to fix them. */ extern char *get_field(), *getname() ; extern int do_check() ; struct recinfo *rec_exists() ; extern struct comminfo *communities ; /* Community alias/username chain. */ extern struct comminfo *clast ; /* End of chain of community records. */ extern struct machinfo *machines ; /* Known machine/communities. */ extern struct machinfo *mlast ; /* End of chain of machine records. */ extern struct psinfo *psrecs ; /* List of news.ps animation files. */ extern struct psinfo *plast ; /* End of chain of NeWS animation files. */ extern struct recinfo *recs ; /* Mail messages being monitored. */ extern struct recinfo *last ; /* End of the chain of mail records. */ extern struct stat buf ; /* Buffer for stat call for file existence. */ extern long lastsize ; /* Last known size of the mail folder. */ extern enum gr_type gtype ; /* Indicates what graphics system is being used. */ extern enum mon_type mtype ; /* What type of monitoring we should do. */ extern char bgicon[] ; /* Alternate background pattern. */ extern char community[] ; /* Community name ("real" host name). */ extern char facedir[] ; /* Directory containing face images. */ extern char iconname[] ; /* Name of the icon file for this person. */ extern char machfile[] ; /* Name of the machine/community file. */ extern char nextline[] ; /* Next line from users mail spool file. */ extern char peopfile[] ; /* Name of the people/username file. */ extern char printer[] ; /* Printer name to monitor. */ extern char progname[] ; /* Name of this program. */ extern char spoolfile[] ; /* Full pathname of users current mail. */ extern int beeps ; /* Number of beeps for arrival of new mail. */ extern int column ; /* Column number for next icon. */ extern int dontshowno ; /* Set if no. of messages shouldn't be shown. */ extern int dontshowtime ; /* Set if timestamp shouldn't be shown. */ extern int dontshowuser ; /* Set if username shouldn't be shown. */ extern int facetype ; /* Type of face file found. */ extern int firsttime ; /* Zeroised after first mail/printer check. */ extern int flashes ; /* Number of flashes for arrival of new mail. */ extern int height ; /* Height in pixels of faces display. */ extern int iconic ; /* Start as an icon if set. */ extern int invert ; /* Set if to use reverse video. */ extern int ix ; /* Initial X position of the icon. */ extern int iy ; /* Initial Y position of the icon. */ extern int newmail ; /* Set if there is new mail this time around. */ extern int noicons ; /* Number of faces this time around. */ extern int period ; /* Period in seconds for checking new mail. */ extern int row ; /* Row number for next icon. */ extern int width ; /* Width in pixels of faces display. */ extern int wx ; /* Initial X position of the window. */ extern int wy ; /* Initial Y position of the window. */ Funky_Stuff len=`wc -c < extern.h` if [ $len != 3566 ] ; then echo error: extern.h was $len bytes long, should have been 3566 fi fi # end of overwriting check if [ -f faces.h ] then echo shar: will not over-write existing file faces.h else echo shar: extracting 'faces.h', 4482 characters cat > faces.h <<'Funky_Stuff' /* @(#)faces.h 1.3 88/12/09 * * Contains all the global definitions used by faces. * * Copyright (c) Rich Burridge - Sun Microsystems Australia. * All rights reserved. * * Permission is given to distribute these sources, as long as the * copyright messages are not removed, and no monies are exchanged. * * No responsibility is taken for any errors or inaccuracies inherent * either to the comments or the code of this program, but if * reported to me then an attempt will be made to fix them. */ #include <stdio.h> #include <sys/fcntl.h> #include <sys/types.h> #include <sys/file.h> #include <sys/stat.h> #include <sys/time.h> #include <pwd.h> #include <strings.h> #define FCLOSE (void) fclose /* To make lint happy. */ #define FFLUSH (void) fflush #define FGETS (void) fgets #define FPRINTF (void) fprintf #define FSEEK (void) fseek #define GETHOSTNAME (void) gethostname #define GET_SUN_ICON (void) get_sun_icon #define IOCTL (void) ioctl #define PUTC (void) putc #define SELECT (void) select #define SSCANF (void) sscanf #define SPRINTF (void) sprintf #define STRCAT (void) strcat #define STRCPY (void) strcpy #define STRNCAT (void) strncat #define STRNCPY (void) strncpy #define UNLINK (void) unlink /* The types of display. */ enum disp_type { BOTH, ICON, WINDOW } ; /* Field extraction options. */ enum field_type { HOSTNAME, TIMESTAMP, USERNAME } ; /* Different types of possible face images. */ enum icon_type { NOMAIL, NOPAPER, NOPRINT, ORDINARY } ; /* Text justification within face display. */ enum just_type { LEFT, RIGHT } ; /* Different types of file monitoring performed by this program. */ enum mon_type { MONALL, MONNEW, MONPRINTER } ; /* Different graphics systems appropriate one set in gtype. */ enum gr_type { SUNVIEW, NEWS } ; /* Determine order for face type lookup. */ #define NEWSTYPE 0 #define SUNTYPE 1 #define BLITTYPE 2 /* NeWS return event values. */ #define DIED 100 /* Faces has been zapped. */ #define PAINTED 101 /* Canvas/Icon needs repainting. */ #define BLITHEIGHT 48 /* Maximum number of lines in a blit icon. */ #define EQUAL(str,val) !strncmp(str,val,strlen(val)) #define ICONHEIGHT 64 /* Height of individual face icons. */ #define ICONWIDTH 64 /* Width of individual face icons. */ #define INC argc-- ; argv++ ; #define MAXLINE 200 /* Maximum length for character strings. */ #define MAXTYPES 3 /* Maximum number of different face types. */ #define NO_PER_ROW 10 /* Number of faces per row. */ char *getenv(), *malloc(), *sprintf() ; struct machinfo /* Machine/community record. */ { char *machine ; /* Machine name. */ char *community ; /* Community it belongs to. */ struct machinfo *next ; /* Pointer to next record. */ } ; struct comminfo /* Community alias/username records. */ { char *community ; /* Community name. */ struct peopinfo *people ; /* Chain of alias/usernames. */ struct comminfo *next ; /* Pointer to next record. */ } ; struct peopinfo /* Username/alias record. */ { char *alias ; /* Alias for this user. */ char *username ; /* Real username. */ struct peopinfo *next ; /* Pointer to next record. */ } ; struct psinfo /* News.ps animation records. */ { char *name ; /* Full pathname of news.ps file. */ int row ; /* Row number where animation will occur. */ int column ; /* Column number where animation will occur. */ struct psinfo *next ; /* Pointer to next record. */ } ; struct recinfo /* Mail/print information record. */ { char *community ; /* Community name for this person. */ char *iconname ; /* Name of iconfile for this person. */ char *username ; /* User name for this person. */ int total ; /* Total number of messages/print jobs. */ int size ; /* Total size in bytes of print job. */ char ts[6] ; /* Latest timestamp for this user. */ struct recinfo *next ; /* Pointer to next record. */ } ; Funky_Stuff len=`wc -c < faces.h` if [ $len != 4482 ] ; then echo error: faces.h was $len bytes long, should have been 4482 fi fi # end of overwriting check if [ -f patchlevel.h ] then echo shar: will not over-write existing file patchlevel.h else echo shar: extracting 'patchlevel.h', 560 characters cat > patchlevel.h <<'Funky_Stuff' /* @(#)patchlevel.h 1.1 88/12/04 * * This is the current patch level for this version of faces. * * Copyright (c) Rich Burridge. * Sun Microsystems, Australia - All rights reserved. * * Permission is given to distribute these sources, as long as the * copyright messages are not removed, and no monies are exchanged. * * No responsibility is taken for any errors or inaccuracies inherent * either to the comments or the code of this program, but if * reported to me then an attempt will be made to fix them. */ #define PATCHLEVEL 0 Funky_Stuff len=`wc -c < patchlevel.h` if [ $len != 560 ] ; then echo error: patchlevel.h was $len bytes long, should have been 560 fi fi # end of overwriting check if [ -f noface.icon ] then echo shar: will not over-write existing file noface.icon else echo shar: extracting 'noface.icon', 1933 characters cat > noface.icon <<'Funky_Stuff' /* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16 */ 0x0000,0x1FA0,0x0000,0x0000,0x0000,0x7FFC,0x0000,0x0000, 0x0000,0xFEFF,0x0000,0x0000,0x0001,0xBFBF,0xC000,0x0000, 0x0001,0xEFFA,0xE000,0x0000,0x0002,0x00FF,0xF800,0x0000, 0x0002,0x007F,0xFF80,0x0000,0x0000,0x001F,0x7E00,0x0000, 0x000C,0x001F,0xFFC0,0x0000,0x0000,0x0015,0xFFC0,0x0000, 0x0030,0x001F,0xFFF0,0x0000,0x0070,0x000F,0xFEB0,0x0000, 0x00C0,0x0007,0xFFF8,0x0000,0x00E0,0x0007,0xFFE8,0x0000, 0x01E0,0x0003,0xFFF8,0x0000,0x03C0,0x0001,0xFFF8,0x0000, 0x03E0,0x0001,0xFFF8,0x0000,0x07C0,0x0000,0xFFF0,0x0000, 0x0FF8,0x0000,0xBFF8,0x0000,0x0FE0,0x0000,0xFFF8,0x0000, 0x1FF0,0x0000,0x7FF8,0x0000,0x1FF0,0x0000,0xFFF8,0x0000, 0x1FF0,0x0000,0xFFF8,0x0000,0x1FD0,0x0000,0xFFF0,0x0000, 0x0FE0,0x0001,0xFFF0,0x0000,0x1FA0,0x0000,0x3FF0,0x0000, 0x0320,0x0000,0x1FE0,0x0000,0x0B80,0x0000,0x1F80,0x0000, 0x0180,0x0000,0x1780,0x0000,0x0080,0x0000,0x1F00,0x0000, 0x0000,0x0000,0x1F00,0x0000,0x0180,0x0000,0x0E00,0x0000, 0x0380,0x0000,0x1E00,0x0000,0x0180,0x0000,0x0FC0,0x0000, 0x0080,0x0000,0x1F80,0x0000,0x01C0,0x0000,0x0F80,0x0000, 0x00C0,0x0000,0x7F80,0x0000,0x0040,0x0000,0x7F00,0x0000, 0x0060,0x0000,0xCE00,0x0000,0x0004,0x0001,0x6000,0x0000, 0x0000,0x0003,0xF800,0x0000,0x0002,0x0001,0xA000,0x0000, 0x0000,0x0007,0xC000,0x0000,0x0002,0x000F,0x4000,0x0000, 0x0000,0x804B,0xC000,0x0000,0x0002,0xBBFE,0x8000,0x0000, 0x0000,0x8FFB,0xC000,0x0000,0x0001,0x7ABF,0xC000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 Funky_Stuff len=`wc -c < noface.icon` if [ $len != 1933 ] ; then echo error: noface.icon was $len bytes long, should have been 1933 fi fi # end of overwriting check if [ -f nomail.icon ] then echo shar: will not over-write existing file nomail.icon else echo shar: extracting 'nomail.icon', 1933 characters cat > nomail.icon <<'Funky_Stuff' /* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16 */ 0x0001,0xFFFF,0xFFC0,0x0000,0x0002,0xB000,0x0030,0x0000, 0x0003,0x5800,0x0008,0x0000,0x0006,0xADFF,0xFFC8,0x0000, 0x0005,0x54FF,0xFFE4,0x0000,0x000A,0xAAFF,0xFFF2,0x0000, 0x000D,0x567F,0xFFF2,0x0000,0x000A,0xAA7F,0xFFFA,0x0000, 0x000D,0x557F,0xFFF9,0x0000,0x000A,0xAB7F,0xFFF9,0x0000, 0x000D,0x557F,0xFFF9,0x0000,0x000A,0xAB3F,0xFFF1,0x0000, 0x000D,0x5500,0x0001,0x0000,0x000A,0xAB00,0x0001,0x0000, 0x000D,0x5500,0xFE01,0x0000,0x000A,0xAB03,0xFF81,0x0000, 0x000D,0x5507,0xFFC1,0x0000,0x000A,0xAB0F,0xFFE1,0x0000, 0x000D,0x551F,0xFFF1,0x0000,0x000A,0xAB1F,0xFFF1,0x0000, 0x000D,0x553F,0xFFF9,0x0000,0x000A,0xAB3F,0xFFF9,0x0000, 0x000D,0x553F,0xFFF9,0x0000,0x000A,0xAB3F,0xFFF9,0x0000, 0x0FFD,0x553F,0xFFF9,0x0000,0x3FFA,0xAB3F,0xFFF9,0x0000, 0x7FFD,0x553F,0xFFF9,0x0000,0xFFFA,0xAB3F,0xFFF9,0x0000, 0xFFFD,0x551F,0xFFF1,0x0000,0xFFFA,0xAB1F,0xFFF1,0x0000, 0xFFFD,0x550F,0xFFE1,0x0000,0xFFFA,0xAB07,0xFFC1,0x0000, 0xFFFD,0xD503,0xFF81,0x0000,0xFFFB,0xEB00,0xFE01,0x0000, 0x3FFD,0xF500,0x0001,0x0000,0x3FFB,0xFB00,0x0001,0x0000, 0x0FFD,0xFD0F,0xFFE1,0x0000,0x0FFB,0xFB1F,0xFFD1,0x0000, 0x03FD,0xFD3F,0xF7C9,0x0000,0x00FF,0xFF7F,0xF8C5,0x0000, 0x003F,0xFD7F,0xFC45,0x0000,0x001F,0xFF7F,0xFE05,0x0000, 0x0007,0xF560,0x3F85,0x0000,0x0003,0xF760,0x0FE5,0x0000, 0x0000,0xFD40,0x01F5,0x0000,0x0000,0x3F40,0x00FD,0x0000, 0x0000,0x0760,0x003D,0x0000,0x0000,0x03E0,0x000F,0x0000, 0x0000,0x0000,0x0000,0x0000,0x00FF,0xFFFF,0xFFFF,0xFF80, 0x00FF,0xFFFF,0xFFFF,0xFF80,0x00BB,0xFFFF,0xFFFD,0xF180, 0x009B,0xFFFF,0xFFFF,0xFD80,0x009B,0x8FFC,0xBC71,0xFD80, 0x00AB,0x77FD,0x5BBD,0xFD80,0x00AB,0x77FD,0x5FBD,0xFD80, 0x00B3,0x77FD,0x5C3D,0xFD80,0x00B3,0x77FD,0x5BBD,0xFD80, 0x00BB,0x77FD,0x5BBD,0xFD80,0x00BB,0x8FFD,0x5C3D,0xFD80, 0x00FF,0xFFFF,0xFFFF,0xFF80,0x00FF,0xFFFF,0xFFFF,0xFF80, 0x00FF,0xFFFF,0xFFFF,0xFF80,0x0000,0x0000,0x0000,0x0000 Funky_Stuff len=`wc -c < nomail.icon` if [ $len != 1933 ] ; then echo error: nomail.icon was $len bytes long, should have been 1933 fi fi # end of overwriting check if [ -f noprint.icon ] then echo shar: will not over-write existing file noprint.icon else echo shar: extracting 'noprint.icon', 1933 characters cat > noprint.icon <<'Funky_Stuff' /* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16 */ 0x0000,0x0000,0x0000,0x0000,0x00FF,0xFFFF,0xFFFF,0xFFE0, 0x0080,0x0000,0x0000,0x0010,0x0080,0x0000,0x0000,0x0010, 0x0080,0x0000,0x0000,0x0010,0x0080,0x0000,0x0000,0x0010, 0x0080,0x0000,0x0000,0x0010,0x0080,0x0000,0x0000,0x0010, 0x0080,0x0000,0x0000,0x0010,0x0080,0x0000,0x0000,0x0010, 0x00FF,0xFFFF,0xFFFF,0xFFF0,0x0090,0x0400,0x0000,0x8010, 0x0091,0xE400,0x0000,0x8010,0x0092,0x1400,0x1FF8,0x8010, 0x0092,0x1400,0x1008,0x8010,0x0092,0x1400,0x1008,0x8010, 0x0093,0xF400,0x1FF8,0x8010,0x0092,0xD400,0x1008,0x8010, 0x0092,0x1400,0x1FF8,0x8010,0x0091,0xE400,0x0000,0x8020, 0x0090,0x0400,0x0000,0x8040,0x00FF,0xFFFF,0xFFFF,0xC080, 0x3FFF,0xFFFF,0xFFFF,0xE100,0x3880,0x0000,0x0000,0x7E00, 0x3880,0x0000,0x0000,0x1FFC,0x3880,0x0000,0x0000,0x1FFC, 0x3F80,0x0FEF,0xEFCF,0xE100,0x0080,0x0000,0x0000,0x01FC, 0x0080,0x0FEF,0xEFCF,0xE100,0x0F80,0x0000,0x0000,0x0100, 0x0880,0x0FEF,0xEFCF,0xE100,0x0F80,0x0000,0x0000,0x0100, 0x0080,0x0000,0x0000,0x0100,0x00FF,0xFFFF,0xFFFF,0xFF00, 0x0040,0x0000,0x0000,0x0200,0x0040,0x0000,0x0000,0x0200, 0x003F,0xFFFF,0xFFFF,0xFC00,0x001C,0x0000,0x0001,0xC000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x00FF,0xFFFF,0xFFFF,0xFF80, 0x00FF,0xFFFF,0xFFFF,0xFF80,0x00FF,0xFFFF,0xBFF7,0xFF80, 0x00FF,0xFFFF,0xFFF7,0xFF80,0x00A7,0x8FFE,0x3C74,0xF180, 0x009B,0x77FF,0xBBB3,0x6E80,0x00BB,0x77FF,0xBBB7,0x6F80, 0x00BB,0x77FF,0xBBB7,0x7180,0x00BB,0x77FF,0xBBB7,0x7E80, 0x00BB,0x77FF,0xBBB3,0x6E80,0x00BB,0x8FFF,0xBC74,0xF180, 0x00FF,0xFFFF,0xBFFF,0xFF80,0x00FF,0xFFFD,0xBFFF,0xFF80, 0x00FF,0xFFFE,0x7FFF,0xFF80,0x00FF,0xFFFF,0xFFFF,0xFF80 Funky_Stuff len=`wc -c < noprint.icon` if [ $len != 1933 ] ; then echo error: noprint.icon was $len bytes long, should have been 1933 fi fi # end of overwriting check if [ -f nopaper.icon ] then echo shar: will not over-write existing file nopaper.icon else echo shar: extracting 'nopaper.icon', 1973 characters cat > nopaper.icon <<'Funky_Stuff' /* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16 */ 0xC000,0x0000,0x0000,0x0003,0xE000,0x0000,0x0000,0x0007, 0x7000,0x0000,0x0000,0x000E,0x3800,0x0000,0x0000,0x001C, 0x1C00,0x0000,0x0000,0x0038,0x0E00,0x0000,0x0000,0x0070, 0x0700,0x0000,0x0000,0x00E0,0x0380,0x0000,0x0000,0x01C0, 0x01C0,0x0000,0x0000,0x0380,0x00E0,0x0000,0x0000,0x0700, 0x0070,0x0000,0x0000,0x0E00,0x0038,0x0000,0x0000,0x1C00, 0x001C,0x0000,0x0000,0x3800,0x000E,0x0000,0x0000,0x7000, 0x0007,0x0000,0x0000,0xE000,0x0003,0x8000,0x0001,0xC000, 0x0001,0xC000,0x0003,0x8000,0x0000,0xE000,0x0007,0x0000, 0x0000,0x7000,0x000E,0x0000,0x0000,0x7FFF,0xFFFF,0xC000, 0x0000,0xBC00,0x0038,0x2000,0x0001,0x1E00,0x0070,0x1000, 0x0002,0x0F00,0x00E0,0x0800,0x0004,0x0780,0x01C0,0x0400, 0x0004,0x05C0,0x0380,0x0400,0x0008,0x42E0,0x0700,0x0200, 0x0008,0xE270,0x0E00,0x0200,0x0009,0xF238,0x1C00,0x0200, 0x0009,0xF21C,0x3800,0x0200,0x0009,0xF20E,0x7000,0x0200, 0x0009,0xF207,0xE000,0x0200,0x0009,0xF203,0xC000,0x0200, 0x0008,0xE203,0xC000,0x0200,0x0008,0x4207,0xE000,0x0200, 0x0004,0x040E,0x7000,0x0400,0x0004,0x041C,0x3800,0x0400, 0x0006,0x0838,0x1C00,0x0800,0x0007,0x1070,0x0E00,0x1000, 0x0002,0xA0E0,0x0700,0x2000,0x0002,0x7FFF,0xFFFF,0xC000, 0x0002,0x0380,0x01C2,0x0000,0x0002,0x0700,0x00E1,0x0000, 0x0003,0x0E00,0x0071,0x0000,0x0001,0x1C00,0x0039,0x0000, 0x0001,0x3800,0x001C,0x8000,0x0000,0xF000,0x000E,0x8000, 0x0000,0xE000,0x0007,0x8000,0x0001,0xC000,0x0003,0x8000, 0x0003,0x8000,0x0001,0xC000,0x0007,0x8000,0x0000,0xE000, 0x000E,0x4030,0x0000,0x7000,0x001C,0x41FC,0x0000,0x7800, 0x0038,0x4F02,0x003C,0x5C00,0x0070,0x5401,0xC1C2,0x2E00, 0x00E0,0x6000,0x3F01,0xC700,0x01C0,0x0000,0x0000,0x0380, 0x0380,0x0000,0x0000,0x01C0,0x0700,0x0000,0x0000,0x00E0, 0x0E00,0x0000,0x0000,0x0070,0x1C00,0x0000,0x0000,0x0038, 0x3800,0x0000,0x0000,0x001C,0x7000,0x0000,0x0000,0x000E, 0xE000,0x0000,0x0000,0x0007,0xC000,0x0000,0x0000,0x0003 Funky_Stuff len=`wc -c < nopaper.icon` if [ $len != 1973 ] ; then echo error: nopaper.icon was $len bytes long, should have been 1973 fi fi # end of overwriting check