# format_add

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/format.c#L3126
- **Page:** https://libtmux.org/en/tmux/3.2a/reference/c-function-format_add/

```c
void format_add(struct format_tree *ft, const char *key, const char *fmt,...)
```

## Parameters

- `ft` (`struct format_tree *`)
- `key` (`const char *`)
- `fmt` (`const char *`)
- `` (`...`)

## Called by

- [`cmd_display_menu_get_position`](/en/tmux/3.2a/reference/c-function-cmd-display-menu-c-cmd_display_menu_get_position/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-display-menu.c#L95)
- [`cmd_list_clients_exec`](/en/tmux/3.2a/reference/c-function-cmd-list-clients-c-cmd_list_clients_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-list-clients.c#L77)
- [`cmd_list_keys_commands`](/en/tmux/3.2a/reference/c-function-cmd-list-keys-c-cmd_list_keys_commands/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-list-keys.c#L347)
- [`cmd_list_panes_window`](/en/tmux/3.2a/reference/c-function-cmd-list-panes-c-cmd_list_panes_window/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-list-panes.c#L130)
- [`cmd_list_sessions_exec`](/en/tmux/3.2a/reference/c-function-cmd-list-sessions-c-cmd_list_sessions_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-list-sessions.c#L70)
- [`cmd_list_windows_session`](/en/tmux/3.2a/reference/c-function-cmd-list-windows-c-cmd_list_windows_session/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-list-windows.c#L112)
- [`cmd_show_messages_exec`](/en/tmux/3.2a/reference/c-function-cmd-show-messages-c-cmd_show_messages_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-show-messages.c#L96)
- [`cmdq_add_format`](/en/tmux/3.2a/reference/c-function-cmdq_add_format/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-queue.c#L267)
- [`cmdq_merge_formats`](/en/tmux/3.2a/reference/c-function-cmdq_merge_formats/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-queue.c#L280)
- [`format_merge`](/en/tmux/3.2a/reference/c-function-format_merge/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/format.c#L3018)
- [`window_buffer_get_key`](/en/tmux/3.2a/reference/c-function-window-buffer-c-window_buffer_get_key/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-buffer.c#L317)
- [`window_client_get_key`](/en/tmux/3.2a/reference/c-function-window-client-c-window_client_get_key/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-client.c#L278)
- [`window_copy_formats`](/en/tmux/3.2a/reference/c-function-window-copy-c-window_copy_formats/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-copy.c#L752)
- [`window_customize_build`](/en/tmux/3.2a/reference/c-function-window-customize-c-window_customize_build/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-customize.c#L548)
- [`window_customize_build_array`](/en/tmux/3.2a/reference/c-function-window-customize-c-window_customize_build_array/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-customize.c#L247)
- [`window_customize_build_keys`](/en/tmux/3.2a/reference/c-function-window-customize-c-window_customize_build_keys/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-customize.c#L462)
- [`window_customize_build_option`](/en/tmux/3.2a/reference/c-function-window-customize-c-window_customize_build_option/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-customize.c#L295)
- [`window_tree_get_key`](/en/tmux/3.2a/reference/c-function-window-tree-c-window_tree_get_key/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-tree.c#L891)

## Calls

- [`xmalloc`](/en/tmux/3.2a/reference/c-function-xmalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/format.c#L3132)
- [`xstrdup`](/en/tmux/3.2a/reference/c-function-xstrdup/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/format.c#L3133)
- [`xvasprintf`](/en/tmux/3.2a/reference/c-function-xvasprintf/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/format.c#L3147)

## Referenced declarations

- [`format_entry.cb`](/en/tmux/3.2a/reference/c-struct-format_entry-cb/) (attribute)
- [`format_tree`](/en/tmux/3.2a/reference/c-struct-format_tree/) (struct)
- [`format_entry.key`](/en/tmux/3.2a/reference/c-struct-format_entry-key/) (attribute)
- [`format_entry.time`](/en/tmux/3.2a/reference/c-struct-format_entry-time/) (attribute)
- [`format_tree.tree`](/en/tmux/3.2a/reference/c-struct-format_tree-tree/) (attribute)
- [`format_entry.value`](/en/tmux/3.2a/reference/c-struct-format_entry-value/) (attribute)
