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

Diff for /src/usr.bin/tmux/input.c between version 1.51 and 1.52

version 1.51, 2012/03/20 11:01:00 version 1.52, 2012/04/25 21:12:49
Line 47 
Line 47 
  */   */
   
 /* Helper functions. */  /* Helper functions. */
   struct input_transition;
 int     input_split(struct input_ctx *);  int     input_split(struct input_ctx *);
 int     input_get(struct input_ctx *, u_int, int, int);  int     input_get(struct input_ctx *, u_int, int, int);
 void    input_reply(struct input_ctx *, const char *, ...);  void    input_reply(struct input_ctx *, const char *, ...);
   void    input_set_state(struct window_pane *, const struct input_transition *);
   
 /* Transition entry/exit handlers. */  /* Transition entry/exit handlers. */
 void    input_clear(struct input_ctx *);  void    input_clear(struct input_ctx *);
Line 692 
Line 694 
   
         ictx->state = &input_state_ground;          ictx->state = &input_state_ground;
         ictx->flags = 0;          ictx->flags = 0;
   
           ictx->since_ground = evbuffer_new();
 }  }
   
 /* Destroy input parser. */  /* Destroy input parser. */
 void  void
 input_free(unused struct window_pane *wp)  input_free(struct window_pane *wp)
 {  {
           if (wp != NULL)
                   evbuffer_free(wp->ictx.since_ground);
 }  }
   
   /* Change input state. */
   void
   input_set_state(struct window_pane *wp, const struct input_transition *itr)
   {
           struct input_ctx        *ictx = &wp->ictx;
           struct evbuffer         *ground_evb = ictx->since_ground;
   
           if (ictx->state->exit != NULL)
                   ictx->state->exit(ictx);
   
           if (itr->state == &input_state_ground)
                   evbuffer_drain(ground_evb, EVBUFFER_LENGTH(ground_evb));
   
           ictx->state = itr->state;
           if (ictx->state->enter != NULL)
                   ictx->state->enter(ictx);
   }
   
 /* Parse input. */  /* Parse input. */
 void  void
 input_parse(struct window_pane *wp)  input_parse(struct window_pane *wp)
Line 755 
Line 779 
                         continue;                          continue;
   
                 /* And switch state, if necessary. */                  /* And switch state, if necessary. */
                 if (itr->state != NULL) {                  if (itr->state != NULL)
                         if (ictx->state->exit != NULL)                          input_set_state(wp, itr);
                                 ictx->state->exit(ictx);  
                         ictx->state = itr->state;                  /* If not in ground state, save input. */
                         if (ictx->state->enter != NULL)                  if (ictx->state != &input_state_ground)
                                 ictx->state->enter(ictx);                          evbuffer_add(ictx->since_ground, &ictx->ch, 1);
                 }  
         }          }
   
         /* Close the screen. */          /* Close the screen. */

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.52