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