return number of extended commands bound to a non-default key */
| 2205 | |
| 2206 | /* return number of extended commands bound to a non-default key */ |
| 2207 | int |
| 2208 | count_bind_keys(void) |
| 2209 | { |
| 2210 | struct Cmd_bind *bind = gc.Cmd.cmdbinds; |
| 2211 | int i, nbinds = 0; |
| 2212 | uchar keys[256]; |
| 2213 | |
| 2214 | (void) memset(keys, 0, sizeof(uchar) * 256); |
| 2215 | |
| 2216 | /* commands bound to different key */ |
| 2217 | while (bind) { |
| 2218 | keys[bind->key] = 1; |
| 2219 | if (bind->userbind && bind->cmd && bind->cmd->key != bind->key) { |
| 2220 | nbinds++; |
| 2221 | } |
| 2222 | bind = bind->next; |
| 2223 | } |
| 2224 | |
| 2225 | /* commands which should be bound to a key, but aren't */ |
| 2226 | for (i = 0; i < extcmdlist_length; i++) |
| 2227 | if (extcmdlist[i].key && !keys[extcmdlist[i].key]) |
| 2228 | nbinds++; |
| 2229 | |
| 2230 | return nbinds; |
| 2231 | } |
| 2232 | |
| 2233 | /* show changed key bindings in text, or if sbuf is non-null, append to it */ |
| 2234 | void |
no outgoing calls
no test coverage detected