9 |
* ### Fast & light environment for Chat ### |
* ### Fast & light environment for Chat ### |
10 |
* ### ### |
* ### ### |
11 |
* ### By FlashCode <flashcode@flashtux.org> ### |
* ### By FlashCode <flashcode@flashtux.org> ### |
12 |
### ### |
* ### ### |
13 |
* ### http://weechat.flashtux.org ### |
* ### http://weechat.flashtux.org ### |
14 |
* ### ### |
* ### ### |
15 |
* ############################################################################ |
* ############################################################################ |
66 |
#include "fifo.h" |
#include "fifo.h" |
67 |
#include "../irc/irc.h" |
#include "../irc/irc.h" |
68 |
#include "../gui/gui.h" |
#include "../gui/gui.h" |
69 |
|
|
70 |
|
#ifdef PLUGINS |
71 |
#include "../plugins/plugins.h" |
#include "../plugins/plugins.h" |
72 |
|
#endif |
73 |
|
|
74 |
|
|
75 |
int quit_weechat; /* = 1 if quit request from user... why ? :'( */ |
int quit_weechat; /* = 1 if quit request from user... why ? :'( */ |
593 |
dir_length = strlen (weechat_home) + 64; |
dir_length = strlen (weechat_home) + 64; |
594 |
dir_name = (char *) malloc (dir_length * sizeof (char)); |
dir_name = (char *) malloc (dir_length * sizeof (char)); |
595 |
|
|
|
#ifdef PLUGIN_PERL |
|
|
/* create "~/.weechat/perl" */ |
|
|
snprintf (dir_name, dir_length, "%s%s%s", weechat_home, DIR_SEPARATOR, |
|
|
"perl"); |
|
|
if (wee_create_dir (dir_name)) |
|
|
{ |
|
|
/* create "~/.weechat/perl/autoload" */ |
|
|
snprintf (dir_name, dir_length, "%s%s%s%s%s", weechat_home, |
|
|
DIR_SEPARATOR, "perl", DIR_SEPARATOR, "autoload"); |
|
|
wee_create_dir (dir_name); |
|
|
/* create "~/.weechat/perl/config" */ |
|
|
snprintf (dir_name, dir_length, "%s%s%s%s%s", weechat_home, |
|
|
DIR_SEPARATOR, "perl", DIR_SEPARATOR, "config"); |
|
|
wee_create_dir (dir_name); |
|
|
} |
|
|
#endif |
|
|
|
|
|
#ifdef PLUGIN_PYTHON |
|
|
/* create "~/.weechat/python" */ |
|
|
snprintf (dir_name, dir_length, "%s%s%s", weechat_home, DIR_SEPARATOR, |
|
|
"python"); |
|
|
if (wee_create_dir (dir_name)) |
|
|
{ |
|
|
/* create "~/.weechat/python/autoload" */ |
|
|
snprintf (dir_name, dir_length, "%s%s%s%s%s", weechat_home, |
|
|
DIR_SEPARATOR, "python", DIR_SEPARATOR, "autoload"); |
|
|
wee_create_dir (dir_name); |
|
|
/* create "~/.weechat/python/config" */ |
|
|
snprintf (dir_name, dir_length, "%s%s%s%s%s", weechat_home, |
|
|
DIR_SEPARATOR, "python", DIR_SEPARATOR, "config"); |
|
|
wee_create_dir (dir_name); |
|
|
} |
|
|
#endif |
|
|
|
|
|
#ifdef PLUGIN_RUBY |
|
|
/* create "~/.weechat/ruby" */ |
|
|
snprintf (dir_name, dir_length, "%s%s%s", weechat_home, DIR_SEPARATOR, |
|
|
"ruby"); |
|
|
if (wee_create_dir (dir_name)) |
|
|
{ |
|
|
/* create "~/.weechat/ruby/autoload" */ |
|
|
snprintf (dir_name, dir_length, "%s%s%s%s%s", weechat_home, |
|
|
DIR_SEPARATOR, "ruby", DIR_SEPARATOR, "autoload"); |
|
|
wee_create_dir (dir_name); |
|
|
} |
|
|
#endif |
|
|
|
|
596 |
/* create "~/.weechat/logs" */ |
/* create "~/.weechat/logs" */ |
597 |
snprintf (dir_name, dir_length, "%s%s%s", weechat_home, DIR_SEPARATOR, |
snprintf (dir_name, dir_length, "%s%s%s", weechat_home, DIR_SEPARATOR, |
598 |
"logs"); |
"logs"); |
881 |
|
|
882 |
gui_init (); /* init WeeChat interface */ |
gui_init (); /* init WeeChat interface */ |
883 |
weechat_welcome_message (); /* display WeeChat welcome message */ |
weechat_welcome_message (); /* display WeeChat welcome message */ |
884 |
plugin_init (); /* init plugin interface(s) */ |
#ifdef PLUGINS |
885 |
|
plugin_init (); /* init plugin interface(s) */ |
886 |
|
#endif |
887 |
/* auto-connect to servers */ |
/* auto-connect to servers */ |
888 |
server_auto_connect (server_cmd_line); |
server_auto_connect (server_cmd_line); |
889 |
fifo_create (); /* create FIFO pipe for remote control */ |
fifo_create (); /* create FIFO pipe for remote control */ |
890 |
|
|
891 |
gui_main_loop (); /* WeeChat main loop */ |
gui_main_loop (); /* WeeChat main loop */ |
892 |
|
|
893 |
|
#ifdef PLUGINS |
894 |
plugin_end (); /* end plugin interface(s) */ |
plugin_end (); /* end plugin interface(s) */ |
895 |
|
#endif |
896 |
server_disconnect_all (); /* disconnect from all servers */ |
server_disconnect_all (); /* disconnect from all servers */ |
897 |
(void) config_write (NULL); /* save config file */ |
(void) config_write (NULL); /* save config file */ |
898 |
command_index_free (); /* free commands index */ |
command_index_free (); /* free commands index */ |