# cmd_list_keys_get_root_and_prefix

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-list-keys.c#L96
- **Page:** https://libtmux.org/en/tmux/3.7c/reference/c-function-cmd-list-keys-c-cmd_list_keys_get_root_and_prefix/

```c
static struct key_binding ** cmd_list_keys_get_root_and_prefix(u_int *n, struct sort_criteria *sort_crit)
```

## Parameters

- `n` (`u_int *`)
- `sort_crit` (`struct sort_criteria *`)

## Called by

- [`cmd_list_keys_exec`](/en/tmux/3.7c/reference/c-function-cmd-list-keys-c-cmd_list_keys_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-list-keys.c#L216)

## Calls

- [`key_bindings_get_table`](/en/tmux/3.7c/reference/c-function-key_bindings_get_table/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-list-keys.c#L106)
- [`sort_get_key_bindings_table`](/en/tmux/3.7c/reference/c-function-sort_get_key_bindings_table/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-list-keys.c#L107)
- [`xreallocarray`](/en/tmux/3.7c/reference/c-function-xreallocarray/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-list-keys.c#L111)

## Referenced declarations

- [`key_binding`](/en/tmux/3.7c/reference/c-struct-key_binding/) (struct)
- [`nitems`](/en/tmux/3.7c/reference/c-define-tmux-h-nitems/) (constant)
- [`sort_criteria`](/en/tmux/3.7c/reference/c-struct-sort_criteria/) (struct)
