# sort_get_clients

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

```c
struct client ** sort_get_clients(u_int *n, struct sort_criteria *sort_crit)
```

## Parameters

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

## Called by

- [`cmd_list_clients_exec`](/en/tmux/3.7c/reference/c-function-cmd-list-clients-c-cmd_list_clients_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-list-clients.c#L83)
- [`format_loop_clients`](/en/tmux/3.7c/reference/c-function-format-c-format_loop_clients/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format.c#L4887)
- [`window_client_build`](/en/tmux/3.7c/reference/c-function-window-client-c-window_client_build/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-client.c#L132)

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

## Other function references

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

## Referenced declarations

- [`client`](/en/tmux/3.7c/reference/c-struct-client/) (struct)
- [`CLIENT_ATTACHED`](/en/tmux/3.7c/reference/c-define-tmux-h-client_attached/) (constant)
- [`CLIENT_UNATTACHEDFLAGS`](/en/tmux/3.7c/reference/c-define-tmux-h-client_unattachedflags/) (constant)
- [`client.entry`](/en/tmux/3.7c/reference/c-struct-client-entry/) (attribute)
- [`client.flags`](/en/tmux/3.7c/reference/c-struct-client-flags/) (attribute)
- [`sort_criteria`](/en/tmux/3.7c/reference/c-struct-sort_criteria/) (struct)
