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