diff options
author | Amadeusz Sławiński (amade) <amade@asmblr.net> | 2011-01-03 11:55:41 +0100 |
---|---|---|
committer | Amadeusz Sławiński <amade@asmblr.net> | 2014-05-11 16:28:24 +0200 |
commit | 7ae8a39c153fa87614b3fce88ca4514a4fd3e74d (patch) | |
tree | 6fda83adae1cb3f6418346fc7282accd01b3819d | |
parent | 74a1357df853f8b1efc5685692896eeaf02a2d9e (diff) | |
download | screen-7ae8a39c153fa87614b3fce88ca4514a4fd3e74d.tar.gz |
*wi -> *win
-rw-r--r-- | src/canvas.c | 32 | ||||
-rw-r--r-- | src/process.c | 90 | ||||
-rw-r--r-- | src/socket.c | 4 | ||||
-rw-r--r-- | src/utmp.c | 50 |
4 files changed, 88 insertions, 88 deletions
diff --git a/src/canvas.c b/src/canvas.c index 38c88ab..c696f80 100644 --- a/src/canvas.c +++ b/src/canvas.c @@ -227,7 +227,7 @@ FindCanvas(int x, int y) } void -SetCanvasWindow(struct canvas *cv, struct win *wi) +SetCanvasWindow(struct canvas *cv, struct win *win) { struct win *p = 0, **pp; struct layer *l; @@ -267,17 +267,17 @@ SetCanvasWindow(struct canvas *cv, struct win *wi) } /* find right layer to display on canvas */ - if (wi && wi->w_type != W_TYPE_GROUP) + if (win && win->w_type != W_TYPE_GROUP) { - l = &wi->w_layer; - if (wi->w_savelayer && (wi->w_blocked || wi->w_savelayer->l_cvlist == 0)) - l = wi->w_savelayer; + l = &win->w_layer; + if (win->w_savelayer && (win->w_blocked || win->w_savelayer->l_cvlist == 0)) + l = win->w_savelayer; } else { l = &cv->c_blank; - if (wi) - l->l_data = (char *)wi; + if (win) + l->l_data = (char *)win; else l->l_data = 0; } @@ -294,35 +294,35 @@ SetCanvasWindow(struct canvas *cv, struct win *wi) if (flayer == 0) flayer = l; - if (wi && wi->w_type == W_TYPE_GROUP) + if (win && win->w_type == W_TYPE_GROUP) { /* auto-start windowlist on groups */ struct display *d = display; struct layer *oldflayer = flayer; flayer = l; - display_windows(0, 0, wi); + display_windows(0, 0, win); flayer = oldflayer; display = d; } - if (wi && D_other == wi) - D_other = wi->w_next; /* Might be 0, but that's OK. */ + if (win && D_other == win) + D_other = win->w_next; /* Might be 0, but that's OK. */ if (cv == D_forecv) { - D_fore = wi; + D_fore = win; fore = D_fore; /* XXX ? */ - if (wi) + if (win) { #ifdef MULTIUSER - ObtainAutoWritelock(display, wi); + ObtainAutoWritelock(display, win); #endif /* * Place the window at the head of the most-recently-used list */ - if (windows != wi) + if (windows != win) { for (pp = &windows; (p = *pp); pp = &p->w_next) - if (p == wi) + if (p == win) break; ASSERT(p); *pp = p->w_next; diff --git a/src/process.c b/src/process.c index 770a4c4..c4fcf32 100644 --- a/src/process.c +++ b/src/process.c @@ -6309,20 +6309,20 @@ SwitchWindow(int n) * Puts window wi in canvas display->d_forecv. */ void -SetForeWindow(struct win *wi) +SetForeWindow(struct win *win) { struct win *p; if (display == 0) { - fore = wi; + fore = win; return; } p = Layer2Window(D_forecv->c_layer); - SetCanvasWindow(D_forecv, wi); + SetCanvasWindow(D_forecv, win); if (p) WindowChanged(p, 'u'); - if (wi) - WindowChanged(wi, 'u'); + if (win) + WindowChanged(win, 'u'); flayer = D_forecv->c_layer; /* Activate called afterwards, so no RefreshHStatus needed */ } @@ -6431,7 +6431,7 @@ MoreWindows() } void -KillWindow(struct win *wi) +KillWindow(struct win *win) { struct win **pp, *p; struct canvas *cv; @@ -6442,16 +6442,16 @@ KillWindow(struct win *wi) * Remove window from linked list. */ for (pp = &windows; (p = *pp); pp = &p->w_next) - if (p == wi) + if (p == win) break; ASSERT(p); *pp = p->w_next; - wi->w_inlen = 0; - wtab[wi->w_number] = 0; + win->w_inlen = 0; + wtab[win->w_number] = 0; if (windows == 0) { - FreeWindow(wi); + FreeWindow(win); Finit(0); } @@ -6463,7 +6463,7 @@ KillWindow(struct win *wi) gotone = 0; for (cv = D_cvlist; cv; cv = cv->c_next) { - if (Layer2Window(cv->c_layer) != wi) + if (Layer2Window(cv->c_layer) != win) continue; /* switch to other window */ SetCanvasWindow(cv, FindNiceWindow(D_other, 0)); @@ -6472,7 +6472,7 @@ KillWindow(struct win *wi) if (gotone) { #ifdef ZMODEM - if (wi->w_zdisplay == display) + if (win->w_zdisplay == display) { D_blocked = 0; D_readev.condpos = D_readev.condneg = 0; @@ -6484,9 +6484,9 @@ KillWindow(struct win *wi) /* do the same for the layouts */ for (lay = layouts; lay; lay = lay->lay_next) - UpdateLayoutCanvas(&lay->lay_canvas, wi); + UpdateLayoutCanvas(&lay->lay_canvas, win); - FreeWindow(wi); + FreeWindow(win); WindowChanged((struct win *)0, 'w'); WindowChanged((struct win *)0, 'W'); WindowChanged((struct win *)0, 0); @@ -7371,7 +7371,7 @@ su_fin(char *buf, int len, char *data) } static int -InputSu(struct win *w, struct acluser **up, char *name) +InputSu(struct win *win, struct acluser **up, char *name) { struct inputsu *i; @@ -7610,69 +7610,69 @@ StuffKey(int i) static int -IsOnDisplay(struct win *wi) +IsOnDisplay(struct win *win) { struct canvas *cv; ASSERT(display); for (cv = D_cvlist; cv; cv = cv->c_next) - if (Layer2Window(cv->c_layer) == wi) + if (Layer2Window(cv->c_layer) == win) return 1; return 0; } struct win * -FindNiceWindow(struct win *wi, char *presel) +FindNiceWindow(struct win *win, char *presel) { int i; - debug2("FindNiceWindow %d %s\n", wi ? wi->w_number : -1 , presel ? presel : "NULL"); + debug2("FindNiceWindow %d %s\n", win ? win->w_number : -1 , presel ? presel : "NULL"); if (presel) { i = WindowByNoN(presel); if (i >= 0) - wi = wtab[i]; + win = wtab[i]; } if (!display) - return wi; + return win; #ifdef MULTIUSER - if (wi && AclCheckPermWin(D_user, ACL_READ, wi)) - wi = 0; + if (win && AclCheckPermWin(D_user, ACL_READ, win)) + win = 0; #endif - if (!wi || (IsOnDisplay(wi) && !presel)) + if (!win || (IsOnDisplay(win) && !presel)) { /* try to get another window */ - wi = 0; + win = 0; #ifdef MULTIUSER - for (wi = windows; wi; wi = wi->w_next) - if (!wi->w_layer.l_cvlist && !AclCheckPermWin(D_user, ACL_WRITE, wi)) + for (win = windows; win; win = win->w_next) + if (!win->w_layer.l_cvlist && !AclCheckPermWin(D_user, ACL_WRITE, win)) break; - if (!wi) - for (wi = windows; wi; wi = wi->w_next) - if (wi->w_layer.l_cvlist && !IsOnDisplay(wi) && !AclCheckPermWin(D_user, ACL_WRITE, wi)) + if (!win) + for (win = windows; win; win = win->w_next) + if (win->w_layer.l_cvlist && !IsOnDisplay(win) && !AclCheckPermWin(D_user, ACL_WRITE, win)) break; - if (!wi) - for (wi = windows; wi; wi = wi->w_next) - if (!wi->w_layer.l_cvlist && !AclCheckPermWin(D_user, ACL_READ, wi)) + if (!win) + for (win = windows; win; win = win->w_next) + if (!win->w_layer.l_cvlist && !AclCheckPermWin(D_user, ACL_READ, win)) break; - if (!wi) - for (wi = windows; wi; wi = wi->w_next) - if (wi->w_layer.l_cvlist && !IsOnDisplay(wi) && !AclCheckPermWin(D_user, ACL_READ, wi)) + if (!win) + for (win = windows; win; win = win->w_next) + if (win->w_layer.l_cvlist && !IsOnDisplay(win) && !AclCheckPermWin(D_user, ACL_READ, win)) break; #endif - if (!wi) - for (wi = windows; wi; wi = wi->w_next) - if (!wi->w_layer.l_cvlist) + if (!win) + for (win = windows; win; win = win->w_next) + if (!win->w_layer.l_cvlist) break; - if (!wi) - for (wi = windows; wi; wi = wi->w_next) - if (wi->w_layer.l_cvlist && !IsOnDisplay(wi)) + if (!win) + for (win = windows; win; win = win->w_next) + if (win->w_layer.l_cvlist && !IsOnDisplay(win)) break; } #ifdef MULTIUSER - if (wi && AclCheckPermWin(D_user, ACL_READ, wi)) - wi = 0; + if (win && AclCheckPermWin(D_user, ACL_READ, win)) + win = 0; #endif - return wi; + return win; } #if 0 diff --git a/src/socket.c b/src/socket.c index 38d9393..32fca58 100644 --- a/src/socket.c +++ b/src/socket.c @@ -798,7 +798,7 @@ ttycmp(char *s1, char *s2) #endif static int -CreateTempDisplay(struct msg *m, int recvfd, struct win *wi) +CreateTempDisplay(struct msg *m, int recvfd, struct win *win) { int pid; int attach; @@ -865,7 +865,7 @@ CreateTempDisplay(struct msg *m, int recvfd, struct win *wi) if (attach) { - if (display || wi) + if (display || win) { write(i, "Attaching from inside of screen?\n", 33); close(i); @@ -401,7 +401,7 @@ RestoreLoginSlot() */ int -SetUtmp(struct win *wi) +SetUtmp(struct win *win) { register slot_t slot; struct utmp u; @@ -413,23 +413,23 @@ SetUtmp(struct win *wi) char *host = 0; #endif /* UTHOST */ - wi->w_slot = (slot_t)0; - if (!utmpok || wi->w_type != W_TYPE_PTY) + win->w_slot = (slot_t)0; + if (!utmpok || win->w_type != W_TYPE_PTY) return -1; - if ((slot = TtyNameSlot(wi->w_tty)) == (slot_t)0) + if ((slot = TtyNameSlot(win->w_tty)) == (slot_t)0) { - debug1("SetUtmp failed (tty %s).\n",wi->w_tty); + debug1("SetUtmp failed (tty %s).\n",win->w_tty); return -1; } - debug2("SetUtmp %d will get slot %d...\n", wi->w_number, (int)slot); + debug2("SetUtmp %d will get slot %d...\n", win->w_number, (int)slot); bzero((char *)&u, sizeof(u)); - if ((saved_ut = bcmp((char *) &wi->w_savut, (char *)&u, sizeof(u)))) + if ((saved_ut = bcmp((char *) &win->w_savut, (char *)&u, sizeof(u)))) /* restore original, of which we will adopt all fields but ut_host */ - bcopy((char *)&wi->w_savut, (char *) &u, sizeof(u)); + bcopy((char *)&win->w_savut, (char *) &u, sizeof(u)); if (!saved_ut) - makeuser(&u, stripdev(wi->w_tty), LoginName, wi->w_pid); + makeuser(&u, stripdev(win->w_tty), LoginName, win->w_pid); #ifdef UTHOST host[sizeof(host) - 15] = '\0'; @@ -468,7 +468,7 @@ SetUtmp(struct win *wi) else strncpy(host, "local", sizeof(host) - 15); - sprintf(host + strlen(host), ":S.%d", wi->w_number); + sprintf(host + strlen(host), ":S.%d", win->w_number); debug1("rlogin hostname: '%s'\n", host); # if !defined(_SEQUENT_) && !defined(sequent) @@ -476,15 +476,15 @@ SetUtmp(struct win *wi) # endif #endif /* UTHOST */ - if (pututslot(slot, &u, host, wi) == 0) + if (pututslot(slot, &u, host, win) == 0) { Msg(errno,"Could not write %s", UtmpName); UT_CLOSE; return -1; } debug("SetUtmp successful\n"); - wi->w_slot = slot; - bcopy((char *)&u, (char *)&wi->w_savut, sizeof(u)); + win->w_slot = slot; + bcopy((char *)&u, (char *)&win->w_savut, sizeof(u)); UT_CLOSE; return 0; } @@ -495,23 +495,23 @@ SetUtmp(struct win *wi) */ int -RemoveUtmp(struct win *wi) +RemoveUtmp(struct win *win) { struct utmp u, *uu; slot_t slot; - slot = wi->w_slot; + slot = win->w_slot; debug1("RemoveUtmp slot=%#x\n", slot); if (!utmpok) return -1; if (slot == (slot_t)0 || slot == (slot_t)-1) { - wi->w_slot = (slot_t)-1; + win->w_slot = (slot_t)-1; return 0; } bzero((char *) &u, sizeof(u)); #ifdef sgi - bcopy((char *)&wi->w_savut, (char *)&u, sizeof(u)); + bcopy((char *)&win->w_savut, (char *)&u, sizeof(u)); uu = &u; #else if ((uu = getutslot(slot)) == 0) @@ -519,18 +519,18 @@ RemoveUtmp(struct win *wi) Msg(0, "Utmp slot not found -> not removed"); return -1; } - bcopy((char *)uu, (char *)&wi->w_savut, sizeof(wi->w_savut)); + bcopy((char *)uu, (char *)&win->w_savut, sizeof(win->w_savut)); #endif u = *uu; makedead(&u); - if (pututslot(slot, &u, (char *)0, wi) == 0) + if (pututslot(slot, &u, (char *)0, win) == 0) { Msg(errno,"Could not write %s", UtmpName); UT_CLOSE; return -1; } debug("RemoveUtmp successfull\n"); - wi->w_slot = (slot_t)-1; + win->w_slot = (slot_t)-1; UT_CLOSE; return 0; } @@ -557,7 +557,7 @@ getutslot(slot_t slot) } static int -pututslot(slot_t slot, struct utmp *u, char *host, struct win *wi) +pututslot(slot_t slot, struct utmp *u, char *host, struct win *win) { #ifdef _SEQUENT_ if (SLOT_USED(u) && host && *host) @@ -566,13 +566,13 @@ pututslot(slot_t slot, struct utmp *u, char *host, struct win *wi) return ut_delete_user(slot, u.ut_pid, 0, 0) != 0; #endif #ifdef HAVE_UTEMPTER - if (eff_uid && wi && wi->w_ptyfd != -1) + if (eff_uid && win && win->w_ptyfd != -1) { /* sigh, linux hackers made the helper functions void */ if (SLOT_USED(u)) - addToUtmp(wi->w_tty, host, wi->w_ptyfd); + addToUtmp(win->w_tty, host, win->w_ptyfd); else - removeLineFromUtmp(wi->w_tty, wi->w_ptyfd); + removeLineFromUtmp(win->w_tty, win->w_ptyfd); return 1; /* pray for success */ } #endif @@ -684,7 +684,7 @@ getutslot(slot_t slot) } static int -pututslot(slot_t slot, struct utmp *u, char *host, struct win *wi) +pututslot(slot_t slot, struct utmp *u, char *host, struct win *win) { #ifdef sequent if (SLOT_USED(u)) |