1 /*- 2 * SPDX-License-Identifier: BSD-3-Clause 3 * 4 * Copyright (c) 1983, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 3. Neither the name of the University nor the names of its contributors 16 * may be used to endorse or promote products derived from this software 17 * without specific prior written permission. 18 * 19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 */ 31 32 #if 0 33 #ifndef lint 34 static char sccsid[] = "@(#)lpdchar.c 8.1 (Berkeley) 6/6/93"; 35 #endif /* not lint */ 36 #endif 37 38 #include "lp.cdefs.h" /* A cross-platform version of <sys/cdefs.h> */ 39 /* 40 * Character set for line printer daemon 41 */ 42 #include "lp.local.h" 43 #include "extern.h" 44 45 #define c_______ 0 46 #define c______1 01 47 #define c_____1_ 02 48 #define c____1__ 04 49 #define c____11_ 06 50 #define c___1___ 010 51 #define c___1__1 011 52 #define c___1_1_ 012 53 #define c___11__ 014 54 #define c__1____ 020 55 #define c__1__1_ 022 56 #define c__1_1__ 024 57 #define c__11___ 030 58 #define c__111__ 034 59 #define c__111_1 035 60 #define c__1111_ 036 61 #define c__11111 037 62 #define c_1_____ 040 63 #define c_1____1 041 64 #define c_1___1_ 042 65 #define c_1__1__ 044 66 #define c_1_1___ 050 67 #define c_1_1__1 051 68 #define c_1_1_1_ 052 69 #define c_11____ 060 70 #define c_11_11_ 066 71 #define c_111___ 070 72 #define c_111__1 071 73 #define c_111_1_ 072 74 #define c_1111__ 074 75 #define c_1111_1 075 76 #define c_11111_ 076 77 #define c_111111 077 78 #define c1______ 0100 79 #define c1_____1 0101 80 #define c1____1_ 0102 81 #define c1____11 0103 82 #define c1___1__ 0104 83 #define c1___1_1 0105 84 #define c1___11_ 0106 85 #define c1__1___ 0110 86 #define c1__1__1 0111 87 #define c1__11_1 0115 88 #define c1__1111 0117 89 #define c1_1____ 0120 90 #define c1_1___1 0121 91 #define c1_1_1_1 0125 92 #define c1_1_11_ 0126 93 #define c1_111__ 0134 94 #define c1_1111_ 0136 95 #define c11____1 0141 96 #define c11___1_ 0142 97 #define c11___11 0143 98 #define c11_1___ 0150 99 #define c11_1__1 0151 100 #define c111_11_ 0166 101 #define c1111___ 0170 102 #define c11111__ 0174 103 #define c111111_ 0176 104 #define c1111111 0177 105 106 char scnkey[][HEIGHT] = /* this is relatively easy to modify */ 107 /* just look: */ 108 { 109 { c_______, 110 c_______, 111 c_______, 112 c_______, 113 c_______, 114 c_______, 115 c_______, 116 c_______, 117 c_______ }, /* */ 118 119 { c__11___, 120 c__11___, 121 c__11___, 122 c__11___, 123 c__11___, 124 c_______, 125 c_______, 126 c__11___, 127 c__11___ }, /* ! */ 128 129 { c_1__1__, 130 c_1__1__, 131 c_______, 132 c_______, 133 c_______, 134 c_______, 135 c_______, 136 c_______, 137 c_______ }, /* " */ 138 139 { c_______, 140 c__1_1__, 141 c__1_1__, 142 c1111111, 143 c__1_1__, 144 c1111111, 145 c__1_1__, 146 c__1_1__, 147 c_______ }, /* # */ 148 149 { c___1___, 150 c_11111_, 151 c1__1__1, 152 c1__1___, 153 c_11111_, 154 c___1__1, 155 c1__1__1, 156 c_11111_, 157 c___1___ }, /* $ */ 158 159 { c_1_____, 160 c1_1___1, 161 c_1___1_, 162 c____1__, 163 c___1___, 164 c__1____, 165 c_1___1_, 166 c1___1_1, 167 c_____1_ }, /* % */ 168 169 { c_11____, 170 c1__1___, 171 c1___1__, 172 c_1_1___, 173 c__1____, 174 c_1_1__1, 175 c1___11_, 176 c1___11_, 177 c_111__1 }, /* & */ 178 179 { c___11__, 180 c___11__, 181 c___1___, 182 c__1____, 183 c_______, 184 c_______, 185 c_______, 186 c_______, 187 c_______ }, /* ' */ 188 189 { c____1__, 190 c___1___, 191 c__1____, 192 c__1____, 193 c__1____, 194 c__1____, 195 c__1____, 196 c___1___, 197 c____1__ }, /* ( */ 198 199 { c__1____, 200 c___1___, 201 c____1__, 202 c____1__, 203 c____1__, 204 c____1__, 205 c____1__, 206 c___1___, 207 c__1____ }, /* ) */ 208 209 { c_______, 210 c___1___, 211 c1__1__1, 212 c_1_1_1_, 213 c__111__, 214 c_1_1_1_, 215 c1__1__1, 216 c___1___, 217 c_______ }, /* * */ 218 219 { c_______, 220 c___1___, 221 c___1___, 222 c___1___, 223 c1111111, 224 c___1___, 225 c___1___, 226 c___1___, 227 c_______ }, /* + */ 228 229 { c_______, 230 c_______, 231 c_______, 232 c_______, 233 c__11___, 234 c__11___, 235 c__1____, 236 c_1_____, 237 c_______ }, /* , */ 238 239 { c_______, 240 c_______, 241 c_______, 242 c_______, 243 c1111111, 244 c_______, 245 c_______, 246 c_______, 247 c_______ }, /* - */ 248 249 { c_______, 250 c_______, 251 c_______, 252 c_______, 253 c_______, 254 c_______, 255 c_______, 256 c__11___, 257 c__11___ }, /* . */ 258 259 { c_______, 260 c______1, 261 c_____1_, 262 c____1__, 263 c___1___, 264 c__1____, 265 c_1_____, 266 c1______, 267 c_______ }, /* / */ 268 269 { c_11111_, 270 c1_____1, 271 c1____11, 272 c1___1_1, 273 c1__1__1, 274 c1_1___1, 275 c11____1, 276 c1_____1, 277 c_11111_ }, /* 0 */ 278 279 { c___1___, 280 c__11___, 281 c_1_1___, 282 c___1___, 283 c___1___, 284 c___1___, 285 c___1___, 286 c___1___, 287 c_11111_ }, /* 1 */ 288 289 { c_11111_, 290 c1_____1, 291 c______1, 292 c_____1_, 293 c__111__, 294 c_1_____, 295 c1______, 296 c1______, 297 c1111111 }, /* 2 */ 298 299 { c_11111_, 300 c1_____1, 301 c______1, 302 c______1, 303 c__1111_, 304 c______1, 305 c______1, 306 c1_____1, 307 c_11111_ }, /* 3 */ 308 309 { c_____1_, 310 c____11_, 311 c___1_1_, 312 c__1__1_, 313 c_1___1_, 314 c1____1_, 315 c1111111, 316 c_____1_, 317 c_____1_ }, /* 4 */ 318 319 { c1111111, 320 c1______, 321 c1______, 322 c11111__, 323 c_____1_, 324 c______1, 325 c______1, 326 c1____1_, 327 c_1111__ }, /* 5 */ 328 329 { c__1111_, 330 c_1_____, 331 c1______, 332 c1______, 333 c1_1111_, 334 c11____1, 335 c1_____1, 336 c1_____1, 337 c_11111_ }, /* 6 */ 338 339 { c1111111, 340 c1_____1, 341 c_____1_, 342 c____1__, 343 c___1___, 344 c__1____, 345 c__1____, 346 c__1____, 347 c__1____ }, /* 7 */ 348 349 { c_11111_, 350 c1_____1, 351 c1_____1, 352 c1_____1, 353 c_11111_, 354 c1_____1, 355 c1_____1, 356 c1_____1, 357 c_11111_ }, /* 8 */ 358 359 { c_11111_, 360 c1_____1, 361 c1_____1, 362 c1_____1, 363 c_111111, 364 c______1, 365 c______1, 366 c1_____1, 367 c_1111__ }, /* 9 */ 368 369 { c_______, 370 c_______, 371 c_______, 372 c__11___, 373 c__11___, 374 c_______, 375 c_______, 376 c__11___, 377 c__11___ }, /* : */ 378 379 380 { c__11___, 381 c__11___, 382 c_______, 383 c_______, 384 c__11___, 385 c__11___, 386 c__1____, 387 c_1_____, 388 c_______ }, /* ; */ 389 390 { c____1__, 391 c___1___, 392 c__1____, 393 c_1_____, 394 c1______, 395 c_1_____, 396 c__1____, 397 c___1___, 398 c____1__ }, /* < */ 399 400 { c_______, 401 c_______, 402 c_______, 403 c1111111, 404 c_______, 405 c1111111, 406 c_______, 407 c_______, 408 c_______ }, /* = */ 409 410 { c__1____, 411 c___1___, 412 c____1__, 413 c_____1_, 414 c______1, 415 c_____1_, 416 c____1__, 417 c___1___, 418 c__1____ }, /* > */ 419 420 { c__1111_, 421 c_1____1, 422 c_1____1, 423 c______1, 424 c____11_, 425 c___1___, 426 c___1___, 427 c_______, 428 c___1___ }, /* ? */ 429 430 { c__1111_, 431 c_1____1, 432 c1__11_1, 433 c1_1_1_1, 434 c1_1_1_1, 435 c1_1111_, 436 c1______, 437 c_1____1, 438 c__1111_ }, /* @ */ 439 440 { c__111__, 441 c_1___1_, 442 c1_____1, 443 c1_____1, 444 c1111111, 445 c1_____1, 446 c1_____1, 447 c1_____1, 448 c1_____1 }, /* A */ 449 450 { c111111_, 451 c_1____1, 452 c_1____1, 453 c_1____1, 454 c_11111_, 455 c_1____1, 456 c_1____1, 457 c_1____1, 458 c111111_ }, /* B */ 459 460 { c__1111_, 461 c_1____1, 462 c1______, 463 c1______, 464 c1______, 465 c1______, 466 c1______, 467 c_1____1, 468 c__1111_ }, /* C */ 469 470 { c11111__, 471 c_1___1_, 472 c_1____1, 473 c_1____1, 474 c_1____1, 475 c_1____1, 476 c_1____1, 477 c_1___1_, 478 c11111__ }, /* D */ 479 480 { c1111111, 481 c1______, 482 c1______, 483 c1______, 484 c111111_, 485 c1______, 486 c1______, 487 c1______, 488 c1111111 }, /* E */ 489 490 { c1111111, 491 c1______, 492 c1______, 493 c1______, 494 c111111_, 495 c1______, 496 c1______, 497 c1______, 498 c1______ }, /* F */ 499 500 { c__1111_, 501 c_1____1, 502 c1______, 503 c1______, 504 c1______, 505 c1__1111, 506 c1_____1, 507 c_1____1, 508 c__1111_ }, /* G */ 509 510 { c1_____1, 511 c1_____1, 512 c1_____1, 513 c1_____1, 514 c1111111, 515 c1_____1, 516 c1_____1, 517 c1_____1, 518 c1_____1 }, /* H */ 519 520 { c_11111_, 521 c___1___, 522 c___1___, 523 c___1___, 524 c___1___, 525 c___1___, 526 c___1___, 527 c___1___, 528 c_11111_ }, /* I */ 529 530 { c__11111, 531 c____1__, 532 c____1__, 533 c____1__, 534 c____1__, 535 c____1__, 536 c____1__, 537 c1___1__, 538 c_111___ }, /* J */ 539 540 { c1_____1, 541 c1____1_, 542 c1___1__, 543 c1__1___, 544 c1_1____, 545 c11_1___, 546 c1___1__, 547 c1____1_, 548 c1_____1 }, /* K */ 549 550 { c1______, 551 c1______, 552 c1______, 553 c1______, 554 c1______, 555 c1______, 556 c1______, 557 c1______, 558 c1111111 }, /* L */ 559 560 { c1_____1, 561 c11___11, 562 c1_1_1_1, 563 c1__1__1, 564 c1_____1, 565 c1_____1, 566 c1_____1, 567 c1_____1, 568 c1_____1 }, /* M */ 569 570 { c1_____1, 571 c11____1, 572 c1_1___1, 573 c1__1__1, 574 c1___1_1, 575 c1____11, 576 c1_____1, 577 c1_____1, 578 c1_____1 }, /* N */ 579 580 { c__111__, 581 c_1___1_, 582 c1_____1, 583 c1_____1, 584 c1_____1, 585 c1_____1, 586 c1_____1, 587 c_1___1_, 588 c__111__ }, /* O */ 589 590 { c111111_, 591 c1_____1, 592 c1_____1, 593 c1_____1, 594 c111111_, 595 c1______, 596 c1______, 597 c1______, 598 c1______ }, /* P */ 599 600 { c__111__, 601 c_1___1_, 602 c1_____1, 603 c1_____1, 604 c1_____1, 605 c1__1__1, 606 c1___1_1, 607 c_1___1_, 608 c__111_1 }, /* Q */ 609 610 { c111111_, 611 c1_____1, 612 c1_____1, 613 c1_____1, 614 c111111_, 615 c1__1___, 616 c1___1__, 617 c1____1_, 618 c1_____1 }, /* R */ 619 620 { c_11111_, 621 c1_____1, 622 c1______, 623 c1______, 624 c_11111_, 625 c______1, 626 c______1, 627 c1_____1, 628 c_11111_ }, /* S */ 629 630 { c1111111, 631 c___1___, 632 c___1___, 633 c___1___, 634 c___1___, 635 c___1___, 636 c___1___, 637 c___1___, 638 c___1___ }, /* T */ 639 640 { c1_____1, 641 c1_____1, 642 c1_____1, 643 c1_____1, 644 c1_____1, 645 c1_____1, 646 c1_____1, 647 c1_____1, 648 c_11111_ }, /* U */ 649 650 { c1_____1, 651 c1_____1, 652 c1_____1, 653 c_1___1_, 654 c_1___1_, 655 c__1_1__, 656 c__1_1__, 657 c___1___, 658 c___1___ }, /* V */ 659 660 { c1_____1, 661 c1_____1, 662 c1_____1, 663 c1_____1, 664 c1__1__1, 665 c1__1__1, 666 c1_1_1_1, 667 c11___11, 668 c1_____1 }, /* W */ 669 670 { c1_____1, 671 c1_____1, 672 c_1___1_, 673 c__1_1__, 674 c___1___, 675 c__1_1__, 676 c_1___1_, 677 c1_____1, 678 c1_____1 }, /* X */ 679 680 { c1_____1, 681 c1_____1, 682 c_1___1_, 683 c__1_1__, 684 c___1___, 685 c___1___, 686 c___1___, 687 c___1___, 688 c___1___ }, /* Y */ 689 690 { c1111111, 691 c______1, 692 c_____1_, 693 c____1__, 694 c___1___, 695 c__1____, 696 c_1_____, 697 c1______, 698 c1111111 }, /* Z */ 699 700 { c_1111__, 701 c_1_____, 702 c_1_____, 703 c_1_____, 704 c_1_____, 705 c_1_____, 706 c_1_____, 707 c_1_____, 708 c_1111__ }, /* [ */ 709 710 { c_______, 711 c1______, 712 c_1_____, 713 c__1____, 714 c___1___, 715 c____1__, 716 c_____1_, 717 c______1, 718 c_______ }, /* \ */ 719 720 { c__1111_, 721 c_____1_, 722 c_____1_, 723 c_____1_, 724 c_____1_, 725 c_____1_, 726 c_____1_, 727 c_____1_, 728 c__1111_ }, /* ] */ 729 730 { c___1___, 731 c__1_1__, 732 c_1___1_, 733 c1_____1, 734 c_______, 735 c_______, 736 c_______, 737 c_______ }, /* ^ */ 738 739 { c_______, 740 c_______, 741 c_______, 742 c_______, 743 c_______, 744 c_______, 745 c_______, 746 c1111111, 747 c_______ }, /* _ */ 748 749 { c__11___, 750 c__11___, 751 c___1___, 752 c____1__, 753 c_______, 754 c_______, 755 c_______, 756 c_______, 757 c_______ }, /* ` */ 758 759 { c_______, 760 c_______, 761 c_______, 762 c_1111__, 763 c_____1_, 764 c_11111_, 765 c1_____1, 766 c1____11, 767 c_1111_1 }, /* a */ 768 769 { c1______, 770 c1______, 771 c1______, 772 c1_111__, 773 c11___1_, 774 c1_____1, 775 c1_____1, 776 c11___1_, 777 c1_111__ }, /* b */ 778 779 { c_______, 780 c_______, 781 c_______, 782 c_1111__, 783 c1____1_, 784 c1______, 785 c1______, 786 c1____1_, 787 c_1111__ }, /* c */ 788 789 { c_____1_, 790 c_____1_, 791 c_____1_, 792 c_111_1_, 793 c1___11_, 794 c1____1_, 795 c1____1_, 796 c1___11_, 797 c_111_1_ }, /* d */ 798 799 { c_______, 800 c_______, 801 c_______, 802 c_1111__, 803 c1____1_, 804 c111111_, 805 c1______, 806 c1____1_, 807 c_1111__ }, /* e */ 808 809 { c___11__, 810 c__1__1_, 811 c__1____, 812 c__1____, 813 c11111__, 814 c__1____, 815 c__1____, 816 c__1____, 817 c__1____ }, /* f */ 818 819 { c_111_1_, 820 c1___11_, 821 c1____1_, 822 c1____1_, 823 c1___11_, 824 c_111_1_, 825 c_____1_, 826 c1____1_, 827 c_1111__ }, /* g */ 828 829 { c1______, 830 c1______, 831 c1______, 832 c1_111__, 833 c11___1_, 834 c1____1_, 835 c1____1_, 836 c1____1_, 837 c1____1_ }, /* h */ 838 839 { c_______, 840 c___1___, 841 c_______, 842 c__11___, 843 c___1___, 844 c___1___, 845 c___1___, 846 c___1___, 847 c__111__ }, /* i */ 848 849 { c____11_, 850 c_____1_, 851 c_____1_, 852 c_____1_, 853 c_____1_, 854 c_____1_, 855 c_____1_, 856 c_1___1_, 857 c__111__ }, /* j */ 858 859 { c1______, 860 c1______, 861 c1______, 862 c1___1__, 863 c1__1___, 864 c1_1____, 865 c11_1___, 866 c1___1__, 867 c1____1_ }, /* k */ 868 869 { c__11___, 870 c___1___, 871 c___1___, 872 c___1___, 873 c___1___, 874 c___1___, 875 c___1___, 876 c___1___, 877 c__111__ }, /* l */ 878 879 { c_______, 880 c_______, 881 c_______, 882 c1_1_11_, 883 c11_1__1, 884 c1__1__1, 885 c1__1__1, 886 c1__1__1, 887 c1__1__1 }, /* m */ 888 889 { c_______, 890 c_______, 891 c_______, 892 c1_111__, 893 c11___1_, 894 c1____1_, 895 c1____1_, 896 c1____1_, 897 c1____1_ }, /* n */ 898 899 { c_______, 900 c_______, 901 c_______, 902 c_1111__, 903 c1____1_, 904 c1____1_, 905 c1____1_, 906 c1____1_, 907 c_1111__ }, /* o */ 908 909 { c1_111__, 910 c11___1_, 911 c1____1_, 912 c1____1_, 913 c11___1_, 914 c1_111__, 915 c1______, 916 c1______, 917 c1______ }, /* p */ 918 919 { c_111_1_, 920 c1___11_, 921 c1____1_, 922 c1____1_, 923 c1___11_, 924 c_111_1_, 925 c_____1_, 926 c_____1_, 927 c_____1_ }, /* q */ 928 929 { c_______, 930 c_______, 931 c_______, 932 c1_111__, 933 c11___1_, 934 c1______, 935 c1______, 936 c1______, 937 c1______ }, /* r */ 938 939 { c_______, 940 c_______, 941 c_______, 942 c_1111__, 943 c1____1_, 944 c_11____, 945 c___11__, 946 c1____1_, 947 c_1111__ }, /* s */ 948 949 { c_______, 950 c__1____, 951 c__1____, 952 c11111__, 953 c__1____, 954 c__1____, 955 c__1____, 956 c__1__1_, 957 c___11__ }, /* t */ 958 959 { c_______, 960 c_______, 961 c_______, 962 c1____1_, 963 c1____1_, 964 c1____1_, 965 c1____1_, 966 c1___11_, 967 c_111_1_ }, /* u */ 968 969 { c_______, 970 c_______, 971 c_______, 972 c1_____1, 973 c1_____1, 974 c1_____1, 975 c_1___1_, 976 c__1_1__, 977 c___1___ }, /* v */ 978 979 { c_______, 980 c_______, 981 c_______, 982 c1_____1, 983 c1__1__1, 984 c1__1__1, 985 c1__1__1, 986 c1__1__1, 987 c_11_11_ }, /* w */ 988 989 { c_______, 990 c_______, 991 c_______, 992 c1____1_, 993 c_1__1__, 994 c__11___, 995 c__11___, 996 c_1__1__, 997 c1____1_ }, /* x */ 998 999 { c1____1_, 1000 c1____1_, 1001 c1____1_, 1002 c1____1_, 1003 c1___11_, 1004 c_111_1_, 1005 c_____1_, 1006 c1____1_, 1007 c_1111__ }, /* y */ 1008 1009 { c_______, 1010 c_______, 1011 c_______, 1012 c111111_, 1013 c____1__, 1014 c___1___, 1015 c__1____, 1016 c_1_____, 1017 c111111_ }, /* z */ 1018 1019 { c___11__, 1020 c__1____, 1021 c__1____, 1022 c__1____, 1023 c_1_____, 1024 c__1____, 1025 c__1____, 1026 c__1____, 1027 c___11__ }, /* } */ 1028 1029 { c___1___, 1030 c___1___, 1031 c___1___, 1032 c___1___, 1033 c___1___, 1034 c___1___, 1035 c___1___, 1036 c___1___, 1037 c___1___ }, /* | */ 1038 1039 { c__11___, 1040 c____1__, 1041 c____1__, 1042 c____1__, 1043 c_____1_, 1044 c____1__, 1045 c____1__, 1046 c____1__, 1047 c__11___ }, /* } */ 1048 1049 { c_11____, 1050 c1__1__1, 1051 c____11_, 1052 c_______, 1053 c_______, 1054 c_______, 1055 c_______, 1056 c_______, 1057 c_______ }, /* ~ */ 1058 1059 { c_1__1__, 1060 c1__1__1, 1061 c__1__1_, 1062 c_1__1__, 1063 c1__1__1, 1064 c__1__1_, 1065 c_1__1__, 1066 c1__1__1, 1067 c__1__1_ } /* rub-out */ 1068 }; 1069