# load_cfg_from_buffer

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cfg.c#L155
- **Page:** https://libtmux.org/en/tmux/latest/reference/c-function-load_cfg_from_buffer/

```c
int load_cfg_from_buffer(const void *buf, size_t len, const char *path, struct client *c, struct cmdq_item *item, struct cmd_find_state *current, int flags, struct cmdq_item **new_item)
```

## Parameters

- `buf` (`const void *`)
- `len` (`size_t`)
- `path` (`const char *`)
- `c` (`struct client *`)
- `item` (`struct cmdq_item *`)
- `current` (`struct cmd_find_state *`)
- `flags` (`int`)
- `new_item` (`struct cmdq_item **`)

## Called by

- [`cmd_source_file_done`](/en/tmux/latest/reference/c-function-cmd-source-file-c-cmd_source_file_done/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-source-file.c#L119)

## Calls

- [`cfg_add_cause`](/en/tmux/latest/reference/c-function-cfg_add_cause/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cfg.c#L178)
- [`cmd_list_free`](/en/tmux/latest/reference/c-function-cmd_list_free/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cfg.c#L183)
- [`cmd_parse_from_buffer`](/en/tmux/latest/reference/c-function-cmd_parse_from_buffer/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cfg.c#L176)
- [`cmdq_add_format`](/en/tmux/latest/reference/c-function-cmdq_add_format/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cfg.c#L191)
- [`cmdq_append`](/en/tmux/latest/reference/c-function-cmdq_append/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cfg.c#L197)
- [`cmdq_copy_state`](/en/tmux/latest/reference/c-function-cmdq_copy_state/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cfg.c#L188)
- [`cmdq_free_state`](/en/tmux/latest/reference/c-function-cmdq_free_state/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cfg.c#L199)
- [`cmdq_get_command`](/en/tmux/latest/reference/c-function-cmdq_get_command/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cfg.c#L193)
- [`cmdq_insert_after`](/en/tmux/latest/reference/c-function-cmdq_insert_after/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cfg.c#L195)
- [`cmdq_new_state`](/en/tmux/latest/reference/c-function-cmdq_new_state/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cfg.c#L190)
- [`log_debug`](/en/tmux/latest/reference/c-function-log_debug/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cfg.c#L167)

## Other function references

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

## Referenced declarations

- [`cmd_parse_input.c`](/en/tmux/latest/reference/c-struct-cmd_parse_input-c/) (attribute)
- [`client`](/en/tmux/latest/reference/c-struct-client/) (struct)
- [`cmd_find_state`](/en/tmux/latest/reference/c-struct-cmd_find_state/) (struct)
- [`CMD_PARSE_ERROR`](/en/tmux/latest/reference/c-enum-cmd_parse_status-cmd_parse_error/) (constant)
- [`CMD_PARSE_PARSEONLY`](/en/tmux/latest/reference/c-define-tmux-h-cmd_parse_parseonly/) (constant)
- [`cmd_parse_result.cmdlist`](/en/tmux/latest/reference/c-struct-cmd_parse_result-cmdlist/) (attribute)
- [`cmdq_item`](/en/tmux/latest/reference/c-struct-cmdq_item/) (struct)
- [`cmdq_state.current`](/en/tmux/latest/reference/c-struct-cmdq_state-current/) (attribute)
- [`cmd_parse_result.error`](/en/tmux/latest/reference/c-struct-cmd_parse_result-error/) (attribute)
- [`cmd_parse_input.file`](/en/tmux/latest/reference/c-struct-cmd_parse_input-file/) (attribute)
- [`cmd_parse_input.flags`](/en/tmux/latest/reference/c-struct-cmd_parse_input-flags/) (attribute)
- [`cmdq_state.flags`](/en/tmux/latest/reference/c-struct-cmdq_state-flags/) (attribute)
- [`cmd_parse_input.item`](/en/tmux/latest/reference/c-struct-cmd_parse_input-item/) (attribute)
- [`cmd_parse_input.line`](/en/tmux/latest/reference/c-struct-cmd_parse_input-line/) (attribute)
- [`cmd_parse_result.status`](/en/tmux/latest/reference/c-struct-cmd_parse_result-status/) (attribute)
