w3m

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/w3m.git/
Log | Files | Refs | README

commit ec25d9bb49b651a351cfe2dba8cc4ee30eed5984
parent 020b4ecb4a23512a6ae46925b857d61e8ec42a53
Author: ukai <ukai>
Date:   Thu,  6 Dec 2001 15:31:58 +0000

[w3m-dev 02622]
From: Tsutomu Okada <okada@furuno.co.jp>

Diffstat:
MChangeLog | 19+++++++++++++++++++
Mfile.c | 20+++++++++++++++++---
Mfm.h | 1+
Mhtml.c | 6++++--
Mhtml.h | 2++
Mmain.c | 12++++--------
Mtagtable.tab | 2++
7 files changed, 49 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,22 @@ +2001-12-07 Tsutomu Okada <okada@furuno.co.jp> + + * [w3m-dev 02622] + * tagtable.tab (noframes): added + * tagtable.tab (/noframes): added + * fm.h (RB_NOFRAMES): added + * html.h (HTML_NOFRAMES): added + * html.h (HTML_N_NOFRAMES): added + * html.c (ALST_NOFRAMES): added + * html.c (98 HTML_NOFRAMES): added + * html.c (99 HTML_N_NOFRAMES): added + * file.c (HTMLtagproc1): add HTML_NOFRAMES, HTML_N_NOFRAMES + * file.c (HTMLtagproc1): don't meta refresh if it is in noframes and + auto frame rendering + * main.c (MAIN): use setAlarmEvent() + * main.c (SigAlarm): ditto + * main.c (setAlarm): ditto + * main.c (setAlarmEvent): check if status == AL_UNSET + 2001-12-06 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp> * [w3m-dev 02619] diff --git a/file.c b/file.c @@ -3380,6 +3380,17 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); } return 0; + case HTML_NOFRAMES: + CLOSE_P; + flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); + obuf->flag |= (RB_NOFRAMES | RB_IGNORE_P); + /* istr = str; */ + return 1; + case HTML_N_NOFRAMES: + CLOSE_P; + flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); + obuf->flag &= ~RB_NOFRAMES; + return 1; case HTML_FRAME: q = r = NULL; parsedtag_get_value(tag, ATTR_SRC, &q); @@ -3711,19 +3722,22 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) 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_interval == 0 && MetaRefresh) { + if (!is_redisplay && refresh_interval == 0 && MetaRefresh && + !((obuf->flag & RB_NOFRAMES) && RenderFrame)) { pushEvent(FUNCNAME_goURL, s_tmp->ptr); /* pushEvent(deletePrevBuf,NULL); */ } #ifdef USE_ALARM - else if (!is_redisplay && refresh_interval > 0 && MetaRefresh) { + else if (!is_redisplay && refresh_interval > 0 && MetaRefresh && + !((obuf->flag & RB_NOFRAMES) && RenderFrame)) { setAlarmEvent(refresh_interval, AL_IMPLICIT, FUNCNAME_goURL, s_tmp->ptr); } #endif } #ifdef USE_ALARM - else if (!is_redisplay && refresh_interval > 0 && MetaRefresh) { + else if (!is_redisplay && refresh_interval > 0 && MetaRefresh && + !((obuf->flag & RB_NOFRAMES) && RenderFrame)) { tmp = Sprintf("Refresh (%d sec)", refresh_interval); push_str(obuf, 0, tmp, PC_ASCII); flushline(h_env, obuf, envs[h_env->envc].indent, 0, diff --git a/fm.h b/fm.h @@ -453,6 +453,7 @@ struct readbuffer { #define RB_IGNORE_P 0x4000 #define RB_TITLE 0x8000 #define RB_NFLUSHED 0x10000 +#define RB_NOFRAMES 0x20000 #ifdef FORMAT_NICE #define RB_FILL 0x200000 diff --git a/html.c b/html.c @@ -36,6 +36,8 @@ unsigned char ALST_FRAME[] = { ATTR_SRC, ATTR_NAME, ATTR_CORE }; #define MAXA_FRAME MAXA_CORE + 2 unsigned char ALST_FRAMESET[] = { ATTR_COLS, ATTR_ROWS, ATTR_CORE }; #define MAXA_FRAMESET MAXA_CORE + 2 +unsigned char ALST_NOFRAMES[] = { ATTR_CORE }; +#define MAXA_NOFRAMES MAXA_CORE unsigned char ALST_FORM[] = { ATTR_METHOD, ATTR_ACTION, ATTR_CHARSET, ATTR_ACCEPT_CHARSET, ATTR_ENCTYPE, ATTR_TARGET, ATTR_NAME, ATTR_CORE @@ -196,9 +198,9 @@ TagInfo TagMAP[MAX_HTMLTAG] = { {"head", NULL, 0, 0}, /* 95 HTML_HEAD */ {"/head", NULL, 0, TFLG_END}, /* 96 HTML_N_HEAD */ {"doctype", NULL, 0, 0}, /* 97 HTML_DOCTYPE */ + {"noframes", ALST_NOFRAMES, MAXA_NOFRAMES, 0}, /* 98 HTML_NOFRAMES */ + {"/noframes", NULL, 0, TFLG_END}, /* 99 HTML_N_NOFRAMES */ - {NULL, NULL, 0, 0}, /* 98 Undefined */ - {NULL, NULL, 0, 0}, /* 99 Undefined */ {NULL, NULL, 0, 0}, /* 100 Undefined */ {NULL, NULL, 0, 0}, /* 101 Undefined */ {NULL, NULL, 0, 0}, /* 102 Undefined */ diff --git a/html.h b/html.h @@ -180,6 +180,8 @@ typedef struct { #define HTML_HEAD 95 #define HTML_N_HEAD 96 #define HTML_DOCTYPE 97 +#define HTML_NOFRAMES 98 +#define HTML_N_NOFRAMES 99 /* pseudo tag */ diff --git a/main.c b/main.c @@ -858,8 +858,7 @@ MAIN(int argc, char **argv, char **envp) } else if (alarm_status == AL_IMPLICIT_DONE && alarm_buffer != Currentbuf) { - alarm_sec = 0; - alarm_status = AL_UNSET; + setAlarmEvent(0, AL_UNSET, FUNCNAME_nulcmd, NULL); } if (alarm_sec > 0) { signal(SIGALRM, SigAlarm); @@ -4686,8 +4685,7 @@ SigAlarm(SIGNAL_ARG) } else if (alarm_status == AL_IMPLICIT_DONE && alarm_buffer != Currentbuf) { - alarm_sec = 0; - alarm_status = AL_UNSET; + setAlarmEvent(0, AL_UNSET, FUNCNAME_nulcmd, NULL); } if (alarm_sec > 0) { signal(SIGALRM, SigAlarm); @@ -4722,7 +4720,7 @@ setAlarm(void) setAlarmEvent(sec, AL_EXPLICIT, cmd, getQWord(&data)); } else { - alarm_sec = 0; + setAlarmEvent(0, AL_UNSET, FUNCNAME_nulcmd, NULL); } displayBuffer(Currentbuf, B_NORMAL); } @@ -4730,14 +4728,12 @@ setAlarm(void) void setAlarmEvent(int sec, short status, int cmd, void *data) { - if (status == AL_EXPLICIT + if (status == AL_UNSET || status == AL_EXPLICIT || (status == AL_IMPLICIT && alarm_status != AL_EXPLICIT)) { alarm_sec = sec; alarm_status = status; alarm_event.cmd = cmd; alarm_event.user_data = data; - signal(SIGALRM, SigAlarm); - alarm(alarm_sec); } } #endif diff --git a/tagtable.tab b/tagtable.tab @@ -75,6 +75,8 @@ meta HTML_META frame HTML_FRAME frameset HTML_FRAMESET /frameset HTML_N_FRAMESET +noframes HTML_NOFRAMES +/noframes HTML_N_NOFRAMES center HTML_CENTER /center HTML_N_CENTER font HTML_FONT