# sort_get_panes_window

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/sort.c#L548
- **Page:** https://libtmux.org/en/tmux/latest/reference/c-function-sort_get_panes_window/

```c
struct window_pane ** sort_get_panes_window(struct window *w, u_int *n, struct sort_criteria *sort_crit)
```

## Parameters

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

## Called by

- [`cmd_list_panes_window`](/en/tmux/latest/reference/c-function-cmd-list-panes-c-cmd_list_panes_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-list-panes.c#L145)
- [`format_loop_panes`](/en/tmux/latest/reference/c-function-format-c-format_loop_panes/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format.c#L4839)
- [`window_tree_build_window`](/en/tmux/latest/reference/c-function-window-tree-c-window_tree_build_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L288)

## Calls

- [`sort_qsort`](/en/tmux/latest/reference/c-function-sort-c-sort_qsort/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/sort.c#L565)
- [`xreallocarray`](/en/tmux/latest/reference/c-function-xreallocarray/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/sort.c#L560)

## Other function references

- [`sort_pane_cmp`](/en/tmux/latest/reference/c-function-sort-c-sort_pane_cmp/) (function)

## Referenced declarations

- [`window_pane.entry`](/en/tmux/latest/reference/c-struct-window_pane-entry/) (attribute)
- [`window.panes`](/en/tmux/latest/reference/c-struct-window-panes/) (attribute)
- [`sort_criteria`](/en/tmux/latest/reference/c-struct-sort_criteria/) (struct)
- [`window`](/en/tmux/latest/reference/c-struct-window/) (struct)
- [`window_pane`](/en/tmux/latest/reference/c-struct-window_pane/) (struct)
