⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 banner.c

📁 早期freebsd实现
💻 C
📖 第 1 页 / 共 5 页
字号:
/* * Copyright (c) 1980, 1993, 1994 *	The Regents of the University of California.  All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *	This product includes software developed by the University of *	California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors *    may be used to endorse or promote products derived from this software *    without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */#ifndef lintstatic char copyright[] ="@(#) Copyright (c) 1980, 1993, 1994\n\	The Regents of the University of California.  All rights reserved.\n";#endif /* not lint */#ifndef lintstatic char sccsid[] = "@(#)banner.c	8.3 (Berkeley) 4/2/94";#endif /* not lint *//* * banner - prints large signs * banner [-w#] [-d] [-t] message ... */#include <err.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#define MAXMSG 1024#define DWIDTH 132#define NCHARS 128#define NBYTES 9271/* Pointers into data_table for each ASCII char */int asc_ptr[NCHARS] = {/* ^@ */   0,      0,      0,      0,      0,      0,      0,      0,/* ^H */   0,      0,      0,      0,      0,      0,      0,      0,/* ^P */   0,      0,      0,      0,      0,      0,      0,      0,/* ^X */   0,      0,      0,      0,      0,      0,      0,      0,/*    */   1,      3,     50,     81,    104,    281,    483,    590,/*  ( */ 621,    685,    749,    851,    862,    893,    898,    921,/*  0 */1019,   1150,   1200,   1419,   1599,   1744,   1934,   2111,/*  8 */2235,   2445,   2622,   2659,      0,   2708,      0,   2715,/*  @ */2857,   3072,   3273,   3403,   3560,   3662,   3730,   3785,/*  H */3965,   4000,   4015,   4115,   4281,   4314,   4432,   4548,/*  P */4709,   4790,   4999,   5188,   5397,   5448,   5576,   5710,/*  X */5892,   6106,   6257,      0,      0,      0,      0,      0,/*  ` */  50,   6503,   6642,   6733,   6837,   6930,   7073,   7157,/*  h */7380,   7452,   7499,   7584,   7689,   7702,   7797,   7869,/*  p */7978,   8069,   8160,   8222,   8381,   8442,   8508,   8605,/*  x */8732,   8888,   9016,      0,      0,      0,      0,      0};/* * Table of stuff to print. Format: * 128+n -> print current line n times. * 64+n  -> this is last byte of char. * else, put m chars at position n (where m * is the next elt in array) and goto second * next element in array. */char data_table[NBYTES] = {/*             0     1     2     3     4     5     6     7     8     9 *//*    0 */   129,  227,  130,   34,    6,   90,   19,  129,   32,   10, /*   10 */    74,   40,  129,   31,   12,   64,   53,  129,   30,   14, /*   20 */    54,   65,  129,   30,   14,   53,   67,  129,   30,   14, /*   30 */    54,   65,  129,   31,   12,   64,   53,  129,   32,   10, /*   40 */    74,   40,  129,   34,    6,   90,   19,  129,  194,  130, /*   50 */    99,    9,  129,   97,   14,  129,   96,   18,  129,   95, /*   60 */    22,  129,   95,   16,  117,    2,  129,   95,   14,  129, /*   70 */    96,   11,  129,   97,    9,  129,   99,    6,  129,  194, /*   80 */   129,   87,    4,  101,    4,  131,   82,   28,  131,   87, /*   90 */     4,  101,    4,  133,   82,   28,  131,   87,    4,  101, /*  100 */     4,  131,  193,  129,   39,    1,   84,   27,  129,   38, /*  110 */     3,   81,   32,  129,   37,    5,   79,   35,  129,   36, /*  120 */     5,   77,   38,  129,   35,    5,   76,   40,  129,   34, /*  130 */     5,   75,   21,  103,   14,  129,   33,    5,   74,   19, /*  140 */   107,   11,  129,   32,    5,   73,   17,  110,    9,  129, /*  150 */    32,    4,   73,   16,  112,    7,  129,   31,    4,   72, /*  160 */    15,  114,    6,  129,   31,    4,   72,   14,  115,    5, /*  170 */   129,   30,    4,   71,   15,  116,    5,  129,   27,   97, /*  180 */   131,   30,    4,   69,   14,  117,    4,  129,   30,    4, /*  190 */    68,   15,  117,    4,  132,   30,    4,   68,   14,  117, /*  200 */     4,  129,   27,   97,  131,   30,    5,   65,   15,  116, /*  210 */     5,  129,   31,    4,   65,   14,  116,    4,  129,   31, /*  220 */     6,   64,   15,  116,    4,  129,   32,    7,   62,   16, /*  230 */   115,    4,  129,   32,    9,   61,   17,  114,    5,  129, /*  240 */    33,   11,   58,   19,  113,    5,  129,   34,   14,   55, /*  250 */    21,  112,    5,  129,   35,   40,  111,    5,  129,   36, /*  260 */    38,  110,    5,  129,   37,   35,  109,    5,  129,   38, /*  270 */    32,  110,    3,  129,   40,   27,  111,    1,  129,  193, /*  280 */   129,   30,    4,  103,    9,  129,   30,    7,  100,   15, /*  290 */   129,   30,   10,   99,   17,  129,   33,   10,   97,    6, /*  300 */   112,    6,  129,   36,   10,   96,    5,  114,    5,  129, /*  310 */    39,   10,   96,    4,  115,    4,  129,   42,   10,   95, /*  320 */     4,  116,    4,  129,   45,   10,   95,    3,  117,    3, /*  330 */   129,   48,   10,   95,    3,  117,    3,  129,   51,   10, /*  340 */    95,    4,  116,    4,  129,   54,   10,   96,    4,  115, /*  350 */     4,  129,   57,   10,   96,    5,  114,    5,  129,   60, /*  360 */    10,   97,    6,  112,    6,  129,   63,   10,   99,   17, /*  370 */   129,   66,   10,  100,   15,  129,   69,   10,  103,    9, /*  380 */   129,   39,    9,   72,   10,  129,   36,   15,   75,   10, /*  390 */   129,   35,   17,   78,   10,  129,   33,    6,   48,    6, /*  400 */    81,   10,  129,   32,    5,   50,    5,   84,   10,  129, /*  410 */    32,    4,   51,    4,   87,   10,  129,   31,    4,   52, /*  420 */     4,   90,   10,  129,   31,    3,   53,    3,   93,   10, /*  430 */   129,   31,    3,   53,    3,   96,   10,  129,   31,    4, /*  440 */    52,    4,   99,   10,  129,   32,    4,   51,    4,  102, /*  450 */    10,  129,   32,    5,   50,    5,  105,   10,  129,   33, /*  460 */     6,   48,    6,  108,   10,  129,   35,   17,  111,   10, /*  470 */   129,   36,   15,  114,    7,  129,   40,    9,  118,    4, /*  480 */   129,  193,  129,   48,   18,  129,   43,   28,  129,   41, /*  490 */    32,  129,   39,   36,  129,   37,   40,  129,   35,   44, /*  500 */   129,   34,   46,  129,   33,   13,   68,   13,  129,   32, /*  510 */     9,   73,    9,  129,   32,    7,   75,    7,  129,   31, /*  520 */     6,   77,    6,  129,   31,    5,   78,    5,  129,   30, /*  530 */     5,   79,    5,  129,   20,   74,  132,   30,    4,   80, /*  540 */     4,  129,   31,    3,   79,    4,  129,   31,    4,   79, /*  550 */     4,  129,   32,    3,   78,    4,  129,   32,    4,   76, /*  560 */     6,  129,   33,    4,   74,    7,  129,   34,    4,   72, /*  570 */     8,  129,   35,    5,   72,    7,  129,   37,    5,   73, /*  580 */     4,  129,   39,    4,   74,    1,  129,  129,  193,  130, /*  590 */   111,    6,  129,  109,   10,  129,  108,   12,  129,  107, /*  600 */    14,  129,   97,    2,  105,   16,  129,   99,   22,  129, /*  610 */   102,   18,  129,  105,   14,  129,  108,    9,  129,  194, /*  620 */   130,   63,   25,  129,   57,   37,  129,   52,   47,  129, /*  630 */    48,   55,  129,   44,   63,  129,   41,   69,  129,   38, /*  640 */    75,  129,   36,   79,  129,   34,   83,  129,   33,   28, /*  650 */    90,   28,  129,   32,   23,   96,   23,  129,   32,   17, /*  660 */   102,   17,  129,   31,   13,  107,   13,  129,   30,    9, /*  670 */   112,    9,  129,   30,    5,  116,    5,  129,   30,    1, /*  680 */   120,    1,  129,  194,  130,   30,    1,  120,    1,  129, /*  690 */    30,    5,  116,    5,  129,   30,    9,  112,    9,  129, /*  700 */    31,   13,  107,   13,  129,   32,   17,  102,   17,  129, /*  710 */    32,   23,   96,   23,  129,   33,   28,   90,   28,  129, /*  720 */    34,   83,  129,   36,   79,  129,   38,   75,  129,   41, /*  730 */    69,  129,   44,   63,  129,   48,   55,  129,   52,   47, /*  740 */   129,   57,   37,  129,   63,   25,  129,  194,  129,   80, /*  750 */     4,  130,   80,    4,  129,   68,    2,   80,    4,   94, /*  760 */     2,  129,   66,    6,   80,    4,   92,    6,  129,   67, /*  770 */     7,   80,    4,   90,    7,  129,   69,    7,   80,    4, /*  780 */    88,    7,  129,   71,    6,   80,    4,   87,    6,  129, /*  790 */    72,   20,  129,   74,   16,  129,   76,   12,  129,   62, /*  800 */    40,  131,   76,   12,  129,   74,   16,  129,   72,   20, /*  810 */   129,   71,    6,   80,    4,   87,    6,  129,   69,    7, /*  820 */    80,    4,   88,    7,  129,   67,    7,   80,    4,   90, /*  830 */     7,  129,   66,    6,   80,    4,   92,    6,  129,   68, /*  840 */     2,   80,    4,   94,    2,  129,   80,    4,  130,  193, /*  850 */   129,   60,    4,  139,   41,   42,  131,   60,    4,  139, /*  860 */   193,  130,   34,    6,  129,   32,   10,  129,   31,   12, /*  870 */   129,   30,   14,  129,   20,    2,   28,   16,  129,   22, /*  880 */    22,  129,   24,   19,  129,   27,   15,  129,   31,    9, /*  890 */   129,  194,  129,   60,    4,  152,  193,  130,   34,    6, /*  900 */   129,   32,   10,  129,   31,   12,  129,   30,   14,  131, /*  910 */    31,   12,  129,   32,   10,  129,   34,    6,  129,  194, /*  920 */   129,   30,    4,  129,   30,    7,  129,   30,   10,  129, /*  930 */    33,   10,  129,   36,   10,  129,   39,   10,  129,   42, /*  940 */    10,  129,   45,   10,  129,   48,   10,  129,   51,   10, /*  950 */   129,   54,   10,  129,   57,   10,  129,   60,   10,  129, /*  960 */    63,   10,  129,   66,   10,  129,   69,   10,  129,   72, /*  970 */    10,  129,   75,   10,  129,   78,   10,  129,   81,   10, 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -