# winlink_add

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

```c
struct winlink * winlink_add(struct winlinks *wwl, int idx)
```

## Parameters

- `wwl` (`struct winlinks *`)
- `idx` (`int`)

## Called by

- [`session_group_synchronize1`](/en/tmux/3.7c/reference/c-function-session-c-session_group_synchronize1/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L657)
- [`session_renumber_windows`](/en/tmux/3.7c/reference/c-function-session_renumber_windows/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L710)

## Calls

- [`xcalloc`](/en/tmux/3.7c/reference/c-function-xcalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L176)

## Other function references

- [`winlink_find_by_index`](/en/tmux/3.7c/reference/c-function-winlink_find_by_index/) (function)
- [`winlink_next_index`](/en/tmux/3.7c/reference/c-function-window-c-winlink_next_index/) (function)

## Referenced by

- [`session_attach`](/en/tmux/3.7c/reference/c-function-session_attach/) (function)
- [`spawn_window`](/en/tmux/3.7c/reference/c-function-spawn_window/) (function)

## Referenced declarations

- [`winlink.idx`](/en/tmux/3.7c/reference/c-struct-winlink-idx/) (attribute)
- [`winlink`](/en/tmux/3.7c/reference/c-struct-winlink/) (struct)
- [`winlinks`](/en/tmux/3.7c/reference/c-struct-winlinks/) (struct)
