Annotation of coherent/d/bin/lpr/lpd2.c, revision 1.1.1.1

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

unix.superglobalmegacorp.com

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