=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/key-bindings.c,v retrieving revision 1.28 retrieving revision 1.29 diff -c -r1.28 -r1.29 *** src/usr.bin/tmux/key-bindings.c 2011/07/03 18:18:15 1.28 --- src/usr.bin/tmux/key-bindings.c 2012/01/21 11:12:13 1.29 *************** *** 1,4 **** ! /* $OpenBSD: key-bindings.c,v 1.28 2011/07/03 18:18:15 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: key-bindings.c,v 1.29 2012/01/21 11:12:13 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 24,30 **** #include "tmux.h" ! SPLAY_GENERATE(key_bindings, key_binding, entry, key_bindings_cmp); struct key_bindings key_bindings; struct key_bindings dead_key_bindings; --- 24,30 ---- #include "tmux.h" ! RB_GENERATE(key_bindings, key_binding, entry, key_bindings_cmp); struct key_bindings key_bindings; struct key_bindings dead_key_bindings; *************** *** 52,58 **** struct key_binding bd; bd.key = key; ! return (SPLAY_FIND(key_bindings, &key_bindings, &bd)); } void --- 52,58 ---- struct key_binding bd; bd.key = key; ! return (RB_FIND(key_bindings, &key_bindings, &bd)); } void *************** *** 64,70 **** bd = xmalloc(sizeof *bd); bd->key = key; ! SPLAY_INSERT(key_bindings, &key_bindings, bd); bd->can_repeat = can_repeat; bd->cmdlist = cmdlist; --- 64,70 ---- bd = xmalloc(sizeof *bd); bd->key = key; ! RB_INSERT(key_bindings, &key_bindings, bd); bd->can_repeat = can_repeat; bd->cmdlist = cmdlist; *************** *** 77,84 **** if ((bd = key_bindings_lookup(key)) == NULL) return; ! SPLAY_REMOVE(key_bindings, &key_bindings, bd); ! SPLAY_INSERT(key_bindings, &dead_key_bindings, bd); } void --- 77,84 ---- if ((bd = key_bindings_lookup(key)) == NULL) return; ! RB_REMOVE(key_bindings, &key_bindings, bd); ! RB_INSERT(key_bindings, &dead_key_bindings, bd); } void *************** *** 86,94 **** { struct key_binding *bd; ! while (!SPLAY_EMPTY(&dead_key_bindings)) { ! bd = SPLAY_ROOT(&dead_key_bindings); ! SPLAY_REMOVE(key_bindings, &dead_key_bindings, bd); cmd_list_free(bd->cmdlist); xfree(bd); } --- 86,94 ---- { struct key_binding *bd; ! while (!RB_EMPTY(&dead_key_bindings)) { ! bd = RB_ROOT(&dead_key_bindings); ! RB_REMOVE(key_bindings, &dead_key_bindings, bd); cmd_list_free(bd->cmdlist); xfree(bd); } *************** *** 179,185 **** struct cmd *cmd; struct cmd_list *cmdlist; ! SPLAY_INIT(&key_bindings); for (i = 0; i < nitems(table); i++) { cmdlist = xmalloc(sizeof *cmdlist); --- 179,185 ---- struct cmd *cmd; struct cmd_list *cmdlist; ! RB_INIT(&key_bindings); for (i = 0; i < nitems(table); i++) { cmdlist = xmalloc(sizeof *cmdlist);