aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-06-01 17:09:04 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-06-01 17:09:04 +0000
commit900682ebd541cad4fceb918c0ec37c3b1f98c78b (patch)
tree494cc6e76a948f9da7ed9dfc1d22e2c3b1b1a11f /main.c
parent[w3m-dev 03200] Re: New configuration option ``keymap_file'' and new command ... (diff)
downloadw3m-900682ebd541cad4fceb918c0ec37c3b1f98c78b.tar.gz
w3m-900682ebd541cad4fceb918c0ec37c3b1f98c78b.zip
[w3m-dev-en 00748] PATCH: Reinitialize w3m while running
* funcname.tab (INIT_MAILCAP): deleted (REINIT): added * main.c (config_filename): added (reinit): added * proto.h (reinit): added * rc.c (rc_initialized): deleted * w3mhelperpanel.c (editMailcap): use REINIT MAILCAP From: Tushar Samant <scribble@pobox.com>
Diffstat (limited to 'main.c')
-rw-r--r--main.c69
1 files changed, 67 insertions, 2 deletions
diff --git a/main.c b/main.c
index 5a48704..3d38d71 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.100 2002/06/01 16:50:16 ukai Exp $ */
+/* $Id: main.c,v 1.101 2002/06/01 17:09:05 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -25,6 +25,8 @@ extern int do_getch();
#define DSTR_LEN 256
+static char *config_filename = NULL;
+
Hist *LoadHist;
Hist *SaveHist;
Hist *URLHist;
@@ -354,7 +356,6 @@ MAIN(int argc, char **argv, char **envp)
char search_header = FALSE;
char *default_type = NULL;
char *post_file = NULL;
- char *config_filename = NULL;
Str err_msg;
#ifndef HAVE_SYS_ERRLIST
@@ -5093,6 +5094,70 @@ setAlarmEvent(int sec, short status, int cmd, void *data)
#endif
void
+reinit()
+{
+ char *resource = searchKeyData();
+
+ if (resource == NULL) {
+ init_rc(config_filename);
+#ifdef USE_COOKIE
+ initCookie();
+#endif
+ initKeymap();
+#ifdef USE_MENU
+ initMenu();
+#endif
+ return;
+ }
+
+ if (!strcasecmp(resource, "CONFIG") || !strcasecmp(resource, "RC")) {
+ init_rc(config_filename);
+ return;
+ }
+
+#ifdef USE_COOKIE
+ if (!strcasecmp(resource, "COOKIE")) {
+ initCookie();
+ return;
+ }
+#endif
+
+ if (!strcasecmp(resource, "KEYMAP")) {
+ initKeymap();
+ return;
+ }
+
+ if (!strcasecmp(resource, "MAILCAP")) {
+ initMailcap();
+ return;
+ }
+
+#ifdef USE_MENU
+ if (!strcasecmp(resource, "MENU")) {
+ initMenu();
+ return;
+ }
+#endif
+
+ if (!strcasecmp(resource, "MIMETYPES")) {
+ initMimeTypes();
+ return;
+ }
+
+#ifdef USE_EXTERNAL_URI_LOADER
+ if (!strcasecmp(resource, "URIMETHODS")) {
+ initURIMethods();
+ return;
+ }
+#endif
+
+ disp_err_message(
+ Sprintf("Don't know how to reinitialize '%s'", resource)->ptr,
+ FALSE
+ );
+}
+
+void
defKey(void)
{
char *data;