tmux  3.2a
About: tmux is a terminal multiplexer that lets you switch easily between several programs in one terminal.
  Fossies Dox: tmux-3.2a.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

xmalloc.c File Reference
#include <errno.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "tmux.h"
Include dependency graph for xmalloc.c:

Go to the source code of this file.

Functions

void * xmalloc (size_t size)
 
void * xcalloc (size_t nmemb, size_t size)
 
void * xrealloc (void *ptr, size_t size)
 
void * xreallocarray (void *ptr, size_t nmemb, size_t size)
 
void * xrecallocarray (void *ptr, size_t oldnmemb, size_t nmemb, size_t size)
 
char * xstrdup (const char *str)
 
char * xstrndup (const char *str, size_t maxlen)
 
int xasprintf (char **ret, const char *fmt,...)
 
int xvasprintf (char **ret, const char *fmt, va_list ap)
 
int xsnprintf (char *str, size_t len, const char *fmt,...)
 
int xvsnprintf (char *str, size_t len, const char *fmt, va_list ap)
 

Function Documentation

◆ xasprintf()

int xasprintf ( char **  ret,
const char *  fmt,
  ... 
)

Definition at line 109 of file xmalloc.c.

References xvasprintf().

Referenced by args_escape(), client_connect(), client_exec(), cmd_command_prompt_callback(), cmd_display_panes_exec(), cmd_find(), cmd_list_keys_commands(), cmd_parse(), cmd_parse_commands_to_string(), cmd_parse_get_error(), cmd_print(), cmd_run_shell_callback(), cmd_show_options_all(), cmdq_error_callback(), cmdq_find_flag(), expand_path(), file_get_path(), format_cb_cursor_character(), format_cb_history_all_bytes(), format_cb_history_bytes(), format_cb_pane_at_bottom(), format_cb_pane_at_top(), format_cb_pane_in_mode(), format_cb_pane_tabs(), format_cb_pid(), format_cb_session_attached_list(), format_cb_session_group_attached_list(), format_cb_session_group_list(), format_cb_window_active_clients(), format_cb_window_active_clients_list(), format_cb_window_active_sessions(), format_cb_window_active_sessions_list(), format_cb_window_linked_sessions_list(), format_cb_window_stack_index(), format_find(), format_job_get(), format_replace(), format_replace_expression(), format_search(), layout_dump(), log_open(), make_label(), menu_add_item(), mode_tree_display_menu(), mode_tree_draw(), options_array_set(), options_default_to_string(), options_from_string(), options_from_string_check(), options_from_string_choice(), options_from_string_flag(), options_scope_from_flags(), options_scope_from_name(), options_set_string(), options_value_to_string(), osdep_get_cwd(), osdep_get_name(), paste_add(), paste_rename(), popup_editor(), server_client_dispatch_identify(), server_client_open(), server_create_socket(), server_link_window(), session_attach(), session_create(), spawn_pane(), spawn_window(), status_prompt_complete(), status_prompt_complete_session(), status_prompt_complete_window_menu(), status_prompt_find_history_file(), status_prompt_key(), status_prompt_menu_callback(), tty_term_create(), tty_term_read_list(), window_customize_build_array(), window_customize_build_keys(), window_customize_key(), window_customize_scope_text(), window_customize_set_key(), window_customize_set_option(), window_pane_search(), window_tree_build_pane(), window_tree_build_window(), window_tree_draw_session(), window_tree_draw_window(), and window_tree_get_target().

◆ xcalloc()

void* xcalloc ( size_t  nmemb,
size_t  size 
)

Definition at line 41 of file xmalloc.c.

References fatalx().

