home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume4 / uumail3 / part1 / address.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-11-30  |  1.2 KB  |  69 lines

  1. /*
  2.  * address - run opath to see what a translated RFC822 address will come
  3.  * out as.
  4.  *
  5.  * By E. Roskos 1/16/85
  6.  * $Log:    address.c,v $
  7.  * Revision 3.0  86/03/14  12:04:19  sob
  8.  * Release of 3/15/86 --- 3rd Release
  9.  * 
  10.  * Revision 1.4  85/12/26  15:47:45  sob
  11.  * Added modifications suggested by terry%owl@rand-unix.ARPA
  12.  * 
  13.  * Revision 1.3  85/11/24  14:50:01  sob
  14.  * Added corrections provided by regina!mark
  15.  * 
  16.  * Revision 1.2  85/09/16  18:31:53  sob
  17.  * Added DEBUG flag
  18.  * 
  19.  * Revision 1.1  85/09/16  17:50:24  sob
  20.  * Initial revision
  21.  * 
  22.  */
  23. #define _DEFINE
  24. #include "uuconf.h"
  25.  
  26. static char rcsid[] = "$Header: address.c,v 3.0 86/03/14 12:04:19 sob RELEASE_3 $";
  27.  
  28. EXTERN char *paths;
  29. char *opath(), *oupath();
  30. int Debug;
  31.  
  32. main(argc,argv)
  33. int argc;
  34. char **argv;
  35. {
  36. char *p;
  37. int uswitch;
  38.  
  39. paths = DATABASE;
  40. ConfFile=CONFIGFILE;
  41.  
  42.     if (argc < 2)
  43.     {
  44.         fprintf(stderr,"usage: %s rfcaddress [...]\n",
  45.             argv[0]);
  46.         exit(1);
  47.     }
  48.  
  49.     while (--argc)
  50.     {
  51.         p = *++argv;
  52.         if (*p=='-')
  53.         {
  54.             switch(*++p)
  55.             {
  56.             case 'u': uswitch++;
  57.                   continue;
  58.             case 'd': Debug++;
  59.                       continue;
  60.             default:  printf("unknown switch: %c\n",*p);
  61.                   continue;
  62.             }
  63.         }
  64.         printf("%s: %s\n",p,uswitch?oupath(p):opath(p));
  65.     }
  66.  
  67.     exit(0);
  68. }
  69.