Annotation of researchv9/cmd/strip/stab.c, revision 1.1.1.1

1.1       root        1: #include "strip.h"
                      2: 
                      3: main(argc, argv)
                      4: int argc; char **argv;
                      5: {
                      6:        register Adotout *a;
                      7:        register struct nlist *sym;
                      8: 
                      9:        prognam = *argv;
                     10: 
                     11:        if (argc < 2) {
                     12:                fprintf(stderr, "Usage: %s file.out...\n", prognam);
                     13:                exit(1);
                     14:        }
                     15: 
                     16:        while (--argc > 0 && (*++argv)[0] == '-' && (*argv)[1])
                     17:                switch ((*argv)[1]) {
                     18:                case 'D':
                     19:                        ++strdebug; break;
                     20:                default:
                     21:                        fatal("unknown option " ,*argv);
                     22:                }
                     23: 
                     24:        while (--argc >= 0) {
                     25:                if ((a = rdout(*argv++, 1)) == 0)
                     26:                        continue;
                     27:                prtout(a);
                     28:                for (sym=a->symtab; sym<a->symend; sym++) {
                     29:                        if (sym->n_un.n_name)
                     30:                                sym->n_un.n_name += (int)a->strtab;
                     31:                        prtsym(stdout,sym);
                     32:                }
                     33:                freeout(a);
                     34:        }
                     35:        exit(0);
                     36: }
                     37: 
                     38: fatal(m1, m2)
                     39: char *m1, *m2;
                     40: {
                     41:        if (m1)
                     42:                fprintf(stderr,"%s: %s%s\n", prognam, m1, m2);
                     43:        exit(1);
                     44: }

unix.superglobalmegacorp.com

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