[BACK]Return to window.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mg

Diff for /src/usr.bin/mg/window.c between version 1.18 and 1.19

version 1.18, 2005/10/11 01:08:53 version 1.19, 2005/11/18 20:56:53
Line 8 
Line 8 
   
 #include "def.h"  #include "def.h"
   
 MGWIN *  struct mgwin *
 new_window(BUFFER *bp)  new_window(struct buffer *bp)
 {  {
         MGWIN *wp;          struct mgwin *wp;
   
         wp = calloc(1, sizeof(MGWIN));          wp = calloc(1, sizeof(struct mgwin));
         if (wp == NULL)          if (wp == NULL)
                 return (NULL);                  return (NULL);
   
Line 67 
Line 67 
 int  int
 refresh(int f, int n)  refresh(int f, int n)
 {  {
         MGWIN   *wp;          struct mgwin    *wp;
         int      oldnrow;          int              oldnrow, oldncol;
         int      oldncol;  
   
         oldnrow = nrow;          oldnrow = nrow;
         oldncol = ncol;          oldncol = ncol;
Line 103 
Line 102 
 int  int
 nextwind(int f, int n)  nextwind(int f, int n)
 {  {
         MGWIN   *wp;          struct mgwin    *wp;
   
         if ((wp = curwp->w_wndp) == NULL)          if ((wp = curwp->w_wndp) == NULL)
                 wp = wheadp;                  wp = wheadp;
Line 122 
Line 121 
 int  int
 prevwind(int f, int n)  prevwind(int f, int n)
 {  {
         MGWIN   *wp1, *wp2;          struct mgwin    *wp1, *wp2;
   
         wp1 = wheadp;          wp1 = wheadp;
         wp2 = curwp;          wp2 = curwp;
Line 146 
Line 145 
 int  int
 onlywind(int f, int n)  onlywind(int f, int n)
 {  {
         MGWIN   *wp;          struct mgwin    *wp;
         LINE    *lp;          struct line     *lp;
         int      i;          int              i;
   
         while (wheadp != curwp) {          while (wheadp != curwp) {
                 wp = wheadp;                  wp = wheadp;
Line 196 
Line 195 
 int  int
 splitwind(int f, int n)  splitwind(int f, int n)
 {  {
         MGWIN   *wp, *wp1, *wp2;          struct mgwin    *wp, *wp1, *wp2;
         LINE    *lp;          struct line     *lp;
         int      ntru, ntrd, ntrl;          int              ntru, ntrd, ntrl;
   
         if (curwp->w_ntrows < 3) {          if (curwp->w_ntrows < 3) {
                 ewprintf("Cannot split a %d line window", curwp->w_ntrows);                  ewprintf("Cannot split a %d line window", curwp->w_ntrows);
Line 279 
Line 278 
 int  int
 enlargewind(int f, int n)  enlargewind(int f, int n)
 {  {
         MGWIN   *adjwp;          struct mgwin    *adjwp;
         LINE    *lp;          struct line     *lp;
         int      i;          int              i;
   
         if (n < 0)          if (n < 0)
                 return (shrinkwind(f, -n));                  return (shrinkwind(f, -n));
Line 328 
Line 327 
 int  int
 shrinkwind(int f, int n)  shrinkwind(int f, int n)
 {  {
         MGWIN   *adjwp;          struct mgwin    *adjwp;
         LINE    *lp;          struct line     *lp;
         int      i;          int              i;
   
         if (n < 0)          if (n < 0)
                 return (enlargewind(f, -n));                  return (enlargewind(f, -n));
Line 382 
Line 381 
 int  int
 delwind(int f, int n)  delwind(int f, int n)
 {  {
         MGWIN   *wp, *nwp;          struct mgwin    *wp, *nwp;
   
         wp = curwp;             /* Cheap...              */          wp = curwp;             /* Cheap...              */
   
Line 416 
Line 415 
  * Pick the uppermost window that isn't the current window. An LRU algorithm   * Pick the uppermost window that isn't the current window. An LRU algorithm
  * might be better. Return a pointer, or NULL on error.   * might be better. Return a pointer, or NULL on error.
  */   */
 MGWIN *  struct mgwin *
 wpopup(void)  wpopup(void)
 {  {
         MGWIN   *wp;          struct mgwin    *wp;
   
         if (wheadp->w_wndp == NULL &&          if (wheadp->w_wndp == NULL &&
             splitwind(FFRAND, 0) == FALSE)              splitwind(FFRAND, 0) == FALSE)

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19