Annotation of coherent/b/etc/Build_401/mkserial.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  * mkserial.c
                      3:  * 4/24/90
                      4:  * Calculate encrypted serial numbers and print to stdout.
                      5:  */
                      6: 
                      7: #include       <stdio.h>
                      8: #include       "serialno.h"
                      9: 
                     10: void   usage();
                     11: 
                     12: main(argc, argv) int argc; char *argv[];
                     13: {
                     14:        char    c;
                     15:        register int i, finish, start, total;
                     16: 
                     17:        if (argc != 4)
                     18:                usage();
                     19:        if ((c = atoi(argv[1])) < 1 || c > VERSIONS) {
                     20:                fprintf(stderr, "mkserial: bad version \"%s\"\n", argv[1]);     
                     21:                exit(1);
                     22:        }
                     23:        else if ((start = atoi(argv[2])) < 1) {
                     24:                fprintf(stderr, "mkserial: bad start \"%s\"\n", argv[2]);       
                     25:                exit(1);
                     26:        }
                     27:        else if ((total = atoi(argv[3])) < 1) {
                     28:                fprintf(stderr, "mkserial: bad count \"%s\"\n", argv[3]);       
                     29:                exit(1);
                     30:        }
                     31: 
                     32:        finish = start + total;
                     33:        --c;
                     34:        for (i = start; i < finish; i ++)
                     35:                printf("%1d%03d%05d\n", c + 1,
                     36:                        magic1[c] ^ (i % magic2[c]), i ^ magic3[c]);
                     37:        exit(0);
                     38: }
                     39: 
                     40: /*
                     41:  * Print usage message and die.
                     42:  */
                     43: void 
                     44: usage()
                     45: {
                     46:        fprintf(stderr, "Usage: mkserial version start count\n");
                     47:        exit(1);
                     48: }

unix.superglobalmegacorp.com

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