# sort_get_winlinks

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

```c
struct winlink ** sort_get_winlinks(u_int *n, struct sort_criteria *sort_crit)
```

## Parameters

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

## Called by

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

## Calls

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

## Other function references

- [`sort_winlink_cmp`](/en/tmux/3.7c/reference/c-function-sort-c-sort_winlink_cmp/) (function)

## Referenced declarations

- [`sort_criteria`](/en/tmux/3.7c/reference/c-struct-sort_criteria/) (struct)
- [`session.windows`](/en/tmux/3.7c/reference/c-struct-session-windows/) (attribute)
- [`winlink`](/en/tmux/3.7c/reference/c-struct-winlink/) (struct)
