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