diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/wee-config.c | 4505 | ||||
-rw-r--r-- | src/core/wee-secure-config.c | 107 | ||||
-rw-r--r-- | src/plugins/alias/alias-config.c | 31 | ||||
-rw-r--r-- | src/plugins/buflist/buflist-config.c | 663 | ||||
-rw-r--r-- | src/plugins/exec/exec-config.c | 134 | ||||
-rw-r--r-- | src/plugins/fifo/fifo-config.c | 67 | ||||
-rw-r--r-- | src/plugins/fset/fset-config.c | 1545 | ||||
-rw-r--r-- | src/plugins/irc/irc-config.c | 1921 | ||||
-rw-r--r-- | src/plugins/logger/logger-config.c | 466 | ||||
-rw-r--r-- | src/plugins/plugin-config.c | 5 | ||||
-rw-r--r-- | src/plugins/plugin-script-config.c | 41 | ||||
-rw-r--r-- | src/plugins/relay/relay-config.c | 811 | ||||
-rw-r--r-- | src/plugins/script/script-config.c | 812 | ||||
-rw-r--r-- | src/plugins/spell/spell-config.c | 290 | ||||
-rw-r--r-- | src/plugins/trigger/trigger-config.c | 229 | ||||
-rw-r--r-- | src/plugins/trigger/trigger-config.h | 3 | ||||
-rw-r--r-- | src/plugins/typing/typing-config.c | 148 | ||||
-rw-r--r-- | src/plugins/xfer/xfer-config.c | 595 |
18 files changed, 6090 insertions, 6283 deletions
diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 070194c5a..297bdb2cf 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -77,8 +77,8 @@ struct t_config_section *weechat_config_section_palette = NULL; struct t_config_section *weechat_config_section_color = NULL; struct t_config_section *weechat_config_section_completion = NULL; struct t_config_section *weechat_config_section_history = NULL; -struct t_config_section *weechat_config_section_network = NULL; struct t_config_section *weechat_config_section_proxy = NULL; +struct t_config_section *weechat_config_section_network = NULL; struct t_config_section *weechat_config_section_plugin = NULL; struct t_config_section *weechat_config_section_signal = NULL; struct t_config_section *weechat_config_section_bar = NULL; @@ -92,244 +92,248 @@ struct t_config_section *weechat_config_section_key[GUI_KEY_NUM_CONTEXTS] = { /* config, startup section */ -struct t_config_option *config_startup_command_after_plugins; -struct t_config_option *config_startup_command_before_plugins; -struct t_config_option *config_startup_display_logo; -struct t_config_option *config_startup_display_version; -struct t_config_option *config_startup_sys_rlimit; +struct t_config_option *config_startup_command_after_plugins = NULL; +struct t_config_option *config_startup_command_before_plugins = NULL; +struct t_config_option *config_startup_display_logo = NULL; +struct t_config_option *config_startup_display_version = NULL; +struct t_config_option *config_startup_sys_rlimit = NULL; /* config, look & feel section */ -struct t_config_option *config_look_align_end_of_lines; -struct t_config_option *config_look_align_multiline_words; -struct t_config_option *config_look_bar_more_down; -struct t_config_option *config_look_bar_more_left; -struct t_config_option *config_look_bar_more_right; -struct t_config_option *config_look_bar_more_up; -struct t_config_option *config_look_bare_display_exit_on_input; -struct t_config_option *config_look_bare_display_time_format; -struct t_config_option *config_look_buffer_auto_renumber; -struct t_config_option *config_look_buffer_notify_default; -struct t_config_option *config_look_buffer_position; -struct t_config_option *config_look_buffer_search_case_sensitive; -struct t_config_option *config_look_buffer_search_force_default; -struct t_config_option *config_look_buffer_search_regex; -struct t_config_option *config_look_buffer_search_where; -struct t_config_option *config_look_buffer_time_format; -struct t_config_option *config_look_buffer_time_same; -struct t_config_option *config_look_chat_space_right; -struct t_config_option *config_look_color_basic_force_bold; -struct t_config_option *config_look_color_inactive_buffer; -struct t_config_option *config_look_color_inactive_message; -struct t_config_option *config_look_color_inactive_prefix; -struct t_config_option *config_look_color_inactive_prefix_buffer; -struct t_config_option *config_look_color_inactive_time; -struct t_config_option *config_look_color_inactive_window; -struct t_config_option *config_look_color_nick_offline; -struct t_config_option *config_look_color_pairs_auto_reset; -struct t_config_option *config_look_color_real_white; -struct t_config_option *config_look_command_chars; -struct t_config_option *config_look_command_incomplete; -struct t_config_option *config_look_confirm_quit; -struct t_config_option *config_look_confirm_upgrade; -struct t_config_option *config_look_day_change; -struct t_config_option *config_look_day_change_message_1date; -struct t_config_option *config_look_day_change_message_2dates; -struct t_config_option *config_look_eat_newline_glitch; -struct t_config_option *config_look_emphasized_attributes; -struct t_config_option *config_look_highlight; -struct t_config_option *config_look_highlight_disable_regex; -struct t_config_option *config_look_highlight_regex; -struct t_config_option *config_look_highlight_tags; -struct t_config_option *config_look_hotlist_add_conditions; -struct t_config_option *config_look_hotlist_buffer_separator; -struct t_config_option *config_look_hotlist_count_max; -struct t_config_option *config_look_hotlist_count_min_msg; -struct t_config_option *config_look_hotlist_names_count; -struct t_config_option *config_look_hotlist_names_length; -struct t_config_option *config_look_hotlist_names_level; -struct t_config_option *config_look_hotlist_names_merged_buffers; -struct t_config_option *config_look_hotlist_prefix; -struct t_config_option *config_look_hotlist_remove; -struct t_config_option *config_look_hotlist_short_names; -struct t_config_option *config_look_hotlist_sort; -struct t_config_option *config_look_hotlist_suffix; -struct t_config_option *config_look_hotlist_unique_numbers; -struct t_config_option *config_look_hotlist_update_on_buffer_switch; -struct t_config_option *config_look_input_cursor_scroll; -struct t_config_option *config_look_input_multiline_lead_linebreak; -struct t_config_option *config_look_input_share; -struct t_config_option *config_look_input_share_overwrite; -struct t_config_option *config_look_input_undo_max; -struct t_config_option *config_look_item_away_message; -struct t_config_option *config_look_item_buffer_filter; -struct t_config_option *config_look_item_buffer_zoom; -struct t_config_option *config_look_item_mouse_status; -struct t_config_option *config_look_item_time_format; -struct t_config_option *config_look_jump_current_to_previous_buffer; -struct t_config_option *config_look_jump_previous_buffer_when_closing; -struct t_config_option *config_look_jump_smart_back_to_buffer; -struct t_config_option *config_look_key_bind_safe; -struct t_config_option *config_look_key_grab_delay; -struct t_config_option *config_look_mouse; -struct t_config_option *config_look_mouse_timer_delay; -struct t_config_option *config_look_nick_color_force; -struct t_config_option *config_look_nick_color_hash; -struct t_config_option *config_look_nick_color_hash_salt; -struct t_config_option *config_look_nick_color_stop_chars; -struct t_config_option *config_look_nick_prefix; -struct t_config_option *config_look_nick_suffix; -struct t_config_option *config_look_paste_bracketed; -struct t_config_option *config_look_paste_bracketed_timer_delay; -struct t_config_option *config_look_paste_max_lines; -struct t_config_option *config_look_prefix[GUI_CHAT_NUM_PREFIXES]; -struct t_config_option *config_look_prefix_align; -struct t_config_option *config_look_prefix_align_max; -struct t_config_option *config_look_prefix_align_min; -struct t_config_option *config_look_prefix_align_more; -struct t_config_option *config_look_prefix_align_more_after; -struct t_config_option *config_look_prefix_buffer_align; -struct t_config_option *config_look_prefix_buffer_align_max; -struct t_config_option *config_look_prefix_buffer_align_more; -struct t_config_option *config_look_prefix_buffer_align_more_after; -struct t_config_option *config_look_prefix_same_nick; -struct t_config_option *config_look_prefix_same_nick_middle; -struct t_config_option *config_look_prefix_suffix; -struct t_config_option *config_look_quote_nick_prefix; -struct t_config_option *config_look_quote_nick_suffix; -struct t_config_option *config_look_quote_time_format; -struct t_config_option *config_look_read_marker; -struct t_config_option *config_look_read_marker_always_show; -struct t_config_option *config_look_read_marker_string; -struct t_config_option *config_look_read_marker_update_on_buffer_switch; -struct t_config_option *config_look_save_config_on_exit; -struct t_config_option *config_look_save_config_with_fsync; -struct t_config_option *config_look_save_layout_on_exit; -struct t_config_option *config_look_scroll_amount; -struct t_config_option *config_look_scroll_bottom_after_switch; -struct t_config_option *config_look_scroll_page_percent; -struct t_config_option *config_look_search_text_not_found_alert; -struct t_config_option *config_look_separator_horizontal; -struct t_config_option *config_look_separator_vertical; -struct t_config_option *config_look_tab_width; -struct t_config_option *config_look_time_format; -struct t_config_option *config_look_window_auto_zoom; -struct t_config_option *config_look_window_separator_horizontal; -struct t_config_option *config_look_window_separator_vertical; -struct t_config_option *config_look_window_title; -struct t_config_option *config_look_word_chars_highlight; -struct t_config_option *config_look_word_chars_input; +struct t_config_option *config_look_align_end_of_lines = NULL; +struct t_config_option *config_look_align_multiline_words = NULL; +struct t_config_option *config_look_bar_more_down = NULL; +struct t_config_option *config_look_bar_more_left = NULL; +struct t_config_option *config_look_bar_more_right = NULL; +struct t_config_option *config_look_bar_more_up = NULL; +struct t_config_option *config_look_bare_display_exit_on_input = NULL; +struct t_config_option *config_look_bare_display_time_format = NULL; +struct t_config_option *config_look_buffer_auto_renumber = NULL; +struct t_config_option *config_look_buffer_notify_default = NULL; +struct t_config_option *config_look_buffer_position = NULL; +struct t_config_option *config_look_buffer_search_case_sensitive = NULL; +struct t_config_option *config_look_buffer_search_force_default = NULL; +struct t_config_option *config_look_buffer_search_regex = NULL; +struct t_config_option *config_look_buffer_search_where = NULL; +struct t_config_option *config_look_buffer_time_format = NULL; +struct t_config_option *config_look_buffer_time_same = NULL; +struct t_config_option *config_look_chat_space_right = NULL; +struct t_config_option *config_look_color_basic_force_bold = NULL; +struct t_config_option *config_look_color_inactive_buffer = NULL; +struct t_config_option *config_look_color_inactive_message = NULL; +struct t_config_option *config_look_color_inactive_prefix = NULL; +struct t_config_option *config_look_color_inactive_prefix_buffer = NULL; +struct t_config_option *config_look_color_inactive_time = NULL; +struct t_config_option *config_look_color_inactive_window = NULL; +struct t_config_option *config_look_color_nick_offline = NULL; +struct t_config_option *config_look_color_pairs_auto_reset = NULL; +struct t_config_option *config_look_color_real_white = NULL; +struct t_config_option *config_look_command_chars = NULL; +struct t_config_option *config_look_command_incomplete = NULL; +struct t_config_option *config_look_confirm_quit = NULL; +struct t_config_option *config_look_confirm_upgrade = NULL; +struct t_config_option *config_look_day_change = NULL; +struct t_config_option *config_look_day_change_message_1date = NULL; +struct t_config_option *config_look_day_change_message_2dates = NULL; +struct t_config_option *config_look_eat_newline_glitch = NULL; +struct t_config_option *config_look_emphasized_attributes = NULL; +struct t_config_option *config_look_highlight = NULL; +struct t_config_option *config_look_highlight_disable_regex = NULL; +struct t_config_option *config_look_highlight_regex = NULL; +struct t_config_option *config_look_highlight_tags = NULL; +struct t_config_option *config_look_hotlist_add_conditions = NULL; +struct t_config_option *config_look_hotlist_buffer_separator = NULL; +struct t_config_option *config_look_hotlist_count_max = NULL; +struct t_config_option *config_look_hotlist_count_min_msg = NULL; +struct t_config_option *config_look_hotlist_names_count = NULL; +struct t_config_option *config_look_hotlist_names_length = NULL; +struct t_config_option *config_look_hotlist_names_level = NULL; +struct t_config_option *config_look_hotlist_names_merged_buffers = NULL; +struct t_config_option *config_look_hotlist_prefix = NULL; +struct t_config_option *config_look_hotlist_remove = NULL; +struct t_config_option *config_look_hotlist_short_names = NULL; +struct t_config_option *config_look_hotlist_sort = NULL; +struct t_config_option *config_look_hotlist_suffix = NULL; +struct t_config_option *config_look_hotlist_unique_numbers = NULL; +struct t_config_option *config_look_hotlist_update_on_buffer_switch = NULL; +struct t_config_option *config_look_input_cursor_scroll = NULL; +struct t_config_option *config_look_input_multiline_lead_linebreak = NULL; +struct t_config_option *config_look_input_share = NULL; +struct t_config_option *config_look_input_share_overwrite = NULL; +struct t_config_option *config_look_input_undo_max = NULL; +struct t_config_option *config_look_item_away_message = NULL; +struct t_config_option *config_look_item_buffer_filter = NULL; +struct t_config_option *config_look_item_buffer_zoom = NULL; +struct t_config_option *config_look_item_mouse_status = NULL; +struct t_config_option *config_look_item_time_format = NULL; +struct t_config_option *config_look_jump_current_to_previous_buffer = NULL; +struct t_config_option *config_look_jump_previous_buffer_when_closing = NULL; +struct t_config_option *config_look_jump_smart_back_to_buffer = NULL; +struct t_config_option *config_look_key_bind_safe = NULL; +struct t_config_option *config_look_key_grab_delay = NULL; +struct t_config_option *config_look_mouse = NULL; +struct t_config_option *config_look_mouse_timer_delay = NULL; +struct t_config_option *config_look_nick_color_force = NULL; +struct t_config_option *config_look_nick_color_hash = NULL; +struct t_config_option *config_look_nick_color_hash_salt = NULL; +struct t_config_option *config_look_nick_color_stop_chars = NULL; +struct t_config_option *config_look_nick_prefix = NULL; +struct t_config_option *config_look_nick_suffix = NULL; +struct t_config_option *config_look_paste_bracketed = NULL; +struct t_config_option *config_look_paste_bracketed_timer_delay = NULL; +struct t_config_option *config_look_paste_max_lines = NULL; +struct t_config_option *config_look_prefix[GUI_CHAT_NUM_PREFIXES] = { + NULL, NULL, NULL, NULL, NULL, +}; +struct t_config_option *config_look_prefix_align = NULL; +struct t_config_option *config_look_prefix_align_max = NULL; +struct t_config_option *config_look_prefix_align_min = NULL; +struct t_config_option *config_look_prefix_align_more = NULL; +struct t_config_option *config_look_prefix_align_more_after = NULL; +struct t_config_option *config_look_prefix_buffer_align = NULL; +struct t_config_option *config_look_prefix_buffer_align_max = NULL; +struct t_config_option *config_look_prefix_buffer_align_more = NULL; +struct t_config_option *config_look_prefix_buffer_align_more_after = NULL; +struct t_config_option *config_look_prefix_same_nick = NULL; +struct t_config_option *config_look_prefix_same_nick_middle = NULL; +struct t_config_option *config_look_prefix_suffix = NULL; +struct t_config_option *config_look_quote_nick_prefix = NULL; +struct t_config_option *config_look_quote_nick_suffix = NULL; +struct t_config_option *config_look_quote_time_format = NULL; +struct t_config_option *config_look_read_marker = NULL; +struct t_config_option *config_look_read_marker_always_show = NULL; +struct t_config_option *config_look_read_marker_string = NULL; +struct t_config_option *config_look_read_marker_update_on_buffer_switch = NULL; +struct t_config_option *config_look_save_config_on_exit = NULL; +struct t_config_option *config_look_save_config_with_fsync = NULL; +struct t_config_option *config_look_save_layout_on_exit = NULL; +struct t_config_option *config_look_scroll_amount = NULL; +struct t_config_option *config_look_scroll_bottom_after_switch = NULL; +struct t_config_option *config_look_scroll_page_percent = NULL; +struct t_config_option *config_look_search_text_not_found_alert = NULL; +struct t_config_option *config_look_separator_horizontal = NULL; +struct t_config_option *config_look_separator_vertical = NULL; +struct t_config_option *config_look_tab_width = NULL; +struct t_config_option *config_look_time_format = NULL; +struct t_config_option *config_look_window_auto_zoom = NULL; +struct t_config_option *config_look_window_separator_horizontal = NULL; +struct t_config_option *config_look_window_separator_vertical = NULL; +struct t_config_option *config_look_window_title = NULL; +struct t_config_option *config_look_word_chars_highlight = NULL; +struct t_config_option *config_look_word_chars_input = NULL; /* config, colors section */ -struct t_config_option *config_color_bar_more; -struct t_config_option *config_color_chat; -struct t_config_option *config_color_chat_bg; -struct t_config_option *config_color_chat_buffer; -struct t_config_option *config_color_chat_channel; -struct t_config_option *config_color_chat_day_change; -struct t_config_option *config_color_chat_delimiters; -struct t_config_option *config_color_chat_highlight; -struct t_config_option *config_color_chat_highlight_bg; -struct t_config_option *config_color_chat_host; -struct t_config_option *config_color_chat_inactive_buffer; -struct t_config_option *config_color_chat_inactive_window; -struct t_config_option *config_color_chat_nick; -struct t_config_option *config_color_chat_nick_colors; -struct t_config_option *config_color_chat_nick_offline; -struct t_config_option *config_color_chat_nick_offline_highlight; -struct t_config_option *config_color_chat_nick_offline_highlight_bg; -struct t_config_option *config_color_chat_nick_other; -struct t_config_option *config_color_chat_nick_prefix; -struct t_config_option *config_color_chat_nick_self; -struct t_config_option *config_color_chat_nick_suffix; -struct t_config_option *config_color_chat_prefix[GUI_CHAT_NUM_PREFIXES]; -struct t_config_option *config_color_chat_prefix_buffer; -struct t_config_option *config_color_chat_prefix_buffer_inactive_buffer; -struct t_config_option *config_color_chat_prefix_more; -struct t_config_option *config_color_chat_prefix_suffix; -struct t_config_option *config_color_chat_read_marker; -struct t_config_option *config_color_chat_read_marker_bg; -struct t_config_option *config_color_chat_server; -struct t_config_option *config_color_chat_tags; -struct t_config_option *config_color_chat_text_found; -struct t_config_option *config_color_chat_text_found_bg; -struct t_config_option *config_color_chat_time; -struct t_config_option *config_color_chat_time_delimiters; -struct t_config_option *config_color_chat_value; -struct t_config_option *config_color_chat_value_null; -struct t_config_option *config_color_emphasized; -struct t_config_option *config_color_emphasized_bg; -struct t_config_option *config_color_input_actions; -struct t_config_option *config_color_input_text_not_found; -struct t_config_option *config_color_item_away; -struct t_config_option *config_color_nicklist_away; -struct t_config_option *config_color_nicklist_group; -struct t_config_option *config_color_separator; -struct t_config_option *config_color_status_count_highlight; -struct t_config_option *config_color_status_count_msg; -struct t_config_option *config_color_status_count_other; -struct t_config_option *config_color_status_count_private; -struct t_config_option *config_color_status_data_highlight; -struct t_config_option *config_color_status_data_msg; -struct t_config_option *config_color_status_data_other; -struct t_config_option *config_color_status_data_private; -struct t_config_option *config_color_status_filter; -struct t_config_option *config_color_status_more; -struct t_config_option *config_color_status_mouse; -struct t_config_option *config_color_status_name; -struct t_config_option *config_color_status_name_ssl; -struct t_config_option *config_color_status_nicklist_count; -struct t_config_option *config_color_status_number; -struct t_config_option *config_color_status_time; +struct t_config_option *config_color_bar_more = NULL; +struct t_config_option *config_color_chat = NULL; +struct t_config_option *config_color_chat_bg = NULL; +struct t_config_option *config_color_chat_buffer = NULL; +struct t_config_option *config_color_chat_channel = NULL; +struct t_config_option *config_color_chat_day_change = NULL; +struct t_config_option *config_color_chat_delimiters = NULL; +struct t_config_option *config_color_chat_highlight = NULL; +struct t_config_option *config_color_chat_highlight_bg = NULL; +struct t_config_option *config_color_chat_host = NULL; +struct t_config_option *config_color_chat_inactive_buffer = NULL; +struct t_config_option *config_color_chat_inactive_window = NULL; +struct t_config_option *config_color_chat_nick = NULL; +struct t_config_option *config_color_chat_nick_colors = NULL; +struct t_config_option *config_color_chat_nick_offline = NULL; +struct t_config_option *config_color_chat_nick_offline_highlight = NULL; +struct t_config_option *config_color_chat_nick_offline_highlight_bg = NULL; +struct t_config_option *config_color_chat_nick_other = NULL; +struct t_config_option *config_color_chat_nick_prefix = NULL; +struct t_config_option *config_color_chat_nick_self = NULL; +struct t_config_option *config_color_chat_nick_suffix = NULL; +struct t_config_option *config_color_chat_prefix[GUI_CHAT_NUM_PREFIXES] = { + NULL, NULL, NULL, NULL, NULL, +}; +struct t_config_option *config_color_chat_prefix_buffer = NULL; +struct t_config_option *config_color_chat_prefix_buffer_inactive_buffer = NULL; +struct t_config_option *config_color_chat_prefix_more = NULL; +struct t_config_option *config_color_chat_prefix_suffix = NULL; +struct t_config_option *config_color_chat_read_marker = NULL; +struct t_config_option *config_color_chat_read_marker_bg = NULL; +struct t_config_option *config_color_chat_server = NULL; +struct t_config_option *config_color_chat_tags = NULL; +struct t_config_option *config_color_chat_text_found = NULL; +struct t_config_option *config_color_chat_text_found_bg = NULL; +struct t_config_option *config_color_chat_time = NULL; +struct t_config_option *config_color_chat_time_delimiters = NULL; +struct t_config_option *config_color_chat_value = NULL; +struct t_config_option *config_color_chat_value_null = NULL; +struct t_config_option *config_color_emphasized = NULL; +struct t_config_option *config_color_emphasized_bg = NULL; +struct t_config_option *config_color_input_actions = NULL; +struct t_config_option *config_color_input_text_not_found = NULL; +struct t_config_option *config_color_item_away = NULL; +struct t_config_option *config_color_nicklist_away = NULL; +struct t_config_option *config_color_nicklist_group = NULL; +struct t_config_option *config_color_separator = NULL; +struct t_config_option *config_color_status_count_highlight = NULL; +struct t_config_option *config_color_status_count_msg = NULL; +struct t_config_option *config_color_status_count_other = NULL; +struct t_config_option *config_color_status_count_private = NULL; +struct t_config_option *config_color_status_data_highlight = NULL; +struct t_config_option *config_color_status_data_msg = NULL; +struct t_config_option *config_color_status_data_other = NULL; +struct t_config_option *config_color_status_data_private = NULL; +struct t_config_option *config_color_status_filter = NULL; +struct t_config_option *config_color_status_more = NULL; +struct t_config_option *config_color_status_mouse = NULL; +struct t_config_option *config_color_status_name = NULL; +struct t_config_option *config_color_status_name_ssl = NULL; +struct t_config_option *config_color_status_nicklist_count = NULL; +struct t_config_option *config_color_status_number = NULL; +struct t_config_option *config_color_status_time = NULL; /* config, completion section */ -struct t_config_option *config_completion_base_word_until_cursor; -struct t_config_option *config_completion_command_inline; -struct t_config_option *config_completion_default_template; -struct t_config_option *config_completion_nick_add_space; -struct t_config_option *config_completion_nick_case_sensitive; -struct t_config_option *config_completion_nick_completer; -struct t_config_option *config_completion_nick_first_only; -struct t_config_option *config_completion_nick_ignore_chars; -struct t_config_option *config_completion_partial_completion_alert; -struct t_config_option *config_completion_partial_completion_command; -struct t_config_option *config_completion_partial_completion_command_arg; -struct t_config_option *config_completion_partial_completion_count; -struct t_config_option *config_completion_partial_completion_other; -struct t_config_option *config_completion_partial_completion_templates; +struct t_config_option *config_completion_base_word_until_cursor = NULL; +struct t_config_option *config_completion_command_inline = NULL; +struct t_config_option *config_completion_default_template = NULL; +struct t_config_option *config_completion_nick_add_space = NULL; +struct t_config_option *config_completion_nick_case_sensitive = NULL; +struct t_config_option *config_completion_nick_completer = NULL; +struct t_config_option *config_completion_nick_first_only = NULL; +struct t_config_option *config_completion_nick_ignore_chars = NULL; +struct t_config_option *config_completion_partial_completion_alert = NULL; +struct t_config_option *config_completion_partial_completion_command = NULL; +struct t_config_option *config_completion_partial_completion_command_arg = NULL; +struct t_config_option *config_completion_partial_completion_count = NULL; +struct t_config_option *config_completion_partial_completion_other = NULL; +struct t_config_option *config_completion_partial_completion_templates = NULL; /* config, history section */ -struct t_config_option *config_history_display_default; -struct t_config_option *config_history_max_buffer_lines_minutes; -struct t_config_option *config_history_max_buffer_lines_number; -struct t_config_option *config_history_max_commands; -struct t_config_option *config_history_max_visited_buffers; +struct t_config_option *config_history_display_default = NULL; +struct t_config_option *config_history_max_buffer_lines_minutes = NULL; +struct t_config_option *config_history_max_buffer_lines_number = NULL; +struct t_config_option *config_history_max_commands = NULL; +struct t_config_option *config_history_max_visited_buffers = NULL; /* config, network section */ -struct t_config_option *config_network_connection_timeout; -struct t_config_option *config_network_gnutls_ca_system; -struct t_config_option *config_network_gnutls_ca_user; -struct t_config_option *config_network_gnutls_handshake_timeout; -struct t_config_option *config_network_proxy_curl; +struct t_config_option *config_network_connection_timeout = NULL; +struct t_config_option *config_network_gnutls_ca_system = NULL; +struct t_config_option *config_network_gnutls_ca_user = NULL; +struct t_config_option *config_network_gnutls_handshake_timeout = NULL; +struct t_config_option *config_network_proxy_curl = NULL; /* config, plugin section */ -struct t_config_option *config_plugin_autoload; -struct t_config_option *config_plugin_extension; -struct t_config_option *config_plugin_path; -struct t_config_option *config_plugin_save_config_on_unload; +struct t_config_option *config_plugin_autoload = NULL; +struct t_config_option *config_plugin_extension = NULL; +struct t_config_option *config_plugin_path = NULL; +struct t_config_option *config_plugin_save_config_on_unload = NULL; /* config, signal section */ -struct t_config_option *config_signal_sighup; -struct t_config_option *config_signal_sigquit; -struct t_config_option *config_signal_sigterm; -struct t_config_option *config_signal_sigusr1; -struct t_config_option *config_signal_sigusr2; +struct t_config_option *config_signal_sighup = NULL; +struct t_config_option *config_signal_sigquit = NULL; +struct t_config_option *config_signal_sigterm = NULL; +struct t_config_option *config_signal_sigusr1 = NULL; +struct t_config_option *config_signal_sigusr2 = NULL; /* other */ @@ -2746,8 +2750,13 @@ config_weechat_init_options () if (!weechat_config_file) return 0; - config_file_set_version (weechat_config_file, WEECHAT_CONFIG_VERSION, - &config_weechat_update_cb, NULL, NULL); + if (!config_file_set_version (weechat_config_file, WEECHAT_CONFIG_VERSION, + &config_weechat_update_cb, NULL, NULL)) + { + config_file_free (weechat_config_file); + weechat_config_file = NULL; + return 0; + } /* debug */ weechat_config_section_debug = config_file_new_section ( @@ -2758,12 +2767,6 @@ config_weechat_init_options () NULL, NULL, NULL, &config_weechat_debug_create_option_cb, NULL, NULL, &config_weechat_debug_delete_option_cb, NULL, NULL); - if (!weechat_config_section_debug) - { - config_file_free (weechat_config_file); - weechat_config_file = NULL; - return 0; - } /* startup */ weechat_config_section_startup = config_file_new_section ( @@ -2774,54 +2777,51 @@ config_weechat_init_options () NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!weechat_config_section_startup) + if (weechat_config_section_startup) { - config_file_free (weechat_config_file); - weechat_config_file = NULL; - return 0; + config_startup_command_after_plugins = config_file_new_option ( + weechat_config_file, weechat_config_section_startup, + "command_after_plugins", "string", + N_("command executed when WeeChat starts, after loading plugins; " + "multiple commands can be separated by semicolons " + "(note: commands are evaluated, see /help eval)"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_startup_command_before_plugins = config_file_new_option ( + weechat_config_file, weechat_config_section_startup, + "command_before_plugins", "string", + N_("command executed when WeeChat starts, before loading plugins; " + "multiple commands can be separated by semicolons " + "(note: commands are evaluated, see /help eval)"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_startup_display_logo = config_file_new_option ( + weechat_config_file, weechat_config_section_startup, + "display_logo", "boolean", + N_("display WeeChat logo at startup"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_startup_display_version = config_file_new_option ( + weechat_config_file, weechat_config_section_startup, + "display_version", "boolean", + N_("display WeeChat version at startup"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_startup_sys_rlimit = config_file_new_option ( + weechat_config_file, weechat_config_section_startup, + "sys_rlimit", "string", + N_("set resource limits for WeeChat process, format is: " + "\"res1:limit1,res2:limit2\"; resource name is the end of " + "constant (RLIMIT_XXX) in lower case (see man setrlimit for " + "values); limit -1 means \"unlimited\"; example: set unlimited " + "size for core file and max 1GB of virtual memory: " + "\"core:-1,as:1000000000\""), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_sys_rlimit, NULL, NULL, + NULL, NULL, NULL); } - config_startup_command_after_plugins = config_file_new_option ( - weechat_config_file, weechat_config_section_startup, - "command_after_plugins", "string", - N_("command executed when WeeChat starts, after loading plugins; " - "multiple commands can be separated by semicolons " - "(note: commands are evaluated, see /help eval)"), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_startup_command_before_plugins = config_file_new_option ( - weechat_config_file, weechat_config_section_startup, - "command_before_plugins", "string", - N_("command executed when WeeChat starts, before loading plugins; " - "multiple commands can be separated by semicolons " - "(note: commands are evaluated, see /help eval)"), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_startup_display_logo = config_file_new_option ( - weechat_config_file, weechat_config_section_startup, - "display_logo", "boolean", - N_("display WeeChat logo at startup"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_startup_display_version = config_file_new_option ( - weechat_config_file, weechat_config_section_startup, - "display_version", "boolean", - N_("display WeeChat version at startup"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_startup_sys_rlimit = config_file_new_option ( - weechat_config_file, weechat_config_section_startup, - "sys_rlimit", "string", - N_("set resource limits for WeeChat process, format is: " - "\"res1:limit1,res2:limit2\"; resource name is the end of constant " - "(RLIMIT_XXX) in lower case (see man setrlimit for values); limit " - "-1 means \"unlimited\"; example: set unlimited size for core file " - "and max 1GB of virtual memory: \"core:-1,as:1000000000\""), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, - &config_change_sys_rlimit, NULL, NULL, - NULL, NULL, NULL); - /* look */ weechat_config_section_look = config_file_new_section ( weechat_config_file, "look", @@ -2831,1144 +2831,1152 @@ config_weechat_init_options () NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!weechat_config_section_look) + if (weechat_config_section_look) { - config_file_free (weechat_config_file); - weechat_config_file = NULL; - return 0; + config_look_align_end_of_lines = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "align_end_of_lines", "integer", + N_("alignment for end of lines (all lines after the first): they " + "are starting under this data (time, buffer, prefix, suffix, " + "message (default))"), + "time|buffer|prefix|suffix|message", 0, 0, "message", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_align_multiline_words = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "align_multiline_words", "boolean", + N_("alignment for multiline words according to option " + "weechat.look.align_end_of_lines; if disabled, the multiline " + "words will not be aligned, which can be useful to not break " + "long URLs"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_bar_more_down = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "bar_more_down", "string", + N_("string displayed when bar can be scrolled down " + "(for bars with filling different from \"horizontal\")"), + NULL, 0, 0, "++", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); + config_look_bar_more_left = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "bar_more_left", "string", + N_("string displayed when bar can be scrolled to the left " + "(for bars with filling \"horizontal\")"), + NULL, 0, 0, "<<", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); + config_look_bar_more_right = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "bar_more_right", "string", + N_("string displayed when bar can be scrolled to the right " + "(for bars with filling \"horizontal\")"), + NULL, 0, 0, ">>", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); + config_look_bar_more_up = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "bar_more_up", "string", + N_("string displayed when bar can be scrolled up " + "(for bars with filling different from \"horizontal\")"), + NULL, 0, 0, "--", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); + config_look_bare_display_exit_on_input = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "bare_display_exit_on_input", "boolean", + N_("exit the bare display mode on any changes in input"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_bare_display_time_format = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "bare_display_time_format", "string", + N_("time format in bare display mode (see man strftime for " + "date/time specifiers)"), + NULL, 0, 0, "%H:%M", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); + config_look_buffer_auto_renumber = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "buffer_auto_renumber", "boolean", + N_("automatically renumber buffers to have only consecutive " + "numbers and start with number 1; if disabled, gaps between " + "buffer numbers are allowed and the first buffer can have a " + "number greater than 1"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_auto_renumber, NULL, NULL, + NULL, NULL, NULL); + config_look_buffer_notify_default = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "buffer_notify_default", "integer", + N_("default notify level for buffers (used to tell WeeChat if " + "buffer must be displayed in hotlist or not, according to " + "importance of message): all=all messages (default), " + "message=messages+highlights, highlight=highlights only, " + "none=never display in hotlist"), + "none|highlight|message|all", 0, 0, "all", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_notify_default, NULL, NULL, + NULL, NULL, NULL); + config_look_buffer_position = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "buffer_position", "integer", + N_("position of a new buffer: end = after the end of list (number = " + "last number + 1) (default), first_gap = at first available " + "number in the list (after the end of list if no number is " + "available); this option is used only if the buffer has no " + "layout number"), + "end|first_gap", 0, 0, "end", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_buffer_search_case_sensitive = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "buffer_search_case_sensitive", "boolean", + N_("default text search in buffer: case sensitive or not"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_buffer_search_force_default = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "buffer_search_force_default", "boolean", + N_("force default values for text search in buffer (instead of " + "using values from last search in buffer)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_buffer_search_regex = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "buffer_search_regex", "boolean", + N_("default text search in buffer: if enabled, search POSIX " + "extended regular expression, otherwise search simple string"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_buffer_search_where = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "buffer_search_where", "integer", + N_("default text search in buffer: in message, prefix, prefix and " + "message"), + "prefix|message|prefix_message", 0, 0, "prefix_message", + NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_buffer_time_format = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "buffer_time_format", "string", + /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ + N_("time format for each line displayed in buffers (see man " + "strftime for date/time specifiers) (note: content is evaluated, " + "so you can use colors with format \"${color:xxx}\", see /help " + "eval); for example time using grayscale (requires support of " + "256 colors): \"${color:252}%H${color:245}%M${color:240}%S\""), + NULL, 0, 0, "%H:%M:%S", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_time_format, NULL, NULL, + NULL, NULL, NULL); + config_look_buffer_time_same = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "buffer_time_same", "string", + /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ + N_("time displayed for a message with same time as previous message: " + "use a space \" \" to hide time, another string to display this " + "string instead of time, or an empty string to disable feature " + "(display time) (note: content is evaluated, so you can use " + "colors with format \"${color:xxx}\", see /help eval)"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_time_same, NULL, NULL, + NULL, NULL, NULL); + config_look_chat_space_right = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "chat_space_right", "boolean", + N_("keep a space on the right side of chat area if there is a bar " + "displayed on the right (for both text and read marker)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_color_basic_force_bold = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "color_basic_force_bold", "boolean", + N_("force \"bold\" attribute for light colors and \"darkgray\" in " + "basic colors (this option is disabled by default: bold is used " + "only if terminal has less than 16 colors)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_look_color_inactive_buffer = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "color_inactive_buffer", "boolean", + N_("use a different color for lines in inactive buffer (when line " + "is from a merged buffer not selected)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_color_inactive_message = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "color_inactive_message", "boolean", + N_("use a different color for inactive message (when window is not " + "current window, or if line is from a merged buffer not selected)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_color_inactive_prefix = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "color_inactive_prefix", "boolean", + N_("use a different color for inactive prefix (when window is not " + "current window, or if line is from a merged buffer not selected)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_color_inactive_prefix_buffer = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "color_inactive_prefix_buffer", "boolean", + N_("use a different color for inactive buffer name in prefix (when " + "window is not current window, or if line is from a merged buffer " + "not selected)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_color_inactive_time = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "color_inactive_time", "boolean", + N_("use a different color for inactive time (when window is not " + "current window, or if line is from a merged buffer not " + "selected)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_color_inactive_window = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "color_inactive_window", "boolean", + N_("use a different color for lines in inactive window (when window " + "is not current window)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_color_nick_offline = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "color_nick_offline", "boolean", + N_("use a different color for offline nicks (not in nicklist any " + "more)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_color_pairs_auto_reset = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "color_pairs_auto_reset", "integer", + N_("automatically reset table of color pairs when number of " + "available pairs is lower or equal to this number (-1 = " + "disable automatic reset, and then a manual \"/color reset\" " + "is needed when table is full)"), + NULL, -1, 256, "5", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_color_real_white = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "color_real_white", "boolean", + N_("if set, uses real white color, disabled by default " + "for terms with white background (if you never use " + "white background, you should turn on this option to " + "see real white instead of default term foreground " + "color)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_look_command_chars = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "command_chars", "string", + N_("chars used to determine if input string is a command or not: " + "input must start with one of these chars; the slash (\"/\") is " + "always considered as command prefix (example: \".$\")"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_command_incomplete = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "command_incomplete", "boolean", + N_("if set, incomplete and unambiguous commands are allowed, for " + "example /he for /help"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_confirm_quit = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "confirm_quit", "boolean", + N_("if set, /quit command must be confirmed with extra argument " + "\"-yes\" (see /help quit)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_confirm_upgrade = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "confirm_upgrade", "boolean", + N_("if set, /upgrade command must be confirmed with extra argument " + "\"-yes\" (see /help upgrade)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_day_change = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "day_change", "boolean", + N_("display special message when day changes"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_day_change_message_1date = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "day_change_message_1date", "string", + /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ + N_("message displayed when the day has changed, with one date " + "displayed (for example at beginning of buffer) (see man " + "strftime for date/time specifiers) (note: content is " + "evaluated, so you can use colors with format \"${color:xxx}\", " + "see /help eval)"), + NULL, 0, 0, "-- %a, %d %b %Y --", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_day_change_message_2dates = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "day_change_message_2dates", "string", + /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ + N_("message displayed when the day has changed, with two dates " + "displayed (between two messages); the second date specifiers " + "must start with two \"%\" because strftime is called two " + "times on this string (see man strftime for date/time " + "specifiers) (note: content is evaluated, so you can use " + "colors with format \"${color:xxx}\", see /help eval)"), + NULL, 0, 0, "-- %%a, %%d %%b %%Y (%a, %d %b %Y) --", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_eat_newline_glitch = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "eat_newline_glitch", "boolean", + N_("if set, the eat_newline_glitch will be set to 0; this is used " + "to not add new line char at end of each line, and then not " + "break text when you copy/paste text from WeeChat to another " + "application (this option is disabled by default because it " + "can cause serious display bugs)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &config_change_eat_newline_glitch, NULL, NULL, + NULL, NULL, NULL); + config_look_emphasized_attributes = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "emphasized_attributes", "string", + N_("attributes for emphasized text: one or more attribute chars (" + "\"%\" for blink, " + "\".\" for \"dim\" (half bright), " + "\"*\" for bold, " + "\"!\" for reverse, " + "\"/\" for italic, " + "\"_\" for underline); " + "if the string is empty, " + "the colors weechat.color.emphasized* are used"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_emphasized_attributes, NULL, NULL, + NULL, NULL, NULL); + config_look_highlight = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "highlight", "string", + N_("comma separated list of words to highlight; case insensitive " + "comparison (use \"(?-i)\" at beginning of words to make them " + "case sensitive), words may begin or end with \"*\" for partial " + "match; example: \"test,(?-i)*toto*,flash*\""), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_highlight_disable_regex = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "highlight_disable_regex", "string", + N_("POSIX extended regular expression used to prevent any highlight " + "from a message: this option has higher priority over other " + "highlight options (if the string is found in the message, the " + "highlight is disabled and the other options are ignored), " + "regular expression is case insensitive (use \"(?-i)\" at " + "beginning to make it case sensitive), examples: " + "\"<flash.*>\", \"(?-i)<Flash.*>\""), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_highlight_disable_regex, NULL, NULL, + NULL, NULL, NULL); + config_look_highlight_regex = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "highlight_regex", "string", + N_("POSIX extended regular expression used to check if a message " + "has highlight or not, at least one match in string must be " + "surrounded by delimiters (chars different from: alphanumeric, " + "\"-\", \"_\" and \"|\"), regular expression is case insensitive " + "(use \"(?-i)\" at beginning to make it case sensitive), " + "examples: \"flashcode|flashy\", \"(?-i)FlashCode|flashy\""), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_highlight_regex, NULL, NULL, + NULL, NULL, NULL); + config_look_highlight_tags = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "highlight_tags", "string", + N_("comma separated list of tags to highlight; case insensitive " + "comparison; wildcard \"*\" is allowed in each tag; many tags " + "can be separated by \"+\" to make a logical \"and\" between " + "tags; examples: \"nick_flashcode\" for messages from nick " + "\"FlashCode\", \"irc_notice+nick_toto*\" for notices from a " + "nick starting with \"toto\""), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_highlight_tags, NULL, NULL, + NULL, NULL, NULL); + config_look_hotlist_add_conditions = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "hotlist_add_conditions", "string", + N_("conditions to add a buffer in hotlist (if notify level is OK " + "for the buffer); you can use in these conditions: \"window\" " + "(current window pointer), \"buffer\" (buffer pointer to add " + "in hotlist), \"priority\" (0 = low, 1 = message, 2 = private, " + "3 = highlight); by default a buffer is added to hotlist if " + "you are away, or if the buffer is not visible on screen (not " + "displayed in any window), or if at least one relay client is " + "connected via the weechat protocol"), + NULL, 0, 0, + "${away} " + "|| ${buffer.num_displayed} == 0 " + "|| ${info:relay_client_count,weechat,connected} > 0", + NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_hotlist_buffer_separator = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "hotlist_buffer_separator", "string", + N_("string displayed between buffers in hotlist"), + NULL, 0, 0, ", ", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); + config_look_hotlist_count_max = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "hotlist_count_max", "integer", + N_("max number of messages count to display in hotlist for a buffer: " + "0 = never display messages count, " + "other number = display max N messages count (from the highest " + "to lowest priority)"), + NULL, 0, GUI_HOTLIST_NUM_PRIORITIES, "2", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); + config_look_hotlist_count_min_msg = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "hotlist_count_min_msg", "integer", + N_("display messages count if number of messages is greater or " + "equal to this value"), + NULL, 1, 100, "2", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); + config_look_hotlist_names_count = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "hotlist_names_count", "integer", + N_("max number of names in hotlist (0 = no name displayed, only " + "buffer numbers)"), + NULL, 0, GUI_BUFFERS_MAX, "3", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); + config_look_hotlist_names_length = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "hotlist_names_length", "integer", + N_("max length of names in hotlist (0 = no limit)"), + NULL, 0, 32, "0", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); + config_look_hotlist_names_level = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "hotlist_names_level", "integer", + N_("level for displaying names in hotlist (combination " + "of: 1=join/part, 2=message, 4=private, 8=highlight, " + "for example: 12=private+highlight)"), + NULL, 1, GUI_HOTLIST_MASK_MAX, "12", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); + config_look_hotlist_names_merged_buffers = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "hotlist_names_merged_buffers", "boolean", + N_("if set, force display of names in hotlist for merged buffers"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); + config_look_hotlist_prefix = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "hotlist_prefix", "string", + N_("text displayed at the beginning of the hotlist"), + NULL, 0, 0, "H: ", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); + config_look_hotlist_remove = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "hotlist_remove", "integer", + N_("remove buffers in hotlist: buffer = remove buffer by buffer, " + "merged = remove all visible merged buffers at once"), + "buffer|merged", + 0, 0, "merged", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_hotlist_short_names = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "hotlist_short_names", "boolean", + N_("if set, uses short names to display buffer names in hotlist " + "(start after first \".\" in name)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); + config_look_hotlist_sort = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "hotlist_sort", "integer", + N_("sort of hotlist: group_time_*: group by notify level " + "(highlights first) then sort by time, group_number_*: group " + "by notify level (highlights first) then sort by number, " + "number_*: sort by number; asc = ascending sort, desc = " + "descending sort"), + "group_time_asc|group_time_desc|group_number_asc|" + "group_number_desc|number_asc|number_desc", + 0, 0, "group_time_asc", NULL, 0, + NULL, NULL, NULL, + &config_change_hotlist_sort, NULL, NULL, + NULL, NULL, NULL); + config_look_hotlist_suffix = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "hotlist_suffix", "string", + N_("text displayed at the end of the hotlist"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); + config_look_hotlist_unique_numbers = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "hotlist_unique_numbers", "boolean", + N_("keep only unique numbers in hotlist (this applies only on " + "hotlist items where name is NOT displayed after number)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); + config_look_hotlist_update_on_buffer_switch = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "hotlist_update_on_buffer_switch", "boolean", + N_("update the hotlist when switching buffers"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_input_cursor_scroll = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "input_cursor_scroll", "integer", + N_("number of chars displayed after end of input line when " + "scrolling to display end of line"), + NULL, 0, 100, "20", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_input_multiline_lead_linebreak = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "input_multiline_lead_linebreak", "boolean", + N_("start the input text on a new line when the input contains " + "multiple lines, so that the start of the lines align"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_input_share = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "input_share", "integer", + N_("share commands, text, or both in input for all buffers (there " + "is still local history for each buffer)"), + "none|commands|text|all", + 0, 0, "none", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_input_share_overwrite = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "input_share_overwrite", "boolean", + N_("if set and input is shared, always overwrite input in target " + "buffer"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_input_undo_max = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "input_undo_max", "integer", + N_("max number of \"undo\" for command line, by buffer (0 = undo " + "disabled)"), + NULL, 0, 65535, "32", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_item_away_message = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "item_away_message", "boolean", + N_("display server away message in away bar item"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_item_away, NULL, NULL, + NULL, NULL, NULL); + config_look_item_buffer_filter = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "item_buffer_filter", "string", + N_("string used to show that some lines are filtered in current " + "buffer (bar item \"buffer_filter\")"), + NULL, 0, 0, "*", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); + config_look_item_buffer_zoom = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "item_buffer_zoom", "string", + N_("string used to show zoom on merged buffer " + "(bar item \"buffer_zoom\")"), + NULL, 0, 0, "!", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); + config_look_item_mouse_status = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "item_mouse_status", "string", + N_("string used to show if mouse is enabled " + "(bar item \"mouse_status\")"), + NULL, 0, 0, "M", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); + config_look_item_time_format = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "item_time_format", "string", + N_("time format for \"time\" bar item (see man strftime for " + "date/time specifiers) (note: content is evaluated, so you can " + "use colors with format \"${color:xxx}\", see /help eval)"), + NULL, 0, 0, "%H:%M", NULL, 0, + NULL, NULL, NULL, + &config_change_item_time_format, NULL, NULL, + NULL, NULL, NULL); + config_look_jump_current_to_previous_buffer = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "jump_current_to_previous_buffer", "boolean", + N_("jump to previous buffer displayed when jumping to current " + "buffer number with /buffer *N (where N is a buffer number), to " + "easily switch to another buffer, then come back to current " + "buffer"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_jump_previous_buffer_when_closing = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "jump_previous_buffer_when_closing", "boolean", + N_("jump to previously visited buffer when closing a buffer (if " + "disabled, then jump to buffer number - 1)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_jump_smart_back_to_buffer = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "jump_smart_back_to_buffer", "boolean", + N_("jump back to initial buffer after reaching end of hotlist"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_key_bind_safe = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "key_bind_safe", "boolean", + N_("allow only binding of \"safe\" keys (beginning with a ctrl or " + "meta code)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_key_grab_delay = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "key_grab_delay", "integer", + N_("default delay (in milliseconds) to grab a key (using default " + "key alt-k); this delay can be overridden in the /input command " + "(see /help input)"), + NULL, 1, 10000, "800", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_mouse = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "mouse", "boolean", + N_("enable mouse support"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &config_change_mouse, NULL, NULL, + NULL, NULL, NULL); + config_look_mouse_timer_delay = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "mouse_timer_delay", "integer", + N_("delay (in milliseconds) to grab a mouse event: WeeChat will " + "wait this delay before processing event"), + NULL, 1, 10000, "100", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_nick_color_force = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "nick_color_force", "string", + N_("force color for some nicks: hash computed with nickname " + "to find color will not be used for these nicks (format is: " + "\"nick1:color1;nick2:color2\"); look up for nicks is with " + "exact case then lower case, so it's possible to use only lower " + "case for nicks in this option; color can include background with " + "the format \"text,background\", for example \"yellow,red\""), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_look_nick_color_force, NULL, NULL, + NULL, NULL, NULL); + config_look_nick_color_hash = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "nick_color_hash", "integer", + N_("hash algorithm used to find the color for a nick: djb2 = variant " + "of djb2 (position of letters matters: anagrams of a nick have " + "different color), djb2_32 = variant of djb2 using 32-bit instead " + "of 64-bit integer, sum = sum of letters, sum_32 = sum of letters " + "using 32-bit instead of 64-bit integer"), + "djb2|sum|djb2_32|sum_32", 0, 0, "djb2", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_nick_color_hash_salt = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "nick_color_hash_salt", "string", + N_("salt for the hash algorithm used to find nick colors " + "(the nickname is appended to this salt and the hash algorithm " + "operates on this string); modifying this shuffles nick colors"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_nick_color_stop_chars = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "nick_color_stop_chars", "string", + N_("chars used to stop in nick when computing color with letters of " + "nick (at least one char outside this list must be in string " + "before stopping) (example: nick \"|nick|away\" with \"|\" in " + "chars will return color of nick \"|nick\"); this option has an " + "impact on option weechat.look.nick_color_force, so the nick " + "for the forced color must not contain the chars ignored by " + "this option"), + NULL, 0, 0, "_|[", NULL, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + config_look_nick_prefix = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "nick_prefix", "string", + N_("text to display before nick in prefix of message, example: " + "\"<\""), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_nick_prefix_suffix, NULL, NULL, + NULL, NULL, NULL); + config_look_nick_suffix = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "nick_suffix", "string", + N_("text to display after nick in prefix of message, example: " + "\">\""), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_nick_prefix_suffix, NULL, NULL, + NULL, NULL, NULL); + config_look_paste_bracketed = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "paste_bracketed", "boolean", + N_("enable terminal \"bracketed paste mode\" (not supported in all " + "terminals/multiplexers): in this mode, pasted text is bracketed " + "with control sequences so that WeeChat can differentiate pasted " + "text from typed-in text (\"ESC[200~\", followed by the pasted " + "text, followed by \"ESC[201~\")"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_paste_bracketed, NULL, NULL, + NULL, NULL, NULL); + config_look_paste_bracketed_timer_delay = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "paste_bracketed_timer_delay", "integer", + N_("force end of bracketed paste after this delay (in seconds) if " + "the control sequence for end of bracketed paste (\"ESC[201~\") " + "was not received in time"), + NULL, 1, 60, "10", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_paste_max_lines = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "paste_max_lines", "integer", + N_("max number of lines for paste without asking user " + "(-1 = disable this feature); this option is used only if the " + "bar item \"input_paste\" is used in at least one bar (by default " + "it is used in \"input\" bar)"), + NULL, -1, INT_MAX, "100", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_prefix[GUI_CHAT_PREFIX_ERROR] = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "prefix_error", "string", + /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ + N_("prefix for error messages (note: content is evaluated, so you " + "can use colors with format \"${color:xxx}\", see /help eval)"), + NULL, 0, 0, GUI_CHAT_PREFIX_ERROR_DEFAULT, NULL, 0, + NULL, NULL, NULL, + &config_change_prefix, NULL, NULL, + NULL, NULL, NULL); + config_look_prefix[GUI_CHAT_PREFIX_NETWORK] = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "prefix_network", "string", + /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ + N_("prefix for network messages (note: content is evaluated, so you " + "can use colors with format \"${color:xxx}\", see /help eval)"), + NULL, 0, 0, GUI_CHAT_PREFIX_NETWORK_DEFAULT, NULL, 0, + NULL, NULL, NULL, + &config_change_prefix, NULL, NULL, + NULL, NULL, NULL); + config_look_prefix[GUI_CHAT_PREFIX_ACTION] = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "prefix_action", "string", + /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ + N_("prefix for action messages (note: content is evaluated, so you " + "can use colors with format \"${color:xxx}\", see /help eval)"), + NULL, 0, 0, GUI_CHAT_PREFIX_ACTION_DEFAULT, NULL, 0, + NULL, NULL, NULL, + &config_change_prefix, NULL, NULL, + NULL, NULL, NULL); + config_look_prefix[GUI_CHAT_PREFIX_JOIN] = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "prefix_join", "string", + /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ + N_("prefix for join messages (note: content is evaluated, so you " + "can use colors with format \"${color:xxx}\", see /help eval)"), + NULL, 0, 0, GUI_CHAT_PREFIX_JOIN_DEFAULT, NULL, 0, + NULL, NULL, NULL, + &config_change_prefix, NULL, NULL, + NULL, NULL, NULL); + config_look_prefix[GUI_CHAT_PREFIX_QUIT] = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "prefix_quit", "string", + /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ + N_("prefix for quit messages (note: content is evaluated, so you " + "can use colors with format \"${color:xxx}\", see /help eval)"), + NULL, 0, 0, GUI_CHAT_PREFIX_QUIT_DEFAULT, NULL, 0, + NULL, NULL, NULL, + &config_change_prefix, NULL, NULL, + NULL, NULL, NULL); + config_look_prefix_align = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "prefix_align", "integer", + N_("prefix alignment (none, left, right (default))"), + "none|left|right", 0, 0, "right", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_prefix_align_max = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "prefix_align_max", "integer", + N_("max size for prefix (0 = no max size)"), + NULL, 0, 128, "0", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_prefix_align_min = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "prefix_align_min", "integer", + N_("min size for prefix"), + NULL, 0, 128, "0", NULL, 0, + NULL, NULL, NULL, + &config_change_prefix_align_min, NULL, NULL, + NULL, NULL, NULL); + config_look_prefix_align_more = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "prefix_align_more", "string", + N_("char to display if prefix is truncated (must be exactly one " + "char on screen)"), + NULL, 0, 0, "+", NULL, 0, + &config_check_prefix_align_more, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_prefix_align_more_after = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "prefix_align_more_after", "boolean", + N_("display the truncature char (by default \"+\") after the text " + "(by replacing the space that should be displayed here); if " + "disabled, the truncature char replaces last char of text"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_prefix_buffer_align = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "prefix_buffer_align", "integer", + N_("prefix alignment for buffer name, when many buffers are merged " + "with same number (none, left, right (default))"), + "none|left|right", 0, 0, "right", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_prefix_buffer_align_max = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "prefix_buffer_align_max", "integer", + N_("max size for buffer name, when many buffers are merged with " + "same number (0 = no max size)"), + NULL, 0, 128, "0", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_prefix_buffer_align_more = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "prefix_buffer_align_more", "string", + N_("char to display if buffer name is truncated (when many buffers " + "are merged with same number) (must be exactly one char on " + "screen)"), + NULL, 0, 0, "+", NULL, 0, + &config_check_prefix_buffer_align_more, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_prefix_buffer_align_more_after = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "prefix_buffer_align_more_after", "boolean", + N_("display the truncature char (by default \"+\") after the text " + "(by replacing the space that should be displayed here); if " + "disabled, the truncature char replaces last char of text"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_prefix_same_nick = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "prefix_same_nick", "string", + N_("prefix displayed for a message with same nick as previous " + "but not next message: use a space \" \" to hide prefix, another " + "string to display this string instead of prefix, or an empty " + "string to disable feature (display prefix)"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_prefix_same_nick, NULL, NULL, + NULL, NULL, NULL); + config_look_prefix_same_nick_middle = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "prefix_same_nick_middle", "string", + N_("prefix displayed for a message with same nick as previous " + "and next message: use a space \" \" to hide prefix, another " + "string to display this string instead of prefix, or an empty " + "string to disable feature (display prefix)"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_prefix_same_nick_middle, NULL, NULL, + NULL, NULL, NULL); + config_look_prefix_suffix = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "prefix_suffix", "string", + N_("string displayed after prefix"), + NULL, 0, 0, "|", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_quote_nick_prefix = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "quote_nick_prefix", "string", + N_("text to display before nick when quoting a message (see /help " + "cursor)"), + NULL, 0, 0, "<", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_quote_nick_suffix = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "quote_nick_suffix", "string", + N_("text to display after nick when quoting a message (see /help " + "cursor)"), + NULL, 0, 0, ">", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_quote_time_format = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "quote_time_format", "string", + N_("time format when quoting a message (see /help cursor)"), + NULL, 0, 0, "%H:%M:%S", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_read_marker = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "read_marker", "integer", + N_("use a marker (line or char) on buffers to show first unread " + "line"), + "none|line|char", + 0, 0, "line", NULL, 0, + NULL, NULL, NULL, + &config_change_read_marker, NULL, NULL, + NULL, NULL, NULL); + config_look_read_marker_always_show = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "read_marker_always_show", "boolean", + N_("always show read marker, even if it is after last buffer line"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_read_marker_string = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "read_marker_string", "string", + N_("string used to draw read marker line (string is repeated until " + "end of line)"), + NULL, 0, 0, "- ", NULL, 0, + NULL, NULL, NULL, + &config_change_read_marker, NULL, NULL, + NULL, NULL, NULL); + config_look_read_marker_update_on_buffer_switch = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "read_marker_update_on_buffer_switch", "boolean", + N_("update the read marker when switching buffers"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_save_config_on_exit = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "save_config_on_exit", "boolean", + N_("save configuration file on exit"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_save_config_on_exit, NULL, NULL, + NULL, NULL, NULL); + config_look_save_config_with_fsync = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "save_config_with_fsync", "boolean", + N_("use fsync to synchronize the configuration file with the " + "storage device (see man fsync); this is slower but should " + "prevent any data loss in case of power failure during the " + "save of configuration file"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &config_change_save_config_on_exit, NULL, NULL, + NULL, NULL, NULL); + config_look_save_layout_on_exit = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "save_layout_on_exit", "integer", + N_("save layout on exit (buffers, windows, or both)"), + "none|buffers|windows|all", 0, 0, "none", NULL, 0, + NULL, NULL, NULL, + &config_change_save_layout_on_exit, NULL, NULL, + NULL, NULL, NULL); + config_look_scroll_amount = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "scroll_amount", "integer", + N_("how many lines to scroll by with scroll_up and " + "scroll_down"), + NULL, 1, INT_MAX, "3", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); + config_look_scroll_bottom_after_switch = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "scroll_bottom_after_switch", "boolean", + N_("scroll to bottom of window after switch to another buffer (do " + "not remember scroll position in windows); the scroll is done " + "only for buffers with formatted content (not free content)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_scroll_page_percent = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "scroll_page_percent", "integer", + N_("percent of screen to scroll when scrolling one page up or " + "down (for example 100 means one page, 50 half-page)"), + NULL, 1, 100, "100", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_search_text_not_found_alert = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "search_text_not_found_alert", "boolean", + N_("alert user when text sought is not found in buffer"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_separator_horizontal = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "separator_horizontal", "string", + N_("char used to draw horizontal separators around bars and windows " + "(empty value will draw a real line with ncurses, but may cause " + "bugs with URL selection under some terminals); " + "width on screen must be exactly one char"), + NULL, 0, 0, "-", NULL, 0, + &config_check_separator, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_separator_vertical = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "separator_vertical", "string", + N_("char used to draw vertical separators around bars and windows " + "(empty value will draw a real line with ncurses); " + "width on screen must be exactly one char"), + NULL, 0, 0, "", NULL, 0, + &config_check_separator, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_tab_width = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "tab_width", "integer", + N_("number of spaces used to display tabs in messages"), + NULL, 1, TAB_MAX_WIDTH, "1", NULL, 0, + NULL, NULL, NULL, + &config_change_tab_width, NULL, NULL, + NULL, NULL, NULL); + config_look_time_format = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "time_format", "string", + N_("time format for dates converted to strings and displayed in " + "messages (see man strftime for date/time specifiers)"), + NULL, 0, 0, "%a, %d %b %Y %T", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_window_auto_zoom = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "window_auto_zoom", "boolean", + N_("automatically zoom on current window if the terminal becomes " + "too small to display all windows (use alt-z to unzoom windows " + "when the terminal is big enough)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_window_separator_horizontal = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "window_separator_horizontal", "boolean", + N_("display an horizontal separator between windows"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_window_separator_vertical = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "window_separator_vertical", "boolean", + N_("display a vertical separator between windows"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); + config_look_window_title = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "window_title", "string", + N_("title for window (terminal for Curses GUI), set on startup; " + "an empty string will keep title unchanged " + "(note: content is evaluated, see /help eval); example: " + "\"WeeChat ${info:version}\""), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_window_title, NULL, NULL, + NULL, NULL, NULL); + config_look_word_chars_highlight = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "word_chars_highlight", "string", + N_("comma-separated list of chars (or range of chars) that are " + "considered part of words for highlights; " + "each item can be a single char, a range of chars (format: a-z), " + "a class of wide character (for example \"alnum\", " + "see man wctype); a \"!\" before the item makes it negative " + "(ie the char is NOT considered part of words); the value \"*\" " + "matches any char; unicode chars are allowed with the format " + "\\u1234, for example \\u00A0 for unbreakable space " + "(see /help print for supported formats)"), + NULL, 0, 0, "!\\u00A0,-,_,|,alnum", NULL, 0, + NULL, NULL, NULL, + &config_change_word_chars_highlight, NULL, NULL, + NULL, NULL, NULL); + config_look_word_chars_input = config_file_new_option ( + weechat_config_file, weechat_config_section_look, + "word_chars_input", "string", + N_("comma-separated list of chars (or range of chars) that are " + "considered part of words for command line; " + "each item can be a single char, a range of chars (format: a-z), " + "a class of wide character (for example \"alnum\", " + "see man wctype); a \"!\" before the item makes it negative " + "(ie the char is NOT considered part of words); the value \"*\" " + "matches any char; unicode chars are allowed with the format " + "\\u1234, for example \\u00A0 for unbreakable space " + "(see /help print for supported formats)"), + NULL, 0, 0, "!\\u00A0,-,_,|,alnum", NULL, 0, + NULL, NULL, NULL, + &config_change_word_chars_input, NULL, NULL, + NULL, NULL, NULL); } - config_look_align_end_of_lines = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "align_end_of_lines", "integer", - N_("alignment for end of lines (all lines after the first): they " - "are starting under this data (time, buffer, prefix, suffix, " - "message (default))"), - "time|buffer|prefix|suffix|message", 0, 0, "message", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_align_multiline_words = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "align_multiline_words", "boolean", - N_("alignment for multiline words according to option " - "weechat.look.align_end_of_lines; if disabled, the multiline words " - "will not be aligned, which can be useful to not break long URLs"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_bar_more_down = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "bar_more_down", "string", - N_("string displayed when bar can be scrolled down " - "(for bars with filling different from \"horizontal\")"), - NULL, 0, 0, "++", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_content, NULL, NULL, - NULL, NULL, NULL); - config_look_bar_more_left = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "bar_more_left", "string", - N_("string displayed when bar can be scrolled to the left " - "(for bars with filling \"horizontal\")"), - NULL, 0, 0, "<<", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_content, NULL, NULL, - NULL, NULL, NULL); - config_look_bar_more_right = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "bar_more_right", "string", - N_("string displayed when bar can be scrolled to the right " - "(for bars with filling \"horizontal\")"), - NULL, 0, 0, ">>", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_content, NULL, NULL, - NULL, NULL, NULL); - config_look_bar_more_up = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "bar_more_up", "string", - N_("string displayed when bar can be scrolled up " - "(for bars with filling different from \"horizontal\")"), - NULL, 0, 0, "--", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_content, NULL, NULL, - NULL, NULL, NULL); - config_look_bare_display_exit_on_input = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "bare_display_exit_on_input", "boolean", - N_("exit the bare display mode on any changes in input"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_bare_display_time_format = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "bare_display_time_format", "string", - N_("time format in bare display mode (see man strftime for date/time " - "specifiers)"), - NULL, 0, 0, "%H:%M", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_content, NULL, NULL, - NULL, NULL, NULL); - config_look_buffer_auto_renumber = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "buffer_auto_renumber", "boolean", - N_("automatically renumber buffers to have only consecutive numbers " - "and start with number 1; if disabled, gaps between buffer numbers " - "are allowed and the first buffer can have a number greater than 1"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_auto_renumber, NULL, NULL, - NULL, NULL, NULL); - config_look_buffer_notify_default = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "buffer_notify_default", "integer", - N_("default notify level for buffers (used to tell WeeChat if buffer " - "must be displayed in hotlist or not, according to importance " - "of message): all=all messages (default), " - "message=messages+highlights, highlight=highlights only, " - "none=never display in hotlist"), - "none|highlight|message|all", 0, 0, "all", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_notify_default, NULL, NULL, - NULL, NULL, NULL); - config_look_buffer_position = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "buffer_position", "integer", - N_("position of a new buffer: end = after the end of list (number = " - "last number + 1) (default), first_gap = at first available " - "number in the list (after the end of list if no number is " - "available); this option is used only if the buffer has no layout " - "number"), - "end|first_gap", 0, 0, "end", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_buffer_search_case_sensitive = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "buffer_search_case_sensitive", "boolean", - N_("default text search in buffer: case sensitive or not"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_buffer_search_force_default = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "buffer_search_force_default", "boolean", - N_("force default values for text search in buffer (instead of using " - "values from last search in buffer)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_buffer_search_regex = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "buffer_search_regex", "boolean", - N_("default text search in buffer: if enabled, search POSIX extended " - "regular expression, otherwise search simple string"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_buffer_search_where = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "buffer_search_where", "integer", - N_("default text search in buffer: in message, prefix, prefix and " - "message"), - "prefix|message|prefix_message", 0, 0, "prefix_message", - NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_buffer_time_format = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "buffer_time_format", "string", - /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ - N_("time format for each line displayed in buffers (see man strftime " - "for date/time specifiers) (note: content is evaluated, so you can " - "use colors with format \"${color:xxx}\", see /help eval); for " - "example time using grayscale (requires support of 256 colors): " - "\"${color:252}%H${color:245}%M${color:240}%S\""), - NULL, 0, 0, "%H:%M:%S", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_time_format, NULL, NULL, - NULL, NULL, NULL); - config_look_buffer_time_same = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "buffer_time_same", "string", - /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ - N_("time displayed for a message with same time as previous message: " - "use a space \" \" to hide time, another string to display this " - "string instead of time, or an empty string to disable feature " - "(display time) (note: content is evaluated, so you can use " - "colors with format \"${color:xxx}\", see /help eval)"), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_time_same, NULL, NULL, - NULL, NULL, NULL); - config_look_chat_space_right = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "chat_space_right", "boolean", - N_("keep a space on the right side of chat area if there is a bar " - "displayed on the right (for both text and read marker)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_color_basic_force_bold = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "color_basic_force_bold", "boolean", - N_("force \"bold\" attribute for light colors and \"darkgray\" in " - "basic colors (this option is disabled by default: bold is used " - "only if terminal has less than 16 colors)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_look_color_inactive_buffer = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "color_inactive_buffer", "boolean", - N_("use a different color for lines in inactive buffer (when line is " - "from a merged buffer not selected)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_color_inactive_message = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "color_inactive_message", "boolean", - N_("use a different color for inactive message (when window is not " - "current window, or if line is from a merged buffer not selected)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_color_inactive_prefix = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "color_inactive_prefix", "boolean", - N_("use a different color for inactive prefix (when window is not " - "current window, or if line is from a merged buffer not selected)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_color_inactive_prefix_buffer = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "color_inactive_prefix_buffer", "boolean", - N_("use a different color for inactive buffer name in prefix (when " - "window is not current window, or if line is from a merged buffer " - "not selected)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_color_inactive_time = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "color_inactive_time", "boolean", - N_("use a different color for inactive time (when window is not " - "current window, or if line is from a merged buffer not selected)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_color_inactive_window = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "color_inactive_window", "boolean", - N_("use a different color for lines in inactive window (when window " - "is not current window)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_color_nick_offline = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "color_nick_offline", "boolean", - N_("use a different color for offline nicks (not in nicklist any more)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_color_pairs_auto_reset = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "color_pairs_auto_reset", "integer", - N_("automatically reset table of color pairs when number of available " - "pairs is lower or equal to this number (-1 = disable automatic " - "reset, and then a manual \"/color reset\" is needed when table " - "is full)"), - NULL, -1, 256, "5", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_color_real_white = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "color_real_white", "boolean", - N_("if set, uses real white color, disabled by default " - "for terms with white background (if you never use " - "white background, you should turn on this option to " - "see real white instead of default term foreground " - "color)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_look_command_chars = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "command_chars", "string", - N_("chars used to determine if input string is a command or not: " - "input must start with one of these chars; the slash (\"/\") is " - "always considered as command prefix (example: \".$\")"), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_command_incomplete = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "command_incomplete", "boolean", - N_("if set, incomplete and unambiguous commands are allowed, for " - "example /he for /help"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_confirm_quit = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "confirm_quit", "boolean", - N_("if set, /quit command must be confirmed with extra argument " - "\"-yes\" (see /help quit)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_confirm_upgrade = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "confirm_upgrade", "boolean", - N_("if set, /upgrade command must be confirmed with extra argument " - "\"-yes\" (see /help upgrade)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_day_change = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "day_change", "boolean", - N_("display special message when day changes"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_day_change_message_1date = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "day_change_message_1date", "string", - /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ - N_("message displayed when the day has changed, with one date displayed " - "(for example at beginning of buffer) (see man strftime for " - "date/time specifiers) (note: content is evaluated, so you can use " - "colors with format \"${color:xxx}\", see /help eval)"), - NULL, 0, 0, "-- %a, %d %b %Y --", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_day_change_message_2dates = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "day_change_message_2dates", "string", - /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ - N_("message displayed when the day has changed, with two dates displayed " - "(between two messages); the second date specifiers must start with " - "two \"%\" because strftime is called two times on this string " - "(see man strftime for date/time specifiers) (note: content is " - "evaluated, so you can use colors with format \"${color:xxx}\", " - "see /help eval)"), - NULL, 0, 0, "-- %%a, %%d %%b %%Y (%a, %d %b %Y) --", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_eat_newline_glitch = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "eat_newline_glitch", "boolean", - N_("if set, the eat_newline_glitch will be set to 0; this is used to " - "not add new line char at end of each line, and then not break " - "text when you copy/paste text from WeeChat to another application " - "(this option is disabled by default because it can cause serious " - "display bugs)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, - &config_change_eat_newline_glitch, NULL, NULL, - NULL, NULL, NULL); - config_look_emphasized_attributes = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "emphasized_attributes", "string", - N_("attributes for emphasized text: one or more attribute chars (" - "\"%\" for blink, " - "\".\" for \"dim\" (half bright), " - "\"*\" for bold, " - "\"!\" for reverse, " - "\"/\" for italic, " - "\"_\" for underline); " - "if the string is empty, " - "the colors weechat.color.emphasized* are used"), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, - &config_change_emphasized_attributes, NULL, NULL, - NULL, NULL, NULL); - config_look_highlight = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "highlight", "string", - N_("comma separated list of words to highlight; case insensitive " - "comparison (use \"(?-i)\" at beginning of words to make them case " - "sensitive), words may begin or end with \"*\" for partial match; " - "example: \"test,(?-i)*toto*,flash*\""), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_highlight_disable_regex = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "highlight_disable_regex", "string", - N_("POSIX extended regular expression used to prevent any highlight " - "from a message: this option has higher priority over other " - "highlight options (if the string is found in the message, the " - "highlight is disabled and the other options are ignored), " - "regular expression is case insensitive (use \"(?-i)\" at beginning " - "to make it case sensitive), examples: " - "\"<flash.*>\", \"(?-i)<Flash.*>\""), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, - &config_change_highlight_disable_regex, NULL, NULL, - NULL, NULL, NULL); - config_look_highlight_regex = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "highlight_regex", "string", - N_("POSIX extended regular expression used to check if a message has " - "highlight or not, at least one match in string must be surrounded " - "by delimiters (chars different from: alphanumeric, \"-\", \"_\" " - "and \"|\"), regular expression is case insensitive (use \"(?-i)\" " - "at beginning to make it case sensitive), examples: " - "\"flashcode|flashy\", \"(?-i)FlashCode|flashy\""), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, - &config_change_highlight_regex, NULL, NULL, - NULL, NULL, NULL); - config_look_highlight_tags = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "highlight_tags", "string", - N_("comma separated list of tags to highlight; case insensitive " - "comparison; wildcard \"*\" is allowed in each tag; many tags can " - "be separated by \"+\" to make a logical \"and\" between tags; " - "examples: \"nick_flashcode\" for messages from nick \"FlashCode\", " - "\"irc_notice+nick_toto*\" for notices from a nick starting with " - "\"toto\""), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, - &config_change_highlight_tags, NULL, NULL, - NULL, NULL, NULL); - config_look_hotlist_add_conditions = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "hotlist_add_conditions", "string", - N_("conditions to add a buffer in hotlist (if notify level is OK for " - "the buffer); you can use in these conditions: \"window\" (current " - "window pointer), \"buffer\" (buffer pointer to add in hotlist), " - "\"priority\" (0 = low, 1 = message, 2 = private, 3 = highlight); " - "by default a buffer is added to hotlist if you are away, or " - "if the buffer is not visible on screen (not displayed in any " - "window), or if at least one relay client is connected via the " - "weechat protocol"), - NULL, 0, 0, - "${away} " - "|| ${buffer.num_displayed} == 0 " - "|| ${info:relay_client_count,weechat,connected} > 0", - NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_hotlist_buffer_separator = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "hotlist_buffer_separator", "string", - N_("string displayed between buffers in hotlist"), - NULL, 0, 0, ", ", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_content, NULL, NULL, - NULL, NULL, NULL); - config_look_hotlist_count_max = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "hotlist_count_max", "integer", - N_("max number of messages count to display in hotlist for a buffer: " - "0 = never display messages count, " - "other number = display max N messages count (from the highest to " - "lowest priority)"), - NULL, 0, GUI_HOTLIST_NUM_PRIORITIES, "2", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_content, NULL, NULL, - NULL, NULL, NULL); - config_look_hotlist_count_min_msg = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "hotlist_count_min_msg", "integer", - N_("display messages count if number of messages is greater or equal " - "to this value"), - NULL, 1, 100, "2", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_content, NULL, NULL, - NULL, NULL, NULL); - config_look_hotlist_names_count = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "hotlist_names_count", "integer", - N_("max number of names in hotlist (0 = no name displayed, only buffer " - "numbers)"), - NULL, 0, GUI_BUFFERS_MAX, "3", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_content, NULL, NULL, - NULL, NULL, NULL); - config_look_hotlist_names_length = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "hotlist_names_length", "integer", - N_("max length of names in hotlist (0 = no limit)"), - NULL, 0, 32, "0", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_content, NULL, NULL, - NULL, NULL, NULL); - config_look_hotlist_names_level = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "hotlist_names_level", "integer", - N_("level for displaying names in hotlist (combination " - "of: 1=join/part, 2=message, 4=private, 8=highlight, " - "for example: 12=private+highlight)"), - NULL, 1, GUI_HOTLIST_MASK_MAX, "12", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_content, NULL, NULL, - NULL, NULL, NULL); - config_look_hotlist_names_merged_buffers = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "hotlist_names_merged_buffers", "boolean", - N_("if set, force display of names in hotlist for merged buffers"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_content, NULL, NULL, - NULL, NULL, NULL); - config_look_hotlist_prefix = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "hotlist_prefix", "string", - N_("text displayed at the beginning of the hotlist"), - NULL, 0, 0, "H: ", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_content, NULL, NULL, - NULL, NULL, NULL); - config_look_hotlist_remove = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "hotlist_remove", "integer", - N_("remove buffers in hotlist: buffer = remove buffer by buffer, " - "merged = remove all visible merged buffers at once"), - "buffer|merged", - 0, 0, "merged", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_hotlist_short_names = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "hotlist_short_names", "boolean", - N_("if set, uses short names to display buffer names in hotlist (start " - "after first \".\" in name)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_content, NULL, NULL, - NULL, NULL, NULL); - config_look_hotlist_sort = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "hotlist_sort", "integer", - N_("sort of hotlist: group_time_*: group by notify level (highlights " - "first) then sort by time, group_number_*: group by notify level " - "(highlights first) then sort by number, number_*: sort by number; " - "asc = ascending sort, desc = descending sort"), - "group_time_asc|group_time_desc|group_number_asc|" - "group_number_desc|number_asc|number_desc", - 0, 0, "group_time_asc", NULL, 0, - NULL, NULL, NULL, - &config_change_hotlist_sort, NULL, NULL, - NULL, NULL, NULL); - config_look_hotlist_suffix = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "hotlist_suffix", "string", - N_("text displayed at the end of the hotlist"), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_content, NULL, NULL, - NULL, NULL, NULL); - config_look_hotlist_unique_numbers = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "hotlist_unique_numbers", "boolean", - N_("keep only unique numbers in hotlist (this applies only on hotlist " - "items where name is NOT displayed after number)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_content, NULL, NULL, - NULL, NULL, NULL); - config_look_hotlist_update_on_buffer_switch = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "hotlist_update_on_buffer_switch", "boolean", - N_("update the hotlist when switching buffers"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_input_cursor_scroll = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "input_cursor_scroll", "integer", - N_("number of chars displayed after end of input line when scrolling " - "to display end of line"), - NULL, 0, 100, "20", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_input_multiline_lead_linebreak = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "input_multiline_lead_linebreak", "boolean", - N_("start the input text on a new line when the input contains " - "multiple lines, so that the start of the lines align"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_input_share = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "input_share", "integer", - N_("share commands, text, or both in input for all buffers (there is " - "still local history for each buffer)"), - "none|commands|text|all", - 0, 0, "none", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_input_share_overwrite = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "input_share_overwrite", "boolean", - N_("if set and input is shared, always overwrite input in target " - "buffer"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_input_undo_max = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "input_undo_max", "integer", - N_("max number of \"undo\" for command line, by buffer (0 = undo " - "disabled)"), - NULL, 0, 65535, "32", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_item_away_message = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "item_away_message", "boolean", - N_("display server away message in away bar item"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &config_change_item_away, NULL, NULL, - NULL, NULL, NULL); - config_look_item_buffer_filter = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "item_buffer_filter", "string", - N_("string used to show that some lines are filtered in current buffer " - "(bar item \"buffer_filter\")"), - NULL, 0, 0, "*", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_content, NULL, NULL, - NULL, NULL, NULL); - config_look_item_buffer_zoom = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "item_buffer_zoom", "string", - N_("string used to show zoom on merged buffer " - "(bar item \"buffer_zoom\")"), - NULL, 0, 0, "!", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_content, NULL, NULL, - NULL, NULL, NULL); - config_look_item_mouse_status = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "item_mouse_status", "string", - N_("string used to show if mouse is enabled " - "(bar item \"mouse_status\")"), - NULL, 0, 0, "M", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_content, NULL, NULL, - NULL, NULL, NULL); - config_look_item_time_format = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "item_time_format", "string", - N_("time format for \"time\" bar item (see man strftime for date/time " - "specifiers) (note: content is evaluated, so you can use colors " - "with format \"${color:xxx}\", see /help eval)"), - NULL, 0, 0, "%H:%M", NULL, 0, - NULL, NULL, NULL, - &config_change_item_time_format, NULL, NULL, - NULL, NULL, NULL); - config_look_jump_current_to_previous_buffer = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "jump_current_to_previous_buffer", "boolean", - N_("jump to previous buffer displayed when jumping to current buffer " - "number with /buffer *N (where N is a buffer number), to easily " - "switch to another buffer, then come back to current buffer"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_jump_previous_buffer_when_closing = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "jump_previous_buffer_when_closing", "boolean", - N_("jump to previously visited buffer when closing a buffer (if " - "disabled, then jump to buffer number - 1)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_jump_smart_back_to_buffer = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "jump_smart_back_to_buffer", "boolean", - N_("jump back to initial buffer after reaching end of hotlist"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_key_bind_safe = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "key_bind_safe", "boolean", - N_("allow only binding of \"safe\" keys (beginning with a ctrl or meta " - "code)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_key_grab_delay = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "key_grab_delay", "integer", - N_("default delay (in milliseconds) to grab a key (using default key " - "alt-k); this delay can be overridden in the /input command (see " - "/help input)"), - NULL, 1, 10000, "800", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_mouse = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "mouse", "boolean", - N_("enable mouse support"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, - &config_change_mouse, NULL, NULL, - NULL, NULL, NULL); - config_look_mouse_timer_delay = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "mouse_timer_delay", "integer", - N_("delay (in milliseconds) to grab a mouse event: WeeChat will " - "wait this delay before processing event"), - NULL, 1, 10000, "100", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_nick_color_force = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "nick_color_force", "string", - N_("force color for some nicks: hash computed with nickname " - "to find color will not be used for these nicks (format is: " - "\"nick1:color1;nick2:color2\"); look up for nicks is with " - "exact case then lower case, so it's possible to use only lower " - "case for nicks in this option; color can include background with " - "the format \"text,background\", for example \"yellow,red\""), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, - &config_change_look_nick_color_force, NULL, NULL, - NULL, NULL, NULL); - config_look_nick_color_hash = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "nick_color_hash", "integer", - N_("hash algorithm used to find the color for a nick: djb2 = variant " - "of djb2 (position of letters matters: anagrams of a nick have " - "different color), djb2_32 = variant of djb2 using 32-bit instead " - "of 64-bit integer, sum = sum of letters, sum_32 = sum of letters " - "using 32-bit instead of 64-bit integer"), - "djb2|sum|djb2_32|sum_32", 0, 0, "djb2", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_nick_color_hash_salt = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "nick_color_hash_salt", "string", - N_("salt for the hash algorithm used to find nick colors " - "(the nickname is appended to this salt and the hash algorithm " - "operates on this string); modifying this shuffles nick colors"), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_nick_color_stop_chars = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "nick_color_stop_chars", "string", - N_("chars used to stop in nick when computing color with letters of " - "nick (at least one char outside this list must be in string before " - "stopping) (example: nick \"|nick|away\" with \"|\" in chars will " - "return color of nick \"|nick\"); this option has an impact on " - "option weechat.look.nick_color_force, so the nick for the forced " - "color must not contain the chars ignored by this option"), - NULL, 0, 0, "_|[", NULL, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - config_look_nick_prefix = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "nick_prefix", "string", - N_("text to display before nick in prefix of message, example: \"<\""), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, - &config_change_nick_prefix_suffix, NULL, NULL, - NULL, NULL, NULL); - config_look_nick_suffix = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "nick_suffix", "string", - N_("text to display after nick in prefix of message, example: \">\""), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, - &config_change_nick_prefix_suffix, NULL, NULL, - NULL, NULL, NULL); - config_look_paste_bracketed = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "paste_bracketed", "boolean", - N_("enable terminal \"bracketed paste mode\" (not supported in all " - "terminals/multiplexers): in this mode, pasted text is bracketed " - "with control sequences so that WeeChat can differentiate pasted " - "text from typed-in text (\"ESC[200~\", followed by the pasted text, " - "followed by \"ESC[201~\")"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &config_change_paste_bracketed, NULL, NULL, - NULL, NULL, NULL); - config_look_paste_bracketed_timer_delay = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "paste_bracketed_timer_delay", "integer", - N_("force end of bracketed paste after this delay (in seconds) if the " - "control sequence for end of bracketed paste (\"ESC[201~\") was not " - "received in time"), - NULL, 1, 60, "10", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_paste_max_lines = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "paste_max_lines", "integer", - N_("max number of lines for paste without asking user " - "(-1 = disable this feature); this option is used only if the bar " - "item \"input_paste\" is used in at least one bar (by default it " - "is used in \"input\" bar)"), - NULL, -1, INT_MAX, "100", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_prefix[GUI_CHAT_PREFIX_ERROR] = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "prefix_error", "string", - /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ - N_("prefix for error messages (note: content is evaluated, so you can " - "use colors with format \"${color:xxx}\", see /help eval)"), - NULL, 0, 0, GUI_CHAT_PREFIX_ERROR_DEFAULT, NULL, 0, - NULL, NULL, NULL, - &config_change_prefix, NULL, NULL, - NULL, NULL, NULL); - config_look_prefix[GUI_CHAT_PREFIX_NETWORK] = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "prefix_network", "string", - /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ - N_("prefix for network messages (note: content is evaluated, so you can " - "use colors with format \"${color:xxx}\", see /help eval)"), - NULL, 0, 0, GUI_CHAT_PREFIX_NETWORK_DEFAULT, NULL, 0, - NULL, NULL, NULL, - &config_change_prefix, NULL, NULL, - NULL, NULL, NULL); - config_look_prefix[GUI_CHAT_PREFIX_ACTION] = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "prefix_action", "string", - /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ - N_("prefix for action messages (note: content is evaluated, so you can " - "use colors with format \"${color:xxx}\", see /help eval)"), - NULL, 0, 0, GUI_CHAT_PREFIX_ACTION_DEFAULT, NULL, 0, - NULL, NULL, NULL, - &config_change_prefix, NULL, NULL, - NULL, NULL, NULL); - config_look_prefix[GUI_CHAT_PREFIX_JOIN] = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "prefix_join", "string", - /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ - N_("prefix for join messages (note: content is evaluated, so you can " - "use colors with format \"${color:xxx}\", see /help eval)"), - NULL, 0, 0, GUI_CHAT_PREFIX_JOIN_DEFAULT, NULL, 0, - NULL, NULL, NULL, - &config_change_prefix, NULL, NULL, - NULL, NULL, NULL); - config_look_prefix[GUI_CHAT_PREFIX_QUIT] = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "prefix_quit", "string", - /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ - N_("prefix for quit messages (note: content is evaluated, so you can " - "use colors with format \"${color:xxx}\", see /help eval)"), - NULL, 0, 0, GUI_CHAT_PREFIX_QUIT_DEFAULT, NULL, 0, - NULL, NULL, NULL, - &config_change_prefix, NULL, NULL, - NULL, NULL, NULL); - config_look_prefix_align = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "prefix_align", "integer", - N_("prefix alignment (none, left, right (default))"), - "none|left|right", 0, 0, "right", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_prefix_align_max = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "prefix_align_max", "integer", - N_("max size for prefix (0 = no max size)"), - NULL, 0, 128, "0", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_prefix_align_min = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "prefix_align_min", "integer", - N_("min size for prefix"), - NULL, 0, 128, "0", NULL, 0, - NULL, NULL, NULL, - &config_change_prefix_align_min, NULL, NULL, - NULL, NULL, NULL); - config_look_prefix_align_more = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "prefix_align_more", "string", - N_("char to display if prefix is truncated (must be exactly one char " - "on screen)"), - NULL, 0, 0, "+", NULL, 0, - &config_check_prefix_align_more, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_prefix_align_more_after = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "prefix_align_more_after", "boolean", - N_("display the truncature char (by default \"+\") after the text (by " - "replacing the space that should be displayed here); if disabled, " - "the truncature char replaces last char of text"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_prefix_buffer_align = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "prefix_buffer_align", "integer", - N_("prefix alignment for buffer name, when many buffers are merged " - "with same number (none, left, right (default))"), - "none|left|right", 0, 0, "right", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_prefix_buffer_align_max = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "prefix_buffer_align_max", "integer", - N_("max size for buffer name, when many buffers are merged with same " - "number (0 = no max size)"), - NULL, 0, 128, "0", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_prefix_buffer_align_more = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "prefix_buffer_align_more", "string", - N_("char to display if buffer name is truncated (when many buffers are " - "merged with same number) (must be exactly one char on screen)"), - NULL, 0, 0, "+", NULL, 0, - &config_check_prefix_buffer_align_more, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_prefix_buffer_align_more_after = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "prefix_buffer_align_more_after", "boolean", - N_("display the truncature char (by default \"+\") after the text (by " - "replacing the space that should be displayed here); if disabled, " - "the truncature char replaces last char of text"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_prefix_same_nick = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "prefix_same_nick", "string", - N_("prefix displayed for a message with same nick as previous " - "but not next message: use a space \" \" to hide prefix, another " - "string to display this string instead of prefix, or an empty " - "string to disable feature (display prefix)"), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, - &config_change_prefix_same_nick, NULL, NULL, - NULL, NULL, NULL); - config_look_prefix_same_nick_middle = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "prefix_same_nick_middle", "string", - N_("prefix displayed for a message with same nick as previous " - "and next message: use a space \" \" to hide prefix, another " - "string to display this string instead of prefix, or an empty " - "string to disable feature (display prefix)"), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, - &config_change_prefix_same_nick_middle, NULL, NULL, - NULL, NULL, NULL); - config_look_prefix_suffix = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "prefix_suffix", "string", - N_("string displayed after prefix"), - NULL, 0, 0, "|", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_quote_nick_prefix = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "quote_nick_prefix", "string", - N_("text to display before nick when quoting a message (see /help " - "cursor)"), - NULL, 0, 0, "<", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_quote_nick_suffix = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "quote_nick_suffix", "string", - N_("text to display after nick when quoting a message (see /help " - "cursor)"), - NULL, 0, 0, ">", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_quote_time_format = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "quote_time_format", "string", - N_("time format when quoting a message (see /help cursor)"), - NULL, 0, 0, "%H:%M:%S", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_read_marker = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "read_marker", "integer", - N_("use a marker (line or char) on buffers to show first unread line"), - "none|line|char", - 0, 0, "line", NULL, 0, - NULL, NULL, NULL, - &config_change_read_marker, NULL, NULL, - NULL, NULL, NULL); - config_look_read_marker_always_show = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "read_marker_always_show", "boolean", - N_("always show read marker, even if it is after last buffer line"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_read_marker_string = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "read_marker_string", "string", - N_("string used to draw read marker line (string is repeated until " - "end of line)"), - NULL, 0, 0, "- ", NULL, 0, - NULL, NULL, NULL, - &config_change_read_marker, NULL, NULL, - NULL, NULL, NULL); - config_look_read_marker_update_on_buffer_switch = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "read_marker_update_on_buffer_switch", "boolean", - N_("update the read marker when switching buffers"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_save_config_on_exit = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "save_config_on_exit", "boolean", - N_("save configuration file on exit"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &config_change_save_config_on_exit, NULL, NULL, - NULL, NULL, NULL); - config_look_save_config_with_fsync = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "save_config_with_fsync", "boolean", - N_("use fsync to synchronize the configuration file with the storage " - "device (see man fsync); this is slower but should prevent any " - "data loss in case of power failure during the save of " - "configuration file"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, - &config_change_save_config_on_exit, NULL, NULL, - NULL, NULL, NULL); - config_look_save_layout_on_exit = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "save_layout_on_exit", "integer", - N_("save layout on exit (buffers, windows, or both)"), - "none|buffers|windows|all", 0, 0, "none", NULL, 0, - NULL, NULL, NULL, - &config_change_save_layout_on_exit, NULL, NULL, - NULL, NULL, NULL); - config_look_scroll_amount = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "scroll_amount", "integer", - N_("how many lines to scroll by with scroll_up and " - "scroll_down"), - NULL, 1, INT_MAX, "3", NULL, 0, - NULL, NULL, NULL, - &config_change_buffer_content, NULL, NULL, - NULL, NULL, NULL); - config_look_scroll_bottom_after_switch = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "scroll_bottom_after_switch", "boolean", - N_("scroll to bottom of window after switch to another buffer (do not " - "remember scroll position in windows); the scroll is done only for " - "buffers with formatted content (not free content)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_scroll_page_percent = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "scroll_page_percent", "integer", - N_("percent of screen to scroll when scrolling one page up or down " - "(for example 100 means one page, 50 half-page)"), - NULL, 1, 100, "100", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_search_text_not_found_alert = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "search_text_not_found_alert", "boolean", - N_("alert user when text sought is not found in buffer"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_separator_horizontal = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "separator_horizontal", "string", - N_("char used to draw horizontal separators around bars and windows " - "(empty value will draw a real line with ncurses, but may cause bugs " - "with URL selection under some terminals); " - "width on screen must be exactly one char"), - NULL, 0, 0, "-", NULL, 0, - &config_check_separator, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_separator_vertical = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "separator_vertical", "string", - N_("char used to draw vertical separators around bars and windows " - "(empty value will draw a real line with ncurses); " - "width on screen must be exactly one char"), - NULL, 0, 0, "", NULL, 0, - &config_check_separator, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_tab_width = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "tab_width", "integer", - N_("number of spaces used to display tabs in messages"), - NULL, 1, TAB_MAX_WIDTH, "1", NULL, 0, - NULL, NULL, NULL, - &config_change_tab_width, NULL, NULL, - NULL, NULL, NULL); - config_look_time_format = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "time_format", "string", - N_("time format for dates converted to strings and displayed in " - "messages (see man strftime for date/time specifiers)"), - NULL, 0, 0, "%a, %d %b %Y %T", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_window_auto_zoom = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "window_auto_zoom", "boolean", - N_("automatically zoom on current window if the terminal becomes too " - "small to display all windows (use alt-z to unzoom windows when the " - "terminal is big enough)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_look_window_separator_horizontal = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "window_separator_horizontal", "boolean", - N_("display an horizontal separator between windows"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_window_separator_vertical = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "window_separator_vertical", "boolean", - N_("display a vertical separator between windows"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &config_change_buffers, NULL, NULL, - NULL, NULL, NULL); - config_look_window_title = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "window_title", "string", - N_("title for window (terminal for Curses GUI), set on startup; " - "an empty string will keep title unchanged " - "(note: content is evaluated, see /help eval); example: " - "\"WeeChat ${info:version}\""), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, - &config_change_window_title, NULL, NULL, - NULL, NULL, NULL); - config_look_word_chars_highlight = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "word_chars_highlight", "string", - N_("comma-separated list of chars (or range of chars) that are " - "considered part of words for highlights; " - "each item can be a single char, a range of chars (format: a-z), " - "a class of wide character (for example \"alnum\", " - "see man wctype); a \"!\" before the item makes it negative " - "(ie the char is NOT considered part of words); the value \"*\" " - "matches any char; unicode chars are allowed with the format " - "\\u1234, for example \\u00A0 for unbreakable space " - "(see /help print for supported formats)"), - NULL, 0, 0, "!\\u00A0,-,_,|,alnum", NULL, 0, - NULL, NULL, NULL, - &config_change_word_chars_highlight, NULL, NULL, - NULL, NULL, NULL); - config_look_word_chars_input = config_file_new_option ( - weechat_config_file, weechat_config_section_look, - "word_chars_input", "string", - N_("comma-separated list of chars (or range of chars) that are " - "considered part of words for command line; " - "each item can be a single char, a range of chars (format: a-z), " - "a class of wide character (for example \"alnum\", " - "see man wctype); a \"!\" before the item makes it negative " - "(ie the char is NOT considered part of words); the value \"*\" " - "matches any char; unicode chars are allowed with the format " - "\\u1234, for example \\u00A0 for unbreakable space " - "(see /help print for supported formats)"), - NULL, 0, 0, "!\\u00A0,-,_,|,alnum", NULL, 0, - NULL, NULL, NULL, - &config_change_word_chars_input, NULL, NULL, - NULL, NULL, NULL); - /* palette */ weechat_config_section_palette = config_file_new_section ( weechat_config_file, "palette", @@ -3978,12 +3986,6 @@ config_weechat_init_options () NULL, NULL, NULL, &config_weechat_palette_create_option_cb, NULL, NULL, &config_weechat_palette_delete_option_cb, NULL, NULL); - if (!weechat_config_section_palette) - { - config_file_free (weechat_config_file); - weechat_config_file = NULL; - return 0; - } /* colors */ weechat_config_section_color = config_file_new_section ( @@ -3994,557 +3996,558 @@ config_weechat_init_options () NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!weechat_config_section_color) + if (weechat_config_section_color) { - config_file_free (weechat_config_file); - weechat_config_file = NULL; - return 0; + /* bar colors */ + config_color_bar_more = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "bar_more", "color", + N_("text color for \"+\" when scrolling bars"), + NULL, -1, 0, "lightmagenta", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + /* chat area */ + config_color_chat = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat", "color", + N_("text color for chat"), + NULL, GUI_COLOR_CHAT, 0, "default", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_bg = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_bg", "color", + N_("background color for chat"), + NULL, -1, 0, "default", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_buffer = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_buffer", "color", + N_("text color for buffer names"), + NULL, GUI_COLOR_CHAT_BUFFER, 0, "white", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_channel = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_channel", "color", + N_("text color for channel names"), + NULL, GUI_COLOR_CHAT_CHANNEL, 0, "white", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_day_change = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_day_change", "color", + N_("text color for message displayed when the day has changed"), + NULL, GUI_COLOR_CHAT_DAY_CHANGE, 0, "cyan", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_delimiters = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_delimiters", "color", + N_("text color for delimiters"), + NULL, GUI_COLOR_CHAT_DELIMITERS, 0, "green", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_highlight = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_highlight", "color", + N_("text color for highlighted prefix"), + NULL, GUI_COLOR_CHAT_HIGHLIGHT, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_highlight_bg = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_highlight_bg", "color", + N_("background color for highlighted prefix"), + NULL, -1, 0, "magenta", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_host = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_host", "color", + N_("text color for hostnames"), + NULL, GUI_COLOR_CHAT_HOST, 0, "cyan", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_inactive_buffer = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_inactive_buffer", "color", + N_("text color for chat when line is inactive (buffer is merged " + "with other buffers and is not selected)"), + NULL, GUI_COLOR_CHAT_INACTIVE_BUFFER, 0, "default", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_inactive_window = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_inactive_window", "color", + N_("text color for chat when window is inactive (not current " + "selected window)"), + NULL, GUI_COLOR_CHAT_INACTIVE_WINDOW, 0, "default", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_nick = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_nick", "color", + N_("text color for nicks in chat window: used in some server " + "messages and as fallback when a nick color is not found; most " + "of times nick color comes from option " + "weechat.color.chat_nick_colors"), + NULL, GUI_COLOR_CHAT_NICK, 0, "lightcyan", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_nick_colors = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_nick_colors", "string", + /* TRANSLATORS: please do not translate "lightred:blue" */ + N_("text color for nicks (comma separated list of colors, " + "background is allowed with format: \"fg:bg\", for example: " + "\"lightred:blue\")"), + NULL, 0, 0, "cyan,magenta,green,brown,lightblue,default,lightcyan," + "lightmagenta,lightgreen,blue", NULL, 0, + NULL, NULL, NULL, + &config_change_nick_colors, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_nick_offline = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_nick_offline", "color", + N_("text color for offline nick (not in nicklist any more); this " + "color is used only if option weechat.look.color_nick_offline is " + "enabled"), + NULL, GUI_COLOR_CHAT_NICK_OFFLINE, 0, "default", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_nick_offline_highlight = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_nick_offline_highlight", "color", + N_("text color for offline nick with highlight; this color is used " + "only if option weechat.look.color_nick_offline is enabled"), + NULL, -1, 0, "default", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_nick_offline_highlight_bg = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_nick_offline_highlight_bg", "color", + N_("background color for offline nick with highlight; this color is " + "used only if option weechat.look.color_nick_offline is enabled"), + NULL, -1, 0, "blue", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_nick_other = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_nick_other", "color", + N_("text color for other nick in private buffer"), + NULL, GUI_COLOR_CHAT_NICK_OTHER, 0, "cyan", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_nick_prefix = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_nick_prefix", "color", + N_("color for nick prefix (string displayed before nick in prefix)"), + NULL, GUI_COLOR_CHAT_NICK_PREFIX, 0, "green", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_nick_self = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_nick_self", "color", + N_("text color for local nick in chat window"), + NULL, GUI_COLOR_CHAT_NICK_SELF, 0, "white", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_nick_suffix = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_nick_suffix", "color", + N_("color for nick suffix (string displayed after nick in prefix)"), + NULL, GUI_COLOR_CHAT_NICK_SUFFIX, 0, "green", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_prefix[GUI_CHAT_PREFIX_ERROR] = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_prefix_error", "color", + N_("text color for error prefix"), + NULL, GUI_COLOR_CHAT_PREFIX_ERROR, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_prefix_buffer = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_prefix_buffer", "color", + N_("text color for buffer name (before prefix, when many buffers " + "are merged with same number)"), + NULL, GUI_COLOR_CHAT_PREFIX_BUFFER, 0, "brown", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_prefix_buffer_inactive_buffer = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_prefix_buffer_inactive_buffer", "color", + N_("text color for inactive buffer name (before prefix, when many " + "buffers are merged with same number and if buffer is not " + "selected)"), + NULL, GUI_COLOR_CHAT_PREFIX_BUFFER_INACTIVE_BUFFER, 0, "default", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_prefix[GUI_CHAT_PREFIX_NETWORK] = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_prefix_network", "color", + N_("text color for network prefix"), + NULL, GUI_COLOR_CHAT_PREFIX_NETWORK, 0, "magenta", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_prefix[GUI_CHAT_PREFIX_ACTION] = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_prefix_action", "color", + N_("text color for action prefix"), + NULL, GUI_COLOR_CHAT_PREFIX_ACTION, 0, "white", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_prefix[GUI_CHAT_PREFIX_JOIN] = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_prefix_join", "color", + N_("text color for join prefix"), + NULL, GUI_COLOR_CHAT_PREFIX_JOIN, 0, "lightgreen", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_prefix[GUI_CHAT_PREFIX_QUIT] = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_prefix_quit", "color", + N_("text color for quit prefix"), + NULL, GUI_COLOR_CHAT_PREFIX_QUIT, 0, "lightred", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_prefix_more = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_prefix_more", "color", + N_("text color for \"+\" when prefix is too long"), + NULL, GUI_COLOR_CHAT_PREFIX_MORE, 0, "lightmagenta", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_prefix_suffix = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_prefix_suffix", "color", + N_("text color for suffix (after prefix)"), + NULL, GUI_COLOR_CHAT_PREFIX_SUFFIX, 0, "green", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_read_marker = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_read_marker", "color", + N_("text color for unread data marker"), + NULL, GUI_COLOR_CHAT_READ_MARKER, 0, "magenta", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_read_marker_bg = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_read_marker_bg", "color", + N_("background color for unread data marker"), + NULL, -1, 0, "default", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_server = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_server", "color", + N_("text color for server names"), + NULL, GUI_COLOR_CHAT_SERVER, 0, "brown", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_tags = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_tags", "color", + N_("text color for tags after messages (displayed with command " + "/debug tags)"), + NULL, GUI_COLOR_CHAT_TAGS, 0, "red", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_text_found = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_text_found", "color", + N_("text color for marker on lines where text sought is found"), + NULL, GUI_COLOR_CHAT_TEXT_FOUND, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_text_found_bg = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_text_found_bg", "color", + N_("background color for marker on lines where text sought is " + "found"), + NULL, -1, 0, "lightmagenta", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_time = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_time", "color", + N_("text color for time in chat window"), + NULL, GUI_COLOR_CHAT_TIME, 0, "default", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_time_delimiters = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_time_delimiters", "color", + N_("text color for time delimiters"), + NULL, GUI_COLOR_CHAT_TIME_DELIMITERS, 0, "brown", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_value = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_value", "color", + N_("text color for values"), + NULL, GUI_COLOR_CHAT_VALUE, 0, "cyan", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_chat_value_null = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "chat_value_null", "color", + N_("text color for null values (undefined)"), + NULL, GUI_COLOR_CHAT_VALUE_NULL, 0, "blue", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + /* emphasis (chat/bars) */ + config_color_emphasized = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "emphasized", "color", + N_("text color for emphasized text (for example when searching " + "text); this option is used only if option " + "weechat.look.emphasized_attributes is an empty string " + "(default value)"), + NULL, GUI_COLOR_EMPHASIS, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_emphasized_bg = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "emphasized_bg", "color", + N_("background color for emphasized text (for example when searching " + "text); used only if option weechat.look.emphasized_attributes " + "is an empty string (default value)"), + NULL, -1, 0, "magenta", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + /* input bar */ + config_color_input_actions = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "input_actions", "color", + N_("text color for actions in input line"), + NULL, -1, 0, "lightgreen", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_input_text_not_found = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "input_text_not_found", "color", + N_("text color for unsuccessful text search in input line"), + NULL, -1, 0, "red", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + /* items */ + config_color_item_away = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "item_away", "color", + N_("text color for away item"), + NULL, -1, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &config_change_item_away, NULL, NULL, + NULL, NULL, NULL); + /* nicklist bar */ + config_color_nicklist_away = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "nicklist_away", "color", + N_("text color for away nicknames"), + NULL, -1, 0, "cyan", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_nicklist_group = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "nicklist_group", "color", + N_("text color for groups in nicklist"), + NULL, -1, 0, "green", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + /* general color settings */ + config_color_separator = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "separator", "color", + N_("color for window separators (when split) and separators beside " + "bars (like nicklist)"), + NULL, GUI_COLOR_SEPARATOR, 0, "blue", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + /* status bar */ + config_color_status_count_highlight = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "status_count_highlight", "color", + N_("text color for count of highlight messages in hotlist " + "(status bar)"), + NULL, -1, 0, "magenta", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_status_count_msg = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "status_count_msg", "color", + N_("text color for count of messages in hotlist (status bar)"), + NULL, -1, 0, "brown", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_status_count_other = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "status_count_other", "color", + N_("text color for count of other messages in hotlist (status bar)"), + NULL, -1, 0, "default", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_status_count_private = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "status_count_private", "color", + N_("text color for count of private messages in hotlist " + "(status bar)"), + NULL, -1, 0, "green", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_status_data_highlight = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "status_data_highlight", "color", + N_("text color for buffer with highlight (status bar)"), + NULL, -1, 0, "lightmagenta", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_status_data_msg = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "status_data_msg", "color", + N_("text color for buffer with new messages (status bar)"), + NULL, -1, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_status_data_other = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "status_data_other", "color", + N_("text color for buffer with new data (not messages) " + "(status bar)"), + NULL, -1, 0, "default", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_status_data_private = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "status_data_private", "color", + N_("text color for buffer with private message (status bar)"), + NULL, -1, 0, "lightgreen", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_status_filter = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "status_filter", "color", + N_("text color for filter indicator in status bar"), + NULL, -1, 0, "green", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_status_more = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "status_more", "color", + N_("text color for buffer with new data (status bar)"), + NULL, -1, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_status_mouse = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "status_mouse", "color", + N_("text color for mouse indicator in status bar"), + NULL, -1, 0, "green", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_status_name = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "status_name", "color", + N_("text color for current buffer name in status bar"), + NULL, -1, 0, "white", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_status_name_ssl = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "status_name_ssl", "color", + N_("text color for current buffer name in status bar, if data are " + "secured with a protocol like SSL"), + NULL, -1, 0, "lightgreen", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_status_nicklist_count = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "status_nicklist_count", "color", + N_("text color for number of nicks in nicklist (status bar)"), + NULL, -1, 0, "default", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_status_number = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "status_number", "color", + N_("text color for current buffer number in status bar"), + NULL, -1, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); + config_color_status_time = config_file_new_option ( + weechat_config_file, weechat_config_section_color, + "status_time", "color", + N_("text color for time (status bar)"), + NULL, -1, 0, "default", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); } - /* bar colors */ - config_color_bar_more = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "bar_more", "color", - N_("text color for \"+\" when scrolling bars"), - NULL, -1, 0, "lightmagenta", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - /* chat area */ - config_color_chat = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat", "color", - N_("text color for chat"), - NULL, GUI_COLOR_CHAT, 0, "default", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_bg = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_bg", "color", - N_("background color for chat"), - NULL, -1, 0, "default", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_buffer = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_buffer", "color", - N_("text color for buffer names"), - NULL, GUI_COLOR_CHAT_BUFFER, 0, "white", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_channel = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_channel", "color", - N_("text color for channel names"), - NULL, GUI_COLOR_CHAT_CHANNEL, 0, "white", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_day_change = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_day_change", "color", - N_("text color for message displayed when the day has changed"), - NULL, GUI_COLOR_CHAT_DAY_CHANGE, 0, "cyan", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_delimiters = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_delimiters", "color", - N_("text color for delimiters"), - NULL, GUI_COLOR_CHAT_DELIMITERS, 0, "green", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_highlight = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_highlight", "color", - N_("text color for highlighted prefix"), - NULL, GUI_COLOR_CHAT_HIGHLIGHT, 0, "yellow", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_highlight_bg = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_highlight_bg", "color", - N_("background color for highlighted prefix"), - NULL, -1, 0, "magenta", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_host = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_host", "color", - N_("text color for hostnames"), - NULL, GUI_COLOR_CHAT_HOST, 0, "cyan", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_inactive_buffer = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_inactive_buffer", "color", - N_("text color for chat when line is inactive (buffer is merged with " - "other buffers and is not selected)"), - NULL, GUI_COLOR_CHAT_INACTIVE_BUFFER, 0, "default", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_inactive_window = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_inactive_window", "color", - N_("text color for chat when window is inactive (not current selected " - "window)"), - NULL, GUI_COLOR_CHAT_INACTIVE_WINDOW, 0, "default", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_nick = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_nick", "color", - N_("text color for nicks in chat window: used in some server messages " - "and as fallback when a nick color is not found; most of times " - "nick color comes from option weechat.color.chat_nick_colors"), - NULL, GUI_COLOR_CHAT_NICK, 0, "lightcyan", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_nick_colors = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_nick_colors", "string", - /* TRANSLATORS: please do not translate "lightred:blue" */ - N_("text color for nicks (comma separated list of colors, background " - "is allowed with format: \"fg:bg\", for example: " - "\"lightred:blue\")"), - NULL, 0, 0, "cyan,magenta,green,brown,lightblue,default,lightcyan," - "lightmagenta,lightgreen,blue", NULL, 0, - NULL, NULL, NULL, - &config_change_nick_colors, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_nick_offline = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_nick_offline", "color", - N_("text color for offline nick (not in nicklist any more); this " - "color is used only if option weechat.look.color_nick_offline is " - "enabled"), - NULL, GUI_COLOR_CHAT_NICK_OFFLINE, 0, "default", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_nick_offline_highlight = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_nick_offline_highlight", "color", - N_("text color for offline nick with highlight; this color is used " - "only if option weechat.look.color_nick_offline is enabled"), - NULL, -1, 0, "default", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_nick_offline_highlight_bg = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_nick_offline_highlight_bg", "color", - N_("background color for offline nick with highlight; this color is " - "used only if option weechat.look.color_nick_offline is enabled"), - NULL, -1, 0, "blue", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_nick_other = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_nick_other", "color", - N_("text color for other nick in private buffer"), - NULL, GUI_COLOR_CHAT_NICK_OTHER, 0, "cyan", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_nick_prefix = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_nick_prefix", "color", - N_("color for nick prefix (string displayed before nick in prefix)"), - NULL, GUI_COLOR_CHAT_NICK_PREFIX, 0, "green", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_nick_self = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_nick_self", "color", - N_("text color for local nick in chat window"), - NULL, GUI_COLOR_CHAT_NICK_SELF, 0, "white", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_nick_suffix = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_nick_suffix", "color", - N_("color for nick suffix (string displayed after nick in prefix)"), - NULL, GUI_COLOR_CHAT_NICK_SUFFIX, 0, "green", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_prefix[GUI_CHAT_PREFIX_ERROR] = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_prefix_error", "color", - N_("text color for error prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_ERROR, 0, "yellow", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_prefix_buffer = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_prefix_buffer", "color", - N_("text color for buffer name (before prefix, when many buffers are " - "merged with same number)"), - NULL, GUI_COLOR_CHAT_PREFIX_BUFFER, 0, "brown", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_prefix_buffer_inactive_buffer = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_prefix_buffer_inactive_buffer", "color", - N_("text color for inactive buffer name (before prefix, when many " - "buffers are merged with same number and if buffer is not " - "selected)"), - NULL, GUI_COLOR_CHAT_PREFIX_BUFFER_INACTIVE_BUFFER, 0, "default", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_prefix[GUI_CHAT_PREFIX_NETWORK] = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_prefix_network", "color", - N_("text color for network prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_NETWORK, 0, "magenta", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_prefix[GUI_CHAT_PREFIX_ACTION] = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_prefix_action", "color", - N_("text color for action prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_ACTION, 0, "white", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_prefix[GUI_CHAT_PREFIX_JOIN] = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_prefix_join", "color", - N_("text color for join prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_JOIN, 0, "lightgreen", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_prefix[GUI_CHAT_PREFIX_QUIT] = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_prefix_quit", "color", - N_("text color for quit prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_QUIT, 0, "lightred", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_prefix_more = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_prefix_more", "color", - N_("text color for \"+\" when prefix is too long"), - NULL, GUI_COLOR_CHAT_PREFIX_MORE, 0, "lightmagenta", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_prefix_suffix = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_prefix_suffix", "color", - N_("text color for suffix (after prefix)"), - NULL, GUI_COLOR_CHAT_PREFIX_SUFFIX, 0, "green", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_read_marker = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_read_marker", "color", - N_("text color for unread data marker"), - NULL, GUI_COLOR_CHAT_READ_MARKER, 0, "magenta", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_read_marker_bg = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_read_marker_bg", "color", - N_("background color for unread data marker"), - NULL, -1, 0, "default", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_server = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_server", "color", - N_("text color for server names"), - NULL, GUI_COLOR_CHAT_SERVER, 0, "brown", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_tags = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_tags", "color", - N_("text color for tags after messages (displayed with command /debug " - "tags)"), - NULL, GUI_COLOR_CHAT_TAGS, 0, "red", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_text_found = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_text_found", "color", - N_("text color for marker on lines where text sought is found"), - NULL, GUI_COLOR_CHAT_TEXT_FOUND, 0, "yellow", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_text_found_bg = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_text_found_bg", "color", - N_("background color for marker on lines where text sought is found"), - NULL, -1, 0, "lightmagenta", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_time = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_time", "color", - N_("text color for time in chat window"), - NULL, GUI_COLOR_CHAT_TIME, 0, "default", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_time_delimiters = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_time_delimiters", "color", - N_("text color for time delimiters"), - NULL, GUI_COLOR_CHAT_TIME_DELIMITERS, 0, "brown", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_value = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_value", "color", - N_("text color for values"), - NULL, GUI_COLOR_CHAT_VALUE, 0, "cyan", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_chat_value_null = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "chat_value_null", "color", - N_("text color for null values (undefined)"), - NULL, GUI_COLOR_CHAT_VALUE_NULL, 0, "blue", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - /* emphasis (chat/bars) */ - config_color_emphasized = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "emphasized", "color", - N_("text color for emphasized text (for example when searching text); " - "this option is used only if option weechat.look.emphasized_attributes " - "is an empty string (default value)"), - NULL, GUI_COLOR_EMPHASIS, 0, "yellow", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_emphasized_bg = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "emphasized_bg", "color", - N_("background color for emphasized text (for example when searching " - "text); used only if option weechat.look.emphasized_attributes is an " - "empty string (default value)"), - NULL, -1, 0, "magenta", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - /* input bar */ - config_color_input_actions = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "input_actions", "color", - N_("text color for actions in input line"), - NULL, -1, 0, "lightgreen", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_input_text_not_found = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "input_text_not_found", "color", - N_("text color for unsuccessful text search in input line"), - NULL, -1, 0, "red", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - /* items */ - config_color_item_away = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "item_away", "color", - N_("text color for away item"), - NULL, -1, 0, "yellow", NULL, 0, - NULL, NULL, NULL, - &config_change_item_away, NULL, NULL, - NULL, NULL, NULL); - /* nicklist bar */ - config_color_nicklist_away = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "nicklist_away", "color", - N_("text color for away nicknames"), - NULL, -1, 0, "cyan", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_nicklist_group = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "nicklist_group", "color", - N_("text color for groups in nicklist"), - NULL, -1, 0, "green", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - /* general color settings */ - config_color_separator = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "separator", "color", - N_("color for window separators (when split) and separators beside bars " - "(like nicklist)"), - NULL, GUI_COLOR_SEPARATOR, 0, "blue", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - /* status bar */ - config_color_status_count_highlight = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "status_count_highlight", "color", - N_("text color for count of highlight messages in hotlist (status bar)"), - NULL, -1, 0, "magenta", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_status_count_msg = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "status_count_msg", "color", - N_("text color for count of messages in hotlist (status bar)"), - NULL, -1, 0, "brown", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_status_count_other = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "status_count_other", "color", - N_("text color for count of other messages in hotlist (status bar)"), - NULL, -1, 0, "default", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_status_count_private = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "status_count_private", "color", - N_("text color for count of private messages in hotlist (status bar)"), - NULL, -1, 0, "green", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_status_data_highlight = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "status_data_highlight", "color", - N_("text color for buffer with highlight (status bar)"), - NULL, -1, 0, "lightmagenta", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_status_data_msg = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "status_data_msg", "color", - N_("text color for buffer with new messages (status bar)"), - NULL, -1, 0, "yellow", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_status_data_other = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "status_data_other", "color", - N_("text color for buffer with new data (not messages) " - "(status bar)"), - NULL, -1, 0, "default", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_status_data_private = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "status_data_private", "color", - N_("text color for buffer with private message (status bar)"), - NULL, -1, 0, "lightgreen", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_status_filter = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "status_filter", "color", - N_("text color for filter indicator in status bar"), - NULL, -1, 0, "green", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_status_more = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "status_more", "color", - N_("text color for buffer with new data (status bar)"), - NULL, -1, 0, "yellow", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_status_mouse = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "status_mouse", "color", - N_("text color for mouse indicator in status bar"), - NULL, -1, 0, "green", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_status_name = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "status_name", "color", - N_("text color for current buffer name in status bar"), - NULL, -1, 0, "white", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_status_name_ssl = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "status_name_ssl", "color", - N_("text color for current buffer name in status bar, if data are " - "secured with a protocol like SSL"), - NULL, -1, 0, "lightgreen", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_status_nicklist_count = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "status_nicklist_count", "color", - N_("text color for number of nicks in nicklist (status bar)"), - NULL, -1, 0, "default", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_status_number = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "status_number", "color", - N_("text color for current buffer number in status bar"), - NULL, -1, 0, "yellow", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - config_color_status_time = config_file_new_option ( - weechat_config_file, weechat_config_section_color, - "status_time", "color", - N_("text color for time (status bar)"), - NULL, -1, 0, "default", NULL, 0, - NULL, NULL, NULL, - &config_change_color, NULL, NULL, - NULL, NULL, NULL); - /* completion */ weechat_config_section_completion = config_file_new_section ( weechat_config_file, "completion", @@ -4554,115 +4557,111 @@ config_weechat_init_options () NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!weechat_config_section_completion) + if (weechat_config_section_completion) { - config_file_free (weechat_config_file); - weechat_config_file = NULL; - return 0; + config_completion_base_word_until_cursor = config_file_new_option ( + weechat_config_file, weechat_config_section_completion, + "base_word_until_cursor", "boolean", + N_("if enabled, the base word to complete ends at char before cursor; " + "otherwise the base word ends at first space after cursor"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_completion_command_inline = config_file_new_option ( + weechat_config_file, weechat_config_section_completion, + "command_inline", "boolean", + N_("if enabled, the commands inside command line are completed (the " + "command at beginning of line has higher priority and is used " + "first); note: when this option is enabled, there is no more " + "automatic completion of paths beginning with \"/\" (outside " + "commands arguments)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_completion_default_template = config_file_new_option ( + weechat_config_file, weechat_config_section_completion, + "default_template", "string", + N_("default completion template (please see documentation for " + "template codes and values: plugin API reference, function " + "\"weechat_hook_command\")"), + NULL, 0, 0, "%(nicks)|%(irc_channels)", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_completion_nick_add_space = config_file_new_option ( + weechat_config_file, weechat_config_section_completion, + "nick_add_space", "boolean", + N_("add space after nick completion (when nick is not first word " + "on command line)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_completion_nick_case_sensitive = config_file_new_option ( + weechat_config_file, weechat_config_section_completion, + "nick_case_sensitive", "boolean", + N_("case sensitive completion for nicks"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_completion_nick_completer = config_file_new_option ( + weechat_config_file, weechat_config_section_completion, + "nick_completer", "string", + N_("string inserted after nick completion (when nick is first word " + "on command line)"), + NULL, 0, 0, ": ", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_completion_nick_first_only = config_file_new_option ( + weechat_config_file, weechat_config_section_completion, + "nick_first_only", "boolean", + N_("complete only with first nick found"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_completion_nick_ignore_chars = config_file_new_option ( + weechat_config_file, weechat_config_section_completion, + "nick_ignore_chars", "string", + N_("chars ignored for nick completion"), + NULL, 0, 0, "[]`_-^", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_completion_partial_completion_alert = config_file_new_option ( + weechat_config_file, weechat_config_section_completion, + "partial_completion_alert", "boolean", + N_("send alert (BEL) when a partial completion occurs"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_completion_partial_completion_command = config_file_new_option ( + weechat_config_file, weechat_config_section_completion, + "partial_completion_command", "boolean", + N_("partially complete command names (stop when many commands found " + "begin with same letters)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_completion_partial_completion_command_arg = config_file_new_option ( + weechat_config_file, weechat_config_section_completion, + "partial_completion_command_arg", "boolean", + N_("partially complete command arguments (stop when many arguments " + "found begin with same prefix)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_completion_partial_completion_count = config_file_new_option ( + weechat_config_file, weechat_config_section_completion, + "partial_completion_count", "boolean", + N_("display count for each partial completion in bar item"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_completion_partial_completion_other = config_file_new_option ( + weechat_config_file, weechat_config_section_completion, + "partial_completion_other", "boolean", + N_("partially complete outside commands (stop when many words found " + "begin with same letters)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_completion_partial_completion_templates = config_file_new_option ( + weechat_config_file, weechat_config_section_completion, + "partial_completion_templates", "string", + N_("comma-separated list of templates for which partial completion " + "is enabled by default (with Tab key instead of shift-Tab); " + "the list of templates is in documentation: plugin API reference, " + "function \"weechat_hook_command\""), + NULL, 0, 0, "config_options", NULL, 0, + NULL, NULL, NULL, + &config_change_completion_partial_completion_templates, NULL, NULL, + NULL, NULL, NULL); } - config_completion_base_word_until_cursor = config_file_new_option ( - weechat_config_file, weechat_config_section_completion, - "base_word_until_cursor", "boolean", - N_("if enabled, the base word to complete ends at char before cursor; " - "otherwise the base word ends at first space after cursor"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_completion_command_inline = config_file_new_option ( - weechat_config_file, weechat_config_section_completion, - "command_inline", "boolean", - N_("if enabled, the commands inside command line are completed (the " - "command at beginning of line has higher priority and is used " - "first); note: when this option is enabled, there is no more " - "automatic completion of paths beginning with \"/\" (outside " - "commands arguments)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_completion_default_template = config_file_new_option ( - weechat_config_file, weechat_config_section_completion, - "default_template", "string", - N_("default completion template (please see documentation for template " - "codes and values: plugin API reference, function " - "\"weechat_hook_command\")"), - NULL, 0, 0, "%(nicks)|%(irc_channels)", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_completion_nick_add_space = config_file_new_option ( - weechat_config_file, weechat_config_section_completion, - "nick_add_space", "boolean", - N_("add space after nick completion (when nick is not first word on " - "command line)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_completion_nick_case_sensitive = config_file_new_option ( - weechat_config_file, weechat_config_section_completion, - "nick_case_sensitive", "boolean", - N_("case sensitive completion for nicks"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_completion_nick_completer = config_file_new_option ( - weechat_config_file, weechat_config_section_completion, - "nick_completer", "string", - N_("string inserted after nick completion (when nick is first word on " - "command line)"), - NULL, 0, 0, ": ", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_completion_nick_first_only = config_file_new_option ( - weechat_config_file, weechat_config_section_completion, - "nick_first_only", "boolean", - N_("complete only with first nick found"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_completion_nick_ignore_chars = config_file_new_option ( - weechat_config_file, weechat_config_section_completion, - "nick_ignore_chars", "string", - N_("chars ignored for nick completion"), - NULL, 0, 0, "[]`_-^", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_completion_partial_completion_alert = config_file_new_option ( - weechat_config_file, weechat_config_section_completion, - "partial_completion_alert", "boolean", - N_("send alert (BEL) when a partial completion occurs"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_completion_partial_completion_command = config_file_new_option ( - weechat_config_file, weechat_config_section_completion, - "partial_completion_command", "boolean", - N_("partially complete command names (stop when many commands found " - "begin with same letters)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_completion_partial_completion_command_arg = config_file_new_option ( - weechat_config_file, weechat_config_section_completion, - "partial_completion_command_arg", "boolean", - N_("partially complete command arguments (stop when many arguments " - "found begin with same prefix)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_completion_partial_completion_count = config_file_new_option ( - weechat_config_file, weechat_config_section_completion, - "partial_completion_count", "boolean", - N_("display count for each partial completion in bar item"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_completion_partial_completion_other = config_file_new_option ( - weechat_config_file, weechat_config_section_completion, - "partial_completion_other", "boolean", - N_("partially complete outside commands (stop when many words found " - "begin with same letters)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_completion_partial_completion_templates = config_file_new_option ( - weechat_config_file, weechat_config_section_completion, - "partial_completion_templates", "string", - N_("comma-separated list of templates for which partial completion is " - "enabled by default (with Tab key instead of shift-Tab); " - "the list of templates is in documentation: plugin API reference, " - "function \"weechat_hook_command\""), - NULL, 0, 0, "config_options", NULL, 0, - NULL, NULL, NULL, - &config_change_completion_partial_completion_templates, NULL, NULL, - NULL, NULL, NULL); - /* history */ weechat_config_section_history = config_file_new_section ( weechat_config_file, "history", @@ -4672,51 +4671,47 @@ config_weechat_init_options () NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!weechat_config_section_history) + if (weechat_config_section_history) { - config_file_free (weechat_config_file); - weechat_config_file = NULL; - return 0; + config_history_display_default = config_file_new_option ( + weechat_config_file, weechat_config_section_history, + "display_default", "integer", + N_("maximum number of commands to display by default in " + "history listing (0 = unlimited)"), + NULL, 0, INT_MAX, "5", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_history_max_buffer_lines_minutes = config_file_new_option ( + weechat_config_file, weechat_config_section_history, + "max_buffer_lines_minutes", "integer", + N_("maximum number of minutes in history per buffer " + "(0 = unlimited); examples: 1440 = one day, 10080 = one week, " + "43200 = one month, 525600 = one year; use 0 ONLY if option " + "weechat.history.max_buffer_lines_number is NOT set to 0"), + NULL, 0, INT_MAX, "0", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_history_max_buffer_lines_number = config_file_new_option ( + weechat_config_file, weechat_config_section_history, + "max_buffer_lines_number", "integer", + N_("maximum number of lines in history per buffer " + "(0 = unlimited); use 0 ONLY if option " + "weechat.history.max_buffer_lines_minutes is NOT set to 0"), + NULL, 0, INT_MAX, "4096", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_history_max_commands = config_file_new_option ( + weechat_config_file, weechat_config_section_history, + "max_commands", "integer", + N_("maximum number of user commands in history (0 = " + "unlimited, NOT RECOMMENDED: no limit in memory usage)"), + NULL, 0, INT_MAX, "100", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_history_max_visited_buffers = config_file_new_option ( + weechat_config_file, weechat_config_section_history, + "max_visited_buffers", "integer", + N_("maximum number of visited buffers to keep in memory"), + NULL, 0, 1000, "50", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } - config_history_display_default = config_file_new_option ( - weechat_config_file, weechat_config_section_history, - "display_default", "integer", - N_("maximum number of commands to display by default in " - "history listing (0 = unlimited)"), - NULL, 0, INT_MAX, "5", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_history_max_buffer_lines_minutes = config_file_new_option ( - weechat_config_file, weechat_config_section_history, - "max_buffer_lines_minutes", "integer", - N_("maximum number of minutes in history per buffer " - "(0 = unlimited); examples: 1440 = one day, 10080 = one week, " - "43200 = one month, 525600 = one year; use 0 ONLY if option " - "weechat.history.max_buffer_lines_number is NOT set to 0"), - NULL, 0, INT_MAX, "0", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_history_max_buffer_lines_number = config_file_new_option ( - weechat_config_file, weechat_config_section_history, - "max_buffer_lines_number", "integer", - N_("maximum number of lines in history per buffer " - "(0 = unlimited); use 0 ONLY if option " - "weechat.history.max_buffer_lines_minutes is NOT set to 0"), - NULL, 0, INT_MAX, "4096", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_history_max_commands = config_file_new_option ( - weechat_config_file, weechat_config_section_history, - "max_commands", "integer", - N_("maximum number of user commands in history (0 = " - "unlimited, NOT RECOMMENDED: no limit in memory usage)"), - NULL, 0, INT_MAX, "100", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_history_max_visited_buffers = config_file_new_option ( - weechat_config_file, weechat_config_section_history, - "max_visited_buffers", "integer", - N_("maximum number of visited buffers to keep in memory"), - NULL, 0, 1000, "50", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - /* proxies */ weechat_config_section_proxy = config_file_new_section ( weechat_config_file, "proxy", @@ -4726,12 +4721,6 @@ config_weechat_init_options () NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!weechat_config_section_proxy) - { - config_file_free (weechat_config_file); - weechat_config_file = NULL; - return 0; - } /* network */ weechat_config_section_network = config_file_new_section ( @@ -4742,58 +4731,54 @@ config_weechat_init_options () NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!weechat_config_section_network) + if (weechat_config_section_network) { - config_file_free (weechat_config_file); - weechat_config_file = NULL; - return 0; + config_network_connection_timeout = config_file_new_option ( + weechat_config_file, weechat_config_section_network, + "connection_timeout", "integer", + N_("timeout (in seconds) for connection to a remote host (made in a " + "child process)"), + NULL, 1, INT_MAX, "60", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_network_gnutls_ca_system = config_file_new_option ( + weechat_config_file, weechat_config_section_network, + "gnutls_ca_system", "boolean", + N_("load system's default trusted certificate authorities on startup; " + "this can be turned off to save some memory only if you are not " + "using SSL connections at all"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_network_gnutls_ca, NULL, NULL, + NULL, NULL, NULL); + config_network_gnutls_ca_user = config_file_new_option ( + weechat_config_file, weechat_config_section_network, + "gnutls_ca_user", "string", + N_("extra file(s) with certificate authorities; multiple files must " + "be separated by colons " + "(each path is evaluated, see function string_eval_path_home in " + "plugin API reference)"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_network_gnutls_ca, NULL, NULL, + NULL, NULL, NULL); + config_network_gnutls_handshake_timeout = config_file_new_option ( + weechat_config_file, weechat_config_section_network, + "gnutls_handshake_timeout", "integer", + N_("timeout (in seconds) for gnutls handshake"), + NULL, 1, INT_MAX, "30", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_network_proxy_curl = config_file_new_option ( + weechat_config_file, weechat_config_section_network, + "proxy_curl", "string", + N_("name of proxy used for download of URLs with Curl (used to " + "download list of scripts and in scripts calling function " + "hook_process); the proxy must be defined with command /proxy"), + NULL, 0, 0, "", NULL, 0, + &config_check_proxy_curl, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); } - config_network_connection_timeout = config_file_new_option ( - weechat_config_file, weechat_config_section_network, - "connection_timeout", "integer", - N_("timeout (in seconds) for connection to a remote host (made in a " - "child process)"), - NULL, 1, INT_MAX, "60", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_network_gnutls_ca_system = config_file_new_option ( - weechat_config_file, weechat_config_section_network, - "gnutls_ca_system", "boolean", - N_("load system's default trusted certificate authorities on startup; " - "this can be turned off to save some memory only if you are not " - "using SSL connections at all"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &config_change_network_gnutls_ca, NULL, NULL, - NULL, NULL, NULL); - config_network_gnutls_ca_user = config_file_new_option ( - weechat_config_file, weechat_config_section_network, - "gnutls_ca_user", "string", - N_("extra file(s) with certificate authorities; multiple files must " - "be separated by colons " - "(each path is evaluated, see function string_eval_path_home in " - "plugin API reference)"), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, - &config_change_network_gnutls_ca, NULL, NULL, - NULL, NULL, NULL); - config_network_gnutls_handshake_timeout = config_file_new_option ( - weechat_config_file, weechat_config_section_network, - "gnutls_handshake_timeout", "integer", - N_("timeout (in seconds) for gnutls handshake"), - NULL, 1, INT_MAX, "30", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_network_proxy_curl = config_file_new_option ( - weechat_config_file, weechat_config_section_network, - "proxy_curl", "string", - N_("name of proxy used for download of URLs with Curl (used to download " - "list of scripts and in scripts calling function hook_process); the " - "proxy must be defined with command /proxy"), - NULL, 0, 0, "", NULL, 0, - &config_check_proxy_curl, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - /* plugin */ weechat_config_section_plugin = config_file_new_section ( weechat_config_file, "plugin", @@ -4803,46 +4788,42 @@ config_weechat_init_options () NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!weechat_config_section_plugin) + if (weechat_config_section_plugin) { - config_file_free (weechat_config_file); - weechat_config_file = NULL; - return 0; + config_plugin_autoload = config_file_new_option ( + weechat_config_file, weechat_config_section_plugin, + "autoload", "string", + N_("comma separated list of plugins to load automatically " + "at startup, \"*\" means all plugins found, a name beginning with " + "\"!\" is a negative value to prevent a plugin from being loaded, " + "wildcard \"*\" is allowed in names (examples: \"*\" or " + "\"*,!lua,!tcl\")"), + NULL, 0, 0, "*", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_plugin_extension = config_file_new_option ( + weechat_config_file, weechat_config_section_plugin, + "extension", "string", + N_("comma separated list of file name extensions for plugins"), + NULL, 0, 0, ".so,.dll", NULL, 0, + NULL, NULL, NULL, + &config_change_plugin_extension, NULL, NULL, + NULL, NULL, NULL); + config_plugin_path = config_file_new_option ( + weechat_config_file, weechat_config_section_plugin, + "path", "string", + N_("path for searching plugins " + "(path is evaluated, see function string_eval_path_home in " + "plugin API reference)"), + NULL, 0, 0, "${weechat_data_dir}/plugins", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_plugin_save_config_on_unload = config_file_new_option ( + weechat_config_file, weechat_config_section_plugin, + "save_config_on_unload", "boolean", + N_("save configuration files when unloading plugins"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } - config_plugin_autoload = config_file_new_option ( - weechat_config_file, weechat_config_section_plugin, - "autoload", "string", - N_("comma separated list of plugins to load automatically " - "at startup, \"*\" means all plugins found, a name beginning with " - "\"!\" is a negative value to prevent a plugin from being loaded, " - "wildcard \"*\" is allowed in names (examples: \"*\" or " - "\"*,!lua,!tcl\")"), - NULL, 0, 0, "*", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_plugin_extension = config_file_new_option ( - weechat_config_file, weechat_config_section_plugin, - "extension", "string", - N_("comma separated list of file name extensions for plugins"), - NULL, 0, 0, ".so,.dll", NULL, 0, - NULL, NULL, NULL, - &config_change_plugin_extension, NULL, NULL, - NULL, NULL, NULL); - config_plugin_path = config_file_new_option ( - weechat_config_file, weechat_config_section_plugin, - "path", "string", - N_("path for searching plugins " - "(path is evaluated, see function string_eval_path_home in " - "plugin API reference)"), - NULL, 0, 0, "${weechat_data_dir}/plugins", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_plugin_save_config_on_unload = config_file_new_option ( - weechat_config_file, weechat_config_section_plugin, - "save_config_on_unload", "boolean", - N_("save configuration files when unloading plugins"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - /* signal */ weechat_config_section_signal = config_file_new_section ( weechat_config_file, "signal", @@ -4852,55 +4833,51 @@ config_weechat_init_options () NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!weechat_config_section_signal) + if (weechat_config_section_signal) { - config_file_free (weechat_config_file); - weechat_config_file = NULL; - return 0; + config_signal_sighup = config_file_new_option ( + weechat_config_file, weechat_config_section_signal, + "sighup", "string", + N_("command to execute when the signal is received, " + "multiple commands can be separated by semicolons " + "(note: commands are evaluated, see /help eval)"), + NULL, 0, 0, + "${if:${info:weechat_headless}?/reload:/quit -yes}", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_signal_sigquit = config_file_new_option ( + weechat_config_file, weechat_config_section_signal, + "sigquit", "string", + N_("command to execute when the signal is received, " + "multiple commands can be separated by semicolons " + "(note: commands are evaluated, see /help eval)"), + NULL, 0, 0, "/quit -yes", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_signal_sigterm = config_file_new_option ( + weechat_config_file, weechat_config_section_signal, + "sigterm", "string", + N_("command to execute when the signal is received, " + "multiple commands can be separated by semicolons " + "(note: commands are evaluated, see /help eval)"), + NULL, 0, 0, "/quit -yes", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_signal_sigusr1 = config_file_new_option ( + weechat_config_file, weechat_config_section_signal, + "sigusr1", "string", + N_("command to execute when the signal is received, " + "multiple commands can be separated by semicolons " + "(note: commands are evaluated, see /help eval)"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_signal_sigusr2 = config_file_new_option ( + weechat_config_file, weechat_config_section_signal, + "sigusr2", "string", + N_("command to execute when the signal is received, " + "multiple commands can be separated by semicolons " + "(note: commands are evaluated, see /help eval)"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } - config_signal_sighup = config_file_new_option ( - weechat_config_file, weechat_config_section_signal, - "sighup", "string", - N_("command to execute when the signal is received, " - "multiple commands can be separated by semicolons " - "(note: commands are evaluated, see /help eval)"), - NULL, 0, 0, - "${if:${info:weechat_headless}?/reload:/quit -yes}", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_signal_sigquit = config_file_new_option ( - weechat_config_file, weechat_config_section_signal, - "sigquit", "string", - N_("command to execute when the signal is received, " - "multiple commands can be separated by semicolons " - "(note: commands are evaluated, see /help eval)"), - NULL, 0, 0, "/quit -yes", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_signal_sigterm = config_file_new_option ( - weechat_config_file, weechat_config_section_signal, - "sigterm", "string", - N_("command to execute when the signal is received, " - "multiple commands can be separated by semicolons " - "(note: commands are evaluated, see /help eval)"), - NULL, 0, 0, "/quit -yes", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_signal_sigusr1 = config_file_new_option ( - weechat_config_file, weechat_config_section_signal, - "sigusr1", "string", - N_("command to execute when the signal is received, " - "multiple commands can be separated by semicolons " - "(note: commands are evaluated, see /help eval)"), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - config_signal_sigusr2 = config_file_new_option ( - weechat_config_file, weechat_config_section_signal, - "sigusr2", "string", - N_("command to execute when the signal is received, " - "multiple commands can be separated by semicolons " - "(note: commands are evaluated, see /help eval)"), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - /* bars */ weechat_config_section_bar = config_file_new_section ( weechat_config_file, "bar", @@ -4910,12 +4887,6 @@ config_weechat_init_options () NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!weechat_config_section_bar) - { - config_file_free (weechat_config_file); - weechat_config_file = NULL; - return 0; - } /* custom bar items */ weechat_config_section_custom_bar_item = config_file_new_section ( @@ -4926,12 +4897,6 @@ config_weechat_init_options () NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!weechat_config_section_custom_bar_item) - { - config_file_free (weechat_config_file); - weechat_config_file = NULL; - return 0; - } /* layout */ weechat_config_section_layout = config_file_new_section ( @@ -4942,12 +4907,6 @@ config_weechat_init_options () NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!weechat_config_section_layout) - { - config_file_free (weechat_config_file); - weechat_config_file = NULL; - return 0; - } /* notify */ weechat_config_section_notify = config_file_new_section ( @@ -4958,12 +4917,6 @@ config_weechat_init_options () NULL, NULL, NULL, &config_weechat_notify_create_option_cb, NULL, NULL, &config_weechat_notify_delete_option_cb, NULL, NULL); - if (!weechat_config_section_notify) - { - config_file_free (weechat_config_file); - weechat_config_file = NULL; - return 0; - } /* filters */ weechat_config_section_filter = config_file_new_section ( @@ -4974,12 +4927,6 @@ config_weechat_init_options () &config_weechat_filter_write_cb, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!weechat_config_section_filter) - { - config_file_free (weechat_config_file); - weechat_config_file = NULL; - return 0; - } /* keys */ for (context = 0; context < GUI_KEY_NUM_CONTEXTS; context++) @@ -4998,12 +4945,6 @@ config_weechat_init_options () NULL, NULL, NULL, &config_weechat_key_create_option_cb, NULL, NULL, &config_weechat_key_delete_option_cb, NULL, NULL); - if (!weechat_config_section_key[context]) - { - config_file_free (weechat_config_file); - weechat_config_file = NULL; - return 0; - } } return 1; diff --git a/src/core/wee-secure-config.c b/src/core/wee-secure-config.c index d3cef343f..d55c61464 100644 --- a/src/core/wee-secure-config.c +++ b/src/core/wee-secure-config.c @@ -40,6 +40,9 @@ struct t_config_file *secure_config_file = NULL; +struct t_config_section *secure_config_section_crypt = NULL; +struct t_config_section *secure_config_section_data = NULL; + struct t_config_option *secure_config_crypt_cipher = NULL; struct t_config_option *secure_config_crypt_hash_algo = NULL; struct t_config_option *secure_config_crypt_passphrase_command = NULL; @@ -444,68 +447,64 @@ secure_config_data_write_cb (const void *pointer, void *data, int secure_config_init_options () { - struct t_config_section *ptr_section; - secure_config_file = config_file_new (NULL, SECURE_CONFIG_PRIO_NAME, &secure_config_reload_cb, NULL, NULL); if (!secure_config_file) return 0; /* crypt */ - ptr_section = config_file_new_section (secure_config_file, "crypt", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) - { - config_file_free (secure_config_file); - secure_config_file = NULL; - return 0; - } - - secure_config_crypt_cipher = config_file_new_option ( - secure_config_file, ptr_section, - "cipher", "integer", - N_("cipher used to crypt data (the number after algorithm is the size " - "of the key in bits)"), - "aes128|aes192|aes256", 0, 0, "aes256", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - secure_config_crypt_hash_algo = config_file_new_option ( - secure_config_file, ptr_section, - "hash_algo", "integer", - N_("hash algorithm used to check the decrypted data"), - "sha224|sha256|sha384|sha512", 0, 0, "sha256", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - secure_config_crypt_passphrase_command = config_file_new_option ( - secure_config_file, ptr_section, - "passphrase_command", "string", - N_("read the passphrase from the output of this system command " - "(only the first line is used and it must not contain any extra " - "character); this option is used only when reading file sec.conf " - "and if the environment variable \"WEECHAT_PASSPHRASE\" is not set " - "(the environment variable has higher priority); " - "example with password-store: " - "\"/usr/bin/pass show weechat/passphrase\""), - NULL, 0, 0, "", NULL, 0, + secure_config_section_crypt = config_file_new_section ( + secure_config_file, "crypt", + 0, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - secure_config_crypt_salt = config_file_new_option ( - secure_config_file, ptr_section, - "salt", "boolean", - N_("use salt when generating key used in encryption (recommended for " - "maximum security); when enabled, the content of crypted data in " - "file sec.conf will be different on each write of the file; if you " - "put the file sec.conf in a version control system, then you " - "can turn off this option to have always same content in file"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + if (secure_config_section_crypt) + { + secure_config_crypt_cipher = config_file_new_option ( + secure_config_file, secure_config_section_crypt, + "cipher", "integer", + N_("cipher used to crypt data (the number after algorithm is the " + "size of the key in bits)"), + "aes128|aes192|aes256", 0, 0, "aes256", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + secure_config_crypt_hash_algo = config_file_new_option ( + secure_config_file, secure_config_section_crypt, + "hash_algo", "integer", + N_("hash algorithm used to check the decrypted data"), + "sha224|sha256|sha384|sha512", 0, 0, "sha256", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + secure_config_crypt_passphrase_command = config_file_new_option ( + secure_config_file, secure_config_section_crypt, + "passphrase_command", "string", + N_("read the passphrase from the output of this system command " + "(only the first line is used and it must not contain any extra " + "character); this option is used only when reading file " + "sec.conf and if the environment variable \"WEECHAT_PASSPHRASE\" " + "is not set (the environment variable has higher priority); " + "example with password-store: " + "\"/usr/bin/pass show weechat/passphrase\""), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + secure_config_crypt_salt = config_file_new_option ( + secure_config_file, secure_config_section_crypt, + "salt", "boolean", + N_("use salt when generating key used in encryption (recommended " + "for maximum security); when enabled, the content of crypted " + "data in file sec.conf will be different on each write of the " + "file; if you put the file sec.conf in a version control system, " + "then you can turn off this option to have always same content " + "in file"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + } /* data */ - ptr_section = config_file_new_section ( + secure_config_section_data = config_file_new_section ( secure_config_file, "data", 0, 0, &secure_config_data_read_cb, NULL, NULL, @@ -513,12 +512,6 @@ secure_config_init_options () &secure_config_data_write_cb, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!ptr_section) - { - config_file_free (secure_config_file); - secure_config_file = NULL; - return 0; - } return 1; } diff --git a/src/plugins/alias/alias-config.c b/src/plugins/alias/alias-config.c index f6b72f4b0..7d65a1c1b 100644 --- a/src/plugins/alias/alias-config.c +++ b/src/plugins/alias/alias-config.c @@ -432,35 +432,31 @@ alias_config_update_cb (const void *pointer, void *data, int alias_config_init () { - struct t_config_section *ptr_section; - alias_config_file = weechat_config_new (ALIAS_CONFIG_PRIO_NAME, &alias_config_reload, NULL, NULL); if (!alias_config_file) return 0; - weechat_config_set_version (alias_config_file, ALIAS_CONFIG_VERSION, - &alias_config_update_cb, NULL, NULL); + if (!weechat_config_set_version (alias_config_file, ALIAS_CONFIG_VERSION, + &alias_config_update_cb, NULL, NULL)) + { + weechat_config_free (alias_config_file); + alias_config_file = NULL; + return 0; + } /* cmd */ - ptr_section = weechat_config_new_section ( + alias_config_section_cmd = weechat_config_new_section ( alias_config_file, "cmd", 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, &alias_config_cmd_write_default_cb, NULL, NULL, &alias_config_cmd_create_option_cb, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (alias_config_file); - alias_config_file = NULL; - return 0; - } - alias_config_section_cmd = ptr_section; + NULL, NULL, NULL); /* completion */ - ptr_section = weechat_config_new_section ( + alias_config_section_completion = weechat_config_new_section ( alias_config_file, "completion", 1, 1, NULL, NULL, NULL, @@ -468,13 +464,6 @@ alias_config_init () &alias_config_completion_write_default_cb, NULL, NULL, &alias_config_completion_create_option_cb, NULL, NULL, NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (alias_config_file); - alias_config_file = NULL; - return 0; - } - alias_config_section_completion = ptr_section; return 1; } diff --git a/src/plugins/buflist/buflist-config.c b/src/plugins/buflist/buflist-config.c index 2e63e934f..7a2f94a0d 100644 --- a/src/plugins/buflist/buflist-config.c +++ b/src/plugins/buflist/buflist-config.c @@ -31,35 +31,42 @@ struct t_config_file *buflist_config_file = NULL; +/* sections */ + +struct t_config_section *buflist_config_section_look = NULL; +struct t_config_section *buflist_config_section_format = NULL; + /* buflist config, look section */ -struct t_config_option *buflist_config_look_add_newline; -struct t_config_option *buflist_config_look_auto_scroll; -struct t_config_option *buflist_config_look_display_conditions; -struct t_config_option *buflist_config_look_enabled; -struct t_config_option *buflist_config_look_mouse_jump_visited_buffer; -struct t_config_option *buflist_config_look_mouse_move_buffer; -struct t_config_option *buflist_config_look_mouse_wheel; -struct t_config_option *buflist_config_look_nick_prefix; -struct t_config_option *buflist_config_look_nick_prefix_empty; -struct t_config_option *buflist_config_look_signals_refresh; -struct t_config_option *buflist_config_look_sort; -struct t_config_option *buflist_config_look_use_items; +struct t_config_option *buflist_config_look_add_newline = NULL; +struct t_config_option *buflist_config_look_auto_scroll = NULL; +struct t_config_option *buflist_config_look_display_conditions = NULL; +struct t_config_option *buflist_config_look_enabled = NULL; +struct t_config_option *buflist_config_look_mouse_jump_visited_buffer = NULL; +struct t_config_option *buflist_config_look_mouse_move_buffer = NULL; +struct t_config_option *buflist_config_look_mouse_wheel = NULL; +struct t_config_option *buflist_config_look_nick_prefix = NULL; +struct t_config_option *buflist_config_look_nick_prefix_empty = NULL; +struct t_config_option *buflist_config_look_signals_refresh = NULL; +struct t_config_option *buflist_config_look_sort = NULL; +struct t_config_option *buflist_config_look_use_items = NULL; /* buflist config, format section */ -struct t_config_option *buflist_config_format_buffer; -struct t_config_option *buflist_config_format_buffer_current; -struct t_config_option *buflist_config_format_hotlist; -struct t_config_option *buflist_config_format_hotlist_level[4]; -struct t_config_option *buflist_config_format_hotlist_level_none; -struct t_config_option *buflist_config_format_hotlist_separator; -struct t_config_option *buflist_config_format_indent; -struct t_config_option *buflist_config_format_lag; -struct t_config_option *buflist_config_format_name; -struct t_config_option *buflist_config_format_nick_prefix; -struct t_config_option *buflist_config_format_number; -struct t_config_option *buflist_config_format_tls_version; +struct t_config_option *buflist_config_format_buffer = NULL; +struct t_config_option *buflist_config_format_buffer_current = NULL; +struct t_config_option *buflist_config_format_hotlist = NULL; +struct t_config_option *buflist_config_format_hotlist_level[4] = { + NULL, NULL, NULL, NULL, +}; +struct t_config_option *buflist_config_format_hotlist_level_none = NULL; +struct t_config_option *buflist_config_format_hotlist_separator = NULL; +struct t_config_option *buflist_config_format_indent = NULL; +struct t_config_option *buflist_config_format_lag = NULL; +struct t_config_option *buflist_config_format_name = NULL; +struct t_config_option *buflist_config_format_nick_prefix = NULL; +struct t_config_option *buflist_config_format_number = NULL; +struct t_config_option *buflist_config_format_tls_version = NULL; struct t_hook **buflist_config_signals_refresh = NULL; int buflist_config_num_signals_refresh = 0; @@ -466,8 +473,6 @@ buflist_config_change_format (const void *pointer, void *data, int buflist_config_init () { - struct t_config_section *ptr_section; - buflist_config_file = weechat_config_new ( BUFLIST_CONFIG_PRIO_NAME, &buflist_config_reload, NULL, NULL); @@ -475,324 +480,320 @@ buflist_config_init () return 0; /* look */ - ptr_section = weechat_config_new_section (buflist_config_file, "look", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (buflist_config_file); - buflist_config_file = NULL; - return 0; - } - - buflist_config_look_add_newline = weechat_config_new_option ( - buflist_config_file, ptr_section, - "add_newline", "boolean", - N_("add newline between the buffers displayed, so each buffer is " - "displayed on a separate line (recommended); if disabled, newlines " - "must be manually added in the formats with \"${\\n}\", " - "and the mouse actions are not possible any more"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &buflist_config_change_buflist, NULL, NULL, - NULL, NULL, NULL); - buflist_config_look_auto_scroll = weechat_config_new_option ( - buflist_config_file, ptr_section, - "auto_scroll", "integer", - N_("automatically scroll the buflist bar to always see the current " - "buffer (this works only with a bar on the left/right position " - "with a \"vertical\" filling); this value is the percent number " - "of lines displayed before the current buffer when scrolling " - "(-1 = disable scroll); for example 50 means that after a scroll, " - "the current buffer is at the middle of bar, 0 means on top of " - "bar, 100 means at bottom of bar"), - NULL, -1, 100, "50", NULL, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - buflist_config_look_display_conditions = weechat_config_new_option ( - buflist_config_file, ptr_section, - "display_conditions", "string", - N_("conditions to display a buffer " - "(note: content is evaluated, see /help buflist); for example " - "to hide server buffers if they are merged with core buffer: " - "\"${buffer.hidden}==0 && ((${type}!=server && " - "${buffer.full_name}!=core.weechat) || ${buffer.active}==1)\""), - NULL, 0, 0, "${buffer.hidden}==0", NULL, 0, - NULL, NULL, NULL, - &buflist_config_change_buflist, NULL, NULL, - NULL, NULL, NULL); - buflist_config_look_enabled = weechat_config_new_option ( - buflist_config_file, ptr_section, - "enabled", "boolean", - N_("enable buflist; it is recommended to use this option instead of " - "just hiding the bar because it also removes some internal hooks " - "that are not needed any more when the bar is hidden; you can " - "also use the command \"/buflist toggle\" or use the default key " - "alt+shift+b"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &buflist_config_change_enabled, NULL, NULL, - NULL, NULL, NULL); - buflist_config_look_mouse_jump_visited_buffer = weechat_config_new_option ( - buflist_config_file, ptr_section, - "mouse_jump_visited_buffer", "boolean", - N_("if enabled, clicks with left/right buttons on the line with " - "current buffer jump to previous/next visited buffer"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - buflist_config_look_mouse_move_buffer = weechat_config_new_option ( - buflist_config_file, ptr_section, - "mouse_move_buffer", "boolean", - N_("if enabled, mouse gestures (drag & drop) move buffers in list"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - buflist_config_look_mouse_wheel = weechat_config_new_option ( - buflist_config_file, ptr_section, - "mouse_wheel", "boolean", - N_("if enabled, mouse wheel up/down actions jump to previous/next " - "buffer in list"), - NULL, 0, 0, "on", NULL, 0, + buflist_config_section_look = weechat_config_new_section ( + buflist_config_file, "look", + 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL); - buflist_config_look_nick_prefix = weechat_config_new_option ( - buflist_config_file, ptr_section, - "nick_prefix", "boolean", - N_("get the nick prefix and its color from nicklist so that " - "${nick_prefix} can be used in format; this can be slow on buffers " - "with lot of nicks in nicklist, so this option is disabled " - "by default"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, - &buflist_config_change_nick_prefix, NULL, NULL, - NULL, NULL, NULL); - buflist_config_look_nick_prefix_empty = weechat_config_new_option ( - buflist_config_file, ptr_section, - "nick_prefix_empty", "boolean", - N_("when the nick prefix is enabled, display a space instead if there " - "is no nick prefix on the buffer"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, - &buflist_config_change_buflist, NULL, NULL, - NULL, NULL, NULL); - buflist_config_look_signals_refresh = weechat_config_new_option ( - buflist_config_file, ptr_section, - "signals_refresh", "string", - N_("comma-separated list of extra signals that are hooked and trigger " - "the refresh of buffers list; this can be useful if some custom " - "variables are used in formats and need specific refresh"), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, - &buflist_config_change_signals_refresh, NULL, NULL, - NULL, NULL, NULL); - buflist_config_look_sort = weechat_config_new_option ( - buflist_config_file, ptr_section, - "sort", "string", - N_("comma-separated list of fields to sort buffers; each field is " - "a hdata variable of buffer (\"var\"), a hdata variable of " - "IRC server (\"irc_server.var\") or a hdata variable of " - "IRC channel (\"irc_channel.var\"); " - "char \"-\" can be used before field to reverse order, " - "char \"~\" can be used to do a case insensitive comparison; " - "example: \"-~short_name\" for case insensitive and reverse " - "sort on buffer short name " - "(note: the content is evaluated, before being split into fields, " - "but at that time \"bar_item\" is the only variable that can be " - "used, to distinguish between different buflist items, for example " - "\"${bar_item.name}\")"), - NULL, 0, 0, "number,-active", NULL, 0, NULL, NULL, NULL, - &buflist_config_change_sort, NULL, NULL, NULL, NULL, NULL); - buflist_config_look_use_items = weechat_config_new_option ( - buflist_config_file, ptr_section, - "use_items", "integer", - N_("number of buflist bar items that can be used; the item names are: " - "\"buflist\", \"buflist2\", \"buflist3\"; be careful, using more " - "than one bar item slows down the display of buffers list"), - NULL, 1, BUFLIST_BAR_NUM_ITEMS, "1", NULL, 0, - NULL, NULL, NULL, - &buflist_config_change_use_items, NULL, NULL, - NULL, NULL, NULL); - - /* format */ - ptr_section = weechat_config_new_section (buflist_config_file, "format", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) + if (buflist_config_section_look) { - weechat_config_free (buflist_config_file); - buflist_config_file = NULL; - return 0; + buflist_config_look_add_newline = weechat_config_new_option ( + buflist_config_file, buflist_config_section_look, + "add_newline", "boolean", + N_("add newline between the buffers displayed, so each buffer is " + "displayed on a separate line (recommended); if disabled, " + "newlines must be manually added in the formats with \"${\\n}\", " + "and the mouse actions are not possible any more"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_buflist, NULL, NULL, + NULL, NULL, NULL); + buflist_config_look_auto_scroll = weechat_config_new_option ( + buflist_config_file, buflist_config_section_look, + "auto_scroll", "integer", + N_("automatically scroll the buflist bar to always see the current " + "buffer (this works only with a bar on the left/right position " + "with a \"vertical\" filling); this value is the percent number " + "of lines displayed before the current buffer when scrolling " + "(-1 = disable scroll); for example 50 means that after a scroll, " + "the current buffer is at the middle of bar, 0 means on top of " + "bar, 100 means at bottom of bar"), + NULL, -1, 100, "50", NULL, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + buflist_config_look_display_conditions = weechat_config_new_option ( + buflist_config_file, buflist_config_section_look, + "display_conditions", "string", + N_("conditions to display a buffer " + "(note: content is evaluated, see /help buflist); for example " + "to hide server buffers if they are merged with core buffer: " + "\"${buffer.hidden}==0 && ((${type}!=server && " + "${buffer.full_name}!=core.weechat) || ${buffer.active}==1)\""), + NULL, 0, 0, "${buffer.hidden}==0", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_buflist, NULL, NULL, + NULL, NULL, NULL); + buflist_config_look_enabled = weechat_config_new_option ( + buflist_config_file, buflist_config_section_look, + "enabled", "boolean", + N_("enable buflist; it is recommended to use this option instead of " + "just hiding the bar because it also removes some internal hooks " + "that are not needed any more when the bar is hidden; you can " + "also use the command \"/buflist toggle\" or use the default key " + "alt+shift+b"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_enabled, NULL, NULL, + NULL, NULL, NULL); + buflist_config_look_mouse_jump_visited_buffer = weechat_config_new_option ( + buflist_config_file, buflist_config_section_look, + "mouse_jump_visited_buffer", "boolean", + N_("if enabled, clicks with left/right buttons on the line with " + "current buffer jump to previous/next visited buffer"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + buflist_config_look_mouse_move_buffer = weechat_config_new_option ( + buflist_config_file, buflist_config_section_look, + "mouse_move_buffer", "boolean", + N_("if enabled, mouse gestures (drag & drop) move buffers in list"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + buflist_config_look_mouse_wheel = weechat_config_new_option ( + buflist_config_file, buflist_config_section_look, + "mouse_wheel", "boolean", + N_("if enabled, mouse wheel up/down actions jump to previous/next " + "buffer in list"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + buflist_config_look_nick_prefix = weechat_config_new_option ( + buflist_config_file, buflist_config_section_look, + "nick_prefix", "boolean", + N_("get the nick prefix and its color from nicklist so that " + "${nick_prefix} can be used in format; this can be slow on " + "buffers with lot of nicks in nicklist, so this option is " + "disabled by default"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_nick_prefix, NULL, NULL, + NULL, NULL, NULL); + buflist_config_look_nick_prefix_empty = weechat_config_new_option ( + buflist_config_file, buflist_config_section_look, + "nick_prefix_empty", "boolean", + N_("when the nick prefix is enabled, display a space instead if " + "there is no nick prefix on the buffer"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_buflist, NULL, NULL, + NULL, NULL, NULL); + buflist_config_look_signals_refresh = weechat_config_new_option ( + buflist_config_file, buflist_config_section_look, + "signals_refresh", "string", + N_("comma-separated list of extra signals that are hooked and " + "trigger the refresh of buffers list; this can be useful if " + "some custom variables are used in formats and need specific " + "refresh"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_signals_refresh, NULL, NULL, + NULL, NULL, NULL); + buflist_config_look_sort = weechat_config_new_option ( + buflist_config_file, buflist_config_section_look, + "sort", "string", + N_("comma-separated list of fields to sort buffers; each field is " + "a hdata variable of buffer (\"var\"), a hdata variable of " + "IRC server (\"irc_server.var\") or a hdata variable of " + "IRC channel (\"irc_channel.var\"); " + "char \"-\" can be used before field to reverse order, " + "char \"~\" can be used to do a case insensitive comparison; " + "example: \"-~short_name\" for case insensitive and reverse " + "sort on buffer short name " + "(note: the content is evaluated, before being split into " + "fields, but at that time \"bar_item\" is the only variable " + "that can be used, to distinguish between different buflist " + "items, for example \"${bar_item.name}\")"), + NULL, 0, 0, "number,-active", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_sort, NULL, NULL, + NULL, NULL, NULL); + buflist_config_look_use_items = weechat_config_new_option ( + buflist_config_file, buflist_config_section_look, + "use_items", "integer", + N_("number of buflist bar items that can be used; the item names " + "are: \"buflist\", \"buflist2\", \"buflist3\"; be careful, " + "using more than one bar item slows down the display of " + "buffers list"), + NULL, 1, BUFLIST_BAR_NUM_ITEMS, "1", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_use_items, NULL, NULL, + NULL, NULL, NULL); } - buflist_config_format_buffer = weechat_config_new_option ( - buflist_config_file, ptr_section, - "buffer", "string", - N_("format of each line with a buffer " - "(note: content is evaluated, see /help buflist); " - "example: standard format for bar item \"buflist\" and only the " - "buffer number between square brackets for other bar items " - "(\"buflist2\" and \"buflist3\"): " - "\"${if:${bar_item.name}==buflist?${format_number}${indent}" - "${format_nick_prefix}${color_hotlist}${format_name}:" - "[${number}]}\""), - NULL, 0, 0, - "${format_number}${indent}${format_nick_prefix}${color_hotlist}" - "${format_name}", - NULL, 0, - NULL, NULL, NULL, - &buflist_config_change_format, NULL, NULL, - NULL, NULL, NULL); - buflist_config_format_buffer_current = weechat_config_new_option ( - buflist_config_file, ptr_section, - "buffer_current", "string", - N_("format for the line with current buffer " - "(note: content is evaluated, see /help buflist)"), - NULL, 0, 0, "${color:,blue}${format_buffer}", NULL, 0, - NULL, NULL, NULL, - &buflist_config_change_format, NULL, NULL, - NULL, NULL, NULL); - buflist_config_format_hotlist = weechat_config_new_option ( - buflist_config_file, ptr_section, - "hotlist", "string", - N_("format for hotlist " - "(note: content is evaluated, see /help buflist)"), - NULL, 0, 0, - " ${color:green}(${hotlist}${color:green})", - NULL, 0, - NULL, NULL, NULL, - &buflist_config_change_format, NULL, NULL, - NULL, NULL, NULL); - buflist_config_format_hotlist_level[3] = weechat_config_new_option ( - buflist_config_file, ptr_section, - "hotlist_highlight", "string", - N_("format for a buffer with hotlist level \"highlight\" " - "(note: content is evaluated, see /help buflist)"), - NULL, 0, 0, "${color:magenta}", NULL, 0, - NULL, NULL, NULL, - &buflist_config_change_buflist, NULL, NULL, - NULL, NULL, NULL); - buflist_config_format_hotlist_level[0] = weechat_config_new_option ( - buflist_config_file, ptr_section, - "hotlist_low", "string", - N_("format for a buffer with hotlist level \"low\" " - "(note: content is evaluated, see /help buflist)"), - NULL, 0, 0, "${color:white}", NULL, 0, - NULL, NULL, NULL, - &buflist_config_change_buflist, NULL, NULL, - NULL, NULL, NULL); - buflist_config_format_hotlist_level[1] = weechat_config_new_option ( - buflist_config_file, ptr_section, - "hotlist_message", "string", - N_("format for a buffer with hotlist level \"message\" " - "(note: content is evaluated, see /help buflist)"), - NULL, 0, 0, "${color:brown}", NULL, 0, - NULL, NULL, NULL, - &buflist_config_change_buflist, NULL, NULL, - NULL, NULL, NULL); - buflist_config_format_hotlist_level_none = weechat_config_new_option ( - buflist_config_file, ptr_section, - "hotlist_none", "string", - N_("format for a buffer not in hotlist " - "(note: content is evaluated, see /help buflist)"), - NULL, 0, 0, "${color:default}", NULL, 0, - NULL, NULL, NULL, - &buflist_config_change_buflist, NULL, NULL, - NULL, NULL, NULL); - buflist_config_format_hotlist_level[2] = weechat_config_new_option ( - buflist_config_file, ptr_section, - "hotlist_private", "string", - N_("format for a buffer with hotlist level \"private\" " - "(note: content is evaluated, see /help buflist)"), - NULL, 0, 0, "${color:green}", NULL, 0, - NULL, NULL, NULL, - &buflist_config_change_buflist, NULL, NULL, - NULL, NULL, NULL); - buflist_config_format_hotlist_separator = weechat_config_new_option ( - buflist_config_file, ptr_section, - "hotlist_separator", "string", - N_("separator for counts in hotlist " - "(note: content is evaluated, see /help buflist)"), - NULL, 0, 0, "${color:default},", NULL, 0, - NULL, NULL, NULL, - &buflist_config_change_buflist, NULL, NULL, - NULL, NULL, NULL); - buflist_config_format_indent = weechat_config_new_option ( - buflist_config_file, ptr_section, - "indent", "string", - N_("string displayed to indent channel and private buffers " - "(note: content is evaluated, see /help buflist)"), - NULL, 0, 0, " ", NULL, 0, - NULL, NULL, NULL, - &buflist_config_change_buflist, NULL, NULL, - NULL, NULL, NULL); - buflist_config_format_lag = weechat_config_new_option ( - buflist_config_file, ptr_section, - "lag", "string", - N_("format for lag on an IRC server buffer " - "(note: content is evaluated, see /help buflist)"), - NULL, 0, 0, - " ${color:green}[${color:brown}${lag}${color:green}]", - NULL, 0, - NULL, NULL, NULL, - &buflist_config_change_buflist, NULL, NULL, - NULL, NULL, NULL); - buflist_config_format_name = weechat_config_new_option ( - buflist_config_file, ptr_section, - "name", "string", - N_("format for buffer name " - "(note: content is evaluated, see /help buflist)"), - NULL, 0, 0, "${name}", NULL, 0, + /* format */ + buflist_config_section_format = weechat_config_new_section ( + buflist_config_file, "format", + 0, 0, NULL, NULL, NULL, - &buflist_config_change_buflist, NULL, NULL, - NULL, NULL, NULL); - buflist_config_format_nick_prefix = weechat_config_new_option ( - buflist_config_file, ptr_section, - "nick_prefix", "string", - N_("format for nick prefix on a channel " - "(note: content is evaluated, see /help buflist)"), - NULL, 0, 0, "${color_nick_prefix}${nick_prefix}", NULL, 0, NULL, NULL, NULL, - &buflist_config_change_buflist, NULL, NULL, - NULL, NULL, NULL); - buflist_config_format_number = weechat_config_new_option ( - buflist_config_file, ptr_section, - "number", "string", - N_("format for buffer number, ${number} is the indented number " - "(note: content is evaluated, see /help buflist)"), - NULL, 0, 0, - "${color:green}${number}${if:${number_displayed}?.: }", - NULL, 0, NULL, NULL, NULL, - &buflist_config_change_buflist, NULL, NULL, - NULL, NULL, NULL); - buflist_config_format_tls_version = weechat_config_new_option ( - buflist_config_file, ptr_section, - "tls_version", "string", - N_("format for TLS version on an IRC server buffer " - "(note: content is evaluated, see /help buflist)"), - NULL, 0, 0, - " ${color:default}(${if:${tls_version}==TLS1.3?${color:green}:" - "${if:${tls_version}==TLS1.2?${color:yellow}:${color:red}}}" - "${translate:${tls_version}}${color:default})", - NULL, 0, NULL, NULL, NULL, - &buflist_config_change_buflist, NULL, NULL, NULL, NULL, NULL); + if (buflist_config_section_format) + { + buflist_config_format_buffer = weechat_config_new_option ( + buflist_config_file, buflist_config_section_format, + "buffer", "string", + N_("format of each line with a buffer " + "(note: content is evaluated, see /help buflist); " + "example: standard format for bar item \"buflist\" and only the " + "buffer number between square brackets for other bar items " + "(\"buflist2\" and \"buflist3\"): " + "\"${if:${bar_item.name}==buflist?${format_number}${indent}" + "${format_nick_prefix}${color_hotlist}${format_name}:" + "[${number}]}\""), + NULL, 0, 0, + "${format_number}${indent}${format_nick_prefix}${color_hotlist}" + "${format_name}", + NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_format, NULL, NULL, + NULL, NULL, NULL); + buflist_config_format_buffer_current = weechat_config_new_option ( + buflist_config_file, buflist_config_section_format, + "buffer_current", "string", + N_("format for the line with current buffer " + "(note: content is evaluated, see /help buflist)"), + NULL, 0, 0, "${color:,blue}${format_buffer}", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_format, NULL, NULL, + NULL, NULL, NULL); + buflist_config_format_hotlist = weechat_config_new_option ( + buflist_config_file, buflist_config_section_format, + "hotlist", "string", + N_("format for hotlist " + "(note: content is evaluated, see /help buflist)"), + NULL, 0, 0, + " ${color:green}(${hotlist}${color:green})", + NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_format, NULL, NULL, + NULL, NULL, NULL); + buflist_config_format_hotlist_level[3] = weechat_config_new_option ( + buflist_config_file, buflist_config_section_format, + "hotlist_highlight", "string", + N_("format for a buffer with hotlist level \"highlight\" " + "(note: content is evaluated, see /help buflist)"), + NULL, 0, 0, "${color:magenta}", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_buflist, NULL, NULL, + NULL, NULL, NULL); + buflist_config_format_hotlist_level[0] = weechat_config_new_option ( + buflist_config_file, buflist_config_section_format, + "hotlist_low", "string", + N_("format for a buffer with hotlist level \"low\" " + "(note: content is evaluated, see /help buflist)"), + NULL, 0, 0, "${color:white}", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_buflist, NULL, NULL, + NULL, NULL, NULL); + buflist_config_format_hotlist_level[1] = weechat_config_new_option ( + buflist_config_file, buflist_config_section_format, + "hotlist_message", "string", + N_("format for a buffer with hotlist level \"message\" " + "(note: content is evaluated, see /help buflist)"), + NULL, 0, 0, "${color:brown}", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_buflist, NULL, NULL, + NULL, NULL, NULL); + buflist_config_format_hotlist_level_none = weechat_config_new_option ( + buflist_config_file, buflist_config_section_format, + "hotlist_none", "string", + N_("format for a buffer not in hotlist " + "(note: content is evaluated, see /help buflist)"), + NULL, 0, 0, "${color:default}", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_buflist, NULL, NULL, + NULL, NULL, NULL); + buflist_config_format_hotlist_level[2] = weechat_config_new_option ( + buflist_config_file, buflist_config_section_format, + "hotlist_private", "string", + N_("format for a buffer with hotlist level \"private\" " + "(note: content is evaluated, see /help buflist)"), + NULL, 0, 0, "${color:green}", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_buflist, NULL, NULL, + NULL, NULL, NULL); + buflist_config_format_hotlist_separator = weechat_config_new_option ( + buflist_config_file, buflist_config_section_format, + "hotlist_separator", "string", + N_("separator for counts in hotlist " + "(note: content is evaluated, see /help buflist)"), + NULL, 0, 0, "${color:default},", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_buflist, NULL, NULL, + NULL, NULL, NULL); + buflist_config_format_indent = weechat_config_new_option ( + buflist_config_file, buflist_config_section_format, + "indent", "string", + N_("string displayed to indent channel and private buffers " + "(note: content is evaluated, see /help buflist)"), + NULL, 0, 0, " ", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_buflist, NULL, NULL, + NULL, NULL, NULL); + buflist_config_format_lag = weechat_config_new_option ( + buflist_config_file, buflist_config_section_format, + "lag", "string", + N_("format for lag on an IRC server buffer " + "(note: content is evaluated, see /help buflist)"), + NULL, 0, 0, + " ${color:green}[${color:brown}${lag}${color:green}]", + NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_buflist, NULL, NULL, + NULL, NULL, NULL); + buflist_config_format_name = weechat_config_new_option ( + buflist_config_file, buflist_config_section_format, + "name", "string", + N_("format for buffer name " + "(note: content is evaluated, see /help buflist)"), + NULL, 0, 0, "${name}", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_buflist, NULL, NULL, + NULL, NULL, NULL); + buflist_config_format_nick_prefix = weechat_config_new_option ( + buflist_config_file, buflist_config_section_format, + "nick_prefix", "string", + N_("format for nick prefix on a channel " + "(note: content is evaluated, see /help buflist)"), + NULL, 0, 0, "${color_nick_prefix}${nick_prefix}", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_buflist, NULL, NULL, + NULL, NULL, NULL); + buflist_config_format_number = weechat_config_new_option ( + buflist_config_file, buflist_config_section_format, + "number", "string", + N_("format for buffer number, ${number} is the indented number " + "(note: content is evaluated, see /help buflist)"), + NULL, 0, 0, + "${color:green}${number}${if:${number_displayed}?.: }", + NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_buflist, NULL, NULL, + NULL, NULL, NULL); + buflist_config_format_tls_version = weechat_config_new_option ( + buflist_config_file, buflist_config_section_format, + "tls_version", "string", + N_("format for TLS version on an IRC server buffer " + "(note: content is evaluated, see /help buflist)"), + NULL, 0, 0, + " ${color:default}(${if:${tls_version}==TLS1.3?${color:green}:" + "${if:${tls_version}==TLS1.2?${color:yellow}:${color:red}}}" + "${translate:${tls_version}}${color:default})", + NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_buflist, NULL, NULL, + NULL, NULL, NULL); + } return 1; } diff --git a/src/plugins/exec/exec-config.c b/src/plugins/exec/exec-config.c index 6c6ef8783..ba21ac65b 100644 --- a/src/plugins/exec/exec-config.c +++ b/src/plugins/exec/exec-config.c @@ -30,16 +30,21 @@ struct t_config_file *exec_config_file = NULL; +/* sections */ + +struct t_config_section *exec_config_section_command = NULL; +struct t_config_section *exec_config_section_color = NULL; + /* exec config, command section */ -struct t_config_option *exec_config_command_default_options; -struct t_config_option *exec_config_command_purge_delay; -struct t_config_option *exec_config_command_shell; +struct t_config_option *exec_config_command_default_options = NULL; +struct t_config_option *exec_config_command_purge_delay = NULL; +struct t_config_option *exec_config_command_shell = NULL; /* exec config, color section */ -struct t_config_option *exec_config_color_flag_finished; -struct t_config_option *exec_config_color_flag_running; +struct t_config_option *exec_config_color_flag_finished = NULL; +struct t_config_option *exec_config_color_flag_running = NULL; char **exec_config_cmd_options = NULL; int exec_config_cmd_num_options = 0; @@ -98,85 +103,78 @@ exec_config_reload_cb (const void *pointer, void *data, int exec_config_init () { - struct t_config_section *ptr_section; - exec_config_file = weechat_config_new (EXEC_CONFIG_PRIO_NAME, &exec_config_reload_cb, NULL, NULL); if (!exec_config_file) return 0; /* command */ - ptr_section = weechat_config_new_section (exec_config_file, "command", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) + exec_config_section_command = weechat_config_new_section ( + exec_config_file, "command", + 0, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + if (exec_config_section_command) { - weechat_config_free (exec_config_file); - exec_config_file = NULL; - return 0; + exec_config_command_default_options = weechat_config_new_option ( + exec_config_file, exec_config_section_command, + "default_options", "string", + N_("default options for command /exec (see /help exec); example: " + "\"-nosh -bg\" to run all commands in background (no output), " + "and without using the shell"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &exec_config_change_command_default_options, NULL, NULL, + NULL, NULL, NULL); + exec_config_command_purge_delay = weechat_config_new_option ( + exec_config_file, exec_config_section_command, + "purge_delay", "integer", + N_("delay for purging finished commands (in seconds, 0 = purge " + "commands immediately, -1 = never purge)"), + NULL, -1, 36000 * 24 * 30, "0", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + exec_config_command_shell = weechat_config_new_option ( + exec_config_file, exec_config_section_command, + "shell", "string", + N_("shell to use with command \"/exec -sh\"; it can be just the " + "name of shell if it is in PATH (for example \"bash\") or the " + "absolute path to the shell (for example \"/bin/bash\"); if " + "value is empty, \"sh\" is used (note: content is evaluated, " + "see /help eval)"), + NULL, 0, 0, "${env:SHELL}", NULL, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); } - exec_config_command_default_options = weechat_config_new_option ( - exec_config_file, ptr_section, - "default_options", "string", - N_("default options for command /exec (see /help exec); example: " - "\"-nosh -bg\" to run all commands in background (no output), and " - "without using the shell"), - NULL, 0, 0, "", NULL, 0, + /* color */ + exec_config_section_color = weechat_config_new_section ( + exec_config_file, "color", + 0, 0, + NULL, NULL, NULL, NULL, NULL, NULL, - &exec_config_change_command_default_options, NULL, NULL, - NULL, NULL, NULL); - exec_config_command_purge_delay = weechat_config_new_option ( - exec_config_file, ptr_section, - "purge_delay", "integer", - N_("delay for purging finished commands (in seconds, 0 = purge " - "commands immediately, -1 = never purge)"), - NULL, -1, 36000 * 24 * 30, "0", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - exec_config_command_shell = weechat_config_new_option ( - exec_config_file, ptr_section, - "shell", "string", - N_("shell to use with command \"/exec -sh\"; it can be just the name " - "of shell if it is in PATH (for example \"bash\") or the absolute " - "path to the shell (for example \"/bin/bash\"); if value is empty, " - "\"sh\" is used (note: content is evaluated, see /help eval)"), - NULL, 0, 0, "${env:SHELL}", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - - /* color */ - ptr_section = weechat_config_new_section (exec_config_file, "color", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) + if (exec_config_section_color) { - weechat_config_free (exec_config_file); - exec_config_file = NULL; - return 0; + exec_config_color_flag_finished = weechat_config_new_option ( + exec_config_file, exec_config_section_color, + "flag_finished", "color", + N_("text color for a finished command flag in list of commands"), + NULL, 0, 0, "lightred", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + exec_config_color_flag_running = weechat_config_new_option ( + exec_config_file, exec_config_section_color, + "flag_running", "color", + N_("text color for a running command flag in list of commands"), + NULL, 0, 0, "lightgreen", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } - exec_config_color_flag_finished = weechat_config_new_option ( - exec_config_file, ptr_section, - "flag_finished", "color", - N_("text color for a finished command flag in list of commands"), - NULL, 0, 0, "lightred", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - exec_config_color_flag_running = weechat_config_new_option ( - exec_config_file, ptr_section, - "flag_running", "color", - N_("text color for a running command flag in list of commands"), - NULL, 0, 0, "lightgreen", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - return 1; } diff --git a/src/plugins/fifo/fifo-config.c b/src/plugins/fifo/fifo-config.c index 11f03a9e9..e8dd23e9c 100644 --- a/src/plugins/fifo/fifo-config.c +++ b/src/plugins/fifo/fifo-config.c @@ -28,10 +28,14 @@ struct t_config_file *fifo_config_file = NULL; +/* sections */ + +struct t_config_section *fifo_config_section_file = NULL; + /* fifo config, file section */ -struct t_config_option *fifo_config_file_enabled; -struct t_config_option *fifo_config_file_path; +struct t_config_option *fifo_config_file_enabled = NULL; +struct t_config_option *fifo_config_file_path = NULL; /* @@ -85,47 +89,42 @@ fifo_config_change_file_path (const void *pointer, void *data, int fifo_config_init () { - struct t_config_section *ptr_section; - fifo_config_file = weechat_config_new (FIFO_CONFIG_PRIO_NAME, NULL, NULL, NULL); if (!fifo_config_file) return 0; /* file */ - ptr_section = weechat_config_new_section (fifo_config_file, "file", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (fifo_config_file); - fifo_config_file = NULL; - return 0; - } - - fifo_config_file_enabled = weechat_config_new_option ( - fifo_config_file, ptr_section, - "enabled", "boolean", - N_("enable FIFO pipe"), - NULL, 0, 0, "on", NULL, 0, + fifo_config_section_file = weechat_config_new_section ( + fifo_config_file, "file", + 0, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, - &fifo_config_change_file_enabled, NULL, NULL, - NULL, NULL, NULL); - fifo_config_file_path = weechat_config_new_option ( - fifo_config_file, ptr_section, - "path", "string", - N_("path for FIFO file; " - "WeeChat PID can be used in path with ${info:pid} " - "(path is evaluated, see function string_eval_path_home in " - "plugin API reference)"), - NULL, 0, 0, "${weechat_runtime_dir}/weechat_fifo_${info:pid}", NULL, 0, NULL, NULL, NULL, - fifo_config_change_file_path, NULL, NULL, NULL, NULL, NULL); + if (fifo_config_section_file) + { + fifo_config_file_enabled = weechat_config_new_option ( + fifo_config_file, fifo_config_section_file, + "enabled", "boolean", + N_("enable FIFO pipe"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &fifo_config_change_file_enabled, NULL, NULL, + NULL, NULL, NULL); + fifo_config_file_path = weechat_config_new_option ( + fifo_config_file, fifo_config_section_file, + "path", "string", + N_("path for FIFO file; " + "WeeChat PID can be used in path with ${info:pid} " + "(path is evaluated, see function string_eval_path_home in " + "plugin API reference)"), + NULL, 0, 0, "${weechat_runtime_dir}/weechat_fifo_${info:pid}", NULL, 0, + NULL, NULL, NULL, + fifo_config_change_file_path, NULL, NULL, + NULL, NULL, NULL); + } return 1; } diff --git a/src/plugins/fset/fset-config.c b/src/plugins/fset/fset-config.c index 26c73c7c2..08908d0a0 100644 --- a/src/plugins/fset/fset-config.c +++ b/src/plugins/fset/fset-config.c @@ -32,67 +32,73 @@ struct t_config_file *fset_config_file = NULL; +/* sections */ + +struct t_config_section *fset_config_section_look = NULL; +struct t_config_section *fset_config_section_format = NULL; +struct t_config_section *fset_config_section_color = NULL; + /* fset config, look section */ -struct t_config_option *fset_config_look_auto_refresh; -struct t_config_option *fset_config_look_auto_unmark; -struct t_config_option *fset_config_look_condition_catch_set; -struct t_config_option *fset_config_look_export_help_default; -struct t_config_option *fset_config_look_format_number; -struct t_config_option *fset_config_look_marked_string; -struct t_config_option *fset_config_look_scroll_horizontal; -struct t_config_option *fset_config_look_show_plugins_desc; -struct t_config_option *fset_config_look_sort; -struct t_config_option *fset_config_look_unmarked_string; -struct t_config_option *fset_config_look_use_color_value; -struct t_config_option *fset_config_look_use_keys; -struct t_config_option *fset_config_look_use_mute; +struct t_config_option *fset_config_look_auto_refresh = NULL; +struct t_config_option *fset_config_look_auto_unmark = NULL; +struct t_config_option *fset_config_look_condition_catch_set = NULL; +struct t_config_option *fset_config_look_export_help_default = NULL; +struct t_config_option *fset_config_look_format_number = NULL; +struct t_config_option *fset_config_look_marked_string = NULL; +struct t_config_option *fset_config_look_scroll_horizontal = NULL; +struct t_config_option *fset_config_look_show_plugins_desc = NULL; +struct t_config_option *fset_config_look_sort = NULL; +struct t_config_option *fset_config_look_unmarked_string = NULL; +struct t_config_option *fset_config_look_use_color_value = NULL; +struct t_config_option *fset_config_look_use_keys = NULL; +struct t_config_option *fset_config_look_use_mute = NULL; /* fset config, format section */ -struct t_config_option *fset_config_format_export_help; -struct t_config_option *fset_config_format_export_option; -struct t_config_option *fset_config_format_export_option_null; -struct t_config_option *fset_config_format_option[2]; +struct t_config_option *fset_config_format_export_help = NULL; +struct t_config_option *fset_config_format_export_option = NULL; +struct t_config_option *fset_config_format_export_option_null = NULL; +struct t_config_option *fset_config_format_option[2] = { NULL, NULL }; /* fset config, color section */ -struct t_config_option *fset_config_color_default_value[2]; -struct t_config_option *fset_config_color_description[2]; -struct t_config_option *fset_config_color_file[2]; -struct t_config_option *fset_config_color_file_changed[2]; -struct t_config_option *fset_config_color_help_default_value; -struct t_config_option *fset_config_color_help_description; -struct t_config_option *fset_config_color_help_name; -struct t_config_option *fset_config_color_help_quotes; -struct t_config_option *fset_config_color_help_values; -struct t_config_option *fset_config_color_index[2]; -struct t_config_option *fset_config_color_line_marked_bg[2]; -struct t_config_option *fset_config_color_line_selected_bg[2]; -struct t_config_option *fset_config_color_marked[2]; -struct t_config_option *fset_config_color_max[2]; -struct t_config_option *fset_config_color_min[2]; -struct t_config_option *fset_config_color_name[2]; -struct t_config_option *fset_config_color_name_changed[2]; -struct t_config_option *fset_config_color_option[2]; -struct t_config_option *fset_config_color_option_changed[2]; -struct t_config_option *fset_config_color_parent_name[2]; -struct t_config_option *fset_config_color_parent_value[2]; -struct t_config_option *fset_config_color_quotes[2]; -struct t_config_option *fset_config_color_quotes_changed[2]; -struct t_config_option *fset_config_color_section[2]; -struct t_config_option *fset_config_color_section_changed[2]; -struct t_config_option *fset_config_color_string_values[2]; -struct t_config_option *fset_config_color_title_count_options; -struct t_config_option *fset_config_color_title_current_option; -struct t_config_option *fset_config_color_title_filter; -struct t_config_option *fset_config_color_title_marked_options; -struct t_config_option *fset_config_color_title_sort; -struct t_config_option *fset_config_color_type[2]; -struct t_config_option *fset_config_color_unmarked[2]; -struct t_config_option *fset_config_color_value[2]; -struct t_config_option *fset_config_color_value_changed[2]; -struct t_config_option *fset_config_color_value_undef[2]; +struct t_config_option *fset_config_color_default_value[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_description[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_file[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_file_changed[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_help_default_value = NULL; +struct t_config_option *fset_config_color_help_description = NULL; +struct t_config_option *fset_config_color_help_name = NULL; +struct t_config_option *fset_config_color_help_quotes = NULL; +struct t_config_option *fset_config_color_help_values = NULL; +struct t_config_option *fset_config_color_index[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_line_marked_bg[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_line_selected_bg[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_marked[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_max[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_min[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_name[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_name_changed[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_option[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_option_changed[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_parent_name[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_parent_value[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_quotes[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_quotes_changed[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_section[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_section_changed[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_string_values[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_title_count_options = NULL; +struct t_config_option *fset_config_color_title_current_option = NULL; +struct t_config_option *fset_config_color_title_filter = NULL; +struct t_config_option *fset_config_color_title_marked_options = NULL; +struct t_config_option *fset_config_color_title_sort = NULL; +struct t_config_option *fset_config_color_type[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_unmarked[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_value[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_value_changed[2] = { NULL, NULL }; +struct t_config_option *fset_config_color_value_undef[2] = { NULL, NULL }; char **fset_config_auto_refresh = NULL; char **fset_config_sort_fields = NULL; @@ -363,755 +369,744 @@ fset_config_change_title_color_cb (const void *pointer, void *data, int fset_config_init () { - struct t_config_section *ptr_section; - fset_config_file = weechat_config_new (FSET_CONFIG_PRIO_NAME, &fset_config_reload, NULL, NULL); if (!fset_config_file) return 0; /* look */ - ptr_section = weechat_config_new_section (fset_config_file, "look", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (fset_config_file); - fset_config_file = NULL; - return 0; - } - - fset_config_look_auto_refresh = weechat_config_new_option ( - fset_config_file, ptr_section, - "auto_refresh", "string", - N_("comma separated list of options to automatically refresh on the " - "fset buffer (if opened); \"*\" means all options (recommended), " - "a name beginning with \"!\" is a negative value to prevent an " - "option to be refreshed, wildcard \"*\" is allowed in names " - "(example: \"*,!plugin.section.*\")"), - NULL, 0, 0, "*", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_auto_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_look_auto_unmark = weechat_config_new_option ( - fset_config_file, ptr_section, - "auto_unmark", "boolean", - N_("automatically unmark all options after an action on marked " - "options or after a refresh"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - fset_config_look_condition_catch_set = weechat_config_new_option ( - fset_config_file, ptr_section, - "condition_catch_set", "string", - N_("condition to catch /set command and display results in the fset " - "buffer; following variables can be used: ${name} (name of option " - "given for the /set command), ${count} (number of options found " - "with the /set argument); an empty string disables the catch of " - "/set command; with value \"1\", the fset buffer is always used " - "with /set command"), - NULL, 0, 0, "${count} >= 1", NULL, 0, - NULL, NULL, NULL, + fset_config_section_look = weechat_config_new_section ( + fset_config_file, "look", + 0, 0, NULL, NULL, NULL, - NULL, NULL, NULL); - fset_config_look_export_help_default = weechat_config_new_option ( - fset_config_file, ptr_section, - "export_help_default", "boolean", - N_("write help for each option exported by default (this can be " - "overridden with arguments \"-help\" and \"-nohelp\" for command " - "/fset -export)"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL); - fset_config_look_format_number = weechat_config_new_option ( - fset_config_file, ptr_section, - "format_number", "integer", - N_("number of format used to display options; this is dynamically " - "changed by the key ctrl-x on the fset buffer"), - NULL, 1, 2, "1", NULL, 0, NULL, NULL, NULL, - &fset_config_change_format_number_cb, NULL, NULL, NULL, NULL, NULL); - fset_config_look_marked_string = weechat_config_new_option ( - fset_config_file, ptr_section, - "marked_string", "string", - N_("string displayed when an option is marked (to do an action on " - "multiple options)"), - NULL, 0, 0, "*", NULL, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - fset_config_look_scroll_horizontal = weechat_config_new_option ( - fset_config_file, ptr_section, - "scroll_horizontal", "integer", - N_("left/right scroll in fset buffer (percent of width)"), - NULL, 1, 100, "10", NULL, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - fset_config_look_show_plugins_desc = weechat_config_new_option ( - fset_config_file, ptr_section, - "show_plugins_desc", "boolean", - N_("show the plugin description options (plugins.desc.*)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_show_plugins_desc_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_look_sort = weechat_config_new_option ( - fset_config_file, ptr_section, - "sort", "string", - N_("comma-separated list of fields to sort options (see /help fset " - "for a list of fields); char \"-\" can be used before field to " - "reverse order, char \"~\" can be used to do a case insensitive " - "comparison; example: \"-~name\" for case insensitive and reverse " - "sort on option name"), - NULL, 0, 0, "~name", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_sort_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_look_unmarked_string = weechat_config_new_option ( - fset_config_file, ptr_section, - "unmarked_string", "string", - N_("string displayed when an option is not marked"), - NULL, 0, 0, " ", NULL, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - fset_config_look_use_color_value = weechat_config_new_option ( - fset_config_file, ptr_section, - "use_color_value", "boolean", - N_("use the color to display value of color options"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_use_color_value_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_look_use_keys = weechat_config_new_option ( - fset_config_file, ptr_section, - "use_keys", "boolean", - N_("use keys alt+X in fset buffer to do actions on options; " - "if disabled, only the input is allowed"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_use_keys_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_look_use_mute = weechat_config_new_option ( - fset_config_file, ptr_section, - "use_mute", "boolean", - N_("use /mute command to set options"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_use_keys_cb, NULL, NULL, - NULL, NULL, NULL); - - /* format */ - ptr_section = weechat_config_new_section (fset_config_file, "format", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) + if (fset_config_section_look) { - weechat_config_free (fset_config_file); - fset_config_file = NULL; - return 0; + fset_config_look_auto_refresh = weechat_config_new_option ( + fset_config_file, fset_config_section_look, + "auto_refresh", "string", + N_("comma separated list of options to automatically refresh on the " + "fset buffer (if opened); \"*\" means all options (recommended), " + "a name beginning with \"!\" is a negative value to prevent an " + "option to be refreshed, wildcard \"*\" is allowed in names " + "(example: \"*,!plugin.section.*\")"), + NULL, 0, 0, "*", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_auto_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_look_auto_unmark = weechat_config_new_option ( + fset_config_file, fset_config_section_look, + "auto_unmark", "boolean", + N_("automatically unmark all options after an action on marked " + "options or after a refresh"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + fset_config_look_condition_catch_set = weechat_config_new_option ( + fset_config_file, fset_config_section_look, + "condition_catch_set", "string", + N_("condition to catch /set command and display results in the fset " + "buffer; following variables can be used: ${name} (name of option " + "given for the /set command), ${count} (number of options found " + "with the /set argument); an empty string disables the catch of " + "/set command; with value \"1\", the fset buffer is always used " + "with /set command"), + NULL, 0, 0, "${count} >= 1", NULL, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + fset_config_look_export_help_default = weechat_config_new_option ( + fset_config_file, fset_config_section_look, + "export_help_default", "boolean", + N_("write help for each option exported by default (this can be " + "overridden with arguments \"-help\" and \"-nohelp\" for command " + "/fset -export)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + fset_config_look_format_number = weechat_config_new_option ( + fset_config_file, fset_config_section_look, + "format_number", "integer", + N_("number of format used to display options; this is dynamically " + "changed by the key ctrl-x on the fset buffer"), + NULL, 1, 2, "1", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_format_number_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_look_marked_string = weechat_config_new_option ( + fset_config_file, fset_config_section_look, + "marked_string", "string", + N_("string displayed when an option is marked (to do an action on " + "multiple options)"), + NULL, 0, 0, "*", NULL, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + fset_config_look_scroll_horizontal = weechat_config_new_option ( + fset_config_file, fset_config_section_look, + "scroll_horizontal", "integer", + N_("left/right scroll in fset buffer (percent of width)"), + NULL, 1, 100, "10", NULL, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + fset_config_look_show_plugins_desc = weechat_config_new_option ( + fset_config_file, fset_config_section_look, + "show_plugins_desc", "boolean", + N_("show the plugin description options (plugins.desc.*)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_show_plugins_desc_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_look_sort = weechat_config_new_option ( + fset_config_file, fset_config_section_look, + "sort", "string", + N_("comma-separated list of fields to sort options (see /help fset " + "for a list of fields); char \"-\" can be used before field to " + "reverse order, char \"~\" can be used to do a case insensitive " + "comparison; example: \"-~name\" for case insensitive and " + "reverse sort on option name"), + NULL, 0, 0, "~name", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_sort_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_look_unmarked_string = weechat_config_new_option ( + fset_config_file, fset_config_section_look, + "unmarked_string", "string", + N_("string displayed when an option is not marked"), + NULL, 0, 0, " ", NULL, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + fset_config_look_use_color_value = weechat_config_new_option ( + fset_config_file, fset_config_section_look, + "use_color_value", "boolean", + N_("use the color to display value of color options"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_use_color_value_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_look_use_keys = weechat_config_new_option ( + fset_config_file, fset_config_section_look, + "use_keys", "boolean", + N_("use keys alt+X in fset buffer to do actions on options; " + "if disabled, only the input is allowed"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_use_keys_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_look_use_mute = weechat_config_new_option ( + fset_config_file, fset_config_section_look, + "use_mute", "boolean", + N_("use /mute command to set options"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_use_keys_cb, NULL, NULL, + NULL, NULL, NULL); } - fset_config_format_export_help = weechat_config_new_option ( - fset_config_file, ptr_section, - "export_help", "string", - N_("format of help line written before each option exported in a file " - "(note: content is evaluated, see /help fset)"), - NULL, 0, 0, - "# ${description2}", - NULL, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - fset_config_format_export_option = weechat_config_new_option ( - fset_config_file, ptr_section, - "export_option", "string", - N_("format of each option exported in a file " - "(note: content is evaluated, see /help fset)"), - NULL, 0, 0, - "/set ${name} ${quoted_value}", - NULL, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - fset_config_format_export_option_null = weechat_config_new_option ( - fset_config_file, ptr_section, - "export_option_null", "string", - N_("format of each option with \"null\" value exported in a file " - "(note: content is evaluated, see /help fset)"), - NULL, 0, 0, - "/unset ${name}", - NULL, 0, + /* format */ + fset_config_section_format = weechat_config_new_section ( + fset_config_file, "format", + 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL); - fset_config_format_option[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "option1", "string", - N_("first format of each line, used when option " - "fset.look.format_number is set to 1 " - "(note: content is evaluated, see /help fset); " - "an empty string uses the default format " - "(\"${marked} ${name} ${type} ${value2}\"), which is without " - "evaluation of string and then much faster; " - "formats can be switched with key ctrl-x"), - NULL, 0, 0, - "", - NULL, 0, NULL, NULL, NULL, - &fset_config_change_format_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_format_option[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "option2", "string", - N_("second format of each line, used when option " - "fset.look.format_number is set to 2 " - "(note: content is evaluated, see /help fset); " - "an empty string uses the default format " - "(\"${marked} ${name} ${type} ${value2}\"), which is without " - "evaluation of string and then much faster; " - "formats can be switched with key ctrl-x"), - NULL, 0, 0, - "${marked} ${name} ${type} ${value2}${newline}" - " ${empty_name} ${_default_value}${color:darkgray} -- " - "${min}..${max}${newline}" - " ${empty_name} ${description}", - NULL, 0, NULL, NULL, NULL, - &fset_config_change_format_cb, NULL, NULL, NULL, NULL, NULL); - - /* color */ - ptr_section = weechat_config_new_section (fset_config_file, "color", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) + if (fset_config_section_format) { - weechat_config_free (fset_config_file); - fset_config_file = NULL; - return 0; + fset_config_format_export_help = weechat_config_new_option ( + fset_config_file, fset_config_section_format, + "export_help", "string", + N_("format of help line written before each option exported in a " + "file (note: content is evaluated, see /help fset)"), + NULL, 0, 0, + "# ${description2}", + NULL, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + fset_config_format_export_option = weechat_config_new_option ( + fset_config_file, fset_config_section_format, + "export_option", "string", + N_("format of each option exported in a file " + "(note: content is evaluated, see /help fset)"), + NULL, 0, 0, + "/set ${name} ${quoted_value}", + NULL, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + fset_config_format_export_option_null = weechat_config_new_option ( + fset_config_file, fset_config_section_format, + "export_option_null", "string", + N_("format of each option with \"null\" value exported in a file " + "(note: content is evaluated, see /help fset)"), + NULL, 0, 0, + "/unset ${name}", + NULL, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + fset_config_format_option[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_format, + "option1", "string", + N_("first format of each line, used when option " + "fset.look.format_number is set to 1 " + "(note: content is evaluated, see /help fset); " + "an empty string uses the default format " + "(\"${marked} ${name} ${type} ${value2}\"), which is without " + "evaluation of string and then much faster; " + "formats can be switched with key ctrl-x"), + NULL, 0, 0, + "", + NULL, 0, + NULL, NULL, NULL, + &fset_config_change_format_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_format_option[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_format, + "option2", "string", + N_("second format of each line, used when option " + "fset.look.format_number is set to 2 " + "(note: content is evaluated, see /help fset); " + "an empty string uses the default format " + "(\"${marked} ${name} ${type} ${value2}\"), which is without " + "evaluation of string and then much faster; " + "formats can be switched with key ctrl-x"), + NULL, 0, 0, + "${marked} ${name} ${type} ${value2}${newline}" + " ${empty_name} ${_default_value}${color:darkgray} -- " + "${min}..${max}${newline}" + " ${empty_name} ${description}", + NULL, 0, + NULL, NULL, NULL, + &fset_config_change_format_cb, NULL, NULL, + NULL, NULL, NULL); } - fset_config_color_default_value[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "default_value", "color", - N_("color for default value"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_default_value[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "default_value_selected", "color", - N_("color for default value on the selected line"), - NULL, 0, 0, "white", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_description[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "description", "color", - N_("color for description"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_description[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "description_selected", "color", - N_("color for description on the selected line"), - NULL, 0, 0, "white", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_file[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "file", "color", - N_("color for file"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_file_changed[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "file_changed", "color", - N_("color for file if value is changed"), - NULL, 0, 0, "brown", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_file_changed[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "file_changed_selected", "color", - N_("color for file if value is changed on the selected line"), - NULL, 0, 0, "yellow", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_file[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "file_selected", "color", - N_("color for file on the selected line"), - NULL, 0, 0, "white", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_help_default_value = weechat_config_new_option ( - fset_config_file, ptr_section, - "help_default_value", "color", - N_("color for default value in help bar"), - NULL, 0, 0, "white", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_help_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_help_description = weechat_config_new_option ( - fset_config_file, ptr_section, - "help_description", "color", - N_("color for description in help bar"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_help_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_help_name = weechat_config_new_option ( - fset_config_file, ptr_section, - "help_name", "color", - N_("color for name in help bar"), - NULL, 0, 0, "white", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_help_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_help_quotes = weechat_config_new_option ( - fset_config_file, ptr_section, - "help_quotes", "color", - N_("color for quotes around string values"), - NULL, 0, 0, "darkgray", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_help_values = weechat_config_new_option ( - fset_config_file, ptr_section, - "help_values", "color", - N_("color for allowed values"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_index[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "index", "color", - N_("color for index of option"), - NULL, 0, 0, "cyan", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_index[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "index_selected", "color", - N_("color for index of option on the selected line"), - NULL, 0, 0, "lightcyan", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_line_marked_bg[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "line_marked_bg1", "color", - N_("background color for a marked line " - "(used with the first format, see option fset.format.option1)"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_line_marked_bg[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "line_marked_bg2", "color", - N_("background color for a marked line " - "(used with the second format, see option fset.format.option2)"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_line_selected_bg[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "line_selected_bg1", "color", - N_("background color for the selected line " - "(used with the first format, see option fset.format.option1)"), - NULL, 0, 0, "blue", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_line_selected_bg[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "line_selected_bg2", "color", - N_("background color for the selected line " - "(used with the second format, see option fset.format.option2)"), - NULL, 0, 0, "red", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_marked[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "marked", "color", - N_("color for mark indicator"), - NULL, 0, 0, "brown", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_marked[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "marked_selected", "color", - N_("color for mark indicator on the selected line"), - NULL, 0, 0, "yellow", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_max[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "max", "color", - N_("color for max value"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_max[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "max_selected", "color", - N_("color for max value on the selected line"), - NULL, 0, 0, "white", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_min[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "min", "color", - N_("color for min value"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_min[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "min_selected", "color", - N_("color for min value on the selected line"), - NULL, 0, 0, "white", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_name[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "name", "color", - N_("color for name"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_name_changed[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "name_changed", "color", - N_("color for name if value is changed"), - NULL, 0, 0, "brown", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_name_changed[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "name_changed_selected", "color", - N_("color for name if value is changed on the selected line"), - NULL, 0, 0, "yellow", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_name[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "name_selected", "color", - N_("color for name on the selected line"), - NULL, 0, 0, "white", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_option[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "option", "color", - N_("color for option"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_option_changed[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "option_changed", "color", - N_("color for option if value is changed"), - NULL, 0, 0, "brown", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_option_changed[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "option_changed_selected", "color", - N_("color for option if value is changed on the selected line"), - NULL, 0, 0, "yellow", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_option[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "option_selected", "color", - N_("color for option on the selected line"), - NULL, 0, 0, "white", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_parent_name[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "parent_name", "color", - N_("color for name of parent option"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_parent_name[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "parent_name_selected", "color", - N_("color for name of parent option on the selected line"), - NULL, 0, 0, "white", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_parent_value[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "parent_value", "color", - N_("color for value of parent option"), - NULL, 0, 0, "cyan", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_parent_value[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "parent_value_selected", "color", - N_("color for value of parent option on the selected line"), - NULL, 0, 0, "lightcyan", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_quotes[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "quotes", "color", - N_("color for quotes around string values"), - NULL, 0, 0, "darkgray", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_quotes_changed[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "quotes_changed", "color", - N_("color for quotes around string values which are changed"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_quotes_changed[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "quotes_changed_selected", "color", - N_("color for quotes around string values which are changed " - "on the selected line"), - NULL, 0, 0, "white", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_quotes[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "quotes_selected", "color", - N_("color for quotes around string values on the selected line"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_section[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "section", "color", - N_("color for section"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_section_changed[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "section_changed", "color", - N_("color for section if value is changed"), - NULL, 0, 0, "brown", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_section_changed[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "section_changed_selected", "color", - N_("color for section if value is changed on the selected line"), - NULL, 0, 0, "yellow", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_section[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "section_selected", "color", - N_("color for section on the selected line"), - NULL, 0, 0, "white", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_string_values[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "string_values", "color", - N_("color for string values"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_string_values[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "string_values_selected", "color", - N_("color for string values on the selected line"), - NULL, 0, 0, "white", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_title_count_options = weechat_config_new_option ( - fset_config_file, ptr_section, - "title_count_options", "color", - N_("color for the count of options found with the current filter " - "in title of buffer"), - NULL, 0, 0, "cyan", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_title_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_title_current_option = weechat_config_new_option ( - fset_config_file, ptr_section, - "title_current_option", "color", - N_("color for current option number in title of buffer"), - NULL, 0, 0, "lightcyan", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_title_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_title_filter = weechat_config_new_option ( - fset_config_file, ptr_section, - "title_filter", "color", - N_("color for filter in title of buffer"), - NULL, 0, 0, "yellow", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_title_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_title_marked_options = weechat_config_new_option ( - fset_config_file, ptr_section, - "title_marked_options", "color", - N_("color for number of marked options in title of buffer"), - NULL, 0, 0, "lightgreen", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_title_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_title_sort = weechat_config_new_option ( - fset_config_file, ptr_section, - "title_sort", "color", - N_("color for sort in title of buffer"), - NULL, 0, 0, "white", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_title_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_type[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "type", "color", - N_("color for type"), - NULL, 0, 0, "green", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_type[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "type_selected", "color", - N_("color for type on the selected line"), - NULL, 0, 0, "lightgreen", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_unmarked[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "unmarked", "color", - N_("color for mark indicator when the option is not marked"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_unmarked[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "unmarked_selected", "color", - N_("color for mark indicator when the option is not marked " - "on the selected line"), - NULL, 0, 0, "white", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_value[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "value", "color", - N_("color for value"), - NULL, 0, 0, "cyan", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_value_changed[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "value_changed", "color", - N_("color for value changed (different from default)"), - NULL, 0, 0, "brown", NULL, 0, - NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_value_changed[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "value_changed_selected", "color", - N_("color for value changed (different from default) on the selected " - "line"), - NULL, 0, 0, "yellow", NULL, 0, + /* color */ + fset_config_section_color = weechat_config_new_section ( + fset_config_file, "color", + 0, 0, NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_value[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "value_selected", "color", - N_("color for value on the selected line"), - NULL, 0, 0, "lightcyan", NULL, 0, NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_value_undef[0] = weechat_config_new_option ( - fset_config_file, ptr_section, - "value_undef", "color", - N_("color for undefined value"), - NULL, 0, 0, "magenta", NULL, 0, NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, - NULL, NULL, NULL); - fset_config_color_value_undef[1] = weechat_config_new_option ( - fset_config_file, ptr_section, - "value_undef_selected", "color", - N_("color for undefined value on the selected line"), - NULL, 0, 0, "lightmagenta", NULL, 0, NULL, NULL, NULL, - &fset_config_change_color_cb, NULL, NULL, NULL, NULL, NULL); + if (fset_config_section_color) + { + fset_config_color_default_value[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "default_value", "color", + N_("color for default value"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_default_value[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "default_value_selected", "color", + N_("color for default value on the selected line"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_description[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "description", "color", + N_("color for description"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_description[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "description_selected", "color", + N_("color for description on the selected line"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_file[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "file", "color", + N_("color for file"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_file_changed[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "file_changed", "color", + N_("color for file if value is changed"), + NULL, 0, 0, "brown", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_file_changed[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "file_changed_selected", "color", + N_("color for file if value is changed on the selected line"), + NULL, 0, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_file[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "file_selected", "color", + N_("color for file on the selected line"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_help_default_value = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "help_default_value", "color", + N_("color for default value in help bar"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_help_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_help_description = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "help_description", "color", + N_("color for description in help bar"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_help_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_help_name = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "help_name", "color", + N_("color for name in help bar"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_help_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_help_quotes = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "help_quotes", "color", + N_("color for quotes around string values"), + NULL, 0, 0, "darkgray", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_help_values = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "help_values", "color", + N_("color for allowed values"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_index[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "index", "color", + N_("color for index of option"), + NULL, 0, 0, "cyan", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_index[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "index_selected", "color", + N_("color for index of option on the selected line"), + NULL, 0, 0, "lightcyan", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_line_marked_bg[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "line_marked_bg1", "color", + N_("background color for a marked line " + "(used with the first format, see option fset.format.option1)"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_line_marked_bg[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "line_marked_bg2", "color", + N_("background color for a marked line " + "(used with the second format, see option fset.format.option2)"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_line_selected_bg[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "line_selected_bg1", "color", + N_("background color for the selected line " + "(used with the first format, see option fset.format.option1)"), + NULL, 0, 0, "blue", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_line_selected_bg[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "line_selected_bg2", "color", + N_("background color for the selected line " + "(used with the second format, see option fset.format.option2)"), + NULL, 0, 0, "red", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_marked[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "marked", "color", + N_("color for mark indicator"), + NULL, 0, 0, "brown", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_marked[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "marked_selected", "color", + N_("color for mark indicator on the selected line"), + NULL, 0, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_max[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "max", "color", + N_("color for max value"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_max[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "max_selected", "color", + N_("color for max value on the selected line"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_min[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "min", "color", + N_("color for min value"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_min[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "min_selected", "color", + N_("color for min value on the selected line"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_name[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "name", "color", + N_("color for name"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_name_changed[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "name_changed", "color", + N_("color for name if value is changed"), + NULL, 0, 0, "brown", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_name_changed[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "name_changed_selected", "color", + N_("color for name if value is changed on the selected line"), + NULL, 0, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_name[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "name_selected", "color", + N_("color for name on the selected line"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_option[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "option", "color", + N_("color for option"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_option_changed[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "option_changed", "color", + N_("color for option if value is changed"), + NULL, 0, 0, "brown", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_option_changed[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "option_changed_selected", "color", + N_("color for option if value is changed on the selected line"), + NULL, 0, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_option[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "option_selected", "color", + N_("color for option on the selected line"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_parent_name[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "parent_name", "color", + N_("color for name of parent option"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_parent_name[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "parent_name_selected", "color", + N_("color for name of parent option on the selected line"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_parent_value[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "parent_value", "color", + N_("color for value of parent option"), + NULL, 0, 0, "cyan", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_parent_value[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "parent_value_selected", "color", + N_("color for value of parent option on the selected line"), + NULL, 0, 0, "lightcyan", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_quotes[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "quotes", "color", + N_("color for quotes around string values"), + NULL, 0, 0, "darkgray", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_quotes_changed[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "quotes_changed", "color", + N_("color for quotes around string values which are changed"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_quotes_changed[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "quotes_changed_selected", "color", + N_("color for quotes around string values which are changed " + "on the selected line"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_quotes[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "quotes_selected", "color", + N_("color for quotes around string values on the selected line"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_section[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "section", "color", + N_("color for section"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_section_changed[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "section_changed", "color", + N_("color for section if value is changed"), + NULL, 0, 0, "brown", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_section_changed[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "section_changed_selected", "color", + N_("color for section if value is changed on the selected line"), + NULL, 0, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_section[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "section_selected", "color", + N_("color for section on the selected line"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_string_values[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "string_values", "color", + N_("color for string values"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_string_values[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "string_values_selected", "color", + N_("color for string values on the selected line"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_title_count_options = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "title_count_options", "color", + N_("color for the count of options found with the current filter " + "in title of buffer"), + NULL, 0, 0, "cyan", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_title_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_title_current_option = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "title_current_option", "color", + N_("color for current option number in title of buffer"), + NULL, 0, 0, "lightcyan", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_title_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_title_filter = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "title_filter", "color", + N_("color for filter in title of buffer"), + NULL, 0, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_title_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_title_marked_options = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "title_marked_options", "color", + N_("color for number of marked options in title of buffer"), + NULL, 0, 0, "lightgreen", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_title_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_title_sort = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "title_sort", "color", + N_("color for sort in title of buffer"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_title_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_type[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "type", "color", + N_("color for type"), + NULL, 0, 0, "green", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_type[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "type_selected", "color", + N_("color for type on the selected line"), + NULL, 0, 0, "lightgreen", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_unmarked[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "unmarked", "color", + N_("color for mark indicator when the option is not marked"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_unmarked[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "unmarked_selected", "color", + N_("color for mark indicator when the option is not marked " + "on the selected line"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_value[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "value", "color", + N_("color for value"), + NULL, 0, 0, "cyan", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_value_changed[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "value_changed", "color", + N_("color for value changed (different from default)"), + NULL, 0, 0, "brown", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_value_changed[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "value_changed_selected", "color", + N_("color for value changed (different from default) on the " + "selected line"), + NULL, 0, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_value[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "value_selected", "color", + N_("color for value on the selected line"), + NULL, 0, 0, "lightcyan", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_value_undef[0] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "value_undef", "color", + N_("color for undefined value"), + NULL, 0, 0, "magenta", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + fset_config_color_value_undef[1] = weechat_config_new_option ( + fset_config_file, fset_config_section_color, + "value_undef_selected", "color", + N_("color for undefined value on the selected line"), + NULL, 0, 0, "lightmagenta", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_color_cb, NULL, NULL, + NULL, NULL, NULL); + } return 1; } diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index 57304bf38..bc243b15f 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -42,8 +42,15 @@ struct t_config_file *irc_config_file = NULL; + +/* sections */ + +struct t_config_section *irc_config_section_look = NULL; +struct t_config_section *irc_config_section_color = NULL; +struct t_config_section *irc_config_section_network = NULL; struct t_config_section *irc_config_section_msgbuffer = NULL; struct t_config_section *irc_config_section_ctcp = NULL; +struct t_config_section *irc_config_section_ignore = NULL; struct t_config_section *irc_config_section_server_default = NULL; struct t_config_section *irc_config_section_server = NULL; @@ -51,119 +58,122 @@ int irc_config_loading = 0; /* IRC config, look section */ -struct t_config_option *irc_config_look_buffer_open_before_autojoin; -struct t_config_option *irc_config_look_buffer_open_before_join; -struct t_config_option *irc_config_look_buffer_switch_autojoin; -struct t_config_option *irc_config_look_buffer_switch_join; -struct t_config_option *irc_config_look_color_nicks_in_names; -struct t_config_option *irc_config_look_color_nicks_in_nicklist; -struct t_config_option *irc_config_look_color_nicks_in_server_messages; -struct t_config_option *irc_config_look_color_pv_nick_like_channel; -struct t_config_option *irc_config_look_ctcp_time_format; -struct t_config_option *irc_config_look_display_account_message; -struct t_config_option *irc_config_look_display_away; -struct t_config_option *irc_config_look_display_ctcp_blocked; -struct t_config_option *irc_config_look_display_ctcp_reply; -struct t_config_option *irc_config_look_display_ctcp_unknown; -struct t_config_option *irc_config_look_display_extended_join; -struct t_config_option *irc_config_look_display_host_join; -struct t_config_option *irc_config_look_display_host_join_local; -struct t_config_option *irc_config_look_display_host_quit; -struct t_config_option *irc_config_look_display_join_message; -struct t_config_option *irc_config_look_display_old_topic; -struct t_config_option *irc_config_look_display_pv_away_once; -struct t_config_option *irc_config_look_display_pv_back; -struct t_config_option *irc_config_look_display_pv_nick_change; -struct t_config_option *irc_config_look_display_pv_warning_address; -struct t_config_option *irc_config_look_highlight_channel; -struct t_config_option *irc_config_look_highlight_pv; -struct t_config_option *irc_config_look_highlight_server; -struct t_config_option *irc_config_look_highlight_tags_restrict; -struct t_config_option *irc_config_look_item_channel_modes_hide_args; -struct t_config_option *irc_config_look_item_display_server; -struct t_config_option *irc_config_look_item_nick_modes; -struct t_config_option *irc_config_look_item_nick_prefix; -struct t_config_option *irc_config_look_join_auto_add_chantype; -struct t_config_option *irc_config_look_msgbuffer_fallback; -struct t_config_option *irc_config_look_new_channel_position; -struct t_config_option *irc_config_look_new_pv_position; -struct t_config_option *irc_config_look_nick_completion_smart; -struct t_config_option *irc_config_look_nick_mode; -struct t_config_option *irc_config_look_nick_mode_empty; -struct t_config_option *irc_config_look_nicks_hide_password; -struct t_config_option *irc_config_look_notice_as_pv; -struct t_config_option *irc_config_look_notice_welcome_redirect; -struct t_config_option *irc_config_look_notice_welcome_tags; -struct t_config_option *irc_config_look_notify_tags_ison; -struct t_config_option *irc_config_look_notify_tags_whois; -struct t_config_option *irc_config_look_part_closes_buffer; -struct t_config_option *irc_config_look_pv_buffer; -struct t_config_option *irc_config_look_pv_tags; -struct t_config_option *irc_config_look_raw_messages; -struct t_config_option *irc_config_look_typing_status_nicks; -struct t_config_option *irc_config_look_typing_status_self; -struct t_config_option *irc_config_look_server_buffer; -struct t_config_option *irc_config_look_smart_filter; -struct t_config_option *irc_config_look_smart_filter_account; -struct t_config_option *irc_config_look_smart_filter_chghost; -struct t_config_option *irc_config_look_smart_filter_delay; -struct t_config_option *irc_config_look_smart_filter_join; -struct t_config_option *irc_config_look_smart_filter_join_unmask; -struct t_config_option *irc_config_look_smart_filter_mode; -struct t_config_option *irc_config_look_smart_filter_nick; -struct t_config_option *irc_config_look_smart_filter_quit; -struct t_config_option *irc_config_look_smart_filter_setname; -struct t_config_option *irc_config_look_temporary_servers; -struct t_config_option *irc_config_look_topic_strip_colors; +struct t_config_option *irc_config_look_buffer_open_before_autojoin = NULL; +struct t_config_option *irc_config_look_buffer_open_before_join = NULL; +struct t_config_option *irc_config_look_buffer_switch_autojoin = NULL; +struct t_config_option *irc_config_look_buffer_switch_join = NULL; +struct t_config_option *irc_config_look_color_nicks_in_names = NULL; +struct t_config_option *irc_config_look_color_nicks_in_nicklist = NULL; +struct t_config_option *irc_config_look_color_nicks_in_server_messages = NULL; +struct t_config_option *irc_config_look_color_pv_nick_like_channel = NULL; +struct t_config_option *irc_config_look_ctcp_time_format = NULL; +struct t_config_option *irc_config_look_display_account_message = NULL; +struct t_config_option *irc_config_look_display_away = NULL; +struct t_config_option *irc_config_look_display_ctcp_blocked = NULL; +struct t_config_option *irc_config_look_display_ctcp_reply = NULL; +struct t_config_option *irc_config_look_display_ctcp_unknown = NULL; +struct t_config_option *irc_config_look_display_extended_join = NULL; +struct t_config_option *irc_config_look_display_host_join = NULL; +struct t_config_option *irc_config_look_display_host_join_local = NULL; +struct t_config_option *irc_config_look_display_host_quit = NULL; +struct t_config_option *irc_config_look_display_join_message = NULL; +struct t_config_option *irc_config_look_display_old_topic = NULL; +struct t_config_option *irc_config_look_display_pv_away_once = NULL; +struct t_config_option *irc_config_look_display_pv_back = NULL; +struct t_config_option *irc_config_look_display_pv_nick_change = NULL; +struct t_config_option *irc_config_look_display_pv_warning_address = NULL; +struct t_config_option *irc_config_look_highlight_channel = NULL; +struct t_config_option *irc_config_look_highlight_pv = NULL; +struct t_config_option *irc_config_look_highlight_server = NULL; +struct t_config_option *irc_config_look_highlight_tags_restrict = NULL; +struct t_config_option *irc_config_look_item_channel_modes_hide_args = NULL; +struct t_config_option *irc_config_look_item_display_server = NULL; +struct t_config_option *irc_config_look_item_nick_modes = NULL; +struct t_config_option *irc_config_look_item_nick_prefix = NULL; +struct t_config_option *irc_config_look_join_auto_add_chantype = NULL; +struct t_config_option *irc_config_look_msgbuffer_fallback = NULL; +struct t_config_option *irc_config_look_new_channel_position = NULL; +struct t_config_option *irc_config_look_new_pv_position = NULL; +struct t_config_option *irc_config_look_nick_completion_smart = NULL; +struct t_config_option *irc_config_look_nick_mode = NULL; +struct t_config_option *irc_config_look_nick_mode_empty = NULL; +struct t_config_option *irc_config_look_nicks_hide_password = NULL; +struct t_config_option *irc_config_look_notice_as_pv = NULL; +struct t_config_option *irc_config_look_notice_welcome_redirect = NULL; +struct t_config_option *irc_config_look_notice_welcome_tags = NULL; +struct t_config_option *irc_config_look_notify_tags_ison = NULL; +struct t_config_option *irc_config_look_notify_tags_whois = NULL; +struct t_config_option *irc_config_look_part_closes_buffer = NULL; +struct t_config_option *irc_config_look_pv_buffer = NULL; +struct t_config_option *irc_config_look_pv_tags = NULL; +struct t_config_option *irc_config_look_raw_messages = NULL; +struct t_config_option *irc_config_look_typing_status_nicks = NULL; +struct t_config_option *irc_config_look_typing_status_self = NULL; +struct t_config_option *irc_config_look_server_buffer = NULL; +struct t_config_option *irc_config_look_smart_filter = NULL; +struct t_config_option *irc_config_look_smart_filter_account = NULL; +struct t_config_option *irc_config_look_smart_filter_chghost = NULL; +struct t_config_option *irc_config_look_smart_filter_delay = NULL; +struct t_config_option *irc_config_look_smart_filter_join = NULL; +struct t_config_option *irc_config_look_smart_filter_join_unmask = NULL; +struct t_config_option *irc_config_look_smart_filter_mode = NULL; +struct t_config_option *irc_config_look_smart_filter_nick = NULL; +struct t_config_option *irc_config_look_smart_filter_quit = NULL; +struct t_config_option *irc_config_look_smart_filter_setname = NULL; +struct t_config_option *irc_config_look_temporary_servers = NULL; +struct t_config_option *irc_config_look_topic_strip_colors = NULL; /* IRC config, color section */ -struct t_config_option *irc_config_color_input_nick; -struct t_config_option *irc_config_color_item_channel_modes; -struct t_config_option *irc_config_color_item_lag_counting; -struct t_config_option *irc_config_color_item_lag_finished; -struct t_config_option *irc_config_color_item_nick_modes; -struct t_config_option *irc_config_color_item_tls_version_deprecated; -struct t_config_option *irc_config_color_item_tls_version_insecure; -struct t_config_option *irc_config_color_item_tls_version_ok; -struct t_config_option *irc_config_color_message_account; -struct t_config_option *irc_config_color_message_join; -struct t_config_option *irc_config_color_message_chghost; -struct t_config_option *irc_config_color_message_join; -struct t_config_option *irc_config_color_message_kick; -struct t_config_option *irc_config_color_message_quit; -struct t_config_option *irc_config_color_message_setname; -struct t_config_option *irc_config_color_mirc_remap; -struct t_config_option *irc_config_color_nick_prefixes; -struct t_config_option *irc_config_color_notice; -struct t_config_option *irc_config_color_reason_kick; -struct t_config_option *irc_config_color_reason_quit; -struct t_config_option *irc_config_color_topic_current; -struct t_config_option *irc_config_color_topic_new; -struct t_config_option *irc_config_color_topic_old; +struct t_config_option *irc_config_color_input_nick = NULL; +struct t_config_option *irc_config_color_item_channel_modes = NULL; +struct t_config_option *irc_config_color_item_lag_counting = NULL; +struct t_config_option *irc_config_color_item_lag_finished = NULL; +struct t_config_option *irc_config_color_item_nick_modes = NULL; +struct t_config_option *irc_config_color_item_tls_version_deprecated = NULL; +struct t_config_option *irc_config_color_item_tls_version_insecure = NULL; +struct t_config_option *irc_config_color_item_tls_version_ok = NULL; +struct t_config_option *irc_config_color_message_account = NULL; +struct t_config_option *irc_config_color_message_chghost = NULL; +struct t_config_option *irc_config_color_message_join = NULL; +struct t_config_option *irc_config_color_message_kick = NULL; +struct t_config_option *irc_config_color_message_quit = NULL; +struct t_config_option *irc_config_color_message_setname = NULL; +struct t_config_option *irc_config_color_mirc_remap = NULL; +struct t_config_option *irc_config_color_nick_prefixes = NULL; +struct t_config_option *irc_config_color_notice = NULL; +struct t_config_option *irc_config_color_reason_kick = NULL; +struct t_config_option *irc_config_color_reason_quit = NULL; +struct t_config_option *irc_config_color_topic_current = NULL; +struct t_config_option *irc_config_color_topic_new = NULL; +struct t_config_option *irc_config_color_topic_old = NULL; /* IRC config, network section */ -struct t_config_option *irc_config_network_autoreconnect_delay_growing; -struct t_config_option *irc_config_network_autoreconnect_delay_max; -struct t_config_option *irc_config_network_ban_mask_default; -struct t_config_option *irc_config_network_colors_receive; -struct t_config_option *irc_config_network_colors_send; -struct t_config_option *irc_config_network_lag_check; -struct t_config_option *irc_config_network_lag_max; -struct t_config_option *irc_config_network_lag_min_show; -struct t_config_option *irc_config_network_lag_reconnect; -struct t_config_option *irc_config_network_lag_refresh_interval; -struct t_config_option *irc_config_network_notify_check_ison; -struct t_config_option *irc_config_network_notify_check_whois; -struct t_config_option *irc_config_network_sasl_fail_unavailable; -struct t_config_option *irc_config_network_send_unknown_commands; -struct t_config_option *irc_config_network_whois_double_nick; +struct t_config_option *irc_config_network_autoreconnect_delay_growing = NULL; +struct t_config_option *irc_config_network_autoreconnect_delay_max = NULL; +struct t_config_option *irc_config_network_ban_mask_default = NULL; +struct t_config_option *irc_config_network_colors_receive = NULL; +struct t_config_option *irc_config_network_colors_send = NULL; +struct t_config_option *irc_config_network_lag_check = NULL; +struct t_config_option *irc_config_network_lag_max = NULL; +struct t_config_option *irc_config_network_lag_min_show = NULL; +struct t_config_option *irc_config_network_lag_reconnect = NULL; +struct t_config_option *irc_config_network_lag_refresh_interval = NULL; +struct t_config_option *irc_config_network_notify_check_ison = NULL; +struct t_config_option *irc_config_network_notify_check_whois = NULL; +struct t_config_option *irc_config_network_sasl_fail_unavailable = NULL; +struct t_config_option *irc_config_network_send_unknown_commands = NULL; +struct t_config_option *irc_config_network_whois_double_nick = NULL; /* IRC config, server section */ -struct t_config_option *irc_config_server_default[IRC_SERVER_NUM_OPTIONS]; - +struct t_config_option *irc_config_server_default[IRC_SERVER_NUM_OPTIONS] = { + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +}; struct t_hook *irc_config_hook_config_nick_color_options = NULL; struct t_hook *irc_config_hook_config_chat_nick_colors = NULL; struct t_hashtable *irc_config_hashtable_display_join_message = NULL; @@ -2751,8 +2761,6 @@ irc_config_server_create_default_options (struct t_config_section *section) int irc_config_init () { - struct t_config_section *ptr_section; - irc_config_hashtable_display_join_message = weechat_hashtable_new ( 32, WEECHAT_HASHTABLE_STRING, @@ -2775,858 +2783,857 @@ irc_config_init () return 0; /* look */ - ptr_section = weechat_config_new_section (irc_config_file, "look", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (irc_config_file); - irc_config_file = NULL; - return 0; - } - - irc_config_look_buffer_open_before_autojoin = weechat_config_new_option ( - irc_config_file, ptr_section, - "buffer_open_before_autojoin", "boolean", - N_("open channel buffer before the JOIN is received from server " - "when it is auto joined (with server option \"autojoin\"); " - "this is useful to open channels with always the same buffer " - "numbers on startup"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_buffer_open_before_join = weechat_config_new_option ( - irc_config_file, ptr_section, - "buffer_open_before_join", "boolean", - N_("open channel buffer before the JOIN is received from server " - "when it is manually joined (with /join command)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_buffer_switch_autojoin = weechat_config_new_option ( - irc_config_file, ptr_section, - "buffer_switch_autojoin", "boolean", - N_("auto switch to channel buffer when it is auto joined (with " - "server option \"autojoin\")"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_buffer_switch_join = weechat_config_new_option ( - irc_config_file, ptr_section, - "buffer_switch_join", "boolean", - N_("auto switch to channel buffer when it is manually joined " - "(with /join command)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_color_nicks_in_names = weechat_config_new_option ( - irc_config_file, ptr_section, - "color_nicks_in_names", "boolean", - N_("use nick color in output of /names (or list of nicks displayed " - "when joining a channel)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_color_nicks_in_nicklist = weechat_config_new_option ( - irc_config_file, ptr_section, - "color_nicks_in_nicklist", "boolean", - N_("use nick color in nicklist"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, - &irc_config_change_look_color_nicks_in_nicklist, NULL, NULL, - NULL, NULL, NULL); - irc_config_look_color_nicks_in_server_messages = weechat_config_new_option ( - irc_config_file, ptr_section, - "color_nicks_in_server_messages", "boolean", - N_("use nick color in messages from server"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_color_pv_nick_like_channel = weechat_config_new_option ( - irc_config_file, ptr_section, - "color_pv_nick_like_channel", "boolean", - N_("use same nick color for channel and private"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_ctcp_time_format = weechat_config_new_option ( - irc_config_file, ptr_section, - "ctcp_time_format", "string", - N_("time format used in answer to message CTCP TIME (see man strftime " - "for date/time specifiers)"), - NULL, 0, 0, "%a, %d %b %Y %T %z", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_display_account_message = weechat_config_new_option ( - irc_config_file, ptr_section, - "display_account_message", "boolean", - N_("display ACCOUNT messages received when capability account-notify " - "is enabled"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_display_away = weechat_config_new_option ( - irc_config_file, ptr_section, - "display_away", "integer", - N_("display message when (un)marking as away (off: do not display/send " - "anything, local: display locally, channel: send action to channels)"), - "off|local|channel", 0, 0, "local", NULL, 0, - NULL, NULL, NULL, - &irc_config_change_look_display_away, NULL, NULL, - NULL, NULL, NULL); - irc_config_look_display_ctcp_blocked = weechat_config_new_option ( - irc_config_file, ptr_section, - "display_ctcp_blocked", "boolean", - N_("display CTCP message even if it is blocked"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_display_ctcp_reply = weechat_config_new_option ( - irc_config_file, ptr_section, - "display_ctcp_reply", "boolean", - N_("display CTCP reply sent by WeeChat"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_display_ctcp_unknown = weechat_config_new_option ( - irc_config_file, ptr_section, - "display_ctcp_unknown", "boolean", - N_("display CTCP message even if it is unknown CTCP"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_display_extended_join = weechat_config_new_option ( - irc_config_file, ptr_section, - "display_extended_join", "boolean", - N_("display extra information in the JOIN messages: account name " - "and real name (capability extended-join must be enabled)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_display_host_join = weechat_config_new_option ( - irc_config_file, ptr_section, - "display_host_join", "boolean", - N_("display host in join messages"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_display_host_join_local = weechat_config_new_option ( - irc_config_file, ptr_section, - "display_host_join_local", "boolean", - N_("display host in join messages from local client"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_display_host_quit = weechat_config_new_option ( - irc_config_file, ptr_section, - "display_host_quit", "boolean", - N_("display host in part/quit messages"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_display_join_message = weechat_config_new_option ( - irc_config_file, ptr_section, - "display_join_message", "string", - N_("comma-separated list of messages to display after joining a " - "channel: 324 = channel modes, 329 = channel creation date, " - "332 = topic, 333 = nick/date for topic, 353 = names on channel, " - "366 = names count"), - NULL, 0, 0, "329,332,333,366", NULL, 0, - NULL, NULL, NULL, - &irc_config_change_look_display_join_message, NULL, NULL, - NULL, NULL, NULL); - irc_config_look_display_old_topic = weechat_config_new_option ( - irc_config_file, ptr_section, - "display_old_topic", "boolean", - N_("display old topic when channel topic is changed"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_display_pv_away_once = weechat_config_new_option ( - irc_config_file, ptr_section, - "display_pv_away_once", "boolean", - N_("display remote away message only once in private"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_display_pv_back = weechat_config_new_option ( - irc_config_file, ptr_section, - "display_pv_back", "boolean", - N_("display a message in private when user is back (after quit on " - "server)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_display_pv_nick_change = weechat_config_new_option ( - irc_config_file, ptr_section, - "display_pv_nick_change", "boolean", - N_("display nick change in private"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_display_pv_warning_address = weechat_config_new_option ( - irc_config_file, ptr_section, - "display_pv_warning_address", "boolean", - N_("display a warning in private buffer if the address of remote nick " - "has changed; this option is disabled by default because servers " - "like bitlbee are causing this warning to be displayed when it is " - "not expected (the address of remote nick changes multiple times " - "on login)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_highlight_channel = weechat_config_new_option ( - irc_config_file, ptr_section, - "highlight_channel", "string", - N_("comma separated list of words to highlight in channel buffers " - "(case insensitive, use \"(?-i)\" at beginning of words to " - "make them case sensitive; special variables $nick, $channel and " - "$server are replaced by their values), these words are added to " - "buffer property \"highlight_words\" only when buffer is created " - "(it does not affect current buffers), an empty string disables " - "default highlight on nick, examples: \"$nick\", \"(?-i)$nick\""), - NULL, 0, 0, "$nick", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_highlight_pv = weechat_config_new_option ( - irc_config_file, ptr_section, - "highlight_pv", "string", - N_("comma separated list of words to highlight in private buffers " - "(case insensitive, use \"(?-i)\" at beginning of words to " - "make them case sensitive; special variables $nick, $channel and " - "$server are replaced by their values), these words are added to " - "buffer property \"highlight_words\" only when buffer is created " - "(it does not affect current buffers), an empty string disables " - "default highlight on nick, examples: \"$nick\", \"(?-i)$nick\""), - NULL, 0, 0, "$nick", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_highlight_server = weechat_config_new_option ( - irc_config_file, ptr_section, - "highlight_server", "string", - N_("comma separated list of words to highlight in server buffers " - "(case insensitive, use \"(?-i)\" at beginning of words to " - "make them case sensitive; special variables $nick, $channel and " - "$server are replaced by their values), these words are added to " - "buffer property \"highlight_words\" only when buffer is created " - "(it does not affect current buffers), an empty string disables " - "default highlight on nick, examples: \"$nick\", \"(?-i)$nick\""), - NULL, 0, 0, "$nick", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_highlight_tags_restrict = weechat_config_new_option ( - irc_config_file, ptr_section, - "highlight_tags_restrict", "string", - N_("restrict highlights to these tags on irc buffers (to have " - "highlight on user messages but not server messages); tags " - "must be separated by a comma and \"+\" can be used to make a " - "logical \"and\" between tags; wildcard \"*\" is allowed in tags; " - "an empty value allows highlight on any tag"), - NULL, 0, 0, "irc_privmsg,irc_notice", NULL, 0, - NULL, NULL, NULL, - &irc_config_change_look_highlight_tags_restrict, NULL, NULL, - NULL, NULL, NULL); - irc_config_look_item_channel_modes_hide_args = weechat_config_new_option ( - irc_config_file, ptr_section, - "item_channel_modes_hide_args", "string", - N_("hide channel modes arguments if at least one of these modes is in " - "channel modes (\"*\" to always hide all arguments, empty value to " - "never hide arguments); example: \"kf\" to hide arguments if \"k\" " - "or \"f\" are in channel modes"), - NULL, 0, 0, "k", NULL, 0, - NULL, NULL, NULL, - &irc_config_change_look_item_channel_modes_hide_args, NULL, NULL, - NULL, NULL, NULL); - irc_config_look_item_display_server = weechat_config_new_option ( - irc_config_file, ptr_section, - "item_display_server", "integer", - N_("name of bar item where IRC server is displayed (for status bar)"), - "buffer_plugin|buffer_name", 0, 0, "buffer_plugin", NULL, 0, - NULL, NULL, NULL, - &irc_config_change_look_item_display_server, NULL, NULL, - NULL, NULL, NULL); - irc_config_look_item_nick_modes = weechat_config_new_option ( - irc_config_file, ptr_section, - "item_nick_modes", "boolean", - N_("display nick modes in bar item \"input_prompt\""), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &irc_config_change_bar_item_input_prompt, NULL, NULL, - NULL, NULL, NULL); - irc_config_look_item_nick_prefix = weechat_config_new_option ( - irc_config_file, ptr_section, - "item_nick_prefix", "boolean", - N_("display nick prefix in bar item \"input_prompt\""), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, - &irc_config_change_bar_item_input_prompt, NULL, NULL, - NULL, NULL, NULL); - irc_config_look_join_auto_add_chantype = weechat_config_new_option ( - irc_config_file, ptr_section, - "join_auto_add_chantype", "boolean", - N_("automatically add channel type in front of channel name on " - "command /join if the channel name does not start with a valid " - "channel type for the server; for example: \"/join weechat\" will " - "in fact send: \"/join #weechat\""), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_msgbuffer_fallback = weechat_config_new_option ( - irc_config_file, ptr_section, - "msgbuffer_fallback", "integer", - N_("default target buffer for msgbuffer options when target is " - "private and that private buffer is not found"), - "current|server", 0, 0, "current", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_new_channel_position = weechat_config_new_option ( - irc_config_file, ptr_section, - "new_channel_position", "integer", - N_("force position of new channel in list of buffers " - "(none = default position (should be last buffer), " - "next = current buffer + 1, near_server = after last channel/pv " - "of server)"), - "none|next|near_server", 0, 0, "none", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_new_pv_position = weechat_config_new_option ( - irc_config_file, ptr_section, - "new_pv_position", "integer", - N_("force position of new private in list of buffers " - "(none = default position (should be last buffer), " - "next = current buffer + 1, near_server = after last channel/pv " - "of server)"), - "none|next|near_server", 0, 0, "none", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_nick_completion_smart = weechat_config_new_option ( - irc_config_file, ptr_section, - "nick_completion_smart", "integer", - N_("smart completion for nicks (completes first with last speakers): " - "speakers = all speakers (including highlights), " - "speakers_highlights = only speakers with highlight"), - "off|speakers|speakers_highlights", 0, 0, "speakers", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_nick_mode = weechat_config_new_option ( - irc_config_file, ptr_section, - "nick_mode", "integer", - N_("display nick mode (op, voice, ...) before nick (none = never, " - "prefix = in prefix only (default), action = in action messages " - "only, both = prefix + action messages)"), - "none|prefix|action|both", 0, 0, "prefix", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_nick_mode_empty = weechat_config_new_option ( - irc_config_file, ptr_section, - "nick_mode_empty", "boolean", - N_("display a space if nick mode is enabled but nick has no mode (not " - "op, voice, ...)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, - &irc_config_change_bar_item_input_prompt, NULL, NULL, - NULL, NULL, NULL); - irc_config_look_nicks_hide_password = weechat_config_new_option ( - irc_config_file, ptr_section, - "nicks_hide_password", "string", - N_("comma separated list of nicks for which passwords will be hidden " - "when a message is sent, for example to hide password in message " - "displayed by \"/msg nickserv identify password\", example: " - "\"nickserv,nickbot\""), - NULL, 0, 0, "nickserv", NULL, 0, + irc_config_section_look = weechat_config_new_section ( + irc_config_file, "look", + 0, 0, NULL, NULL, NULL, - &irc_config_change_look_nicks_hide_password, NULL, NULL, - NULL, NULL, NULL); - irc_config_look_notice_as_pv = weechat_config_new_option ( - irc_config_file, ptr_section, - "notice_as_pv", "integer", - N_("display notices as private messages (if auto, use private buffer " - "if found)"), - "auto|never|always", 0, 0, "auto", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_notice_welcome_redirect = weechat_config_new_option ( - irc_config_file, ptr_section, - "notice_welcome_redirect", "boolean", - N_("automatically redirect channel welcome notices to the channel " - "buffer; such notices have the nick as target but a channel name " - "in beginning of notice message, for example the ENTRYMSG notices " - "sent by Atheme IRC Services which look like: " - "\"[#channel] Welcome to this channel...\""), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_notice_welcome_tags = weechat_config_new_option ( - irc_config_file, ptr_section, - "notice_welcome_tags", "string", - N_("comma separated list of tags used in a welcome notices redirected " - "to a channel, for example: \"notify_private\""), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_notify_tags_ison = weechat_config_new_option ( - irc_config_file, ptr_section, - "notify_tags_ison", "string", - N_("comma separated list of tags used in messages displayed by notify " - "when a nick joins or quits server (result of command ison or " - "monitor), for example: \"notify_message\", \"notify_private\" or " - "\"notify_highlight\""), - NULL, 0, 0, "notify_message", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_notify_tags_whois = weechat_config_new_option ( - irc_config_file, ptr_section, - "notify_tags_whois", "string", - N_("comma separated list of tags used in messages displayed by notify " - "when a nick away status changes (result of command whois), " - "for example: \"notify_message\", \"notify_private\" or " - "\"notify_highlight\""), - NULL, 0, 0, "notify_message", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_part_closes_buffer = weechat_config_new_option ( - irc_config_file, ptr_section, - "part_closes_buffer", "boolean", - N_("close buffer when /part is issued on a channel"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_pv_buffer = weechat_config_new_option ( - irc_config_file, ptr_section, - "pv_buffer", "integer", - N_("merge private buffers"), - "independent|merge_by_server|merge_all", 0, 0, "independent", NULL, 0, NULL, NULL, NULL, - &irc_config_change_look_pv_buffer, NULL, NULL, - NULL, NULL, NULL); - irc_config_look_pv_tags = weechat_config_new_option ( - irc_config_file, ptr_section, - "pv_tags", "string", - N_("comma separated list of tags used in private messages, for example: " - "\"notify_message\", \"notify_private\" or \"notify_highlight\""), - NULL, 0, 0, "notify_private", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_raw_messages = weechat_config_new_option ( - irc_config_file, ptr_section, - "raw_messages", "integer", - N_("number of raw messages to save in memory when raw data buffer is " - "closed (messages will be displayed when opening raw data buffer)"), - NULL, 0, 65535, "256", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_typing_status_nicks = weechat_config_new_option ( - irc_config_file, ptr_section, - "typing_status_nicks", "boolean", - N_("display nicks typing on the channel in bar item \"typing\" " - "(option typing.look.enabled_nicks must be enabled and capability " - "\"message-tags\" must be enabled on the server)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_typing_status_self = weechat_config_new_option ( - irc_config_file, ptr_section, - "typing_status_self", "boolean", - N_("send self typing status to channels so that other users see when " - "you are typing a message " - "(option typing.look.enabled_self must be enabled and capability " - "\"message-tags\" must be enabled on the server)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_server_buffer = weechat_config_new_option ( - irc_config_file, ptr_section, - "server_buffer", "integer", - N_("merge server buffers; this option has no effect if a layout " - "is saved and is conflicting with this value (see /help layout)"), - "merge_with_core|merge_without_core|independent", 0, 0, "merge_with_core", - NULL, 0, NULL, NULL, NULL, - &irc_config_change_look_server_buffer, NULL, NULL, - NULL, NULL, NULL); - irc_config_look_smart_filter = weechat_config_new_option ( - irc_config_file, ptr_section, - "smart_filter", "boolean", - N_("filter join/part/quit/nick messages for a nick if not speaking " - "for some minutes on channel (you must create a filter on tag " - "\"irc_smart_filter\", see /help filter)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_smart_filter_account = weechat_config_new_option ( - irc_config_file, ptr_section, - "smart_filter_account", "boolean", - /* TRANSLATORS: please do not translate "account" */ - N_("enable smart filter for \"account\" messages"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_smart_filter_chghost = weechat_config_new_option ( - irc_config_file, ptr_section, - "smart_filter_chghost", "boolean", - /* TRANSLATORS: please do not translate "chghost" */ - N_("enable smart filter for \"chghost\" messages"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_smart_filter_delay = weechat_config_new_option ( - irc_config_file, ptr_section, - "smart_filter_delay", "integer", - N_("delay for filtering join/part/quit messages (in minutes): if the " - "nick did not speak during the last N minutes, the join/part/quit is " - "filtered"), - NULL, 1, 60*24*7, "5", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_smart_filter_join = weechat_config_new_option ( - irc_config_file, ptr_section, - "smart_filter_join", "boolean", - /* TRANSLATORS: please do not translate "join" */ - N_("enable smart filter for \"join\" messages"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_smart_filter_join_unmask = weechat_config_new_option ( - irc_config_file, ptr_section, - "smart_filter_join_unmask", "integer", - N_("delay for unmasking a join message that was filtered with tag " - "\"irc_smart_filter\" (in minutes): if a nick has joined max N " - "minutes ago and then says something on channel (message, notice or " - "update on topic), the join is unmasked, as well as nick changes " - "after this join (0 = disable: never unmask a join)"), - NULL, 0, 60*24*7, "30", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_smart_filter_mode = weechat_config_new_option ( - irc_config_file, ptr_section, - "smart_filter_mode", "string", - /* TRANSLATORS: please do not translate "mode" */ - N_("enable smart filter for \"mode\" messages: \"*\" to filter all " - "modes, \"+\" to filter all modes in server prefixes (for example " - "\"ovh\"), \"xyz\" to filter only modes x/y/z, \"-xyz\" to filter " - "all modes but not x/y/z; examples: \"ovh\": filter modes o/v/h, " - "\"-bkl\": filter all modes but not b/k/l"), - NULL, 0, 0, "+", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_smart_filter_nick = weechat_config_new_option ( - irc_config_file, ptr_section, - "smart_filter_nick", "boolean", - /* TRANSLATORS: please do not translate "nick" */ - N_("enable smart filter for \"nick\" messages (nick changes)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_smart_filter_quit = weechat_config_new_option ( - irc_config_file, ptr_section, - "smart_filter_quit", "boolean", - /* TRANSLATORS: please do not translate "part" and "quit" */ - N_("enable smart filter for \"part\" and \"quit\" messages"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_smart_filter_setname = weechat_config_new_option ( - irc_config_file, ptr_section, - "smart_filter_setname", "boolean", - /* TRANSLATORS: please do not translate "setname" */ - N_("enable smart filter for \"setname\" messages"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_temporary_servers = weechat_config_new_option ( - irc_config_file, ptr_section, - "temporary_servers", "boolean", - N_("enable automatic addition of temporary servers with command " - "/connect"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_topic_strip_colors = weechat_config_new_option ( - irc_config_file, ptr_section, - "topic_strip_colors", "boolean", - N_("strip colors in topic (used only when displaying buffer title)"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, - &irc_config_change_look_topic_strip_colors, NULL, NULL, NULL, NULL, NULL); - - /* color */ - ptr_section = weechat_config_new_section (irc_config_file, "color", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) + if (irc_config_section_look) { - weechat_config_free (irc_config_file); - irc_config_file = NULL; - return 0; + irc_config_look_buffer_open_before_autojoin = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "buffer_open_before_autojoin", "boolean", + N_("open channel buffer before the JOIN is received from server " + "when it is auto joined (with server option \"autojoin\"); " + "this is useful to open channels with always the same buffer " + "numbers on startup"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_buffer_open_before_join = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "buffer_open_before_join", "boolean", + N_("open channel buffer before the JOIN is received from server " + "when it is manually joined (with /join command)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_buffer_switch_autojoin = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "buffer_switch_autojoin", "boolean", + N_("auto switch to channel buffer when it is auto joined (with " + "server option \"autojoin\")"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_buffer_switch_join = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "buffer_switch_join", "boolean", + N_("auto switch to channel buffer when it is manually joined " + "(with /join command)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_color_nicks_in_names = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "color_nicks_in_names", "boolean", + N_("use nick color in output of /names (or list of nicks displayed " + "when joining a channel)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_color_nicks_in_nicklist = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "color_nicks_in_nicklist", "boolean", + N_("use nick color in nicklist"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_look_color_nicks_in_nicklist, NULL, NULL, + NULL, NULL, NULL); + irc_config_look_color_nicks_in_server_messages = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "color_nicks_in_server_messages", "boolean", + N_("use nick color in messages from server"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_color_pv_nick_like_channel = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "color_pv_nick_like_channel", "boolean", + N_("use same nick color for channel and private"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_ctcp_time_format = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "ctcp_time_format", "string", + N_("time format used in answer to message CTCP TIME (see man " + "strftime for date/time specifiers)"), + NULL, 0, 0, "%a, %d %b %Y %T %z", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_display_account_message = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "display_account_message", "boolean", + N_("display ACCOUNT messages received when capability account-notify " + "is enabled"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_display_away = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "display_away", "integer", + N_("display message when (un)marking as away (off: do not " + "display/send anything, local: display locally, channel: send " + "action to channels)"), + "off|local|channel", 0, 0, "local", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_look_display_away, NULL, NULL, + NULL, NULL, NULL); + irc_config_look_display_ctcp_blocked = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "display_ctcp_blocked", "boolean", + N_("display CTCP message even if it is blocked"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_display_ctcp_reply = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "display_ctcp_reply", "boolean", + N_("display CTCP reply sent by WeeChat"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_display_ctcp_unknown = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "display_ctcp_unknown", "boolean", + N_("display CTCP message even if it is unknown CTCP"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_display_extended_join = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "display_extended_join", "boolean", + N_("display extra information in the JOIN messages: account name " + "and real name (capability extended-join must be enabled)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_display_host_join = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "display_host_join", "boolean", + N_("display host in join messages"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_display_host_join_local = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "display_host_join_local", "boolean", + N_("display host in join messages from local client"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_display_host_quit = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "display_host_quit", "boolean", + N_("display host in part/quit messages"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_display_join_message = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "display_join_message", "string", + N_("comma-separated list of messages to display after joining a " + "channel: 324 = channel modes, 329 = channel creation date, " + "332 = topic, 333 = nick/date for topic, 353 = names on channel, " + "366 = names count"), + NULL, 0, 0, "329,332,333,366", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_look_display_join_message, NULL, NULL, + NULL, NULL, NULL); + irc_config_look_display_old_topic = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "display_old_topic", "boolean", + N_("display old topic when channel topic is changed"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_display_pv_away_once = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "display_pv_away_once", "boolean", + N_("display remote away message only once in private"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_display_pv_back = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "display_pv_back", "boolean", + N_("display a message in private when user is back (after quit on " + "server)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_display_pv_nick_change = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "display_pv_nick_change", "boolean", + N_("display nick change in private"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_display_pv_warning_address = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "display_pv_warning_address", "boolean", + N_("display a warning in private buffer if the address of remote " + "nick has changed; this option is disabled by default because " + "servers like bitlbee are causing this warning to be displayed " + "when it is not expected (the address of remote nick changes " + "multiple times on login)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_highlight_channel = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "highlight_channel", "string", + N_("comma separated list of words to highlight in channel buffers " + "(case insensitive, use \"(?-i)\" at beginning of words to " + "make them case sensitive; special variables $nick, $channel and " + "$server are replaced by their values), these words are added to " + "buffer property \"highlight_words\" only when buffer is created " + "(it does not affect current buffers), an empty string disables " + "default highlight on nick, examples: \"$nick\", \"(?-i)$nick\""), + NULL, 0, 0, "$nick", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_highlight_pv = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "highlight_pv", "string", + N_("comma separated list of words to highlight in private buffers " + "(case insensitive, use \"(?-i)\" at beginning of words to " + "make them case sensitive; special variables $nick, $channel and " + "$server are replaced by their values), these words are added to " + "buffer property \"highlight_words\" only when buffer is created " + "(it does not affect current buffers), an empty string disables " + "default highlight on nick, examples: \"$nick\", \"(?-i)$nick\""), + NULL, 0, 0, "$nick", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_highlight_server = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "highlight_server", "string", + N_("comma separated list of words to highlight in server buffers " + "(case insensitive, use \"(?-i)\" at beginning of words to " + "make them case sensitive; special variables $nick, $channel and " + "$server are replaced by their values), these words are added to " + "buffer property \"highlight_words\" only when buffer is created " + "(it does not affect current buffers), an empty string disables " + "default highlight on nick, examples: \"$nick\", \"(?-i)$nick\""), + NULL, 0, 0, "$nick", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_highlight_tags_restrict = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "highlight_tags_restrict", "string", + N_("restrict highlights to these tags on irc buffers (to have " + "highlight on user messages but not server messages); tags " + "must be separated by a comma and \"+\" can be used to make a " + "logical \"and\" between tags; wildcard \"*\" is allowed in tags; " + "an empty value allows highlight on any tag"), + NULL, 0, 0, "irc_privmsg,irc_notice", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_look_highlight_tags_restrict, NULL, NULL, + NULL, NULL, NULL); + irc_config_look_item_channel_modes_hide_args = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "item_channel_modes_hide_args", "string", + N_("hide channel modes arguments if at least one of these modes is " + "in channel modes (\"*\" to always hide all arguments, empty " + "value to never hide arguments); example: \"kf\" to hide " + "arguments if \"k\" or \"f\" are in channel modes"), + NULL, 0, 0, "k", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_look_item_channel_modes_hide_args, NULL, NULL, + NULL, NULL, NULL); + irc_config_look_item_display_server = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "item_display_server", "integer", + N_("name of bar item where IRC server is displayed (for status bar)"), + "buffer_plugin|buffer_name", 0, 0, "buffer_plugin", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_look_item_display_server, NULL, NULL, + NULL, NULL, NULL); + irc_config_look_item_nick_modes = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "item_nick_modes", "boolean", + N_("display nick modes in bar item \"input_prompt\""), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_bar_item_input_prompt, NULL, NULL, + NULL, NULL, NULL); + irc_config_look_item_nick_prefix = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "item_nick_prefix", "boolean", + N_("display nick prefix in bar item \"input_prompt\""), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_bar_item_input_prompt, NULL, NULL, + NULL, NULL, NULL); + irc_config_look_join_auto_add_chantype = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "join_auto_add_chantype", "boolean", + N_("automatically add channel type in front of channel name on " + "command /join if the channel name does not start with a valid " + "channel type for the server; for example: \"/join weechat\" " + "will in fact send: \"/join #weechat\""), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_msgbuffer_fallback = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "msgbuffer_fallback", "integer", + N_("default target buffer for msgbuffer options when target is " + "private and that private buffer is not found"), + "current|server", 0, 0, "current", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_new_channel_position = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "new_channel_position", "integer", + N_("force position of new channel in list of buffers " + "(none = default position (should be last buffer), " + "next = current buffer + 1, near_server = after last channel/pv " + "of server)"), + "none|next|near_server", 0, 0, "none", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_new_pv_position = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "new_pv_position", "integer", + N_("force position of new private in list of buffers " + "(none = default position (should be last buffer), " + "next = current buffer + 1, near_server = after last channel/pv " + "of server)"), + "none|next|near_server", 0, 0, "none", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_nick_completion_smart = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "nick_completion_smart", "integer", + N_("smart completion for nicks (completes first with last speakers): " + "speakers = all speakers (including highlights), " + "speakers_highlights = only speakers with highlight"), + "off|speakers|speakers_highlights", 0, 0, "speakers", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_nick_mode = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "nick_mode", "integer", + N_("display nick mode (op, voice, ...) before nick (none = never, " + "prefix = in prefix only (default), action = in action messages " + "only, both = prefix + action messages)"), + "none|prefix|action|both", 0, 0, "prefix", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_nick_mode_empty = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "nick_mode_empty", "boolean", + N_("display a space if nick mode is enabled but nick has no mode " + "(not op, voice, ...)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_bar_item_input_prompt, NULL, NULL, + NULL, NULL, NULL); + irc_config_look_nicks_hide_password = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "nicks_hide_password", "string", + N_("comma separated list of nicks for which passwords will be " + "hidden when a message is sent, for example to hide password " + "in message displayed by \"/msg nickserv identify password\", " + "example: \"nickserv,nickbot\""), + NULL, 0, 0, "nickserv", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_look_nicks_hide_password, NULL, NULL, + NULL, NULL, NULL); + irc_config_look_notice_as_pv = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "notice_as_pv", "integer", + N_("display notices as private messages (if auto, use private " + "buffer if found)"), + "auto|never|always", 0, 0, "auto", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_notice_welcome_redirect = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "notice_welcome_redirect", "boolean", + N_("automatically redirect channel welcome notices to the channel " + "buffer; such notices have the nick as target but a channel name " + "in beginning of notice message, for example the ENTRYMSG " + "notices sent by Atheme IRC Services which look like: " + "\"[#channel] Welcome to this channel...\""), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_notice_welcome_tags = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "notice_welcome_tags", "string", + N_("comma separated list of tags used in a welcome notices " + "redirected to a channel, for example: \"notify_private\""), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_notify_tags_ison = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "notify_tags_ison", "string", + N_("comma separated list of tags used in messages displayed by " + "notify when a nick joins or quits server (result of command " + "ison or monitor), for example: \"notify_message\", " + "\"notify_private\" or \"notify_highlight\""), + NULL, 0, 0, "notify_message", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_notify_tags_whois = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "notify_tags_whois", "string", + N_("comma separated list of tags used in messages displayed by " + "notify when a nick away status changes (result of command " + "whois), for example: \"notify_message\", \"notify_private\" or " + "\"notify_highlight\""), + NULL, 0, 0, "notify_message", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_part_closes_buffer = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "part_closes_buffer", "boolean", + N_("close buffer when /part is issued on a channel"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_pv_buffer = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "pv_buffer", "integer", + N_("merge private buffers"), + "independent|merge_by_server|merge_all", 0, 0, "independent", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_look_pv_buffer, NULL, NULL, + NULL, NULL, NULL); + irc_config_look_pv_tags = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "pv_tags", "string", + N_("comma separated list of tags used in private messages, for " + "example: \"notify_message\", \"notify_private\" or " + "\"notify_highlight\""), + NULL, 0, 0, "notify_private", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_raw_messages = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "raw_messages", "integer", + N_("number of raw messages to save in memory when raw data buffer " + "is closed (messages will be displayed when opening raw data " + "buffer)"), + NULL, 0, 65535, "256", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_typing_status_nicks = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "typing_status_nicks", "boolean", + N_("display nicks typing on the channel in bar item \"typing\" " + "(option typing.look.enabled_nicks must be enabled and " + "capability \"message-tags\" must be enabled on the server)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_typing_status_self = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "typing_status_self", "boolean", + N_("send self typing status to channels so that other users see " + "when you are typing a message " + "(option typing.look.enabled_self must be enabled and capability " + "\"message-tags\" must be enabled on the server)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_server_buffer = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "server_buffer", "integer", + N_("merge server buffers; this option has no effect if a layout " + "is saved and is conflicting with this value (see /help layout)"), + "merge_with_core|merge_without_core|independent", 0, 0, "merge_with_core", + NULL, 0, + NULL, NULL, NULL, + &irc_config_change_look_server_buffer, NULL, NULL, + NULL, NULL, NULL); + irc_config_look_smart_filter = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "smart_filter", "boolean", + N_("filter join/part/quit/nick messages for a nick if not speaking " + "for some minutes on channel (you must create a filter on tag " + "\"irc_smart_filter\", see /help filter)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_smart_filter_account = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "smart_filter_account", "boolean", + /* TRANSLATORS: please do not translate "account" */ + N_("enable smart filter for \"account\" messages"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_smart_filter_chghost = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "smart_filter_chghost", "boolean", + /* TRANSLATORS: please do not translate "chghost" */ + N_("enable smart filter for \"chghost\" messages"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_smart_filter_delay = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "smart_filter_delay", "integer", + N_("delay for filtering join/part/quit messages (in minutes): if " + "the nick did not speak during the last N minutes, the " + "join/part/quit is filtered"), + NULL, 1, 60*24*7, "5", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_smart_filter_join = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "smart_filter_join", "boolean", + /* TRANSLATORS: please do not translate "join" */ + N_("enable smart filter for \"join\" messages"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_smart_filter_join_unmask = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "smart_filter_join_unmask", "integer", + N_("delay for unmasking a join message that was filtered with tag " + "\"irc_smart_filter\" (in minutes): if a nick has joined max N " + "minutes ago and then says something on channel (message, " + "notice or update on topic), the join is unmasked, as well as " + "nick changes after this join (0 = disable: never unmask a " + "join)"), + NULL, 0, 60*24*7, "30", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_smart_filter_mode = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "smart_filter_mode", "string", + /* TRANSLATORS: please do not translate "mode" */ + N_("enable smart filter for \"mode\" messages: \"*\" to filter all " + "modes, \"+\" to filter all modes in server prefixes (for example " + "\"ovh\"), \"xyz\" to filter only modes x/y/z, \"-xyz\" to filter " + "all modes but not x/y/z; examples: \"ovh\": filter modes o/v/h, " + "\"-bkl\": filter all modes but not b/k/l"), + NULL, 0, 0, "+", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_smart_filter_nick = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "smart_filter_nick", "boolean", + /* TRANSLATORS: please do not translate "nick" */ + N_("enable smart filter for \"nick\" messages (nick changes)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_smart_filter_quit = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "smart_filter_quit", "boolean", + /* TRANSLATORS: please do not translate "part" and "quit" */ + N_("enable smart filter for \"part\" and \"quit\" messages"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_smart_filter_setname = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "smart_filter_setname", "boolean", + /* TRANSLATORS: please do not translate "setname" */ + N_("enable smart filter for \"setname\" messages"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_temporary_servers = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "temporary_servers", "boolean", + N_("enable automatic addition of temporary servers with command " + "/connect"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_topic_strip_colors = weechat_config_new_option ( + irc_config_file, irc_config_section_look, + "topic_strip_colors", "boolean", + N_("strip colors in topic (used only when displaying buffer title)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_look_topic_strip_colors, NULL, NULL, + NULL, NULL, NULL); } - irc_config_color_input_nick = weechat_config_new_option ( - irc_config_file, ptr_section, - "input_nick", "color", - N_("color for nick in input bar"), - NULL, -1, 0, "lightcyan", NULL, 0, - NULL, NULL, NULL, - &irc_config_change_bar_item_input_prompt, NULL, NULL, - NULL, NULL, NULL); - irc_config_color_item_channel_modes = weechat_config_new_option ( - irc_config_file, ptr_section, - "item_channel_modes", "color", - N_("color for channel modes, near channel name"), - NULL, -1, 0, "default", NULL, 0, - NULL, NULL, NULL, - &irc_config_change_color_item_channel_modes, NULL, NULL, - NULL, NULL, NULL); - irc_config_color_item_lag_counting = weechat_config_new_option ( - irc_config_file, ptr_section, - "item_lag_counting", "color", - N_("color for lag indicator, when counting (pong not received from " - "server, lag is increasing)"), - NULL, -1, 0, "default", NULL, 0, - NULL, NULL, NULL, - &irc_config_change_color_item_lag, NULL, NULL, - NULL, NULL, NULL); - irc_config_color_item_lag_finished = weechat_config_new_option ( - irc_config_file, ptr_section, - "item_lag_finished", "color", - N_("color for lag indicator, when pong has been received from server"), - NULL, -1, 0, "yellow", NULL, 0, - NULL, NULL, NULL, - &irc_config_change_color_item_lag, NULL, NULL, - NULL, NULL, NULL); - irc_config_color_item_nick_modes = weechat_config_new_option ( - irc_config_file, ptr_section, - "item_nick_modes", "color", - N_("color for nick modes in bar item \"input_prompt\""), - NULL, -1, 0, "default", NULL, 0, - NULL, NULL, NULL, - &irc_config_change_color_item_nick_modes, NULL, NULL, - NULL, NULL, NULL); - irc_config_color_item_tls_version_deprecated = weechat_config_new_option ( - irc_config_file, ptr_section, - "item_tls_version_deprecated", "color", - N_("color for deprecated TLS versions in bar item \"tls_version\""), - NULL, -1, 0, "yellow", NULL, 0, + /* color */ + irc_config_section_color = weechat_config_new_section ( + irc_config_file, "color", + 0, 0, NULL, NULL, NULL, - &irc_config_change_color_item_tls_version, NULL, NULL, - NULL, NULL, NULL); - irc_config_color_item_tls_version_insecure = weechat_config_new_option ( - irc_config_file, ptr_section, - "item_tls_version_insecure", "color", - N_("color for insecure TLS versions in bar item \"tls_version\""), - NULL, -1, 0, "red", NULL, 0, NULL, NULL, NULL, - &irc_config_change_color_item_tls_version, NULL, NULL, - NULL, NULL, NULL); - irc_config_color_item_tls_version_ok = weechat_config_new_option ( - irc_config_file, ptr_section, - "item_tls_version_ok", "color", - N_("color for higher supported TLS version in bar item \"tls_version\""), - NULL, -1, 0, "green", NULL, 0, NULL, NULL, NULL, - &irc_config_change_color_item_tls_version, NULL, NULL, - NULL, NULL, NULL); - irc_config_color_message_account = weechat_config_new_option ( - irc_config_file, ptr_section, - "message_account", "color", - N_("color for text in account messages"), - NULL, -1, 0, "cyan", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_color_message_chghost = weechat_config_new_option ( - irc_config_file, ptr_section, - "message_chghost", "color", - /* TRANSLATORS: please do not translate "chghost" */ - N_("color for text in \"chghost\" messages"), - NULL, -1, 0, "brown", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_color_message_join = weechat_config_new_option ( - irc_config_file, ptr_section, - "message_join", "color", - N_("color for text in join messages"), - NULL, -1, 0, "green", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_color_message_kick = weechat_config_new_option ( - irc_config_file, ptr_section, - "message_kick", "color", - N_("color for text in kick/kill messages"), - NULL, -1, 0, "red", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_color_message_quit = weechat_config_new_option ( - irc_config_file, ptr_section, - "message_quit", "color", - N_("color for text in part/quit messages"), - NULL, -1, 0, "red", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_color_message_setname = weechat_config_new_option ( - irc_config_file, ptr_section, - "message_setname", "color", - /* TRANSLATORS: please do not translate "setname" */ - N_("color for text in \"setname\" messages"), - NULL, -1, 0, "brown", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_color_mirc_remap = weechat_config_new_option ( - irc_config_file, ptr_section, - "mirc_remap", "string", - /* TRANSLATORS: please do not translate the list of WeeChat color names at the end of string */ - N_("remap mirc colors in messages using a hashtable: keys are \"fg,bg\" " - "as integers between -1 (not specified) and 15, values are WeeChat " - "color names or numbers (format is: \"1,-1:color1;2,7:color2\"), " - "example: \"1,-1:darkgray;1,2:white,blue\" to remap black to " - "\"darkgray\" and black on blue to \"white,blue\"; default " - "WeeChat colors for IRC codes: 0=white, 1=black, 2=blue, 3=green, " - "4=lightred, 5=red, 6=magenta, 7=brown, 8=yellow, 9=lightgreen, " - "10=cyan, 11=lightcyan, 12=lightblue, 13=lightmagenta, " - "14=darkgray, 15=gray"), - NULL, 0, 0, "1,-1:darkgray", NULL, 0, NULL, NULL, NULL, - &irc_config_change_color_mirc_remap, NULL, NULL, NULL, NULL, NULL); - irc_config_color_nick_prefixes = weechat_config_new_option ( - irc_config_file, ptr_section, - "nick_prefixes", "string", - N_("color for nick prefixes using mode char (o=op, h=halfop, v=voice, " - "..), format is: \"o:color1;h:color2;v:color3\" (if a mode is not " - "found, WeeChat will try with next modes received from server " - "(\"PREFIX\"); a special mode \"*\" can be used as default color " - "if no mode has been found in list)"), - NULL, 0, 0, "y:lightred;q:lightred;a:lightcyan;o:lightgreen;" - "h:lightmagenta;v:yellow;*:lightblue", NULL, 0, - NULL, NULL, NULL, - &irc_config_change_color_nick_prefixes, NULL, NULL, - NULL, NULL, NULL); - irc_config_color_notice = weechat_config_new_option ( - irc_config_file, ptr_section, - "notice", "color", - N_("color for text \"Notice\" in notices"), - NULL, -1, 0, "green", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_color_reason_kick = weechat_config_new_option ( - irc_config_file, ptr_section, - "reason_kick", "color", - N_("color for reason in kick/kill messages"), - NULL, -1, 0, "default", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_color_reason_quit = weechat_config_new_option ( - irc_config_file, ptr_section, - "reason_quit", "color", - N_("color for reason in part/quit messages"), - NULL, -1, 0, "default", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_color_topic_current = weechat_config_new_option ( - irc_config_file, ptr_section, - "topic_current", "color", - N_("color for current channel topic (when joining a channel or " - "using /topic)"), - NULL, -1, 0, "default", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_color_topic_new = weechat_config_new_option ( - irc_config_file, ptr_section, - "topic_new", "color", - N_("color for new channel topic (when topic is changed)"), - NULL, -1, 0, "white", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_color_topic_old = weechat_config_new_option ( - irc_config_file, ptr_section, - "topic_old", "color", - N_("color for old channel topic (when topic is changed)"), - NULL, -1, 0, "default", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - - /* network */ - ptr_section = weechat_config_new_section (irc_config_file, "network", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) + if (irc_config_section_color) { - weechat_config_free (irc_config_file); - irc_config_file = NULL; - return 0; + irc_config_color_input_nick = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "input_nick", "color", + N_("color for nick in input bar"), + NULL, -1, 0, "lightcyan", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_bar_item_input_prompt, NULL, NULL, + NULL, NULL, NULL); + irc_config_color_item_channel_modes = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "item_channel_modes", "color", + N_("color for channel modes, near channel name"), + NULL, -1, 0, "default", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_color_item_channel_modes, NULL, NULL, + NULL, NULL, NULL); + irc_config_color_item_lag_counting = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "item_lag_counting", "color", + N_("color for lag indicator, when counting (pong not received from " + "server, lag is increasing)"), + NULL, -1, 0, "default", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_color_item_lag, NULL, NULL, + NULL, NULL, NULL); + irc_config_color_item_lag_finished = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "item_lag_finished", "color", + N_("color for lag indicator, when pong has been received from server"), + NULL, -1, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_color_item_lag, NULL, NULL, + NULL, NULL, NULL); + irc_config_color_item_nick_modes = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "item_nick_modes", "color", + N_("color for nick modes in bar item \"input_prompt\""), + NULL, -1, 0, "default", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_color_item_nick_modes, NULL, NULL, + NULL, NULL, NULL); + irc_config_color_item_tls_version_deprecated = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "item_tls_version_deprecated", "color", + N_("color for deprecated TLS versions in bar item \"tls_version\""), + NULL, -1, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_color_item_tls_version, NULL, NULL, + NULL, NULL, NULL); + irc_config_color_item_tls_version_insecure = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "item_tls_version_insecure", "color", + N_("color for insecure TLS versions in bar item \"tls_version\""), + NULL, -1, 0, "red", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_color_item_tls_version, NULL, NULL, + NULL, NULL, NULL); + irc_config_color_item_tls_version_ok = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "item_tls_version_ok", "color", + N_("color for higher supported TLS version in bar item " + "\"tls_version\""), + NULL, -1, 0, "green", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_color_item_tls_version, NULL, NULL, + NULL, NULL, NULL); + irc_config_color_message_account = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "message_account", "color", + N_("color for text in account messages"), + NULL, -1, 0, "cyan", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_color_message_chghost = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "message_chghost", "color", + /* TRANSLATORS: please do not translate "chghost" */ + N_("color for text in \"chghost\" messages"), + NULL, -1, 0, "brown", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_color_message_join = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "message_join", "color", + N_("color for text in join messages"), + NULL, -1, 0, "green", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_color_message_kick = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "message_kick", "color", + N_("color for text in kick/kill messages"), + NULL, -1, 0, "red", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_color_message_quit = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "message_quit", "color", + N_("color for text in part/quit messages"), + NULL, -1, 0, "red", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_color_message_setname = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "message_setname", "color", + /* TRANSLATORS: please do not translate "setname" */ + N_("color for text in \"setname\" messages"), + NULL, -1, 0, "brown", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_color_mirc_remap = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "mirc_remap", "string", + /* TRANSLATORS: please do not translate the list of WeeChat color names at the end of string */ + N_("remap mirc colors in messages using a hashtable: keys are " + "\"fg,bg\" as integers between -1 (not specified) and 15, " + "values are WeeChat color names or numbers (format is: " + "\"1,-1:color1;2,7:color2\"), example: " + "\"1,-1:darkgray;1,2:white,blue\" to remap black to " + "\"darkgray\" and black on blue to \"white,blue\"; default " + "WeeChat colors for IRC codes: 0=white, 1=black, 2=blue, " + "3=green, 4=lightred, 5=red, 6=magenta, 7=brown, 8=yellow, " + "9=lightgreen, 10=cyan, 11=lightcyan, 12=lightblue, " + "13=lightmagenta, 14=darkgray, 15=gray"), + NULL, 0, 0, "1,-1:darkgray", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_color_mirc_remap, NULL, NULL, + NULL, NULL, NULL); + irc_config_color_nick_prefixes = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "nick_prefixes", "string", + N_("color for nick prefixes using mode char (o=op, h=halfop, " + "v=voice, ..), format is: \"o:color1;h:color2;v:color3\" (if a " + "mode is not found, WeeChat will try with next modes received " + "from server (\"PREFIX\"); a special mode \"*\" can be used as " + "default color if no mode has been found in list)"), + NULL, 0, 0, "y:lightred;q:lightred;a:lightcyan;o:lightgreen;" + "h:lightmagenta;v:yellow;*:lightblue", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_color_nick_prefixes, NULL, NULL, + NULL, NULL, NULL); + irc_config_color_notice = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "notice", "color", + N_("color for text \"Notice\" in notices"), + NULL, -1, 0, "green", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_color_reason_kick = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "reason_kick", "color", + N_("color for reason in kick/kill messages"), + NULL, -1, 0, "default", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_color_reason_quit = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "reason_quit", "color", + N_("color for reason in part/quit messages"), + NULL, -1, 0, "default", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_color_topic_current = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "topic_current", "color", + N_("color for current channel topic (when joining a channel or " + "using /topic)"), + NULL, -1, 0, "default", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_color_topic_new = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "topic_new", "color", + N_("color for new channel topic (when topic is changed)"), + NULL, -1, 0, "white", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_color_topic_old = weechat_config_new_option ( + irc_config_file, irc_config_section_color, + "topic_old", "color", + N_("color for old channel topic (when topic is changed)"), + NULL, -1, 0, "default", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } - irc_config_network_autoreconnect_delay_growing = weechat_config_new_option ( - irc_config_file, ptr_section, - "autoreconnect_delay_growing", "integer", - N_("growing factor for autoreconnect delay to server (1 = always same " - "delay, 2 = delay*2 for each retry, etc.)"), - NULL, 1, 100, "2", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_network_autoreconnect_delay_max = weechat_config_new_option ( - irc_config_file, ptr_section, - "autoreconnect_delay_max", "integer", - N_("maximum autoreconnect delay to server (in seconds, 0 = no maximum)"), - NULL, 0, 3600 * 24 * 7, "600", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_network_ban_mask_default = weechat_config_new_option ( - irc_config_file, ptr_section, - "ban_mask_default", "string", - N_("default ban mask for commands /ban, /unban and /kickban; variables " - "$nick, $user, $ident and $host are replaced by their values " - "(extracted from \"nick!user@host\"); $ident is the same as $user if " - "$user does not start with \"~\", otherwise it is set to \"*\"; this " - "default mask is used only if WeeChat knows the host for the nick"), - NULL, 0, 0, "*!$ident@$host", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_network_colors_receive = weechat_config_new_option ( - irc_config_file, ptr_section, - "colors_receive", "boolean", - N_("when off, colors codes are ignored in incoming messages"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_network_colors_send = weechat_config_new_option ( - irc_config_file, ptr_section, - "colors_send", "boolean", - N_("allow user to send colors with special codes (ctrl-c + a code and " - "optional color: b=bold, cxx=color, cxx,yy=color+background, " - "i=italic, o=disable color/attributes, r=reverse, u=underline)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_network_lag_check = weechat_config_new_option ( - irc_config_file, ptr_section, - "lag_check", "integer", - N_("interval between two checks for lag (in seconds, 0 = never " - "check)"), - NULL, 0, 3600 * 24 * 7, "60", NULL, 0, - NULL, NULL, NULL, - &irc_config_change_network_lag_check, NULL, NULL, - NULL, NULL, NULL); - irc_config_network_lag_max = weechat_config_new_option ( - irc_config_file, ptr_section, - "lag_max", "integer", - N_("maximum lag (in seconds): if this lag is reached, WeeChat will " - "consider that the answer from server (pong) will never be received " - "and will give up counting the lag (0 = never give up)"), - NULL, 0, 3600 * 24 * 7, "1800", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_network_lag_min_show = weechat_config_new_option ( - irc_config_file, ptr_section, - "lag_min_show", "integer", - N_("minimum lag to show (in milliseconds)"), - NULL, 0, 1000 * 3600 * 24, "500", NULL, 0, + /* network */ + irc_config_section_network = weechat_config_new_section ( + irc_config_file, "network", + 0, 0, NULL, NULL, NULL, - &irc_config_change_network_lag_min_show, NULL, NULL, - NULL, NULL, NULL); - irc_config_network_lag_reconnect = weechat_config_new_option ( - irc_config_file, ptr_section, - "lag_reconnect", "integer", - N_("reconnect to server if lag is greater than or equal to this value " - "(in seconds, 0 = never reconnect); this value must be less than or " - "equal to irc.network.lag_max"), - NULL, 0, 3600 * 24 * 7, "300", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_network_lag_refresh_interval = weechat_config_new_option ( - irc_config_file, ptr_section, - "lag_refresh_interval", "integer", - N_("interval between two refreshes of lag item, when lag is " - "increasing (in seconds)"), - NULL, 1, 3600, "1", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_network_notify_check_ison = weechat_config_new_option ( - irc_config_file, ptr_section, - "notify_check_ison", "integer", - N_("interval between two checks for notify with IRC command \"ison\" " - "(in minutes)"), - NULL, 1, 60 * 24 * 7, "1", NULL, 0, NULL, NULL, NULL, - &irc_config_change_network_notify_check_ison, NULL, NULL, - NULL, NULL, NULL); - irc_config_network_notify_check_whois = weechat_config_new_option ( - irc_config_file, ptr_section, - "notify_check_whois", "integer", - N_("interval between two checks for notify with IRC command \"whois\" " - "(in minutes)"), - NULL, 1, 60 * 24 * 7, "5", NULL, 0, NULL, NULL, NULL, - &irc_config_change_network_notify_check_whois, NULL, NULL, - NULL, NULL, NULL); - irc_config_network_sasl_fail_unavailable = weechat_config_new_option ( - irc_config_file, ptr_section, - "sasl_fail_unavailable", "boolean", - N_("cause SASL authentication failure when SASL is requested but " - "unavailable on the server; when this option is enabled, it has " - "effect only if option \"sasl_fail\" is set to \"reconnect\" or " - "\"disconnect\" in the server"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_network_send_unknown_commands = weechat_config_new_option ( - irc_config_file, ptr_section, - "send_unknown_commands", "boolean", - N_("send unknown commands to server"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, - &irc_config_change_network_send_unknown_commands, NULL, NULL, NULL, NULL, NULL); - irc_config_network_whois_double_nick = weechat_config_new_option ( - irc_config_file, ptr_section, - "whois_double_nick", "boolean", - N_("double the nick in /whois command (if only one nick is given), to " - "get idle time in answer; for example: \"/whois nick\" will send " - "\"whois nick nick\""), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + if (irc_config_section_network) + { + irc_config_network_autoreconnect_delay_growing = weechat_config_new_option ( + irc_config_file, irc_config_section_network, + "autoreconnect_delay_growing", "integer", + N_("growing factor for autoreconnect delay to server (1 = always " + "same delay, 2 = delay*2 for each retry, etc.)"), + NULL, 1, 100, "2", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_network_autoreconnect_delay_max = weechat_config_new_option ( + irc_config_file, irc_config_section_network, + "autoreconnect_delay_max", "integer", + N_("maximum autoreconnect delay to server (in seconds, 0 = no " + "maximum)"), + NULL, 0, 3600 * 24 * 7, "600", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_network_ban_mask_default = weechat_config_new_option ( + irc_config_file, irc_config_section_network, + "ban_mask_default", "string", + N_("default ban mask for commands /ban, /unban and /kickban; " + "variables $nick, $user, $ident and $host are replaced by their " + "values (extracted from \"nick!user@host\"); $ident is the same " + "as $user if $user does not start with \"~\", otherwise it is " + "set to \"*\"; this default mask is used only if WeeChat knows " + "the host for the nick"), + NULL, 0, 0, "*!$ident@$host", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_network_colors_receive = weechat_config_new_option ( + irc_config_file, irc_config_section_network, + "colors_receive", "boolean", + N_("when off, colors codes are ignored in incoming messages"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_network_colors_send = weechat_config_new_option ( + irc_config_file, irc_config_section_network, + "colors_send", "boolean", + N_("allow user to send colors with special codes (ctrl-c + a code " + "and optional color: b=bold, cxx=color, cxx,yy=color+background, " + "i=italic, o=disable color/attributes, r=reverse, u=underline)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_network_lag_check = weechat_config_new_option ( + irc_config_file, irc_config_section_network, + "lag_check", "integer", + N_("interval between two checks for lag (in seconds, 0 = never " + "check)"), + NULL, 0, 3600 * 24 * 7, "60", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_network_lag_check, NULL, NULL, + NULL, NULL, NULL); + irc_config_network_lag_max = weechat_config_new_option ( + irc_config_file, irc_config_section_network, + "lag_max", "integer", + N_("maximum lag (in seconds): if this lag is reached, WeeChat will " + "consider that the answer from server (pong) will never be " + "received and will give up counting the lag (0 = never give up)"), + NULL, 0, 3600 * 24 * 7, "1800", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_network_lag_min_show = weechat_config_new_option ( + irc_config_file, irc_config_section_network, + "lag_min_show", "integer", + N_("minimum lag to show (in milliseconds)"), + NULL, 0, 1000 * 3600 * 24, "500", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_network_lag_min_show, NULL, NULL, + NULL, NULL, NULL); + irc_config_network_lag_reconnect = weechat_config_new_option ( + irc_config_file, irc_config_section_network, + "lag_reconnect", "integer", + N_("reconnect to server if lag is greater than or equal to this " + "value (in seconds, 0 = never reconnect); this value must be " + "less than or equal to irc.network.lag_max"), + NULL, 0, 3600 * 24 * 7, "300", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_network_lag_refresh_interval = weechat_config_new_option ( + irc_config_file, irc_config_section_network, + "lag_refresh_interval", "integer", + N_("interval between two refreshes of lag item, when lag is " + "increasing (in seconds)"), + NULL, 1, 3600, "1", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_network_notify_check_ison = weechat_config_new_option ( + irc_config_file, irc_config_section_network, + "notify_check_ison", "integer", + N_("interval between two checks for notify with IRC command " + "\"ison\" (in minutes)"), + NULL, 1, 60 * 24 * 7, "1", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_network_notify_check_ison, NULL, NULL, + NULL, NULL, NULL); + irc_config_network_notify_check_whois = weechat_config_new_option ( + irc_config_file, irc_config_section_network, + "notify_check_whois", "integer", + N_("interval between two checks for notify with IRC command " + "\"whois\" (in minutes)"), + NULL, 1, 60 * 24 * 7, "5", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_network_notify_check_whois, NULL, NULL, + NULL, NULL, NULL); + irc_config_network_sasl_fail_unavailable = weechat_config_new_option ( + irc_config_file, irc_config_section_network, + "sasl_fail_unavailable", "boolean", + N_("cause SASL authentication failure when SASL is requested but " + "unavailable on the server; when this option is enabled, it has " + "effect only if option \"sasl_fail\" is set to \"reconnect\" or " + "\"disconnect\" in the server"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_network_send_unknown_commands = weechat_config_new_option ( + irc_config_file, irc_config_section_network, + "send_unknown_commands", "boolean", + N_("send unknown commands to server"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &irc_config_change_network_send_unknown_commands, NULL, NULL, + NULL, NULL, NULL); + irc_config_network_whois_double_nick = weechat_config_new_option ( + irc_config_file, irc_config_section_network, + "whois_double_nick", "boolean", + N_("double the nick in /whois command (if only one nick is given), " + "to get idle time in answer; for example: \"/whois nick\" will " + "send \"whois nick nick\""), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + } /* msgbuffer */ - ptr_section = weechat_config_new_section ( + irc_config_section_msgbuffer = weechat_config_new_section ( irc_config_file, "msgbuffer", 1, 1, NULL, NULL, NULL, @@ -3634,16 +3641,9 @@ irc_config_init () NULL, NULL, NULL, &irc_config_msgbuffer_create_option, NULL, NULL, NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (irc_config_file); - irc_config_file = NULL; - return 0; - } - irc_config_section_msgbuffer = ptr_section; /* CTCP */ - ptr_section = weechat_config_new_section ( + irc_config_section_ctcp = weechat_config_new_section ( irc_config_file, "ctcp", 1, 1, NULL, NULL, NULL, @@ -3651,16 +3651,9 @@ irc_config_init () NULL, NULL, NULL, &irc_config_ctcp_create_option, NULL, NULL, NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (irc_config_file); - irc_config_file = NULL; - return 0; - } - irc_config_section_ctcp = ptr_section; /* ignore */ - ptr_section = weechat_config_new_section ( + irc_config_section_ignore = weechat_config_new_section ( irc_config_file, "ignore", 0, 0, &irc_config_ignore_read_cb, NULL, NULL, @@ -3668,15 +3661,9 @@ irc_config_init () &irc_config_ignore_write_cb, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (irc_config_file); - irc_config_file = NULL; - return 0; - } /* server_default */ - ptr_section = weechat_config_new_section ( + irc_config_section_server_default = weechat_config_new_section ( irc_config_file, "server_default", 0, 0, NULL, NULL, NULL, @@ -3684,18 +3671,11 @@ irc_config_init () NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (irc_config_file); - irc_config_file = NULL; - return 0; - } - irc_config_section_server_default = ptr_section; - irc_config_server_create_default_options (ptr_section); + irc_config_server_create_default_options (irc_config_section_server_default); /* server */ - ptr_section = weechat_config_new_section ( + irc_config_section_server = weechat_config_new_section ( irc_config_file, "server", 0, 0, &irc_config_server_read_cb, NULL, NULL, @@ -3703,13 +3683,6 @@ irc_config_init () NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (irc_config_file); - irc_config_file = NULL; - return 0; - } - irc_config_section_server = ptr_section; irc_config_hook_config_nick_color_options = weechat_hook_config ( "weechat.look.nick_color_*", diff --git a/src/plugins/logger/logger-config.c b/src/plugins/logger/logger-config.c index d254cabe3..646d3a0ba 100644 --- a/src/plugins/logger/logger-config.c +++ b/src/plugins/logger/logger-config.c @@ -30,6 +30,12 @@ struct t_config_file *logger_config_file = NULL; + +/* sections */ + +struct t_config_section *logger_config_section_look = NULL; +struct t_config_section *logger_config_section_color = NULL; +struct t_config_section *logger_config_section_file = NULL; struct t_config_section *logger_config_section_level = NULL; struct t_config_section *logger_config_section_mask = NULL; @@ -37,31 +43,31 @@ int logger_config_loading = 0; /* logger config, look section */ -struct t_config_option *logger_config_look_backlog; -struct t_config_option *logger_config_look_backlog_conditions; +struct t_config_option *logger_config_look_backlog = NULL; +struct t_config_option *logger_config_look_backlog_conditions = NULL; /* logger config, color section */ -struct t_config_option *logger_config_color_backlog_end; -struct t_config_option *logger_config_color_backlog_line; +struct t_config_option *logger_config_color_backlog_end = NULL; +struct t_config_option *logger_config_color_backlog_line = NULL; /* logger config, file section */ -struct t_config_option *logger_config_file_auto_log; -struct t_config_option *logger_config_file_color_lines; -struct t_config_option *logger_config_file_flush_delay; -struct t_config_option *logger_config_file_fsync; -struct t_config_option *logger_config_file_info_lines; -struct t_config_option *logger_config_file_mask; -struct t_config_option *logger_config_file_name_lower_case; -struct t_config_option *logger_config_file_nick_prefix; -struct t_config_option *logger_config_file_nick_suffix; -struct t_config_option *logger_config_file_path; -struct t_config_option *logger_config_file_replacement_char; -struct t_config_option *logger_config_file_rotation_compression_level; -struct t_config_option *logger_config_file_rotation_compression_type; -struct t_config_option *logger_config_file_rotation_size_max; -struct t_config_option *logger_config_file_time_format; +struct t_config_option *logger_config_file_auto_log = NULL; +struct t_config_option *logger_config_file_color_lines = NULL; +struct t_config_option *logger_config_file_flush_delay = NULL; +struct t_config_option *logger_config_file_fsync = NULL; +struct t_config_option *logger_config_file_info_lines = NULL; +struct t_config_option *logger_config_file_mask = NULL; +struct t_config_option *logger_config_file_name_lower_case = NULL; +struct t_config_option *logger_config_file_nick_prefix = NULL; +struct t_config_option *logger_config_file_nick_suffix = NULL; +struct t_config_option *logger_config_file_path = NULL; +struct t_config_option *logger_config_file_replacement_char = NULL; +struct t_config_option *logger_config_file_rotation_compression_level = NULL; +struct t_config_option *logger_config_file_rotation_compression_type = NULL; +struct t_config_option *logger_config_file_rotation_size_max = NULL; +struct t_config_option *logger_config_file_time_format = NULL; /* other */ @@ -460,234 +466,224 @@ logger_config_get_mask (const char *name) int logger_config_init () { - struct t_config_section *ptr_section; - logger_config_file = weechat_config_new (LOGGER_CONFIG_PRIO_NAME, NULL, NULL, NULL); if (!logger_config_file) return 0; /* look */ - ptr_section = weechat_config_new_section (logger_config_file, "look", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) + logger_config_section_look = weechat_config_new_section ( + logger_config_file, "look", + 0, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + if (logger_config_section_look) { - weechat_config_free (logger_config_file); - logger_config_file = NULL; - return 0; + logger_config_look_backlog = weechat_config_new_option ( + logger_config_file, logger_config_section_look, + "backlog", "integer", + N_("maximum number of lines to display from log file when creating " + "new buffer (0 = no backlog)"), + NULL, 0, INT_MAX, "20", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + logger_config_look_backlog_conditions = weechat_config_new_option ( + logger_config_file, logger_config_section_look, + "backlog_conditions", "string", + N_("conditions to display the backlog " + "(note: content is evaluated, see /help eval); " + "empty value displays the backlog on all buffers; " + "for example to display backlog on private buffers only: " + "\"${type} == private\""), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } - logger_config_look_backlog = weechat_config_new_option ( - logger_config_file, ptr_section, - "backlog", "integer", - N_("maximum number of lines to display from log file when creating " - "new buffer (0 = no backlog)"), - NULL, 0, INT_MAX, "20", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - logger_config_look_backlog_conditions = weechat_config_new_option ( - logger_config_file, ptr_section, - "backlog_conditions", "string", - N_("conditions to display the backlog " - "(note: content is evaluated, see /help eval); " - "empty value displays the backlog on all buffers; " - "for example to display backlog on private buffers only: " - "\"${type} == private\""), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - /* color */ - ptr_section = weechat_config_new_section (logger_config_file, "color", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) + logger_config_section_color = weechat_config_new_section ( + logger_config_file, "color", + 0, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + if (logger_config_section_color) { - weechat_config_free (logger_config_file); - logger_config_file = NULL; - return 0; + logger_config_color_backlog_end = weechat_config_new_option ( + logger_config_file, logger_config_section_color, + "backlog_end", "color", + N_("color for line ending the backlog"), + NULL, -1, 0, "default", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + logger_config_color_backlog_line = weechat_config_new_option ( + logger_config_file, logger_config_section_color, + "backlog_line", "color", + N_("color for backlog lines, used only if the option " + "logger.file.color_lines is off"), + NULL, -1, 0, "default", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } - logger_config_color_backlog_end = weechat_config_new_option ( - logger_config_file, ptr_section, - "backlog_end", "color", - N_("color for line ending the backlog"), - NULL, -1, 0, "default", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - logger_config_color_backlog_line = weechat_config_new_option ( - logger_config_file, ptr_section, - "backlog_line", "color", - N_("color for backlog lines, used only if the option " - "logger.file.color_lines is off"), - NULL, -1, 0, "default", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - /* file */ - ptr_section = weechat_config_new_section (logger_config_file, "file", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (logger_config_file); - logger_config_file = NULL; - return 0; - } - - logger_config_file_auto_log = weechat_config_new_option ( - logger_config_file, ptr_section, - "auto_log", "boolean", - N_("automatically save content of buffers to files (unless a buffer " - "disables log); if disabled, logging is disabled on all buffers"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - logger_config_file_color_lines = weechat_config_new_option ( - logger_config_file, ptr_section, - "color_lines", "boolean", - N_("use ANSI color codes in lines written in log files and display " - "backlog lines with these colors"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, - &logger_config_color_lines_change, NULL, NULL, - NULL, NULL, NULL); - logger_config_file_flush_delay = weechat_config_new_option ( - logger_config_file, ptr_section, - "flush_delay", "integer", - N_("number of seconds between flush of log files (0 = write in log " - "files immediately for each line printed)"), - NULL, 0, 3600, "120", NULL, 0, - NULL, NULL, NULL, - &logger_config_flush_delay_change, NULL, NULL, - NULL, NULL, NULL); - logger_config_file_fsync = weechat_config_new_option ( - logger_config_file, ptr_section, - "fsync", "boolean", - N_("use fsync to synchronize the log file with the storage device " - "after the flush (see man fsync); this is slower but should " - "prevent any data loss in case of power failure during the save of " - "log file"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - logger_config_file_info_lines = weechat_config_new_option ( - logger_config_file, ptr_section, - "info_lines", "boolean", - N_("write information line in log file when log starts or ends for a " - "buffer"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - logger_config_file_mask = weechat_config_new_option ( - logger_config_file, ptr_section, - "mask", "string", - N_("default file name mask for log files (format is " - "\"directory/to/file\" or \"file\", without first \"/\" because " - "\"path\" option is used to build complete path to file); local " - "buffer variables are permitted (you should use only variables " - "that are defined on all buffers, so for example you should NOT " - "use $server nor $channel); date specifiers are permitted " - "(see man strftime)"), - NULL, 0, 0, "$plugin.$name.weechatlog", NULL, 0, + logger_config_section_file = weechat_config_new_section ( + logger_config_file, "file", + 0, 0, NULL, NULL, NULL, - &logger_config_change_file_option_restart_log, NULL, NULL, - NULL, NULL, NULL); - logger_config_file_name_lower_case = weechat_config_new_option ( - logger_config_file, ptr_section, - "name_lower_case", "boolean", - N_("use only lower case for log filenames"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, - &logger_config_change_file_option_restart_log, NULL, NULL, - NULL, NULL, NULL); - logger_config_file_nick_prefix = weechat_config_new_option ( - logger_config_file, ptr_section, - "nick_prefix", "string", - N_("text to write before nick in prefix of message, example: \"<\""), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - logger_config_file_nick_suffix = weechat_config_new_option ( - logger_config_file, ptr_section, - "nick_suffix", "string", - N_("text to write after nick in prefix of message, example: \">\""), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - logger_config_file_path = weechat_config_new_option ( - logger_config_file, ptr_section, - "path", "string", - N_("path for WeeChat log files; " - "date specifiers are permitted (see man strftime) " - "(path is evaluated, see function string_eval_path_home in " - "plugin API reference)"), - NULL, 0, 0, "${weechat_data_dir}/logs", NULL, 0, NULL, NULL, NULL, - &logger_config_change_file_option_restart_log, NULL, NULL, - NULL, NULL, NULL); - logger_config_file_replacement_char = weechat_config_new_option ( - logger_config_file, ptr_section, - "replacement_char", "string", - N_("replacement char for special chars in filename built with mask " - "(like directory delimiter)"), - NULL, 0, 0, "_", NULL, 0, NULL, NULL, NULL, - &logger_config_change_file_option_restart_log, NULL, NULL, NULL, NULL, NULL); - logger_config_file_rotation_compression_level = weechat_config_new_option ( - logger_config_file, ptr_section, - "rotation_compression_level", "integer", - N_("compression level for rotated log files (with extension \".1\", " - "\".2\", etc.), if option logger.file.rotation_compression_type is " - "enabled: 1 = low compression / fast ... 100 = best compression / " - "slow; the value is a percentage converted to 1-9 for gzip and " - "1-19 for zstd; the default value is recommended, it offers a good " - "compromise between compression and speed"), - NULL, 1, 100, "20", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - logger_config_file_rotation_compression_type = weechat_config_new_option ( - logger_config_file, ptr_section, - "rotation_compression_type", "integer", - N_("compression type for rotated log files; if set to \"none\", " - "rotated log files are not compressed; WARNING: if rotation was " - "enabled with another type of compression (or no compression), " - "you must first unload the logger plugin, compress files with the " - "new type (or decompress files), then change the option in " - "logger.conf, then load the logger plugin"), - "none|gzip|zstd", 0, 0, "none", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - logger_config_file_rotation_size_max = weechat_config_new_option ( - logger_config_file, ptr_section, - "rotation_size_max", "string", - N_("when this size is reached, a rotation of log files is performed: " - "the existing rotated log files are renamed (.1 becomes .2, .2 " - "becomes .3, etc.) and the current file is renamed with extension " - ".1; an integer number with a suffix is allowed: b = bytes " - "(default if no unit given), k = kilobytes, m = megabytes, " - "g = gigabytes, t = terabytes; example: \"2g\" causes a rotation " - "if the file size is > 2,000,000,000 bytes; if set to \"0\", " - "no rotation is performed (unlimited log size); WARNING: before " - "changing this option, you should first set the compression type " - "via option logger.file.rotation_compression_type"), - NULL, 0, 0, "0", NULL, 0, - &logger_config_rotation_size_max_check, NULL, NULL, - &logger_config_rotation_size_max_change, NULL, NULL, - NULL, NULL, NULL); - logger_config_file_time_format = weechat_config_new_option ( - logger_config_file, ptr_section, - "time_format", "string", - N_("timestamp used in log files (see man strftime for date/time " - "specifiers)"), - NULL, 0, 0, "%Y-%m-%d %H:%M:%S", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + if (logger_config_section_file) + { + logger_config_file_auto_log = weechat_config_new_option ( + logger_config_file, logger_config_section_file, + "auto_log", "boolean", + N_("automatically save content of buffers to files (unless a buffer " + "disables log); if disabled, logging is disabled on all buffers"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + logger_config_file_color_lines = weechat_config_new_option ( + logger_config_file, logger_config_section_file, + "color_lines", "boolean", + N_("use ANSI color codes in lines written in log files and display " + "backlog lines with these colors"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &logger_config_color_lines_change, NULL, NULL, + NULL, NULL, NULL); + logger_config_file_flush_delay = weechat_config_new_option ( + logger_config_file, logger_config_section_file, + "flush_delay", "integer", + N_("number of seconds between flush of log files (0 = write in log " + "files immediately for each line printed)"), + NULL, 0, 3600, "120", NULL, 0, + NULL, NULL, NULL, + &logger_config_flush_delay_change, NULL, NULL, + NULL, NULL, NULL); + logger_config_file_fsync = weechat_config_new_option ( + logger_config_file, logger_config_section_file, + "fsync", "boolean", + N_("use fsync to synchronize the log file with the storage device " + "after the flush (see man fsync); this is slower but should " + "prevent any data loss in case of power failure during the save " + "of log file"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + logger_config_file_info_lines = weechat_config_new_option ( + logger_config_file, logger_config_section_file, + "info_lines", "boolean", + N_("write information line in log file when log starts or ends for " + "a buffer"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + logger_config_file_mask = weechat_config_new_option ( + logger_config_file, logger_config_section_file, + "mask", "string", + N_("default file name mask for log files (format is " + "\"directory/to/file\" or \"file\", without first \"/\" because " + "\"path\" option is used to build complete path to file); local " + "buffer variables are permitted (you should use only variables " + "that are defined on all buffers, so for example you should NOT " + "use $server nor $channel); date specifiers are permitted " + "(see man strftime)"), + NULL, 0, 0, "$plugin.$name.weechatlog", NULL, 0, + NULL, NULL, NULL, + &logger_config_change_file_option_restart_log, NULL, NULL, + NULL, NULL, NULL); + logger_config_file_name_lower_case = weechat_config_new_option ( + logger_config_file, logger_config_section_file, + "name_lower_case", "boolean", + N_("use only lower case for log filenames"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &logger_config_change_file_option_restart_log, NULL, NULL, + NULL, NULL, NULL); + logger_config_file_nick_prefix = weechat_config_new_option ( + logger_config_file, logger_config_section_file, + "nick_prefix", "string", + N_("text to write before nick in prefix of message, example: \"<\""), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + logger_config_file_nick_suffix = weechat_config_new_option ( + logger_config_file, logger_config_section_file, + "nick_suffix", "string", + N_("text to write after nick in prefix of message, example: \">\""), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + logger_config_file_path = weechat_config_new_option ( + logger_config_file, logger_config_section_file, + "path", "string", + N_("path for WeeChat log files; " + "date specifiers are permitted (see man strftime) " + "(path is evaluated, see function string_eval_path_home in " + "plugin API reference)"), + NULL, 0, 0, "${weechat_data_dir}/logs", NULL, 0, + NULL, NULL, NULL, + &logger_config_change_file_option_restart_log, NULL, NULL, + NULL, NULL, NULL); + logger_config_file_replacement_char = weechat_config_new_option ( + logger_config_file, logger_config_section_file, + "replacement_char", "string", + N_("replacement char for special chars in filename built with mask " + "(like directory delimiter)"), + NULL, 0, 0, "_", NULL, 0, + NULL, NULL, NULL, + &logger_config_change_file_option_restart_log, NULL, NULL, + NULL, NULL, NULL); + logger_config_file_rotation_compression_level = weechat_config_new_option ( + logger_config_file, logger_config_section_file, + "rotation_compression_level", "integer", + N_("compression level for rotated log files (with extension \".1\", " + "\".2\", etc.), if option logger.file.rotation_compression_type " + "is enabled: 1 = low compression / fast ... 100 = best " + "compression / slow; the value is a percentage converted to " + "1-9 for gzip and 1-19 for zstd; the default value is " + "recommended, it offers a good compromise between compression " + "and speed"), + NULL, 1, 100, "20", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + logger_config_file_rotation_compression_type = weechat_config_new_option ( + logger_config_file, logger_config_section_file, + "rotation_compression_type", "integer", + N_("compression type for rotated log files; if set to \"none\", " + "rotated log files are not compressed; WARNING: if rotation was " + "enabled with another type of compression (or no compression), " + "you must first unload the logger plugin, compress files with the " + "new type (or decompress files), then change the option in " + "logger.conf, then load the logger plugin"), + "none|gzip|zstd", 0, 0, "none", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + logger_config_file_rotation_size_max = weechat_config_new_option ( + logger_config_file, logger_config_section_file, + "rotation_size_max", "string", + N_("when this size is reached, a rotation of log files is performed: " + "the existing rotated log files are renamed (.1 becomes .2, .2 " + "becomes .3, etc.) and the current file is renamed with extension " + ".1; an integer number with a suffix is allowed: b = bytes " + "(default if no unit given), k = kilobytes, m = megabytes, " + "g = gigabytes, t = terabytes; example: \"2g\" causes a rotation " + "if the file size is > 2,000,000,000 bytes; if set to \"0\", " + "no rotation is performed (unlimited log size); WARNING: before " + "changing this option, you should first set the compression type " + "via option logger.file.rotation_compression_type"), + NULL, 0, 0, "0", NULL, 0, + &logger_config_rotation_size_max_check, NULL, NULL, + &logger_config_rotation_size_max_change, NULL, NULL, + NULL, NULL, NULL); + logger_config_file_time_format = weechat_config_new_option ( + logger_config_file, logger_config_section_file, + "time_format", "string", + N_("timestamp used in log files (see man strftime for date/time " + "specifiers)"), + NULL, 0, 0, "%Y-%m-%d %H:%M:%S", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + } /* level */ - ptr_section = weechat_config_new_section ( + logger_config_section_level = weechat_config_new_section ( logger_config_file, "level", 1, 1, NULL, NULL, NULL, @@ -695,17 +691,9 @@ logger_config_init () NULL, NULL, NULL, &logger_config_level_create_option, NULL, NULL, &logger_config_level_delete_option, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (logger_config_file); - logger_config_file = NULL; - return 0; - } - - logger_config_section_level = ptr_section; /* mask */ - ptr_section = weechat_config_new_section ( + logger_config_section_mask = weechat_config_new_section ( logger_config_file, "mask", 1, 1, NULL, NULL, NULL, @@ -713,14 +701,6 @@ logger_config_init () NULL, NULL, NULL, &logger_config_mask_create_option, NULL, NULL, &logger_config_mask_delete_option, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (logger_config_file); - logger_config_file = NULL; - return 0; - } - - logger_config_section_mask = ptr_section; return 1; } diff --git a/src/plugins/plugin-config.c b/src/plugins/plugin-config.c index df2c2cbf5..14f717439 100644 --- a/src/plugins/plugin-config.c +++ b/src/plugins/plugin-config.c @@ -378,11 +378,6 @@ plugin_config_init () &plugin_config_create_desc, NULL, NULL, &plugin_config_delete_desc, NULL, NULL); } - else - { - plugin_config_section_var = NULL; - plugin_config_section_desc = NULL; - } } /* diff --git a/src/plugins/plugin-script-config.c b/src/plugins/plugin-script-config.c index 5893c87ed..fb357ff2b 100644 --- a/src/plugins/plugin-script-config.c +++ b/src/plugins/plugin-script-config.c @@ -60,30 +60,27 @@ plugin_script_config_init (struct t_weechat_plugin *weechat_plugin, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!ptr_section) + if (ptr_section) { - weechat_config_free (*(plugin_data->config_file)); - *(plugin_data->config_file) = NULL; - return 0; + *(plugin_data->config_look_check_license) = weechat_config_new_option ( + *(plugin_data->config_file), ptr_section, + "check_license", "boolean", + N_("check the license of scripts when they are loaded: if the " + "license is different from the plugin license, a warning is " + "displayed"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + *(plugin_data->config_look_eval_keep_context) = weechat_config_new_option ( + *(plugin_data->config_file), ptr_section, + "eval_keep_context", "boolean", + N_("keep context between two calls to the source code evaluation " + "(option \"eval\" of script command or info \"%s_eval\"); " + "a hidden script is used to eval script code; " + "if this option is disabled, this hidden script is unloaded " + "after each eval: this uses less memory, but is slower"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } - *(plugin_data->config_look_check_license) = weechat_config_new_option ( - *(plugin_data->config_file), ptr_section, - "check_license", "boolean", - N_("check the license of scripts when they are loaded: if the license " - "is different from the plugin license, a warning is displayed"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - *(plugin_data->config_look_eval_keep_context) = weechat_config_new_option ( - *(plugin_data->config_file), ptr_section, - "eval_keep_context", "boolean", - N_("keep context between two calls to the source code evaluation " - "(option \"eval\" of script command or info \"%s_eval\"); " - "a hidden script is used to eval script code; " - "if this option is disabled, this hidden script is unloaded after " - "each eval: this uses less memory, but is slower"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - return 1; } diff --git a/src/plugins/relay/relay-config.c b/src/plugins/relay/relay-config.c index a7591befa..126905784 100644 --- a/src/plugins/relay/relay-config.c +++ b/src/plugins/relay/relay-config.c @@ -40,54 +40,64 @@ struct t_config_file *relay_config_file = NULL; + +/* sections */ + +struct t_config_section *relay_config_section_look = NULL; +struct t_config_section *relay_config_section_color = NULL; +struct t_config_section *relay_config_section_network = NULL; +struct t_config_section *relay_config_section_irc = NULL; +struct t_config_section *relay_config_section_weechat = NULL; struct t_config_section *relay_config_section_port = NULL; struct t_config_section *relay_config_section_path = NULL; /* relay config, look section */ -struct t_config_option *relay_config_look_auto_open_buffer; -struct t_config_option *relay_config_look_raw_messages; +struct t_config_option *relay_config_look_auto_open_buffer = NULL; +struct t_config_option *relay_config_look_raw_messages = NULL; /* relay config, color section */ -struct t_config_option *relay_config_color_client; -struct t_config_option *relay_config_color_status[RELAY_NUM_STATUS]; -struct t_config_option *relay_config_color_text; -struct t_config_option *relay_config_color_text_bg; -struct t_config_option *relay_config_color_text_selected; +struct t_config_option *relay_config_color_client = NULL; +struct t_config_option *relay_config_color_status[RELAY_NUM_STATUS] = { + NULL, NULL, NULL, NULL, NULL, +}; +struct t_config_option *relay_config_color_text = NULL; +struct t_config_option *relay_config_color_text_bg = NULL; +struct t_config_option *relay_config_color_text_selected = NULL; /* relay config, network section */ -struct t_config_option *relay_config_network_allow_empty_password; -struct t_config_option *relay_config_network_allowed_ips; -struct t_config_option *relay_config_network_auth_timeout; -struct t_config_option *relay_config_network_bind_address; -struct t_config_option *relay_config_network_clients_purge_delay; -struct t_config_option *relay_config_network_compression; -struct t_config_option *relay_config_network_ipv6; -struct t_config_option *relay_config_network_max_clients; -struct t_config_option *relay_config_network_nonce_size; -struct t_config_option *relay_config_network_password; -struct t_config_option *relay_config_network_password_hash_algo; -struct t_config_option *relay_config_network_password_hash_iterations; -struct t_config_option *relay_config_network_ssl_cert_key; -struct t_config_option *relay_config_network_ssl_priorities; -struct t_config_option *relay_config_network_totp_secret; -struct t_config_option *relay_config_network_totp_window; -struct t_config_option *relay_config_network_websocket_allowed_origins; +struct t_config_option *relay_config_network_allow_empty_password = NULL; +struct t_config_option *relay_config_network_allowed_ips = NULL; +struct t_config_option *relay_config_network_auth_timeout = NULL; +struct t_config_option *relay_config_network_bind_address = NULL; +struct t_config_option *relay_config_network_clients_purge_delay = NULL; +struct t_config_option *relay_config_network_compression = NULL; +struct t_config_option *relay_config_network_ipv6 = NULL; +struct t_config_option *relay_config_network_max_clients = NULL; +struct t_config_option *relay_config_network_nonce_size = NULL; +struct t_config_option *relay_config_network_password = NULL; +struct t_config_option *relay_config_network_password_hash_algo = NULL; +struct t_config_option *relay_config_network_password_hash_iterations = NULL; +struct t_config_option *relay_config_network_ssl_cert_key = NULL; +struct t_config_option *relay_config_network_ssl_priorities = NULL; +struct t_config_option *relay_config_network_totp_secret = NULL; +struct t_config_option *relay_config_network_totp_window = NULL; +struct t_config_option *relay_config_network_websocket_allowed_origins = NULL; /* relay config, irc section */ -struct t_config_option *relay_config_irc_backlog_max_minutes; -struct t_config_option *relay_config_irc_backlog_max_number; -struct t_config_option *relay_config_irc_backlog_since_last_disconnect; -struct t_config_option *relay_config_irc_backlog_since_last_message; -struct t_config_option *relay_config_irc_backlog_tags; -struct t_config_option *relay_config_irc_backlog_time_format; +struct t_config_option *relay_config_irc_backlog_max_minutes = NULL; +struct t_config_option *relay_config_irc_backlog_max_number = NULL; +struct t_config_option *relay_config_irc_backlog_since_last_disconnect = NULL; +struct t_config_option *relay_config_irc_backlog_since_last_message = NULL; +struct t_config_option *relay_config_irc_backlog_tags = NULL; +struct t_config_option *relay_config_irc_backlog_time_format = NULL; /* relay config, weechat section */ -struct t_config_option *relay_config_weechat_commands; +struct t_config_option *relay_config_weechat_commands = NULL; /* other */ @@ -889,411 +899,396 @@ relay_config_reload (const void *pointer, void *data, int relay_config_init () { - struct t_config_section *ptr_section; - relay_config_file = weechat_config_new (RELAY_CONFIG_PRIO_NAME, &relay_config_reload, NULL, NULL); if (!relay_config_file) return 0; /* section look */ - ptr_section = weechat_config_new_section (relay_config_file, "look", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (relay_config_file); - relay_config_file = NULL; - return 0; - } - - relay_config_look_auto_open_buffer = weechat_config_new_option ( - relay_config_file, ptr_section, - "auto_open_buffer", "boolean", - N_("auto open relay buffer when a new client is connecting"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - relay_config_look_raw_messages = weechat_config_new_option ( - relay_config_file, ptr_section, - "raw_messages", "integer", - N_("number of raw messages to save in memory when raw data buffer is " - "closed (messages will be displayed when opening raw data buffer)"), - NULL, 0, 65535, "256", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - - /* section color */ - ptr_section = weechat_config_new_section (relay_config_file, "color", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (relay_config_file); - relay_config_file = NULL; - return 0; - } - - relay_config_color_client = weechat_config_new_option ( - relay_config_file, ptr_section, - "client", "color", - N_("text color for client description"), - NULL, 0, 0, "cyan", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - relay_config_color_status[RELAY_STATUS_CONNECTED] = weechat_config_new_option ( - relay_config_file, ptr_section, - "status_active", "color", - N_("text color for \"connected\" status"), - NULL, 0, 0, "green", NULL, 0, + relay_config_section_look = weechat_config_new_section ( + relay_config_file, "look", + 0, 0, NULL, NULL, NULL, - &relay_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - relay_config_color_status[RELAY_STATUS_AUTH_FAILED] = weechat_config_new_option ( - relay_config_file, ptr_section, - "status_auth_failed", "color", - N_("text color for \"authentication failed\" status"), - NULL, 0, 0, "lightmagenta", NULL, 0, NULL, NULL, NULL, - &relay_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - relay_config_color_status[RELAY_STATUS_CONNECTING] = weechat_config_new_option ( - relay_config_file, ptr_section, - "status_connecting", "color", - N_("text color for \"connecting\" status"), - NULL, 0, 0, "white", NULL, 0, NULL, NULL, NULL, - &relay_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - relay_config_color_status[RELAY_STATUS_DISCONNECTED] = weechat_config_new_option ( - relay_config_file, ptr_section, - "status_disconnected", "color", - N_("text color for \"disconnected\" status"), - NULL, 0, 0, "lightred", NULL, 0, NULL, NULL, NULL, - &relay_config_refresh_cb, NULL, NULL, NULL, NULL, NULL); - relay_config_color_status[RELAY_STATUS_WAITING_AUTH] = weechat_config_new_option ( - relay_config_file, ptr_section, - "status_waiting_auth", "color", - N_("text color for \"waiting authentication\" status"), - NULL, 0, 0, "yellow", NULL, 0, + if (relay_config_section_look) + { + relay_config_look_auto_open_buffer = weechat_config_new_option ( + relay_config_file, relay_config_section_look, + "auto_open_buffer", "boolean", + N_("auto open relay buffer when a new client is connecting"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + relay_config_look_raw_messages = weechat_config_new_option ( + relay_config_file, relay_config_section_look, + "raw_messages", "integer", + N_("number of raw messages to save in memory when raw data buffer " + "is closed (messages will be displayed when opening raw data " + "buffer)"), + NULL, 0, 65535, "256", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + } + + /* section color */ + relay_config_section_color = weechat_config_new_section ( + relay_config_file, "color", + 0, 0, NULL, NULL, NULL, - &relay_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - relay_config_color_text = weechat_config_new_option ( - relay_config_file, ptr_section, - "text", "color", - N_("text color in relay buffer"), - NULL, 0, 0, "default", NULL, 0, NULL, NULL, NULL, - &relay_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - relay_config_color_text_bg = weechat_config_new_option ( - relay_config_file, ptr_section, - "text_bg", "color", - N_("background color in relay buffer"), - NULL, 0, 0, "default", NULL, 0, NULL, NULL, NULL, - &relay_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - relay_config_color_text_selected = weechat_config_new_option ( - relay_config_file, ptr_section, - "text_selected", "color", - N_("text color of selected line in relay buffer"), - NULL, 0, 0, "white", NULL, 0, NULL, NULL, NULL, - &relay_config_refresh_cb, NULL, NULL, NULL, NULL, NULL); - - /* section network */ - ptr_section = weechat_config_new_section (relay_config_file, "network", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) + if (relay_config_section_color) { - weechat_config_free (relay_config_file); - relay_config_file = NULL; - return 0; + relay_config_color_client = weechat_config_new_option ( + relay_config_file, relay_config_section_color, + "client", "color", + N_("text color for client description"), + NULL, 0, 0, "cyan", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + relay_config_color_status[RELAY_STATUS_CONNECTED] = weechat_config_new_option ( + relay_config_file, relay_config_section_color, + "status_active", "color", + N_("text color for \"connected\" status"), + NULL, 0, 0, "green", NULL, 0, + NULL, NULL, NULL, + &relay_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + relay_config_color_status[RELAY_STATUS_AUTH_FAILED] = weechat_config_new_option ( + relay_config_file, relay_config_section_color, + "status_auth_failed", "color", + N_("text color for \"authentication failed\" status"), + NULL, 0, 0, "lightmagenta", NULL, 0, + NULL, NULL, NULL, + &relay_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + relay_config_color_status[RELAY_STATUS_CONNECTING] = weechat_config_new_option ( + relay_config_file, relay_config_section_color, + "status_connecting", "color", + N_("text color for \"connecting\" status"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &relay_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + relay_config_color_status[RELAY_STATUS_DISCONNECTED] = weechat_config_new_option ( + relay_config_file, relay_config_section_color, + "status_disconnected", "color", + N_("text color for \"disconnected\" status"), + NULL, 0, 0, "lightred", NULL, 0, + NULL, NULL, NULL, + &relay_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + relay_config_color_status[RELAY_STATUS_WAITING_AUTH] = weechat_config_new_option ( + relay_config_file, relay_config_section_color, + "status_waiting_auth", "color", + N_("text color for \"waiting authentication\" status"), + NULL, 0, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &relay_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + relay_config_color_text = weechat_config_new_option ( + relay_config_file, relay_config_section_color, + "text", "color", + N_("text color in relay buffer"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &relay_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + relay_config_color_text_bg = weechat_config_new_option ( + relay_config_file, relay_config_section_color, + "text_bg", "color", + N_("background color in relay buffer"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &relay_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + relay_config_color_text_selected = weechat_config_new_option ( + relay_config_file, relay_config_section_color, + "text_selected", "color", + N_("text color of selected line in relay buffer"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &relay_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); } - relay_config_network_allow_empty_password = weechat_config_new_option ( - relay_config_file, ptr_section, - "allow_empty_password", "boolean", - N_("allow empty password in relay (it should be enabled only for " - "tests or local network)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - relay_config_network_allowed_ips = weechat_config_new_option ( - relay_config_file, ptr_section, - "allowed_ips", "string", - N_("POSIX extended regular expression with IPs allowed to use relay " - "(case insensitive, use \"(?-i)\" at beginning to make it case " - "sensitive), example: " - "\"^(123\\.45\\.67\\.89|192\\.160\\..*)$\""), - NULL, 0, 0, "", NULL, 0, + /* section network */ + relay_config_section_network = weechat_config_new_section ( + relay_config_file, "network", + 0, 0, NULL, NULL, NULL, - &relay_config_change_network_allowed_ips, NULL, NULL, - NULL, NULL, NULL); - relay_config_network_auth_timeout = weechat_config_new_option ( - relay_config_file, ptr_section, - "auth_timeout", "integer", - N_("timeout (in seconds) for client authentication: connection is " - "closed if the client is still not authenticated after this delay " - "and the client status is set to \"authentication failed\" " - "(0 = wait forever)"), - NULL, 0, INT_MAX, "60", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - relay_config_network_bind_address = weechat_config_new_option ( - relay_config_file, ptr_section, - "bind_address", "string", - N_("address for bind (if empty, connection is possible on all " - "interfaces, use \"127.0.0.1\" to allow connections from " - "local machine only)"), - NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, - &relay_config_change_network_bind_address_cb, NULL, NULL, - NULL, NULL, NULL); - relay_config_network_clients_purge_delay = weechat_config_new_option ( - relay_config_file, ptr_section, - "clients_purge_delay", "integer", - N_("delay for purging disconnected clients (in minutes, 0 = purge " - "clients immediately, -1 = never purge)"), - NULL, -1, 60 * 24 * 30, "0", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - relay_config_network_compression = weechat_config_new_option ( - relay_config_file, ptr_section, - "compression", "integer", - N_("compression of messages sent to clients with \"weechat\" " - "protocol: 0 = disable compression, 1 = low compression / fast " - "... 100 = best compression / slow; the value is a percentage " - "converted to 1-9 for zlib and 1-19 for zstd; " - "the default value is recommended, it offers a good " - "compromise between compression and speed"), - NULL, 0, 100, "20", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - relay_config_network_ipv6 = weechat_config_new_option ( - relay_config_file, ptr_section, - "ipv6", "boolean", - N_("listen on IPv6 socket by default (in addition to IPv4 which is " - "default); protocols IPv4 and IPv6 can be forced (individually or " - "together) in the protocol name (see /help relay)"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, - &relay_config_change_network_ipv6_cb, NULL, NULL, - NULL, NULL, NULL); - relay_config_network_max_clients = weechat_config_new_option ( - relay_config_file, ptr_section, - "max_clients", "integer", - N_("maximum number of clients connecting to a port (0 = no limit)"), - NULL, 0, INT_MAX, "5", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - relay_config_network_nonce_size = weechat_config_new_option ( - relay_config_file, ptr_section, - "nonce_size", "integer", - N_("size of nonce (in bytes), generated when a client connects; " - "the client must use this nonce, concatenated to the client nonce " - "and the password when hashing the password in the \"init\" " - "command of the weechat protocol"), - NULL, 8, 128, "16", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - relay_config_network_password = weechat_config_new_option ( - relay_config_file, ptr_section, - "password", "string", - N_("password required by clients to access this relay (empty value " - "means no password required, see option " - "relay.network.allow_empty_password) (note: content is evaluated, " - "see /help eval)"), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - relay_config_network_password_hash_algo = weechat_config_new_option ( - relay_config_file, ptr_section, - "password_hash_algo", "string", - N_("comma separated list of hash algorithms used for password " - "authentication in weechat protocol, among these values: \"plain\" " - "(password in plain text, not hashed), \"sha256\", \"sha512\", " - "\"pbkdf2+sha256\", \"pbkdf2+sha512\"), \"*\" means all algorithms, " - "a name beginning with \"!\" is a negative value to prevent an " - "algorithm from being used, wildcard \"*\" is allowed in names " - "(examples: \"*\", \"pbkdf2*\", \"*,!plain\")"), - NULL, 0, 0, "*", NULL, 0, NULL, NULL, NULL, - &relay_config_change_network_password_hash_algo, NULL, NULL, NULL, NULL, NULL); - relay_config_network_password_hash_iterations = weechat_config_new_option ( - relay_config_file, ptr_section, - "password_hash_iterations", "integer", - N_("number of iterations asked to the client in weechat protocol " - "when a hashed password with algorithm PBKDF2 is used for " - "authentication; more iterations is better in term of security but " - "is slower to compute; this number should not be too high if your " - "CPU is slow"), - NULL, 1, 1000000, "100000", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - relay_config_network_ssl_cert_key = weechat_config_new_option ( - relay_config_file, ptr_section, - "ssl_cert_key", "string", - N_("file with SSL certificate and private key (for serving clients " - "with SSL) " - "(path is evaluated, see function string_eval_path_home in " - "plugin API reference)"), - NULL, 0, 0, "${weechat_config_dir}/ssl/relay.pem", NULL, 0, + if (relay_config_section_network) + { + relay_config_network_allow_empty_password = weechat_config_new_option ( + relay_config_file, relay_config_section_network, + "allow_empty_password", "boolean", + N_("allow empty password in relay (it should be enabled only for " + "tests or local network)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + relay_config_network_allowed_ips = weechat_config_new_option ( + relay_config_file, relay_config_section_network, + "allowed_ips", "string", + N_("POSIX extended regular expression with IPs allowed to use relay " + "(case insensitive, use \"(?-i)\" at beginning to make it case " + "sensitive), example: " + "\"^(123\\.45\\.67\\.89|192\\.160\\..*)$\""), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &relay_config_change_network_allowed_ips, NULL, NULL, + NULL, NULL, NULL); + relay_config_network_auth_timeout = weechat_config_new_option ( + relay_config_file, relay_config_section_network, + "auth_timeout", "integer", + N_("timeout (in seconds) for client authentication: connection is " + "closed if the client is still not authenticated after this " + "delay and the client status is set to \"authentication " + "failed\" (0 = wait forever)"), + NULL, 0, INT_MAX, "60", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + relay_config_network_bind_address = weechat_config_new_option ( + relay_config_file, relay_config_section_network, + "bind_address", "string", + N_("address for bind (if empty, connection is possible on all " + "interfaces, use \"127.0.0.1\" to allow connections from " + "local machine only)"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &relay_config_change_network_bind_address_cb, NULL, NULL, + NULL, NULL, NULL); + relay_config_network_clients_purge_delay = weechat_config_new_option ( + relay_config_file, relay_config_section_network, + "clients_purge_delay", "integer", + N_("delay for purging disconnected clients (in minutes, 0 = purge " + "clients immediately, -1 = never purge)"), + NULL, -1, 60 * 24 * 30, "0", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + relay_config_network_compression = weechat_config_new_option ( + relay_config_file, relay_config_section_network, + "compression", "integer", + N_("compression of messages sent to clients with \"weechat\" " + "protocol: 0 = disable compression, 1 = low compression / fast " + "... 100 = best compression / slow; the value is a percentage " + "converted to 1-9 for zlib and 1-19 for zstd; " + "the default value is recommended, it offers a good " + "compromise between compression and speed"), + NULL, 0, 100, "20", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + relay_config_network_ipv6 = weechat_config_new_option ( + relay_config_file, relay_config_section_network, + "ipv6", "boolean", + N_("listen on IPv6 socket by default (in addition to IPv4 which is " + "default); protocols IPv4 and IPv6 can be forced (individually " + "or together) in the protocol name (see /help relay)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &relay_config_change_network_ipv6_cb, NULL, NULL, + NULL, NULL, NULL); + relay_config_network_max_clients = weechat_config_new_option ( + relay_config_file, relay_config_section_network, + "max_clients", "integer", + N_("maximum number of clients connecting to a port (0 = no limit)"), + NULL, 0, INT_MAX, "5", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + relay_config_network_nonce_size = weechat_config_new_option ( + relay_config_file, relay_config_section_network, + "nonce_size", "integer", + N_("size of nonce (in bytes), generated when a client connects; " + "the client must use this nonce, concatenated to the client nonce " + "and the password when hashing the password in the \"init\" " + "command of the weechat protocol"), + NULL, 8, 128, "16", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + relay_config_network_password = weechat_config_new_option ( + relay_config_file, relay_config_section_network, + "password", "string", + N_("password required by clients to access this relay (empty value " + "means no password required, see option " + "relay.network.allow_empty_password) (note: content is evaluated, " + "see /help eval)"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + relay_config_network_password_hash_algo = weechat_config_new_option ( + relay_config_file, relay_config_section_network, + "password_hash_algo", "string", + N_("comma separated list of hash algorithms used for password " + "authentication in weechat protocol, among these values: " + "\"plain\" (password in plain text, not hashed), \"sha256\", " + "\"sha512\", \"pbkdf2+sha256\", \"pbkdf2+sha512\"), \"*\" means " + "all algorithms, a name beginning with \"!\" is a negative " + "value to prevent an algorithm from being used, wildcard \"*\" " + "is allowed in names (examples: \"*\", \"pbkdf2*\", " + "\"*,!plain\")"), + NULL, 0, 0, "*", NULL, 0, + NULL, NULL, NULL, + &relay_config_change_network_password_hash_algo, NULL, NULL, + NULL, NULL, NULL); + relay_config_network_password_hash_iterations = weechat_config_new_option ( + relay_config_file, relay_config_section_network, + "password_hash_iterations", "integer", + N_("number of iterations asked to the client in weechat protocol " + "when a hashed password with algorithm PBKDF2 is used for " + "authentication; more iterations is better in term of security " + "but is slower to compute; this number should not be too high " + "if your CPU is slow"), + NULL, 1, 1000000, "100000", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + relay_config_network_ssl_cert_key = weechat_config_new_option ( + relay_config_file, relay_config_section_network, + "ssl_cert_key", "string", + N_("file with SSL certificate and private key (for serving clients " + "with SSL) " + "(path is evaluated, see function string_eval_path_home in " + "plugin API reference)"), + NULL, 0, 0, "${weechat_config_dir}/ssl/relay.pem", NULL, 0, + NULL, NULL, NULL, + &relay_config_change_network_ssl_cert_key, NULL, NULL, + NULL, NULL, NULL); + relay_config_network_ssl_priorities = weechat_config_new_option ( + relay_config_file, relay_config_section_network, + "ssl_priorities", "string", + N_("string with priorities for gnutls (for syntax, see " + "documentation of function gnutls_priority_init in gnutls " + "manual, common strings are: \"PERFORMANCE\", \"NORMAL\", " + "\"SECURE128\", \"SECURE256\", \"EXPORT\", \"NONE\")"), + NULL, 0, 0, "NORMAL:-VERS-SSL3.0", NULL, 0, + &relay_config_check_network_ssl_priorities, NULL, NULL, + &relay_config_change_network_ssl_priorities, NULL, NULL, + NULL, NULL, NULL); + relay_config_network_totp_secret = weechat_config_new_option ( + relay_config_file, relay_config_section_network, + "totp_secret", "string", + N_("secret for the generation of the Time-based One-Time Password " + "(TOTP), encoded in base32 (only letters and digits from 2 to 7); " + "it is used as second factor in weechat protocol, in addition to " + "the password, which must not be empty " + "(empty value means no TOTP is required) " + "(note: content is evaluated, see /help eval)"), + NULL, 0, 0, "", NULL, 0, + &relay_config_check_network_totp_secret, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + relay_config_network_totp_window = weechat_config_new_option ( + relay_config_file, relay_config_section_network, + "totp_window", "integer", + N_("number of Time-based One-Time Passwords to accept before and " + "after the current one: " + "0 = accept only the current password, " + "1 = accept one password before, the current, and one after, " + "2 = accept two passwords before, the current, and two after, " + "...; a high number reduces the security level " + "(0 or 1 are recommended values)"), + NULL, 0, 256, "0", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + relay_config_network_websocket_allowed_origins = weechat_config_new_option ( + relay_config_file, relay_config_section_network, + "websocket_allowed_origins", "string", + N_("POSIX extended regular expression with origins allowed in " + "websockets (case insensitive, use \"(?-i)\" at beginning to " + "make it case sensitive), example: " + "\"^https?://(www\\.)?example\\.(com|org)\""), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &relay_config_change_network_websocket_allowed_origins, NULL, NULL, + NULL, NULL, NULL); + } + + /* section irc */ + relay_config_section_irc = weechat_config_new_section ( + relay_config_file, "irc", + 0, 0, + NULL, NULL, NULL, NULL, NULL, NULL, - &relay_config_change_network_ssl_cert_key, NULL, NULL, - NULL, NULL, NULL); - relay_config_network_ssl_priorities = weechat_config_new_option ( - relay_config_file, ptr_section, - "ssl_priorities", "string", - N_("string with priorities for gnutls (for syntax, see " - "documentation of function gnutls_priority_init in gnutls " - "manual, common strings are: \"PERFORMANCE\", \"NORMAL\", " - "\"SECURE128\", \"SECURE256\", \"EXPORT\", \"NONE\")"), - NULL, 0, 0, "NORMAL:-VERS-SSL3.0", NULL, 0, - &relay_config_check_network_ssl_priorities, NULL, NULL, - &relay_config_change_network_ssl_priorities, NULL, NULL, - NULL, NULL, NULL); - relay_config_network_totp_secret = weechat_config_new_option ( - relay_config_file, ptr_section, - "totp_secret", "string", - N_("secret for the generation of the Time-based One-Time Password " - "(TOTP), encoded in base32 (only letters and digits from 2 to 7); " - "it is used as second factor in weechat protocol, in addition to " - "the password, which must not be empty " - "(empty value means no TOTP is required) " - "(note: content is evaluated, see /help eval)"), - NULL, 0, 0, "", NULL, 0, - &relay_config_check_network_totp_secret, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL); - relay_config_network_totp_window = weechat_config_new_option ( - relay_config_file, ptr_section, - "totp_window", "integer", - N_("number of Time-based One-Time Passwords to accept before and " - "after the current one: " - "0 = accept only the current password, " - "1 = accept one password before, the current, and one after, " - "2 = accept two passwords before, the current, and two after, " - "...; a high number reduces the security level " - "(0 or 1 are recommended values)"), - NULL, 0, 256, "0", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - relay_config_network_websocket_allowed_origins = weechat_config_new_option ( - relay_config_file, ptr_section, - "websocket_allowed_origins", "string", - N_("POSIX extended regular expression with origins allowed in " - "websockets (case insensitive, use \"(?-i)\" at beginning to make " - "it case sensitive), example: " - "\"^https?://(www\\.)?example\\.(com|org)\""), - NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, - &relay_config_change_network_websocket_allowed_origins, NULL, NULL, NULL, NULL, NULL); - - /* section irc */ - ptr_section = weechat_config_new_section (relay_config_file, "irc", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) + if (relay_config_section_irc) { - weechat_config_free (relay_config_file); - relay_config_file = NULL; - return 0; + relay_config_irc_backlog_max_minutes = weechat_config_new_option ( + relay_config_file, relay_config_section_irc, + "backlog_max_minutes", "integer", + N_("maximum number of minutes in backlog per IRC channel " + "(0 = unlimited, examples: 1440 = one day, 10080 = one week, " + "43200 = one month, 525600 = one year)"), + NULL, 0, INT_MAX, "0", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + relay_config_irc_backlog_max_number = weechat_config_new_option ( + relay_config_file, relay_config_section_irc, + "backlog_max_number", "integer", + N_("maximum number of lines in backlog per IRC channel " + "(0 = unlimited)"), + NULL, 0, INT_MAX, "1024", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + relay_config_irc_backlog_since_last_disconnect = weechat_config_new_option ( + relay_config_file, relay_config_section_irc, + "backlog_since_last_disconnect", "boolean", + N_("display backlog starting from last client disconnect"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + relay_config_irc_backlog_since_last_message = weechat_config_new_option ( + relay_config_file, relay_config_section_irc, + "backlog_since_last_message", "boolean", + N_("display backlog starting from your last message"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + relay_config_irc_backlog_tags = weechat_config_new_option ( + relay_config_file, relay_config_section_irc, + "backlog_tags", "string", + N_("comma-separated list of messages tags which are displayed in " + "backlog per IRC channel (supported tags: \"irc_join\", " + "\"irc_part\", \"irc_quit\", \"irc_nick\", \"irc_privmsg\"), " + "\"*\" = all supported tags"), + NULL, 0, 0, "irc_privmsg", NULL, 0, + &relay_config_check_irc_backlog_tags, NULL, NULL, + &relay_config_change_irc_backlog_tags, NULL, NULL, + NULL, NULL, NULL); + relay_config_irc_backlog_time_format = weechat_config_new_option ( + relay_config_file, relay_config_section_irc, + "backlog_time_format", "string", + N_("format for time in backlog messages (see man strftime for " + "format) (not used if server capability \"server-time\" was " + "enabled by client, because time is sent as irc tag); empty " + "string = disable time in backlog messages"), + NULL, 0, 0, "[%H:%M] ", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } - relay_config_irc_backlog_max_minutes = weechat_config_new_option ( - relay_config_file, ptr_section, - "backlog_max_minutes", "integer", - N_("maximum number of minutes in backlog per IRC channel " - "(0 = unlimited, examples: 1440 = one day, 10080 = one week, " - "43200 = one month, 525600 = one year)"), - NULL, 0, INT_MAX, "0", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - relay_config_irc_backlog_max_number = weechat_config_new_option ( - relay_config_file, ptr_section, - "backlog_max_number", "integer", - N_("maximum number of lines in backlog per IRC channel " - "(0 = unlimited)"), - NULL, 0, INT_MAX, "1024", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - relay_config_irc_backlog_since_last_disconnect = weechat_config_new_option ( - relay_config_file, ptr_section, - "backlog_since_last_disconnect", "boolean", - N_("display backlog starting from last client disconnect"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - relay_config_irc_backlog_since_last_message = weechat_config_new_option ( - relay_config_file, ptr_section, - "backlog_since_last_message", "boolean", - N_("display backlog starting from your last message"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - relay_config_irc_backlog_tags = weechat_config_new_option ( - relay_config_file, ptr_section, - "backlog_tags", "string", - N_("comma-separated list of messages tags which are displayed in " - "backlog per IRC channel (supported tags: \"irc_join\", " - "\"irc_part\", \"irc_quit\", \"irc_nick\", \"irc_privmsg\"), " - "\"*\" = all supported tags"), - NULL, 0, 0, "irc_privmsg", NULL, 0, - &relay_config_check_irc_backlog_tags, NULL, NULL, - &relay_config_change_irc_backlog_tags, NULL, NULL, - NULL, NULL, NULL); - relay_config_irc_backlog_time_format = weechat_config_new_option ( - relay_config_file, ptr_section, - "backlog_time_format", "string", - N_("format for time in backlog messages (see man strftime for format) " - "(not used if server capability \"server-time\" was enabled by " - "client, because time is sent as irc tag); empty string = disable " - "time in backlog messages"), - NULL, 0, 0, "[%H:%M] ", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - /* section weechat */ - ptr_section = weechat_config_new_section (relay_config_file, "weechat", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (relay_config_file); - relay_config_file = NULL; - return 0; - } - - relay_config_weechat_commands = weechat_config_new_option ( - relay_config_file, ptr_section, - "commands", "string", - N_("comma-separated list of commands allowed/denied when input " - "data (text or command) is received from a client; " - "\"*\" means any command, a name beginning with \"!\" is " - "a negative value to prevent a command from being executed, " - "wildcard \"*\" is allowed in names; this option should be set if " - "the relay client is not safe (someone could use it to run " - "commands); for example \"*,!exec,!quit\" allows any command " - "except /exec and /quit"), - NULL, 0, 0, "", NULL, 0, + relay_config_section_weechat = weechat_config_new_section ( + relay_config_file, "weechat", + 0, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + if (relay_config_section_weechat) + { + relay_config_weechat_commands = weechat_config_new_option ( + relay_config_file, relay_config_section_weechat, + "commands", "string", + N_("comma-separated list of commands allowed/denied when input " + "data (text or command) is received from a client; " + "\"*\" means any command, a name beginning with \"!\" is " + "a negative value to prevent a command from being executed, " + "wildcard \"*\" is allowed in names; this option should be set " + "if the relay client is not safe (someone could use it to run " + "commands); for example \"*,!exec,!quit\" allows any command " + "except /exec and /quit"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + } /* section port */ - ptr_section = weechat_config_new_section ( + relay_config_section_port = weechat_config_new_section ( relay_config_file, "port", 1, 1, NULL, NULL, NULL, @@ -1301,17 +1296,9 @@ relay_config_init () NULL, NULL, NULL, &relay_config_create_option_port_path, NULL, NULL, NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (relay_config_file); - relay_config_file = NULL; - return 0; - } - - relay_config_section_port = ptr_section; /* section path */ - ptr_section = weechat_config_new_section ( + relay_config_section_path = weechat_config_new_section ( relay_config_file, "path", 1, 1, NULL, NULL, NULL, @@ -1319,14 +1306,6 @@ relay_config_init () NULL, NULL, NULL, &relay_config_create_option_port_path, NULL, NULL, NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (relay_config_file); - relay_config_file = NULL; - return 0; - } - - relay_config_section_path = ptr_section; return 1; } diff --git a/src/plugins/script/script-config.c b/src/plugins/script/script-config.c index ea9e9290f..cf7c16961 100644 --- a/src/plugins/script/script-config.c +++ b/src/plugins/script/script-config.c @@ -35,55 +35,61 @@ struct t_config_file *script_config_file = NULL; +/* sections */ + +struct t_config_section *script_config_section_look = NULL; +struct t_config_section *script_config_section_color = NULL; +struct t_config_section *script_config_section_scripts = NULL; + /* script config, look section */ -struct t_config_option *script_config_look_columns; -struct t_config_option *script_config_look_diff_color; -struct t_config_option *script_config_look_diff_command; -struct t_config_option *script_config_look_display_source; -struct t_config_option *script_config_look_quiet_actions; -struct t_config_option *script_config_look_sort; -struct t_config_option *script_config_look_translate_description; -struct t_config_option *script_config_look_use_keys; +struct t_config_option *script_config_look_columns = NULL; +struct t_config_option *script_config_look_diff_color = NULL; +struct t_config_option *script_config_look_diff_command = NULL; +struct t_config_option *script_config_look_display_source = NULL; +struct t_config_option *script_config_look_quiet_actions = NULL; +struct t_config_option *script_config_look_sort = NULL; +struct t_config_option *script_config_look_translate_description = NULL; +struct t_config_option *script_config_look_use_keys = NULL; /* script config, color section */ -struct t_config_option *script_config_color_status_autoloaded; -struct t_config_option *script_config_color_status_held; -struct t_config_option *script_config_color_status_installed; -struct t_config_option *script_config_color_status_obsolete; -struct t_config_option *script_config_color_status_popular; -struct t_config_option *script_config_color_status_running; -struct t_config_option *script_config_color_status_unknown; -struct t_config_option *script_config_color_text; -struct t_config_option *script_config_color_text_bg; -struct t_config_option *script_config_color_text_bg_selected; -struct t_config_option *script_config_color_text_date; -struct t_config_option *script_config_color_text_date_selected; -struct t_config_option *script_config_color_text_delimiters; -struct t_config_option *script_config_color_text_description; -struct t_config_option *script_config_color_text_description_selected; -struct t_config_option *script_config_color_text_extension; -struct t_config_option *script_config_color_text_extension_selected; -struct t_config_option *script_config_color_text_name; -struct t_config_option *script_config_color_text_name_selected; -struct t_config_option *script_config_color_text_selected; -struct t_config_option *script_config_color_text_tags; -struct t_config_option *script_config_color_text_tags_selected; -struct t_config_option *script_config_color_text_version; -struct t_config_option *script_config_color_text_version_loaded; -struct t_config_option *script_config_color_text_version_loaded_selected; -struct t_config_option *script_config_color_text_version_selected; +struct t_config_option *script_config_color_status_autoloaded = NULL; +struct t_config_option *script_config_color_status_held = NULL; +struct t_config_option *script_config_color_status_installed = NULL; +struct t_config_option *script_config_color_status_obsolete = NULL; +struct t_config_option *script_config_color_status_popular = NULL; +struct t_config_option *script_config_color_status_running = NULL; +struct t_config_option *script_config_color_status_unknown = NULL; +struct t_config_option *script_config_color_text = NULL; +struct t_config_option *script_config_color_text_bg = NULL; +struct t_config_option *script_config_color_text_bg_selected = NULL; +struct t_config_option *script_config_color_text_date = NULL; +struct t_config_option *script_config_color_text_date_selected = NULL; +struct t_config_option *script_config_color_text_delimiters = NULL; +struct t_config_option *script_config_color_text_description = NULL; +struct t_config_option *script_config_color_text_description_selected = NULL; +struct t_config_option *script_config_color_text_extension = NULL; +struct t_config_option *script_config_color_text_extension_selected = NULL; +struct t_config_option *script_config_color_text_name = NULL; +struct t_config_option *script_config_color_text_name_selected = NULL; +struct t_config_option *script_config_color_text_selected = NULL; +struct t_config_option *script_config_color_text_tags = NULL; +struct t_config_option *script_config_color_text_tags_selected = NULL; +struct t_config_option *script_config_color_text_version = NULL; +struct t_config_option *script_config_color_text_version_loaded = NULL; +struct t_config_option *script_config_color_text_version_loaded_selected = NULL; +struct t_config_option *script_config_color_text_version_selected = NULL; /* script config, scripts section */ -struct t_config_option *script_config_scripts_autoload; -struct t_config_option *script_config_scripts_cache_expire; -struct t_config_option *script_config_scripts_download_enabled; -struct t_config_option *script_config_scripts_download_timeout; -struct t_config_option *script_config_scripts_hold; -struct t_config_option *script_config_scripts_path; -struct t_config_option *script_config_scripts_url; +struct t_config_option *script_config_scripts_autoload = NULL; +struct t_config_option *script_config_scripts_cache_expire = NULL; +struct t_config_option *script_config_scripts_download_enabled = NULL; +struct t_config_option *script_config_scripts_download_timeout = NULL; +struct t_config_option *script_config_scripts_hold = NULL; +struct t_config_option *script_config_scripts_path = NULL; +struct t_config_option *script_config_scripts_url = NULL; /* @@ -418,8 +424,6 @@ script_config_reload (const void *pointer, void *data, int script_config_init () { - struct t_config_section *ptr_section; - script_config_file = weechat_config_new ( SCRIPT_CONFIG_PRIO_NAME, &script_config_reload, NULL, NULL); @@ -427,392 +431,384 @@ script_config_init () return 0; /* look */ - ptr_section = weechat_config_new_section (script_config_file, "look", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (script_config_file); - script_config_file = NULL; - return 0; - } - - script_config_look_columns = weechat_config_new_option ( - script_config_file, ptr_section, - "columns", "string", - N_("format of columns displayed in script buffer: following column " - "identifiers are replaced by their values: %a=author, %d=description, " - "%D=date added, %e=extension, %l=language, %L=license, %n=name with " - "extension, %N=name, %r=requirements, %s=status, %t=tags, " - "%u=date updated, %v=version, %V=version loaded, %w=min_weechat, " - "%W=max_weechat)"), - NULL, 0, 0, "%s %n %V %v %u | %d | %t", NULL, 0, + script_config_section_look = weechat_config_new_section ( + script_config_file, "look", + 0, 0, NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_look_diff_color = weechat_config_new_option ( - script_config_file, ptr_section, - "diff_color", "boolean", - N_("colorize output of diff"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - script_config_look_diff_command = weechat_config_new_option ( - script_config_file, ptr_section, - "diff_command", "string", - N_("command used to show differences between script installed and the " - "new version in repository (\"auto\" = auto detect diff command (git " - "or diff), empty value = disable diff, other string = name of " - "command, for example \"diff\")"), - NULL, 0, 0, "auto", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - script_config_look_display_source = weechat_config_new_option ( - script_config_file, ptr_section, - "display_source", "boolean", - N_("display source code of script on buffer with detail on a script " - "(script is downloaded in a temporary file when detail on script " - "is displayed)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - script_config_look_quiet_actions = weechat_config_new_option ( - script_config_file, ptr_section, - "quiet_actions", "boolean", - N_("quiet actions on script buffer: do not display messages on core " - "buffer when scripts are installed/removed/loaded/unloaded (only " - "errors are displayed)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - script_config_look_sort = weechat_config_new_option ( - script_config_file, ptr_section, - "sort", "string", - N_("default sort keys for scripts: comma-separated list of identifiers: " - "a=author, A=autoloaded, d=date added, e=extension, i=installed, " - "l=language, n=name, o=obsolete, p=popularity, r=running, " - "u=date updated; char \"-\" can be used before identifier to reverse " - "order; example: \"i,u\": installed scripts first, sorted by update " - "date"), - NULL, 0, 0, "i,p,n", NULL, 0, NULL, NULL, NULL, - &script_config_reload_scripts_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_look_translate_description = weechat_config_new_option ( - script_config_file, ptr_section, - "translate_description", "boolean", - N_("translate description of scripts (if translation is available in " - "your language, otherwise English version is used)"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, - &script_config_reload_scripts_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_look_use_keys = weechat_config_new_option ( - script_config_file, ptr_section, - "use_keys", "boolean", - N_("use keys alt+X in script buffer to do actions on scripts (alt+i = " - "install, alt+r = remove, ...); if disabled, only the input is " - "allowed: i, r, ..."), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, - &script_config_change_use_keys_cb, NULL, NULL, NULL, NULL, NULL); - - /* color */ - ptr_section = weechat_config_new_section (script_config_file, "color", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) + if (script_config_section_look) { - weechat_config_free (script_config_file); - script_config_file = NULL; - return 0; + script_config_look_columns = weechat_config_new_option ( + script_config_file, script_config_section_look, + "columns", "string", + N_("format of columns displayed in script buffer: following column " + "identifiers are replaced by their values: %a=author, " + "%d=description, %D=date added, %e=extension, %l=language, " + "%L=license, %n=name with extension, %N=name, %r=requirements, " + "%s=status, %t=tags, %u=date updated, %v=version, " + "%V=version loaded, %w=min_weechat, %W=max_weechat)"), + NULL, 0, 0, "%s %n %V %v %u | %d | %t", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_look_diff_color = weechat_config_new_option ( + script_config_file, script_config_section_look, + "diff_color", "boolean", + N_("colorize output of diff"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + script_config_look_diff_command = weechat_config_new_option ( + script_config_file, script_config_section_look, + "diff_command", "string", + N_("command used to show differences between script installed and " + "the new version in repository (\"auto\" = auto detect diff " + "command (git or diff), empty value = disable diff, other " + "string = name of command, for example \"diff\")"), + NULL, 0, 0, "auto", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + script_config_look_display_source = weechat_config_new_option ( + script_config_file, script_config_section_look, + "display_source", "boolean", + N_("display source code of script on buffer with detail on a script " + "(script is downloaded in a temporary file when detail on script " + "is displayed)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + script_config_look_quiet_actions = weechat_config_new_option ( + script_config_file, script_config_section_look, + "quiet_actions", "boolean", + N_("quiet actions on script buffer: do not display messages on core " + "buffer when scripts are installed/removed/loaded/unloaded (only " + "errors are displayed)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + script_config_look_sort = weechat_config_new_option ( + script_config_file, script_config_section_look, + "sort", "string", + N_("default sort keys for scripts: comma-separated list of " + "identifiers: a=author, A=autoloaded, d=date added, e=extension, " + "i=installed, l=language, n=name, o=obsolete, p=popularity, " + "r=running, u=date updated; char \"-\" can be used before " + "identifier to reverse order; example: \"i,u\": installed " + "scripts first, sorted by update date"), + NULL, 0, 0, "i,p,n", NULL, 0, + NULL, NULL, NULL, + &script_config_reload_scripts_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_look_translate_description = weechat_config_new_option ( + script_config_file, script_config_section_look, + "translate_description", "boolean", + N_("translate description of scripts (if translation is available " + "in your language, otherwise English version is used)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &script_config_reload_scripts_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_look_use_keys = weechat_config_new_option ( + script_config_file, script_config_section_look, + "use_keys", "boolean", + N_("use keys alt+X in script buffer to do actions on scripts " + "(alt+i = install, alt+r = remove, ...); if disabled, only the " + "input is allowed: i, r, ..."), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &script_config_change_use_keys_cb, NULL, NULL, + NULL, NULL, NULL); } - script_config_color_status_autoloaded = weechat_config_new_option ( - script_config_file, ptr_section, - "status_autoloaded", "color", - N_("color for status \"autoloaded\" (\"a\")"), - NULL, 0, 0, "cyan", NULL, 0, - NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_status_held = weechat_config_new_option ( - script_config_file, ptr_section, - "status_held", "color", - N_("color for status \"held\" (\"H\")"), - NULL, 0, 0, "white", NULL, 0, - NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_status_installed = weechat_config_new_option ( - script_config_file, ptr_section, - "status_installed", "color", - N_("color for status \"installed\" (\"i\")"), - NULL, 0, 0, "lightcyan", NULL, 0, - NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_status_obsolete = weechat_config_new_option ( - script_config_file, ptr_section, - "status_obsolete", "color", - N_("color for status \"obsolete\" (\"N\")"), - NULL, 0, 0, "lightmagenta", NULL, 0, - NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_status_popular = weechat_config_new_option ( - script_config_file, ptr_section, - "status_popular", "color", - N_("color for status \"popular\" (\"*\")"), - NULL, 0, 0, "yellow", NULL, 0, - NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_status_running = weechat_config_new_option ( - script_config_file, ptr_section, - "status_running", "color", - N_("color for status \"running\" (\"r\")"), - NULL, 0, 0, "lightgreen", NULL, 0, - NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_status_unknown = weechat_config_new_option ( - script_config_file, ptr_section, - "status_unknown", "color", - N_("color for status \"unknown\" (\"?\")"), - NULL, 0, 0, "lightred", NULL, 0, - NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_text = weechat_config_new_option ( - script_config_file, ptr_section, - "text", "color", - N_("text color in script buffer"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_text_bg = weechat_config_new_option ( - script_config_file, ptr_section, - "text_bg", "color", - N_("background color in script buffer"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_text_bg_selected = weechat_config_new_option ( - script_config_file, ptr_section, - "text_bg_selected", "color", - N_("background color for selected line in script buffer"), - NULL, 0, 0, "red", NULL, 0, - NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_text_date = weechat_config_new_option ( - script_config_file, ptr_section, - "text_date", "color", - N_("text color of dates in script buffer"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_text_date_selected = weechat_config_new_option ( - script_config_file, ptr_section, - "text_date_selected", "color", - N_("text color of dates for selected line in script buffer"), - NULL, 0, 0, "white", NULL, 0, - NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_text_delimiters = weechat_config_new_option ( - script_config_file, ptr_section, - "text_delimiters", "color", - N_("text color of delimiters in script buffer"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_text_description = weechat_config_new_option ( - script_config_file, ptr_section, - "text_description", "color", - N_("text color of description in script buffer"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_text_description_selected = weechat_config_new_option ( - script_config_file, ptr_section, - "text_description_selected", "color", - N_("text color of description for selected line in script buffer"), - NULL, 0, 0, "white", NULL, 0, - NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_text_extension = weechat_config_new_option ( - script_config_file, ptr_section, - "text_extension", "color", - N_("text color of extension in script buffer"), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_text_extension_selected = weechat_config_new_option ( - script_config_file, ptr_section, - "text_extension_selected", "color", - N_("text color of extension for selected line in script buffer"), - NULL, 0, 0, "white", NULL, 0, + /* color */ + script_config_section_color = weechat_config_new_section ( + script_config_file, "color", + 0, 0, NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_text_name = weechat_config_new_option ( - script_config_file, ptr_section, - "text_name", "color", - N_("text color of script name in script buffer"), - NULL, 0, 0, "cyan", NULL, 0, NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_text_name_selected = weechat_config_new_option ( - script_config_file, ptr_section, - "text_name_selected", "color", - N_("text color of script name for selected line in script buffer"), - NULL, 0, 0, "lightcyan", NULL, 0, NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_text_selected = weechat_config_new_option ( - script_config_file, ptr_section, - "text_selected", "color", - N_("text color for selected line in script buffer"), - NULL, 0, 0, "white", NULL, 0, NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, NULL, NULL, NULL); - script_config_color_text_tags = weechat_config_new_option ( - script_config_file, ptr_section, - "text_tags", "color", - N_("text color of tags in script buffer"), - NULL, 0, 0, "brown", NULL, 0, - NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_text_tags_selected = weechat_config_new_option ( - script_config_file, ptr_section, - "text_tags_selected", "color", - N_("text color of tags for selected line in script buffer"), - NULL, 0, 0, "yellow", NULL, 0, - NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_text_version = weechat_config_new_option ( - script_config_file, ptr_section, - "text_version", "color", - N_("text color of version in script buffer"), - NULL, 0, 0, "magenta", NULL, 0, + if (script_config_section_color) + { + script_config_color_status_autoloaded = weechat_config_new_option ( + script_config_file, script_config_section_color, + "status_autoloaded", "color", + N_("color for status \"autoloaded\" (\"a\")"), + NULL, 0, 0, "cyan", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_status_held = weechat_config_new_option ( + script_config_file, script_config_section_color, + "status_held", "color", + N_("color for status \"held\" (\"H\")"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_status_installed = weechat_config_new_option ( + script_config_file, script_config_section_color, + "status_installed", "color", + N_("color for status \"installed\" (\"i\")"), + NULL, 0, 0, "lightcyan", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_status_obsolete = weechat_config_new_option ( + script_config_file, script_config_section_color, + "status_obsolete", "color", + N_("color for status \"obsolete\" (\"N\")"), + NULL, 0, 0, "lightmagenta", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_status_popular = weechat_config_new_option ( + script_config_file, script_config_section_color, + "status_popular", "color", + N_("color for status \"popular\" (\"*\")"), + NULL, 0, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_status_running = weechat_config_new_option ( + script_config_file, script_config_section_color, + "status_running", "color", + N_("color for status \"running\" (\"r\")"), + NULL, 0, 0, "lightgreen", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_status_unknown = weechat_config_new_option ( + script_config_file, script_config_section_color, + "status_unknown", "color", + N_("color for status \"unknown\" (\"?\")"), + NULL, 0, 0, "lightred", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_text = weechat_config_new_option ( + script_config_file, script_config_section_color, + "text", "color", + N_("text color in script buffer"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_text_bg = weechat_config_new_option ( + script_config_file, script_config_section_color, + "text_bg", "color", + N_("background color in script buffer"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_text_bg_selected = weechat_config_new_option ( + script_config_file, script_config_section_color, + "text_bg_selected", "color", + N_("background color for selected line in script buffer"), + NULL, 0, 0, "red", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_text_date = weechat_config_new_option ( + script_config_file, script_config_section_color, + "text_date", "color", + N_("text color of dates in script buffer"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_text_date_selected = weechat_config_new_option ( + script_config_file, script_config_section_color, + "text_date_selected", "color", + N_("text color of dates for selected line in script buffer"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_text_delimiters = weechat_config_new_option ( + script_config_file, script_config_section_color, + "text_delimiters", "color", + N_("text color of delimiters in script buffer"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_text_description = weechat_config_new_option ( + script_config_file, script_config_section_color, + "text_description", "color", + N_("text color of description in script buffer"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_text_description_selected = weechat_config_new_option ( + script_config_file, script_config_section_color, + "text_description_selected", "color", + N_("text color of description for selected line in script buffer"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_text_extension = weechat_config_new_option ( + script_config_file, script_config_section_color, + "text_extension", "color", + N_("text color of extension in script buffer"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_text_extension_selected = weechat_config_new_option ( + script_config_file, script_config_section_color, + "text_extension_selected", "color", + N_("text color of extension for selected line in script buffer"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_text_name = weechat_config_new_option ( + script_config_file, script_config_section_color, + "text_name", "color", + N_("text color of script name in script buffer"), + NULL, 0, 0, "cyan", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_text_name_selected = weechat_config_new_option ( + script_config_file, script_config_section_color, + "text_name_selected", "color", + N_("text color of script name for selected line in script buffer"), + NULL, 0, 0, "lightcyan", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_text_selected = weechat_config_new_option ( + script_config_file, script_config_section_color, + "text_selected", "color", + N_("text color for selected line in script buffer"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_text_tags = weechat_config_new_option ( + script_config_file, script_config_section_color, + "text_tags", "color", + N_("text color of tags in script buffer"), + NULL, 0, 0, "brown", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_text_tags_selected = weechat_config_new_option ( + script_config_file, script_config_section_color, + "text_tags_selected", "color", + N_("text color of tags for selected line in script buffer"), + NULL, 0, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_text_version = weechat_config_new_option ( + script_config_file, script_config_section_color, + "text_version", "color", + N_("text color of version in script buffer"), + NULL, 0, 0, "magenta", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_text_version_loaded = weechat_config_new_option ( + script_config_file, script_config_section_color, + "text_version_loaded", "color", + N_("text color of version loaded in script buffer"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_text_version_loaded_selected = weechat_config_new_option ( + script_config_file, script_config_section_color, + "text_version_loaded_selected", "color", + N_("text color of version loaded for selected line in script buffer"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_color_text_version_selected = weechat_config_new_option ( + script_config_file, script_config_section_color, + "text_version_selected", "color", + N_("text color of version for selected line in script buffer"), + NULL, 0, 0, "lightmagenta", NULL, 0, + NULL, NULL, NULL, + &script_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + } + + /* scripts */ + script_config_section_scripts = weechat_config_new_section ( + script_config_file, "scripts", + 0, 0, NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_text_version_loaded = weechat_config_new_option ( - script_config_file, ptr_section, - "text_version_loaded", "color", - N_("text color of version loaded in script buffer"), - NULL, 0, 0, "default", NULL, 0, NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_text_version_loaded_selected = weechat_config_new_option ( - script_config_file, ptr_section, - "text_version_loaded_selected", "color", - N_("text color of version loaded for selected line in script buffer"), - NULL, 0, 0, "white", NULL, 0, NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_color_text_version_selected = weechat_config_new_option ( - script_config_file, ptr_section, - "text_version_selected", "color", - N_("text color of version for selected line in script buffer"), - NULL, 0, 0, "lightmagenta", NULL, 0, NULL, NULL, NULL, - &script_config_refresh_cb, NULL, NULL, NULL, NULL, NULL); - - /* scripts */ - ptr_section = weechat_config_new_section (script_config_file, "scripts", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) + if (script_config_section_scripts) { - weechat_config_free (script_config_file); - script_config_file = NULL; - return 0; + script_config_scripts_autoload = weechat_config_new_option ( + script_config_file, script_config_section_scripts, + "autoload", "boolean", + N_("autoload scripts installed (make a link in \"autoload\" directory " + "to script in parent directory)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + script_config_scripts_cache_expire = weechat_config_new_option ( + script_config_file, script_config_section_scripts, + "cache_expire", "integer", + N_("local cache expiration time, in minutes (-1 = never expires, " + "0 = always expire)"), + NULL, -1, 525600, "1440", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + script_config_scripts_download_enabled = weechat_config_new_option ( + script_config_file, script_config_section_scripts, + "download_enabled", "boolean", + N_("enable download of files from the scripts repository when the " + "/script command is used (list of scripts and scripts " + "themselves); the list of scripts is downloaded from the URL " + "specified in the option script.scripts.url; WeeChat will " + "sometimes download again the list of scripts when you use the " + "/script command, even if you don't install a script"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + script_config_scripts_download_timeout = weechat_config_new_option ( + script_config_file, script_config_section_scripts, + "download_timeout", "integer", + N_("timeout (in seconds) for download of scripts and list of " + "scripts"), + NULL, 1, 3600, "30", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + script_config_scripts_hold = weechat_config_new_option ( + script_config_file, script_config_section_scripts, + "hold", "string", + N_("scripts to \"hold\": comma-separated list of scripts which " + "will never been upgraded and can not be removed, for example: " + "\"go.py,urlserver.py\""), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &script_config_change_hold_cb, NULL, NULL, + NULL, NULL, NULL); + script_config_scripts_path = weechat_config_new_option ( + script_config_file, script_config_section_scripts, + "path", "string", + N_("local cache directory for scripts " + "(path is evaluated, see function string_eval_path_home in " + "plugin API reference)"), + NULL, 0, 0, "${weechat_cache_dir}/script", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + script_config_scripts_url = weechat_config_new_option ( + script_config_file, script_config_section_scripts, + "url", "string", + N_("URL for file with list of scripts"), + NULL, 0, 0, "https://weechat.org/files/plugins.xml.gz", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } - script_config_scripts_autoload = weechat_config_new_option ( - script_config_file, ptr_section, - "autoload", "boolean", - N_("autoload scripts installed (make a link in \"autoload\" directory " - "to script in parent directory)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - script_config_scripts_cache_expire = weechat_config_new_option ( - script_config_file, ptr_section, - "cache_expire", "integer", - N_("local cache expiration time, in minutes (-1 = never expires, " - "0 = always expire)"), - NULL, -1, 525600, "1440", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - script_config_scripts_download_enabled = weechat_config_new_option ( - script_config_file, ptr_section, - "download_enabled", "boolean", - N_("enable download of files from the scripts repository when the " - "/script command is used (list of scripts and scripts themselves); " - "the list of scripts is downloaded from the URL specified in the " - "option script.scripts.url; WeeChat will sometimes download again " - "the list of scripts when you use the /script command, even if " - "you don't install a script"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - script_config_scripts_download_timeout = weechat_config_new_option ( - script_config_file, ptr_section, - "download_timeout", "integer", - N_("timeout (in seconds) for download of scripts and list of scripts"), - NULL, 1, 3600, "30", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - script_config_scripts_hold = weechat_config_new_option ( - script_config_file, ptr_section, - "hold", "string", - N_("scripts to \"hold\": comma-separated list of scripts which will " - "never been upgraded and can not be removed, for example: " - "\"go.py,urlserver.py\""), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, - &script_config_change_hold_cb, NULL, NULL, - NULL, NULL, NULL); - script_config_scripts_path = weechat_config_new_option ( - script_config_file, ptr_section, - "path", "string", - N_("local cache directory for scripts " - "(path is evaluated, see function string_eval_path_home in " - "plugin API reference)"), - NULL, 0, 0, "${weechat_cache_dir}/script", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - script_config_scripts_url = weechat_config_new_option ( - script_config_file, ptr_section, - "url", "string", - N_("URL for file with list of scripts"), - NULL, 0, 0, "https://weechat.org/files/plugins.xml.gz", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - return 1; } diff --git a/src/plugins/spell/spell-config.c b/src/plugins/spell/spell-config.c index c31ef3bf7..9bab0dfcb 100644 --- a/src/plugins/spell/spell-config.c +++ b/src/plugins/spell/spell-config.c @@ -31,33 +31,39 @@ struct t_config_file *spell_config_file = NULL; -struct t_config_section *spell_config_section_dict = NULL; -int spell_config_loading = 0; +/* sections */ + +struct t_config_section *spell_config_section_color = NULL; +struct t_config_section *spell_config_section_check = NULL; +struct t_config_section *spell_config_section_dict = NULL; +struct t_config_section *spell_config_section_look = NULL; +struct t_config_section *spell_config_section_option = NULL; /* spell config, color section */ -struct t_config_option *spell_config_color_misspelled; -struct t_config_option *spell_config_color_suggestion; -struct t_config_option *spell_config_color_suggestion_delimiter_dict; -struct t_config_option *spell_config_color_suggestion_delimiter_word; +struct t_config_option *spell_config_color_misspelled = NULL; +struct t_config_option *spell_config_color_suggestion = NULL; +struct t_config_option *spell_config_color_suggestion_delimiter_dict = NULL; +struct t_config_option *spell_config_color_suggestion_delimiter_word = NULL; /* spell config, check section */ -struct t_config_option *spell_config_check_commands; -struct t_config_option *spell_config_check_default_dict; -struct t_config_option *spell_config_check_during_search; -struct t_config_option *spell_config_check_enabled; -struct t_config_option *spell_config_check_real_time; -struct t_config_option *spell_config_check_suggestions; -struct t_config_option *spell_config_check_word_min_length; +struct t_config_option *spell_config_check_commands = NULL; +struct t_config_option *spell_config_check_default_dict = NULL; +struct t_config_option *spell_config_check_during_search = NULL; +struct t_config_option *spell_config_check_enabled = NULL; +struct t_config_option *spell_config_check_real_time = NULL; +struct t_config_option *spell_config_check_suggestions = NULL; +struct t_config_option *spell_config_check_word_min_length = NULL; /* spell config, look section */ -struct t_config_option *spell_config_look_suggestion_delimiter_dict; -struct t_config_option *spell_config_look_suggestion_delimiter_word; +struct t_config_option *spell_config_look_suggestion_delimiter_dict = NULL; +struct t_config_option *spell_config_look_suggestion_delimiter_word = NULL; +int spell_config_loading = 0; char **spell_commands_to_check = NULL; int spell_count_commands_to_check = 0; int *spell_length_commands_to_check = NULL; @@ -439,15 +445,13 @@ spell_config_set_dict (const char *name, const char *value) int spell_config_init () { - struct t_config_section *ptr_section; - spell_config_file = weechat_config_new (SPELL_CONFIG_PRIO_NAME, NULL, NULL, NULL); if (!spell_config_file) return 0; /* color */ - ptr_section = weechat_config_new_section ( + spell_config_section_color = weechat_config_new_section ( spell_config_file, "color", 0, 0, NULL, NULL, NULL, @@ -455,43 +459,39 @@ spell_config_init () NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!ptr_section) + if (spell_config_section_color) { - weechat_config_free (spell_config_file); - spell_config_file = NULL; - return 0; + spell_config_color_misspelled = weechat_config_new_option ( + spell_config_file, spell_config_section_color, + "misspelled", "color", + N_("text color for misspelled words (input bar)"), + NULL, 0, 0, "lightred", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + spell_config_color_suggestion = weechat_config_new_option ( + spell_config_file, spell_config_section_color, + "suggestion", "color", + N_("text color for suggestion on a misspelled word in bar item " + "\"spell_suggest\""), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + spell_config_color_suggestion_delimiter_dict = weechat_config_new_option ( + spell_config_file, spell_config_section_color, + "suggestion_delimiter_dict", "color", + N_("text color for delimiters displayed between two dictionaries " + "in bar item \"spell_suggest\""), + NULL, 0, 0, "cyan", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + spell_config_color_suggestion_delimiter_word = weechat_config_new_option ( + spell_config_file, spell_config_section_color, + "suggestion_delimiter_word", "color", + N_("text color for delimiters displayed between two words in bar " + "item \"spell_suggest\""), + NULL, 0, 0, "cyan", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } - spell_config_color_misspelled = weechat_config_new_option ( - spell_config_file, ptr_section, - "misspelled", "color", - N_("text color for misspelled words (input bar)"), - NULL, 0, 0, "lightred", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - spell_config_color_suggestion = weechat_config_new_option ( - spell_config_file, ptr_section, - "suggestion", "color", - N_("text color for suggestion on a misspelled word in bar item " - "\"spell_suggest\""), - NULL, 0, 0, "default", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - spell_config_color_suggestion_delimiter_dict = weechat_config_new_option ( - spell_config_file, ptr_section, - "suggestion_delimiter_dict", "color", - N_("text color for delimiters displayed between two dictionaries " - "in bar item \"spell_suggest\""), - NULL, 0, 0, "cyan", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - spell_config_color_suggestion_delimiter_word = weechat_config_new_option ( - spell_config_file, ptr_section, - "suggestion_delimiter_word", "color", - N_("text color for delimiters displayed between two words in bar item " - "\"spell_suggest\""), - NULL, 0, 0, "cyan", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - /* check */ - ptr_section = weechat_config_new_section ( + spell_config_section_check = weechat_config_new_section ( spell_config_file, "check", 0, 0, NULL, NULL, NULL, @@ -499,76 +499,72 @@ spell_config_init () NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!ptr_section) + if (spell_config_section_check) { - weechat_config_free (spell_config_file); - spell_config_file = NULL; - return 0; + spell_config_check_commands = weechat_config_new_option ( + spell_config_file, spell_config_section_check, + "commands", "string", + N_("comma separated list of commands for which spell checking is " + "enabled (spell checking is disabled for all other commands)"), + NULL, 0, 0, + "away,command,cycle,kick,kickban,me,msg,notice,part,query," + "quit,topic", NULL, 0, + NULL, NULL, NULL, + &spell_config_change_commands, NULL, NULL, + NULL, NULL, NULL); + spell_config_check_default_dict = weechat_config_new_option ( + spell_config_file, spell_config_section_check, + "default_dict", "string", + N_("default dictionary (or comma separated list of dictionaries) to " + "use when buffer has no dictionary defined (leave blank to " + "disable spell checker on buffers for which you didn't " + "explicitly enabled it)"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &spell_config_change_default_dict, NULL, NULL, + NULL, NULL, NULL); + spell_config_check_during_search = weechat_config_new_option ( + spell_config_file, spell_config_section_check, + "during_search", "boolean", + N_("check words during text search in buffer"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + spell_config_check_enabled = weechat_config_new_option ( + spell_config_file, spell_config_section_check, + "enabled", "boolean", + N_("enable spell checker for command line"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &spell_config_change_enabled, NULL, NULL, + NULL, NULL, NULL); + spell_config_check_real_time = weechat_config_new_option ( + spell_config_file, spell_config_section_check, + "real_time", "boolean", + N_("real-time spell checking of words (slower, disabled by default: " + "words are checked only if there's delimiter after)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + spell_config_check_suggestions = weechat_config_new_option ( + spell_config_file, spell_config_section_check, + "suggestions", "integer", + N_("number of suggestions to display in bar item \"spell_suggest\" " + "for each dictionary set in buffer (-1 = disable suggestions, " + "0 = display all possible suggestions in all languages)"), + NULL, -1, INT_MAX, "-1", NULL, 0, + NULL, NULL, NULL, + &spell_config_change_suggestions, NULL, NULL, + NULL, NULL, NULL); + spell_config_check_word_min_length = weechat_config_new_option ( + spell_config_file, spell_config_section_check, + "word_min_length", "integer", + N_("minimum length for a word to be spell checked (use 0 to check " + "all words)"), + NULL, 0, INT_MAX, "2", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } - spell_config_check_commands = weechat_config_new_option ( - spell_config_file, ptr_section, - "commands", "string", - N_("comma separated list of commands for which spell checking is " - "enabled (spell checking is disabled for all other commands)"), - NULL, 0, 0, - "away,command,cycle,kick,kickban,me,msg,notice,part,query," - "quit,topic", NULL, 0, - NULL, NULL, NULL, - &spell_config_change_commands, NULL, NULL, - NULL, NULL, NULL); - spell_config_check_default_dict = weechat_config_new_option ( - spell_config_file, ptr_section, - "default_dict", "string", - N_("default dictionary (or comma separated list of dictionaries) to " - "use when buffer has no dictionary defined (leave blank to disable " - "spell checker on buffers for which you didn't explicitly " - "enabled it)"), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, - &spell_config_change_default_dict, NULL, NULL, - NULL, NULL, NULL); - spell_config_check_during_search = weechat_config_new_option ( - spell_config_file, ptr_section, - "during_search", "boolean", - N_("check words during text search in buffer"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - spell_config_check_enabled = weechat_config_new_option ( - spell_config_file, ptr_section, - "enabled", "boolean", - N_("enable spell checker for command line"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, - &spell_config_change_enabled, NULL, NULL, - NULL, NULL, NULL); - spell_config_check_real_time = weechat_config_new_option ( - spell_config_file, ptr_section, - "real_time", "boolean", - N_("real-time spell checking of words (slower, disabled by default: " - "words are checked only if there's delimiter after)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - spell_config_check_suggestions = weechat_config_new_option ( - spell_config_file, ptr_section, - "suggestions", "integer", - N_("number of suggestions to display in bar item \"spell_suggest\" " - "for each dictionary set in buffer (-1 = disable suggestions, " - "0 = display all possible suggestions in all languages)"), - NULL, -1, INT_MAX, "-1", NULL, 0, - NULL, NULL, NULL, - &spell_config_change_suggestions, NULL, NULL, - NULL, NULL, NULL); - spell_config_check_word_min_length = weechat_config_new_option ( - spell_config_file, ptr_section, - "word_min_length", "integer", - N_("minimum length for a word to be spell checked (use 0 to check all " - "words)"), - NULL, 0, INT_MAX, "2", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - /* dict */ - ptr_section = weechat_config_new_section ( + spell_config_section_dict = weechat_config_new_section ( spell_config_file, "dict", 1, 1, NULL, NULL, NULL, @@ -576,17 +572,9 @@ spell_config_init () NULL, NULL, NULL, &spell_config_dict_create_option, NULL, NULL, &spell_config_dict_delete_option, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (spell_config_file); - spell_config_file = NULL; - return 0; - } - - spell_config_section_dict = ptr_section; /* look */ - ptr_section = weechat_config_new_section ( + spell_config_section_look = weechat_config_new_section ( spell_config_file, "look", 0, 0, NULL, NULL, NULL, @@ -594,34 +582,30 @@ spell_config_init () NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!ptr_section) + if (spell_config_section_look) { - weechat_config_free (spell_config_file); - spell_config_file = NULL; - return 0; + spell_config_look_suggestion_delimiter_dict = weechat_config_new_option ( + spell_config_file, spell_config_section_look, + "suggestion_delimiter_dict", "string", + N_("delimiter displayed between two dictionaries in bar item " + "\"spell_suggest\""), + NULL, 0, 0, " / ", NULL, 0, + NULL, NULL, NULL, + &spell_config_change_suggestions, NULL, NULL, + NULL, NULL, NULL); + spell_config_look_suggestion_delimiter_word = weechat_config_new_option ( + spell_config_file, spell_config_section_look, + "suggestion_delimiter_word", "string", + N_("delimiter displayed between two words in bar item " + "\"spell_suggest\""), + NULL, 0, 0, ",", NULL, 0, + NULL, NULL, NULL, + &spell_config_change_suggestions, NULL, NULL, + NULL, NULL, NULL); } - spell_config_look_suggestion_delimiter_dict = weechat_config_new_option ( - spell_config_file, ptr_section, - "suggestion_delimiter_dict", "string", - N_("delimiter displayed between two dictionaries in bar item " - "\"spell_suggest\""), - NULL, 0, 0, " / ", NULL, 0, - NULL, NULL, NULL, - &spell_config_change_suggestions, NULL, NULL, - NULL, NULL, NULL); - spell_config_look_suggestion_delimiter_word = weechat_config_new_option ( - spell_config_file, ptr_section, - "suggestion_delimiter_word", "string", - N_("delimiter displayed between two words in bar item " - "\"spell_suggest\""), - NULL, 0, 0, ",", NULL, 0, - NULL, NULL, NULL, - &spell_config_change_suggestions, NULL, NULL, - NULL, NULL, NULL); - /* option */ - ptr_section = weechat_config_new_section ( + spell_config_section_option = weechat_config_new_section ( spell_config_file, "option", 1, 1, NULL, NULL, NULL, @@ -629,12 +613,6 @@ spell_config_init () NULL, NULL, NULL, &spell_config_option_create_option, NULL, NULL, &spell_config_option_delete_option, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (spell_config_file); - spell_config_file = NULL; - return 0; - } return 1; } diff --git a/src/plugins/trigger/trigger-config.c b/src/plugins/trigger/trigger-config.c index 001d7b958..ec25b0b3f 100644 --- a/src/plugins/trigger/trigger-config.c +++ b/src/plugins/trigger/trigger-config.c @@ -29,25 +29,30 @@ struct t_config_file *trigger_config_file = NULL; + +/* sections */ + +struct t_config_section *trigger_config_section_look = NULL; +struct t_config_section *trigger_config_section_color = NULL; struct t_config_section *trigger_config_section_trigger = NULL; /* trigger config, look section */ -struct t_config_option *trigger_config_look_enabled; -struct t_config_option *trigger_config_look_monitor_strip_colors; +struct t_config_option *trigger_config_look_enabled = NULL; +struct t_config_option *trigger_config_look_monitor_strip_colors = NULL; /* trigger config, color section */ -struct t_config_option *trigger_config_color_flag_command; -struct t_config_option *trigger_config_color_flag_conditions; -struct t_config_option *trigger_config_color_flag_regex; -struct t_config_option *trigger_config_color_flag_return_code; -struct t_config_option *trigger_config_color_flag_post_action; -struct t_config_option *trigger_config_color_identifier; -struct t_config_option *trigger_config_color_regex; -struct t_config_option *trigger_config_color_replace; -struct t_config_option *trigger_config_color_trigger; -struct t_config_option *trigger_config_color_trigger_disabled; +struct t_config_option *trigger_config_color_flag_command = NULL; +struct t_config_option *trigger_config_color_flag_conditions = NULL; +struct t_config_option *trigger_config_color_flag_regex = NULL; +struct t_config_option *trigger_config_color_flag_return_code = NULL; +struct t_config_option *trigger_config_color_flag_post_action = NULL; +struct t_config_option *trigger_config_color_identifier = NULL; +struct t_config_option *trigger_config_color_regex = NULL; +struct t_config_option *trigger_config_color_replace = NULL; +struct t_config_option *trigger_config_color_trigger = NULL; +struct t_config_option *trigger_config_color_trigger_disabled = NULL; char *trigger_config_default_list[][1 + TRIGGER_NUM_OPTIONS] = { @@ -683,8 +688,6 @@ trigger_config_reload_cb (const void *pointer, void *data, int trigger_config_init () { - struct t_config_section *ptr_section; - trigger_config_file = weechat_config_new ( TRIGGER_CONFIG_PRIO_NAME, &trigger_config_reload_cb, NULL, NULL); @@ -692,113 +695,107 @@ trigger_config_init () return 0; /* look */ - ptr_section = weechat_config_new_section (trigger_config_file, "look", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) + trigger_config_section_look = weechat_config_new_section ( + trigger_config_file, "look", + 0, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + if (trigger_config_section_look) { - weechat_config_free (trigger_config_file); - trigger_config_file = NULL; - return 0; + trigger_config_look_enabled = weechat_config_new_option ( + trigger_config_file, trigger_config_section_look, + "enabled", "boolean", + N_("enable trigger support"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &trigger_config_change_enabled, NULL, NULL, + NULL, NULL, NULL); + trigger_config_look_monitor_strip_colors = weechat_config_new_option ( + trigger_config_file, trigger_config_section_look, + "monitor_strip_colors", "boolean", + N_("strip colors in hashtable values displayed on monitor buffer"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } - trigger_config_look_enabled = weechat_config_new_option ( - trigger_config_file, ptr_section, - "enabled", "boolean", - N_("enable trigger support"), - NULL, 0, 0, "on", NULL, 0, + /* color */ + trigger_config_section_color = weechat_config_new_section ( + trigger_config_file, "color", + 0, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, - &trigger_config_change_enabled, NULL, NULL, NULL, NULL, NULL); - trigger_config_look_monitor_strip_colors = weechat_config_new_option ( - trigger_config_file, ptr_section, - "monitor_strip_colors", "boolean", - N_("strip colors in hashtable values displayed on monitor buffer"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - - /* color */ - ptr_section = weechat_config_new_section (trigger_config_file, "color", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) + if (trigger_config_section_color) { - weechat_config_free (trigger_config_file); - trigger_config_file = NULL; - return 0; + trigger_config_color_flag_command = weechat_config_new_option ( + trigger_config_file, trigger_config_section_color, + "flag_command", "color", + N_("text color for command flag (in /trigger list)"), + NULL, 0, 0, "lightgreen", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + trigger_config_color_flag_conditions = weechat_config_new_option ( + trigger_config_file, trigger_config_section_color, + "flag_conditions", "color", + N_("text color for conditions flag (in /trigger list)"), + NULL, 0, 0, "yellow", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + trigger_config_color_flag_regex = weechat_config_new_option ( + trigger_config_file, trigger_config_section_color, + "flag_regex", "color", + N_("text color for regex flag (in /trigger list)"), + NULL, 0, 0, "lightcyan", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + trigger_config_color_flag_return_code = weechat_config_new_option ( + trigger_config_file, trigger_config_section_color, + "flag_return_code", "color", + N_("text color for return code flag (in /trigger list)"), + NULL, 0, 0, "lightmagenta", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + trigger_config_color_flag_post_action = weechat_config_new_option ( + trigger_config_file, trigger_config_section_color, + "flag_post_action", "color", + N_("text color for post action flag (in /trigger list)"), + NULL, 0, 0, "lightblue", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + trigger_config_color_identifier = weechat_config_new_option ( + trigger_config_file, trigger_config_section_color, + "identifier", "color", + N_("text color for trigger context identifier in monitor buffer"), + NULL, 0, 0, "cyan", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + trigger_config_color_regex = weechat_config_new_option ( + trigger_config_file, trigger_config_section_color, + "regex", "color", + N_("text color for regular expressions"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + trigger_config_color_replace = weechat_config_new_option ( + trigger_config_file, trigger_config_section_color, + "replace", "color", + N_("text color for replacement text (for regular expressions)"), + NULL, 0, 0, "cyan", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + trigger_config_color_trigger = weechat_config_new_option ( + trigger_config_file, trigger_config_section_color, + "trigger", "color", + N_("text color for trigger name"), + NULL, 0, 0, "green", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + trigger_config_color_trigger_disabled = weechat_config_new_option ( + trigger_config_file, trigger_config_section_color, + "trigger_disabled", "color", + N_("text color for disabled trigger name"), + NULL, 0, 0, "red", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } - trigger_config_color_flag_command = weechat_config_new_option ( - trigger_config_file, ptr_section, - "flag_command", "color", - N_("text color for command flag (in /trigger list)"), - NULL, 0, 0, "lightgreen", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - trigger_config_color_flag_conditions = weechat_config_new_option ( - trigger_config_file, ptr_section, - "flag_conditions", "color", - N_("text color for conditions flag (in /trigger list)"), - NULL, 0, 0, "yellow", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - trigger_config_color_flag_regex = weechat_config_new_option ( - trigger_config_file, ptr_section, - "flag_regex", "color", - N_("text color for regex flag (in /trigger list)"), - NULL, 0, 0, "lightcyan", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - trigger_config_color_flag_return_code = weechat_config_new_option ( - trigger_config_file, ptr_section, - "flag_return_code", "color", - N_("text color for return code flag (in /trigger list)"), - NULL, 0, 0, "lightmagenta", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - trigger_config_color_flag_post_action = weechat_config_new_option ( - trigger_config_file, ptr_section, - "flag_post_action", "color", - N_("text color for post action flag (in /trigger list)"), - NULL, 0, 0, "lightblue", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - trigger_config_color_identifier = weechat_config_new_option ( - trigger_config_file, ptr_section, - "identifier", "color", - N_("text color for trigger context identifier in monitor buffer"), - NULL, 0, 0, "cyan", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - trigger_config_color_regex = weechat_config_new_option ( - trigger_config_file, ptr_section, - "regex", "color", - N_("text color for regular expressions"), - NULL, 0, 0, "white", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - trigger_config_color_replace = weechat_config_new_option ( - trigger_config_file, ptr_section, - "replace", "color", - N_("text color for replacement text (for regular expressions)"), - NULL, 0, 0, "cyan", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - trigger_config_color_trigger = weechat_config_new_option ( - trigger_config_file, ptr_section, - "trigger", "color", - N_("text color for trigger name"), - NULL, 0, 0, "green", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - trigger_config_color_trigger_disabled = weechat_config_new_option ( - trigger_config_file, ptr_section, - "trigger_disabled", "color", - N_("text color for disabled trigger name"), - NULL, 0, 0, "red", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - /* trigger */ - ptr_section = weechat_config_new_section ( + trigger_config_section_trigger = weechat_config_new_section ( trigger_config_file, TRIGGER_CONFIG_SECTION_TRIGGER, 0, 0, @@ -807,14 +804,6 @@ trigger_config_init () &trigger_config_trigger_write_default_cb, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (trigger_config_file); - trigger_config_file = NULL; - return 0; - } - - trigger_config_section_trigger = ptr_section; return 1; } diff --git a/src/plugins/trigger/trigger-config.h b/src/plugins/trigger/trigger-config.h index f4653af1d..096ce9afb 100644 --- a/src/plugins/trigger/trigger-config.h +++ b/src/plugins/trigger/trigger-config.h @@ -25,6 +25,9 @@ #define TRIGGER_CONFIG_SECTION_TRIGGER "trigger" extern struct t_config_file *trigger_config_file; + +extern struct t_config_section *trigger_config_section_look; +extern struct t_config_section *trigger_config_section_color; extern struct t_config_section *trigger_config_section_trigger; extern struct t_config_option *trigger_config_look_enabled; diff --git a/src/plugins/typing/typing-config.c b/src/plugins/typing/typing-config.c index 04785e99a..6b2b79b98 100644 --- a/src/plugins/typing/typing-config.c +++ b/src/plugins/typing/typing-config.c @@ -31,18 +31,20 @@ struct t_config_file *typing_config_file = NULL; -struct t_config_section *typing_config_section_cmd = NULL; -struct t_config_section *typing_config_section_completion = NULL; + +/* sections */ + +struct t_config_section *typing_config_section_look = NULL; /* typing config, look section */ -struct t_config_option *typing_config_look_delay_purge_paused; -struct t_config_option *typing_config_look_delay_purge_typing; -struct t_config_option *typing_config_look_delay_set_paused; -struct t_config_option *typing_config_look_enabled_nicks; -struct t_config_option *typing_config_look_enabled_self; -struct t_config_option *typing_config_look_input_min_chars; -struct t_config_option *typing_config_look_item_max_length; +struct t_config_option *typing_config_look_delay_purge_paused = NULL; +struct t_config_option *typing_config_look_delay_purge_typing = NULL; +struct t_config_option *typing_config_look_delay_set_paused = NULL; +struct t_config_option *typing_config_look_enabled_nicks = NULL; +struct t_config_option *typing_config_look_enabled_self = NULL; +struct t_config_option *typing_config_look_input_min_chars = NULL; +struct t_config_option *typing_config_look_item_max_length = NULL; /* @@ -110,8 +112,6 @@ typing_config_change_item_max_length (const void *pointer, void *data, int typing_config_init () { - struct t_config_section *ptr_section; - typing_config_file = weechat_config_new ( TYPING_CONFIG_PRIO_NAME, &typing_config_reload, NULL, NULL); @@ -119,73 +119,73 @@ typing_config_init () return 0; /* look */ - ptr_section = weechat_config_new_section (typing_config_file, "look", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (typing_config_file); - typing_config_file = NULL; - return 0; - } - - typing_config_look_delay_purge_paused = weechat_config_new_option ( - typing_config_file, ptr_section, - "delay_purge_paused", "integer", - N_("number of seconds after paused status has been set: if reached, " - "the typing status is removed"), - NULL, 1, INT_MAX, "30", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - typing_config_look_delay_purge_typing = weechat_config_new_option ( - typing_config_file, ptr_section, - "delay_purge_typing", "integer", - N_("number of seconds after typing status has been set: if reached, " - "the typing status is removed"), - NULL, 1, INT_MAX, "6", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - typing_config_look_delay_set_paused = weechat_config_new_option ( - typing_config_file, ptr_section, - "delay_set_paused", "integer", - N_("number of seconds after typing last char: if reached, the typing " - "status becomes \"paused\" and no more typing signals are sent"), - NULL, 1, INT_MAX, "10", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - typing_config_look_enabled_nicks = weechat_config_new_option ( - typing_config_file, ptr_section, - "enabled_nicks", "boolean", - N_("typing enabled for other nicks (display typing info for nicks " - "typing in the current buffer)"), - NULL, 0, 0, "off", NULL, 0, + typing_config_section_look = weechat_config_new_section ( + typing_config_file, "look", + 0, 0, + NULL, NULL, NULL, NULL, NULL, NULL, - &typing_config_change_enabled, NULL, NULL, - NULL, NULL, NULL); - typing_config_look_enabled_self = weechat_config_new_option ( - typing_config_file, ptr_section, - "enabled_self", "boolean", - N_("typing enabled for self messages (send typing info to other users)"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, - &typing_config_change_enabled, NULL, NULL, - NULL, NULL, NULL); - typing_config_look_input_min_chars = weechat_config_new_option ( - typing_config_file, ptr_section, - "input_min_chars", "integer", - N_("min number of chars in message to trigger send of typing signals"), - NULL, 1, INT_MAX, "4", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - typing_config_look_item_max_length = weechat_config_new_option ( - typing_config_file, ptr_section, - "item_max_length", "integer", - N_("max number of chars displayed in the bar item \"typing\" " - "(0 = do not truncate content)"), - NULL, 0, INT_MAX, "0", NULL, 0, NULL, NULL, NULL, - &typing_config_change_item_max_length, NULL, NULL, NULL, NULL, NULL); + if (typing_config_section_look) + { + typing_config_look_delay_purge_paused = weechat_config_new_option ( + typing_config_file, typing_config_section_look, + "delay_purge_paused", "integer", + N_("number of seconds after paused status has been set: if reached, " + "the typing status is removed"), + NULL, 1, INT_MAX, "30", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + typing_config_look_delay_purge_typing = weechat_config_new_option ( + typing_config_file, typing_config_section_look, + "delay_purge_typing", "integer", + N_("number of seconds after typing status has been set: if reached, " + "the typing status is removed"), + NULL, 1, INT_MAX, "6", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + typing_config_look_delay_set_paused = weechat_config_new_option ( + typing_config_file, typing_config_section_look, + "delay_set_paused", "integer", + N_("number of seconds after typing last char: if reached, the " + "typing status becomes \"paused\" and no more typing signals " + "are sent"), + NULL, 1, INT_MAX, "10", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + typing_config_look_enabled_nicks = weechat_config_new_option ( + typing_config_file, typing_config_section_look, + "enabled_nicks", "boolean", + N_("typing enabled for other nicks (display typing info for nicks " + "typing in the current buffer)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &typing_config_change_enabled, NULL, NULL, + NULL, NULL, NULL); + typing_config_look_enabled_self = weechat_config_new_option ( + typing_config_file, typing_config_section_look, + "enabled_self", "boolean", + N_("typing enabled for self messages (send typing info to other " + "users)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &typing_config_change_enabled, NULL, NULL, + NULL, NULL, NULL); + typing_config_look_input_min_chars = weechat_config_new_option ( + typing_config_file, typing_config_section_look, + "input_min_chars", "integer", + N_("min number of chars in message to trigger send of typing " + "signals"), + NULL, 1, INT_MAX, "4", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + typing_config_look_item_max_length = weechat_config_new_option ( + typing_config_file, typing_config_section_look, + "item_max_length", "integer", + N_("max number of chars displayed in the bar item \"typing\" " + "(0 = do not truncate content)"), + NULL, 0, INT_MAX, "0", NULL, 0, + NULL, NULL, NULL, + &typing_config_change_item_max_length, NULL, NULL, + NULL, NULL, NULL); + } return 1; } diff --git a/src/plugins/xfer/xfer-config.c b/src/plugins/xfer/xfer-config.c index ae92ffa38..5d8d27eda 100644 --- a/src/plugins/xfer/xfer-config.c +++ b/src/plugins/xfer/xfer-config.c @@ -30,43 +30,52 @@ struct t_config_file *xfer_config_file = NULL; +/* sections */ + +struct t_config_section *xfer_config_section_look = NULL; +struct t_config_section *xfer_config_section_color = NULL; +struct t_config_section *xfer_config_section_network = NULL; +struct t_config_section *xfer_config_section_file = NULL; + /* xfer config, look section */ -struct t_config_option *xfer_config_look_auto_open_buffer; -struct t_config_option *xfer_config_look_progress_bar_size; -struct t_config_option *xfer_config_look_pv_tags; +struct t_config_option *xfer_config_look_auto_open_buffer = NULL; +struct t_config_option *xfer_config_look_progress_bar_size = NULL; +struct t_config_option *xfer_config_look_pv_tags = NULL; /* xfer config, color section */ -struct t_config_option *xfer_config_color_status[XFER_NUM_STATUS]; -struct t_config_option *xfer_config_color_text; -struct t_config_option *xfer_config_color_text_bg; -struct t_config_option *xfer_config_color_text_selected; +struct t_config_option *xfer_config_color_status[XFER_NUM_STATUS] = { + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +}; +struct t_config_option *xfer_config_color_text = NULL; +struct t_config_option *xfer_config_color_text_bg = NULL; +struct t_config_option *xfer_config_color_text_selected = NULL; /* xfer config, network section */ -struct t_config_option *xfer_config_network_blocksize; -struct t_config_option *xfer_config_network_fast_send; -struct t_config_option *xfer_config_network_own_ip; -struct t_config_option *xfer_config_network_port_range; -struct t_config_option *xfer_config_network_send_ack; -struct t_config_option *xfer_config_network_speed_limit_recv; -struct t_config_option *xfer_config_network_speed_limit_send; -struct t_config_option *xfer_config_network_timeout; +struct t_config_option *xfer_config_network_blocksize = NULL; +struct t_config_option *xfer_config_network_fast_send = NULL; +struct t_config_option *xfer_config_network_own_ip = NULL; +struct t_config_option *xfer_config_network_port_range = NULL; +struct t_config_option *xfer_config_network_send_ack = NULL; +struct t_config_option *xfer_config_network_speed_limit_recv = NULL; +struct t_config_option *xfer_config_network_speed_limit_send = NULL; +struct t_config_option *xfer_config_network_timeout = NULL; /* xfer config, file section */ -struct t_config_option *xfer_config_file_auto_accept_chats; -struct t_config_option *xfer_config_file_auto_accept_files; -struct t_config_option *xfer_config_file_auto_accept_nicks; -struct t_config_option *xfer_config_file_auto_check_crc32; -struct t_config_option *xfer_config_file_auto_rename; -struct t_config_option *xfer_config_file_auto_resume; -struct t_config_option *xfer_config_file_convert_spaces; -struct t_config_option *xfer_config_file_download_path; -struct t_config_option *xfer_config_file_download_temporary_suffix; -struct t_config_option *xfer_config_file_upload_path; -struct t_config_option *xfer_config_file_use_nick_in_filename; +struct t_config_option *xfer_config_file_auto_accept_chats = NULL; +struct t_config_option *xfer_config_file_auto_accept_files = NULL; +struct t_config_option *xfer_config_file_auto_accept_nicks = NULL; +struct t_config_option *xfer_config_file_auto_check_crc32 = NULL; +struct t_config_option *xfer_config_file_auto_rename = NULL; +struct t_config_option *xfer_config_file_auto_resume = NULL; +struct t_config_option *xfer_config_file_convert_spaces = NULL; +struct t_config_option *xfer_config_file_download_path = NULL; +struct t_config_option *xfer_config_file_download_temporary_suffix = NULL; +struct t_config_option *xfer_config_file_upload_path = NULL; +struct t_config_option *xfer_config_file_use_nick_in_filename = NULL; /* @@ -112,303 +121,295 @@ xfer_config_reload (const void *pointer, void *data, int xfer_config_init () { - struct t_config_section *ptr_section; - xfer_config_file = weechat_config_new (XFER_CONFIG_PRIO_NAME, &xfer_config_reload, NULL, NULL); if (!xfer_config_file) return 0; - ptr_section = weechat_config_new_section (xfer_config_file, "look", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) - { - weechat_config_free (xfer_config_file); - xfer_config_file = NULL; - return 0; - } - - xfer_config_look_auto_open_buffer = weechat_config_new_option ( - xfer_config_file, ptr_section, - "auto_open_buffer", "boolean", - N_("auto open xfer buffer when a new xfer is added " - "to list"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - xfer_config_look_progress_bar_size = weechat_config_new_option ( - xfer_config_file, ptr_section, - "progress_bar_size", "integer", - N_("size of progress bar, in chars (if 0, progress bar is disabled)"), - NULL, 0, XFER_CONFIG_PROGRESS_BAR_MAX_SIZE, "20", NULL, 0, + xfer_config_section_look = weechat_config_new_section ( + xfer_config_file, "look", + 0, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, - &xfer_config_refresh_cb, NULL, NULL, NULL, NULL, NULL); - xfer_config_look_pv_tags = weechat_config_new_option ( - xfer_config_file, ptr_section, - "pv_tags", "string", - N_("comma separated list of tags used in private messages, for example: " - "\"notify_message\", \"notify_private\" or \"notify_highlight\""), - NULL, 0, 0, "notify_private", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - - ptr_section = weechat_config_new_section (xfer_config_file, "color", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) + if (xfer_config_section_look) { - weechat_config_free (xfer_config_file); - xfer_config_file = NULL; - return 0; + xfer_config_look_auto_open_buffer = weechat_config_new_option ( + xfer_config_file, xfer_config_section_look, + "auto_open_buffer", "boolean", + N_("auto open xfer buffer when a new xfer is added " + "to list"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + xfer_config_look_progress_bar_size = weechat_config_new_option ( + xfer_config_file, xfer_config_section_look, + "progress_bar_size", "integer", + N_("size of progress bar, in chars (if 0, progress bar is " + "disabled)"), + NULL, 0, XFER_CONFIG_PROGRESS_BAR_MAX_SIZE, "20", NULL, 0, + NULL, NULL, NULL, + &xfer_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + xfer_config_look_pv_tags = weechat_config_new_option ( + xfer_config_file, xfer_config_section_look, + "pv_tags", "string", + N_("comma separated list of tags used in private messages, for " + "example: \"notify_message\", \"notify_private\" or " + "\"notify_highlight\""), + NULL, 0, 0, "notify_private", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } - xfer_config_color_status[XFER_STATUS_ABORTED] = weechat_config_new_option ( - xfer_config_file, ptr_section, - "status_aborted", "color", - N_("text color for \"aborted\" status"), - NULL, 0, 0, "lightred", NULL, 0, - NULL, NULL, NULL, - &xfer_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - xfer_config_color_status[XFER_STATUS_ACTIVE] = weechat_config_new_option ( - xfer_config_file, ptr_section, - "status_active", "color", - N_("text color for \"active\" status"), - NULL, 0, 0, "lightblue", NULL, 0, + xfer_config_section_color = weechat_config_new_section ( + xfer_config_file, "color", + 0, 0, NULL, NULL, NULL, - &xfer_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - xfer_config_color_status[XFER_STATUS_CONNECTING] = weechat_config_new_option ( - xfer_config_file, ptr_section, - "status_connecting", "color", - N_("text color for \"connecting\" status"), - NULL, 0, 0, "yellow", NULL, 0, NULL, NULL, NULL, - &xfer_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - xfer_config_color_status[XFER_STATUS_DONE] = weechat_config_new_option ( - xfer_config_file, ptr_section, - "status_done", "color", - N_("text color for \"done\" status"), - NULL, 0, 0, "lightgreen", NULL, 0, NULL, NULL, NULL, - &xfer_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - xfer_config_color_status[XFER_STATUS_FAILED] = weechat_config_new_option ( - xfer_config_file, ptr_section, - "status_failed", "color", - N_("text color for \"failed\" status"), - NULL, 0, 0, "lightred", NULL, 0, NULL, NULL, NULL, - &xfer_config_refresh_cb, NULL, NULL, NULL, NULL, NULL); - xfer_config_color_status[XFER_STATUS_WAITING] = weechat_config_new_option ( - xfer_config_file, ptr_section, - "status_waiting", "color", - N_("text color for \"waiting\" status"), - NULL, 0, 0, "lightcyan", NULL, 0, + if (xfer_config_section_color) + { + xfer_config_color_status[XFER_STATUS_ABORTED] = weechat_config_new_option ( + xfer_config_file, xfer_config_section_color, + "status_aborted", "color", + N_("text color for \"aborted\" status"), + NULL, 0, 0, "lightred", NULL, 0, + NULL, NULL, NULL, + &xfer_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + xfer_config_color_status[XFER_STATUS_ACTIVE] = weechat_config_new_option ( + xfer_config_file, xfer_config_section_color, + "status_active", "color", + N_("text color for \"active\" status"), + NULL, 0, 0, "lightblue", NULL, 0, + NULL, NULL, NULL, + &xfer_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + xfer_config_color_status[XFER_STATUS_CONNECTING] = weechat_config_new_option ( + xfer_config_file, xfer_config_section_color, + "status_connecting", "color", + N_("text color for \"connecting\" status"), + NULL, 0, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &xfer_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + xfer_config_color_status[XFER_STATUS_DONE] = weechat_config_new_option ( + xfer_config_file, xfer_config_section_color, + "status_done", "color", + N_("text color for \"done\" status"), + NULL, 0, 0, "lightgreen", NULL, 0, + NULL, NULL, NULL, + &xfer_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + xfer_config_color_status[XFER_STATUS_FAILED] = weechat_config_new_option ( + xfer_config_file, xfer_config_section_color, + "status_failed", "color", + N_("text color for \"failed\" status"), + NULL, 0, 0, "lightred", NULL, 0, + NULL, NULL, NULL, + &xfer_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + xfer_config_color_status[XFER_STATUS_WAITING] = weechat_config_new_option ( + xfer_config_file, xfer_config_section_color, + "status_waiting", "color", + N_("text color for \"waiting\" status"), + NULL, 0, 0, "lightcyan", NULL, 0, + NULL, NULL, NULL, + &xfer_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + xfer_config_color_text = weechat_config_new_option ( + xfer_config_file, xfer_config_section_color, + "text", "color", + N_("text color in xfer buffer"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &xfer_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + xfer_config_color_text_bg = weechat_config_new_option ( + xfer_config_file, xfer_config_section_color, + "text_bg", "color", + N_("background color in xfer buffer"), + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, + &xfer_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + xfer_config_color_text_selected = weechat_config_new_option ( + xfer_config_file, xfer_config_section_color, + "text_selected", "color", + N_("text color of selected line in xfer buffer"), + NULL, 0, 0, "white", NULL, 0, + NULL, NULL, NULL, + &xfer_config_refresh_cb, NULL, NULL, + NULL, NULL, NULL); + } + + xfer_config_section_network = weechat_config_new_section ( + xfer_config_file, "network", + 0, 0, NULL, NULL, NULL, - &xfer_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - xfer_config_color_text = weechat_config_new_option ( - xfer_config_file, ptr_section, - "text", "color", - N_("text color in xfer buffer"), - NULL, 0, 0, "default", NULL, 0, NULL, NULL, NULL, - &xfer_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - xfer_config_color_text_bg = weechat_config_new_option ( - xfer_config_file, ptr_section, - "text_bg", "color", - N_("background color in xfer buffer"), - NULL, 0, 0, "default", NULL, 0, NULL, NULL, NULL, - &xfer_config_refresh_cb, NULL, NULL, - NULL, NULL, NULL); - xfer_config_color_text_selected = weechat_config_new_option ( - xfer_config_file, ptr_section, - "text_selected", "color", - N_("text color of selected line in xfer buffer"), - NULL, 0, 0, "white", NULL, 0, NULL, NULL, NULL, - &xfer_config_refresh_cb, NULL, NULL, NULL, NULL, NULL); - - ptr_section = weechat_config_new_section (xfer_config_file, "network", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) + if (xfer_config_section_network) { - weechat_config_free (xfer_config_file); - xfer_config_file = NULL; - return 0; + xfer_config_network_blocksize = weechat_config_new_option ( + xfer_config_file, xfer_config_section_network, + "blocksize", "integer", + N_("block size for sending packets, in bytes"), + NULL, XFER_BLOCKSIZE_MIN, XFER_BLOCKSIZE_MAX, "65536", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + xfer_config_network_fast_send = weechat_config_new_option ( + xfer_config_file, xfer_config_section_network, + "fast_send", "boolean", + N_("does not wait for ACK when sending file"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + xfer_config_network_own_ip = weechat_config_new_option ( + xfer_config_file, xfer_config_section_network, + "own_ip", "string", + N_("IP or DNS address used for sending files/chats " + "(if empty, local interface IP is used)"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + xfer_config_network_port_range = weechat_config_new_option ( + xfer_config_file, xfer_config_section_network, + "port_range", "string", + N_("restricts outgoing files/chats to use only ports in the given " + "range (useful for NAT) (syntax: a single port, ie. 5000 or a " + "port range, ie. 5000-5015, empty value means any port, it's " + "recommended to use ports greater than 1024, because only root " + "can use ports below 1024)"), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + xfer_config_network_send_ack = weechat_config_new_option ( + xfer_config_file, xfer_config_section_network, + "send_ack", "boolean", + N_("send acks when receiving files; if disabled, the transfer may " + "freeze if the sender is waiting for acks (for example a " + "WeeChat sending a file with option xfer.network.fast_send set " + "to off); on the other hand, disabling send of acks may prevent " + "a freeze if the acks are not sent immediately to the sender"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + xfer_config_network_speed_limit_recv = weechat_config_new_option ( + xfer_config_file, xfer_config_section_network, + "speed_limit_recv", "integer", + N_("speed limit for receiving files, in kilo-bytes by second (0 " + "means no limit)"), + NULL, 0, INT_MAX, "0", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + xfer_config_network_speed_limit_send = weechat_config_new_option ( + xfer_config_file, xfer_config_section_network, + "speed_limit_send", "integer", + N_("speed limit for sending files, in kilo-bytes by second (0 means " + "no limit)"), + NULL, 0, INT_MAX, "0", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + xfer_config_network_timeout = weechat_config_new_option ( + xfer_config_file, xfer_config_section_network, + "timeout", "integer", + N_("timeout for xfer request (in seconds)"), + NULL, 5, INT_MAX, "300", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } - xfer_config_network_blocksize = weechat_config_new_option ( - xfer_config_file, ptr_section, - "blocksize", "integer", - N_("block size for sending packets, in bytes"), - NULL, XFER_BLOCKSIZE_MIN, XFER_BLOCKSIZE_MAX, "65536", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - xfer_config_network_fast_send = weechat_config_new_option ( - xfer_config_file, ptr_section, - "fast_send", "boolean", - N_("does not wait for ACK when sending file"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - xfer_config_network_own_ip = weechat_config_new_option ( - xfer_config_file, ptr_section, - "own_ip", "string", - N_("IP or DNS address used for sending files/chats " - "(if empty, local interface IP is used)"), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - xfer_config_network_port_range = weechat_config_new_option ( - xfer_config_file, ptr_section, - "port_range", "string", - N_("restricts outgoing files/chats to use only ports in the given " - "range (useful for NAT) (syntax: a single port, ie. 5000 or a port " - "range, ie. 5000-5015, empty value means any port, it's recommended " - "to use ports greater than 1024, because only root can use ports " - "below 1024)"), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - xfer_config_network_send_ack = weechat_config_new_option ( - xfer_config_file, ptr_section, - "send_ack", "boolean", - N_("send acks when receiving files; if disabled, the transfer may " - "freeze if the sender is waiting for acks (for example a WeeChat " - "sending a file with option xfer.network.fast_send set to off); " - "on the other hand, disabling send of acks may prevent a freeze if " - "the acks are not sent immediately to the sender"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - xfer_config_network_speed_limit_recv = weechat_config_new_option ( - xfer_config_file, ptr_section, - "speed_limit_recv", "integer", - N_("speed limit for receiving files, in kilo-bytes by second (0 means " - "no limit)"), - NULL, 0, INT_MAX, "0", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - xfer_config_network_speed_limit_send = weechat_config_new_option ( - xfer_config_file, ptr_section, - "speed_limit_send", "integer", - N_("speed limit for sending files, in kilo-bytes by second (0 means " - "no limit)"), - NULL, 0, INT_MAX, "0", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - xfer_config_network_timeout = weechat_config_new_option ( - xfer_config_file, ptr_section, - "timeout", "integer", - N_("timeout for xfer request (in seconds)"), - NULL, 5, INT_MAX, "300", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - - ptr_section = weechat_config_new_section (xfer_config_file, "file", - 0, 0, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL); - if (!ptr_section) + xfer_config_section_file = weechat_config_new_section ( + xfer_config_file, "file", + 0, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); + if (xfer_config_section_file) { - weechat_config_free (xfer_config_file); - xfer_config_file = NULL; - return 0; + xfer_config_file_auto_accept_chats = weechat_config_new_option ( + xfer_config_file, xfer_config_section_file, + "auto_accept_chats", "boolean", + N_("automatically accept chat requests (use carefully!)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + xfer_config_file_auto_accept_files = weechat_config_new_option ( + xfer_config_file, xfer_config_section_file, + "auto_accept_files", "boolean", + N_("automatically accept incoming files (use carefully!)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + xfer_config_file_auto_accept_nicks = weechat_config_new_option ( + xfer_config_file, xfer_config_section_file, + "auto_accept_nicks", "string", + N_("comma-separated list of nicks for which the incoming files and " + "chats are automatically accepted; format is \"server.nick\" " + "(for a specific server) or \"nick\" (for all servers); " + "example: \"libera.FlashCode,andrew\""), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + xfer_config_file_auto_check_crc32 = weechat_config_new_option ( + xfer_config_file, xfer_config_section_file, + "auto_check_crc32", "boolean", + N_("automatically check CRC32 file checksum if it is found in the " + "filename (8 hexadecimal chars)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + xfer_config_file_auto_rename = weechat_config_new_option ( + xfer_config_file, xfer_config_section_file, + "auto_rename", "boolean", + N_("rename incoming files if already exists (add \".1\", \".2\", " + "...)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + xfer_config_file_auto_resume = weechat_config_new_option ( + xfer_config_file, xfer_config_section_file, + "auto_resume", "boolean", + N_("automatically resume file transfer if connection with remote " + "host is lost"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + xfer_config_file_convert_spaces = weechat_config_new_option ( + xfer_config_file, xfer_config_section_file, + "convert_spaces", "boolean", + N_("convert spaces to underscores when sending and receiving " + "files"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + xfer_config_file_download_path = weechat_config_new_option ( + xfer_config_file, xfer_config_section_file, + "download_path", "string", + N_("path for writing incoming files " + "(path is evaluated, see function string_eval_path_home in " + "plugin API reference)"), + NULL, 0, 0, "${weechat_data_dir}/xfer", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + xfer_config_file_download_temporary_suffix = weechat_config_new_option ( + xfer_config_file, xfer_config_section_file, + "download_temporary_suffix", "string", + N_("temporary filename suffix used during the transfer for a file " + "received, it is removed after successful transfer; " + "if empty string, no filename suffix is used during the " + "transfer"), + NULL, 0, 0, ".part", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + xfer_config_file_upload_path = weechat_config_new_option ( + xfer_config_file, xfer_config_section_file, + "upload_path", "string", + N_("path for reading files when sending " + "(path is evaluated, see function string_eval_path_home in " + "plugin API reference)"), + NULL, 0, 0, "~", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + xfer_config_file_use_nick_in_filename = weechat_config_new_option ( + xfer_config_file, xfer_config_section_file, + "use_nick_in_filename", "boolean", + N_("use remote nick as prefix in local filename when receiving a " + "file"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } - xfer_config_file_auto_accept_chats = weechat_config_new_option ( - xfer_config_file, ptr_section, - "auto_accept_chats", "boolean", - N_("automatically accept chat requests (use carefully!)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - xfer_config_file_auto_accept_files = weechat_config_new_option ( - xfer_config_file, ptr_section, - "auto_accept_files", "boolean", - N_("automatically accept incoming files (use carefully!)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - xfer_config_file_auto_accept_nicks = weechat_config_new_option ( - xfer_config_file, ptr_section, - "auto_accept_nicks", "string", - N_("comma-separated list of nicks for which the incoming files and " - "chats are automatically accepted; format is \"server.nick\" (for a " - "specific server) or \"nick\" (for all servers); example: " - "\"libera.FlashCode,andrew\""), - NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - xfer_config_file_auto_check_crc32 = weechat_config_new_option ( - xfer_config_file, ptr_section, - "auto_check_crc32", "boolean", - N_("automatically check CRC32 file checksum if it is found in the " - "filename (8 hexadecimal chars)"), - NULL, 0, 0, "off", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - xfer_config_file_auto_rename = weechat_config_new_option ( - xfer_config_file, ptr_section, - "auto_rename", "boolean", - N_("rename incoming files if already exists (add \".1\", \".2\", ...)"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - xfer_config_file_auto_resume = weechat_config_new_option ( - xfer_config_file, ptr_section, - "auto_resume", "boolean", - N_("automatically resume file transfer if connection with remote host " - "is lost"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - xfer_config_file_convert_spaces = weechat_config_new_option ( - xfer_config_file, ptr_section, - "convert_spaces", "boolean", - N_("convert spaces to underscores when sending and receiving files"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - xfer_config_file_download_path = weechat_config_new_option ( - xfer_config_file, ptr_section, - "download_path", "string", - N_("path for writing incoming files " - "(path is evaluated, see function string_eval_path_home in " - "plugin API reference)"), - NULL, 0, 0, "${weechat_data_dir}/xfer", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - xfer_config_file_download_temporary_suffix = weechat_config_new_option ( - xfer_config_file, ptr_section, - "download_temporary_suffix", "string", - N_("temporary filename suffix used during the transfer for a file " - "received, it is removed after successful transfer; " - "if empty string, no filename suffix is used during the transfer"), - NULL, 0, 0, ".part", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - xfer_config_file_upload_path = weechat_config_new_option ( - xfer_config_file, ptr_section, - "upload_path", "string", - N_("path for reading files when sending " - "(path is evaluated, see function string_eval_path_home in " - "plugin API reference)"), - NULL, 0, 0, "~", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - xfer_config_file_use_nick_in_filename = weechat_config_new_option ( - xfer_config_file, ptr_section, - "use_nick_in_filename", "boolean", - N_("use remote nick as prefix in local filename when receiving a file"), - NULL, 0, 0, "on", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - return 1; } |