aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2001-11-16 03:58:49 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2001-11-16 03:58:49 +0000
commit6da73298fc1d2e2584c1c1adaf75bf640064eb38 (patch)
tree035c474a4c86579da037c1b467160abce1ca56d7
parentadd ChangeLog (diff)
downloadw3m-6da73298fc1d2e2584c1c1adaf75bf640064eb38.tar.gz
w3m-6da73298fc1d2e2584c1c1adaf75bf640064eb38.zip
[w3m-dev 02408] meta refresh
From: Tsutomu Okada <okada@furuno.co.jp>
-rw-r--r--ChangeLog12
-rw-r--r--file.c12
-rw-r--r--fm.h13
-rw-r--r--main.c12
-rw-r--r--rc.c3
5 files changed, 42 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index d04ce07..bb8451a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2001-11-16 Tsutomu Okada <okada@furuno.co.jp>
+ * file.c (HTMLtagproc1): [w3m-dev 02408] meta refresh
+ use MetaRefresh
+ add case refresh > 0
+ * fm.h:
+ add MetaRefresh
+ move alarm related definition from main.c
+ * main.c:
+ move alarm releated definition to fm.h
+ (SigAlarm): alarm_once
+ * rc.c:
+ add CMT_META_REFRESH
+
* file.c (loadHTMLBuffer): [w3m-dev 02415]
clean up temporary files
diff --git a/file.c b/file.c
index 50900c0..93497b8 100644
--- a/file.c
+++ b/file.c
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.5 2001/11/16 03:33:28 ukai Exp $ */
+/* $Id: file.c,v 1.6 2001/11/16 03:58:49 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -3589,10 +3589,18 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
refresh, cur_hseq++, q, q);
push_str(obuf, s_tmp->length, tmp, PC_ASCII);
flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit);
- if (!is_redisplay && refresh == 0) {
+ if (!is_redisplay && refresh == 0 && MetaRefresh) {
pushEvent(FUNCNAME_goURL, s_tmp->ptr);
/* pushEvent(deletePrevBuf,NULL); */
}
+#ifdef USE_ALARM
+ else if (!is_redisplay && refresh > 0 && MetaRefresh) {
+ alarm_sec = refresh;
+ alarm_once = TRUE;
+ alarm_event.cmd = FUNCNAME_goURL;
+ alarm_event.user_data = s_tmp->ptr;
+ }
+#endif
}
}
return 1;
diff --git a/fm.h b/fm.h
index c9b35bb..5b50420 100644
--- a/fm.h
+++ b/fm.h
@@ -1,4 +1,4 @@
-/* $Id: fm.h,v 1.3 2001/11/15 00:32:13 a-ito Exp $ */
+/* $Id: fm.h,v 1.4 2001/11/16 03:58:49 ukai Exp $ */
/*
* w3m: WWW wo Miru utility
*
@@ -621,6 +621,7 @@ global char TargetSelf init(FALSE);
global char PermitSaveToPipe init(FALSE);
global char DecodeCTE init(FALSE);
global char ArgvIsURL init(FALSE);
+global char MetaRefresh init(FALSE);
global char fmInitialized init(FALSE);
@@ -847,6 +848,16 @@ int backend( void );
extern void deleteFiles(void);
void w3m_exit( int i );
+typedef struct {
+ int cmd;
+ void *user_data;
+} Event;
+#ifdef USE_ALARM
+global int alarm_sec init(0);
+global short alarm_once init(0);
+global Event alarm_event;
+#endif
+
/*
* Externals
*/
diff --git a/main.c b/main.c
index be8b81f..8791dc3 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.4 2001/11/16 03:30:15 ukai Exp $ */
+/* $Id: main.c,v 1.5 2001/11/16 03:58:49 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -32,16 +32,10 @@ Hist *ShellHist;
Hist *TextHist;
#define N_EVENT_QUEUE 10
-typedef struct {
- int cmd;
- void *user_data;
-} Event;
static Event eventQueue[N_EVENT_QUEUE];
static int n_event_queue;
#ifdef USE_ALARM
-static int alarm_sec = 0;
-static Event alarm_event;
static MySignalHandler SigAlarm(SIGNAL_ARG);
#endif
@@ -4618,6 +4612,9 @@ SigAlarm(SIGNAL_ARG)
CurrentMenuData = NULL;
#endif
w3mFuncList[alarm_event.cmd].func();
+ onA();
+ if (alarm_once)
+ alarm_sec = 0;
signal(SIGALRM, SigAlarm);
alarm(alarm_sec);
}
@@ -4647,6 +4644,7 @@ setAlarm(void)
}
if (cmd >= 0) {
alarm_sec = sec;
+ alarm_once = FALSE;
alarm_event.cmd = cmd;
alarm_event.user_data = getQWord(&data);
signal(SIGALRM, SigAlarm);
diff --git a/rc.c b/rc.c
index c3d48f4..6234210 100644
--- a/rc.c
+++ b/rc.c
@@ -143,6 +143,7 @@ static int rc_initialized = 0;
#endif
#define CMT_FOLLOW_REDIRECTION "従うリダイレクトの回数"
+#define CMT_META_REFRESH "meta refresh に対応する"
#else /* LANG != JA */
@@ -236,6 +237,7 @@ static int rc_initialized = 0;
#define CMT_COOKIE_ACCEPT_DOMAINS "Domains from which should accept cookies"
#endif
#define CMT_FOLLOW_REDIRECTION "Follow this number of redirections"
+#define CMT_META_REFRESH "Support meta refresh"
#endif /* LANG != JA */
#define PI_TEXT 0
@@ -460,6 +462,7 @@ struct param_ptr params9[] =
{"argv_is_url", P_CHARINT, PI_ONOFF, (void *) &ArgvIsURL, CMT_ARGV_IS_URL, NULL},
{"retry_http", P_INT, PI_ONOFF, (void *) &retryAsHttp, CMT_RETRY_HTTP, NULL},
{"follow_redirection", P_INT, PI_TEXT, &FollowRedirection, CMT_FOLLOW_REDIRECTION, NULL},
+ {"meta_refresh", P_CHARINT, PI_ONOFF, (void *) &MetaRefresh, CMT_META_REFRESH, NULL},
#ifdef USE_SSL
{"ssl_forbid_method", P_STRING, PI_TEXT, (void *) &ssl_forbid_method, CMT_SSL_FORBID_METHOD, NULL},
#endif /* USE_SSL */