# cmd_source_file_exec

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-source-file.c#L160
- **Page:** https://libtmux.org/en/tmux/latest/reference/c-function-cmd-source-file-c-cmd_source_file_exec/

tmux command: [`source-file`](/en/tmux/latest/manual/source-file/)

```c
static enum cmd_retval cmd_source_file_exec(struct cmd *, struct cmdq_item *)
```

## Parameters

- `self` (`struct cmd *`)
- `item` (`struct cmdq_item *`)

## Calls

- [`args_has`](/en/tmux/latest/reference/c-function-args_has/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-source-file.c#L191)
- [`args_string`](/en/tmux/latest/reference/c-function-args_string/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-source-file.c#L204)
- [`cmd_get_args`](/en/tmux/latest/reference/c-function-cmd_get_args/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-source-file.c#L162)
- [`cmd_get_parse_flags`](/en/tmux/latest/reference/c-function-cmd_get_parse_flags/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-source-file.c#L196)
- [`cmd_source_file_add`](/en/tmux/latest/reference/c-function-cmd-source-file-c-cmd_source_file_add/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-source-file.c#L211)
- [`cmd_source_file_complete`](/en/tmux/latest/reference/c-function-cmd-source-file-c-cmd_source_file_complete/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-source-file.c#L252)
- [`cmd_source_file_quote_for_glob`](/en/tmux/latest/reference/c-function-cmd-source-file-c-cmd_source_file_quote_for_glob/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-source-file.c#L201)
- [`cmdq_error`](/en/tmux/latest/reference/c-function-cmdq_error/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-source-file.c#L174)
- [`cmdq_get_client`](/en/tmux/latest/reference/c-function-cmdq_get_client/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-source-file.c#L164)
- [`file_read`](/en/tmux/latest/reference/c-function-file_read/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-source-file.c#L249)
- [`format_single_from_target`](/en/tmux/latest/reference/c-function-format_single_from_target/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-source-file.c#L207)
- [`log_debug`](/en/tmux/latest/reference/c-function-log_debug/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-source-file.c#L178)
- [`xasprintf`](/en/tmux/latest/reference/c-function-xasprintf/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-source-file.c#L218)
- [`xcalloc`](/en/tmux/latest/reference/c-function-xcalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-source-file.c#L188)
- [`xstrdup`](/en/tmux/latest/reference/c-function-xstrdup/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-source-file.c#L216)

## Other function references

- [`args_count`](/en/tmux/latest/reference/c-function-args_count/) (function)
- [`cmd_source_file_done`](/en/tmux/latest/reference/c-function-cmd-source-file-c-cmd_source_file_done/) (function)
- [`server_client_get_cwd`](/en/tmux/latest/reference/c-function-server_client_get_cwd/) (function)

## Referenced by

- [`cmd_source_file_entry`](/en/tmux/latest/reference/c-variable-cmd_source_file_entry/) (attribute)

## Referenced declarations

- [`cmd_source_file_data.after`](/en/tmux/latest/reference/c-struct-cmd_source_file_data-after/) (attribute)
- [`CLIENT_CONTROL`](/en/tmux/latest/reference/c-define-tmux-h-client_control/) (constant)
- [`cmd`](/en/tmux/latest/reference/c-struct-cmd/) (struct)
- [`CMD_PARSE_PARSEONLY`](/en/tmux/latest/reference/c-define-tmux-h-cmd_parse_parseonly/) (constant)
- [`CMD_PARSE_QUIET`](/en/tmux/latest/reference/c-define-tmux-h-cmd_parse_quiet/) (constant)
- [`CMD_PARSE_VERBOSE`](/en/tmux/latest/reference/c-define-tmux-h-cmd_parse_verbose/) (constant)
- [`CMD_RETURN_ERROR`](/en/tmux/latest/reference/c-enum-cmd_retval-cmd_return_error/) (constant)
- [`CMD_RETURN_NORMAL`](/en/tmux/latest/reference/c-enum-cmd_retval-cmd_return_normal/) (constant)
- [`CMD_RETURN_WAIT`](/en/tmux/latest/reference/c-enum-cmd_retval-cmd_return_wait/) (constant)
- [`cmd_retval`](/en/tmux/latest/reference/c-enum-cmd_retval/) (enum)
- [`cmd_source_file_depth`](/en/tmux/latest/reference/c-variable-cmd-source-file-c-cmd_source_file_depth/) (attribute)
- [`CMD_SOURCE_FILE_DEPTH_LIMIT`](/en/tmux/latest/reference/c-define-cmd-source-file-c-cmd_source_file_depth_limit/) (constant)
- [`cmdq_item`](/en/tmux/latest/reference/c-struct-cmdq_item/) (struct)
- [`client.cwd`](/en/tmux/latest/reference/c-struct-client-cwd/) (attribute)
- [`cmd_source_file_data.files`](/en/tmux/latest/reference/c-struct-cmd_source_file_data-files/) (attribute)
- [`client.flags`](/en/tmux/latest/reference/c-struct-client-flags/) (attribute)
- [`cmd_source_file_data.flags`](/en/tmux/latest/reference/c-struct-cmd_source_file_data-flags/) (attribute)
- [`cmd_source_file_data.item`](/en/tmux/latest/reference/c-struct-cmd_source_file_data-item/) (attribute)
- [`cmd_source_file_data.nfiles`](/en/tmux/latest/reference/c-struct-cmd_source_file_data-nfiles/) (attribute)
- [`client.path`](/en/tmux/latest/reference/c-struct-client-path/) (attribute)
- [`client.retval`](/en/tmux/latest/reference/c-struct-client-retval/) (attribute)
- [`cmd_source_file_data.retval`](/en/tmux/latest/reference/c-struct-cmd_source_file_data-retval/) (attribute)
- [`client.source_file_depth`](/en/tmux/latest/reference/c-struct-client-source_file_depth/) (attribute)
