Annotation of coherent/d/bin/dump/dumpdate.c, revision 1.1

1.1     ! root        1: #include <stdio.h>
        !             2: #include <dumptape.h>
        !             3: 
        !             4: char   *ctime();
        !             5: 
        !             6: struct idates  id;
        !             7: 
        !             8: main(argc, argv)
        !             9: char *argv[];
        !            10: {
        !            11:        register FILE *ddfp;
        !            12:        register char *cp;
        !            13:        register i;
        !            14: 
        !            15:        if ((ddfp = fopen(DDATE, "r")) == NULL) {
        !            16:                fprintf(stderr, "dumpdate: cannot open date file\n");
        !            17:                exit(1);
        !            18:        }
        !            19:        while (fread(&id, sizeof(id), 1, ddfp) == 1) {
        !            20:                if (argc > 1) {
        !            21:                        for (i=1; i<argc; ++i) {
        !            22:                                if (devcmp(id.id_name, argv[i]) == 0)
        !            23:                                        break;
        !            24:                        }
        !            25:                        if (i == argc)
        !            26:                                continue;
        !            27:                }
        !            28:                cp = ctime(&id.id_ddate);
        !            29:                cp[24] = '\0';
        !            30:                printf("Level %d %s %.*s\n", id.id_incno, cp, DIRSIZ,
        !            31:                        id.id_name);
        !            32:        }
        !            33:        exit(0);
        !            34: }
        !            35: 
        !            36: devcmp(p1, p2)
        !            37: char *p1;
        !            38: register char *p2;
        !            39: {
        !            40:        register char *p3;
        !            41:        register c;
        !            42: 
        !            43:        p3 = p2;
        !            44:        while ((c = *p2++) != '\0') {
        !            45:                if (c == '/')
        !            46:                        p3 = p2;
        !            47:        }
        !            48:        return (strncmp(p1, p3, DIRSIZ));
        !            49: }

unix.superglobalmegacorp.com

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