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