From 76edff82efbe2f9c228e33b728d2e5f363c8509c Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Sat, 7 Feb 2009 19:44:54 -0500 Subject: Allow highlighting bell/monitor windows in caption The command is 'rendition'. Details in man-page. The defaults are currently set in a way to make sure that the new settings are noticeable. This changeset is preferred over either of the patches in savannah #18382, because it allows specifying the renditions for both bell and monitor windows, and is flexible enough that new renditions can be added if desired. --- src/help.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src/help.c') diff --git a/src/help.c b/src/help.c index b0d0db0..106af6a 100644 --- a/src/help.c +++ b/src/help.c @@ -40,6 +40,7 @@ extern struct display *display, *displays; extern struct win *windows; extern char *noargs[]; extern struct mchar mchar_blank, mchar_so; +extern int renditions[]; extern unsigned char *blank; extern struct win *wtab[]; #ifdef MAPKEYS @@ -1079,6 +1080,8 @@ int isblank; int yoff, xoff = 0; struct wlistdata *wlistdata; struct win *group; + struct mchar mchar_rend = mchar_blank; + struct mchar *mchar = (struct mchar *)0; if (i == MAXWIN) return; @@ -1094,9 +1097,23 @@ int isblank; if (i != pos && isblank) while (n && str[n - 1] == ' ') n--; - LPutWinMsg(flayer, str, (i == pos || !isblank) ? flayer->l_width : n, i == pos ? &mchar_so : &mchar_blank, xoff, y + yoff); + if (i == pos) + mchar = &mchar_so; + else if (wtab[i]->w_monitor == MON_DONE && renditions[REND_MONITOR] != -1) + { + mchar = &mchar_rend; + ApplyAttrColor(renditions[REND_MONITOR], mchar); + } + else if ((wtab[i]->w_bell == BELL_DONE || wtab[i]->w_bell == BELL_FOUND) && renditions[REND_BELL] != -1) + { + mchar = &mchar_rend; + ApplyAttrColor(renditions[REND_BELL], mchar); + } + else + mchar = &mchar_blank; + LPutWinMsg(flayer, str, (i == pos || !isblank) ? flayer->l_width : n, mchar, xoff, y + yoff); if (xoff) - LPutWinMsg(flayer, "", xoff, i == pos ? &mchar_so : &mchar_blank, 0, y + yoff); + LPutWinMsg(flayer, "", xoff, mchar, 0, y + yoff); #if 0 LPutStr(flayer, str, n, i == pos ? &mchar_so : &mchar_blank, 0, y + yoff); if (i == pos || !isblank) -- cgit v1.2.1 From f04882c76d0d23a35942e736e89ef19268f541b5 Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Sat, 7 Feb 2009 20:00:26 -0500 Subject: Copyright for 2009 --- src/help.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/help.c') diff --git a/src/help.c b/src/help.c index 106af6a..ac7209f 100644 --- a/src/help.c +++ b/src/help.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2008 +/* Copyright (c) 2008, 2009 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Micah Cowan (micah@cowan.name) @@ -503,7 +503,7 @@ static const char cpmsg[] = "\ \n\ Screen version %v\n\ \n\ -Copyright (c) 2008 Juergen Weigert, Michael Schroeder, Micah Cowan, Sadrul Habib Chowdhury\n\ +Copyright (c) 2008, 2009 Juergen Weigert, Michael Schroeder, Micah Cowan, Sadrul Habib Chowdhury\n\ Copyright (c) 1993-2002, 2003, 2005, 2006, 2007 Juergen Weigert, Michael Schroeder\n\ Copyright (c) 1987 Oliver Laumann\n\ \n\ -- cgit v1.2.1 From c78d93a1d7bd6c39fa4e2d94ef26907f9ddf308b Mon Sep 17 00:00:00 2001 From: Curtis Brown Date: Mon, 30 Nov 2009 12:46:45 -0500 Subject: More documentation updates. --- src/help.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/help.c') diff --git a/src/help.c b/src/help.c index ac7209f..a6497ce 100644 --- a/src/help.c +++ b/src/help.c @@ -74,13 +74,13 @@ char *myname, *message, *arg; #if defined(LOGOUTOK) && defined(UTMPOK) printf("-l Login mode on (update %s), -ln = off.\n", UTMPFILE); #endif - printf("-list or -ls. Do nothing, just list our SockDir.\n"); + printf("-ls [match] or -list. Do nothing, just list our SockDir [on possible matches].\n"); printf("-L Turn on output logging.\n"); printf("-m ignore $STY variable, do create a new screen session.\n"); printf("-O Choose optimal output rather than exact vt100 emulation.\n"); printf("-p window Preselect the named window if it exists.\n"); printf("-q Quiet startup. Exits with non-zero return code if unsuccessful.\n"); - printf("-r Reattach to a detached screen process.\n"); + printf("-r [session] Reattach to a detached screen process.\n"); printf("-R Reattach if possible, otherwise start a new session.\n"); printf("-s shell Shell to execute rather than $SHELL.\n"); printf("-S sockname Name this session .sockname instead of ...\n"); @@ -90,7 +90,7 @@ char *myname, *message, *arg; printf("-U Tell screen to use UTF-8 encoding.\n"); #endif printf("-v Print \"Screen version %s\".\n", version); - printf("-wipe Do nothing, just clean up SockDir.\n"); + printf("-wipe [match] Do nothing, just clean up SockDir [on possible matches].\n"); #ifdef MULTI printf("-x Attach to a not detached screen. (Multi display mode).\n"); #endif /* MULTI */ -- cgit v1.2.1 From b9a14d268112b87c77aa2933995028fbfd481e5d Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Tue, 1 Dec 2009 15:32:14 -0500 Subject: Fix a bug in windowlist navigation. --- src/help.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/help.c') diff --git a/src/help.c b/src/help.c index a6497ce..0f4b6a5 100644 --- a/src/help.c +++ b/src/help.c @@ -1005,7 +1005,7 @@ int *plen; h = wlistdata->pos; if (h == MAXWIN && Layer2Window(flayer) && Layer2Window(flayer)->w_type == W_TYPE_GROUP) break; - if (display && h != MAXWIN && wtab[h] && (wtab[h]->w_type == W_TYPE_GROUP || wtab[h] == D_fore)) + if (display && h != MAXWIN && wtab[h] && (wtab[h]->w_type == W_TYPE_GROUP) && Layer2Window(flayer) == wtab[h]) { wlistdata->group = wtab[h]; wlistdata->pos = wtab[h]->w_number; -- cgit v1.2.1 From 2199ead34441dd5291ffecb737b9ff4e7ae47f0d Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Sat, 5 Dec 2009 21:53:52 -0500 Subject: Revamp the display list. Revamp the display list (in works). The future changes are expected to add full mouse control, and perhaps some other utility functions (e.g. detaching a display, changing permissions perhaps? etc.) --- src/help.c | 190 ++----------------------------------------------------------- 1 file changed, 4 insertions(+), 186 deletions(-) (limited to 'src/help.c') diff --git a/src/help.c b/src/help.c index 0f4b6a5..cbd7bf8 100644 --- a/src/help.c +++ b/src/help.c @@ -680,183 +680,7 @@ int y, xs, xe, isblank; } - -/* -** -** here is all the displays stuff -** -*/ - -#ifdef MULTI - -static void DisplaysProcess __P((char **, int *)); -static void DisplaysRedisplayLine __P((int, int, int, int)); -static void displayspage __P((void)); - -struct displaysdata -{ - int dummy_element_for_solaris; -}; - -static struct LayFuncs DisplaysLf = -{ - DisplaysProcess, - HelpAbort, - DisplaysRedisplayLine, - DefClearLine, - DefRewrite, - DefResize, - DefRestore -}; - -static void -DisplaysProcess(ppbuf, plen) -char **ppbuf; -int *plen; -{ - int done = 0; - - ASSERT(flayer); - while (!done && *plen > 0) - { - switch (**ppbuf) - { - case ' ': - displayspage(); - break; - case '\r': - case '\n': - HelpAbort(); - done = 1; - break; - default: - break; - } - ++*ppbuf; - --*plen; - } -} - - -void -display_displays() -{ - if (flayer->l_width < 10 || flayer->l_height < 5) - { - LMsg(0, "Window size too small for displays page"); - return; - } - if (InitOverlayPage(sizeof(struct displaysdata), &DisplaysLf, 0)) - return; - flayer->l_x = 0; - flayer->l_y = flayer->l_height - 1; - displayspage(); -} - -/* - * layout of the displays page is as follows: - -xterm 80x42 jnweiger@/dev/ttyp4 0(m11) &rWx -facit 80x24 nb mlschroe@/dev/ttyhf 11(tcsh) rwx -xterm 80x42 jnhollma@/dev/ttyp5 0(m11) &R.x - - | | | | | | | | ¦___ window permissions - | | | | | | | | (R. is locked r-only, - | | | | | | | | W has wlock) - | | | | | | | |___ Window is shared - | | | | | | |___ Name/Title of window - | | | | | |___ Number of window - | | | | |___ Name of the display (the attached device) - | | | |___ Username who is logged in at the display - | | |___ Display is in nonblocking mode. Shows 'NB' if obuf is full. - | |___ Displays geometry as width x height. - |___ the terminal type known by screen for this display. - - */ - -static void -displayspage() -{ - int y, l; - char tbuf[80]; - struct display *d; - struct win *w; - static char *blockstates[5] = {"nb", "NB", "Z<", "Z>", "BL"}; - - LClearAll(flayer, 0); - - leftline("term-type size user interface window", 0); - leftline("---------- ------- ---------- ----------------- ----------", 1); - y = 2; - - for (d = displays; d; d = d->d_next) - { - w = d->d_fore; - - if (y >= flayer->l_height - 3) - break; - sprintf(tbuf, "%-10.10s%4dx%-4d%10.10s@%-16.16s%s", - d->d_termname, d->d_width, d->d_height, d->d_user->u_name, - d->d_usertty, - (d->d_blocked || d->d_nonblock >= 0) && d->d_blocked <= 4 ? blockstates[d->d_blocked] : " "); - - if (w) - { - l = 10 - strlen(w->w_title); - if (l < 0) - l = 0; - sprintf(tbuf + strlen(tbuf), "%3d(%.10s)%*s%c%c%c%c", - w->w_number, w->w_title, l, "", - /* w->w_dlist->next */ 0 ? '&' : ' ', - /* - * The rwx triple: - * -,r,R no read, read, read only due to foreign wlock - * -,.,w,W no write, write suppressed by foreign wlock, - * write, own wlock - * -,x no execute, execute - */ -#ifdef MULTIUSER - (AclCheckPermWin(d->d_user, ACL_READ, w) ? '-' : - ((w->w_wlock == WLOCK_OFF || d->d_user == w->w_wlockuser) ? - 'r' : 'R')), - (AclCheckPermWin(d->d_user, ACL_READ, w) ? '-' : - ((w->w_wlock == WLOCK_OFF) ? 'w' : - ((d->d_user == w->w_wlockuser) ? 'W' : 'v'))), - (AclCheckPermWin(d->d_user, ACL_READ, w) ? '-' : 'x') -#else - 'r', 'w', 'x' -#endif - ); - } - leftline(tbuf, y); - y++; - } - sprintf(tbuf,"[Press Space %s Return to end.]", - 1 ? "to refresh;" : "or"); - centerline(tbuf, flayer->l_height - 2); - LaySetCursor(); -} - -static void -DisplaysRedisplayLine(y, xs, xe, isblank) -int y, xs, xe, isblank; -{ - ASSERT(flayer); - if (y < 0) - { - displayspage(); - return; - } - if (y != 0 && y != flayer->l_height - 1) - return; - if (isblank) - return; - LClearArea(flayer, xs, y, xe, y, 0, 0); - /* To be filled in... */ -} - -#endif /* MULTI */ - +#include "list_display.c" /* ** @@ -1026,6 +850,8 @@ int *plen; if (h != MAXWIN) SwitchWindow(h); break; + case 0222: /* Mouse event */ + break; case 0033: case 0007: h = wlistdata->start; @@ -1358,6 +1184,7 @@ struct win *group; if (InitOverlayPage(sizeof(*wlistdata), &WListLf, 0)) return; wlistdata = (struct wlistdata *)flayer->l_data; + flayer->l_mode = 1; flayer->l_x = 0; flayer->l_y = flayer->l_height - 1; wlistdata->start = onblank && p ? p->w_number : -1; @@ -1484,15 +1311,6 @@ WListLinkChanged() display = olddisplay; } -int -InWList() -{ - if (flayer && flayer->l_layfn == &WListLf) - return 1; - return 0; -} - - /* ** -- cgit v1.2.1 From cb86fbaf2557c64acba71425920f14d3993fa5dd Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Thu, 17 Dec 2009 22:47:49 -0500 Subject: Move the cursor in the window/display list. This will make it easier to determine which row is selected in case the rendition for standout mode is the same as the normal mode (i.e. '= dd'). Fixes debian bug #446082. --- src/help.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/help.c') diff --git a/src/help.c b/src/help.c index cbd7bf8..338c4cd 100644 --- a/src/help.c +++ b/src/help.c @@ -940,6 +940,8 @@ int isblank; LPutWinMsg(flayer, str, (i == pos || !isblank) ? flayer->l_width : n, mchar, xoff, y + yoff); if (xoff) LPutWinMsg(flayer, "", xoff, mchar, 0, y + yoff); + if (mchar == &mchar_so) + flayer->l_y = y + yoff; #if 0 LPutStr(flayer, str, n, i == pos ? &mchar_so : &mchar_blank, 0, y + yoff); if (i == pos || !isblank) -- cgit v1.2.1 From f33e5cdecb7bf3b6ae8e4a5c0ca394dd5a06a416 Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Tue, 26 Jan 2010 15:15:24 -0500 Subject: Increase the max-window limit. The limit can be increased using the 'maxwin' command. There is still an upper-limit of 2048 windows. --- src/help.c | 87 +++++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 52 insertions(+), 35 deletions(-) (limited to 'src/help.c') diff --git a/src/help.c b/src/help.c index 338c4cd..e98f50c 100644 --- a/src/help.c +++ b/src/help.c @@ -38,11 +38,12 @@ char version[60]; /* initialised by main() */ extern struct layer *flayer; extern struct display *display, *displays; extern struct win *windows; +extern int maxwin; extern char *noargs[]; extern struct mchar mchar_blank, mchar_so; extern int renditions[]; extern unsigned char *blank; -extern struct win *wtab[]; +extern struct win **wtab; #ifdef MAPKEYS extern struct term term[]; #endif @@ -691,6 +692,7 @@ int y, xs, xe, isblank; struct wlistdata; static void WListProcess __P((char **, int *)); +static void WListAbort __P((void)); static void WListRedisplayLine __P((int, int, int, int)); static void wlistpage __P((void)); static void WListLine __P((int, int, int, int)); @@ -712,13 +714,13 @@ struct wlistdata { int order; struct win *group; int nested; - int list[MAXWIN]; + int *list; }; static struct LayFuncs WListLf = { WListProcess, - HelpAbort, + WListAbort, WListRedisplayLine, DefClearLine, DefRewrite, @@ -745,6 +747,16 @@ int wi, he; return 0; } +static void +WListAbort() +{ + struct wlistdata * wlistdata = (struct wlistdata *)flayer->l_data; + if (wlistdata->list) + Free(wlistdata->list); + LAY_CALL_UP(LRefreshAll(flayer, 0)); + ExitOverlayPage(); +} + static void WListProcess(ppbuf, plen) char **ppbuf; @@ -766,7 +778,7 @@ int *plen; { int n = (unsigned char)**ppbuf - '0'; int d = 0; - if (n < MAXWIN && wtab[n] && WTAB_GROUP_MATCHES(n)) + if (n < maxwin && wtab[n] && WTAB_GROUP_MATCHES(n)) { int i; for (d = -wlistdata->npos, i = WListNext(wlistdata, -1, 0); i != n; i = WListNext(wlistdata, i, 1), d++) @@ -805,7 +817,7 @@ int *plen; WListMove(-wlistdata->pos, -1); break; case 0205: /* end */ - WListMove(MAXWIN, -1); + WListMove(maxwin, -1); break; case 'a': /* All-window view */ @@ -827,9 +839,9 @@ int *plen; case '\n': case ' ': h = wlistdata->pos; - if (h == MAXWIN && Layer2Window(flayer) && Layer2Window(flayer)->w_type == W_TYPE_GROUP) + if (h == maxwin && Layer2Window(flayer) && Layer2Window(flayer)->w_type == W_TYPE_GROUP) break; - if (display && h != MAXWIN && wtab[h] && (wtab[h]->w_type == W_TYPE_GROUP) && Layer2Window(flayer) == wtab[h]) + if (display && h != maxwin && wtab[h] && (wtab[h]->w_type == W_TYPE_GROUP) && Layer2Window(flayer) == wtab[h]) { wlistdata->group = wtab[h]; wlistdata->pos = wtab[h]->w_number; @@ -837,17 +849,21 @@ int *plen; break; } done = 1; - if (!display || h == MAXWIN || !wtab[h] || wtab[h] == D_fore || (flayer->l_cvlist && flayer->l_cvlist->c_lnext)) - HelpAbort(); + if (!display || h == maxwin || !wtab[h] || wtab[h] == D_fore || (flayer->l_cvlist && flayer->l_cvlist->c_lnext)) + WListAbort(); #ifdef MULTIUSER else if (AclCheckPermWin(D_user, ACL_READ, wtab[h])) - HelpAbort(); + WListAbort(); #endif else - ExitOverlayPage(); /* no need to redisplay */ + { + if (wlistdata->list) + Free(wlistdata->list); + ExitOverlayPage(); /* no need to redisplay */ + } /* restore display, don't switch wrong user */ display = olddisplay; - if (h != MAXWIN) + if (h != maxwin) SwitchWindow(h); break; case 0222: /* Mouse event */ @@ -865,7 +881,7 @@ int *plen; } break; } - HelpAbort(); + WListAbort(); display = olddisplay; if (h >= 0 && wtab[h]) SwitchWindow(h); @@ -909,7 +925,7 @@ int isblank; struct mchar mchar_rend = mchar_blank; struct mchar *mchar = (struct mchar *)0; - if (i == MAXWIN) + if (i == maxwin) return; wlistdata = (struct wlistdata *)flayer->l_data; if (wlistdata->nested && wtab[i]) @@ -959,21 +975,21 @@ int old, delta; { int i; - if (old == MAXWIN) - return MAXWIN; + if (old == maxwin) + return maxwin; if (old == -1) old = 0; else { - for (i = 0; i < MAXWIN && wlistdata->list[i] != -1; i++) + for (i = 0; i < maxwin && wlistdata->list[i] != -1; i++) if (wlistdata->list[i] == old) break; - if (i < MAXWIN && wlistdata->list[i] != -1) + if (i < maxwin && wlistdata->list[i] != -1) old = i; } old += delta; - if (old < 0 || old >= MAXWIN || wlistdata->list[old] == -1) + if (old < 0 || old >= maxwin || wlistdata->list[old] == -1) old -= delta; return wlistdata->list[old]; } @@ -993,7 +1009,7 @@ int up, oldpos; i = WListNext(wlistdata, pos, -ypos); for (y = 0; y < wlistdata->numwin; y++) { - if (i == MAXWIN || !wtab[i]) + if (i == maxwin || !wtab[i]) return; if (y == 0) wlistdata->first = i; @@ -1004,7 +1020,7 @@ int up, oldpos; wlistdata->ypos = y; oldi = i; i = WListNext(wlistdata, i, 1); - if (i == MAXWIN || i == oldi) + if (i == maxwin || i == oldi) break; } } @@ -1023,11 +1039,11 @@ WListNormalize() ypos = 0; if (ypos >= wlistdata->numwin) ypos = wlistdata->numwin - 1; - for (n = 0, oldi = MAXWIN, i = pos; i != MAXWIN && i != oldi && n < wlistdata->numwin; oldi = i, i = WListNext(wlistdata, i, 1)) + for (n = 0, oldi = maxwin, i = pos; i != maxwin && i != oldi && n < wlistdata->numwin; oldi = i, i = WListNext(wlistdata, i, 1)) n++; if (ypos < wlistdata->numwin - n) ypos = wlistdata->numwin - n; - for (n = 0, oldi = MAXWIN, i = WListNext(wlistdata, -1, 0); i != MAXWIN && i != oldi && i != pos; oldi = i, i = WListNext(wlistdata, i, 1)) + for (n = 0, oldi = maxwin, i = WListNext(wlistdata, -1, 0); i != maxwin && i != oldi && i != pos; oldi = i, i = WListNext(wlistdata, i, 1)) n++; if (ypos > n) ypos = n; @@ -1092,10 +1108,10 @@ struct win *group; { int i; - if (ind >= MAXWIN) + if (ind >= maxwin) return ind; if (ind == 0) - for (i = 0; i < MAXWIN; i++) + for (i = 0; i < maxwin; i++) wlistdata->list[i] = -1; if (wlistdata->order == WLIST_MRU) @@ -1107,23 +1123,23 @@ struct win *group; { if (start == -1) start = 0; - while (start < MAXWIN && !wtab[start]) + while (start < maxwin && !wtab[start]) start++; } - if (start >= MAXWIN || !wtab[start]) + if (start >= maxwin || !wtab[start]) return ind; if (!WTAB_GROUP_MATCHES(start)) { - while (start < MAXWIN && (!wtab[start] || !WTAB_GROUP_MATCHES(start))) + while (start < maxwin && (!wtab[start] || !WTAB_GROUP_MATCHES(start))) if (wlistdata->order != WLIST_MRU) start++; else if (wtab[start]->w_next) start = wtab[start]->w_next->w_number; else - start = MAXWIN; - if (start >= MAXWIN || !wtab[start]) + start = maxwin; + if (start >= maxwin || !wtab[start]) return ind; } @@ -1186,6 +1202,7 @@ struct win *group; if (InitOverlayPage(sizeof(*wlistdata), &WListLf, 0)) return; wlistdata = (struct wlistdata *)flayer->l_data; + wlistdata->list = calloc(maxwin, sizeof(int)); flayer->l_mode = 1; flayer->l_x = 0; flayer->l_y = flayer->l_height - 1; @@ -1216,23 +1233,23 @@ wlistpage() WListOrder(wlistdata, 0, -1, group); pos = wlistdata->pos; - if (pos == MAXWIN || !wtab[pos] || !WTAB_GROUP_MATCHES(pos)) + if (pos == maxwin || !wtab[pos] || !WTAB_GROUP_MATCHES(pos)) { if (wlistdata->order == WLIST_MRU) pos = WListNext(wlistdata, -1, wlistdata->npos); else { /* find new position */ - if (pos < MAXWIN) - while(++pos < MAXWIN) + if (pos < maxwin) + while(++pos < maxwin) if (wtab[pos] && WTAB_GROUP_MATCHES(pos)) break; - if (pos == MAXWIN) + if (pos == maxwin) while (--pos >= 0) if (wtab[pos] && WTAB_GROUP_MATCHES(pos)) break; if (pos == -1) - pos = MAXWIN; + pos = maxwin; } } wlistdata->pos = pos; -- cgit v1.2.1 From e29d6de0f8f4c40806e9b3300ed3609aaefc104b Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Sun, 21 Feb 2010 01:14:06 -0500 Subject: Start working on a generic list framework. The list of displays uses this framework. Eventually, the list of windows, bindkeys etc. will also use this framework. In the list of displays, you can press 'd' to detach the selected display (and 'D' to power-detach). Eventually, the plan is to add typeahead search in the list too. --- src/help.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/help.c') diff --git a/src/help.c b/src/help.c index e98f50c..1e37354 100644 --- a/src/help.c +++ b/src/help.c @@ -33,6 +33,8 @@ #include "screen.h" #include "extern.h" +#include "list_generic.h" + char version[60]; /* initialised by main() */ extern struct layer *flayer; @@ -681,8 +683,6 @@ int y, xs, xe, isblank; } -#include "list_display.c" - /* ** ** here is the windowlist -- cgit v1.2.1 From 04f2e5342014efbbc6ba2d7277d33d3be388b2fd Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Mon, 22 Feb 2010 20:50:31 -0500 Subject: Revamp the window list. The window list now uses the list-framework. The basic window list is working. The list for a group, or nested/mru lists still need some work. This is going to be a much simpler code than before. --- src/help.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/help.c') diff --git a/src/help.c b/src/help.c index 1e37354..ebcf1d5 100644 --- a/src/help.c +++ b/src/help.c @@ -717,6 +717,7 @@ struct wlistdata { int *list; }; +#if 0 static struct LayFuncs WListLf = { WListProcess, @@ -727,9 +728,11 @@ static struct LayFuncs WListLf = WListResize, DefRestore }; +#endif #define WTAB_GROUP_MATCHES(i) (group == wtab[i]->w_group) +#if 0 static int WListResize(wi, he) int wi, he; @@ -1155,6 +1158,7 @@ struct win *group; return ind; return WListOrder(wlistdata, ind, start, group); } +#endif void display_wlist(onblank, order, group) @@ -1162,9 +1166,13 @@ int onblank; int order; struct win *group; { + display_windows(onblank, order, group); + return; +#if 0 struct win *p; struct wlistdata *wlistdata; + if (flayer->l_width < 10 || flayer->l_height < 6) { LMsg(0, "Window size too small for window list page"); @@ -1214,8 +1222,10 @@ struct win *group; wlistdata->numwin = flayer->l_height - (group ? 4 : 3); wlistdata->nested = (order & WLIST_NESTED); wlistpage(); +#endif } +#if 0 static void wlistpage() { @@ -1299,20 +1309,25 @@ struct win *p; WListLine(y, i, wlistdata->pos, 0); LaySetCursor(); } +#endif void WListUpdatecv(cv, p) struct canvas *cv; struct win *p; { +#if 0 if (cv->c_layer->l_layfn != &WListLf) return; CV_CALL(cv, WListUpdate(p)); +#endif +#warning Fixme } void WListLinkChanged() { +#if 0 struct display *olddisplay = display; struct canvas *cv; struct wlistdata *wlistdata; @@ -1328,6 +1343,8 @@ WListLinkChanged() CV_CALL(cv, WListUpdate(0)); } display = olddisplay; +#endif +#warning Fix me too! } -- cgit v1.2.1 From d9262fc5897e54f1b1fc1874acf101811bbb5935 Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Tue, 23 Feb 2010 12:43:26 -0500 Subject: Update the window-list when necessary. Update the window-list whenever window ordering/etc. changes. There is an unusual bug where the selection in a list changes automatically when switching windows in another display. Need to investigate this issue. Also, left to do: support nested list, and advanced navigations introduced (e.g. toggle MRU, nestedness etc.) --- src/help.c | 39 ++------------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) (limited to 'src/help.c') diff --git a/src/help.c b/src/help.c index ebcf1d5..be344b7 100644 --- a/src/help.c +++ b/src/help.c @@ -50,6 +50,8 @@ extern struct win **wtab; extern struct term term[]; #endif +extern struct LayFuncs ListLf; + static void PadStr __P((char *, int, int, int)); extern char *wliststr; @@ -1311,43 +1313,6 @@ struct win *p; } #endif -void -WListUpdatecv(cv, p) -struct canvas *cv; -struct win *p; -{ -#if 0 - if (cv->c_layer->l_layfn != &WListLf) - return; - CV_CALL(cv, WListUpdate(p)); -#endif -#warning Fixme -} - -void -WListLinkChanged() -{ -#if 0 - struct display *olddisplay = display; - struct canvas *cv; - struct wlistdata *wlistdata; - - for (display = displays; display; display = display->d_next) - for (cv = D_cvlist; cv; cv = cv->c_next) - { - if (!cv->c_layer || cv->c_layer->l_layfn != &WListLf) - continue; - wlistdata = (struct wlistdata *)cv->c_layer->l_data; - if (wlistdata->order != WLIST_MRU) - continue; - CV_CALL(cv, WListUpdate(0)); - } - display = olddisplay; -#endif -#warning Fix me too! -} - - /* ** ** The bindkey help page -- cgit v1.2.1 From 94d954b97565a4b2625ca04152fca4e87cf9d730 Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Tue, 23 Feb 2010 20:30:53 -0500 Subject: Final touches to the revamped window list. This window list should be better than the old one, mostly code-wise, as there's yet no new functionality. However, it should be much simpler to add typeahead search and other nifty things now than before. --- src/help.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/help.c') diff --git a/src/help.c b/src/help.c index be344b7..7b3e3b5 100644 --- a/src/help.c +++ b/src/help.c @@ -691,6 +691,7 @@ int y, xs, xe, isblank; ** */ +#if 0 struct wlistdata; static void WListProcess __P((char **, int *)); @@ -719,7 +720,6 @@ struct wlistdata { int *list; }; -#if 0 static struct LayFuncs WListLf = { WListProcess, @@ -730,11 +730,9 @@ static struct LayFuncs WListLf = WListResize, DefRestore }; -#endif #define WTAB_GROUP_MATCHES(i) (group == wtab[i]->w_group) -#if 0 static int WListResize(wi, he) int wi, he; -- cgit v1.2.1 From 1df022599350ae3882843b772b2bc0869348b894 Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Tue, 23 Feb 2010 20:35:03 -0500 Subject: Remove old code. --- src/help.c | 626 ------------------------------------------------------------- 1 file changed, 626 deletions(-) (limited to 'src/help.c') diff --git a/src/help.c b/src/help.c index 7b3e3b5..f8ae2fc 100644 --- a/src/help.c +++ b/src/help.c @@ -685,632 +685,6 @@ int y, xs, xe, isblank; } -/* -** -** here is the windowlist -** -*/ - -#if 0 -struct wlistdata; - -static void WListProcess __P((char **, int *)); -static void WListAbort __P((void)); -static void WListRedisplayLine __P((int, int, int, int)); -static void wlistpage __P((void)); -static void WListLine __P((int, int, int, int)); -static void WListLines __P((int, int)); -static void WListMove __P((int, int)); -static void WListUpdate __P((struct win *)); -static int WListNormalize __P((void)); -static int WListResize __P((int, int)); -static int WListNext __P((struct wlistdata *, int, int)); - -struct wlistdata { - int pos; - int ypos; - int npos; - int numwin; - int first; - int last; - int start; - int order; - struct win *group; - int nested; - int *list; -}; - -static struct LayFuncs WListLf = -{ - WListProcess, - WListAbort, - WListRedisplayLine, - DefClearLine, - DefRewrite, - WListResize, - DefRestore -}; - -#define WTAB_GROUP_MATCHES(i) (group == wtab[i]->w_group) - -static int -WListResize(wi, he) -int wi, he; -{ - struct wlistdata *wlistdata; - if (wi < 10 || he < 5) - return -1; - wlistdata = (struct wlistdata *)flayer->l_data; - flayer->l_width = wi; - flayer->l_height = he; - wlistdata->numwin = he - 3; - if (wlistdata->ypos >= wlistdata->numwin) - wlistdata->ypos = wlistdata->numwin - 1; - flayer->l_y = he - 1; - return 0; -} - -static void -WListAbort() -{ - struct wlistdata * wlistdata = (struct wlistdata *)flayer->l_data; - if (wlistdata->list) - Free(wlistdata->list); - LAY_CALL_UP(LRefreshAll(flayer, 0)); - ExitOverlayPage(); -} - -static void -WListProcess(ppbuf, plen) -char **ppbuf; -int *plen; -{ - int done = 0; - struct wlistdata *wlistdata; - struct display *olddisplay = display; - int h; - struct win *group; - - ASSERT(flayer); - wlistdata = (struct wlistdata *)flayer->l_data; - group = wlistdata->group; - h = wlistdata->numwin; - while (!done && *plen > 0) - { - if ((unsigned char)**ppbuf >= '0' && (unsigned char)**ppbuf <= '9') - { - int n = (unsigned char)**ppbuf - '0'; - int d = 0; - if (n < maxwin && wtab[n] && WTAB_GROUP_MATCHES(n)) - { - int i; - for (d = -wlistdata->npos, i = WListNext(wlistdata, -1, 0); i != n; i = WListNext(wlistdata, i, 1), d++) - ; - } - if (d) - WListMove(d, -1); - } - switch ((unsigned char)**ppbuf) - { - case 0220: /* up */ - case 16: /* ^P like emacs */ - case 'k': - WListMove(-1, -1); - break; - case 0216: /* down */ - case 14: /* ^N like emacs */ - case 'j': - WListMove(1, -1); - break; - case '\025': - WListMove(-(h / 2), wlistdata->ypos); - break; - case '\004': - WListMove(h / 2, wlistdata->ypos); - break; - case 0002: - case 'b': - WListMove(-h, -1); - break; - case 0006: - case 'f': - WListMove(h, -1); - break; - case 0201: /* home */ - WListMove(-wlistdata->pos, -1); - break; - case 0205: /* end */ - WListMove(maxwin, -1); - break; - case 'a': - /* All-window view */ - wlistdata->group = 0; - wlistdata->nested = WLIST_NESTED; - wlistpage(); - break; - case 'g': - /* Toggle nested view */ - wlistdata->nested ^= WLIST_NESTED; - wlistpage(); - break; - case 'm': - /* Toggle MRU view */ - wlistdata->order ^= 1; - wlistpage(); - break; - case '\r': - case '\n': - case ' ': - h = wlistdata->pos; - if (h == maxwin && Layer2Window(flayer) && Layer2Window(flayer)->w_type == W_TYPE_GROUP) - break; - if (display && h != maxwin && wtab[h] && (wtab[h]->w_type == W_TYPE_GROUP) && Layer2Window(flayer) == wtab[h]) - { - wlistdata->group = wtab[h]; - wlistdata->pos = wtab[h]->w_number; - wlistpage(); - break; - } - done = 1; - if (!display || h == maxwin || !wtab[h] || wtab[h] == D_fore || (flayer->l_cvlist && flayer->l_cvlist->c_lnext)) - WListAbort(); -#ifdef MULTIUSER - else if (AclCheckPermWin(D_user, ACL_READ, wtab[h])) - WListAbort(); -#endif - else - { - if (wlistdata->list) - Free(wlistdata->list); - ExitOverlayPage(); /* no need to redisplay */ - } - /* restore display, don't switch wrong user */ - display = olddisplay; - if (h != maxwin) - SwitchWindow(h); - break; - case 0222: /* Mouse event */ - break; - case 0033: - case 0007: - h = wlistdata->start; - if (h == -1 && Layer2Window(flayer) && Layer2Window(flayer)->w_type == W_TYPE_GROUP) - { - struct win *p = Layer2Window(flayer); - if (wlistdata->group != p) - { - wlistdata->group = p; - wlistpage(); - } - break; - } - WListAbort(); - display = olddisplay; - if (h >= 0 && wtab[h]) - SwitchWindow(h); - else if (h == -2) - { - struct win *p = FindNiceWindow(display ? D_other : (struct win *)0, 0); - if (p) - SwitchWindow(p->w_number); - } - done = 1; - break; - case '\010': /* ctrl-h */ - case 0177: - if (!wlistdata->group) - break; - wlistdata->pos = wlistdata->group->w_number; - wlistdata->group = wlistdata->group->w_group; - if (wlistdata->group) - wlistdata->pos = wlistdata->group->w_number; - wlistpage(); - break; - default: - break; - } - ++*ppbuf; - --*plen; - } -} - -static void -WListLine(y, i, pos, isblank) -int y, i; -int pos; -int isblank; -{ - char *str; - int n; - int yoff, xoff = 0; - struct wlistdata *wlistdata; - struct win *group; - struct mchar mchar_rend = mchar_blank; - struct mchar *mchar = (struct mchar *)0; - - if (i == maxwin) - return; - wlistdata = (struct wlistdata *)flayer->l_data; - if (wlistdata->nested && wtab[i]) - for (group = wtab[i]->w_group, xoff = 0; group != wlistdata->group; - group = group->w_group, xoff += 2) - ; - yoff = wlistdata->group ? 3 : 2; - display = Layer2Window(flayer) ? 0 : flayer->l_cvlist ? flayer->l_cvlist->c_display : 0; - str = MakeWinMsgEv(wliststr, wtab[i], '%', flayer->l_width - xoff, (struct event *)0, 0); - n = strlen(str); - if (i != pos && isblank) - while (n && str[n - 1] == ' ') - n--; - if (i == pos) - mchar = &mchar_so; - else if (wtab[i]->w_monitor == MON_DONE && renditions[REND_MONITOR] != -1) - { - mchar = &mchar_rend; - ApplyAttrColor(renditions[REND_MONITOR], mchar); - } - else if ((wtab[i]->w_bell == BELL_DONE || wtab[i]->w_bell == BELL_FOUND) && renditions[REND_BELL] != -1) - { - mchar = &mchar_rend; - ApplyAttrColor(renditions[REND_BELL], mchar); - } - else - mchar = &mchar_blank; - LPutWinMsg(flayer, str, (i == pos || !isblank) ? flayer->l_width : n, mchar, xoff, y + yoff); - if (xoff) - LPutWinMsg(flayer, "", xoff, mchar, 0, y + yoff); - if (mchar == &mchar_so) - flayer->l_y = y + yoff; -#if 0 - LPutStr(flayer, str, n, i == pos ? &mchar_so : &mchar_blank, 0, y + yoff); - if (i == pos || !isblank) - while(n < flayer->l_width) - LPutChar(flayer, i == pos ? &mchar_so : &mchar_blank, n++, y + yoff); -#endif - return; -} - - -static int -WListNext(wlistdata, old, delta) -struct wlistdata *wlistdata; -int old, delta; -{ - int i; - - if (old == maxwin) - return maxwin; - if (old == -1) - old = 0; - else - { - for (i = 0; i < maxwin && wlistdata->list[i] != -1; i++) - if (wlistdata->list[i] == old) - break; - if (i < maxwin && wlistdata->list[i] != -1) - old = i; - } - - old += delta; - if (old < 0 || old >= maxwin || wlistdata->list[old] == -1) - old -= delta; - return wlistdata->list[old]; -} - -static void -WListLines(up, oldpos) -int up, oldpos; -{ - struct wlistdata *wlistdata; - int ypos, pos; - int y, i, oldi; - - wlistdata = (struct wlistdata *)flayer->l_data; - ypos = wlistdata->ypos; - pos = wlistdata->pos; - - i = WListNext(wlistdata, pos, -ypos); - for (y = 0; y < wlistdata->numwin; y++) - { - if (i == maxwin || !wtab[i]) - return; - if (y == 0) - wlistdata->first = i; - wlistdata->last = i; - if (((i == oldpos || i == pos) && pos != oldpos) || (up > 0 && y >= wlistdata->numwin - up) || (up < 0 && y < -up)) - WListLine(y, i, pos, i != oldpos); - if (i == pos) - wlistdata->ypos = y; - oldi = i; - i = WListNext(wlistdata, i, 1); - if (i == maxwin || i == oldi) - break; - } -} - -static int -WListNormalize() -{ - struct wlistdata *wlistdata; - int i, oldi, n; - int ypos, pos; - - wlistdata = (struct wlistdata *)flayer->l_data; - ypos = wlistdata->ypos; - pos = wlistdata->pos; - if (ypos < 0) - ypos = 0; - if (ypos >= wlistdata->numwin) - ypos = wlistdata->numwin - 1; - for (n = 0, oldi = maxwin, i = pos; i != maxwin && i != oldi && n < wlistdata->numwin; oldi = i, i = WListNext(wlistdata, i, 1)) - n++; - if (ypos < wlistdata->numwin - n) - ypos = wlistdata->numwin - n; - for (n = 0, oldi = maxwin, i = WListNext(wlistdata, -1, 0); i != maxwin && i != oldi && i != pos; oldi = i, i = WListNext(wlistdata, i, 1)) - n++; - if (ypos > n) - ypos = n; - wlistdata->ypos = ypos; - wlistdata->npos = n; - return ypos; -} - -static void -WListMove(num, ypos) -int num; -int ypos; -{ - struct wlistdata *wlistdata; - int oldpos, oldypos, oldnpos; - int pos, up; - - wlistdata = (struct wlistdata *)flayer->l_data; - oldpos = wlistdata->pos; - oldypos = wlistdata->ypos; - oldnpos = wlistdata->npos; - wlistdata->ypos = ypos == -1 ? oldypos + num : ypos; - pos = WListNext(wlistdata, oldpos, num); - wlistdata->pos = pos; - ypos = WListNormalize(); - up = wlistdata->npos - ypos - (oldnpos - oldypos); - if (up) - { - LScrollV(flayer, up, 2, 2 + wlistdata->numwin - 1, 0); - WListLines(up, oldpos); - LaySetCursor(); - return; - } - if (pos == oldpos) - return; - WListLine(oldypos, oldpos, pos, 0); - WListLine(ypos, pos, pos, 1); - LaySetCursor(); -} - -static void -WListRedisplayLine(y, xs, xe, isblank) -int y, xs, xe, isblank; -{ - ASSERT(flayer); - if (y < 0) - { - wlistpage(); - return; - } - if (y != 0 && y != flayer->l_height - 1) - return; - if (!isblank) - LClearArea(flayer, xs, y, xe, y, 0, 0); -} - -static int -WListOrder(wlistdata, ind, start, group) -struct wlistdata *wlistdata; -int ind, start; -struct win *group; -{ - int i; - - if (ind >= maxwin) - return ind; - if (ind == 0) - for (i = 0; i < maxwin; i++) - wlistdata->list[i] = -1; - - if (wlistdata->order == WLIST_MRU) - { - if (start == -1) - start = windows->w_number; - } - else - { - if (start == -1) - start = 0; - while (start < maxwin && !wtab[start]) - start++; - } - - if (start >= maxwin || !wtab[start]) - return ind; - - if (!WTAB_GROUP_MATCHES(start)) - { - while (start < maxwin && (!wtab[start] || !WTAB_GROUP_MATCHES(start))) - if (wlistdata->order != WLIST_MRU) - start++; - else if (wtab[start]->w_next) - start = wtab[start]->w_next->w_number; - else - start = maxwin; - if (start >= maxwin || !wtab[start]) - return ind; - } - - wlistdata->list[ind++] = start; - if (wlistdata->nested && wtab[start]->w_type == W_TYPE_GROUP) - ind = WListOrder(wlistdata, ind, -1, wtab[start]); - - if (wlistdata->order != WLIST_MRU) - start++; - else if (wtab[start]->w_next) - start = wtab[start]->w_next->w_number; - else - return ind; - return WListOrder(wlistdata, ind, start, group); -} -#endif - -void -display_wlist(onblank, order, group) -int onblank; -int order; -struct win *group; -{ - display_windows(onblank, order, group); - return; -#if 0 - struct win *p; - struct wlistdata *wlistdata; - - - if (flayer->l_width < 10 || flayer->l_height < 6) - { - LMsg(0, "Window size too small for window list page"); - return; - } - if (onblank) - { - debug3("flayer %x %d %x\n", flayer, flayer->l_width, flayer->l_height); - if (!display) - { - LMsg(0, "windowlist -b: display required"); - return; - } - p = D_fore; - if (p) - { - SetForeWindow((struct win *)0); - if (p->w_group) - { - D_fore = p->w_group; - flayer->l_data = (char *)p->w_group; - } - Activate(0); - } - if (flayer->l_width < 10 || flayer->l_height < 6) - { - LMsg(0, "Window size too small for window list page"); - return; - } - } - else - p = Layer2Window(flayer); - if (!group && p) - group = p->w_group; - if (InitOverlayPage(sizeof(*wlistdata), &WListLf, 0)) - return; - wlistdata = (struct wlistdata *)flayer->l_data; - wlistdata->list = calloc(maxwin, sizeof(int)); - flayer->l_mode = 1; - flayer->l_x = 0; - flayer->l_y = flayer->l_height - 1; - wlistdata->start = onblank && p ? p->w_number : -1; - wlistdata->order = (order & 0x1); - wlistdata->group = group; - wlistdata->pos = p ? p->w_number : WListNext(wlistdata, -1, 0); - wlistdata->ypos = wlistdata->npos = 0; - wlistdata->numwin = flayer->l_height - (group ? 4 : 3); - wlistdata->nested = (order & WLIST_NESTED); - wlistpage(); -#endif -} - -#if 0 -static void -wlistpage() -{ - struct wlistdata *wlistdata; - char *str; - int pos; - struct win *group; - - wlistdata = (struct wlistdata *)flayer->l_data; - group = wlistdata->group; - - LClearAll(flayer, 0); - if (wlistdata->start >= 0 && wtab[wlistdata->start] == 0) - wlistdata->start = -2; - - WListOrder(wlistdata, 0, -1, group); - pos = wlistdata->pos; - if (pos == maxwin || !wtab[pos] || !WTAB_GROUP_MATCHES(pos)) - { - if (wlistdata->order == WLIST_MRU) - pos = WListNext(wlistdata, -1, wlistdata->npos); - else - { - /* find new position */ - if (pos < maxwin) - while(++pos < maxwin) - if (wtab[pos] && WTAB_GROUP_MATCHES(pos)) - break; - if (pos == maxwin) - while (--pos >= 0) - if (wtab[pos] && WTAB_GROUP_MATCHES(pos)) - break; - if (pos == -1) - pos = maxwin; - } - } - wlistdata->pos = pos; - - display = 0; - str = MakeWinMsgEv(wlisttit, (struct win *)0, '%', flayer->l_width, (struct event *)0, 0); - if (wlistdata->group) - { - LPutWinMsg(flayer, "Group: ", 7, &mchar_blank, 0, 0); - LPutWinMsg(flayer, wlistdata->group->w_title, strlen(wlistdata->group->w_title), &mchar_blank, 7, 0); - LPutWinMsg(flayer, str, strlen(str), &mchar_blank, 0, 1); - } - else - { - LPutWinMsg(flayer, str, strlen(str), &mchar_blank, 0, 0); - } - WListNormalize(); - WListLines(wlistdata->numwin, -1); - LaySetCursor(); -} - -static void -WListUpdate(p) -struct win *p; -{ - struct wlistdata *wlistdata; - int i, n, y; - - if (p == 0) - { - wlistpage(); - return; - } - wlistdata = (struct wlistdata *)flayer->l_data; - n = p->w_number; - if (wlistdata->order == WLIST_NUM && (n < wlistdata->first || n > wlistdata->last)) - return; - i = wlistdata->first; - for (y = 0; y < wlistdata->numwin; y++) - { - if (i == n) - break; - i = WListNext(wlistdata, i, 1); - } - if (y == wlistdata->numwin) - return; - WListLine(y, i, wlistdata->pos, 0); - LaySetCursor(); -} -#endif - /* ** ** The bindkey help page -- cgit v1.2.1 From 230cee80c145cf2d359b2c9fbcf6d4f2561b0d4a Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Wed, 24 Feb 2010 03:59:53 -0500 Subject: Changelog the search-ability in the windowlist. --- src/help.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/help.c') diff --git a/src/help.c b/src/help.c index f8ae2fc..d818ea4 100644 --- a/src/help.c +++ b/src/help.c @@ -1,4 +1,7 @@ -/* Copyright (c) 2008, 2009 +/* Copyright (c) 2010 + * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) + * Sadrul Habib Chowdhury (sadrul@users.sourceforge.net) + * Copyright (c) 2008, 2009 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Micah Cowan (micah@cowan.name) @@ -508,6 +511,7 @@ static const char cpmsg[] = "\ \n\ Screen version %v\n\ \n\ +Copyright (c) 2010 Juergen Weigert, Sadrul Habib Chowdhury\n\ Copyright (c) 2008, 2009 Juergen Weigert, Michael Schroeder, Micah Cowan, Sadrul Habib Chowdhury\n\ Copyright (c) 1993-2002, 2003, 2005, 2006, 2007 Juergen Weigert, Michael Schroeder\n\ Copyright (c) 1987 Oliver Laumann\n\ -- cgit v1.2.1 From 4f28ba8c8fd9032763eac42ed3591a6b2751f84c Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Fri, 26 Feb 2010 11:31:19 -0500 Subject: Some more fixes for the list management. Make sure the allocated memory is always freed. Also, do not reference freed memory. Thank you valgrind. --- src/help.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/help.c') diff --git a/src/help.c b/src/help.c index d818ea4..a624941 100644 --- a/src/help.c +++ b/src/help.c @@ -148,7 +148,8 @@ static struct LayFuncs HelpLf = DefClearLine, DefRewrite, DefResize, - DefRestore + DefRestore, + 0 }; @@ -504,7 +505,8 @@ static struct LayFuncs CopyrightLf = DefClearLine, DefRewrite, DefResize, - DefRestore + DefRestore, + 0 }; static const char cpmsg[] = "\ @@ -725,7 +727,8 @@ static struct LayFuncs BindkeyLf = DefClearLine, DefRewrite, DefResize, - DefRestore + DefRestore, + 0 }; @@ -922,7 +925,8 @@ static struct LayFuncs ZmodemLf = DefClearLine, DefRewrite, ZmodemResize, - DefRestore + DefRestore, + 0 }; /*ARGSUSED*/ -- cgit v1.2.1