home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume14 / faces-1.4.5 / patch02 next >
Encoding:
Text File  |  1990-08-16  |  55.5 KB  |  1,726 lines

  1. Newsgroups: comp.sources.misc
  2. subject: v14i052: Official patch #7 for faces v1.4 (part 1 of 2).
  3. from: rburridge@Sun.COM (Rich Burridge)
  4. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5.  
  6. Posting-number: Volume 14, Issue 52
  7. Submitted-by: rburridge@Sun.COM (Rich Burridge)
  8. Archive-name: faces-1.4.5/patch02
  9.  
  10. [Please don't include this part with the posting].
  11.  
  12. Brandon, could you please post this (and the next message) to 
  13. comp.sources.misc ? I've sent a copy to comp.sources.bugs, but I'd like
  14. the patch to be archived. I apologise for the awful format; I'll do it
  15. the Larry Wall way next time.
  16.  
  17. Thanks.
  18.  
  19. ------CUT HERE------Start of first message------CUT HERE------
  20.  
  21. /** IMPORTANT NOTE: This patch and the new file (mush.xface.patch)
  22.  ** comes in two parts. You should save these two parts, strip off the
  23.  ** initial header (down to and including the CUT HERE lines), and
  24.  ** anything below (and including) the CUT HERE line at the end of each
  25.  ** file. cat the two files together, and unpack with sh. Use Larry Wall's
  26.  ** patch program to apply, and recompile and reinstall.
  27.  **
  28.  ** I apologise for this; I didn't realise the patch was going to be so
  29.  ** big.
  30.  **/
  31.  
  32. This is official patch #7 for faces v1.4; please apply it.
  33. It has also been sent to comp.sources.misc for posting there, and
  34. subsequent archiving.
  35.  
  36. Faces v1.4 was posted to comp.sources.misc about the end of June 1990,
  37. and was already at patchlevel #5. Patch #6 can be obtained via the mail
  38. archive server, by sending a message to rb-archive-server@Aus.Sun.COM
  39. containing the line:
  40.  
  41. send faces patch6
  42.  
  43. Note you might need to include a valid path line in this message, in
  44. order for the mail server to get the patch back to you. Such a line might
  45. be:
  46.  
  47. path uunet.uu.net!hostname!username
  48.  
  49. Rich Burridge,          DOMAIN: richb@Aus.Sun.COM
  50. Sun Microsystems.       ACSNET: richb@sunaus.sun.oz
  51. PHONE: +61 2 413 2666   UUCP:   {uunet,mcvax,ukc}!munnari!sunaus.oz!richb
  52. -------------------------------------------------------------------------
  53.  
  54. Faces v1.4 patch #7 makes the following changes:
  55.  
  56.        * From Chris Steinbroner <hesh@lll-crg.llnl.gov>
  57.          From Bob Posert <psitech.psitech!bob@uunet.UU.NET>
  58.          Incoming mail is not always stored in /usr/spool/mail/username.
  59.          HP-UX and Dell Unix (Interactive 386/ix) store it in
  60.          /usr/mail/username. Another definition (SPOOLDIR), has been added
  61.          to the Makefile. The README file has also been updated.
  62.  
  63.        * From Hugues Leroy <Hugues.Leroy@irisa.fr>
  64.          From Graham Dumpleton <grahamd@otc.otca.oz.au>
  65.          From Peter Chubb <peterc@softway.oz.au>
  66.          From Robert Adams <adams@trim.intel.com>
  67.          The parsefrom() function was not replacing a '\n' at the end of
  68.          a line with '\0' before preceding.
  69.  
  70.        * From Michael Schmidt <michael@uni-paderborn.de>
  71.          The faces window now accepts two more keyboard characters:
  72.             q - to terminate the faces program.
  73.            ^L - to refresh the faces window.
  74.  
  75.        * From Michael Schmidt <michael@uni-paderborn.de>
  76.          Added support for printer monitoring with the PLP printer
  77.          spooling system. Another definition (PLP) has been added to
  78.          the Makefile. The README file has been updated.
  79.  
  80.        * From Chris Steinbroner <hesh@lll-crg.llnl.gov>
  81.          Diffs included to allow faces to run under HP-UX.
  82.  
  83.        * From Robert Adams <adams@trim.intel.com>
  84.          Changed the SYSV definition to SYSV32 because I work with both
  85.          System V.3.2.2 and System V.4.0 from AT&T and they need different
  86.          defines.
  87.  
  88.        * From Robert Adams <adams@trim.intel.com>
  89.          Added -bg and -fg to the parameter string and modified x11.c
  90.          to set the background and foreground colors. Currently this is
  91.          only available with the X11 graphics driver.
  92.  
  93.        * From Robert Adams <adams@trim.intel.com>
  94.          people.tab now accepts the syntax "aliascomm/alias=comm/name"
  95.          to map a whole name (this is one of the TODO points).
  96.          It still accepts the old syntax. As a side effect, the
  97.          people.tab and machine.tab routines were re-written to be
  98.          better parsers and are now forgiving of white space.
  99.  
  100.        * From Robert Adams <adams@trim.intel.com>
  101.          make_iconname was rewritten to get rid of the cut and paste
  102.          code and now is a gaggle of 'for' loops.
  103.  
  104.        * From Robert Adams <adams@trim.intel.com>
  105.          From Michael Schmidt <michael@uni-paderborn.de>
  106.          The domain name parsing code in make_iconname was not working.
  107.          The problem was that the 'old_style' code 'goto'ed out of the
  108.          middle of the domain breakdown loop thus defeating same.
  109.  
  110.        * From Robert Adams <adams@trim.intel.com>
  111.          The code for building the name for people.tab and machine.tab was
  112.          broken if an alternate directory ("-f") was specified (changes
  113.          in rec.c in read_alias and read_machines).
  114.  
  115.        * From Robert Adams <adams@trim.intel.com>
  116.          If 'host' does not appear in an RFC822 address, the code would
  117.          assume "LOCAL".  The code has been fixed to assume 'hostname'
  118.          instead (fix to parsefrom.c).
  119.  
  120.        * From Robert Adams <adams@trim.intel.com>
  121.          There was a strange bug that would cause icons on the end of the
  122.          list (after entries were deleted) to get mangled.  This usually
  123.          showed up as the NOMAIL icon not being shown but garbage being
  124.          shown instead.  The problem was that in 'garbage_collect', there
  125.          was a local variable 'last' that was hidding the global variable
  126.          of the same name and thus the global was not getting updated
  127.  
  128.        * From Pat Lashley <patl@Sun.COM>
  129.          Added code to use the Domain Name Service to attempt to convert
  130.          unqualified hostnames, or hostnames with partial domains to fully
  131.          qualified domain names. Another definition (DNSLOOKUP) has been
  132.          added to the Makefile. The README file has been updated.
  133.  
  134.        * From Pat Lashley <patl@Sun.COM>
  135.          When no icon is found for a given user, the unknown icon may be
  136.          displayed either with the user name, or labeled as `unknown'.
  137.          The former case provides the most information, the latter allows
  138.          all unknown users within a given community to be lumped into a
  139.          single image. Another definition (NAMEUNKNOWN) has been added to
  140.          the Makefile. The README file has been updated.
  141.  
  142.        * From Pat Lashley <patl@Sun.COM>
  143.          Support is now included for multiple face directories. Faces
  144.          will search for the environment variable FACEPATH, and use this
  145.          as a list of colon separated face directories. See the manual
  146.          page for more details.
  147.  
  148.        * Official support for X-Face lines was not included with patch #2
  149.          to mush v7.1. Dan and Bart suggested that instead, a new file
  150.          (mush.xface.patch) should be included with the faces distribution
  151.          which in an unofficial patch to mush v7.1.2, to allow that X-Face
  152.          support. The README, MANIFEST and FILES files have been updated.
  153.  
  154.        * From Rod Whitby <rwhitby@austek.oz.au>
  155.          faces v.1.4.6 dumps core when the following message (cut down to the
  156.          smallest case) is in my mail box. This was a case of a valid X-Face:
  157.          being followed by a line starting with the word "X-Face ". Faces now
  158.          searches for "X-Face:" rather than "X-Face". This really needs to be
  159.          tightened up some more.
  160.  
  161. It introduces the following file:
  162.  
  163.        * mush.xface.patch  - unofficial patch to apply to Mush v7.1.2 to get
  164.                              X-Face: support.
  165.  
  166. ------CUT HERE------CUT HERE------CUT HERE------CUT HERE------
  167. #! /bin/sh
  168. # this is a shell archive, meaning:
  169. # 1. Remove everything above the #! /bin/sh line
  170. # 2. Save the resulting text in a file.
  171. # 3. Execute the file with /bin/sh to create the files:
  172. #    mush.xface.patch
  173. #    patch.7
  174. # This archive created: Tue Aug 14 07:22:29 EST 1990
  175. #
  176. #
  177. export PATH; PATH=/bin:$PATH
  178. #
  179. if [ -f mush.xface.patch ]
  180. then
  181. echo shar: will not over-write existing file mush.xface.patch
  182. else
  183. echo shar: extracting 'mush.xface.patch',     3336 characters
  184. cat > mush.xface.patch <<'Funky_Stuff'
  185. *** Mushrc.orig    Mon Aug  6 11:32:57 1990
  186. --- Mushrc    Mon Aug  6 11:33:22 1990
  187. ***************
  188. *** 29,35 ****
  189.   set newline
  190.   
  191.   # When reading messages, don't bother looking at lengthy, boring headers.
  192. ! ignore message-id received via status
  193.   
  194.   # Since mush has csh-like history, you might find it annoying to type
  195.   # things like "mail host\!host1\!host2\!user" from within the mush shell.
  196. --- 29,35 ----
  197.   set newline
  198.   
  199.   # When reading messages, don't bother looking at lengthy, boring headers.
  200. ! ignore message-id received via status X-Face
  201.   
  202.   # Since mush has csh-like history, you might find it annoying to type
  203.   # things like "mail host\!host1\!host2\!user" from within the mush shell.
  204. *** init.c.orig    Mon Aug  6 07:57:54 1990
  205. --- init.c    Mon Aug  6 08:01:10 1990
  206. ***************
  207. *** 12,20 ****
  208. --- 12,23 ----
  209.   #include <sys/utsname.h>
  210.   #endif /* SYSV */
  211.   
  212. + char facebuf[1024];    /* For possible compressed X-Face: image. */
  213.   void
  214.   init()
  215.   {
  216. +     FILE        *fp;
  217.       char         *home, *realname, *argv[4];
  218.       extern char        *getlogin();
  219.       char        buf[MAXPATHLEN];
  220. ***************
  221. *** 135,140 ****
  222. --- 138,153 ----
  223.       argv[0] = "hostname";
  224.       argv[2] = buf;
  225.       (void) add_option(&set_options, argv);
  226. +     }
  227. +     (void) sprintf(buf, "%s/.face", home);
  228. +     if (fp = fopen(buf, "r")) {
  229. +     facebuf[0] = '\0';
  230. +     while (fgets(buf, BUFSIZ, fp) != NULL) {
  231. +         if (facebuf[0] != '\0')
  232. +         (void) strcat(facebuf, "\t");
  233. +         (void) strcat(facebuf, buf);
  234. +     }
  235.       }
  236.   
  237.       init_bindings();
  238. *** config.h-dist.orig    Mon Aug  6 11:38:03 1990
  239. --- config.h-dist    Mon Aug  6 11:39:53 1990
  240. ***************
  241. *** 104,110 ****
  242.   /* #define PICKY_MAILER /**/
  243.   
  244.   /* Headers that will NOT be included when forwarding mail */
  245. ! #define IGNORE_ON_FWD    "status"    /* comma or space separated list */
  246.   
  247.   #define    MAXMSGS        1000    /* maximum number of messages we can read */
  248.   #define HDRSIZ BUFSIZ    /* This should not be < BUFSIZ! (but can be >) */
  249. --- 104,110 ----
  250.   /* #define PICKY_MAILER /**/
  251.   
  252.   /* Headers that will NOT be included when forwarding mail */
  253. ! #define IGNORE_ON_FWD    "status,X-Face"    /* comma or space separated list */
  254.   
  255.   #define    MAXMSGS        1000    /* maximum number of messages we can read */
  256.   #define HDRSIZ BUFSIZ    /* This should not be < BUFSIZ! (but can be >) */
  257. *** mail.c.orig    Mon Aug  6 07:58:05 1990
  258. --- mail.c    Mon Aug  6 09:02:27 1990
  259. ***************
  260. *** 1491,1496 ****
  261. --- 1491,1497 ----
  262.       int i, for_editor = (fp == NULL_FILE);
  263.       int got_date = for_editor, got_from = for_editor;
  264.       struct options *opts;
  265. +     extern char facebuf[];
  266.   
  267.       if (for_editor && hfile) {
  268.       i = file_to_fp(hfile, files[0], "r");
  269. ***************
  270. *** 1654,1659 ****
  271. --- 1655,1661 ----
  272.               !lcase_strncmp(p, "bcc:", 4) ||
  273.               !lcase_strncmp(p, "fcc:", 4) ||
  274.               !lcase_strncmp(p, "x-mailer:", 9) ||
  275. +             !lcase_strncmp(p, "x-face:", 7) ||
  276.               !lcase_strncmp(p, "status:", 7))
  277.               print_hdr = FALSE;
  278.           else if (!lcase_strncmp(p, "date:", 5))
  279. ***************
  280. *** 1720,1725 ****
  281. --- 1722,1729 ----
  282.   #ifdef PICKY_MAILER
  283.       }
  284.   #endif /* PICKY_MAILER */
  285. +     if (facebuf != NULL)
  286. +         (void) fprintf(files[i], "X-Face: %s", facebuf);
  287.       (void) fprintf(files[i], "X-Mailer: %s\n", check_internal("version"));
  288.       (void) fprintf(files[i], "%sTo: %s\n",
  289.           ison(flags, FORWARD) ? "Resent-" : "", To);
  290. Funky_Stuff
  291. len=`wc -c < mush.xface.patch`
  292. if [ $len !=     3336 ] ; then
  293. echo error: mush.xface.patch was $len bytes long, should have been     3336
  294. fi
  295. fi # end of overwriting check
  296. if [ -f patch.7 ]
  297. then
  298. echo shar: will not over-write existing file patch.7
  299. else
  300. echo shar: extracting 'patch.7',   101860 characters
  301. cat > patch.7 <<'Funky_Stuff'
  302.  
  303. ------- get.c -------
  304. *** /tmp/da09664    Tue Aug 14 07:20:14 1990
  305. --- get.c    Wed Aug  8 17:45:12 1990
  306. ***************
  307. *** 15,21 ****
  308. --- 15,25 ----
  309.    */
  310.   
  311.   #include <stdio.h>
  312. + #ifdef SYSV32 || hpux
  313. + #include <string.h>
  314. + #else
  315.   #include <strings.h>
  316. + #endif /* SYSV32 || hpux */
  317.   #include <pwd.h>
  318.   #include <ctype.h>
  319.   #include "faces.h"
  320. ***************
  321. *** 136,143 ****
  322. --- 140,154 ----
  323.   int argc ;
  324.   char *argv[] ;
  325.   {
  326. +   char *faceenv ;
  327.     char next[MAXLINE] ;    /* The next command line parameter. */
  328. +   char *pptr ;
  329. +   int i ;
  330.   
  331. +   faceenv = getenv("FACEPATH") ;
  332. +   if (faceenv) STRCPY(facedirs, faceenv) ;
  333. +   else facedirs[0] = (char) NULL ;
  334.     INC ;
  335.     while (argc > 0)
  336.       {
  337. ***************
  338. *** 159,165 ****
  339.                          break ;
  340.               case 'a' : mtype = MONALL ;    /* Monitor all of the spoolfile. */
  341.                          break ;
  342. !             case 'b' : INC ;               /* Alternate background pattern. */
  343.                          getparam(bgicon, argv, "-b needs background icon") ;
  344.                          break ;
  345.               case 'c' : INC ;               /* Number of columns. */
  346. --- 170,182 ----
  347.                          break ;
  348.               case 'a' : mtype = MONALL ;    /* Monitor all of the spoolfile. */
  349.                          break ;
  350. !             case 'b' : if (argv[0][2] == 'g')
  351. !                          {
  352. !                            INC ;           /* Background color. */
  353. !                            getparam(bgcolor, argv, "-bg specifies background color") ;
  354. !                            break ;
  355. !                          }
  356. !                        INC ;               /* Alternate background pattern. */
  357.                          getparam(bgicon, argv, "-b needs background icon") ;
  358.                          break ;
  359.               case 'c' : INC ;               /* Number of columns. */
  360. ***************
  361. *** 177,184 ****
  362.                          INC ;
  363.                          getparam(userprog, argv, "-e needs user program") ;
  364.                          break ;
  365. !             case 'f' : INC ;               /* New directory for face icons. */
  366. !                        getparam(facedir, argv, "-f needs face directory") ;
  367.                          break ;
  368.               case 'g' : INC ;               /* X11 geometry information. */
  369.                          getparam(geometry, argv,
  370. --- 194,207 ----
  371.                          INC ;
  372.                          getparam(userprog, argv, "-e needs user program") ;
  373.                          break ;
  374. !             case 'f' : if (argv[0][2] == 'g')
  375. !                          {
  376. !                            INC ;           /* Background color. */
  377. !                            getparam(fgcolor, argv, "-fg specifies foreground color") ;
  378. !                            break ;
  379. !                          }
  380. !                        INC ;               /* New directory for face icons. */
  381. !                        getparam(facedirs, argv, "-f needs face directory path") ;
  382.                          break ;
  383.               case 'g' : INC ;               /* X11 geometry information. */
  384.                          getparam(geometry, argv,
  385. ***************
  386. *** 276,281 ****
  387. --- 299,324 ----
  388.             }
  389.         INC ;
  390.       }
  391. + /* Parse the face path from the parameter line... */
  392. +   for (i = 0, pptr = facedirs; pptr && (i <= MAXPATHS); i++)
  393. +     {
  394. +       if ((*pptr == ':') || (*pptr == (char) NULL))
  395. +         {
  396. + /* Null entry in face path means insert compiled-in default. */
  397. +           facepath[i] = FACEDIR ;
  398. +           if (*(pptr++) == (char) NULL) break ;
  399. +         }
  400. +       else
  401. +         {
  402. +           facepath[i] = pptr ;
  403. +           pptr = index(pptr, ':') ;
  404. +           if (pptr) *(pptr++) = (char) NULL ;
  405. +         }
  406. +     }
  407.   }
  408.   
  409.   
  410. ***************
  411. *** 492,498 ****
  412.   usage()      /* Print faces usage message. */
  413.   {
  414.     FPRINTF(stderr, "Usage: %s [-MH] [-P printer] [-Wi] [-Wp x y] ", progname) ;
  415. !   FPRINTF(stderr, "[-WP x y] [-b background] [-d display] [-f facedir] ") ;
  416.     FPRINTF(stderr, "[-g geometry] [-i] [-n] [-p period] [-s spoolfile] [-u] ") ;
  417.     FPRINTF(stderr, "[-t] [-v]\n") ;
  418.   }
  419. --- 535,542 ----
  420.   usage()      /* Print faces usage message. */
  421.   {
  422.     FPRINTF(stderr, "Usage: %s [-MH] [-P printer] [-Wi] [-Wp x y] ", progname) ;
  423. !   FPRINTF(stderr, "[-WP x y] [-b background] [-bg background_color] ") ;
  424. !   FPRINTF(stderr, "[-d display] [-f facepath] [-fg foreground_color] ") ;
  425.     FPRINTF(stderr, "[-g geometry] [-i] [-n] [-p period] [-s spoolfile] [-u] ") ;
  426.     FPRINTF(stderr, "[-t] [-v]\n") ;
  427.   }
  428.  
  429. ------- main.c -------
  430. *** /tmp/da09667    Tue Aug 14 07:20:15 1990
  431. --- main.c    Sat Aug  4 23:35:02 1990
  432. ***************
  433. *** 17,31 ****
  434.    */
  435.   
  436.   #include <stdio.h>
  437. ! #ifdef SYSV
  438.   #include <string.h>
  439.   #else
  440.   #include <strings.h>
  441. ! #endif /*SYSV*/
  442.   #include <sys/types.h>
  443.   #include <sys/stat.h>
  444.   #include <netdb.h>
  445.   
  446.   #ifdef NISLOOKUP
  447.   #include <rpcsvc/ypclnt.h>
  448.   #endif /*NISLOOKUP*/
  449. --- 17,37 ----
  450.    */
  451.   
  452.   #include <stdio.h>
  453. ! #ifdef SYSV32 || hpux
  454.   #include <string.h>
  455.   #else
  456.   #include <strings.h>
  457. ! #endif /* SYSV32 || hpux */
  458.   #include <sys/types.h>
  459.   #include <sys/stat.h>
  460.   #include <netdb.h>
  461. + #include <ctype.h>
  462.   
  463. + #ifdef DNSLOOKUP
  464. + #include <sys/socket.h>
  465. + #include <netdb.h>
  466. + #endif /*DNSLOOKUP*/
  467.   #ifdef NISLOOKUP
  468.   #include <rpcsvc/ypclnt.h>
  469.   #endif /*NISLOOKUP*/
  470. ***************
  471. *** 72,77 ****
  472. --- 78,84 ----
  473.   enum gr_type gtype ;                /* Which graphics system is being used. */
  474.   enum mon_type mtype = MONNEW ;      /* Type of monitoring operation to do. */
  475.   
  476. + char bgcolor[MAXLINE] ;          /* X11 background color. */
  477.   char bgicon[MAXLINE] ;           /* Alternate background pattern. */
  478.   char community[MAXLINE] ;        /* Community name ("real" host name). */
  479.   char defdir[MAXLINE] ;           /* The default face directory. */
  480. ***************
  481. *** 81,87 ****
  482.   char face_host[MAXLINE] ;   /* Pointer to host name from the "From" line. */
  483.   char face_ts[MAXLINE] ;     /* Pointer to time stamp from the "From" line. */
  484.   char face_user[MAXLINE] ;   /* Pointer to user name from the "From" line. */
  485. ! char facedir[MAXLINE] ;          /* Alternate face image directory. */
  486.   char fname[MAXTYPES][MAXLINE] ;  /* Array of various face name types. */
  487.   char geometry[MAXLINE] ;         /* X11 geometry information. */
  488.   char hostcommunity[MAXLINE] ;    /* The community of the host machine */
  489. --- 88,96 ----
  490.   char face_host[MAXLINE] ;   /* Pointer to host name from the "From" line. */
  491.   char face_ts[MAXLINE] ;     /* Pointer to time stamp from the "From" line. */
  492.   char face_user[MAXLINE] ;   /* Pointer to user name from the "From" line. */
  493. ! char facedirs[MAXLINE] ;    /* Colon separated list of face directories. */
  494. ! char *facepath[MAXPATHS+1] ;     /* Array of face image directories. */
  495. ! char fgcolor[MAXLINE] ;          /* X11 foreground color. */
  496.   char fname[MAXTYPES][MAXLINE] ;  /* Array of various face name types. */
  497.   char geometry[MAXLINE] ;         /* X11 geometry information. */
  498.   char hostcommunity[MAXLINE] ;    /* The community of the host machine */
  499. ***************
  500. *** 93,98 ****
  501. --- 102,108 ----
  502.   char peopfile[MAXLINE] ;    /* Name of the people/username file. */
  503.   char printer[MAXLINE] ;     /* Printer name to monitor. */
  504.   char progname[MAXLINE] ;    /* Name of this program. */
  505. + char realcomm[MAXLINE] ;    /* Real community for this user. */
  506.   char realname[MAXLINE] ;    /* Real username for this user. */
  507.   char spoolfile[MAXLINE] ;   /* Full pathname of users current mail. */
  508.   char update_alias[MAXLINE] ;   /* Name of mail alias for database updates. */
  509. ***************
  510. *** 137,142 ****
  511. --- 147,153 ----
  512.   int period = 60 ;   /* Period in seconds for new mail check. */
  513.   int posspec = 0 ;   /* Set if -Wp or -g option is present (for X11) */
  514.   int row ;           /* Row number for next icon. */
  515. + int toclear = 0 ;   /* Set if faces memory area needs clearing. */
  516.   int update = 0 ;    /* If set, send mail to update faces database. */
  517.   int width ;         /* Width in pixels of faces display. */
  518.   int wx = 0 ;        /* Initial X position of the window. */
  519. ***************
  520. *** 220,230 ****
  521.    */
  522.   
  523.     {
  524. !     struct hostent *hp ;
  525.       char hostname[MAXLINE] ;
  526.   
  527.       GETHOSTNAME(hostname, MAXLINE) ;
  528. !     hp = gethostbyname (hostname) ;
  529.       if (hp != NULL) STRCPY(hostname, hp->h_name) ;
  530.       h_to_c(hostname, hostcommunity) ;
  531.     }
  532. --- 231,243 ----
  533.    */
  534.   
  535.     {
  536. !     struct hostent *hp = NULL ;
  537.       char hostname[MAXLINE] ;
  538.   
  539.       GETHOSTNAME(hostname, MAXLINE) ;
  540. ! #ifndef SYSV32
  541. !     hp = gethostbyname(hostname) ;
  542. ! #endif /*SYSV32*/
  543.       if (hp != NULL) STRCPY(hostname, hp->h_name) ;
  544.       h_to_c(hostname, hostcommunity) ;
  545.     }
  546. ***************
  547. *** 233,241 ****
  548.     {
  549.       struct machinfo *temp ;
  550.   
  551. !     yp_get_default_domain (&hostdomain) ;
  552.       STRCPY(domaincommunity, hostdomain) ;
  553.   
  554.   /*  We can't call h_to_c() to setup the default because it expects
  555.    *  it to be set already; so we grovel through the machine/community
  556.    *  association list directly.
  557. --- 246,257 ----
  558.     {
  559.       struct machinfo *temp ;
  560.   
  561. !     yp_get_default_domain(&hostdomain) ;
  562.       STRCPY(domaincommunity, hostdomain) ;
  563.   
  564. +     IF_DEBUG( FPRINTF(stderr, "main: NIS community is `%s`\n",
  565. +                       domaincommunity) ) ;
  566.   /*  We can't call h_to_c() to setup the default because it expects
  567.    *  it to be set already; so we grovel through the machine/community
  568.    *  association list directly.
  569. ***************
  570. *** 242,253 ****
  571.    */
  572.   
  573.       for (temp = machines; temp != NULL; temp = temp->next)
  574. !       if (strcmp(temp->machine, domaincommunity) == 0)
  575. !         {
  576. !           STRCPY(domaincommunity, temp->community) ;
  577. !           break ;
  578. !         }
  579.   
  580.       IF_DEBUG( FPRINTF(stderr, "main: domain community is `%s`\n",
  581.                         domaincommunity) ; )
  582.     }
  583. --- 258,273 ----
  584.    */
  585.   
  586.       for (temp = machines; temp != NULL; temp = temp->next)
  587. !      if (!strcmp(temp->machine, domaincommunity))
  588. !        {
  589. !          char *str ;
  590.   
  591. +          STRCPY(domaincommunity, temp->community) ;
  592. +          for (str = community;  *str;  str++)
  593. +            if (isascii(*str) && isupper(*str)) *str = tolower(*str) ;
  594. +          break ;
  595. +        }
  596.       IF_DEBUG( FPRINTF(stderr, "main: domain community is `%s`\n",
  597.                         domaincommunity) ; )
  598.     }
  599. ***************
  600. *** 260,273 ****
  601.   }
  602.   
  603.   
  604. ! a_to_u(community, user, realname)    /* Turn possible alias into username. */
  605. ! char *community, *user, *realname ;
  606.   {
  607.     struct comminfo *ctemp ;
  608.     struct peopinfo *ptemp ;
  609.   
  610. !   STRCPY(realname, user) ;      /* In case alias not found. */
  611. !   ctemp = communities ;         /* Point to chain of communities. */
  612.     while (ctemp != NULL)
  613.       if (!strcmp(ctemp->community, community))
  614.         {
  615. --- 280,296 ----
  616.   }
  617.   
  618.   
  619. ! /* Turn possible alias into username. */
  620. ! a_to_u(community, user, realcomm, realname)
  621. ! char *community, *user, *realcomm, *realname ;
  622.   {
  623.     struct comminfo *ctemp ;
  624.     struct peopinfo *ptemp ;
  625.   
  626. !   STRCPY(realname, user) ;         /* In case alias not found. */
  627. !   STRCPY(realcomm, community) ;    /* In case alias not found. */
  628. !   ctemp = communities ;            /* Point to chain of communities. */
  629.     while (ctemp != NULL)
  630.       if (!strcmp(ctemp->community, community))
  631.         {
  632. ***************
  633. *** 276,281 ****
  634. --- 299,305 ----
  635.             if (!strcmp(ptemp->alias, user))
  636.               {
  637.                 STRCPY(realname, ptemp->username) ;
  638. +               STRCPY(realcomm, ptemp->community) ;
  639.                 return ;
  640.               }
  641.             else ptemp = ptemp->next ;
  642. ***************
  643. *** 287,295 ****
  644.   
  645.   initialise()
  646.   {
  647. !   STRCPY(facedir, "") ;       /* No alternate face directory by default. */
  648.     STRCPY(display, "") ;       /* X11 display type. */
  649.     STRCPY(geometry, "") ;      /* X11 geometry information. */
  650.   
  651.   #ifdef FBMONTYPE
  652.     mtype = FBMONTYPE ;         /* Type of monitoring to do. */
  653. --- 311,325 ----
  654.   
  655.   initialise()
  656.   {
  657. !   int i ;
  658. !   facepath[0] = FACEDIR ;    /* Default path is single built-in directory. */
  659. !   for (i = 1;  i <= MAXPATHS;  i++) facepath[i] = (char *) NULL ;
  660.     STRCPY(display, "") ;       /* X11 display type. */
  661.     STRCPY(geometry, "") ;      /* X11 geometry information. */
  662. +   STRCPY(fgcolor, "") ;       /* X11 foreground information. */
  663. +   STRCPY(bgcolor, "") ;       /* X11 background information. */
  664.   
  665.   #ifdef FBMONTYPE
  666.     mtype = FBMONTYPE ;         /* Type of monitoring to do. */
  667. ***************
  668. *** 301,315 ****
  669.     STRCPY(bgicon, "") ;                  /* Default is to use root gray. */
  670.   #endif /*BACKGROUND*/
  671.   
  672. - #ifdef FACEDIR
  673. -   STRCPY(defdir, FACEDIR) ;            /* Different directory for face icons. */
  674. - #else
  675. -   STRCPY(defdir,"/usr/local/faces") ;  /* Directory for face icons. */
  676. - #endif /*FACEDIR*/
  677. -   SPRINTF(machfile, "%s/%s", defdir, MACHINETAB) ;
  678. -   SPRINTF(peopfile, "%s/%s", defdir, PEOPLETAB) ;
  679.   #ifdef INVERT
  680.     invert = 1 ;               /* Display in reverse video. */
  681.   #endif /*INVERT*/
  682. --- 331,336 ----
  683. ***************
  684. *** 329,335 ****
  685. --- 350,360 ----
  686.     else
  687.       {
  688.         username = getname() ;     /* Get users name from passwd entry. */
  689. + #ifdef SPOOLDIR
  690. +       SPRINTF(spoolfile, "%s/%s", SPOOLDIR, username) ;
  691. + #else
  692.         SPRINTF(spoolfile, "/usr/spool/mail/%s", username) ;
  693. + #endif /*SPOOLDIR*/
  694.       }
  695.   #endif /*SPOOLFILE*/
  696.   
  697. ***************
  698. *** 380,385 ****
  699. --- 405,442 ----
  700.           return ;
  701.         }
  702.   
  703. + #ifdef DNSLOOKUP
  704. +   {
  705. +     char *str ;
  706. +     struct hostent *found = gethostbyname(community) ;
  707. +  
  708. +     if (found)
  709. +       {
  710. +          IF_DEBUG( FPRINTF(stderr, "DNSLOOKUP found %s as %s\n",
  711. +                            community, found->h_name) ) ;
  712. +          STRCPY(community, found->h_name) ;
  713. +          for (str = community;  *str;  str++)
  714. +            if (isascii(*str) && isupper(*str)) *str = tolower(*str) ;
  715. +        
  716. + /* Grovel through the machine/community association list again
  717. +  * to allow domains to be aliases.
  718. +  */
  719. +          for (temp = machines; temp != NULL; temp = temp->next)
  720. +            if (!strcmp(temp->machine, community))
  721. +              {
  722. +                STRCPY(community, temp->community) ;
  723. +                IF_DEBUG( FPRINTF(stderr,
  724. +                          "h_to_c(): machine `%s` found in community '%s'\n",
  725. +                          temp->machine, community) ; )
  726. +                return ;
  727. +              }
  728. +          return ;
  729. +       }
  730. +   }
  731. + #endif /*DNSLOOKUP*/
  732.   #ifdef NISLOOKUP
  733.   
  734.   /*  yp_match() returns zero on success. We will treat any failure as
  735. ***************
  736. *** 389,412 ****
  737.     yp_err = yp_match(hostdomain, "hosts.byname",
  738.                       host, strlen(host), &hostinfo, &len) ;
  739.   
  740. -   if (yp_err == 0)
  741. -     {
  742.   /* We aren't interested in the value returned, only whether the key
  743.    * was found...
  744.    */
  745.   
  746.         STRCPY(community, domaincommunity) ;
  747. !       IF_DEBUG( FPRINTF(stderr, "NISlookup: found %s\n", host) ; )
  748.       }
  749. !   IF_DEBUG( else FPRINTF(stderr, "NISlookup: Error %d\n", yp_err) ; )
  750. !   IF_DEBUG( FPRINTF(stderr, "h_to_c(): community = '%s'\n", community) ; )
  751.   #endif /*NISLOOKUP*/
  752.   }
  753.   
  754.   
  755. ! make_iconname(facedir, community, user)    /* Construct the icon name. */
  756. ! char *facedir, *community, *user ;
  757.   {
  758.   
  759.   /*  Sets up community and user based on the first successful
  760. --- 446,478 ----
  761.     yp_err = yp_match(hostdomain, "hosts.byname",
  762.                       host, strlen(host), &hostinfo, &len) ;
  763.   
  764.   /* We aren't interested in the value returned, only whether the key
  765.    * was found...
  766.    */
  767.   
  768. +   if (yp_err == 0)
  769. +     {
  770. +       char *str ;
  771.         STRCPY(community, domaincommunity) ;
  772. !       for (str = community;  *str;  str++)
  773. !         if (isascii(*str) && isupper(*str)) *str = tolower(*str) ;
  774. !  
  775. ! /* Don't bother checking for domaincommunity in the machines
  776. !  * alias list - that should have been done when the variable
  777. !  * was initialized.
  778. !  */
  779. !  
  780. !       IF_DEBUG( FPRINTF(stderr, "NISlookup: found %s\n", host) ) ;
  781.       }
  782. !   IF_DEBUG( else FPRINTF(stderr, "NISlookup: Error %d\n", yp_err) ) ;
  783. !   IF_DEBUG( FPRINTF(stderr, "h_to_c(): community = '%s'\n", community) ) ;
  784.   #endif /*NISLOOKUP*/
  785.   }
  786.   
  787.   
  788. ! make_iconname(facepath, community, user)    /* Construct the icon name. */
  789. ! char *facepath[MAXPATHS+1], *community, *user ;
  790.   {
  791.   
  792.   /*  Sets up community and user based on the first successful
  793. ***************
  794. *** 417,647 ****
  795.    *  $(FACEDIR)/community/unknown/[face.ps, sun.icon, 48x48x1, face.xbm]
  796.    *  $(FACEDIR)/misc./unknown/[face.ps, sun.icon, 48x48x1, face.xbm]
  797.    *
  798. !  *  Firstly a check is made for the "old" style; first in a possible
  799. !  *  alternate face directory, then in the default directory. This is
  800. !  *  where the username is not a directory but the ikon in 48x48x1
  801. !  *  format.
  802.    *
  803.    *  If none of these are found, the "blank face" is returned.
  804.    */
  805.   
  806. !   char *cptr ;
  807. !   int i ;
  808.   
  809.     old_style = 0 ;     /* Reset before checking this face. */
  810.   
  811.     IF_DEBUG( FPRINTF(stderr, "make_iconname: %s[%s] ", community, user) ; )
  812.     
  813. !   if (strlen(facedir))
  814. !     for (cptr = community; cptr != NULL; cptr = index(cptr, '.'))
  815. !       for (i = -1; i < maxtypes; i++)
  816. !         {
  817. !           if (*cptr == '.') cptr++ ;
  818. !           if (i < 0)
  819. !             {
  820. !               SPRINTF(iconname, "%s/%s/%s", facedir, cptr, user) ;
  821. !               if (stat(iconname, &buf) == -1) goto mi1 ;
  822. !               if ((buf.st_mode & S_IFMT) == S_IFREG)
  823. !                 {
  824. !                   old_style = 1 ;
  825. !                   IF_DEBUG( FPRINTF(stderr, "found as %s\n", iconname) ; )
  826. !                   return 1 ;
  827. !                 }
  828. !             }
  829. !           else
  830. !             {
  831. !               SPRINTF(iconname, "%s/%s/%s/%s", facedir, cptr, user, fname[i]) ;
  832. !               if (stat(iconname, &buf) != -1)
  833. !                 {
  834. !                   IF_DEBUG( FPRINTF(stderr, "found as %s\n", iconname) ; )
  835. !                   return 1 ;
  836. !                 }
  837. !             }
  838. !         }
  839. ! mi1:
  840. !   for (cptr = community; cptr != NULL; cptr = index(cptr, '.'))
  841. !     for (i = -1; i < maxtypes; i++)
  842. !       {
  843. !         if (*cptr == '.') cptr++ ;
  844. !         if (i < 0)
  845.             {
  846. !             SPRINTF(iconname, "%s/%s/%s", defdir, cptr, user) ;
  847. !             if (stat(iconname, &buf) == -1) goto mi2 ;
  848. !             if ((buf.st_mode & S_IFMT) == S_IFREG)
  849. !               {    
  850. !                 IF_DEBUG( FPRINTF(stderr, "found as %s\n", iconname) ; )
  851. !                 old_style = 1 ;
  852. !                 return 1 ;
  853. !               }
  854. !           } 
  855. !         else
  856. !           {
  857. !             SPRINTF(iconname, "%s/%s/%s/%s", defdir, cptr, user, fname[i]) ;
  858.               if (stat(iconname, &buf) != -1)
  859. -               {
  860. -                 IF_DEBUG( FPRINTF(stderr, "found as %s\n", iconname) ; )
  861. -                 return 1 ;
  862. -               }
  863. -           }
  864. -       }
  865. -  
  866. - mi2:
  867. -   if (strlen(facedir))
  868. -     for (i = -1; i < maxtypes; i++)
  869. -       if (i < 0)
  870. -         {
  871. -           SPRINTF(iconname, "%s/misc./%s", facedir, user) ;
  872. -           if (stat(iconname, &buf) == -1) goto mi3 ;
  873. -           if ((buf.st_mode & S_IFMT) == S_IFREG)
  874. -             {
  875. -               IF_DEBUG( FPRINTF(stderr, "found as %s\n", iconname) ; )
  876. -               old_style = 1 ;
  877. -               return 1 ;
  878. -             }
  879. -         }    
  880. -       else
  881. -         { 
  882. -           SPRINTF(iconname, "%s/misc./%s/%s", facedir, user, fname[i]) ;
  883. -           if (stat(iconname, &buf) != -1)
  884. -             {
  885. -               if (!x_face) STRCPY(community, "misc.") ;
  886. -               IF_DEBUG( FPRINTF(stderr, "found as %s\n", iconname) ; )
  887. -               return 1 ;
  888. -             }
  889. -         }
  890. - mi3:
  891. -   for (i = -1; i < maxtypes; i++)
  892. -     if (i < 0)
  893. -       {
  894. -         SPRINTF(iconname, "%s/misc./%s", defdir, user) ;
  895. -         if (stat(iconname, &buf) == -1) goto mi4 ;
  896. -         if ((buf.st_mode & S_IFMT) == S_IFREG)
  897. -           {
  898. -             IF_DEBUG( FPRINTF(stderr, "found as %s\n", iconname) ; )
  899. -             old_style = 1 ;
  900. -             return 1 ;
  901. -           }
  902. -       }    
  903. -     else
  904. -       {
  905. -         SPRINTF(iconname, "%s/misc./%s/%s", defdir, user, fname[i]) ;
  906. -         if (stat(iconname, &buf) != -1)
  907. -           {
  908. -             IF_DEBUG( FPRINTF(stderr, "found as %s\n", iconname) ; )
  909. -             if (!x_face) STRCPY(community, "misc.") ;
  910. -             return 1 ;
  911. -           }
  912. -       }
  913. -  
  914. - mi4:
  915. -   if (strlen(facedir))
  916. -     for (cptr = community; cptr != NULL; cptr = index(cptr, '.'))
  917. -       for (i = -1; i < maxtypes; i++)
  918. -         {
  919. -           if (*cptr == '.') cptr++ ;
  920. -           if (i < 0)
  921. -             {
  922. -               SPRINTF(iconname, "%s/%s/unknown", facedir, cptr) ;
  923. -               if (stat(iconname, &buf) == -1) goto mi5 ;
  924.                 if ((buf.st_mode & S_IFMT) == S_IFREG)
  925. -                 {    
  926. -                   IF_DEBUG( FPRINTF(stderr, "found as %s\n", iconname) ; )
  927. -                   old_style = 1 ;
  928. -                   return 1 ;
  929. -                 }
  930. -             } 
  931. -           else
  932. -             {
  933. -               SPRINTF(iconname, "%s/%s/unknown/%s", facedir, cptr, fname[i]) ;
  934. -               if (stat(iconname, &buf) != -1)
  935.                   {
  936.                     IF_DEBUG( FPRINTF(stderr, "found as %s\n", iconname) ; )
  937. -                   if (mtype == MONALL && !x_face) STRCPY(user, "unknown") ;
  938.                     return 1 ;
  939.                   }
  940. !             }
  941. !         }
  942. ! mi5:
  943. !   for (cptr = community; cptr != NULL; cptr = index(cptr, '.'))
  944. !     for (i = -1; i < maxtypes; i++)
  945. !       {
  946. !         if (*cptr == '.') cptr++ ;
  947. !         if (i < 0)
  948. !           {
  949. !             SPRINTF(iconname, "%s/%s/unknown", defdir, cptr) ;
  950. !             if (stat(iconname, &buf) == -1) goto mi6 ;
  951. !             if ((buf.st_mode & S_IFMT) == S_IFREG)
  952. !               {    
  953. !                 IF_DEBUG( FPRINTF(stderr, "found as %s\n", iconname) ; )
  954. !                 old_style = 1 ;
  955. !                 return 1 ;
  956. !               }
  957. !           } 
  958. !         else
  959. !           {
  960. !             SPRINTF(iconname, "%s/%s/unknown/%s", defdir, cptr, fname[i]) ;
  961. !             if (stat(iconname, &buf) != -1)
  962.                 {
  963. !                 IF_DEBUG( FPRINTF(stderr, "found as %s\n", iconname) ; )
  964. !                 if (mtype == MONALL && !x_face) STRCPY(user, "unknown") ;
  965. !                 return 1 ;
  966.                 }
  967.             }
  968. -       }
  969. - mi6:
  970. -   if (strlen(facedir))
  971. -     for (i = -1; i < maxtypes; i++)
  972. -       if (i < 0)
  973. -         {
  974. -           SPRINTF(iconname, "%s/misc./unknown", facedir) ;
  975. -           if (stat(iconname, &buf) == -1) goto mi7 ;
  976. -           if ((buf.st_mode & S_IFMT) == S_IFREG)
  977. -             {
  978. -               IF_DEBUG( FPRINTF(stderr, "found as %s\n", iconname) ; )
  979. -               old_style = 1 ;
  980. -               return 1 ;
  981. -             }
  982. -         }    
  983. -       else
  984. -         {
  985. -           SPRINTF(iconname, "%s/misc./unknown/%s", facedir, fname[i]) ;
  986. -           if (stat(iconname, &buf) != -1)
  987. -             {
  988. -               IF_DEBUG( FPRINTF(stderr, "found as %s\n", iconname) ; )
  989. -               if (!x_face) STRCPY(community, "misc.") ;
  990. -               if (mtype == MONALL && !x_face) STRCPY(user, "unknown") ;
  991. -               return 1 ;
  992. -             }
  993. -         }
  994. - mi7:
  995. -   for (i = -1; i < maxtypes; i++)
  996. -     if (i < 0)
  997. -       {
  998. -         SPRINTF(iconname, "%s/misc./unknown", defdir) ;
  999. -         if (stat(iconname, &buf) == -1) return 0 ;
  1000. -         if ((buf.st_mode & S_IFMT) == S_IFREG)
  1001. -           {
  1002. -             IF_DEBUG( FPRINTF(stderr, "found as %s\n", iconname) ; )
  1003. -             old_style = 1 ;
  1004. -             return 1 ;
  1005. -           }  
  1006. -       }    
  1007. -     else
  1008. -       {
  1009. -         SPRINTF(iconname, "%s/misc./unknown/%s", defdir, fname[i]) ;
  1010. -         if (stat(iconname, &buf) != -1)
  1011. -           {
  1012. -             IF_DEBUG( FPRINTF(stderr, "found as %s\n", iconname) ; )
  1013. -             if (!x_face) STRCPY(community, "misc.") ;
  1014. -             if (mtype == MONALL && !x_face) STRCPY(user, "unknown") ;
  1015. -             return 1 ;
  1016. -           }
  1017. -       }
  1018.   
  1019.   /* Face icon not found, so the "blank face" should be used. */
  1020.   
  1021. --- 483,538 ----
  1022.    *  $(FACEDIR)/community/unknown/[face.ps, sun.icon, 48x48x1, face.xbm]
  1023.    *  $(FACEDIR)/misc./unknown/[face.ps, sun.icon, 48x48x1, face.xbm]
  1024.    *
  1025. !  *  Firstly a check is made for the "old" style. This is where the username
  1026. !  *  is not a directory but the ikon in 48x48x1 format. $(FACEDIR) is
  1027. !  *  replaced by all the face directories given.
  1028.    *
  1029.    *  If none of these are found, the "blank face" is returned.
  1030.    */
  1031.   
  1032. !   char *cptr, *icomm[3], *iuser[3] ;
  1033. !   int i, ic, id, iu ;
  1034.   
  1035. +   icomm[0] = community ;
  1036. +   icomm[1] = "misc." ;
  1037. +   icomm[2] = "" ;
  1038. +   iuser[0] = user ;
  1039. +   iuser[1] = "unknown" ;
  1040. +   iuser[2] = "" ;
  1041.     old_style = 0 ;     /* Reset before checking this face. */
  1042.   
  1043.     IF_DEBUG( FPRINTF(stderr, "make_iconname: %s[%s] ", community, user) ; )
  1044.     
  1045. !   for (id = 0; strlen(facepath[id]) != 0; id++)
  1046. !     for (iu = 0; strlen(iuser[iu]) != 0; iu++)
  1047. !       for (ic = 0; strlen(icomm[ic]) != 0; ic++)
  1048. !         for (cptr = icomm[ic]; cptr != NULL; cptr = index(cptr, '.'))
  1049.             {
  1050. !             SPRINTF(iconname, "%s/%s/%s", facepath[id], cptr, iuser[iu]) ;
  1051.               if (stat(iconname, &buf) != -1)
  1052.                 if ((buf.st_mode & S_IFMT) == S_IFREG)
  1053.                   {
  1054. +                   old_style = 1 ;
  1055.                     IF_DEBUG( FPRINTF(stderr, "found as %s\n", iconname) ; )
  1056.                     return 1 ;
  1057.                   }
  1058. !             for (i = 0; i < maxtypes; i++)
  1059.                 {
  1060. !                 if (*cptr == '.') cptr++ ;
  1061. !                 SPRINTF(iconname, "%s/%s/%s/%s", 
  1062. !                         facepath[id], cptr, iuser[iu], fname[i]) ;
  1063. !                 if (stat(iconname, &buf) != -1)
  1064. !                   {
  1065. !                     IF_DEBUG( FPRINTF(stderr, "found as %s\n", iconname) ; )
  1066. ! #ifdef NAMEUNKNOWN
  1067. !                     if (EQUAL(iser[iu], "unknown")) STRCPY(user, "unknown") ;
  1068. ! #endif /*NAMEUNKNOWN*/
  1069. !                     return 1 ;
  1070. !                   }
  1071.                 }
  1072.             }
  1073.   
  1074.   /* Face icon not found, so the "blank face" should be used. */
  1075.   
  1076.  
  1077. ------- mon.c -------
  1078. *** /tmp/da09670    Tue Aug 14 07:20:16 1990
  1079. --- mon.c    Tue Aug 14 06:58:10 1990
  1080. ***************
  1081. *** 15,25 ****
  1082.    */
  1083.   
  1084.   #include <stdio.h>
  1085. ! #ifdef SYSV
  1086.   #include <string.h>
  1087.   #else
  1088.   #include <strings.h>
  1089. ! #endif /*SYSV*/
  1090.   #include <sys/types.h>
  1091.   #include <sys/stat.h>
  1092.   #include <sys/time.h>
  1093. --- 15,25 ----
  1094.    */
  1095.   
  1096.   #include <stdio.h>
  1097. ! #ifdef SYSV32 || hpux
  1098.   #include <string.h>
  1099.   #else
  1100.   #include <strings.h>
  1101. ! #endif /* SYSV32 || hpux */
  1102.   #include <sys/types.h>
  1103.   #include <sys/stat.h>
  1104.   #include <sys/time.h>
  1105. ***************
  1106. *** 130,135 ****
  1107. --- 130,155 ----
  1108.   }
  1109.   
  1110.   
  1111. + do_key(val)            /* Handle various keyboard options. */
  1112. + int val ;
  1113. + {
  1114. +   switch (val)
  1115. +     {
  1116. +       case KEY_CLEAR   : if (mtype == MONNEW)
  1117. +                            {
  1118. +                              repl_image(DISP_NAME,  CUROFF, width, height) ;
  1119. +                              repl_image(DISP_OTHER, CUROFF, width, height) ;
  1120. +                              toclear = 1 ;
  1121. +                              do_check() ;
  1122. +                            }
  1123. +                          break ;
  1124. +       case KEY_REFRESH : draw_screen(wdtype) ;
  1125. +                          break ;
  1126. +       case KEY_QUIT    : exit(0) ;
  1127. +     }
  1128. + }
  1129.   do_mail(mtype)              /* Monitor a mail file for new or all mail. */
  1130.   enum mon_type mtype ;
  1131.   {        
  1132. ***************
  1133. *** 184,192 ****
  1134.             if (froms_found) process_info() ;  /* Process previous mail. */
  1135.             process_from() ;                   /* Save new from details. */
  1136.           }
  1137. !       else if (EQUAL(line, "From:"))  process_from() ;
  1138. !       else if (EQUAL(line, "X-Face")) process_face() ;
  1139. !       else if (doing_xface)           process_face() ;
  1140.       }
  1141.     FCLOSE(fp) ;
  1142.   
  1143. --- 204,212 ----
  1144.             if (froms_found) process_info() ;  /* Process previous mail. */
  1145.             process_from() ;                   /* Save new from details. */
  1146.           }
  1147. !       else if (EQUAL(line, "From:"))   process_from() ;
  1148. !       else if (EQUAL(line, "X-Face:")) process_face() ;
  1149. !       else if (doing_xface)            process_face() ;
  1150.       }
  1151.     FCLOSE(fp) ;
  1152.   
  1153. ***************
  1154. *** 216,221 ****
  1155. --- 236,243 ----
  1156.         return ;
  1157.       }
  1158.     column = row = 0 ;          /* Start in top left corner of pixrect. */
  1159. + #ifndef PLP
  1160.     FGETS(nextline, MAXLINE, fp) ;
  1161.     if (EQUAL(nextline, "no entries"))
  1162.       {
  1163. ***************
  1164. *** 230,245 ****
  1165.         text(DISP_ALL, LEFT, printer) ;      /* Output printer name. */
  1166.       }
  1167.     else
  1168.       {
  1169.         FGETS(nextline, MAXLINE, fp) ;    /* Skip the next line. */
  1170.         while (fgets(nextline, MAXLINE, fp) != NULL)
  1171.           {
  1172.             SSCANF(&nextline[7], "%s", owner) ;
  1173.             SSCANF(&nextline[60], "%d", &size) ;
  1174.             h_to_c("", community) ;
  1175. !           found = make_iconname(facedir, community, owner) ;
  1176.             add_record("", owner, "", size) ;
  1177.           }
  1178.         make_pixrect(noicons) ;
  1179.         this = recs ;
  1180.         while (this != NULL)
  1181. --- 252,302 ----
  1182.         text(DISP_ALL, LEFT, printer) ;      /* Output printer name. */
  1183.       }
  1184.     else
  1185. + #endif /*PLP*/
  1186.       {
  1187.         FGETS(nextline, MAXLINE, fp) ;    /* Skip the next line. */
  1188.         while (fgets(nextline, MAXLINE, fp) != NULL)
  1189.           {
  1190. + #ifdef PLP
  1191. +           if ((nextline[0] == '\n')             ||
  1192. +               (EQUAL(nextline, "  work done"))  ||
  1193. +               (EQUAL(nextline, "  processing")) ||
  1194. +               (EQUAL(nextline, "Printer "))     ||
  1195. +               (EQUAL(nextline, "Remote printer "))) continue ;
  1196. +           if ((EQUAL(nextline, "  Printer Error: may need attention!")) ||
  1197. +               (EQUAL(nextline, "Remote connect to "))) /* for the time being */
  1198. +             {
  1199. +               make_pixrect(1) ;                 /* Just the "no paper" icon. */
  1200. +               add_face(DISP_ALL, NOPAPER, "") ; /* Set to "no paper" icon. */
  1201. +               text(DISP_ALL, LEFT, printer) ;   /* Output printer name. */
  1202. +               PCLOSE(fp) ;
  1203. +               show_display() ;
  1204. +               return ;
  1205. +         }
  1206. + #endif /*PLP*/
  1207.             SSCANF(&nextline[7], "%s", owner) ;
  1208. + #ifdef PLP
  1209. +           if (EQUAL(owner, "Owner")) continue ;
  1210. +           SSCANF(&nextline[59], "%d", &size) ;
  1211. + #else
  1212.             SSCANF(&nextline[60], "%d", &size) ;
  1213. + #endif /*PLP*/
  1214.             h_to_c("", community) ;
  1215. !           found = make_iconname(facepath, community, owner) ;
  1216.             add_record("", owner, "", size) ;
  1217.           }
  1218. + #ifdef PLP
  1219. +       if (recs == NULL)
  1220. +         {
  1221. +           make_pixrect(1) ;                    /* Just the "no print" icon. */
  1222. +           add_face(DISP_ALL, NOPRINT, "") ;    /* Set to "no print" icon. */
  1223. +           text(DISP_ALL, LEFT, printer) ;      /* Output printer name. */
  1224. +           PCLOSE(fp) ;
  1225. +           show_display() ;
  1226. +           return ;
  1227. +     }
  1228. + #endif /*PLP*/
  1229.         make_pixrect(noicons) ;
  1230.         this = recs ;
  1231.         while (this != NULL)
  1232. ***************
  1233. *** 319,326 ****
  1234.               EQUAL(user, "NOPRINT") || EQUAL(user, "NOUSERS")))
  1235.           {
  1236.             h_to_c(host, community) ;   /* Turn hostname into community name. */
  1237. !           a_to_u(community, user, realname) ;
  1238. !           found = make_iconname(facedir, community, realname) ;
  1239.           }
  1240.              if (EQUAL(user, "NOMAIL"))  ftype = NOMAIL ;
  1241.         else if (EQUAL(user, "NOPAPER")) ftype = NOPAPER ;
  1242. --- 376,383 ----
  1243.               EQUAL(user, "NOPRINT") || EQUAL(user, "NOUSERS")))
  1244.           {
  1245.             h_to_c(host, community) ;   /* Turn hostname into community name. */
  1246. !           a_to_u(community, user, realcomm, realname) ;
  1247. !           found = make_iconname(facepath, realcomm, realname) ;
  1248.           }
  1249.              if (EQUAL(user, "NOMAIL"))  ftype = NOMAIL ;
  1250.         else if (EQUAL(user, "NOPAPER")) ftype = NOPAPER ;
  1251. ***************
  1252. *** 360,366 ****
  1253.         SSCANF(&nextline[0], "%s", username) ;
  1254.         SSCANF(&nextline[38], "%s", ts) ;
  1255.         h_to_c("", community) ;
  1256. !       found = make_iconname(facedir, community, username) ;
  1257.         add_record("", username, ts, 0) ;
  1258.       }
  1259.     if (!noicons)
  1260. --- 417,423 ----
  1261.         SSCANF(&nextline[0], "%s", username) ;
  1262.         SSCANF(&nextline[38], "%s", ts) ;
  1263.         h_to_c("", community) ;
  1264. !       found = make_iconname(facepath, community, username) ;
  1265.         add_record("", username, ts, 0) ;
  1266.       }
  1267.     if (!noicons)
  1268. ***************
  1269. *** 557,576 ****
  1270.     struct recinfo *crec ;    /* Pointer to current mail record for updating. */
  1271.   
  1272.     h_to_c(face_host, community) ;    /* Turn hostname into community name. */
  1273. !   a_to_u(community, face_user, realname) ;
  1274.     if (mtype == MONNEW)
  1275.       {
  1276.         if (x_face)
  1277.           {
  1278. -           SPRINTF(iconname, "%s/%s/%s/48x48x1",
  1279. -                   strlen(facedir) ? facedir : defdir, community, realname) ;
  1280.             add_face(DISP_ALL, XFACE, iconname) ;
  1281.             if (update) do_face_update(iconname, face_buf) ;
  1282.           }
  1283.         else
  1284.           {
  1285. !           if (!(found = make_iconname(facedir, community, realname)))
  1286. !             add_face(DISP_ALL, NOFACE, (char *) NULL) ;
  1287.             else add_face(DISP_ALL, ORDINARY, iconname) ;
  1288.           }
  1289.   
  1290. --- 614,635 ----
  1291.     struct recinfo *crec ;    /* Pointer to current mail record for updating. */
  1292.   
  1293.     h_to_c(face_host, community) ;    /* Turn hostname into community name. */
  1294. !   a_to_u(community, face_user, realcomm, realname) ;
  1295. !   found = make_iconname (facepath, community, realname) ;
  1296. !   if (x_face && !found)
  1297. !     SPRINTF(iconname, "%s/%s/%s/48x48x1", facepath[0], community, realname) ;
  1298.     if (mtype == MONNEW)
  1299.       {
  1300.         if (x_face)
  1301.           {
  1302.             add_face(DISP_ALL, XFACE, iconname) ;
  1303.             if (update) do_face_update(iconname, face_buf) ;
  1304.           }
  1305.         else
  1306.           {
  1307. !           if (!found) add_face(DISP_ALL, NOFACE, (char *) NULL) ;
  1308.             else add_face(DISP_ALL, ORDINARY, iconname) ;
  1309.           }
  1310.   
  1311. ***************
  1312. *** 584,600 ****
  1313.       }
  1314.     else
  1315.       {
  1316. !       found = make_iconname(facedir, community, realname) ;
  1317. !       if (x_face)
  1318. !         SPRINTF(iconname, "%s/%s/%s/48x48x1",
  1319. !                 strlen(facedir) ? facedir : defdir, community, realname) ;
  1320. !       if ((crec = rec_exists(community, realname)) != NULL)
  1321.           {
  1322.             STRCPY(crec->ts, face_ts) ;
  1323.             if (!crec->total) noicons++ ;
  1324.             crec->total++ ;
  1325.           }
  1326. !       else add_record(community, realname, face_ts, 0) ;
  1327.       }
  1328.     fromc_found = froms_found = x_face = 0 ;  /* Reset for the next message. */
  1329.   }
  1330. --- 643,655 ----
  1331.       }
  1332.     else
  1333.       {
  1334. !       if ((crec = rec_exists(realcomm, realname)) != NULL)
  1335.           {
  1336.             STRCPY(crec->ts, face_ts) ;
  1337.             if (!crec->total) noicons++ ;
  1338.             crec->total++ ;
  1339.           }
  1340. !       else add_record(realcomm, realname, face_ts, 0) ;
  1341.       }
  1342.     fromc_found = froms_found = x_face = 0 ;  /* Reset for the next message. */
  1343.   }
  1344.  
  1345. ------- rec.c -------
  1346. *** /tmp/da09673    Tue Aug 14 07:20:17 1990
  1347. --- rec.c    Wed Aug  8 18:02:52 1990
  1348. ***************
  1349. *** 15,25 ****
  1350.    */
  1351.   
  1352.   #include <stdio.h>
  1353. ! #ifdef SYSV
  1354.   #include <string.h>
  1355.   #else
  1356.   #include <strings.h>
  1357. ! #endif /*SYSV*/
  1358.   #include "faces.h"
  1359.   #include "extern.h"
  1360.   
  1361. --- 15,25 ----
  1362.    */
  1363.   
  1364.   #include <stdio.h>
  1365. ! #ifdef SYSV32 || hpux
  1366.   #include <string.h>
  1367.   #else
  1368.   #include <strings.h>
  1369. ! #endif /* SYSV32 || hpux */
  1370.   #include "faces.h"
  1371.   #include "extern.h"
  1372.   
  1373. ***************
  1374. *** 36,44 ****
  1375.   }
  1376.   
  1377.   
  1378. ! add_alias(crec, username, alias)  /* Add new alias to hostnames' list. */
  1379.   struct comminfo *crec ;
  1380. ! char *username, *alias ;
  1381.   {
  1382.     struct peopinfo *cptemp, *ptemp ;
  1383.   
  1384. --- 36,46 ----
  1385.   }
  1386.   
  1387.   
  1388. ! /* Add new alias to hostnames' list. */
  1389. ! add_alias(crec, username, realcomm, alias)
  1390.   struct comminfo *crec ;
  1391. ! char *username, *realcomm, *alias ;
  1392.   {
  1393.     struct peopinfo *cptemp, *ptemp ;
  1394.   
  1395. ***************
  1396. *** 47,52 ****
  1397. --- 49,56 ----
  1398.     STRCPY(ptemp->alias, alias) ;
  1399.     ptemp->username = (char *) Malloc(strlen(username)+1) ;
  1400.     STRCPY(ptemp->username, username) ;
  1401. +   ptemp->community = (char *) Malloc(strlen(realcomm)+1) ;
  1402. +   STRCPY(ptemp->community, realcomm) ;
  1403.     ptemp->next = NULL ;
  1404.   
  1405.     if (crec->people == NULL) crec->people = ptemp ;
  1406. ***************
  1407. *** 82,87 ****
  1408. --- 86,94 ----
  1409.         mlast->next = temp ;     /* Add record to existing chain. */
  1410.         mlast = temp ;           /* Point to end of chain. */
  1411.       }
  1412. +   IF_DEBUG( FPRINTF(stderr, "add_machine: Added %s ==> %s\n",
  1413. +                     temp->machine, temp->community) ) ;
  1414.   }
  1415.   
  1416.   
  1417. ***************
  1418. *** 141,163 ****
  1419.   }
  1420.   
  1421.   
  1422. ! check_comm(hostname, username, alias)  /* Check community list. */
  1423. ! char *hostname, *username, *alias ;
  1424.   {
  1425.     struct comminfo *ctemp ;
  1426.    
  1427.     ctemp = communities ;      /* Try and find machine record for hostname. */
  1428.     while (ctemp != NULL)
  1429. !     if (!strcmp(ctemp->community, hostname))
  1430.         {  
  1431. !         add_alias(ctemp, username, alias) ;
  1432.           return ;
  1433.         }  
  1434.       else ctemp = ctemp->next ;
  1435.    
  1436.     ctemp = (struct comminfo *) LINT_CAST(Malloc(sizeof(struct comminfo))) ;
  1437. !   ctemp->community = (char *) Malloc(strlen(hostname)+1) ;
  1438. !   STRCPY(ctemp->community, hostname) ; 
  1439.     ctemp->people = NULL ; 
  1440.     ctemp->next = NULL ; 
  1441.    
  1442. --- 148,172 ----
  1443.   }
  1444.   
  1445.   
  1446. ! /* Check community list. */
  1447. ! check_comm(hostname, username, aliascomm, alias)
  1448. ! char *hostname, *username, *aliascomm, *alias ;
  1449.   {
  1450.     struct comminfo *ctemp ;
  1451.    
  1452.     ctemp = communities ;      /* Try and find machine record for hostname. */
  1453.     while (ctemp != NULL)
  1454. !     if (!strcmp(ctemp->community, aliascomm))
  1455.         {  
  1456. !         add_alias(ctemp, username, hostname, alias) ;
  1457.           return ;
  1458.         }  
  1459.       else ctemp = ctemp->next ;
  1460.    
  1461.     ctemp = (struct comminfo *) LINT_CAST(Malloc(sizeof(struct comminfo))) ;
  1462. !   ctemp->community = (char *) Malloc(strlen(aliascomm)+1) ;
  1463. !   STRCPY(ctemp->community, aliascomm) ; 
  1464.     ctemp->people = NULL ; 
  1465.     ctemp->next = NULL ; 
  1466.    
  1467. ***************
  1468. *** 167,173 ****
  1469.         clast->next = ctemp ;   /* Add record to existing chain. */
  1470.         clast = ctemp ;         /* Point to end of chain. */
  1471.       }
  1472. !   add_alias(ctemp, username, alias) ;
  1473.   }
  1474.   
  1475.   
  1476. --- 176,182 ----
  1477.         clast->next = ctemp ;   /* Add record to existing chain. */
  1478.         clast = ctemp ;         /* Point to end of chain. */
  1479.       }
  1480. !   add_alias(ctemp, username, hostname, alias) ;
  1481.   }
  1482.   
  1483.   
  1484. ***************
  1485. *** 175,181 ****
  1486.   
  1487.   garbage_collect()
  1488.   {
  1489. !   struct recinfo *last, *this, *next ;
  1490.   
  1491.     last = NULL ;
  1492.     this = recs ;
  1493. --- 184,190 ----
  1494.   
  1495.   garbage_collect()
  1496.   {
  1497. !   struct recinfo *this, *next ;
  1498.   
  1499.     last = NULL ;
  1500.     this = recs ;
  1501. ***************
  1502. *** 198,242 ****
  1503.   }
  1504.   
  1505.   
  1506.   read_aliases()     /* Setup the hostname aliases subchains. */
  1507.   {
  1508.     char alias[MAXLINE] ;      /* Alias for this community/username. */
  1509.     char hostname[MAXLINE] ;   /* This records' hostname. */
  1510.     char username[MAXLINE] ;   /* This records real username. */
  1511.     char *ptr1, *ptr2 ;
  1512.     FILE *fd ;
  1513.   
  1514. !   if (strlen(facedir)) SPRINTF(peopfile, "%s/PEOPLETAB", facedir) ;
  1515. !   if ((fd = fopen(peopfile, "r")) == NULL)   /* Open people file. */
  1516.       {
  1517. !       if (strlen(facedir))
  1518.           {
  1519. !           SPRINTF(peopfile, "%s/machine.tab", defdir) ;
  1520. !           fd = fopen(peopfile, "r") ;
  1521.           }
  1522. !       if (fd == NULL)
  1523. !         {
  1524. !           FPRINTF(stderr,"%s: cannot open %s\n", progname, peopfile) ;
  1525. !           return ;
  1526. !         }
  1527.       }
  1528. -   while (fgets(nextline, MAXLINE, fd) != NULL)
  1529. -     {
  1530. -       if (nextline[0] == '\n' || nextline[0] == '#') continue ;
  1531. -       ptr1 = index(nextline, '/') ;
  1532. -       if (((int) (ptr1-nextline)) <= 0) continue ;  /* Ignore if no length. */
  1533. -       STRNCPY(hostname, nextline, (int) (ptr1-nextline)) ;
  1534. -       hostname[(int) (ptr1-nextline)] = '\0' ;
  1535. -       ptr2 = index(nextline, '=') ;
  1536. -       if (((int) (ptr2-ptr1-1)) <= 0) continue ;    /* Ignore if no length. */
  1537. -       STRNCPY(alias, ptr1+1, (int) (ptr2-ptr1-1)) ;
  1538. -       alias[(int) (ptr2-ptr1-1)] = '\0' ;
  1539. -       if ((strlen(ptr2)-2) <= 0) continue ;         /* Ignore if no length. */
  1540. -       STRNCPY(username, ptr2+1, strlen(ptr2)-2) ;
  1541. -       username[strlen(ptr2)-2] = '\0' ;
  1542. -       check_comm(hostname, username, alias) ;
  1543. -     }
  1544. -   FCLOSE(fd) ;
  1545.   }
  1546.   
  1547.   
  1548. --- 207,273 ----
  1549.   }
  1550.   
  1551.   
  1552. + #define  MAXTOKENLEN  100
  1553. + static char ptoken[MAXTOKENLEN] ;
  1554. + char *
  1555. + get_token(pntr)
  1556. + char *pntr ;
  1557. + {
  1558. +   int i = 0 ;
  1559. +   while (*pntr=='\t' || *pntr == ' ') pntr++ ;
  1560. +   while ((i < MAXTOKENLEN) && (!strchr("/= \t#",*pntr)))
  1561. +     ptoken[i++] = *(pntr++) ;
  1562. +   while (*pntr=='\t' || *pntr == ' ') pntr++ ;
  1563. +   ptoken[i] = '\0' ;
  1564. +   return(pntr) ;
  1565. + }
  1566.   read_aliases()     /* Setup the hostname aliases subchains. */
  1567.   {
  1568.     char alias[MAXLINE] ;      /* Alias for this community/username. */
  1569. +   char aliascomm[MAXLINE] ;  /* Alias for this community/username. */
  1570.     char hostname[MAXLINE] ;   /* This records' hostname. */
  1571.     char username[MAXLINE] ;   /* This records real username. */
  1572.     char *ptr1, *ptr2 ;
  1573. +   int i ;
  1574.     FILE *fd ;
  1575.   
  1576. !   for (i = 0; facepath[i] != NULL; i++)
  1577.       {
  1578. !       SPRINTF(peopfile, "%s/%s", facepath[i], PEOPLETAB) ;
  1579. !       if ((fd = fopen(peopfile, "r")) == NULL) continue ;
  1580. !       while (fgets(nextline, MAXLINE, fd) != NULL)
  1581.           {
  1582. !           if (nextline[0] == '\n' || nextline[0] == '#') continue ;
  1583. !           nextline[strlen(nextline)-1] = '\0' ;
  1584. !           ptr1 = get_token(nextline) ;
  1585. !           if (!strlen(ptoken) || *ptr1 != '/') continue ;
  1586. !           STRCPY(aliascomm, ptoken) ;
  1587. !           ptr1 = get_token(++ptr1) ;
  1588. !           if (!strlen(ptoken) || *ptr1 != '=') continue ;
  1589. !           STRCPY(alias, ptoken) ;
  1590. !           ptr1 = get_token(++ptr1) ;
  1591. !           if (!strlen(ptoken)) continue ;
  1592. !           if (*ptr1 == '/')
  1593. !             {
  1594. !               STRCPY(hostname, ptoken) ;
  1595. !               ptr1 = get_token(++ptr1) ;
  1596. !               if (!strlen(ptoken)) continue ;
  1597. !               STRCPY(username, ptoken) ;
  1598. !             }
  1599. !           else
  1600. !             {
  1601. !               STRCPY(hostname, aliascomm) ;
  1602. !               STRCPY(username, ptoken) ;
  1603. !             }
  1604. !          check_comm(hostname, username, aliascomm, alias) ;
  1605.           }
  1606. !       FCLOSE(fd) ;
  1607.       }
  1608.   }
  1609.   
  1610.   
  1611. ***************
  1612. *** 245,279 ****
  1613.     char community[MAXLINE] ;   /* This records' community. */
  1614.     char machine[MAXLINE] ;     /* This records' machine name. */
  1615.     char *ptr ;
  1616.     FILE *fd ;
  1617.   
  1618. !   if (strlen(facedir)) SPRINTF(machfile, "%s/MACHINETAB", facedir) ;
  1619. !   if ((fd = fopen(machfile, "r")) == NULL)   /* Open machine file. */
  1620.       {
  1621. !       if (strlen(facedir))
  1622.           {
  1623. !           SPRINTF(machfile, "%s/machine.tab", defdir) ;
  1624. !           fd = fopen(machfile, "r") ;
  1625.           }
  1626. !       if (fd == NULL)
  1627. !         {
  1628. !           FPRINTF(stderr,"%s: cannot open %s\n", progname, machfile) ;
  1629. !           return ;
  1630. !         }
  1631.       }
  1632. -   while (fgets(nextline, MAXLINE, fd) != NULL)
  1633. -     {
  1634. -       if (nextline[0] == '\n' || nextline[0] == '#') continue ;
  1635. -       ptr = index(nextline, '=') ;
  1636. -       if (((int) (ptr-nextline)) <= 0) continue ;  /* Ignore if no length. */
  1637. -       STRNCPY(machine, nextline, (int) (ptr-nextline)) ;
  1638. -       machine[(int) (ptr-nextline)] = '\0' ;
  1639. -       if (strlen(ptr)-2 <= 0) continue ;           /* Ignore if no length. */
  1640. -       STRNCPY(community, ptr+1, strlen(ptr)-2) ;
  1641. -       community[strlen(ptr)-2] = '\0' ;
  1642. -       add_machine(machine, community) ;
  1643. -     }
  1644. -   FCLOSE(fd) ;
  1645.   }
  1646.   
  1647.   
  1648. --- 276,303 ----
  1649.     char community[MAXLINE] ;   /* This records' community. */
  1650.     char machine[MAXLINE] ;     /* This records' machine name. */
  1651.     char *ptr ;
  1652. +   int i ;
  1653.     FILE *fd ;
  1654.   
  1655. !   for (i = 0; facepath[i] != NULL; i++)
  1656.       {
  1657. !       SPRINTF(machfile, "%s/%s", facepath[i], MACHINETAB) ;
  1658. !       if ((fd = fopen(machfile, "r")) == NULL) continue ;
  1659. !       while (fgets(nextline, MAXLINE, fd) != NULL)
  1660.           {
  1661. !           if (nextline[0] == '\n' || nextline[0] == '#') continue ;
  1662. !           nextline[strlen(nextline)-1] = '\0' ;
  1663. !           ptr = get_token(nextline) ;
  1664. !           if (!strlen(ptoken) || *ptr != '=') continue ;
  1665. !           STRCPY(machine, ptoken) ;
  1666. !           ptr = get_token(++ptr) ;
  1667. !           if (!strlen(ptoken)) continue ;
  1668. !           STRCPY(community, ptoken) ;
  1669. !           add_machine(machine, community) ;
  1670.           }
  1671. !       FCLOSE(fd) ;
  1672.       }
  1673.   }
  1674.   
  1675.   
  1676.  
  1677. ------CUT HERE------CUT HERE------CUT HERE------CUT HERE------
  1678.  
  1679. Rich Burridge,          DOMAIN: richb@Aus.Sun.COM
  1680. Sun Microsystems.       ACSNET: richb@sunaus.sun.oz
  1681. PHONE: +61 2 413 2666   UUCP:   {uunet,mcvax,ukc}!munnari!sunaus.oz!richb
  1682.  
  1683.  
  1684.