diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-06 14:10:32 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-06 14:10:32 +0000 |
commit | ca1ee217023b431bac179023c2b70e13427c4ab0 (patch) | |
tree | 8fbc261392ff2e39f7a5d19594da2c2b0c248fee /tmux.h | |
parent | ac3fe6512f47e72ba108e04392d1f2e548774af9 (diff) | |
download | rtmux-ca1ee217023b431bac179023c2b70e13427c4ab0.tar.gz rtmux-ca1ee217023b431bac179023c2b70e13427c4ab0.tar.bz2 rtmux-ca1ee217023b431bac179023c2b70e13427c4ab0.zip |
Switch to splay tree for key bindings.
Diffstat (limited to 'tmux.h')
-rw-r--r-- | tmux.h | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $Id: tmux.h,v 1.204 2008-12-15 21:21:56 nicm Exp $ */ +/* $Id: tmux.h,v 1.205 2009-01-06 14:10:32 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -831,11 +831,13 @@ struct cmd_option_data { }; /* Key binding. */ -struct binding { +struct key_binding { int key; struct cmd *cmd; + + SPLAY_ENTRY(key_binding) entry; }; -ARRAY_DECL(bindings, struct binding *); +SPLAY_HEAD(key_bindings, key_binding); /* Set/display option data. */ struct set_option_entry { @@ -1122,7 +1124,10 @@ void client_write_server2( void client_fill_session(struct msg_command_data *); /* key-bindings.c */ -extern struct bindings key_bindings; +extern struct key_bindings key_bindings; +int key_bindings_cmp(struct key_binding *, struct key_binding *); +SPLAY_PROTOTYPE(key_bindings, key_binding, entry, key_bindings_cmp); +struct key_binding *key_bindings_lookup(int); void key_bindings_add(int, struct cmd *); void key_bindings_remove(int); void key_bindings_init(void); |