Annotation of researchv10no/ipc/mgrs/tpcmgr/main.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  *     Generic dialer routine.  Usage:
                      3:  *             dialer mount-pt [unit]
                      4:  */
                      5: #include <stdio.h>
                      6: #include <ipc.h>
                      7: 
                      8: /* export */
                      9: char *av0;
                     10: int debug;
                     11: 
                     12: /* cheap foiegn imports */
                     13: extern void dodialout();
                     14: 
                     15: usage(name)
                     16: {
                     17:        fprintf(stderr, "usage: %s [-m mount-pt]\n", name);
                     18:        exit(1);
                     19: }
                     20: 
                     21: main(ac, av)
                     22:        int ac;
                     23:        char *av[];
                     24: {
                     25:        char *mtpt="tpc", *cp;
                     26:        int ai;
                     27: 
                     28:        av0 = av[0];
                     29:        chdir("/cs");
                     30:        for (ai=1; ai<ac; ai++) {
                     31:                if (av[ai][0] == '-')
                     32:                        for (cp=&av[ai][1]; *cp; cp++) {
                     33:                                switch(*cp) {
                     34:                                case 'd':
                     35:                                        debug = 1;
                     36:                                        break;
                     37:                                case 'm':
                     38:                                        if (ai+1>=ac || *cp!='m')
                     39:                                                usage(av0);
                     40:                                        mtpt = av[++ai];
                     41:                                        break;
                     42:                                default:
                     43:                                        usage(av0);
                     44:                                }
                     45:                        }
                     46:                else
                     47:                        usage(av[0]);
                     48:        }
                     49:        if (!debug)
                     50:                detach(mtpt);
                     51:        for(;;)
                     52:                dodialout(mtpt);
                     53: }

unix.superglobalmegacorp.com

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