home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume3 / uumail2 / uupath.c < prev   
C/C++ Source or Header  |  1986-11-30  |  1KB  |  57 lines

  1. /*
  2.  * Name: uupath
  3.  *
  4.  * Calls getpath to lookup the usenet path
  5.  *
  6.  * Author: J. Donnelly  3/82
  7.  * $Log:    uupath.c,v $
  8.  * Revision 1.3  85/08/03  01:26:17  UUCP
  9.  * *** empty log message ***
  10.  * 
  11.  * Revision 1.2  85/07/19  17:47:05  UUCP
  12.  * updated to define Debug for compatability with getpath
  13.  * 
  14.  * Revision 1.1  85/07/11  18:35:59  sob
  15.  * Initial revision
  16.  * 
  17.  *
  18.  */
  19.  
  20. #include    "uuconf.h"
  21. bool Debug;
  22.  
  23. static char rcsid[] = "$Header: uupath.c,v 1.3 85/08/03 01:26:17 UUCP Exp $";
  24.  
  25. main (argc, argv) char *argv[];
  26. {
  27.     char    path[PATHSIZ],work[BUFSIZ];
  28.     int     i,
  29.             retval;                    /* value returned from getpath */
  30.  
  31.     if (argc < 2)
  32.     {
  33.     printf ("Usage: uupath sysname1 sysname2 ...\n");
  34.     exit (EX_USAGE);
  35.     }
  36.  
  37.     for (i = 1; i < argc; i++)
  38.     {
  39.     retval = getpath (argv[i], &path[0],DATABASE);        /* lookup usenet path */
  40.     if (retval == EX_NOHOST)
  41.         printf ("Can't find path to %s\n", argv[i]);
  42.  
  43.     else
  44.         if (retval == EX_NOINPUT)
  45.         {
  46.         printf ("Can't open the network map\n");
  47.         exit (EX_TEMPFAIL);
  48.         }
  49.  
  50.         else
  51.         {
  52.         sprintf (&work[0],"Path to %s:  %s\n", argv[i], &path[0]);
  53.             printf(&work[0],"username");
  54.         }
  55.     }
  56. }
  57.