summaryrefslogtreecommitdiff
path: root/src/core/wee-config.h
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2007-12-01 00:35:57 +0100
committerSebastien Helleu <flashcode@flashtux.org>2007-12-01 00:35:57 +0100
commit59fb878b77320844d7d2150c95ce22c253ffb4e6 (patch)
treedbb9ee486748b0c64fcf558732ae643474e33b3f /src/core/wee-config.h
parent32cc6ae5d8a2c0753eb2ef8ecb7194f0afff4302 (diff)
downloadweechat-59fb878b77320844d7d2150c95ce22c253ffb4e6.zip
New config functions, almost entirely rewritten from scratch
Diffstat (limited to 'src/core/wee-config.h')
-rw-r--r--src/core/wee-config.h336
1 files changed, 159 insertions, 177 deletions
diff --git a/src/core/wee-config.h b/src/core/wee-config.h
index ac62dbe32..d7ac9748a 100644
--- a/src/core/wee-config.h
+++ b/src/core/wee-config.h
@@ -20,183 +20,165 @@
#ifndef __WEECHAT_CONFIG_H
#define __WEECHAT_CONFIG_H 1
-#include "wee-config-option.h"
#include "wee-config-file.h"
-#include "../gui/gui-chat.h"
-#include "../gui/gui-color.h"
-
-#define WEECHAT_CONFIG_NAME "weechat.rc"
-
-#define CFG_LOOK_NICKLIST_LEFT 0
-#define CFG_LOOK_NICKLIST_RIGHT 1
-#define CFG_LOOK_NICKLIST_TOP 2
-#define CFG_LOOK_NICKLIST_BOTTOM 3
-
-#define CFG_LOOK_PREFIX_ALIGN_NONE 0
-#define CFG_LOOK_PREFIX_ALIGN_LEFT 1
-#define CFG_LOOK_PREFIX_ALIGN_RIGHT 2
-
-#define CFG_LOOK_HOTLIST_SORT_GROUP_TIME_ASC 0
-#define CFG_LOOK_HOTLIST_SORT_GROUP_TIME_DESC 1
-#define CFG_LOOK_HOTLIST_SORT_GROUP_NUMBER_ASC 2
-#define CFG_LOOK_HOTLIST_SORT_GROUP_NUMBER_DESC 3
-#define CFG_LOOK_HOTLIST_SORT_NUMBER_ASC 4
-#define CFG_LOOK_HOTLIST_SORT_NUMBER_DESC 5
-
-extern struct t_config_option weechat_options_look[];
-extern int cfg_look_color_real_white;
-extern int cfg_look_save_on_exit;
-extern int cfg_look_set_title;
-extern int cfg_look_startup_logo;
-extern int cfg_look_startup_version;
-extern char *cfg_look_weechat_slogan;
-extern int cfg_look_one_server_buffer;
-extern int cfg_look_open_near_server;
-extern int cfg_look_scroll_amount;
-extern char *cfg_look_buffer_time_format;
-extern int cfg_look_color_nicks_number;
-extern int cfg_look_color_actions;
-extern int cfg_look_nicklist;
-extern int cfg_look_nicklist_position;
-extern int cfg_look_nicklist_min_size;
-extern int cfg_look_nicklist_max_size;
-extern int cfg_look_nicklist_separator;
-extern int cfg_look_nickmode;
-extern int cfg_look_nickmode_empty;
-extern char *cfg_look_no_nickname;
-extern char *cfg_look_prefix[GUI_CHAT_PREFIX_NUMBER];
-extern int cfg_look_prefix_align;
-extern int cfg_look_prefix_align_max;
-extern char *cfg_look_prefix_suffix;
-extern int cfg_look_align_text_offset;
-extern char *cfg_look_nick_completor;
-extern char *cfg_look_nick_completion_ignore;
-extern int cfg_look_nick_completion_smart;
-extern int cfg_look_nick_complete_first;
-extern int cfg_look_infobar;
-extern char *cfg_look_infobar_time_format;
-extern int cfg_look_infobar_seconds;
-extern int cfg_look_infobar_delay_highlight;
-extern int cfg_look_hotlist_names_count;
-extern int cfg_look_hotlist_names_level;
-extern int cfg_look_hotlist_names_length;
-extern int cfg_look_hotlist_sort;
-extern int cfg_look_day_change;
-extern char *cfg_look_day_change_time_format;
-extern char *cfg_look_read_marker;
-extern char *cfg_look_input_format;
-extern int cfg_look_paste_max_lines;
-
-extern struct t_config_option weechat_options_colors[];
-extern int cfg_col_separator;
-extern int cfg_col_title;
-extern int cfg_col_title_bg;
-extern int cfg_col_title_more;
-extern int cfg_col_chat;
-extern int cfg_col_chat_bg;
-extern int cfg_col_chat_time;
-extern int cfg_col_chat_time_delimiters;
-extern int cfg_col_chat_prefix[GUI_CHAT_PREFIX_NUMBER];
-extern int cfg_col_chat_prefix_more;
-extern int cfg_col_chat_prefix_suffix;
-extern int cfg_col_chat_buffer;
-extern int cfg_col_chat_server;
-extern int cfg_col_chat_channel;
-extern int cfg_col_chat_nick;
-extern int cfg_col_chat_nick_self;
-extern int cfg_col_chat_nick_other;
-extern int cfg_col_chat_nick_colors[GUI_COLOR_NICK_NUMBER];
-extern int cfg_col_chat_host;
-extern int cfg_col_chat_delimiters;
-extern int cfg_col_chat_highlight;
-extern int cfg_col_chat_read_marker;
-extern int cfg_col_chat_read_marker_bg;
-extern int cfg_col_status;
-extern int cfg_col_status_bg;
-extern int cfg_col_status_delimiters;
-extern int cfg_col_status_channel;
-extern int cfg_col_status_data_msg;
-extern int cfg_col_status_data_private;
-extern int cfg_col_status_data_highlight;
-extern int cfg_col_status_data_other;
-extern int cfg_col_status_more;
-extern int cfg_col_infobar;
-extern int cfg_col_infobar_bg;
-extern int cfg_col_infobar_delimiters;
-extern int cfg_col_infobar_highlight;
-extern int cfg_col_infobar_bg;
-extern int cfg_col_input;
-extern int cfg_col_input_bg;
-extern int cfg_col_input_server;
-extern int cfg_col_input_channel;
-extern int cfg_col_input_nick;
-extern int cfg_col_input_delimiters;
-extern int cfg_col_input_text_not_found;
-extern int cfg_col_input_actions;
-extern int cfg_col_nicklist;
-extern int cfg_col_nicklist_bg;
-extern int cfg_col_nicklist_away;
-extern int cfg_col_nicklist_prefix1;
-extern int cfg_col_nicklist_prefix2;
-extern int cfg_col_nicklist_prefix3;
-extern int cfg_col_nicklist_prefix4;
-extern int cfg_col_nicklist_prefix5;
-extern int cfg_col_nicklist_more;
-extern int cfg_col_nicklist_separator;
-extern int cfg_col_info;
-extern int cfg_col_info_bg;
-extern int cfg_col_info_waiting;
-extern int cfg_col_info_connecting;
-extern int cfg_col_info_active;
-extern int cfg_col_info_done;
-extern int cfg_col_info_failed;
-extern int cfg_col_info_aborted;
-
-extern struct t_config_option weechat_options_history[];
-extern int cfg_history_max_lines;
-extern int cfg_history_max_commands;
-extern int cfg_history_display_default;
-
-extern struct t_config_option weechat_options_proxy[];
-extern int cfg_proxy_use;
-extern int cfg_proxy_type;
-extern char *cfg_proxy_type_values[];
-extern int cfg_proxy_ipv6;
-extern char *cfg_proxy_address;
-extern int cfg_proxy_port;
-extern char *cfg_proxy_username;
-extern char *cfg_proxy_password;
-
-extern struct t_config_option weechat_options_plugins[];
-extern char *cfg_plugins_path;
-extern char *cfg_plugins_autoload;
-extern char *cfg_plugins_extension;
-
-extern char *weechat_config_sections[];
-extern struct t_config_option *weechat_config_options[];
-
-extern void weechat_config_change_noop ();
-extern void weechat_config_change_save_on_exit ();
-extern void weechat_config_change_title ();
-extern void weechat_config_change_buffers ();
-extern void weechat_config_change_buffer_content ();
-extern void weechat_config_change_buffer_time_format ();
-extern void weechat_config_change_hotlist ();
-extern void weechat_config_change_read_marker ();
-extern void weechat_config_change_prefix ();
-extern void weechat_config_change_color ();
-extern void weechat_config_change_nicks_colors ();
-
-extern int weechat_config_read_alias (struct t_config_option *, char *, char *);
-extern int weechat_config_read_key (struct t_config_option *, char *, char *);
-extern int weechat_config_read ();
-extern int weechat_config_write_alias (FILE *, char *, struct t_config_option *);
-extern int weechat_config_write_keys (FILE *, char *, struct t_config_option *);
-extern int weechat_config_write_alias_default_values (FILE *, char *,
- struct t_config_option *);
-extern int weechat_config_write_keys_default_values (FILE *, char *,
- struct t_config_option *);
-extern int weechat_config_write ();
-extern void weechat_config_print_stdout ();
+
+#define WEECHAT_CONFIG_FILENAME "weechat.rc"
+
+#define CONFIG_LOOK_NICKLIST_LEFT 0
+#define CONFIG_LOOK_NICKLIST_RIGHT 1
+#define CONFIG_LOOK_NICKLIST_TOP 2
+#define CONFIG_LOOK_NICKLIST_BOTTOM 3
+
+#define CONFIG_LOOK_PREFIX_ALIGN_NONE 0
+#define CONFIG_LOOK_PREFIX_ALIGN_LEFT 1
+#define CONFIG_LOOK_PREFIX_ALIGN_RIGHT 2
+
+#define CONFIG_LOOK_HOTLIST_SORT_GROUP_TIME_ASC 0
+#define CONFIG_LOOK_HOTLIST_SORT_GROUP_TIME_DESC 1
+#define CONFIG_LOOK_HOTLIST_SORT_GROUP_NUMBER_ASC 2
+#define CONFIG_LOOK_HOTLIST_SORT_GROUP_NUMBER_DESC 3
+#define CONFIG_LOOK_HOTLIST_SORT_NUMBER_ASC 4
+#define CONFIG_LOOK_HOTLIST_SORT_NUMBER_DESC 5
+
+extern struct t_config_file *weechat_config;
+
+extern struct t_config_option *config_look_color_real_white;
+extern struct t_config_option *config_look_save_on_exit;
+extern struct t_config_option *config_look_set_title;
+extern struct t_config_option *config_look_startup_logo;
+extern struct t_config_option *config_look_startup_version;
+extern struct t_config_option *config_look_weechat_slogan;
+extern struct t_config_option *config_look_one_server_buffer;
+extern struct t_config_option *config_look_open_near_server;
+extern struct t_config_option *config_look_scroll_amount;
+extern struct t_config_option *config_look_buffer_time_format;
+extern struct t_config_option *config_look_color_nicks_number;
+extern struct t_config_option *config_look_color_actions;
+extern struct t_config_option *config_look_nicklist;
+extern struct t_config_option *config_look_nicklist_position;
+extern struct t_config_option *config_look_nicklist_min_size;
+extern struct t_config_option *config_look_nicklist_max_size;
+extern struct t_config_option *config_look_nicklist_separator;
+extern struct t_config_option *config_look_nickmode;
+extern struct t_config_option *config_look_nickmode_empty;
+extern struct t_config_option *config_look_no_nickname;
+extern struct t_config_option *config_look_prefix[];
+extern struct t_config_option *config_look_prefix_align;
+extern struct t_config_option *config_look_prefix_align_max;
+extern struct t_config_option *config_look_prefix_suffix;
+extern struct t_config_option *config_look_nick_completor;
+extern struct t_config_option *config_look_nick_completion_ignore;
+extern struct t_config_option *config_look_nick_completion_smart;
+extern struct t_config_option *config_look_nick_complete_first;
+extern struct t_config_option *config_look_infobar;
+extern struct t_config_option *config_look_infobar_time_format;
+extern struct t_config_option *config_look_infobar_seconds;
+extern struct t_config_option *config_look_infobar_delay_highlight;
+extern struct t_config_option *config_look_hotlist_names_count;
+extern struct t_config_option *config_look_hotlist_names_level;
+extern struct t_config_option *config_look_hotlist_names_length;
+extern struct t_config_option *config_look_hotlist_sort;
+extern struct t_config_option *config_look_day_change;
+extern struct t_config_option *config_look_day_change_time_format;
+extern struct t_config_option *config_look_read_marker;
+extern struct t_config_option *config_look_input_format;
+extern struct t_config_option *config_look_paste_max_lines;
+
+extern struct t_config_option *config_color_separator;
+extern struct t_config_option *config_color_title;
+extern struct t_config_option *config_color_title_bg;
+extern struct t_config_option *config_color_title_more;
+extern struct t_config_option *config_color_chat;
+extern struct t_config_option *config_color_chat_bg;
+extern struct t_config_option *config_color_chat_time;
+extern struct t_config_option *config_color_chat_time_delimiters;
+extern struct t_config_option *config_color_chat_prefix[];
+extern struct t_config_option *config_color_chat_prefix_more;
+extern struct t_config_option *config_color_chat_prefix_suffix;
+extern struct t_config_option *config_color_chat_buffer;
+extern struct t_config_option *config_color_chat_server;
+extern struct t_config_option *config_color_chat_channel;
+extern struct t_config_option *config_color_chat_nick;
+extern struct t_config_option *config_color_chat_nick_self;
+extern struct t_config_option *config_color_chat_nick_other;
+extern struct t_config_option *config_color_chat_nick_colors[];
+extern struct t_config_option *config_color_chat_host;
+extern struct t_config_option *config_color_chat_delimiters;
+extern struct t_config_option *config_color_chat_highlight;
+extern struct t_config_option *config_color_chat_read_marker;
+extern struct t_config_option *config_color_chat_read_marker_bg;
+extern struct t_config_option *config_color_status;
+extern struct t_config_option *config_color_status_bg;
+extern struct t_config_option *config_color_status_delimiters;
+extern struct t_config_option *config_color_status_channel;
+extern struct t_config_option *config_color_status_data_msg;
+extern struct t_config_option *config_color_status_data_private;
+extern struct t_config_option *config_color_status_data_highlight;
+extern struct t_config_option *config_color_status_data_other;
+extern struct t_config_option *config_color_status_more;
+extern struct t_config_option *config_color_infobar;
+extern struct t_config_option *config_color_infobar_bg;
+extern struct t_config_option *config_color_infobar_delimiters;
+extern struct t_config_option *config_color_infobar_highlight;
+extern struct t_config_option *config_color_infobar_bg;
+extern struct t_config_option *config_color_input;
+extern struct t_config_option *config_color_input_bg;
+extern struct t_config_option *config_color_input_server;
+extern struct t_config_option *config_color_input_channel;
+extern struct t_config_option *config_color_input_nick;
+extern struct t_config_option *config_color_input_delimiters;
+extern struct t_config_option *config_color_input_text_not_found;
+extern struct t_config_option *config_color_input_actions;
+extern struct t_config_option *config_color_nicklist;
+extern struct t_config_option *config_color_nicklist_bg;
+extern struct t_config_option *config_color_nicklist_away;
+extern struct t_config_option *config_color_nicklist_prefix1;
+extern struct t_config_option *config_color_nicklist_prefix2;
+extern struct t_config_option *config_color_nicklist_prefix3;
+extern struct t_config_option *config_color_nicklist_prefix4;
+extern struct t_config_option *config_color_nicklist_prefix5;
+extern struct t_config_option *config_color_nicklist_more;
+extern struct t_config_option *config_color_nicklist_separator;
+extern struct t_config_option *config_color_info;
+extern struct t_config_option *config_color_info_bg;
+extern struct t_config_option *config_color_info_waiting;
+extern struct t_config_option *config_color_info_connecting;
+extern struct t_config_option *config_color_info_active;
+extern struct t_config_option *config_color_info_done;
+extern struct t_config_option *config_color_info_failed;
+extern struct t_config_option *config_color_info_aborted;
+
+extern struct t_config_option *config_history_max_lines;
+extern struct t_config_option *config_history_max_commands;
+extern struct t_config_option *config_history_display_default;
+
+extern struct t_config_option *config_proxy_use;
+extern struct t_config_option *config_proxy_type;
+extern struct t_config_option *config_proxy_ipv6;
+extern struct t_config_option *config_proxy_address;
+extern struct t_config_option *config_proxy_port;
+extern struct t_config_option *config_proxy_username;
+extern struct t_config_option *config_proxy_password;
+
+extern struct t_config_option *config_plugins_path;
+extern struct t_config_option *config_plugins_autoload;
+extern struct t_config_option *config_plugins_extension;
+
+extern void config_change_noop ();
+extern void config_change_save_on_exit ();
+extern void config_change_title ();
+extern void config_change_buffers ();
+extern void config_change_buffer_content ();
+extern void config_change_buffer_time_format ();
+extern void config_change_hotlist ();
+extern void config_change_read_marker ();
+extern void config_change_prefix ();
+extern void config_change_color ();
+extern void config_change_nicks_colors ();
+
+extern void config_weechat_init ();
+extern int config_weechat_read ();
+extern int config_weechat_write ();
+extern void config_weechat_print_stdout ();
#endif /* wee-config.h */