Referenced by args_parse(), args_print(), args_set(), cmd_copy_argv(), cmd_list_new(), cmd_list_print(), cmd_parse(), cmd_parse_from_arguments(), cmd_unpack_argv(), cmdq_error_callback(), cmdq_find_flag(), cmdq_new(), cmdq_new_state(), control_add_pane(), control_add_sub(), control_check_subs_all_panes(), control_check_subs_all_windows(), control_check_subs_pane(), control_check_subs_window(), control_error(), control_start(), control_write(), environ_create(), environ_push(), file_create_with_client(), file_create_with_peer(), format_build_modifiers(), format_create(), format_draw(), format_job_get(), format_loop_panes(), format_loop_sessions(), format_loop_windows(), format_trim_left(), format_trim_right(), grid_create(), input_init(), input_key_build(), key_bindings_add(), menu_create(), menu_display(), mode_tree_add(), mode_tree_draw(), mode_tree_start(), notify_add(), options_add(), options_array_new(), options_create(), popup_display(), popup_editor(), proc_add_peer(), proc_start(), screen_set_selection(), screen_write_make_list(), server_add_message(), server_client_create(), server_client_dispatch_command(), server_client_set_pane(), session_create(), session_group_new(), status_prompt_key(), tty_keys_add1(), tty_term_create(), utf8_from_data(), window_buffer_add_item(), window_buffer_init(), window_buffer_start_edit(), window_client_add_item(), window_client_init(), window_copy_clone_screen(), window_copy_common_init(), window_copy_search_marks(), window_create(), window_customize_add_item(), window_customize_init(), window_customize_set_key(), window_customize_set_option(), window_pane_create(), window_pane_set_mode(), window_pane_set_palette(), window_tree_add_item(), window_tree_init(), winlink_add(), and yyparse().

◆ xmalloc()

◆ xrealloc()

◆ xreallocarray()

◆ xrecallocarray()

void* xrecallocarray ( void *  ptr,
size_t  oldnmemb,
size_t  nmemb,
size_t  size 
)

Definition at line 75 of file xmalloc.c.

References fatalx(), and recallocarray().

◆ xsnprintf()

◆ xstrdup()

char* xstrdup ( const char *  str)

Definition at line 89 of file xmalloc.c.

References fatalx().

