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