summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-05-13 14:27:33 +0200
committerSebastien Helleu <flashcode@flashtux.org>2008-05-13 14:27:33 +0200
commit673e4ad3bed15e26d6384103549127c56e7ce7b8 (patch)
tree8ea7dd032ceba539cd1d011e444a8e4c3d5dbca9 /src/core
parenta804fb1936ee46a86c83053f9c5647371fea64fd (diff)
downloadweechat-673e4ad3bed15e26d6384103549127c56e7ce7b8.zip
Disable auto-connect for plugins with command line option ("-a")
Diffstat (limited to 'src/core')
-rw-r--r--src/core/wee-command.c2
-rw-r--r--src/core/wee-string.c4
-rw-r--r--src/core/wee-utf8.c4
-rw-r--r--src/core/weechat.c43
-rw-r--r--src/core/weechat.h5
5 files changed, 29 insertions, 29 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index 3ca29a587..24847f194 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -1661,7 +1661,7 @@ command_quit (void *data, struct t_gui_buffer *buffer,
(argc > 1) ? argv_eol[1] : NULL);
/* force end of main loop */
- quit_weechat = 1;
+ weechat_quit = 1;
return WEECHAT_RC_OK;
}
diff --git a/src/core/wee-string.c b/src/core/wee-string.c
index a2784b542..e0089d7d7 100644
--- a/src/core/wee-string.c
+++ b/src/core/wee-string.c
@@ -940,7 +940,7 @@ string_iconv_to_internal (char *charset, char *string)
output = string_iconv (0,
(charset && charset[0]) ?
- charset : local_charset,
+ charset : weechat_local_charset,
WEECHAT_INTERNAL_CHARSET,
input);
utf8_normalize (output, '?');
@@ -976,7 +976,7 @@ string_iconv_from_internal (char *charset, char *string)
output = string_iconv (1,
WEECHAT_INTERNAL_CHARSET,
(charset && charset[0]) ?
- charset : local_charset,
+ charset : weechat_local_charset,
input);
free (input);
return output;
diff --git a/src/core/wee-utf8.c b/src/core/wee-utf8.c
index c6f6f5a4d..7dbb5ac8c 100644
--- a/src/core/wee-utf8.c
+++ b/src/core/wee-utf8.c
@@ -41,7 +41,7 @@ int local_utf8 = 0;
void
utf8_init ()
{
- local_utf8 = (string_strcasecmp (local_charset, "UTF-8") == 0);
+ local_utf8 = (string_strcasecmp (weechat_local_charset, "UTF-8") == 0);
}
/*
@@ -443,7 +443,7 @@ utf8_pos (char *string, int real_pos)
int count;
char *limit;
- if (!string || !local_charset)
+ if (!string || !weechat_local_charset)
return real_pos;
count = 0;
diff --git a/src/core/weechat.c b/src/core/weechat.c
index 6ba8eb4b1..f9c266897 100644
--- a/src/core/weechat.c
+++ b/src/core/weechat.c
@@ -66,18 +66,16 @@
#include "../plugins/plugin.h"
-char *weechat_argv0 = NULL; /* WeeChat binary file name (argv[0]) */
-char *weechat_session = NULL; /* WeeChat session file (for /upgrade cmd) */
-time_t weechat_start_time; /* WeeChat start time (used by /uptime cmd) */
-int quit_weechat; /* = 1 if quit request from user... why ? :'( */
-int sigsegv = 0; /* SIGSEGV received? */
-char *weechat_home = NULL; /* WeeChat home dir. (default: ~/.weechat) */
-
-char *local_charset = NULL; /* local charset, for ex.: ISO-8859-1, UTF-8 */
-
-int server_cmd_line; /* at least 1 server on WeeChat command line */
-int auto_connect; /* enabled by default (cmd option to disable) */
-int auto_load_plugins; /* enabled by default (cmd option to disable) */
+char *weechat_argv0 = NULL; /* WeeChat binary file name (argv[0])*/
+char *weechat_session = NULL; /* session file (/upgrade) */
+time_t weechat_start_time; /* start time (used by /uptime cmd) */
+int weechat_quit; /* = 1 if quit request from user */
+int weechat_sigsegv = 0; /* SIGSEGV received? */
+char *weechat_home = NULL; /* home dir. (default: ~/.weechat) */
+char *weechat_local_charset = NULL; /* example: ISO-8859-1, UTF-8 */
+int weechat_server_cmd_line = 0; /* at least 1 server on cmd line */
+int weechat_auto_load_plugins = 1; /* auto load plugins */
+int weechat_auto_connect = 1; /* auto connect in plugins */
/*
@@ -181,15 +179,15 @@ weechat_parse_args (int argc, char *argv[])
weechat_argv0 = strdup (argv[0]);
weechat_session = NULL;
weechat_home = NULL;
- server_cmd_line = 0;
- auto_connect = 1;
- auto_load_plugins = 1;
+ weechat_server_cmd_line = 0;
+ weechat_auto_load_plugins = 1;
+ weechat_auto_connect = 1;
for (i = 1; i < argc; i++)
{
if ((strcmp (argv[i], "-a") == 0)
|| (strcmp (argv[i], "--no-connect") == 0))
- auto_connect = 0;
+ weechat_auto_connect = 0;
else if ((strcmp (argv[i], "-c") == 0)
|| (strcmp (argv[i], "--config") == 0))
{
@@ -248,7 +246,7 @@ weechat_parse_args (int argc, char *argv[])
else if ((strcmp (argv[i], "-p") == 0)
|| (strcmp (argv[i], "--no-plugin") == 0))
{
- auto_load_plugins = 0;
+ weechat_auto_load_plugins = 0;
}
else if (strcmp (argv[i], "--session") == 0)
{
@@ -435,8 +433,8 @@ weechat_shutdown (int return_code, int crash)
if (weechat_home)
free (weechat_home);
log_close ();
- if (local_charset)
- free (local_charset);
+ if (weechat_local_charset)
+ free (weechat_local_charset);
if (crash)
abort();
@@ -459,9 +457,9 @@ main (int argc, char *argv[])
#endif
#ifdef HAVE_LANGINFO_CODESET
- local_charset = strdup (nl_langinfo (CODESET));
+ weechat_local_charset = strdup (nl_langinfo (CODESET));
#else
- local_charset = strdup ("");
+ weechat_local_charset = strdup ("");
#endif
utf8_init ();
@@ -488,7 +486,8 @@ main (int argc, char *argv[])
//session_load (weechat_session); /* load previous session if asked */
weechat_welcome_message (); /* display WeeChat welcome message */
command_startup (0); /* command executed before plugins */
- plugin_init (auto_load_plugins); /* init plugin interface(s) */
+ plugin_init (weechat_auto_load_plugins); /* init plugin interface(s) */
+ weechat_auto_connect = 1; /* auto-connect for future plugins */
command_startup (1); /* command executed after plugins */
gui_main_loop (); /* WeeChat main loop */
diff --git a/src/core/weechat.h b/src/core/weechat.h
index 79950e1aa..4a29f308b 100644
--- a/src/core/weechat.h
+++ b/src/core/weechat.h
@@ -100,9 +100,10 @@
extern char *weechat_argv0;
extern time_t weechat_start_time;
-extern int quit_weechat;
+extern int weechat_quit;
extern char *weechat_home;
-extern char *local_charset;
+extern char *weechat_local_charset;
+extern int weechat_auto_connect;
extern void weechat_dump (int crash);
extern void weechat_shutdown (int return_code, int crash);