home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume3 / uumail2 / address.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-11-30  |  1.0 KB  |  64 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 1.3  85/11/24  14:50:01  sob
  8.  * Added corrections provided by regina!mark
  9.  * 
  10.  * Revision 1.2  85/09/16  18:31:53  sob
  11.  * Added DEBUG flag
  12.  * 
  13.  * Revision 1.1  85/09/16  17:50:24  sob
  14.  * Initial revision
  15.  * 
  16.  */
  17. #define _DEFINE
  18. #include "uuconf.h"
  19.  
  20. static char rcsid[] = "$Header: address.c,v 1.3 85/11/24 14:50:01 sob Exp $";
  21.  
  22. EXTERN char *paths;
  23. char *opath();
  24. int Debug;
  25.  
  26. main(argc,argv)
  27. int argc;
  28. char **argv;
  29. {
  30. char *p;
  31. int uswitch;
  32.  
  33. paths = DATABASE;
  34. ConfFile=CONFIGFILE;
  35.  
  36.     if (argc < 2)
  37.     {
  38.         fprintf(stderr,"usage: %s rfcaddress [...]\n",
  39.             argv[0]);
  40.         exit(1);
  41.     }
  42.  
  43.     while (--argc)
  44.     {
  45.         p = *++argv;
  46.         if (*p=='-')
  47.         {
  48.             switch(*++p)
  49.             {
  50.             case 'u': uswitch++;
  51.                   continue;
  52.             case 'd': Debug++;
  53.                       continue;
  54.             default:  printf("unknown switch: %c\n",*p);
  55.                   continue;
  56.             }
  57.             continue;
  58.         }
  59.         printf("%s: %s\n",p,uswitch?oupath(p):opath(p));
  60.     }
  61.  
  62.     exit(0);
  63. }
  64.