# sort_get_winlinks_session

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

```c
struct winlink ** sort_get_winlinks_session(struct session *s, u_int *n, struct sort_criteria *sort_crit)
```

## Parameters

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

## Called by

- [`cmd_list_windows_exec`](/en/tmux/latest/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#L87)
- [`format_loop_windows`](/en/tmux/latest/reference/c-function-format-c-format_loop_windows/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format.c#L4768)
- [`window_tree_build_session`](/en/tmux/latest/reference/c-function-window-tree-c-window_tree_build_session/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L336)

## 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#L615)
- [`xreallocarray`](/en/tmux/latest/reference/c-function-xreallocarray/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/sort.c#L610)

## Other function references

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

## Referenced declarations

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