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

Diff for /src/usr.bin/tmux/paste.c between version 1.27 and 1.28

version 1.27, 2015/04/07 13:06:22 version 1.28, 2015/08/29 09:25:00
Line 30 
Line 30 
  * string!   * string!
  */   */
   
   struct paste_buffer {
           char            *data;
           size_t           size;
   
           char            *name;
           int              automatic;
           u_int            order;
   
           RB_ENTRY(paste_buffer) name_entry;
           RB_ENTRY(paste_buffer) time_entry;
   };
   
 u_int   paste_next_index;  u_int   paste_next_index;
 u_int   paste_next_order;  u_int   paste_next_order;
 u_int   paste_num_automatic;  u_int   paste_num_automatic;
Line 60 
Line 72 
         return (0);          return (0);
 }  }
   
   /* Get paste buffer name. */
   const char *
   paste_buffer_name(struct paste_buffer *pb)
   {
           return (pb->name);
   }
   
   /* Get paste buffer data. */
   const char *
   paste_buffer_data(struct paste_buffer *pb, size_t *size)
   {
           if (size != NULL)
                   *size = pb->size;
           return (pb->data);
   }
   
 /* Walk paste buffers by name. */  /* Walk paste buffers by name. */
 struct paste_buffer *  struct paste_buffer *
 paste_walk(struct paste_buffer *pb)  paste_walk(struct paste_buffer *pb)
Line 71 
Line 99 
   
 /* Get the most recent automatic buffer. */  /* Get the most recent automatic buffer. */
 struct paste_buffer *  struct paste_buffer *
 paste_get_top(void)  paste_get_top(const char **name)
 {  {
         struct paste_buffer     *pb;          struct paste_buffer     *pb;
   
         pb = RB_MIN(paste_time_tree, &paste_by_time);          pb = RB_MIN(paste_time_tree, &paste_by_time);
         if (pb == NULL)          if (pb == NULL)
                 return (NULL);                  return (NULL);
           if (name != NULL)
                   *name = pb->name;
         return (pb);          return (pb);
 }  }
   
Line 87 
Line 117 
 {  {
         struct paste_buffer     *pb;          struct paste_buffer     *pb;
   
         pb = paste_get_top();          pb = paste_get_top(NULL);
         if (pb == NULL)          if (pb == NULL)
                 return (-1);                  return (-1);
         return (paste_free_name(pb->name));          return (paste_free_name(pb->name));

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28