From 15b102c15cd63c6749b042854b73e7d2a40483b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= Date: Tue, 25 Jul 2017 17:50:46 +0200 Subject: [PATCH] clean copyright stuff from help.[ch] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Amadeusz Sławiński --- src/help.c | 191 ----------------------------------------------------- src/help.h | 2 - 2 files changed, 193 deletions(-) diff --git a/src/help.c b/src/help.c index d6593ce..2cc3479 100644 --- a/src/help.c +++ b/src/help.c @@ -407,197 +407,6 @@ static void HelpRedisplayLine(int y, int xs, int xe, int isblank) LClearArea(flayer, xs, y, xe, y, 0, 0); } -/* -** -** here is all the copyright stuff -** -*/ - -static void CopyrightProcess(char **, size_t *); -static void CopyrightRedisplayLine(int, int, int, int); -static void CopyrightAbort(void); -static void copypage(void); - -struct copydata { - char *cps, *savedcps; /* position in the message */ - char *refcps, *refsavedcps; /* backup for redisplaying */ -}; - -static const struct LayFuncs CopyrightLf = { - CopyrightProcess, - CopyrightAbort, - CopyrightRedisplayLine, - DefClearLine, - DefResize, - DefRestore, - 0 -}; - -static const char cpmsg[] = "\ -\n\ -Screen version %v\n\ -\n\ -Copyright (c) 2015-2017 Juergen Weigert, Alexander Naumov, Amadeusz Slawinski\n\ -Copyright (c) 2010-2014 Juergen Weigert, Sadrul Habib Chowdhury\n\ -Copyright (c) 2008-2009 Juergen Weigert, Michael Schroeder, Micah Cowan, Sadrul Habib Chowdhury\n\ -Copyright (c) 1993-2007 Juergen Weigert, Michael Schroeder\n\ -Copyright (c) 1987 Oliver Laumann\n\ -\n\ -This program is free software; you can redistribute it and/or \ -modify it under the terms of the GNU General Public License as published \ -by the Free Software Foundation; either version 3, or (at your option) \ -any later version.\n\ -\n\ -This program is distributed in the hope that it will be useful, \ -but WITHOUT ANY WARRANTY; without even the implied warranty of \ -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \ -GNU General Public License for more details.\n\ -\n\ -You should have received a copy of the GNU General Public License \ -along with this program (see the file COPYING); if not, see \ -http://www.gnu.org/licenses/, or contact Free Software Foundation, Inc., \ -51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA.\n\ -\n\ -Send bugreports, fixes, enhancements, t-shirts, money, beer & pizza to \ -screen-devel@gnu.org\n\n\n" -#ifdef ENABLE_TELNET - "+builtin-telnet " -#else - "-builtin-telnet " -#endif - ; - -static void CopyrightProcess(char **ppbuf, size_t *plen) -{ - int done = 0; - struct copydata *copydata; - - copydata = (struct copydata *)flayer->l_data; - while (!done && *plen > 0) { - switch (**ppbuf) { - case ' ': - if (*copydata->cps) { - copypage(); - break; - } - /* FALLTHROUGH */ - case '\r': - case '\n': - CopyrightAbort(); - done = 1; - break; - default: - break; - } - ++*ppbuf; - --*plen; - } -} - -static void CopyrightAbort() -{ - LAY_CALL_UP(LRefreshAll(flayer, 0)); - ExitOverlayPage(); -} - -void display_copyright() -{ - struct copydata *copydata; - - if (flayer->l_width < 10 || flayer->l_height < 5) { - LMsg(0, "Window size too small for copyright page"); - return; - } - if (InitOverlayPage(sizeof(struct copydata), &CopyrightLf, 0)) - return; - copydata = (struct copydata *)flayer->l_data; - copydata->cps = (char *)cpmsg; - copydata->savedcps = 0; - flayer->l_x = 0; - flayer->l_y = flayer->l_height - 1; - copypage(); -} - -static void copypage() -{ - char *cps; - char *ws; - int x, y, l; - char cbuf[80]; - struct copydata *copydata; - - copydata = (struct copydata *)flayer->l_data; - - LClearAll(flayer, 0); - x = y = 0; - cps = copydata->cps; - copydata->refcps = cps; - copydata->refsavedcps = copydata->savedcps; - while (*cps && y < flayer->l_height - 3) { - ws = cps; - while (*cps == ' ') - cps++; - if (strncmp(cps, "%v", 2) == 0) { - copydata->savedcps = cps + 2; - cps = version; - continue; - } - while (*cps && *cps != ' ' && *cps != '\n') - cps++; - l = cps - ws; - cps = ws; - if (l > flayer->l_width - 1) - l = flayer->l_width - 1; - if (x && x + l >= flayer->l_width - 2) { - x = 0; - y++; - continue; - } - if (x) { - LPutChar(flayer, &mchar_blank, x, y); - x++; - } - if (l) - LPutStr(flayer, ws, l, &mchar_blank, x, y); - x += l; - cps += l; - if (*cps == 0 && copydata->savedcps) { - cps = copydata->savedcps; - copydata->savedcps = 0; - } - if (*cps == '\n') { - x = 0; - y++; - } - if (*cps == ' ' || *cps == '\n') - cps++; - } - while (*cps == '\n') - cps++; - sprintf(cbuf, "[Press Space %s Return to end.]", *cps ? "for next page;" : "or"); - centerline(cbuf, flayer->l_height - 2); - copydata->cps = cps; - LaySetCursor(); -} - -static void CopyrightRedisplayLine(int y, int xs, int xe, int isblank) -{ - if (y < 0) { - struct copydata *copydata; - - copydata = (struct copydata *)flayer->l_data; - copydata->cps = copydata->refcps; - copydata->savedcps = copydata->refsavedcps; - copypage(); - return; - } - if (y != 0 && y != flayer->l_height - 1) - return; - if (isblank) - return; - LClearArea(flayer, xs, y, xe, y, 0, 0); -} - /* ** ** The bindkey help page diff --git a/src/help.h b/src/help.h index f3734c0..fb4cbb9 100644 --- a/src/help.h +++ b/src/help.h @@ -6,8 +6,6 @@ void exit_with_usage (char *, char *, char *); void display_help (char *, struct action *); -void display_copyright (void); -void display_displays (void); void display_bindkey (char *, struct action *); int InWList (void); void WListUpdatecv (Canvas *, Window *);