# sort_would_window_tree_swap

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

```c
int sort_would_window_tree_swap(struct sort_criteria *sort_crit, struct winlink *wla, struct winlink *wlb)
```

## Parameters

- `sort_crit` (`struct sort_criteria *`)
- `wla` (`struct winlink *`)
- `wlb` (`struct winlink *`)

## Called by

- [`window_tree_swap`](/en/tmux/latest/reference/c-function-window-tree-c-window_tree_swap/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L846)

## Calls

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

## Referenced declarations

- [`sort_criteria.order`](/en/tmux/latest/reference/c-struct-sort_criteria-order/) (attribute)
- [`sort_criteria`](/en/tmux/latest/reference/c-struct-sort_criteria/) (struct)
- [`SORT_INDEX`](/en/tmux/latest/reference/c-enum-sort_order-sort_index/) (constant)
- [`winlink`](/en/tmux/latest/reference/c-struct-winlink/) (struct)
