# window_tree_build

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-tree.c#L454
- **Page:** https://libtmux.org/en/tmux/3.2a/reference/c-function-window-tree-c-window_tree_build/

```c
static void window_tree_build(void *modedata, struct mode_tree_sort_criteria *sort_crit, uint64_t *tag, const char *filter)
```

## Parameters

- `modedata` (`void *`)
- `sort_crit` (`struct mode_tree_sort_criteria *`)
- `tag` (`uint64_t *`)
- `filter` (`const char *`)

## Calls

- [`session_group_contains`](/en/tmux/3.2a/reference/c-function-session_group_contains/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-tree.c#L462)
- [`window_count_panes`](/en/tmux/3.2a/reference/c-function-window_count_panes/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-tree.c#L499)
- [`window_tree_build_session`](/en/tmux/3.2a/reference/c-function-window-tree-c-window_tree_build_session/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-tree.c#L486)
- [`window_tree_free_item`](/en/tmux/3.2a/reference/c-function-window-tree-c-window_tree_free_item/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-tree.c#L465)
- [`xreallocarray`](/en/tmux/3.2a/reference/c-function-xreallocarray/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-tree.c#L479)

## Other function references

- [`window_tree_cmp_session`](/en/tmux/3.2a/reference/c-function-window-tree-c-window_tree_cmp_session/) (function)

## Referenced by

- [`window_tree_init`](/en/tmux/3.2a/reference/c-function-window-tree-c-window_tree_init/) (function)

## Referenced declarations

- [`window_tree_modedata.data`](/en/tmux/3.2a/reference/c-struct-window_tree_modedata-data/) (attribute)
- [`window_tree_modedata.fs`](/en/tmux/3.2a/reference/c-struct-window_tree_modedata-fs/) (attribute)
- [`window_tree_modedata.item_list`](/en/tmux/3.2a/reference/c-struct-window_tree_modedata-item_list/) (attribute)
- [`window_tree_modedata.item_size`](/en/tmux/3.2a/reference/c-struct-window_tree_modedata-item_size/) (attribute)
- [`mode_tree_sort_criteria`](/en/tmux/3.2a/reference/c-struct-mode_tree_sort_criteria/) (struct)
- [`cmd_find_state.s`](/en/tmux/3.2a/reference/c-struct-cmd_find_state-s/) (attribute)
- [`session_group.sessions`](/en/tmux/3.2a/reference/c-struct-session_group-sessions/) (attribute)
- [`window_tree_modedata.squash_groups`](/en/tmux/3.2a/reference/c-struct-window_tree_modedata-squash_groups/) (attribute)
- [`window_tree_modedata.type`](/en/tmux/3.2a/reference/c-struct-window_tree_modedata-type/) (attribute)
- [`winlink.window`](/en/tmux/3.2a/reference/c-struct-winlink-window/) (attribute)
- [`WINDOW_TREE_NONE`](/en/tmux/3.2a/reference/c-enum-window_tree_type-window_tree_none/) (constant)
- [`WINDOW_TREE_PANE`](/en/tmux/3.2a/reference/c-enum-window_tree_type-window_tree_pane/) (constant)
- [`WINDOW_TREE_SESSION`](/en/tmux/3.2a/reference/c-enum-window_tree_type-window_tree_session/) (constant)
- [`window_tree_sort`](/en/tmux/3.2a/reference/c-variable-window-tree-c-window_tree_sort/) (attribute)
- [`WINDOW_TREE_WINDOW`](/en/tmux/3.2a/reference/c-enum-window_tree_type-window_tree_window/) (constant)
- [`cmd_find_state.wl`](/en/tmux/3.2a/reference/c-struct-cmd_find_state-wl/) (attribute)
- [`cmd_find_state.wp`](/en/tmux/3.2a/reference/c-struct-cmd_find_state-wp/) (attribute)
