# cmdq_add_format

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-queue.c#L260
- **Page:** https://libtmux.org/en/tmux/latest/reference/c-function-cmdq_add_format/

```c
void cmdq_add_format(struct cmdq_state *state, const char *key, const char *fmt,...)
```

## Parameters

- `state` (`struct cmdq_state *`)
- `key` (`const char *`)
- `fmt` (`const char *`)
- `` (`...`)

## Called by

- [`cmdq_insert_hook`](/en/tmux/latest/reference/c-function-cmdq_insert_hook/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-queue.c#L395)
- [`load_cfg`](/en/tmux/latest/reference/c-function-load_cfg/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cfg.c#L139)
- [`load_cfg_from_buffer`](/en/tmux/latest/reference/c-function-load_cfg_from_buffer/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cfg.c#L191)

## Calls

- [`format_add`](/en/tmux/latest/reference/c-function-format_add/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-queue.c#L271)
- [`xvasprintf`](/en/tmux/latest/reference/c-function-xvasprintf/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-queue.c#L266)

## Other function references

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

## Referenced by

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

## Referenced declarations

- [`cmdq_state`](/en/tmux/latest/reference/c-struct-cmdq_state/) (struct)
- [`FORMAT_NONE`](/en/tmux/latest/reference/c-define-tmux-h-format_none/) (constant)
- [`cmdq_state.formats`](/en/tmux/latest/reference/c-struct-cmdq_state-formats/) (attribute)
