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

Diff for /src/usr.bin/tmux/key-bindings.c between version 1.28 and 1.29

version 1.28, 2011/07/03 18:18:15 version 1.29, 2012/01/21 11:12:13
Line 24 
Line 24 
   
 #include "tmux.h"  #include "tmux.h"
   
 SPLAY_GENERATE(key_bindings, key_binding, entry, key_bindings_cmp);  RB_GENERATE(key_bindings, key_binding, entry, key_bindings_cmp);
   
 struct key_bindings     key_bindings;  struct key_bindings     key_bindings;
 struct key_bindings     dead_key_bindings;  struct key_bindings     dead_key_bindings;
Line 52 
Line 52 
         struct key_binding      bd;          struct key_binding      bd;
   
         bd.key = key;          bd.key = key;
         return (SPLAY_FIND(key_bindings, &key_bindings, &bd));          return (RB_FIND(key_bindings, &key_bindings, &bd));
 }  }
   
 void  void
Line 64 
Line 64 
   
         bd = xmalloc(sizeof *bd);          bd = xmalloc(sizeof *bd);
         bd->key = key;          bd->key = key;
         SPLAY_INSERT(key_bindings, &key_bindings, bd);          RB_INSERT(key_bindings, &key_bindings, bd);
   
         bd->can_repeat = can_repeat;          bd->can_repeat = can_repeat;
         bd->cmdlist = cmdlist;          bd->cmdlist = cmdlist;
Line 77 
Line 77 
   
         if ((bd = key_bindings_lookup(key)) == NULL)          if ((bd = key_bindings_lookup(key)) == NULL)
                 return;                  return;
         SPLAY_REMOVE(key_bindings, &key_bindings, bd);          RB_REMOVE(key_bindings, &key_bindings, bd);
         SPLAY_INSERT(key_bindings, &dead_key_bindings, bd);          RB_INSERT(key_bindings, &dead_key_bindings, bd);
 }  }
   
 void  void
Line 86 
Line 86 
 {  {
         struct key_binding      *bd;          struct key_binding      *bd;
   
         while (!SPLAY_EMPTY(&dead_key_bindings)) {          while (!RB_EMPTY(&dead_key_bindings)) {
                 bd = SPLAY_ROOT(&dead_key_bindings);                  bd = RB_ROOT(&dead_key_bindings);
                 SPLAY_REMOVE(key_bindings, &dead_key_bindings, bd);                  RB_REMOVE(key_bindings, &dead_key_bindings, bd);
                 cmd_list_free(bd->cmdlist);                  cmd_list_free(bd->cmdlist);
                 xfree(bd);                  xfree(bd);
         }          }
Line 179 
Line 179 
         struct cmd      *cmd;          struct cmd      *cmd;
         struct cmd_list *cmdlist;          struct cmd_list *cmdlist;
   
         SPLAY_INIT(&key_bindings);          RB_INIT(&key_bindings);
   
         for (i = 0; i < nitems(table); i++) {          for (i = 0; i < nitems(table); i++) {
                 cmdlist = xmalloc(sizeof *cmdlist);                  cmdlist = xmalloc(sizeof *cmdlist);

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