Referenced by args_escape(), args_percentage(), args_set(), args_string_percentage(), args_strtonum(), client_dispatch_attached(), cmd_append_argv(), cmd_capture_pane_exec(), cmd_capture_pane_pending(), cmd_copy_argv(), cmd_find_client(), cmd_find_target(), cmd_get_alias(), cmd_list_keys_commands(), cmd_list_keys_print_notes(), cmd_parse(), cmd_parse_commands_to_string(), cmd_parse_get_error(), cmd_prepend_argv(), cmd_print(), cmd_refresh_client_exec(), cmd_refresh_client_update_subscription(), cmd_source_file_add(), cmd_stringify_argv(), cmd_template_replace(), cmd_unpack_argv(), cmd_wait_for_add(), cmdq_fire_callback(), control_add_sub(), control_check_age(), default_window_name(), environ_clear(), environ_put(), environ_set(), expand_path(), expand_paths(), file_error(), file_get_path(), file_print_buffer(), file_read(), file_vprint(), file_write(), format_add(), format_add_cb(), format_add_tv(), format_cb_alternate_on(), format_cb_buffer_mode_format(), format_cb_buffer_name(), format_cb_client_control_mode(), format_cb_client_flags(), format_cb_client_key_table(), format_cb_client_last_session(), format_cb_client_mode_format(), format_cb_client_name(), format_cb_client_prefix(), format_cb_client_readonly(), format_cb_client_session(), format_cb_client_termfeatures(), format_cb_client_termname(), format_cb_client_termtype(), format_cb_client_tty(), format_cb_client_utf8(), format_cb_config_files(), format_cb_current_command(), format_cb_current_path(), format_cb_cursor_flag(), format_cb_host(), format_cb_host_short(), format_cb_insert_flag(), format_cb_keypad_cursor_flag(), format_cb_keypad_flag(), format_cb_mouse_all_flag(), format_cb_mouse_any_flag(), format_cb_mouse_button_flag(), format_cb_mouse_sgr_flag(), format_cb_mouse_standard_flag(), format_cb_mouse_utf8_flag(), format_cb_origin_flag(), format_cb_pane_active(), format_cb_pane_at_left(), format_cb_pane_at_right(), format_cb_pane_bg(), format_cb_pane_dead(), format_cb_pane_fg(), format_cb_pane_format(), format_cb_pane_input_off(), format_cb_pane_last(), format_cb_pane_marked(), format_cb_pane_marked_set(), format_cb_pane_mode(), format_cb_pane_path(), format_cb_pane_pipe(), format_cb_pane_search_string(), format_cb_pane_synchronized(), format_cb_pane_title(), format_cb_pane_tty(), format_cb_session_alerts(), format_cb_session_format(), format_cb_session_group(), format_cb_session_group_many_attached(), format_cb_session_grouped(), format_cb_session_many_attached(), format_cb_session_marked(), format_cb_session_name(), format_cb_session_path(), format_cb_session_stack(), format_cb_socket_path(), format_cb_tree_mode_format(), format_cb_version(), format_cb_window_active(), format_cb_window_activity_flag(), format_cb_window_bell_flag(), format_cb_window_bigger(), format_cb_window_end_flag(), format_cb_window_flags(), format_cb_window_format(), format_cb_window_last_flag(), format_cb_window_linked(), format_cb_window_marked_flag(), format_cb_window_raw_flags(), format_cb_window_silence_flag(), format_cb_window_stack_index(), format_cb_window_start_flag(), format_cb_window_zoomed_flag(), format_cb_wrap_flag(), format_choose(), format_each(), format_expand1(), format_find(), format_job_get(), format_loop_panes(), format_loop_windows(), format_match(), format_pretty_time(), format_replace(), format_session_name(), format_sub(), format_trim_right(), format_window_name(), input_csi_dispatch_sgr_colon(), input_key_build(), input_osc_4(), input_split(), key_bindings_add(), key_bindings_get_table(), key_bindings_reset(), main(), menu_create(), mode_tree_add(), mode_tree_build_lines(), mode_tree_display_menu(), mode_tree_draw(), mode_tree_filter_callback(), mode_tree_search_callback(), mode_tree_start(), notify_add(), options_add(), options_array_assign(), options_array_set(), options_default(), options_default_to_string(), options_from_string(), options_match(), options_parse(), options_to_string(), options_value_to_string(), osdep_get_name(), parse_window_name(), paste_rename(), paste_set(), popup_editor(), proc_start(), regsub(), screen_init(), screen_push_title(), screen_set_cursor_colour(), screen_set_title(), server_client_detach(), server_client_dispatch_command(), server_client_dispatch_identify(), server_client_open(), server_client_set_flags(), server_client_set_title(), session_check_name(), session_create(), session_group_new(), spawn_pane(), status_prompt_add_history(), status_prompt_complete(), status_prompt_complete_list(), status_prompt_complete_prefix(), status_prompt_find_history_file(), status_prompt_menu_callback(), status_prompt_set(), tty_add_features(), tty_force_cursor_colour(), tty_init(), tty_keys_extended_device_attributes(), tty_term_apply(), tty_term_create(), tty_term_strip(), utf8_padcstr(), utf8_rpadcstr(), window_buffer_build(), window_buffer_init(), window_buffer_start_edit(), window_client_init(), window_copy_cmd_append_selection(), window_copy_common_init(), window_copy_search(), window_create(), window_customize_build_array(), window_customize_build_keys(), window_customize_build_option(), window_customize_init(), window_customize_scope_text(), window_customize_set_command_callback(), window_customize_set_key(), window_customize_set_note_callback(), window_customize_set_option(), window_pane_start_input(), and window_tree_init().

◆ xstrndup()

char* xstrndup ( const char *  str,
size_t  maxlen 
)

◆ xvasprintf()

◆ xvsnprintf()

int xvsnprintf ( char *  str,
size_t  len,
const char *  fmt,
va_list  ap 
)

Definition at line 148 of file xmalloc.c.

References fatalx().

Referenced by xsnprintf().