# main

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tmux.c#L375
- **Page:** https://libtmux.org/en/tmux/3.7c/reference/c-function-main/

```c
int main(int argc, char **argv)
```

## Parameters

- `argc` (`int`)
- `argv` (`char **`)

## Calls

- [`environ_create`](/en/tmux/3.7c/reference/c-function-environ_create/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tmux.c#L400)
- [`environ_put`](/en/tmux/3.7c/reference/c-function-environ_put/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tmux.c#L402)
- [`environ_set`](/en/tmux/3.7c/reference/c-function-environ_set/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tmux.c#L404)
- [`err`](/en/tmux/3.7c/reference/c-function-err/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tmux.c#L479)
- [`errx`](/en/tmux/3.7c/reference/c-function-errx/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tmux.c#L388)
- [`expand_paths`](/en/tmux/3.7c/reference/c-function-tmux-c-expand_paths/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tmux.c#L405)
- [`log_add_level`](/en/tmux/3.7c/reference/c-function-log_add_level/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tmux.c#L464)
- [`options_create`](/en/tmux/3.7c/reference/c-function-options_create/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tmux.c#L506)
- [`options_default`](/en/tmux/3.7c/reference/c-function-options_default/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tmux.c#L511)
- [`options_set_number`](/en/tmux/3.7c/reference/c-function-options_set_number/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tmux.c#L534)
- [`options_set_string`](/en/tmux/3.7c/reference/c-function-options_set_string/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tmux.c#L522)
- [`tty_add_features`](/en/tmux/3.7c/reference/c-function-tty_add_features/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tmux.c#L410)
- [`usage`](/en/tmux/3.7c/reference/c-function-tmux-c-usage/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tmux.c#L437)
- [`xreallocarray`](/en/tmux/3.7c/reference/c-function-xreallocarray/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tmux.c#L431)
- [`xstrdup`](/en/tmux/3.7c/reference/c-function-xstrdup/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tmux.c#L546)

## Other function references

- [`client_main`](/en/tmux/3.7c/reference/c-function-client_main/) (function)
- [`find_cwd`](/en/tmux/3.7c/reference/c-function-find_cwd/) (function)
- [`getptmfd`](/en/tmux/3.7c/reference/c-function-getptmfd/) (function)
- [`getshell`](/en/tmux/3.7c/reference/c-function-tmux-c-getshell/) (function)
- [`getversion`](/en/tmux/3.7c/reference/c-function-getversion/) (function)
- [`make_label`](/en/tmux/3.7c/reference/c-function-tmux-c-make_label/) (function)
- [`osdep_event_init`](/en/tmux/3.7c/reference/c-function-osdep_event_init/) (function)

## Referenced declarations

- [`cfg_files`](/en/tmux/3.7c/reference/c-variable-cfg_files/) (attribute)
- [`cfg_nfiles`](/en/tmux/3.7c/reference/c-variable-cfg_nfiles/) (attribute)
- [`cfg_quiet`](/en/tmux/3.7c/reference/c-variable-cfg_quiet/) (attribute)
- [`CLIENT_CONTROL`](/en/tmux/3.7c/reference/c-define-tmux-h-client_control/) (constant)
- [`CLIENT_CONTROLCONTROL`](/en/tmux/3.7c/reference/c-define-tmux-h-client_controlcontrol/) (constant)
- [`CLIENT_DEFAULTSOCKET`](/en/tmux/3.7c/reference/c-define-tmux-h-client_defaultsocket/) (constant)
- [`CLIENT_LOGIN`](/en/tmux/3.7c/reference/c-define-tmux-h-client_login/) (constant)
- [`CLIENT_NOFORK`](/en/tmux/3.7c/reference/c-define-tmux-h-client_nofork/) (constant)
- [`CLIENT_NOSTARTSERVER`](/en/tmux/3.7c/reference/c-define-tmux-h-client_nostartserver/) (constant)
- [`CLIENT_UTF8`](/en/tmux/3.7c/reference/c-define-tmux-h-client_utf8/) (constant)
- [`options_table_entry.flags`](/en/tmux/3.7c/reference/c-struct-options_table_entry-flags/) (attribute)
- [`getopt`](/en/tmux/3.7c/reference/c-define-compat-h-getopt/) (constant)
- [`global_environ`](/en/tmux/3.7c/reference/c-variable-global_environ/) (attribute)
- [`global_options`](/en/tmux/3.7c/reference/c-variable-global_options/) (attribute)
- [`global_s_options`](/en/tmux/3.7c/reference/c-variable-global_s_options/) (attribute)
- [`global_w_options`](/en/tmux/3.7c/reference/c-variable-global_w_options/) (attribute)
- [`MODEKEY_EMACS`](/en/tmux/3.7c/reference/c-define-tmux-h-modekey_emacs/) (constant)
- [`MODEKEY_VI`](/en/tmux/3.7c/reference/c-define-tmux-h-modekey_vi/) (constant)
- [`options_table_entry.name`](/en/tmux/3.7c/reference/c-struct-options_table_entry-name/) (attribute)
- [`optarg`](/en/tmux/3.7c/reference/c-define-compat-h-optarg/) (constant)
- [`optind`](/en/tmux/3.7c/reference/c-define-compat-h-optind/) (constant)
- [`options_table`](/en/tmux/3.7c/reference/c-variable-options_table/) (attribute)
- [`OPTIONS_TABLE_SERVER`](/en/tmux/3.7c/reference/c-define-tmux-h-options_table_server/) (constant)
- [`OPTIONS_TABLE_SESSION`](/en/tmux/3.7c/reference/c-define-tmux-h-options_table_session/) (constant)
- [`OPTIONS_TABLE_WINDOW`](/en/tmux/3.7c/reference/c-define-tmux-h-options_table_window/) (constant)
- [`pledge`](/en/tmux/3.7c/reference/c-define-compat-h-pledge/) (constant)
- [`ptm_fd`](/en/tmux/3.7c/reference/c-variable-ptm_fd/) (attribute)
- [`options_table_entry.scope`](/en/tmux/3.7c/reference/c-struct-options_table_entry-scope/) (attribute)
- [`shell_command`](/en/tmux/3.7c/reference/c-variable-shell_command/) (attribute)
- [`socket_path`](/en/tmux/3.7c/reference/c-variable-socket_path/) (attribute)
