summaryrefslogtreecommitdiffstats
path: root/cmd-list-keys.c
diff options
context:
space:
mode:
authornicm <nicm>2018-08-02 11:44:07 +0000
committernicm <nicm>2018-08-02 11:44:07 +0000
commit6048b0f48337b8d2359d9996a59665640278677c (patch)
tree1e6d7378f94d9d00bb721e5f1e81e957d548e949 /cmd-list-keys.c
parentf12b8574155b12313afc63f7b6dd9baa261c9710 (diff)
Make key trees and some other bits static.
Diffstat (limited to 'cmd-list-keys.c')
-rw-r--r--cmd-list-keys.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/cmd-list-keys.c b/cmd-list-keys.c
index 9e0cac62..5efb0cd2 100644
--- a/cmd-list-keys.c
+++ b/cmd-list-keys.c
@@ -75,10 +75,14 @@ cmd_list_keys_exec(struct cmd *self, struct cmdq_item *item)
repeat = 0;
tablewidth = keywidth = 0;
- RB_FOREACH(table, key_tables, &key_tables) {
- if (tablename != NULL && strcmp(table->name, tablename) != 0)
+ table = key_bindings_first_table ();
+ while (table != NULL) {
+ if (tablename != NULL && strcmp(table->name, tablename) != 0) {
+ table = key_bindings_next_table(table);
continue;
- RB_FOREACH(bd, key_bindings, &table->key_bindings) {
+ }
+ bd = key_bindings_first(table);
+ while (bd != NULL) {
key = key_string_lookup_key(bd->key);
if (bd->flags & KEY_BINDING_REPEAT)
@@ -90,13 +94,20 @@ cmd_list_keys_exec(struct cmd *self, struct cmdq_item *item)
width = utf8_cstrwidth(key);
if (width > keywidth)
keywidth = width;
+
+ bd = key_bindings_next(table, bd);
}
+ table = key_bindings_next_table(table);
}
- RB_FOREACH(table, key_tables, &key_tables) {
- if (tablename != NULL && strcmp(table->name, tablename) != 0)
+ table = key_bindings_first_table ();
+ while (table != NULL) {
+ if (tablename != NULL && strcmp(table->name, tablename) != 0) {
+ table = key_bindings_next_table(table);
continue;
- RB_FOREACH(bd, key_bindings, &table->key_bindings) {
+ }
+ bd = key_bindings_first(table);
+ while (bd != NULL) {
key = key_string_lookup_key(bd->key);
if (!repeat)
@@ -122,7 +133,9 @@ cmd_list_keys_exec(struct cmd *self, struct cmdq_item *item)
free(cp);
cmdq_print(item, "bind-key %s", tmp);
+ bd = key_bindings_next(table, bd);
}
+ table = key_bindings_next_table(table);
}
return (CMD_RETURN_NORMAL);