commit 28de981639976a565d2865adcf17de20405d6395
parent f2aa018102fd066767531c94bb3698c31bd76882
Author: ukai <ukai>
Date: Fri, 16 Nov 2001 03:58:49 +0000
[w3m-dev 02408] meta refresh
From: Tsutomu Okada <okada@furuno.co.jp>
Diffstat:
5 files changed, 39 insertions(+), 7 deletions(-)
diff --git 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
@@ -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
@@ -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
@@ -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
@@ -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 */