lpdchar.c revision 1.8
1/* $OpenBSD: lpdchar.c,v 1.8 2016/02/28 20:55:40 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 { c__11___, 373 c__11___, 374 c_______, 375 c_______, 376 c__11___, 377 c__11___, 378 c__1____, 379 c_1_____, 380 c_______ }, /* ; */ 381 382 { c____1__, 383 c___1___, 384 c__1____, 385 c_1_____, 386 c1______, 387 c_1_____, 388 c__1____, 389 c___1___, 390 c____1__ }, /* < */ 391 392 { c_______, 393 c_______, 394 c_______, 395 c1111111, 396 c_______, 397 c1111111, 398 c_______, 399 c_______, 400 c_______ }, /* = */ 401 402 { c__1____, 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 412 { c__1111_, 413 c_1____1, 414 c_1____1, 415 c______1, 416 c____11_, 417 c___1___, 418 c___1___, 419 c_______, 420 c___1___ }, /* ? */ 421 422 { c__1111_, 423 c_1____1, 424 c1__11_1, 425 c1_1_1_1, 426 c1_1_1_1, 427 c1_1111_, 428 c1______, 429 c_1____1, 430 c__1111_ }, /* @ */ 431 432 { c__111__, 433 c_1___1_, 434 c1_____1, 435 c1_____1, 436 c1111111, 437 c1_____1, 438 c1_____1, 439 c1_____1, 440 c1_____1 }, /* A */ 441 442 { c111111_, 443 c_1____1, 444 c_1____1, 445 c_1____1, 446 c_11111_, 447 c_1____1, 448 c_1____1, 449 c_1____1, 450 c111111_ }, /* B */ 451 452 { c__1111_, 453 c_1____1, 454 c1______, 455 c1______, 456 c1______, 457 c1______, 458 c1______, 459 c_1____1, 460 c__1111_ }, /* C */ 461 462 { c11111__, 463 c_1___1_, 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 c11111__ }, /* D */ 471 472 { c1111111, 473 c1______, 474 c1______, 475 c1______, 476 c111111_, 477 c1______, 478 c1______, 479 c1______, 480 c1111111 }, /* E */ 481 482 { c1111111, 483 c1______, 484 c1______, 485 c1______, 486 c111111_, 487 c1______, 488 c1______, 489 c1______, 490 c1______ }, /* F */ 491 492 { c__1111_, 493 c_1____1, 494 c1______, 495 c1______, 496 c1______, 497 c1__1111, 498 c1_____1, 499 c_1____1, 500 c__1111_ }, /* G */ 501 502 { c1_____1, 503 c1_____1, 504 c1_____1, 505 c1_____1, 506 c1111111, 507 c1_____1, 508 c1_____1, 509 c1_____1, 510 c1_____1 }, /* H */ 511 512 { c_11111_, 513 c___1___, 514 c___1___, 515 c___1___, 516 c___1___, 517 c___1___, 518 c___1___, 519 c___1___, 520 c_11111_ }, /* I */ 521 522 { c__11111, 523 c____1__, 524 c____1__, 525 c____1__, 526 c____1__, 527 c____1__, 528 c____1__, 529 c1___1__, 530 c_111___ }, /* J */ 531 532 { c1_____1, 533 c1____1_, 534 c1___1__, 535 c1__1___, 536 c1_1____, 537 c11_1___, 538 c1___1__, 539 c1____1_, 540 c1_____1 }, /* K */ 541 542 { c1______, 543 c1______, 544 c1______, 545 c1______, 546 c1______, 547 c1______, 548 c1______, 549 c1______, 550 c1111111 }, /* L */ 551 552 { c1_____1, 553 c11___11, 554 c1_1_1_1, 555 c1__1__1, 556 c1_____1, 557 c1_____1, 558 c1_____1, 559 c1_____1, 560 c1_____1 }, /* M */ 561 562 { c1_____1, 563 c11____1, 564 c1_1___1, 565 c1__1__1, 566 c1___1_1, 567 c1____11, 568 c1_____1, 569 c1_____1, 570 c1_____1 }, /* N */ 571 572 { c__111__, 573 c_1___1_, 574 c1_____1, 575 c1_____1, 576 c1_____1, 577 c1_____1, 578 c1_____1, 579 c_1___1_, 580 c__111__ }, /* O */ 581 582 { c111111_, 583 c1_____1, 584 c1_____1, 585 c1_____1, 586 c111111_, 587 c1______, 588 c1______, 589 c1______, 590 c1______ }, /* P */ 591 592 { c__111__, 593 c_1___1_, 594 c1_____1, 595 c1_____1, 596 c1_____1, 597 c1__1__1, 598 c1___1_1, 599 c_1___1_, 600 c__111_1 }, /* Q */ 601 602 { c111111_, 603 c1_____1, 604 c1_____1, 605 c1_____1, 606 c111111_, 607 c1__1___, 608 c1___1__, 609 c1____1_, 610 c1_____1 }, /* R */ 611 612 { c_11111_, 613 c1_____1, 614 c1______, 615 c1______, 616 c_11111_, 617 c______1, 618 c______1, 619 c1_____1, 620 c_11111_ }, /* S */ 621 622 { c1111111, 623 c___1___, 624 c___1___, 625 c___1___, 626 c___1___, 627 c___1___, 628 c___1___, 629 c___1___, 630 c___1___ }, /* T */ 631 632 { c1_____1, 633 c1_____1, 634 c1_____1, 635 c1_____1, 636 c1_____1, 637 c1_____1, 638 c1_____1, 639 c1_____1, 640 c_11111_ }, /* U */ 641 642 { c1_____1, 643 c1_____1, 644 c1_____1, 645 c_1___1_, 646 c_1___1_, 647 c__1_1__, 648 c__1_1__, 649 c___1___, 650 c___1___ }, /* V */ 651 652 { c1_____1, 653 c1_____1, 654 c1_____1, 655 c1_____1, 656 c1__1__1, 657 c1__1__1, 658 c1_1_1_1, 659 c11___11, 660 c1_____1 }, /* W */ 661 662 { c1_____1, 663 c1_____1, 664 c_1___1_, 665 c__1_1__, 666 c___1___, 667 c__1_1__, 668 c_1___1_, 669 c1_____1, 670 c1_____1 }, /* X */ 671 672 { c1_____1, 673 c1_____1, 674 c_1___1_, 675 c__1_1__, 676 c___1___, 677 c___1___, 678 c___1___, 679 c___1___, 680 c___1___ }, /* Y */ 681 682 { c1111111, 683 c______1, 684 c_____1_, 685 c____1__, 686 c___1___, 687 c__1____, 688 c_1_____, 689 c1______, 690 c1111111 }, /* Z */ 691 692 { c_1111__, 693 c_1_____, 694 c_1_____, 695 c_1_____, 696 c_1_____, 697 c_1_____, 698 c_1_____, 699 c_1_____, 700 c_1111__ }, /* [ */ 701 702 { c_______, 703 c1______, 704 c_1_____, 705 c__1____, 706 c___1___, 707 c____1__, 708 c_____1_, 709 c______1, 710 c_______ }, /* \ */ 711 712 { c__1111_, 713 c_____1_, 714 c_____1_, 715 c_____1_, 716 c_____1_, 717 c_____1_, 718 c_____1_, 719 c_____1_, 720 c__1111_ }, /* ] */ 721 722 { c___1___, 723 c__1_1__, 724 c_1___1_, 725 c1_____1, 726 c_______, 727 c_______, 728 c_______, 729 c_______ }, /* ^ */ 730 731 { c_______, 732 c_______, 733 c_______, 734 c_______, 735 c_______, 736 c_______, 737 c_______, 738 c1111111, 739 c_______ }, /* _ */ 740 741 { c__11___, 742 c__11___, 743 c___1___, 744 c____1__, 745 c_______, 746 c_______, 747 c_______, 748 c_______, 749 c_______ }, /* ` */ 750 751 { c_______, 752 c_______, 753 c_______, 754 c_1111__, 755 c_____1_, 756 c_11111_, 757 c1_____1, 758 c1____11, 759 c_1111_1 }, /* a */ 760 761 { c1______, 762 c1______, 763 c1______, 764 c1_111__, 765 c11___1_, 766 c1_____1, 767 c1_____1, 768 c11___1_, 769 c1_111__ }, /* b */ 770 771 { c_______, 772 c_______, 773 c_______, 774 c_1111__, 775 c1____1_, 776 c1______, 777 c1______, 778 c1____1_, 779 c_1111__ }, /* c */ 780 781 { c_____1_, 782 c_____1_, 783 c_____1_, 784 c_111_1_, 785 c1___11_, 786 c1____1_, 787 c1____1_, 788 c1___11_, 789 c_111_1_ }, /* d */ 790 791 { c_______, 792 c_______, 793 c_______, 794 c_1111__, 795 c1____1_, 796 c111111_, 797 c1______, 798 c1____1_, 799 c_1111__ }, /* e */ 800 801 { c___11__, 802 c__1__1_, 803 c__1____, 804 c__1____, 805 c11111__, 806 c__1____, 807 c__1____, 808 c__1____, 809 c__1____ }, /* f */ 810 811 { c_111_1_, 812 c1___11_, 813 c1____1_, 814 c1____1_, 815 c1___11_, 816 c_111_1_, 817 c_____1_, 818 c1____1_, 819 c_1111__ }, /* g */ 820 821 { c1______, 822 c1______, 823 c1______, 824 c1_111__, 825 c11___1_, 826 c1____1_, 827 c1____1_, 828 c1____1_, 829 c1____1_ }, /* h */ 830 831 { c_______, 832 c___1___, 833 c_______, 834 c__11___, 835 c___1___, 836 c___1___, 837 c___1___, 838 c___1___, 839 c__111__ }, /* i */ 840 841 { c____11_, 842 c_____1_, 843 c_____1_, 844 c_____1_, 845 c_____1_, 846 c_____1_, 847 c_____1_, 848 c_1___1_, 849 c__111__ }, /* j */ 850 851 { c1______, 852 c1______, 853 c1______, 854 c1___1__, 855 c1__1___, 856 c1_1____, 857 c11_1___, 858 c1___1__, 859 c1____1_ }, /* k */ 860 861 { c__11___, 862 c___1___, 863 c___1___, 864 c___1___, 865 c___1___, 866 c___1___, 867 c___1___, 868 c___1___, 869 c__111__ }, /* l */ 870 871 { c_______, 872 c_______, 873 c_______, 874 c1_1_11_, 875 c11_1__1, 876 c1__1__1, 877 c1__1__1, 878 c1__1__1, 879 c1__1__1 }, /* m */ 880 881 { c_______, 882 c_______, 883 c_______, 884 c1_111__, 885 c11___1_, 886 c1____1_, 887 c1____1_, 888 c1____1_, 889 c1____1_ }, /* n */ 890 891 { c_______, 892 c_______, 893 c_______, 894 c_1111__, 895 c1____1_, 896 c1____1_, 897 c1____1_, 898 c1____1_, 899 c_1111__ }, /* o */ 900 901 { c1_111__, 902 c11___1_, 903 c1____1_, 904 c1____1_, 905 c11___1_, 906 c1_111__, 907 c1______, 908 c1______, 909 c1______ }, /* p */ 910 911 { c_111_1_, 912 c1___11_, 913 c1____1_, 914 c1____1_, 915 c1___11_, 916 c_111_1_, 917 c_____1_, 918 c_____1_, 919 c_____1_ }, /* q */ 920 921 { c_______, 922 c_______, 923 c_______, 924 c1_111__, 925 c11___1_, 926 c1______, 927 c1______, 928 c1______, 929 c1______ }, /* r */ 930 931 { c_______, 932 c_______, 933 c_______, 934 c_1111__, 935 c1____1_, 936 c_11____, 937 c___11__, 938 c1____1_, 939 c_1111__ }, /* s */ 940 941 { c_______, 942 c__1____, 943 c__1____, 944 c11111__, 945 c__1____, 946 c__1____, 947 c__1____, 948 c__1__1_, 949 c___11__ }, /* t */ 950 951 { c_______, 952 c_______, 953 c_______, 954 c1____1_, 955 c1____1_, 956 c1____1_, 957 c1____1_, 958 c1___11_, 959 c_111_1_ }, /* u */ 960 961 { c_______, 962 c_______, 963 c_______, 964 c1_____1, 965 c1_____1, 966 c1_____1, 967 c_1___1_, 968 c__1_1__, 969 c___1___ }, /* v */ 970 971 { c_______, 972 c_______, 973 c_______, 974 c1_____1, 975 c1__1__1, 976 c1__1__1, 977 c1__1__1, 978 c1__1__1, 979 c_11_11_ }, /* w */ 980 981 { c_______, 982 c_______, 983 c_______, 984 c1____1_, 985 c_1__1__, 986 c__11___, 987 c__11___, 988 c_1__1__, 989 c1____1_ }, /* x */ 990 991 { c1____1_, 992 c1____1_, 993 c1____1_, 994 c1____1_, 995 c1___11_, 996 c_111_1_, 997 c_____1_, 998 c1____1_, 999 c_1111__ }, /* y */ 1000 1001 { c_______, 1002 c_______, 1003 c_______, 1004 c111111_, 1005 c____1__, 1006 c___1___, 1007 c__1____, 1008 c_1_____, 1009 c111111_ }, /* z */ 1010 1011 { c___11__, 1012 c__1____, 1013 c__1____, 1014 c__1____, 1015 c_1_____, 1016 c__1____, 1017 c__1____, 1018 c__1____, 1019 c___11__ }, /* { */ 1020 1021 { c___1___, 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 1031 { c__11___, 1032 c____1__, 1033 c____1__, 1034 c____1__, 1035 c_____1_, 1036 c____1__, 1037 c____1__, 1038 c____1__, 1039 c__11___ }, /* } */ 1040 1041 { c_11____, 1042 c1__1__1, 1043 c____11_, 1044 c_______, 1045 c_______, 1046 c_______, 1047 c_______, 1048 c_______, 1049 c_______ }, /* ~ */ 1050 1051 { c_1__1__, 1052 c1__1__1, 1053 c__1__1_, 1054 c_1__1__, 1055 c1__1__1, 1056 c__1__1_, 1057 c_1__1__, 1058 c1__1__1, 1059 c__1__1_ } /* rub-out */ 1060}; 1061