Annotation of 43BSDReno/contrib/mh/zotnet/mf/umsift.c, revision 1.1.1.1

1.1       root        1: /* umsift.c - test out uumm */
                      2: 
                      3: #include "mf.h"
                      4: #include <stdio.h>
                      5: 
                      6: /*  */
                      7: 
                      8: /* ARGSUSED */
                      9: 
                     10: main (argc, argv)
                     11: int     argc;
                     12: char  **argv;
                     13: {
                     14:     int     oops = 0;
                     15:     char    sobuf[BUFSIZ];
                     16:     FILE * fp;
                     17: 
                     18:     mts_init (*argv);
                     19:     setbuf (stdout, sobuf);
                     20:     if (argc < 2)
                     21:        sift (stdin);
                     22:     else
                     23:        while (--argc) {
                     24:            if ((fp = fopen (*++argv)) == NULL) {
                     25:                perror (*argv);
                     26:                oops++;
                     27:                continue;
                     28:            }
                     29:            sift (fp);
                     30:            fclose (fp);
                     31:        }
                     32: 
                     33:     exit (oops);
                     34: }
                     35: 
                     36: /*  */
                     37: 
                     38: static  sift (f)
                     39:         FILE * f;
                     40: {
                     41:     switch (uucp2mmdf (fileno (f), fileno (stdout), FALSE)) {
                     42:        case MFOK: 
                     43:            break;
                     44: 
                     45:        case MFPRM: 
                     46:            die ("internal error while filtering UUCP mail");
                     47: 
                     48:        case MFSIO: 
                     49:            die ("no free file pointers -- you lose");
                     50: 
                     51:        case MFERR: 
                     52:            die ("i/o error while filtering UUCP mail");
                     53: 
                     54:        case MFROM: 
                     55:        case MFHDR: 
                     56:        case MFTXT: 
                     57:            fprintf (stderr, "UUCP mail was in bad format, patched...\n");
                     58:            break;
                     59:     }
                     60: }
                     61: 
                     62: /*  */
                     63: 
                     64: /* VARARGS */
                     65: 
                     66: die (fmt, a, b, c, d)
                     67: char   *fmt,
                     68:        *a,
                     69:        *b,
                     70:        *c,
                     71:        *d;
                     72: {
                     73:     fflush (stdout);
                     74: 
                     75:     fprintf (stderr, fmt, a, b, c, d);
                     76:     putc ('\n', stderr);
                     77: 
                     78:     exit (-1);
                     79: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.