Annotation of coherent/d/bin/banner.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * banner.c
        !             3:  * Print arguments (or stdin) in large type.
        !             4:  * td 80.09.24
        !             5:  */
        !             6: 
        !             7: #include <stdio.h>
        !             8: 
        !             9: char font[96][9]={
        !            10: 0000,0000,0000,0000,0000,0000,0000,0000,0000,  /* sp */
        !            11: 0010,0010,0010,0010,0010,0000,0010,0000,0000,  /* ! */
        !            12: 0024,0024,0024,0000,0000,0000,0000,0000,0000,  /* " */
        !            13: 0024,0024,0076,0024,0076,0024,0024,0000,0000,  /* # */
        !            14: 0010,0036,0050,0034,0012,0074,0010,0000,0000,  /* $ */
        !            15: 0060,0062,0004,0010,0020,0046,0006,0000,0000,  /* % */
        !            16: 0010,0024,0024,0030,0052,0044,0032,0000,0000,  /* & */
        !            17: 0010,0010,0020,0000,0000,0000,0000,0000,0000,  /* ' */
        !            18: 0004,0010,0020,0020,0020,0010,0004,0000,0000,  /* ( */
        !            19: 0020,0010,0004,0004,0004,0010,0020,0000,0000,  /* ) */
        !            20: 0000,0010,0052,0034,0052,0010,0000,0000,0000,  /* * */
        !            21: 0000,0010,0010,0076,0010,0010,0000,0000,0000,  /* + */
        !            22: 0000,0000,0000,0000,0000,0030,0030,0010,0020,  /* , */
        !            23: 0000,0000,0000,0076,0000,0000,0000,0000,0000,  /* - */
        !            24: 0000,0000,0000,0000,0000,0030,0030,0000,0000,  /* . */
        !            25: 0001,0002,0004,0010,0020,0040,0100,0000,0000,  /* / */
        !            26: 0034,0042,0046,0052,0062,0042,0034,0000,0000,  /* 0 */
        !            27: 0010,0030,0010,0010,0010,0010,0034,0000,0000,  /* 1 */
        !            28: 0034,0042,0002,0004,0010,0020,0076,0000,0000,  /* 2 */
        !            29: 0076,0004,0010,0004,0002,0042,0034,0000,0000,  /* 3 */
        !            30: 0004,0014,0024,0044,0076,0004,0004,0000,0000,  /* 4 */
        !            31: 0076,0040,0074,0002,0002,0042,0034,0000,0000,  /* 5 */
        !            32: 0014,0020,0040,0074,0042,0042,0034,0000,0000,  /* 6 */
        !            33: 0076,0002,0004,0010,0020,0020,0020,0000,0000,  /* 7 */
        !            34: 0034,0042,0042,0034,0042,0042,0034,0000,0000,  /* 8 */
        !            35: 0034,0042,0042,0036,0002,0004,0030,0000,0000,  /* 9 */
        !            36: 0000,0030,0030,0000,0030,0030,0000,0000,0000,  /* : */
        !            37: 0000,0030,0030,0000,0030,0030,0010,0020,0000,  /* ; */
        !            38: 0002,0004,0010,0020,0010,0004,0002,0000,0000,  /* < */
        !            39: 0000,0000,0076,0000,0076,0000,0000,0000,0000,  /* = */
        !            40: 0040,0020,0010,0004,0010,0020,0040,0000,0000,  /* > */
        !            41: 0034,0042,0002,0004,0010,0000,0010,0000,0000,  /* ? */
        !            42: 0014,0022,0056,0052,0056,0040,0036,0000,0000,  /* @ */
        !            43: 0034,0042,0042,0076,0042,0042,0042,0000,0000,  /* A */
        !            44: 0074,0042,0042,0074,0042,0042,0074,0000,0000,  /* B */
        !            45: 0034,0042,0040,0040,0040,0042,0034,0000,0000,  /* C */
        !            46: 0070,0044,0042,0042,0042,0044,0070,0000,0000,  /* D */
        !            47: 0076,0040,0040,0074,0040,0040,0076,0000,0000,  /* E */
        !            48: 0076,0040,0040,0074,0040,0040,0040,0000,0000,  /* F */
        !            49: 0036,0040,0040,0046,0042,0042,0036,0000,0000,  /* G */
        !            50: 0042,0042,0042,0076,0042,0042,0042,0000,0000,  /* H */
        !            51: 0034,0010,0010,0010,0010,0010,0034,0000,0000,  /* I */
        !            52: 0034,0010,0010,0010,0010,0050,0020,0000,0000,  /* J */
        !            53: 0042,0044,0050,0060,0050,0044,0042,0000,0000,  /* K */
        !            54: 0040,0040,0040,0040,0040,0040,0076,0000,0000,  /* L */
        !            55: 0042,0066,0052,0052,0042,0042,0042,0000,0000,  /* M */
        !            56: 0042,0042,0062,0052,0046,0042,0042,0000,0000,  /* N */
        !            57: 0034,0042,0042,0042,0042,0042,0034,0000,0000,  /* O */
        !            58: 0074,0042,0042,0074,0040,0040,0040,0000,0000,  /* P */
        !            59: 0034,0042,0042,0042,0052,0044,0032,0000,0000,  /* Q */
        !            60: 0074,0042,0042,0074,0050,0044,0042,0000,0000,  /* R */
        !            61: 0034,0042,0040,0034,0002,0042,0034,0000,0000,  /* S */
        !            62: 0076,0010,0010,0010,0010,0010,0010,0000,0000,  /* T */
        !            63: 0042,0042,0042,0042,0042,0042,0034,0000,0000,  /* U */
        !            64: 0042,0042,0042,0024,0024,0010,0010,0000,0000,  /* V */
        !            65: 0042,0042,0042,0052,0052,0052,0024,0000,0000,  /* W */
        !            66: 0042,0042,0024,0010,0024,0042,0042,0000,0000,  /* X */
        !            67: 0042,0042,0024,0010,0010,0010,0010,0000,0000,  /* Y */
        !            68: 0076,0002,0004,0010,0020,0040,0076,0000,0000,  /* Z */
        !            69: 0034,0020,0020,0020,0020,0020,0034,0000,0000,  /* [ */
        !            70: 0100,0040,0020,0010,0004,0002,0001,0000,0000,  /* \ */
        !            71: 0034,0004,0004,0004,0004,0004,0034,0000,0000,  /* ] */
        !            72: 0010,0024,0042,0000,0000,0000,0000,0000,0000,  /* ^ */
        !            73: 0000,0000,0000,0000,0000,0000,0076,0000,0000,  /* _ */
        !            74: 0010,0010,0004,0000,0000,0000,0000,0000,0000,  /* ` */
        !            75: 0000,0000,0034,0002,0036,0042,0036,0000,0000,  /* a */
        !            76: 0040,0040,0074,0042,0042,0042,0074,0000,0000,  /* b */
        !            77: 0000,0000,0030,0044,0040,0044,0030,0000,0000,  /* c */
        !            78: 0002,0002,0036,0042,0042,0042,0036,0000,0000,  /* d */
        !            79: 0000,0000,0034,0042,0076,0040,0034,0000,0000,  /* e */
        !            80: 0014,0022,0070,0020,0020,0020,0020,0000,0000,  /* f */
        !            81: 0000,0000,0032,0046,0042,0046,0032,0002,0034,  /* g */
        !            82: 0040,0040,0074,0042,0042,0042,0042,0000,0000,  /* h */
        !            83: 0010,0000,0030,0010,0010,0010,0034,0000,0000,  /* i */
        !            84: 0004,0000,0004,0004,0004,0004,0004,0044,0030,  /* j */
        !            85: 0040,0040,0044,0050,0064,0042,0042,0000,0000,  /* k */
        !            86: 0030,0010,0010,0010,0010,0010,0034,0000,0000,  /* l */
        !            87: 0000,0000,0064,0052,0052,0052,0052,0000,0000,  /* m */
        !            88: 0000,0000,0074,0042,0042,0042,0042,0000,0000,  /* n */
        !            89: 0000,0000,0034,0042,0042,0042,0034,0000,0000,  /* o */
        !            90: 0000,0000,0054,0062,0042,0062,0054,0040,0040,  /* p */
        !            91: 0000,0000,0032,0046,0042,0046,0032,0002,0002,  /* q */
        !            92: 0000,0000,0054,0062,0040,0040,0040,0000,0000,  /* r */
        !            93: 0000,0000,0036,0040,0034,0002,0074,0000,0000,  /* s */
        !            94: 0020,0020,0070,0020,0020,0022,0014,0000,0000,  /* t */
        !            95: 0000,0000,0042,0042,0042,0046,0032,0000,0000,  /* u */
        !            96: 0000,0000,0042,0042,0042,0024,0010,0000,0000,  /* v */
        !            97: 0000,0000,0042,0042,0052,0052,0024,0000,0000,  /* w */
        !            98: 0000,0000,0042,0024,0010,0024,0042,0000,0000,  /* x */
        !            99: 0000,0000,0042,0042,0042,0046,0032,0002,0034,  /* y */
        !           100: 0000,0000,0076,0004,0010,0020,0076,0000,0000,  /* z */
        !           101: 0014,0020,0020,0040,0020,0020,0014,0000,0000,  /* { */
        !           102: 0010,0010,0010,0000,0010,0010,0010,0000,0000,  /* | */
        !           103: 0030,0004,0004,0002,0004,0004,0030,0000,0000,  /* } */
        !           104: 0020,0052,0004,0000,0000,0000,0000,0000,0000,  /* ~ */
        !           105: 0177,0177,0177,0177,0177,0177,0177,0177,0177   /* del */
        !           106: };
        !           107: 
        !           108: char line[512];
        !           109: 
        !           110: main(argc, argv) int argc; char *argv[];
        !           111: {
        !           112:        register i;
        !           113: 
        !           114:        if(argc>1) for(i=1;i!=argc;i++){
        !           115:                if(i!=1)
        !           116:                        putchar('\n');
        !           117:                banner(argv[i]);
        !           118:        }
        !           119:        else while(gets(line)!=NULL){
        !           120:                putchar('\n');
        !           121:                banner(line);
        !           122:        }
        !           123:        exit(0);
        !           124: }
        !           125: 
        !           126: banner(line) char *line;
        !           127: {
        !           128:        register i, j;
        !           129:        register char *s;
        !           130: 
        !           131:        for(i=0;i!=9;i++){
        !           132:                for(s=line;*s;s++) for(j=0200;j!=0;j>>=1)
        !           133:                        if(' '<=*s && *s<=0177 && font[*s-' '][i]&j)
        !           134:                                putchar('x');
        !           135:                        else
        !           136:                                putchar(' ');
        !           137:                putchar('\n');
        !           138:        }
        !           139: }
        !           140: 
        !           141: /* end of banner.c */

unix.superglobalmegacorp.com

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