diff -crN -x CVS w3m-0.3.2.2/.cvsignore w3m-js-1.743/.cvsignore *** w3m-0.3.2.2/.cvsignore 2002-02-01 02:54:47.000000000 +0900 --- w3m-js-1.743/.cvsignore 2002-11-19 21:02:12.000000000 +0900 *************** *** 12,18 **** w3mbookmark w3mhelperpanel w3mimgdisplay - w3mimgsize version.c w3mhelp-lynx_en.html w3mhelp-lynx_ja.html --- 12,17 ---- diff -crN -x CVS w3m-0.3.2.2/Bonus/2ch.cgi w3m-js-1.743/Bonus/2ch.cgi *** w3m-0.3.2.2/Bonus/2ch.cgi 1970-01-01 09:00:00.000000000 +0900 --- w3m-js-1.743/Bonus/2ch.cgi 2003-01-12 01:12:44.000000000 +0900 *************** *** 0 **** --- 1,134 ---- + #!/usr/bin/perl + + $WGET = "wget"; + $SCRIPT_NAME = $ENV{'SCRIPT_NAME'} || $0; + $CGI = "file://$SCRIPT_NAME"; + $_ = $QUERY_STRING = $ENV{"QUERY_STRING"}; + + if (/subback.html$/) { + &subback(); + exit; + } + + s@(/\d+)(/([^/]*))?$@$1@ || exit; + $label = $3; + $cgi = "$CGI?$_"; + s@^http://([^/]+)/test/read.cgi/([^/]+)/@$1/$2/dat/@ || exit; + $subback = "$CGI?http://$1/$2/subback.html"; + $_ .= ".dat"; + $dat = "http://$_"; + $tmp = $ENV{"HOME"} . "/.w3m2ch/$_"; + $dat =~ s/([^\w\/.\:\-])/\\$1/g; + $tmp =~ s/([^\w\/.\:\-])/\\$1/g; + ($dir = $tmp) =~ s@/[^/]+$@@; + $cmd = "mkdir -p $dir; $WGET -c -O $tmp $dat >/dev/null 2>&1"; + system $cmd; + $lines = (split(" ", `wc $tmp`))[0]; + $lines || exit; + + @ARGV = ($tmp); + if ($label =~ /^l(\d+)/) { + $start = $lines - $1 + 1; + if ($start < 1) { + $start = 1; + } + $end = $lines; + } elsif ($label =~ /^(\d+)-(\d+)/) { + $start = $1; + $end = $2; + } elsif ($label =~ /^(\d+)-/) { + $start = $1; + $end = $start + 100 - 1; + } elsif ($label =~ /^(\d+)/) { + $start = $1; + $end = $1; + } else { + $start = 1; + $end = $lines; + } + $head = "■掲示板に戻る■\n"; + $head .= "全部\n"; + for (0 .. ($lines - 1) / 100) { + $n = $_ * 100 + 1; + $head .= "$n-\n"; + } + $head .= "最新50\n"; + print <) { + s/\r?\n$//; + ($name, $mail, $date, $_, $title) = split(/\<\>/); + if ($i == 1) { + if (!$title) { + print < + $QUERY_STRING + EOF + unlink($tmp); + exit + } + print <$title + $head +

$title

+
+ EOF + } + if ($mail) { + $name = "$name"; + } + s@http://ime.nu/@http://@g; + s@(h?ttp:)([#-~]+)@"$1$2"@ge; + s@(ftp:[#-~]+)@$1@g; + s@= $start && $i <= $end)) { + print <$i :$name:$date +
+ $_ +

+ EOF + } + $i++; + } + print < +


+ EOF + + sub link { + local($_) = @_; + if (m@/test/read.cgi/@) { + return "$CGI?$_"; + } + return $_; + } + + sub subback { + $dat = $_; + s@http://@@ || exit; + $tmp = $ENV{"HOME"} . "/.w3m2ch/$_"; + $dat =~ s/([^\w\/.\:\-])/\\$1/g; + $tmp =~ s/([^\w\/.\:\-])/\\$1/g; + ($dir = $tmp) =~ s@/[^/]+$@@; + $cmd = "mkdir -p $dir; $WGET -O $tmp $dat >/dev/null 2>&1"; + system $cmd; + print <) { + if (/"\177-\377]/sprintf('%%%02X', unpack('C', $&))/eg; + $url .= "/cgi-bin/dict_search.cgi?MT=$_&sw=$switch"; + } else { + $input = "w3m-control: GOTO_LINK"; + } + print <"\177-\377]/sprintf('%%%02X', unpack('C', $&))/eg; + $url .= "search?q=$_&hl=ja&lr=lang_ja&ie=EUC-JP"; + } else { + $input = "w3m-control: GOTO_LINK"; + } + print < + # [ username = ] + # [ password = ] + # [ password_file = ] + # ---------------------- + # --- --- + # + # ----------------------- + # default: + # = $USER + # = $PASSWD (Don't use!) + # = $PASSWD_FILE + + $DEBUG = 1; + + $MIME_TYPE = "~/.mime.types"; + $AUTH_FILE = "~/.w3m/smb"; + $MIME_TYPE =~ s@^~/@$ENV{"HOME"}/@; + $AUTH_FILE =~ s@^~/@$ENV{"HOME"}/@; + $WORKGROUP = "-"; + $USER = $ENV{"USER"}; + $PASSWD = $ENV{"PASSWD"}; + $PASSWD_FILE = $ENV{"PASSWD_FILE"}; + &load_auth_file($AUTH_FILE); + + $NMBLOOKUP = "nmblookup"; + $SMBCLIENT = "smbclient"; + @NMBLOOKUP_OPT = ("-T"); + @SMBCLIENT_OPT = ("-N"); + $USE_OPT_A = defined($PASSWD) && (-f $AUTH_FILE) && &check_opt_a(); + if ($USE_OPT_A) { + push(@SMBCLIENT_OPT, "-A", $AUTH_FILE); + } elsif (-f $PASSWD_FILE) { + $USE_PASSWD_FILE = 1; + } elsif (defined($PASSWD)) { + $USE_PASSWD_FD = 1; + $PASSWD_FD = 0; + } + if (defined($PASSWD)) { + $passwd = "*" x 8; + } + $DEBUG && print <) { + $DEBUG && print "DEBUG: $_"; + /^\s/ && last; + } + close($F); + if (s/\s+([A-Z]*) {1,8}\d+ (\w{3} ){2}[ \d]\d \d\d:\d\d:\d\d \d{4}\s*$// + && $1 !~ /D/) { + &get_file($service, $file); + exit; + } + + get_list: + $_ = "$file/*"; + s@/+@\\@g; + @cmd = ($SMBCLIENT, $service, @SMBCLIENT_OPT, "-c", "ls \"$_\""); + $F = &open_pipe(1, @cmd); + while (<$F>) { + /^\s*$/ && last; + $DEBUG && print "DEBUG: $_"; + /^cd\s+/ && last; + /^\S/ && next; + s/\r?\n//; + push(@files, $_); + } + close($F); + + $qservice = &html_quote($service); + $service = &file_encode($service); + $qfile = &html_quote($file); + $file = &file_encode($file); + + print "Content-Type: text/html\n\n"; + print "$qservice$qfile\n"; + print "$qservice$qfile\n"; + print "
\n";
+ 	for (sort @files) {
+ 		s/\s+([A-Z]*) {1,8}\d+  (\w{3} ){2}[ \d]\d \d\d:\d\d:\d\d \d{4}\s*$// || next;
+ 		$c = $&;
+ 		s/^  //;
+ 		$_ eq "." && next;
+ 		print ""
+ 			. &html_quote($_) . ""
+ 			. &html_quote($c) . "\n";
+ 	}
+ 	print "
\n"; + } + + sub get_file { + local($service, $file) = @_; + local($encoding, $type); + local($_, @cmd); + + $_ = $file; + s@/@\\@g; + @cmd = ($SMBCLIENT, $service, @SMBCLIENT_OPT, "-E", "-c", "more \"$_\""); + $DEBUG && print "DEBUG: @cmd\n"; + + ($encoding, $type) = &guess_type($file); + $file =~ s@^.*/@@; + $| = 1; + print "Content-Encoding: $encoding\n" if $encoding; + print "Content-Type: $type; name=\"$file\"\n\n"; + + $ENV{"PAGER"} = $PAGER if $PAGER; + &exec_cmd(1, @cmd); + } + + sub share_list { + local($server) = @_; + local(@share); + local($qserver, $_, $d, @c); + + @share = &get_list(1, $server, "Share"); + + $qserver = &html_quote($server); + $server = &file_encode($server); + + print "Content-Type: text/html\n\n"; + print "Share list: $qserver\n"; + print "\n"; + print "
$qserver"; + for (sort @share) { + ($_, $d, @c) = split(" "); + if ($d eq 'Disk') { + print "
+ " + . &html_quote($_) . ""; + } else { + print "
+ " + . &html_quote($_); + } + print "" + . &html_quote($d) . "" + . &html_quote("@c") . "\n"; + } + print "
\n"; + } + + sub server_list { + local($group) = @_; + local($master, @server); + local($_, @c); + + $master = &get_master($group); + @server = &get_list(0, $master, "Server"); + + $group = &html_quote($group); + + print "Content-Type: text/html\n\n"; + print "Server list: $group\n"; + print "\n"; + print "
$group\n"; + for (sort @server) { + ($_, @c) = split(" "); + print "
+ " + . &html_quote($_) . "" + . &html_quote("@c") . "\n"; + } + print "
\n"; + } + + sub group_list { + local($master, @group); + local($_, @c); + + $master = &get_master($WORKGROUP || "-"); + @group = &get_list(0, $master, "Workgroup"); + + print "Content-Type: text/html\n\n"; + print "Workgroup list\n"; + print "\n"; + for (sort @group) { + ($_, @c) = split(" "); + print "
" + . &html_quote($_) . "" + . &html_quote("@c") . "\n"; + } + print "
\n"; + } + + sub check_opt_a { + local($_, $F, @cmd); + + @cmd = ($SMBCLIENT, "-h"); + $F = &open_pipe(0, @cmd); + while (<$F>) { + if (/^\s*-A\s/) { + $DEBUG && print "DEBUG: $_"; + close($F); + return 1; + } + } + close($F); + return 0; + } + + sub get_master { + local($group) = @_; + local($_, $F, @cmd); + + @cmd = ($NMBLOOKUP, "-M", @NMBLOOKUP_OPT, $group); + $F = &open_pipe(0, @cmd); + $_ = <$F>; + $_ = <$F>; + close($F); + ($_) = split(/[,\s]/); + s/\.*$//; + return $_; + } + + sub get_list { + local($passwd, $server, $header) = @_; + local(@list) = (); + local($_, @cmd, $F); + + @cmd = ($SMBCLIENT, @SMBCLIENT_OPT, "-L", $server); + $F = &open_pipe($passwd, @cmd); + while (<$F>) { + if (/^\s*$header/) { + $DEBUG && print "DEBUG: $_"; + last; + } + } + while (<$F>) { + /^\s*$/ && last; + $DEBUG && print "DEBUG: $_"; + /^\S/ && last; + /^\s*-/ && next; + push(@list, $_); + } + close($F); + return @list; + } + + sub open_pipe { + local($passwd, @cmd) = @_; + local($F) = $FILE++; + + $DEBUG && print "DEBUG: @cmd\n"; + open($F, "-|") || &exec_cmd($passwd, @cmd); + return $F; + } + + sub exec_cmd { + local($passwd, @cmd) = @_; + + $ENV{"LC_ALL"} = "C"; + $ENV{"USER"} = $USER; + if ($passwd && !$USE_OPT_A) { + if ($USE_PASSWD_FILE) { + $ENV{"PASSWD_FILE"} = $PASSWD_FILE; + } elsif ($USE_PASSWD_FD) { + $ENV{"PASSWD_FD"} = $PASSWD_FD; + if (open(W, "|-")) { + print W $PASSWD; + close(W); + exit; + } + } + } + open(STDERR, ">/dev/null"); + exec @cmd; + exit 1; + } + + sub print_form { + local($_) = @_; + local($q) = &html_quote($_); + $_ = &file_encode($_); + + print <$q +
+ +
Workgroup User Password +
+ + + +
+
+ EOF + } + + sub load_auth_file { + local($_) = @_; + + if ($USER =~ s/%(.*)$//) { + $PASSWD = $1 unless $PASSWD; + } + open(F, $_) || return; + while () { + s/\s+$//; + if (s/^workgroup\s*=\s*//i) { + $WORKGROUP = $_; + } elsif (s/^user(name)?\s*=\s*//i) { + $USER = $_; + } elsif (s/^passw(or)?d\s*=\s*//i) { + $PASSWD = $_; + } elsif (s/^passw(or)?d_file\s*=\s*//i) { + $PASSWD_FILE = $_; + } + } + close(F); + } + + sub load_mime_type { + local($_) = @_; + local(%mime) = (); + local($type, @suffix); + + open(F, $_) || return (); + while() { + /^#/ && next; + chop; + (($type, @suffix) = split(" ")) >= 2 || next; + for (@suffix) { + $mime{$_} = $type; + } + } + close(F); + return %mime; + } + + sub guess_type { + local($_) = @_; + local(%mime) = &load_mime_type($MIME_TYPE); + local($encoding) = undef; + + if (s/\.gz$//i) { + $encoding = "gzip"; + } elsif (s/\.Z$//i) { + $encoding = "compress"; + } elsif (s/\.bz2?$//i) { + $encoding = "bzip2"; + } + /\.(\w+)$/; + $_ = $1; + tr/A-Z/a-z/; + return ($encoding, $mime{$_} || "text/plain"); + } + + sub cleanup { + local($_) = @_; + + $_ .= "/"; + s@//+@/@g; + s@/\./@/@g; + while(m@/\.\./@) { + s@^/(\.\./)+@/@; + s@/[^/]+/\.\./@/@; + } + s@(.)/$@$1@; + return $_; + } + + sub file_encode { + local($_) = @_; + s/[\000-\040\+:#?&%<>"\177-\377]/sprintf('%%%02X', unpack('C', $&))/eg; + return $_; + } + + sub file_decode { + local($_) = @_; + s/\+/ /g; + s/%([\da-f][\da-f])/pack('C', hex($1))/egi; + s@[\r\n\0\\"]@@g; + return $_; + } + + sub html_quote { + local($_) = @_; + local(%QUOTE) = ( + '<', '<', + '>', '>', + '&', '&', + '"', '"', + ); + s/[<>&"]/$QUOTE{$&}/g; + return $_; + } diff -crN -x CVS w3m-0.3.2.2/ChangeLog w3m-js-1.743/ChangeLog *** w3m-0.3.2.2/ChangeLog 2002-12-06 01:53:19.000000000 +0900 --- w3m-js-1.743/ChangeLog 2003-02-08 02:29:54.000000000 +0900 *************** *** 1,40 **** 2002-12-06 Fumitoshi UKAI ! * w3m 0.3.2.2 ! * version.c.in: update ! * doc/README: version 0.3.2.2, release date ! * doc-jp/README: ditto ! * NEWS: update 2002-12-06 Hironori SAKAMOTO ! ! * w3m 0.3.2 branch: security fix * file.c (process_img): html_quote() ! (loadHTMLstream): HTMLlineproc0 internal 2002-11-27 Fumitoshi UKAI ! * w3m 0.3.2.1 ! * version.c.in: update ! * doc/README: version 0.3.2.1, release date ! * doc-jp/README: ditto ! * NEWS: update ! 2002-11-26 Hironori SAKAMOTO - * w3m 0.3.2 branch: security fix * frame.c (createFrameFile): html_quote() 2002-11-16 Hironori SAKAMOTO - * w3m 0.3.2 branch: backport from trunk * [w3m-dev 03438] Re: segmentation fault by large complex table. * table.c (check_table_height): check MAXROWCELL * table.h (MAXROWCELL): added ! 2002-11-26 Hironori SAKAMOTO - * w3m 0.3.2 branch: backport from trunk * [w3m-dev 03371] segmentation fault by large complex table. * table.c (bsearch_2short): indexarry char to short (bsearch_double): ditto --- 1,3011 ---- + 2003-02-08 Hiroyuki Ito + + * [w3m-dev 03736] dirlist sort + * scripts/dirlist.cgi.in (right_dir): use cmp for filename comparison + + 2003-02-07 Hironori SAKAMOTO + + * [w3m-dev 03735] Re: make error of checkType arg + * etc.c (checkType): delete USE_ANSI_COLOR + * file.c (addnewline): macro for USE_ANSI_COLOR + (readHeader): rewrite of USE_ANSI_COLOR + (HTMLlineproc2body): ditto + (addnewline2): ditto + (addnewline): ditto + (loadBuffer): ditto + (getNextPage): ditto + * proto.h (checkType): macro for USE_ANSI_COLOR + + 2003-02-07 Hironori SAKAMOTO + + * [w3m-dev 03733] Re: display decoded URL + * display.c (make_lastline_link): buf->document_code + + 2003-02-07 Hironori SAKAMOTO + + * [w3m-dev 03732] Re: scroll() is slow ? + * configure (use_raw_scroll): added + (config.h) use_raw_scroll + * config.h.dist (USE_RAW_SCROLL): added + * display.c (displayBuffer): ifdef USE_RAW_SCROLL + * proto.h (scroll): ifdef USE_RAW_SCROLL + (rscroll): ditto + (need_clrtoeol): if 0 + (terms.c): if 0 need_clrtoeol + (scroll_raw): ifdef USE_RAW_SCROLL + + 2003-02-06 Fumitoshi UKAI + + * NEWS: rc: decode_url + + 2003-02-06 Hironori SAKAMOTO + + * [w3m-dev 03730] display decoded URL + * anchor.c (link_list_panel): support DecodeURL + * display.c (make_lastline_link): support DecodeURL + * etc.c (url_unquote_conv): added + * fm.h (DecodeURL): added + * history.c (historyBuffer): support DecodeURL + * indep.c (QUOTE_MAP): added + (HTML_QUOTE_MAP): added + (html_quote_char): deleted + (url_quote): use is_url_quote + (file_quote): use is_file_quote + (is_url_safe): deleted + (Str_form_quote): use is_url_unsafe + (Str_url_unquote): add safe args + (is_shell_safe): delete + (shell_quote): use is_shell_unsafe + * indep.h (QUOTE_MAP): added + (HTML_QUOTE_MAP): added + (HTML_QUOTE_MASK): added + (SHELL_UNSAFE_MASK): added + (URL_QUOTE_MASK): added + (FILE_QUOTE_MASK): added + (URL_UNSAFE_MASK): added + (GET_QUOTE_TYPE): added + (is_html_quote): added + (is_shell_unsafe): added + (is_url_quote): added + (is_file_quote): added + (is_url_unsafe): added + (html_quote_char): added + (html_quote_char): deleted + (Str_url_unquote): added safe + (form_unquote): Str_url_unquote changes + * linein.c (_prev): support DecodeURL + (_next): ditto + * main.c (goURL0): support DecodeURL + (_peekURL): ditto + (curURL): ditto + * map.c (follow_map_panel): support DecodeURL + (append_map_info): ditto + (append_link_info): ditto + (append_frame_info): ditto + (page_info_panel): ditto + * menu.c (initSelectMenu): delete SCM_LOCAL_CGI + support DecodeURL + (initSelTabMenu): delete SCM_LOCAL_CGI + support DecodeURL + (link_menu): support DecodeURL + * parsetagx.c (parse_tag): is_html_quote + * proto.h (url_unquote_conv): added + * rc.c (CMT_DECODE_URL): added + (params1): add decode_url + * url.c (openURL): Str_url_unquote non safe + + 2003-02-06 Hironori SAKAMOTO + + * [w3m-dev 03729] buf fix of reAnchorNewsheader() + * anchor.c (reAnchorAny): check l->bpos + (reAnchorNewsheader): check l->bpos + strlen(*q) + lineBuf[l->size] + + 2003-02-06 Hironori SAKAMOTO + + * [w3m-dev 03728] IPv6 hostname + * url.c (parseURL): rewrite IPv6 address parser + + 2003-02-04 Hironori SAKAMOTO + + * [w3m-dev 03724] Re: view source, edit source + * buffer.c (reshapeBuffer): initialize buf->width first + * display.c (displayBuffer): no need to check buf>sourcefile + + 2003-02-01 Hironori SAKAMOTO + + * [w3m-dev 03721] PATH_INFO support of local CGI + * local.c (CGIFN_DROOT): deleted + (CGIFN_LIBDIR): added + (CGIFN_MODE): deleted + (CGIFN_CONTAIN_SLASH): deleted + (check_local_cgi): rewrite + (cgi_filename): rewrite + (localcgi_post): support PATH_INFO + * url.c (openURL): rewrite + * Bonus/smb.cgi: use PATH_INFO + + 2003-02-01 Hironori SAKAMOTO + + * [w3m-dev 03720] mark remains + * main.c (srchcore): PREC_NUM + + 2003-01-31 Hironori SAKAMOTO + + * [w3m-dev 03719] Re: Too slow when loading big file with fold_line=1 + * file.c (addnewline): check i len + + 2003-01-31 Hironori SAKAMOTO + + * [w3m-dev 03718] Too slow when loading big file with fold_line=1 + * etc.c (nextColumn): added + (calcPosition): use New_N + rewrite with nextColumn + (columnLen): added + * file.c (addnewline): rewrite with columnLen + * proto.h (columnLen): added + + 2003-01-31 Hironori SAKAMOTO + + * [w3m-dev 03717] print newline before exec shell command. + * main.c (execsh): print newline + + 2003-01-31 Hironori SAKAMOTO + + * [w3m-dev 03715] initial currentLine when pager mode. + * file.c (getNextPage): fix cur + + 2003-01-31 Hironori SAKAMOTO + + * [w3m-dev 03714] -cols 1 -dump -o fold_line=1 + * file.c (addnewline): check i == 0, i == l->len + * fm.h (_INIT_BUFFER_WIDTH): added + (INIT_BUFFER_WIDTH): use _INIT_BUFFER_WIDTH + + 2003-01-31 Hironori SAKAMOTO + + * [w3m-dev 03713] search with "$" + * search.c (forwardSearch): check l->next && l->next->bpos + (backwardSearch): check l->size, l->next && l->next->bpos + + 2003-01-31 Hironori SAKAMOTO + + * [w3m-dev 03712] buf fix of LINE_INFO + * main.c (curlno): rewrite + + 2003-01-30 Hironori SAKAMOTO + + * [w3m-dev 03709] Re: view source, edit source + * display.c (displayBuffer): INIT_BUFFER_WIDTH + * file.c (_saveBuffer): added + (saveBuffer): use _saveBuffer + (saveBufferBody): added + * main.c (vmSrc): saveBufferBody + * proto.h (saveBufferBody): added + + 2003-01-30 Hironori SAKAMOTO + + * [w3m-dev-en 00852] Re: Enhancement: content type detection of files + * url.c (DefaultGuess): remove upppercases + (guessContentTypeFromTable): rewrite, strcasecmp + + 2003-01-30 Hironori SAKAMOTO + + * [w3m-dev 03708] Re: Don't stop loading image when moving to next page. + * config.h.dist (lstat): define ifndef HAVE_LSTAT + * configure (config.h) ditto + * display.c (fmTerm): new loadImage + (save_current_buf): only ifdef USE_BUFINFO + (displayBuffer): new loadImage + * etc.c (setup_child): TrapSignal + * file.c (loadGeneralFile): TRAP_OFF, TRAP_ON + (loadHTMLstream): ditto + (loadGopherDir): ditto + (loadBuffer): ditto + (loadImageBuffer): ditto + (getNextPage): ditto + (save2tmp): ditto + * fm.h (TrapSignal): added + (TRAP_ON): added + (TRAP_OFF): added + * form.c (HAVE_LSTAT): deleted + * frame.c (createFrameFile): TRAP_OFF, TRAP_ON + * image.c (image_buffer): added + (deleteImage): new loadImage + (getAllImage): initialize image_buffer + (loadImage): rewrite + * main.c (main): new loadImage + (checkDownloadList): remove ifdef HAVE_LSTAT + * news.c (loadNwesgroup): TRAP_ON, TRAP_OFF + * proto.h (loadImage): add buf arg + * url.c (openSocket): TRAP_ON, TRAP_OFF + (check_no_proxy): TRAP_ON, TRAP_OFF + + 2003-01-29 Hironori SAKAMOTO + + * [w3m-dev 03707] Don't stop loading image when moving to next page. + * display.c (save_current_buf): required when defined USE_IMAGE + (displayBuffer): stop only buffer changed + * image.c (loadImage): IMG_FLAG_START load from maxLoadImage + + 2003-01-29 Hironori SAKAMOTO + + * [w3m-dev 03706] X-Image-URL: support, bug fix of reshapeBuffer() + * buffer.c (reshapeBuffer): rewrite + * file.c (readHeader): rewrite + + 2003-01-29 NAKAJIMA Mikio + + * [w3m-dev 03705] goodict.cgi (was: Re: google.cgi (was: Re: keymap key SEARCH string)) + * Bonus/goodict.cgi: added + + 2003-01-29 Hironori SAKAMOTO + + * [w3m-dev 03700] Re: google.cgi (was: Re: keymap key SEARCH string) + * main.c (goURL0): check relative or *url == '#' + + 2003-01-28 Hironori SAKAMOTO + + * [w3m-dev 03689] Re: fold patch + * fm.h (BufferPos): add bpos + * main.c (save_buffer_position): bpos initialize + (resetPos): reset bpos + + 2003-01-26 Hironori SAKAMOTO + + * [w3m-dev 03686] Re: fold patch + * buffer.c (writeBufferCache): rewrite + (readBufferCache): rewrite + * etc.c (calcPosition): short -> int realColumn + * fm.h (Line): short -> int len,width,size,bpos,bwidth + (BufferPoint): short->int pos + (Buffer): short->int currentColumn,pos,visualpos + (BufferPos): short->int currentColumn,pos + * frame.h (frameset_queue): short->int pos,currentColumn + * main.c (clear_mark): short->int pos + (dispincsrch): short->int pos + (backBf): short->int pos + (set_buffer_environ): short->int prev_pos + + 2003-01-25 Hironori SAKAMOTO + + * [w3m-dev 03684] Re: fold patch + * file.c (PSIZE): added + (HTMLlineproc2body): outc,outp is created by NewAtom_N + use PSIZE + + 2003-01-25 Fumitoshi UKAI + + * file.c (getNextPage): no need volatile for code + + 2003-01-25 Hironori SAKAMOTO + + * [w3m-dev 03683] interrupt in getNextPage() + * file.c (getNextPage): trap SIGINT + + 2003-01-25 Hironori SAKAMOTO + + * [w3m-dev 03682] open null file on tab + * display.c (displayBuffer): if empty, clear() + + 2003-01-25 Hironori SAKAMOTO + + * [w3m-dev 03681] Re: fold patch + * buffer.c (reshapeBuffer): buf->pos, sbuf.currentLine fix + FoldLine + * display.c (arrangeCursor): buf->pos fix + (restorePosition): buf->pos fix + + 2003-01-24 Fumitoshi UKAI + + * NEWS: func: RESHAPE + rc: fold_line + + 2003-01-24 Fumitoshi UKAI + + * fix compiler warnings + * display.c (displayBuffer): fix suggest parentheses around && within || + 2003-01-24 Hironori SAKAMOTO + + * [w3m-dev 03667] fold patch + * anchor.c (reAnchorPos): rewrite + (reAnchorWord): delete reseq_anchor() + (reAnchorAny): use l->size + delete reseq_anchor() + * backend.c (internal_get): pass TRUE to saveBuffer + * buffer.c (newBuffer): delete n->linelen + (reshapeBuffer): rewrite + * display.c (displayBuffer): FoldLine + (redrawLine): l->bpos + (cursorUp0): added + (cursorUp): rewrite + (cursorDown0): added + (cursowDown): rewrite + (cursorRight): check l->next + l->bwidth + (cursorLeft): l->prev && l->bpos + l->bwidth + (arrangeCursor): buf->currentLine->bwidth + buf->cursorX + * etc.c (checkType): **oporp + rewrite + (calcPosition): realColumn allocated by New_reuse + * file.c (addnewline): add nlines arg + (propBuffer): deleted + (colorBuffer): deleted + (readHeader): propBuffer + FOLD_BUFFER_WIDTH + (HTMLlineproc2body): rewrite + (addnewline2): added + (addnewline): rewrite + (loadBuffer): propBuffer, colorBuffer + (saveBuffer): cont arg + (getNextPage): rewrite + * fm.h (LINELEN): 256 + (FNLEN): deleted + (Line): add size, bpos, bwidth + (Buffer): delete linelen + (INIT_BUFFER_WIDTH): check showLineNum + (FOLD_BUFFER_WIDTH): added + (FoldLine): added + * funcname.tab (RESHAPE): added + * main.c (do_dump): pass FALSE to saveBuffer + (nscroll): rewrite + (clear_mark): l->size + (shiftvisualpos): rewrite + (pipeBuf): pass TRUE to saveBuffer + (linebeg): check line->prev && line->bpos + (linend): check line->next, line->next->bpos + (editScr): pass TRUE to saveBuffer + (svBuf): pass TRUE to saveBuffer + (vmSrc): pass TRUE to saveBuffer + (reshape): added + (curlno): rewrite + * mimehead.c (LINELEN): deleted + * proto.h (reshape): added + (saveBuffer): add cont arg + (cursorUp0): added + (cursorDown0): added + (checkType): change type oprop, ocolor, delete check_color, len + * rc.c (CMT_FOLD_LINE): added + (params1): add fold_line + (sync_with_option): check PagerMax + * search.c (set_mark): l->size + (forwardSearch): rewrite + (backwardSearch): rewrite + * doc/README.func (RESHAPE): added + * doc-jp/README.func (RESHAPE): added + * scripts/w3mhelp.cgi.in (Buffer operation): add reshape + + 2003-01-24 Hironori SAKAMOTO + + * etc.c (next_status): after = is R_ST_VALUE + R_ST_VALUE > => R_ST_NORMAL + R_ST_VALUE SP => R_ST_TAG + (read_token): R_ST_VALUE + (correct_irrtag): R_ST_VALUE + * rm.h (R_ST_VALUE): added + (ST_IS_REAL_TAG): rewrite + (ST_IS_COMMENT): deleted + (ST_IS_TAG): deleted + * parsetagx.c (parse_tag): skip too long tagname + skip too long attrname + if attrvalue has quote char, need reconstruct + if unknown attr, need reconstruct + * table.c (visible_length): R_ST_VALUE + + 2003-01-24 Hironori SAKAMOTO + + * [w3m-dev 03680] showProgress() on fast system + * file.c (showProgress): check line len, time + + 2003-01-24 Hironori SAKAMOTO + + * [w3m-dev 03679] Re: cleanup for pipe + * etc.c (open_pipe_rw): check stdin, stdout + * file.c (uncompress_stream): rewrite + + 2003-01-23 Fumitoshi UKAI + + * [w3m-dev 03678] Re: config.param is clear when configure -help + * configure: don't override config.param + + 2003-01-23 Hironori SAKAMOTO + + * [w3m-dev 03677] view source, edit source + * buffer.c (discardBuffer): unlink header source + * file.c (loadFile): delete skip header + * fm.h (BP_SOURCE): deleted + (SkipHeader): deleted + * main (editBf): cleanup + (vmSrc): cleanup + + 2003-01-23 Hironori SAKAMOTO + + * [w3m-dev 03676] cleanup for pipe + * etc.c (open_pipe_rw): added + * file.c (uncompress_stream): rewrite using open_pipe_rw + * image.c (openImgdisplay): rewrite using open_pipe_rw + * local.c (localcgi_popen_rw): deleted + (localcgi_post): rewrite using open_pipe_rw + * proto.h (open_pipe_rw): added + * search.c (migemor): initialized to NULL + (migemow): initialized to NULL + (migemo_pid): initialized to 0 + (open_migemo): rewrite using open_pipe_rw + + 2003-01-23 Hironori SAKAMOTO + + * [w3m-dev 03675] x-face + * file.c (xface2xpm): use getImage() + (readHeader): check same file + (loadImageBuffer): rewrite + (lessopen_stream): shell_quote() + + 2003-01-23 Hironori SAKAMOTO + + * [w3m-dev 03674] -dump problem + * file.c (loadGeneralFile): return NULL when dump + * main.c (dump_source): deleted + (dump_head): deleted + (dupm_extra): deleted + (do_dump): added + (main): singal when dump + + 2003-01-23 Yoshinobu Sakane + + * [w3m-dev 03671] Re: config.param is clear when configure -help + * configure: test -f config.param + + 2003-01-22 Hironori SAKAMOTO + + * [w3m-dev 03665] imlib2 support (on X11) + * configure: X11 inline image with Imlib2 + fix typo in fb/imlib2 + * w3mimg/x11/x11_w3mimg.c: USE_IMLIB2 + (x11_load_image): USE_IMLIB2 + (x11_show_image): USE_IMLIB2 + (x11_free_image): USE_IMLIB2 + (x11_get_image_size): USE_IMLIB2 + + 2003-01-22 Hironori SAKAMOTO + + * [w3m-dev 03664] config.param is clear when configure -help + * configure: config.param created after arg parsing + + 2003-01-21 Fumitoshi UKAI + + * map.c (follow_map_menu): if USE_IMAGE or MENU_MAP + * proto.h (follow_map_menu): ditto + + 2003-01-21 Hironori SAKAMOTO + + * [w3m-dev 03660] Re: fputs -> Strfputs + * Str.h (Strncmp_charp): paren + (Strncasecmp_charp): ditto + (Strinsert): ditto + (Strshrinkfirst): ditto + * display.c (disp_err_message): added + * file.c (loadGeneralFile): don't put function in macro arg + (saveBuffer): ditto + * frame.c (createFrameFile): ditto + * proto.h (disp_err_message): macro->function + * table.c (pushdata): if data is NULL, use "" + (suspend_or_pushdata): if line is NULL, use "" + * textlist.h (pushText): don't use (s) twice in a macro + + 2003-01-21 Hironori SAKAMOTO + + * [w3m-dev 03659] Can't download from SSL. + * istream.c (ISfileno): case IST_SSL + + 2003-01-21 Hironori SAKAMOTO + + * [w3m-dev 03658] Re: Other user can see local cookie. + * fm.h (rc_dir): init(NULL) + * rc.c (config_file): deleted + (init_rc): use rc_dir + + 2003-01-21 Hironori SAKAMOTO + + * [w3m-dev 03657] fputs -> Strfputs + * form.c (form_fputs_decode): use Strfputs() + + 2003-01-19 Fumitoshi UKAI + + * [w3m-dev 03655] Re: file.c:image_source when undef USE_IMAGE + * map.c (follow_map_menu): fix warnings + + 2003-01-19 WATANABE Katsuyuki + + * [w3m-dev 03654] file.c:image_source when undef USE_IMAGE + * file.c (readHeader): image_source ifdef USE_IMAGE + (loadGeneralFile): ditto + (uncompress_stream): ditto + + 2003-01-19 Fumitoshi UKAI + + * [w3m-dev 03653] SourceForge.net: 576032 w3m https crashes with OpenSSL-0.9.7 + * istream.c (ssl_check_cert_ident): use sk_GENERAL_NAME_free() + + 2003-01-18 Fumitoshi UKAI + + * [w3m-dev 03652] Re: Debian bug #176981 + * file.c (checkHeader): always remove_space + (loadGeneralFile): no need remove_space + + 2003-01-18 Hironori SAKAMOTO + + * [w3m-dev 03651] Debian bug #176981 + * file.c (checkRedirection): added + (loadGeneralFile): check redirection + t_buf only is created when it is NULL + remove_space + + 2003-01-18 Hironori SAKAMOTO + + * [w3m-dev 03647] expandName() and expandPath() + * etc.c (openSecretFile): use expandPath + (expandName): rewrite + (file_to_url): use expandPath + * file.c (_doFileCopy): use expandPath + (doFileSave): use expandPath + * indep.c (expandPath): rewrite + * linein.c (inputLineHistSearch): use expandPath + (next_dcompl): use expandPath + (doComplete): use expandPath + * local.c (set_cgi_environ): rewrite + * mailcap.c (loadMailcap): use expandPath + * main.c (svBuf): use expandPath + (addDownloadList): use expandPath + * rc.c (init_rc): use expandPath + (rcFile): rewrite + (auxbinFile): use expandPath + (libFile): use expandPath + (etcFile): use expandPath + (helpFile): use expandPath + * url.c (loadMimeTypes): use expandPath + (loadURIMethods): use expandPath + + 2003-01-18 Hironori SAKAMOTO + + * [w3m-dev 03646] setup child process, local CGI + * etc.c (reset_signals): static + don't ignore SIGUSR1 + (close_all_fds_except): static + DEV_NULL_PATH + (setup_child): added + (myExec): rewrite + (mySystem): rewrite + * file.c (readHeader): check image_source + (loadGeneralFile): check image_source + (doExternal): use setup_child + (_doFileCopy): use setup_child + (doFileSave): use setup_child + (uncompress_stream): check image_source + use setup_child + * image.c (getCharSize): no need stderr redirect + (openImgdisplay): use setup_child + (loadImage): use setup_child + (getImageSize): no need stderr redirect + * local.c (writeLocalCookie): check Local_cookie_file + (localcgi_popen_rw): added + (localcgi_popen_r): deleted + (localcgi_post): rewrite + (localcgi_get): deleted + * proto.h (localcgi_get): defined by localcgi_post + (reset_signals): deleted + (close_all_fds_except): deleted + (close_all_fds): deleted + (setup_child): added + * search.c (open_migemo): use setup_child, myExec + * w3mimgdisplay.c (main): use DEV_NULL_PATH + + 2003-01-16 Hironori SAKAMOTO + + * [w3m-dev 03644] Re: Other user can see local cookie. + * cookie.c (save_cookies): return if no_rc_dir + * etc.c (tmpf_base): add cookie + (tmpfname): use tmp_dir instead of rc_dir + * file.c (loadGeneralFile): cookie is not passed via URL + * fm.h (TMPF_COOKIE): incl + (MAX_TMPF_TYPE): incl + (no_rc_dir): added + (tmp_dir): added + (config_file): added + * local.c (Local_cookie_file): added + (writeLocalCookie): added + (setLocalCookie): dont set environment LOCAL_COOKIE + (localcgi_post): writeLocalCookie + (localcgi_get): writeLocalCookie + * main.c (config_filename): deleted + (cmd_loadURL): arg FormList + (main): rewrite config_file, rc + (ldhelp): no cookie in URL + (cmd_loadURL): arg FormList + (goURL0): cmd_loadURL change + (cmd_loadBuffer): cmd_loadURL change + (adBmark): cookie is posted + (follow_map): cmd_loadURL change + (linkMn): cmd_loadURL change + (reinit): init_rc change + * proto.h (create_option_search_table): deleted + (init_rc): no args + * rc.c (create_option_search_table): static + (init_rc): no args + rewrite + (optionpanel_src1): rewrite + (load_option_panel): html_quote + (panel_set_option): no_rc_dir + * w3mbookmark.c: rewrite + * w3mhelperpanel.c: rewrite + * scripts/dirlist.cgi.in: rewrite + * scripts/w3mhelp.cgi.in: rewrite + * scripts/w3mmail.cgi.in: rewrite + * scripts/multipart/multipart.cgi.in: rewrite + + 2003-01-16 Fumitoshi UKAI + + * file.c (loadGopherDir): convertLine RAW_MODE + * ftp.c (loadFTPDir): ditto + + 2003-01-16 Hironori SAKAMOTO + + * [w3m-dev 03642] Re: cleanup (don't close connection of news server) + * local.c (localcgi_post): localcgi_popen_r first + + 2003-01-16 Hironori SAKAMOTO + + * [w3m-dev 03641] Re: cleanup (don't close connection of news server) + * ftp.c (ftp_command): fix fwrite arg + * news.c (news_command): fix fwrite arg + + 2003-01-16 Hironori SAKAMOTO + + * [w3m-dev 03640] Re: cleanup (don't close connection of news server) + * anchor.c (_put_ahchor_news): always conv_str + (_put_anchor_all): always conv_str + * etc.c (close_all_fds): deleted + (close_all_fds_except): added, except fd=f is left open + * file.c (guess_filename): added + (UFhalfclose): added + (convertLine): cleanup_line if not raw mode + check uf + (readHeader): always convertLine + (loadGeneralFile): rewrite + (loadGopherDir): return Str, args change to ParsedURL and code + rewrite + (saveBuffer): always conv_str + (_doFileCopy): close_all_fds + (doFileSave): close_all_fds_except + (uncompress_stream): dup, close_all_fds_except + * form.c (form_fputs_decode): always conv_str + (input_textarea): convertLine + * frame.c (createFrameFile): convertLine + * ftp.c (loadFTPDir): arg code + rewrite + (readFTPDir): convertLine + * html.h (UFfileno): added + * image.c (loadImage): close_all_fds + * indep.h (RAW_MODE): added + * local.c (loadLocalDir): return Str + (dirBuffer): rewrite + (localcgi_popen_r): close_all_fds + * main.c (main): check SCM_LOCAL + print err_msg + * news.c (news_command): args cmd and arg + (news_quit): news_command + (openNewsStream): news_command + (readNewsgroup): deleted + (loadNewsgroup): added + (closeNews): added + * proto.h (loadGopherDir): update + (conv_str): define for no JP_CHARSET + (readFTPDir): deleted + (loadFTPDir): added + (readNewsgroup): deleted + (loadNewsgroup): added + (dirBuffer): deleted + (loadLocalDir): added + (close_all_fds): defined by close_all_fds_except + (close_all_fds_except): added + + 2003-01-16 Hironori SAKAMOTO + + * [w3m-dev 03639] Re: smb.cgi + * Bonus/2ch.cgi: change password handling + * Bonus/README: update + * Bonus/README.eng: ditto + + 2003-01-12 qhwt@myrealbox.com + + * [w3m-dev 03636] segfault in main.c + * main.c (main): check newbuf->currentURL.file + + 2003-01-12 Fumitoshi UKAI + + * Bonus/README.eng: sync with Bonus/README + + 2003-01-12 Hironori SAKAMOTO + + * [w3m-dev 03635] 2ch.cgi + * Bonus/2ch.cgi: added + * Bonus/README: update + + 2003-01-12 Fumitoshi UKAI + + * Bonus/README.eng: sync with Bonus/README + + 2003-01-12 Hironori SAKAMOTO + + * [w3m-dev 03634] smb.cgi + * Bonus/smb.cgi: added + * Bonus/README: update + + 2003-01-12 Fumitoshi UKAI + + * ftp.c (ftp_pasv): ftp_command response + (readFTPDir): masked declaration of realpathname + + 2003-01-12 Hironori SAKAMOTO + + * [w3m-dev 03633] Re: cleanup (don't close connection of news server) + * file.c (FTPhalfclose): deleted + (loadGeneralFile): closeFTP when doFileSave is done + (_doFileCopy): return int + (doFileMove): return int + (doFileSave): return int + * ftp.c: rewrite + * main.c (w3m_exit): disconnectFTP + * proto.h (_doFileCopy): return int + (doFileMove): return int + (doFileSave): return int + (openFTP): deleted + (openFTPStream): return InputStream + (closeFTP): no arg + (Ftpfclose): disconnectFTP + * url.c (openFTPstream): deleted + + 2003-01-11 Fumitoshi UKAI + + * fix compiler warnings + * html.h (UFclose): value computed but not used + + 2003-01-11 Hironori SAKAMOTO + + * [w3m-dev 03632] cleanup (don't close connection of news server) + * file.c (loadSomething): remove UFclose nntp:,news: + (loadFile): UFclose + (loadGeneralFile): always UFclose + * html.h (UFclose): only reset when ISclose ==0 + * istream.c (ISclose): return int + (ISfileno): flag IST_UNCLOSE + * istream.h (ISclose): return int + (IST_UNCLOSE): added + * news.c (news_close): reset IST_UNCLOSE + (news_open): set IST_UNCLOSE + + 2003-01-11 Hironori SAKAMOTO + + * [w3m-dev 03631] display current form item + * form.c (form2str): rewrite + * istream.c (ssl_get_certificate): fix typo + * map.c (follow_map_panel): valign=top + (append_map_info): valign=top + (append_link_info): valign=top + (append_frame_info): + html_quote ssl_certificate + (page_info_panel): rewrite, html_quote + + 2003-01-11 Fumitoshi UKAI + + * doc/README.pre_form: update + * doc-jp/README.pre_form: ditto + + 2003-01-11 Hironori SAKAMOTO + + * [w3m-dev 03630] improved pre_form + * form.c (pre_form): add re_url, name + (add_pre_form): add name + rewrite + (loadPreForm): add "form" + (preFormUpdateBuffer): handle re_url + + 2003-01-11 Hironori SAKAMOTO + + * [w3m-dev 03629] delete tmp file + * etc.c (tempfname): always file to delete + * file.c (xface2xpm): no need fileToDelete + (readHeader): ditto + (loadGeneralFile): ditto + (loadHTMLBuffer): ditto + (loadHTMLString): ditto + (loadGopherDir): ditto + (loadImageBuffer): ditto + (doExternal): rewrite + (doFileSave): no need fileToDelete + (uncompress_stream): ditto + * fm.h (CurrentPid): added + * image.c (getImage): cache->touch to delete + * local.c (setLocalCookie): use CurrentPid + (localcgi_post): fileToDelete + * main.c (main): CurrentPid + (pipeBuf): no need fileToDelete + (query_from_followform): CurrentPid + (vmSrc): no need fileToDelete + + 2003-01-11 Hironori SAKAMOTO + + * [w3m-dev 03628] Re: Error occured while reset + * file.c (doExternal): bufp = NULL, return 1 + (uncompress_stream): tempfname fileToDelete + + 2003-01-11 Hironori SAKAMOTO + + * [w3m-dev 03626] Re: relative URL + * url.c (parseURL2): copy if scheme is local or local-cgi + + 2003-01-11 Hironori SAKAMOTO + + * [w3m-dev 03625] keymap key SEARCH string + * main.c (srch): accept command argument + (reMark): accept command argument + * Bonus/google.cgi: added + + 2003-01-11 Hironori SAKAMOTO + + * [w3m-dev 03622] Re: Error occured while reset + * file.c (uncompress_stream): child process initialized + * terms.c (close_tty): close unless stdin,out,err + (reset_tty): flush_tty, close_tty + (write1): flush_tty + (refresh): flush_tty + (flush_tty): check ttyf + + 2003-01-11 Hironori SAKAMOTO + + * [w3m-dev 03620] -m option and header + * buffer.c (reshapeBuffer): fix reading from stdin + fix -m option + * display.c (redrawNLine): rewrite + (redrawLine): return l instead of l->next + (redrawLineImage): ditto + * file.c (loadFile): read header even if skip header + (loadGeneralFile): read header even if skip header + * fm.h (SkipHeader): added + * main.c (main): check whether reading from stdin + SkipHeader + + 2003-01-10 Hironori SAKAMOTO + + * [w3m-dev 03619] Re: Error occured while reset + * file.c (process_img): check image.ext + (HTMLlineproc2body): check image.ext + (loadImageBuffer): url, ext is in URLFile + * frame.c (unloadFrame): no need to push to fileToDelete + (copyFrame): no need to reset FB_TODELETE + (resetFrameElement): f_body->source, buf->sourcefile + (frame_download_source): buf->source + buf->sourcefile reset + * frame.h (FB_NOCACHE): deleted + (FB_TODELETE): deleted + * main.c (vmSrc): Currentbuf->sourcefile + need_reshape if images exist + + 2003-01-09 Hironori SAKAMOTO + + * [w3m-dev 03617] sourcefile when Content-Encoding: is specified. + * file.c (uncompress_stream): add src arg + (examineFile): change uncompress_stream + (loadGeneralFile): change uncompress_stream + (doExternal): src + (uncompress_stream): ext + tmpfile with same ext + + 2003-01-09 Hironori SAKAMOTO + + * [w3m-dev 03616] Re: data: URL scheme + * file.c (loadGeneralFile): check SCM_DATA + (loadImageBuffer): newBuffer() + * html.h (SCM_DATA): added + * indep.c (url_unquote): deleted + (Str_url_unquote): renamed from Str_form_unquote + + is decoded is_form only + * indep.h (url_unquote): deleted + (Str_url_unquote): added + (Str_form_unquote): define by Str_url_unquote + * main.c (followA): file_unquote + (cmd_loadURL): file_unquote + * url.c (DefaultPort): add for data: + (schemetable): add "data" + (DefaultFile): SCM_FTPDIR + (parseURL): scheme copied from current + (parseURL2): SCM_DATA + check SCM_FTP, SCM_FTPDIR + (_parsedURL2Str): add data in scheme_str + handle SCM_DATA + SCM_FTPDIR + (openURL): file_unquote + handle SCM_DATA + + 2003-01-08 Hironori SAKAMOTO + + * [w3m-dev 03611] relative URL + * news.c (openNewsStream): don't skip '/' for nntp: + (readNewsgroup): cleanup + * url.c (parseURL): don't copy user & password + (parseURL2): fix for group, don't copy user & password + + 2003-01-07 Fumitoshi UKAI + + * fix build warnings + * url.c (parseURL2): fix comparison between pointer and integer + * news.c (readNewsgroup): variable `scheme',`group',`list' might be clobbered by `longjmp' or `vfork' + + 2003-01-07 Hironori SAKAMOTO + + * [w3m-dev 03610] Re: news: + * anchor.c (_put_anchor_news): check '<' + (reAnchorNewsheader): added + * file.c (loadSomething): Subject: as buffername + (checkHeader): check buf->document_header + (loadGeneralFile): reAnchorNewsheader + * html.h (SCM_NNTP_GROUP): added + * main.c (main): delete USE_NNTP in switch (newbuf->real_scheme) + (chkNMIDBuffer): lowercase in url_like_pat + * news.c (add_news_message): add scheme, group as arg + (openNewsStream): check SCM_NNTP_GROUP + check current_news.host + (readNewsgroup): rewrite to support nntp:,news: extension + * proto.h (reAnchorNewsheader): added + * url.c (DefaultPort): add 119 for nntp group + (parseURL2): rewrite to support nntp:,news: extension + (_parsedURL2Str): add for SCM_NNTP_GROUP + (openURL): rewrite to support nntp:,news: extension + + 2002-12-28 Fumitoshi UKAI + + * fix build errors + * display.c (make_lastline_message): fix error for undef JP_CHARSET + * news.c (readNewsgroup: `code' always required + + * gcc -Wall -Werror clean + * file.c (loadHTMLstream): unused variable `p' + * news.c (news_command): unused variable `c' + (news_open): unused variable `tmp' + (readNewsgroup): volatile page, qgroup, flag, start, end + uninitialized variable `page' + * url.c (openURL): unused variable `fw', `r', `stream' + + 2002-12-28 Fumitoshi UKAI + + * rc: nntpserver, nntpmode, max_news + + 2002-12-28 Hironori SAKAMOTO + + * [w3m-dev 03608] news: + * XMakefile (LSRCS): add news.c + (LOBJS): add news.o + * file.c (loadSOmething): don't UFclose() for nntp/news + (readHeader): remove . at beginning of line for news + img link to file: + (loadGeneralFile): add SCM_NEWS_GROUP + don't UFclose() for nntp/news + (loadHTMLstream): . line check for news + (loadBuffer): . line check for news + * fm.h (NNTP_server): added + (NNTP_mode): added + (MaxNewsMessage): added + * html.h (SCM_NEWS_GROUP): added + * main.c (main): NNTP_server or NNTPSERVER + NNTP_mode or NNTPMODE + add SCM_NEWS_GROUP + (followA): remove news:..@.. check + (cmd_loadURL): remove news:...@.. check + (w3m_exit): disconnectNews + * proto.h (openNewsStream): added + (readNewsgroup): added + (disconnectNews): added + * rc.c (CMT_NNTP_SERVER): added + (CMT_NNTP_MODE): added + (CMT_MAX_NEWS): added + (params9): add nntpserver, nntpmode, max_news + * url.c (DefaultPort): add 119 for news group + (parseURL2): news:..@... is SCM_NEWS_GROUP + (_parsedURL2Str): add news for SCM_NEWS_GROUP + (openURL): cleanup SCM_NEWS + add SCM_NEWS_GROUP + * news.c: added + + 2002-12-28 Hironori SAKAMOTO + + * [w3m-dev 03607] mymktime: time zone support + * etc.c (get_zone): added + (mymktime): parse timezone + + 2002-12-28 Hironori SAKAMOTO + + * [w3m-dev 03606] Re: clean up displayBuffer() + * main.c (followA): B_FORCE_REDRAW + (follow_map): ditto + + 2002-12-27 Hironori SAKAMOTO + + * [w3m-dev 03604] http response code and content-type + * file.c (loadGeneralFile): don't guessContentType if http errors + + 2002-12-26 Hiroyuki Ito + + * [w3m-dev 03602] Re: w3mimgdisplay core dump + * w3mimgdisplay.c (DrawImage): check load_image, imageBuf[n].pixmap + * w3mimg/fb/fb_w3mimg.c (w3mfb_show_image): check img->pixmap + * w3mimg/x11/x11_w3mimg.c (x11_show_image): check img->pixmap + + 2002-12-26 Hironori SAKAMOTO + + * [w3m-dev 03601] Re: meta refresh + * main.c (LastEvent): added + (pushEvent): add to LastEvent + + 2002-12-26 Hironori SAKAMOTO + + * [w3m-dev 03600] Re: meta refresh + * main.c (main): move add_download_list + + 2002-12-25 Hironori SAKAMOTO + + * [w3m-dev 03598] restore cursor when download list panel is updated. + * main.c (stopDownload): delete->replace + (ldDL): use DownloadListBuffer() + + 2002-12-25 Hironori SAKAMOTO + + * [w3m-dev 03597] Re: meta refresh + * main.c (Event): next, linked list + (N_EVENT_QUEUE): deleted + (eventQueue): deleted + (n_event_queue): deleted + (CurrentEvent): added + (main): event processing, add CurrentEvent linked list + (pushEvent): add Event to CurrentEvent + (SigAlarm): Currentbuf->event + * proto.h (pushEvent): rename args + + 2002-12-25 Hiroaki Shimotsu + + * [w3m-dev 03596] LIST + * anchor.c (link_list_panel): check internal + + 2002-12-25 Hironori SAKAMOTO + + * [w3m-dev 03595] tolower, toupper + * Str.c (Strlower): TOLOWER + (Strupper): TOUPPER + * backend.c: delete ctype.h + * etc.c (gethtmlcmd): TOLOWER + * file.c (readHeader): TOLOWER + (checkOverWrite): TOLOWER + (guess_charset): TOLOWER + * ftp.c: delete ctype.h + * indep.c (strcasecmp): TOLOWER + (strncasecmp): TOLOWER + (strcasematch): TOLOWER + * istream.c: include myctype.h + (ssl_get_certificate): TOLOWER + * mailcap.c (mailcapMatch): TOLOWER + * main.c (_quitfm): TOLOWER + * menu.c (accesskey_menu): TOLOWER + * mimehead.c: include myctype.h + (decodeWord): TOUPPER + * mktable.c: delete ctype.h, include myctype.h + (main): IS_SPACE + * myctype.h: delete ctype.h + (TOLOWER): added + (TOUPPER): added + * parsetagx.c (parse_tag): TOLOWER + * rc.c (str_to_bool): TOLOWER + (str_to_color): TOLOWER + * regex.c: delete ctype.h, include myctype.h + (TOLOWER): added + (TOUPPER): added + (regmatch1): TOLOWER + (matchWhich): TOLOWER, TOUPPER + + 2002-12-22 Fumitoshi UKAI + + * mimehead.c (decodeWord): don't use toupper() (requires ctype.h) + + 2002-12-22 ABE Yuji + + * [w3m-dev 03594] mime decode with encoding named 'b' & 'q' + * mimehead.c (decodeWord): toupeer(method) + + 2002-12-22 Fumitoshi UKAI + + * file.c (discardline): not used + + 2002-12-22 Hironori SAKAMOTO + + * [w3m-dev 03593] Re: segmentation fault when exist after <img> + * file.c (cur_title): added + (save_obuf): deleted + (process_title): added + (process_n_title): added + (feed_title): added + (HTMLtagproc1): rewrite HTML_TITLE, HTML_N_TITLE, + HTML_TITLE_ALT, HTML_N_HEAD, HTML_HEAD + (HTMLlineproc0): check RB_TITLE + (completeHTMLstream): add RB_TITLE + (loadHTMLstream): initialize cur_title + + 2002-12-21 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03590] segmentation fault when <title> exist after <img> + * file.c (save_line): deleted + (save_prevchar): deleted + (save_obuf): added + (HTMLtagproc1): bcopy save_obuf + + 2002-12-20 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03588] include time.h in ftp.c + * ftp.c: include <time.h> + + 2002-12-19 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03583] w3mman + * scripts/w3mman/README: W3MMAN_W3M, W3MMAN_MAN + * scripts/w3mman/w3mman.1.in: add ENVIRONMENT + * scripts/w3mman/w3mman.in: $ENV{'W3MMAN_W3M'}, $ENV{'W3MMAN_MAN'} + * scripts/w3mman/w3mman2html.cgi.in: $ENV{'W3MMAN_MAN'} + hyphenation + + 2002-12-19 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03582] add config options graphic_char and use_proxy + * NEWS: rc: graphic_char, use_proxy + * fm.h (Do_no_use_proxy): macro using use_proxy + (use_proxy): added + (no_graphic_char): deleted + (UseGraphicChar): added + * main.c (main): UseGraphicChar, use_proxy + * rc.c (CMT_GRAPHIC_CHAR): added + (CMT_USE_PROXY): added + (params1): graphic_char + (params4): use_proxy + * terms.c (graph_ok): UseGraphicChar + + 2002-12-19 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03581] MARK_URL, MARK_WORD + * main.c (chkWORD): accept ()[]{}&|;*?$ as anchor + + 2002-12-19 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03580] Re: clean up displayBuffer() + * main.c (main): force redraw + + 2002-12-19 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03579] Re: clean up displayBuffer() + * display.c (displayBuffer): re calcTabPos() when force or image redraw + * main.c (_mark): force redraw + (reinit): redraw image + * search.c (backwardSearch): found_last + + 2002-12-19 Fumitoshi UKAI <ukai@debian.or.jp> + + * [w3m-dev 03584] Re: meta refresh + * main.c (DefaultAlarm): fix initialize value + + 2002-12-19 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03578] meta refresh + * file.c (getMetaRefreshParam): do nothing if refresh_interval < 0 + (HTMLtagproc1): rewrite refresh + (HTMLlineproc2body): add HTML_META + * fm.h (BP_RELOAD): deleted + (Buffer): add event + (AL_IMPLICIT_DONE): deleted + (AL_ONCE): deleted + (AL_RESTORE): deleted + (AlarmEvent): added + * main.c (AlarmEvent): deleted + (PrevAlarm): deleted + (DefaultAlarm): added + (CurrentAlarm): point to DefaultAlarm + (main): CurrentKeyData, CurrentCmdData + handle Currentbuf->event + (SigAlarm): CurrentAlarm is pointer + (copyAlarmEvent): deleted + (setAlarm): setAlarmEvent pass &DefaultAlarm + (setAlarmEvent): arg event + (ldDL): no BP_RELOAD + * proto.h (setAlarmEvent): arg event + + 2002-12-18 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03577] incorrect table width + * table.c (dv2sv): fix move direction + (set_integered_width): ditto + (check_table_height): ditto + (feed_table_tag): ditto + + 2002-12-17 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03576] Re: news support + * anchor.c (_put_anchor_news): convert to document code and quote + (_put_anchor_all): convert to document code + * main.c (chkNMIDBuffer): change url_like_pat + + 2002-12-15 Fumitoshi UKAI <ukai@debian.or.jp> + + * NEWS: rc: preserve_timestamp + + 2002-12-15 Takahashi Youichirou <nikuq@hk.airnet.ne.jp> + + * [w3m-dev 03574] Re: preserve timestamp + * ftp.c (getFtpModtime): don't call localtime,gettime in same expr + + 2002-12-15 Fumitoshi UKAI <ukai@debian.or.jp> + + * [w3m-dev 03573] Re: Bug#172851: w3m: In form, takes hostname as baseref for relative URI action + * url.c (parseURL): if empty is URL, base URL is used + + 2002-12-15 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03571] base=0 -> 10 in toNumber() + * parsetagx.c (toNumber): strtol base=10 + + 2002-12-15 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03570] meta tag in frame + * frame.c (createFrameFile): fix meta equiv parse in frame + + 2002-12-15 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03569] Re: preserve timestamp + * file.c (loadGeneralFile): PresetveTimestamp + (_doFileCopy): is_pipe, PreserveTimestamp + (doFileSave): PreserveTImestamp + * fm.h (PreserveTimestamp): added + * rc.c (CMT_PRESERVE_TIMESTAMP): added + (params3): add preserve_timestamp + + 2002-12-15 Takahashi Youichirou <nikuq@hk.airnet.ne.jp> + + * [w3m-dev 03568] Re: preserve timestamp + * etc.c (USE_COOKIE): moved + * file.c (utime.h): include + (setModtime): added + (loadGeneralFile): set f.modtime + (_doFileCopy): setModtime() + (doFileSave): setModtime() + * ftp.c (getFtpModtime): added + (openFTP): pass URLFile, set modtime + * html.h (URLFile): add modtime + * proto.h (openFTP): arg URLFile *uf + (mymktime): always + * url.c (init_stream): initialize modtime + (openFTPStream): pass URLFile + (openURL): openFTPStream + + 2002-12-13 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03567] default keybinding + * doc-jp/keymap.default (C-q,C-t,(,),+,-,D,L,T,m,r,{,|,}, + M-c,M-k,M-l,M-m,M-o,M-t): assign + * doc/keymap.default: ditto + * keybind.c: ditto + * doc-jp/keymap.lynx (C-q,C-t,C-u,(,),,,.,;,D,L,T,W,[,], + m,r,w,{,|,},M-<,M->,M-W,M-c,M-g, + M-k,M-l,M-m,M-n,M-o,M-p,M-t,M-w): assign + * doc/keymap.lynx: ditto + * keybind_lynx.c: ditto + * doc-jp/menu.default (Main): Select,SelectTab,TAB_LINK + * doc/menu.default: ditto + + 2002-12-13 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03566] configure prefix + * configure: add X prefix for expr args + + 2002-12-13 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03564] clean up displayBuffer() + * display.c (delayed_msg): static + (drawAnchorCursor): static + (redrawBuffer): define + (redrawNLine): static + (redrawLine): static + (redrawLineRegion): static + (do_effects): static + (do_color): static + (make_lastline_link): added + (make_lastline_message): added + (displayBuffer): rewrite with make_lastline_message() + (drawAnchorCursor0): added + (drawAnchorCursor): added + * main.c (main): remove onA() + (keyPressEventProc): remove onA() + (disp_srchresult): static + disp_message TRUE + (isrch): remove onA() + (srch): displayBuffer + remove onA() + (srch_nxtprv): remove onA() + (pipeBuf): disp_message TRUE + (pipesh): disp_message TRUE + (readsh): disp_message TRUE + (_mark): dispBuffer + (_followForm): break, always dispBuffer + (drawAnchorCursor0): deleted + (drawAnchorCursor): deleted + (onA): deleted + (anchorMn): delete onA() + (svBuf): displayBuffer B_NORMAL + (reload): disp_err_message TRUE + displayBuffer + (rFrame): displayBuffer + (invoke_browser): displayBuffer + (extbrz): disp_err_message TRUE + (process_mouse): onA -> displayBuffer + (movMs): delete onA() + (menuMs): onA -> displayBuffer + (closeTMs): disp_message TRUE + (wrapToggle): disp_message TRUE + (execdict): disp_message TRUE + (SigAlarm): displayBuffer, delete onA + (reinit): displayBuffer + * map.c (getCurrentMapLabel): deleted + (retrieveCurrentMapArea): added + * proto.h (redrawBuffer): deleted + (redrawNLine): deleted + (redrawLine): deleted + (redrawLineRegion): deleted + (do_effects): deleted + (do_color): deleted + (message_list): deleted + (getCurrentMapLabel): deleted + (retrieveCurrentMapArea): added + + 2002-12-13 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03563] Directory Traversal Vulnerabilities in FTP Clients + * file.c (guess_save_name): pass guess_filename + + 2002-12-13 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03562] #undef BUFINFO + * config.h.dist (BUFINFO): undef + * configure (use_bufinfo): n + * main.c (saveBufferInfo): ifdef USE_BUFINFO + * proto.h (reloadBuffer): if 0 + (saveBufferInfo): ifdef USE_BUFINFO + + 2002-12-12 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03559] Re: use select instead of signal for loading images + * fm.h (Buffer): add image_loaded + * image.c (W3M_SIGIMG): deleted + (image_lock): deleted + (need_load_image): deleted + (load_image_handler): deleted + (load_image_next): deleted + (getAllImage): check image_loaded + (loadImage): delete image_lock + delete IMG_FLAG_NEXT + * main.c (main): check image_loaded + * proto.h (sleep_till_anykey): return int + * terms.c (sleep_till_anykey): return int + + 2002-12-12 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03558] long title is displayed over tab region + * display.c (redrawNLine): check l < 0 + use addnstr + + 2002-12-11 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03554] Re: Undo/Redo + * doc/README.func (REDO): added + (UNDO): added + * doc-jp/README.func (REDO): added + (UNDO): added + * scripts/w3mhelp.cgi.in: (Page/Cursor motion): add undoPos, redoPos + + 2002-12-11 Fumitoshi UKAI <ukai@debian.or.jp> + + * NEWS: func: REDO, UNDO + + 2002-12-11 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03553] Undo/Redo + * fm.h (Buffer): add undo + (BufferPos): added + * funcname.tab (REDO): added + (UNDO): added + * main.c (save_buffer_position): added + (main): save_buffer_position + (resetPos): added + (undoPos): added + (redoPos): added + * proto.h (undoPos): added + (redoPos): added + + 2002-12-11 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03552] Re: link list + * menu.c (accesskey_menu): check hseq + (list_menu): check hseq + + 2002-12-11 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03551] Re: External URI loader + * file.c (loadGeneralFile): fix SCM_UNKNONWN + + 2002-12-10 Fumitoshi UKAI <ukai@debian.or.jp> + + * NEWS: func: LIST, LIST_MENU, MOVE_LIST_MENU + + 2002-12-10 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03549] link list + * anchor.c (addMultirowsImg): add a->slave + (getAnchorText): arg AnchorList *al + (link_list_panel): added + * funcname.tab (LIST): added + (LIST_MENU): added + (MOVE_LIST_MENU): added + * main.c (anchorMn): added + (accessKey): use anchorMn() + (listMn): added + (movlistMn): added + (linkLst): added + * map.c (searchMapList): not static + * menu.c (accesskey_menu): pass AnchorList to getAnchorText() + (lmKeys): added + (lmKeys2): added + (nlmKeys): added + (nlmKeys2): added + (lmGoto): added + (lmSelect): added + (list_menu): added + * proto.h (linkLst): added + (listMn): added + (movlistMn): added + (list_menu): added + (searchMapList): added + (getAnchorText): arg AnchorList *al + (link_list_panel): added + * doc/README.func (LIST): added + (LIST_MENU): added + (MOVE_LIST_MENU): added + * doc-jp/README.func (LINK_MENU): fix message + (LIST): added + (LIST_MENU): added + (MOVE_LIST_MENU): added + * scripts/w3mhelp.cgi.in (Page/Cursor motion): add movlistMn + (Hyperlink operation): add linkLst linkMn + + 2002-12-10 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03548] close anchor before <img align=...> + * file.c (process_img): use div_int + (process_hr): use div_int + (process_idattr): don't close_anchor + (CLOSE_A): added + (HTMLtagproc1): </p> close anchor + <dl>,<ul>,<ol>,<blockquote>,<li>,<dt>,<dd> close anchor + <noframes> close anchor + <pre> close anchor + <center> close anchor + <div> close anchor + add DIV_INT + <form> close anchor + * html.c (TagMAP): add div_int + * html.h (HTML_DIV_INT): added + (HTML_N_DIV_INT): added + * tagtable.tab (div_int): added + (/div_int): added + + 2002-12-10 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03544] Can't display "1&2" in table + * file.c (HTMLlineproc0): continue -> R_ST_NORMAL + + 2002-12-10 Fumitoshi UKAI <ukai@debian.or.jp> + + * file.c (loadGeneralFile): missing `{', fix indent for SCM_UNKNOWN + * main.c (set_buffer_environ): unused variables `prev_col' + + 2002-12-10 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03543] External URI loader (Debian closes: Bug#169962) + * file.c (loadGeneralFile): rewrite SCM_UNKNOWN + + 2002-12-10 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03542] news support + * file.c (loadGeneralFile): NNTP as well as NEWS + * indep.c (url_unquote_char): check % hex hex + (url_unquote): unquote except \0, \n, \r + + 2002-12-10 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03541] Re: W3M_LINE_NO / W3M_CURRENT_COLUMN + * main.c (goLine): check searchKeyData() + (set_buffer_environ): W3M_CURRENT_* + + 2002-12-07 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03536] <del>, <s> + * file.c (HTMLtagproc1): <s>..</s> is [S:...:S] + (HTMLtagproc0): <del> will delete <table> + * fm.h (RB_S): added + * html.c (TagMAP): <s>,</s> + move <internal>, </internal> + * html.h (HTML_S): added + (HTML_N_S): added + (HTML_INTERNAL): renumed + (HTML_N_INTERNAL): ditto + (MAX_HTMLTAG): add 2 + * rc.c (CMT_DISP_INS_DEL): update + * table.c (feed_table_tag): add HTML_S, HTML_N_S + * table.h (TBLM_S): added + (TBLM_ANCHOR): renum + * tagtable.tab: (strike, s): HTML_S + (/strike, /s): HTML_N_S + + 2002-12-07 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03535] close anchor, quote < + * file.c (HTMLtagproc1): close_anchor + * frame.c (createFrameFile): quote < + + 2002-12-07 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03534] cleanup file.c + * file.c (HTMLlineproc2body): cleanup + 2002-12-06 Fumitoshi UKAI <ukai@debian.or.jp> ! * version.c.in: w3m/0.3.2.2+cvs ! * NEWS: 0.3.2.2 2002-12-06 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * security fix * file.c (process_img): html_quote() ! ! 2002-12-06 Takahashi Youichirou <nikuq@hk.airnet.ne.jp> ! ! * [w3m-dev 03530] save history ! * history.c (saveHistory): save tmpfile and rename ! ! 2002-12-06 Fumitoshi UKAI <ukai@debian.or.jp> ! ! * NEWS: func: ACCESSKEY, LINK_MENU ! ! 2002-12-06 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03529] Support of title, accesskey of anchor ! * anchor.c (putAnchor): arg title, key ! initialize slave ! (registerHref): arg title, key ! (registerName): title = NULL, key = '\0' ! (registerForm): title = NULL, key = '\0' ! (_put_anchor_news): title = NULL, key = '\0' ! (_put_anchor_all): title = NULL, key = '\0' ! (addMultirowsImg): register title, accesskey ! (addMultirowsForm): title = NULL, key = '\0' ! (getAnchorText): added ! * display.c (displayBuffer): show title if any ! * file.c (set_breakpoint): use bcopy ! (back_to_breakpoint): use bcopy ! (flushline): s/anchor/anchor.url/ ! s/anchor_hseq/anchor.hseq/ ! s/anchor_target/anchor.target/ ! add anchor.* ! (close_effect0): s/anchor/anchor.url/ ! s/anchor_hseq/anchor.hseq/ ! (close_anchor): use bzero ! (process_img): ATTR_TITLE, ! (HTMLtagproc1): s/anchor/anchor.url/ ! target, referer, title, accesskey, hseq ! (HTMLlineproc2body): ATTR_TITLE, ATTR_ACCESSKEY ! (init_henv): use bzero ! * fm.h (Anchor): add title, accesskey, slave ! (Breakpoint): use Anchor ! (struct readbuffer): use Anchor ! * funcname.tab (ACCESSKEY): added ! (LINK_MENU): added ! * html.c (ALST_A): add ATTR_TITLE, ATTR_ACCESSKEY ! (ALST_IMG): add ATTR_TITLE ! (ALST_IMG_ALT): add ATTR_TITLE ! (AttrMAP): add accesskey, renum ! * html.h (ATTR_ACCESSKEY): added ! (ATTR_*): renum 50->60 ! * main.c (linkMn): added ! (accessKey): added ! * menu.c (LinkMenu): deleted ! (LinkV): deleted ! (initLinkMenu): deleted ! (lmGoURL): deleted ! (popupMenu): delete initLinkMenu() ! (initMenu): delete Link ! (link_menu): added ! (accesskey_menu): added ! * proto.h (linkMn): added ! (link_menu): added ! (accessKey): added ! (accesskey_menu): added ! (putAnchor): arg title, key ! (registerHref): arg title, key ! (registerImg): arg title ! (getAnchorText): added ! * doc/README.func (ACCESSKEY): added ! (LINK_MENU): added ! * doc-jp/README.func (ACCESSKEY): added ! (LINK_MENU): added ! * scripts/w3mhelp.cgi.in (Hyperlink operation): add linkMn accessKey ! ! 2002-12-06 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03528] area without alt ! * map.c (getCurrentMapLabel): when a->alt is empty ! ! 2002-12-06 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03527] fix frame.c ! * frame.c (createFrameFile): move need_reconstruct ! ! 2002-12-06 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03526] Re: fix doc*/README.func, w3mhelp.cgi.in ! * scripts/w3mhelp.cgi.in: (load_keymap): ! always upcase ESC,SPC,TAB,DEL,UP,DOWN,RIGHT,LEFT ! ! 2002-12-05 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03525] Re: sync option ! * func.c (initKeymap): delete check force, keymap_initialized ! ! 2002-12-05 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03524] fix doc*/README.func, w3mhelp.cgi.in ! * doc/README.func (REINIT): added ! * doc-jp/README.func (REINIT): added ! * scripts/w3mhelp.cgi.in (Page/Cursor motion): ! add moveR1 movL1 movD1 movU1 ldown1 lup1 ! (File/Stream operation): add pipeBuf ! (Miscellany): add dispVer execCmd reinit ! (load_keymap): rewrite ! (norm_key): rewrite ! ! 2002-12-05 Fumitoshi UKAI <ukai@debian.or.jp> ! ! * NEWS: rc: display_ins_del ! ! 2002-12-05 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03523] Re: del/ins ! * file.c (HTMLtagproc1): check displayInsDel, RB_DEL ! * fm.h (RB_DEL): added ! (displayInsDel): added ! * rc.c (CMT_DISP_INS_DEL): added ! (display_ins_del): added ! * table.c (feed_table_tag): check displayInsDel, TBLM_DEL ! * table.h (TBLM_DEL): added ! (TBLM_ANCHOR): renum ! (struct table_mode): unsigned int pre_mode ! ! 2002-12-05 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03522] newline around <pre>..</pre> ! * file.c (HTMLtagproc1): break before <pre>/after </pre> if necessary ! ! 2002-12-05 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03521] sync option ! * display.c (redrawNLine): calcTabPos() ! * func.c (initKeymap): return if keymap_initialized ! * main.c (calcTabPos): no more static ! (main): move sync_with_option, initCookie, setLocalCookie ! move backend ! move initKeymap, initMouseAction, initMenu ! remove calcTabPos ! add displayBuffer ! (numTab): static ! (deleteTab): delete calcTabPos ! (moveTab): delete calcTabPos ! * proto.h (calcTabPos): added ! ! 2002-12-05 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev-en 00841] Re: w3m segfaults if the terminal is not writable ! * terms.c (reset_tty): don't close stderr ! ! 2002-12-04 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03516] Re: 2 stroke keybinding ! * func.c (keymap_initialized): initialized to FALSE ! (setKeymap): push KeyData ! ! 2002-12-04 Fumitoshi UKAI <ukai@debian.or.jp> ! ! * NEWS: 2 stroke keybinding ! func: MULTIMAP ! ! 2002-12-04 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03515] 2 stroke keybinding ! * func.c (setKeymap): add map ! K_MULTI support ! (getKey2): added ! (getKey): rewrite to use getKey2() ! * func.h (K_MULTI): added ! (MULTI_KEY): added ! * funcname.tab (MULTIMAP): added ! * main.c (escKeyProc): added ! (escmap): rewrite to use escKeyProc() ! (escbmap): rewrite to use escKeyProc() ! (escdmap): rewrite to use escKeyProc() ! (multimap): added ! * proto.h (multimap): added ! ! 2002-12-04 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03514] Effect of tab title ! * display.c (redrawNLine): rewrite, do without clrtoeolx() ! ! 2002-12-04 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03512] Re: HTML parser ! * table.c (feed_table_tag): HTML_N_SELECT, HTML_N_CAPTION ! ! 2002-12-04 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03510] waiting time when cookie was rejected. ! * file.c (readHeader): display cookie warnings for only 1 sec ! ! 2002-12-04 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03509] HTML parser ! * file.c (close_textarea): delete ! (HTMLtagproc1): rewrite ! delete HTML_EOL ! move HTML_LISTING, HTML_N_LISTING ! add HTML_PRE_PLAIN, HTML_N_PRE_PLAIN ! add HTML_PLAINTEXT ! end_tag ! (HTMLlineproc0): s/str/line/ ! rewrite ! (completeHTMLstream): </textarea> if necessary ! * fm.h (struct readbuffer): delete ignore_tag ! add end_tag ! (RB_XMPMODE): deleted ! (RB_LSTMODE): deleted ! (RB_SCRIPT): added ! (RB_STYLE): added ! (RB_*): renumber ! (R_ST_EOL): added ! (R_ST_*): renumber ! (ST_IS_TAG): check R_ST_EOL ! * form.c (form_fputs_decode): remove <eol> handling ! * frame.c (newFrame): remove_space() ! (CASE_TABLE_TAG): added ! (createFrameFile): rewrite ! * html.c (TagMAP): delete eol ! add pre_plain, /pre_plain ! * html.h (HTML_EOL): deleted ! (HTML_PRE_PLAIN): added ! (HTML_N_PRE_PLAIN): added ! * table.c (visible_length): rewrite ! (visible_length_plain): added ! (maximum_visible_length_plain): added ! (do_refill): R_ST_EOL ! (table_close_select): end_tag ! (table_close_textarea): end_tag ! (TAG_ACTION_PLAIN): added ! (feed_table_tag): rewrite ! (feed_table): rewrite ! * table.h (TBLM_*) reassign ! (struct table_mode): delete ignore_tag ! add end_tag ! * tagtable.tab (eol): deleted ! (pre_plain): added ! (/pre_plain): added ! ! 2002-12-03 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03505] Re: coredump when ssl error ! * file.c (loadGeneralFile): term_raw(), SIGINT before retry ! ! 2002-12-03 AIDA Shinra <aida-s@jcom.home.ne.jp> ! ! * [w3m-dev 03504] coredump when ssl error ! * file.c (loadGeneralFile): term_raw, SIGINT ! ! 2002-12-03 Fumitoshi UKAI <ukai@debian.or.jp> ! ! * remove ununsed variables ! * file.c (addLink): unused variable `t' ! * menu.c (lmGoURL): unused variable `pu' ! ! 2002-12-03 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03501] link tag support ! * buffer.c (reshapeBuffer): initialize formlist, linklist, ! maplist, hmarklist, imarklist ! * file.c (addLink): added ! (HTMLlineproc2body): add HTML_LINK ! (loadHTMLstream): use HTMLlineproc0 not in R_ST_NORMAL ! (reloadBuffer): initialize linklist, maplist, ! hmarklist, imarklist ! * fm.h (LINK_TYPE_NONE): added ! (LINK_TYPE_REL): added ! (LINK_TYPE_REV): added ! (LinkList): added ! (Buffer): add linklist ! * html.c (ALST_LINK): added ! (TagMAP): add link ! (AtrMAP): add rel, rev, title ! * html.h (HTML_LINK): added ! (ATTR_REL): added ! (ATTR_REV): added ! (ATTR_TITLE): added ! * map.c (append_map_info): anchor ! (append_link_info): added ! (page_info_panel): append_link_info ! * menu.c (LinkMenu): added ! (linkV): added ! (initLinkMenu): added ! (lmGoURL): added ! (popupMenu): initLinkMenu() ! (initMenu): w3mMenuList new 4 ! add "Link" ! * tagtable.tab (link): added ! ! 2002-11-29 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m bug] internal tag ! * display.c (loadHTMLstream): HTMLlineproc0 internal ! ! 2002-11-29 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03498] Re: parse <!-- ... --> in <script> ! * file.c (HTMLlineproc0): tag in textarea ! * frame.c (createFrameFile): fix comment processing in frame ! ! 2002-11-28 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03497] incorrect image size ! * image.c (getImageSize): invoke w3mimgdiplay -size instead of "5;..." ! * w3mimgdisplay.c (defined_size): added ! (main): if defined_size get_image_size() ! (GetOption): -size ! ! 2002-11-28 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03496] parse <!-- ... --> in <script> ! * etc.c (read_token): check <pre> ! * file.c (HTMLlineproc0): remove comment processing ! check pre mode ! comment processing move ! ! 2002-11-28 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03495] local CGI can't work ! * local.c: #include "hash.h" ! (set_environ): env string put in hash ! ! 2002-11-28 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03494] Number of line is few when pager mode. ! * display.c (redrawLine): buf->rootY ! ! 2002-11-28 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03493] scroll menu ! * menu.c (mLineU): added ! (mLineD): added ! (MenuKeymap): C-r, C-s, J, K ! (mouse_scroll_line): added ! (process_mMouse): drag ! BTN4, BTN5 ! * doc-jp/README.menu: update 2002-11-27 Fumitoshi UKAI <ukai@debian.or.jp> ! * version.c.in: w3m/0.3.2.1+cvs ! 2002-11-27 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03491] Re: case insensitive regexp search ! * regex.c (matchWhich): tolower ! ! 2002-11-27 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * use local_cookie for support local-cgi commands ! * file.c (loadGeneralFile): pass Local_cookie to DirBufferCommand ! * fm.h (Local_cookie): Str ! * local.c (setLocalCookie): Str, set_environ() ! (set_cgi_environ): remove LOCAL_COOKIE ! * main.c (ldhelp): pass Local_cookie ! (adBmark): ditto ! * rc.c (optionpanel_src1): cookie ! (load_option_panel): pass Local_cookie ! * w3mbookmark.c (main): check Local_cookie ! * w3mhelperpanel (main): ditto ! * scripts/dirlist.cgi.in: ditto ! * scripts/w3mhelp.cgi.in: ditto ! * scripts/multipart/multipart.cgi.in: ditto ! ! 2002-11-27 Fumitoshi UKAI <ukai@debian.or.jp> * frame.c (createFrameFile): html_quote() + 2002-11-27 Hiroyuki Ito <hito@crl.go.jp> + + * [w3m-dev 03488] meta refresh in frame + * file.c (getMetaRefreshParam): added + (HTMLtagproc1): use getMetaRefreshParam() + * frame.c (createFrameFile): check meta refresh + * proto.h (getMetaRefreshProgram): added + + 2002-11-27 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * w3m 0.3.2.1 security fix + * frame.c (createFrameFile): html_quote() + + 2002-11-27 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03486] fix of displayLineInfo + * display.c (displayBuffer): don't divide by 0 + + 2002-11-26 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03485] fix mouse menu position + * main.c (do_mouse_action): use anchor_map is no active_map + check top left corner + (FRAME_WIDTH): added + (menuMs): adjust cursorX using FRAME_WIDTH + + 2002-11-26 Fumitoshi UKAI <ukai@debian.or.jp> + + * NEWS: func: CLOSE_TAB_MOUSE, MENU_MOUSE, MOVE_MOUSE, TAB_MOUSE + + 2002-11-26 Fumitoshi UKAI <ukai@debian.or.jp> + + * doc/README.mouse_menu: deleted + * doc/README.mouse: added + * doc-jp/README.mouse_menu: deleted + * doc-jp/README.mouse: added + + 2002-11-26 Fumitoshi UKAI <ukai@debian.or.jp> + + * map.c (follow_map_menu): MapArea *a is used ifdef MENU_MAP + * func.c (initMouseAction): remove unsed variables: x, width, map + + 2002-11-26 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03478] mouse action configuration + * display.c (displayBuffer): mouse_menu -> mouse_action.menu_str + mouse_action.lastline_str + (redrawNLine): mouse_menu -> mouse_action.menu_str + * fm.h (MouseMenuMap): deleted + (MouseActionMap): added + (MouseAction): added + (mouse_action): added + * func.c (default_mouse_action): added + (setMouseAction0): added + (setMouseAction1): added + (setMouseAction2): added + (initMouseMenu): deleted + (initMouseAction): added + * funcname.tab (CLOSE_TAB_MOUSE): added + (MENU_MOUSE): added + (MOVE_MOUSE): added + (TAB_MOUSE): added + * main.c (main): initMouseMenu() -> initMouseAction() + mouse_menu -> mouse_action + (posTab): mouse_menu -> mouse_action + check y > LastTab->y + (mouse_menu_action): deleted + (do_mouse_action): added + (process_mouse): mouse_menu -> mouse_action + do_mouse_action() + (movMs): added + (menuMs): added + (tabMs): added + (closeTMs): added + (reinit): initMouseMenu() -> initMouseAction() + resource: MOUSE_MENU -> MOUSE + (calcTabPos): mouse_menu -> mouse_action + * menu.c (mainMn): mouse_menu -> mouse_action + (selMn): mouse_menu -> mouse_action + (tabMn): mouse_menu -> mouse_action + (initMenu): add SelectTag to w3mMenuList + * proto.h (movMs): added + (menuMs): added + (tabMs): added + (closeTMs): added + (initMouseMenu): deleted + (initMouseAction): added + * rc.c (sync_with_option): initMouseMenu() -> initMouseAction() + * doc/README.func (CLOSE_TAB_MOUSE): added + (MENU_MOUSE): added + (MOVE_MOUSE): added + (TAB_MOUSE): added + * doc-jp/README.func (CLOSE_TAB_MOUSE): added + (MENU_MOUSE): added + (MOVE_MOUSE): added + (TAB_MOUSE): added + + 2002-11-26 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03476] Re: Bug#170506: w3m: Unable to use mozilla bugzilla + * file.c (HTMLtagproc1): initialize ignore_tag in table_mode + (HTMLtagproc0): check table_level + * table.c (feed_table_tag): set mode->ignore_tag + * table.h (struct table_mode): add ignore_tag + + 2002-11-25 Fumitoshi UKAI <ukai@debian.or.jp> + + * [w3m-dev 03471] Re: SETPGRP() + * configure: SETPGRP() always defined + * proto.h (close_all_fds): added + (myExec): #ifdef HAVE_SETPGRP + * etc.c (close_all_fds): added + (myExec): #ifdef HAVE_SETPGRP + (mySystem): #ifndef -> #ifdef + * file.c (_doFileCopy): delete #ifdef HAVE_SETPGRP + (doFileSave): ditto + * image.c (openImgdisplay): delete #ifdef HAVE_SETPGRP + use close_all_fds() + * search.c (open_migemo): ditto + + 2002-11-23 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03466] Re: background download when external viewer + * file.c (doExternal): UFclose(&uf); + + 2002-11-23 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03464] Re: case insensitive regexp search + (rewrite [w3m-dev 03462] by Hiroyuki Ito <hito@crl.go.jp>) + * regex.c (matchWhich): add int + (newRegex0): igncase + (regmatch1): matchWhich with re->mode & RE_IGNCASE + (matchWhich): add igncase + + 2002-11-23 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03459] background download when external viewer + * etc.c (myExec): added + (mySystem): rewrite to use myExec() + * file.c (doExternal): run background if BackgroundExtViewer + * proto.h (myExec): added + + 2002-11-23 Fumitoshi UKAI <ukai@debian.or.jp> + + * doc/README.mouse_menu: delete column 10 limit + * doc-jp/README.mouse_menu: ditto + + 2002-11-23 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03458] Re: mouse menu + * display.c (displayBuffer): nTab2 -> nTab, mouse_menu + * fm.h (nTab2): deleted + (MouseMenuMap): added + (MouseMenu): added + (LIMIT_MOUSE_MENU): added + * func.c (initMouseMenu): delete mouse_menu_map initialization + conv_from_system + mouse_menu->width + * main.c (main): mouse_menu->in_action = FALSE + (posTab): check mouse_menu + (mouse_menu_action): add y arg + mouse_menu_width check + (process_mouse): nTab2 -> nTab, mouse_menu + (nTabLine): deleted + (calcTabPos): check mouse_menu + * menu.c (mainMn): x, y + (selMn): mouse_menu check + (tabMn): mosue_menu check + * proto.h (nTabLine): deleted + + 2002-11-22 Fumitoshi UKAI <ukai@debian.or.jp> + + * NEWS: options: -N + + 2002-11-22 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03457] open URL of command line on each new tabs + * main.c (delBuffer): static + (fusage): -N + (main): add open_new_tab for -N + + 2002-11-22 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03456] tiling of tab + * display.c (displayBuffer): use LastTab->y + (redrawNLine): fix column calculation + * fm.h (TabBuffer): add x1, x2, y + * main.c (calcTabPos): added + (main): calcTabPos() + (mouse_scroll_line): rewrite + (process_mouse): use LastTab->y + (_newT): calcTabPos() + (calcTabPos): added + (deleteTab): calcTabPos() + (moveTab): calcTabPos() + + 2002-11-22 Fumitoshi UKAI <ukai@debian.or.jp> + + * doc/README.mouse_menu: added + * doc-jp/README.mouse_menu: added + + 2002-11-22 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03455] mouse menu + * configure (config.h): MOUSE_FILE + * display.c (displayBuffer): nTab -> nTab2, N_TAB -> nTabLine() + (redrawNLine): nTab -> nTab2, N_TAB -> nTabLine() + mouse_menu support + * fm.h (nTab2): added + (N_TAB): deleted + (NO_TABBUFFER): added + (struct _MouseMenu): added + (mouse_menu_map): added + (mouse_menu): added + * func.c (initMouseMenu): added + * main.c (main): initMouseMenu() + (posTab): mouse_menu support + (mouse_menu_action): added + (process_mouse): mouse_menu support + (reinit): initMouseMenu() + (nTabLine): added + (moveTab): check NO_TABBUFFER + * proto.h (nTabLine): added + (initMouseMenu): added + * rc.c (sync_with_option): initMouseMenu() + + 2002-11-22 Fumitoshi UKAI <ukai@debian.or.jp> + + * NEWS: func: NEXT, PREV + + 2002-11-22 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03454] next / previous buffer + * funcname.tab (NEXT): added + (PREV): added + * main.c (nextBf): added + (prevBf): added + * proto.h (nextBf): added + (prevBf): added + * doc/README.func (NEXT): added + (PREV): added + * doc-jp/README.func (NEXT): added + (PREV): added + * scripts/w3mhelp.cgi.in (Buffer operation): nextBf prevBf + + 2002-11-20 Fumitoshi UKAI <ukai@debian.or.jp> + + * NEWS: rc: image_map_list + + 2002-11-20 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03452] image map + * display.c (displayBuffer): use getCurrentMapLabel() + * fm.h (MapArea): delete ifdef MENU_MAP + (image_map_list): added + * main.c (followA): don't call retrieveCurrentImg() ifdef USE_IMAGE + use retrieveCurrentMap() ifndef USE_IMAGE + (_followForm): indent + (drawAnchorCursor0): add AnchorList + (drawAnchorCuror): pass AnchorList to drawAnchorCursor0 + (follow_map): follow_map_panel + * map.c (searchMapList): added + (nearestMapArea): n, min default value to -1 + (searchMapArea): added + (getCurrentMapLabel): added + (getMapXY): moved + (retrieveCurrentMap): added + (follow_map_menu): parsed_tagarg -> name + rewrite to search map list/area + (follow_map_panel): parsed_tagarg -> name + rewrite to search map list/area + (newMapArea): delete ifdef MENU_MAP + (append_map_info): added + (page_info_panel): append_map_info + * proto.h (follow_map_menu): parsed_tagarg -> name + (follow_map_panel): parsed_tagarg -> name + (getCurrentMapLabel): added + (retrieveCurrentMap): added + * rc.c (CMT_IMAGE_MAP_LIST): added + (image_map_list): added + + 2002-11-20 Yoshinobu Sakane <sakane@d4.bsd.nes.nec.co.jp> + + * [w3m-dev 03450] Re: cygwin console on Win9X + * terms.c (mouse_init): ifdef __CYGWIN__ + (mouse_end): ditto + + 2002-11-19 Fumitoshi UKAI <ukai@debian.or.jp> + + * ftp.c (ftp_fclose): void return + + 2002-11-19 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03444] download from ftp. + * file.c (FTPhalfclose: static + (loadGeneralFile): UFclose + FTPhalfclose for SCM_FTP + UFclose before signal back + (loadImageBuffer): UFclose before signal back + (openGeneralPagerBuffer): UFclose + * ftp.c (ftp_fclose): added + (Ftpfclose): dont read response(), but ftp_fclose() + (FtpBye): ftp_fclose() + + 2002-11-19 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03449] Add DOWNLOAD_LIST to doc*/README.func and scripts/w3mhelp.cgi.in + * doc-jp/README.func (DOWNLOAD_LIST): added + * doc/README.func (DOWNLOAD_LIST): added + * scripts/w3mhelp.cgi.in (Miscellany): add ldDL + + 2002-11-19 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03448] Some fixes + * url.c (KeyAbort): SIGNAL_RETURN + * .cvsginore: delete w3mimgsize + * scripts/.cvsignore: delete xface2xbm + * scripts/xface2xbm.in: deleted + + 2002-11-19 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03447] Re: Open download list panel on new tab + * main.c (download_action): buffer management deleted + (ldDL): buffer management moved here + + 2002-11-19 Fumitoshi UKAI <ukai@debian.or.jp> + + * NEWS: rc: open_tab_dl_list + + 2002-11-19 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03446] Open download list panel on new tab + * fm.h (open_tab_dl_list): added + * main.c (download_action): buffer delete when download done + (ldDL): open buf in new tab if open_tab_dl_list + * rc.c (CMT_OPEN_TAB_DL_LIST): added + (open_tab_dl_list): added + + 2002-11-19 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03445] download list for "w3m foo.tar.gz" + * main.c (main): display download list + + 2002-11-19 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03443] Can't display "echo only_one_line | w3m" + * display.c (redrawNLine): check 1st line + + 2002-11-16 Fumitoshi UKAI <ukai@debian.or.jp> + + * [w3m-dev 03442] Re: setting form on loading + * form.c (preFormUpdateBuffer): ifdef MENU_SELECT + + 2002-11-16 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03441] charset of save file + * file.c (_doFileCopy): use conv_from_system() + (doFileSave): conv_from_system() + * main.c (DownloadListBuffer): conv_from_system() + + 2002-11-16 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03440] Re: restore alarm event + * fm.h (BP_RELOAD): added + (DOWNLOAD_LIST_TITLE): added + * main.c (main): if BP_RELOAD, do reload + (reload): if buffer is DOWNLOAD_LIST, ldDL() + (DownloadListBuffer): rewrite with DOWNLOAD_LIST_TITLE + (download_action): delete "update" + don't delete prev buffer + (ldDL): rewrite to do reload + + 2002-11-16 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03439] restore alarm event + * fm.h (AL_RESTORE): added + * main.c (alarm_sec): deleted + (alarm_status): deleted + (alarm_buffer): deleted + (alarm_event): deleted + (AlarmEvent): added + (CurrentAlarm): added + (PrevAlarm): added + (main): rewrite with CurrentAlarm + (SigAlarm): rewrite with CurrentAlarm + (copyAlarmEvent): added + (setAlarm): if AL_RESTORE, copy back from PrevAlarm + rewrite with CurrentAlarm + 2002-11-16 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> * [w3m-dev 03438] Re: segmentation fault by large complex table. * table.c (check_table_height): check MAXROWCELL * table.h (MAXROWCELL): added ! 2002-11-16 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03437] Re: Check image size ! * fm.h (MAX_IMAGE_SIZE): changed to 2048 ! ! 2002-11-16 Hiroyuki Ito <hito@crl.go.jp> ! ! * [w3m-dev 03436] Check image size ! * file.c (process_img): check w > MAX_IMAGE_SIZE ! (HTMLlineproc2body): check w,h > MAX_IMAGE_SIZE ! * fm.h (MAX_IMAGE_SIZE): added ! * image.c (getImageSize): check w,h,width,height > MAX_IMAGE_SIZE ! ! 2002-11-16 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03435] save image with SAVE ! * buffer.c (discardBuffer): check image ! * file.c (loadImageBuffer): add st ! IMG_FLAG_DONE_REMOVE ! s/sourcefile/mailcap_source/ ! * fm.h (IMG_FLAG_DONT_REMOVE): added ! * image.c (drawImage): & IMG_FLAG_LOADED ! (deleteImage): & IMG_FLAG_DONT_REMOVE ! (showImageProgress): & IMG_FLAG_LOADED ! (getImage): & IMG_FLAG_LOADED ! (getImageSize): & IMG_FLAG_LOADED ! * main.c (vmSrc): delete ifdef USE_IMAGE ! ! 2002-11-16 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03434] Re: cygwin console on Win9X ! * terms.c (cygwin_mouse_btn_swapped): ifdef USE_MOUSE ! (lastConMouse): deleted ! (check_win9x): static ! (read_win32_console): static ! (GetConsoleHwnd): static ! (cygwin_version): ifdef USE_MOUSE, static ! (check_cygwin_console): static ! (NEED_XTERM_ON): added ! (NEED_XTERM_OFF): added ! (NEED_CYGWIN_ON): added ! (NEED_CYGWIN_OFF): added ! (XTERM_TITLE): static char[] ! (SCREEN_TITLE): static char[] ! (CYGWIN_TITLE): static char[] ! (term_title): check title_str ! * terms.h (LASTLINE): added ! (is_xterm): deleted ! (enable_win9x_console_input): extern ! (disable_win9x_console_input): extern ! (NEED_XTERM_ON): deleted ! (NEED_XTERM_OFF): deleted ! ! 2002-11-16 WATANABE Katsuyuki <katsuyuki_1.watanabe@toppan.co.jp> ! ! * [w3m-dev 03433] cygwin console on Win9X ! * configure (config.h): SUPPORT_WIN9X_CONSOLE_MBCS ! * linein.c (inputLineHistSearch): enable_win9x_console_input() ! disable_win9x_console_input() ! * main.c (mouse): cygin_mouse_btn_swapped ! * terms.c (is_xterm): static ! (isLocalConsole): added ! (cygwin_mouse_btn_swapped): added ! (check_win32_console): deleted ! (check_win9x): added ! (init_win32_console_handle): check ttyslot() ! (enable_win9x_console_input): added ! (disable_win9x_console_input): added ! (read_win32_console_input): delete ifdef MOUSE ! (cmp_tv): deleted ! (subtract_tv): deleted ! (GetConsoleHwnd): added ! (cygwin_version): added ! (select_or_poll_win32_console): deleted ! (check_cygwin_console): added ! (select_win32_console): deleted ! (set_tty): check_cygin_console() ! (term_title): SetConsoleTitle() ! (CYGWIN_ON): added ! (CYGIN_OFF): added ! (mouse_init): NEED_CYGWIN_ON ! (mouse_end): NEED_CYGWIN_OFF ! * terms.h (cygwin_mouse_btn_swapped): added ! (enable_win9x_console_input): added ! (disable_win9x_console_input): added ! (NEED_CYGWIN_ON): added ! (NEED_CYGWIN_OFF): added ! ! 2002-11-16 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03432] Re: tab browser ! * display.c (displayBuffer): s/buf->LINES/LASTLINES/ in cygwin ! ! 2002-11-16 Fumitoshi UKAI <ukai@debian.or.jp> ! ! * NEWS: func: DOWNLOAD_LIST ! ! 2002-11-16 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03431] save file by background process ! * file.c (loadGeneralFile): use _doFileCopy() ! (_doFileCopy): renamed from doFileCopy() ! lock ! fork & save ! (doFileSave): lock ! fork & save ! * fm.h (DownloadList): added ! (FirstDL): added ! (LastDL): added ! * form.c (struct internal_action): add download ! * funcname.tab (DOWNLOAD_LIST): added ! * html.h (URLFile): add url ! * main.c (dump_extra): add add_download_list ! (main): add_download_list, ldDL() ! (_quitfm): added ! (quitfm): rewrite with _quitfm() ! (qquitfm): ditto ! (w3m_exit): stopDownload() ! (addDownloadList): added ! (checkDownloadList): added ! (convert_size3): added ! (DownloadListBuffer): added ! (download_action): added ! (stopDownload): added ! (ldDL): added ! * proto.h (ldDL): added ! (convert_size): added ! (convert_size2): added ! (doFileCopy): deleted ! (_doFileCopy): added ! (addDownloadList): added ! (stopDownload): added ! (checkDownloadList): added ! (download_action): added ! * url.c (openURL): save url in uf ! ! 2002-11-15 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03430] disable display of alarm command ! * main.c (SigAlarm): remove display_message_nsec() ! (setAlarm): show sec ! ! 2002-11-15 Fumitoshi UKAI <ukai@debian.or.jp> ! ! * NEWS: env,rc: https_proxy ! ! 2002-11-15 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03429] https proxy ! * fm.h (HTTPS_proxy): added ! (HTTPS_proxy_parsed): added ! * main.c (main): check https_proxy ! * rc.c (CMT_HTTPS_PROXY): added ! (https_proxy): added ! (parse_proxy): HTTPS_proxy ! * url.c (openURL): for HTTPS, use HTTPS_proxy ! (schemeToProxy): HTTPS_proxy_parsed ! ! 2002-11-14 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03428] install manual as w3m.exe.1 on Cygwin ! * XMakefile (MAN1_TARGET): added ! (HELP_TARGET): added ! (install): use MAN1_TARGET, HELP_TARGET ! (uninstall): use MAN1_TARGET, uninstall HELP_TARGET ! ! 2002-11-14 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03427] Re: Select the nearest map area as default. ! * map.c (newMapArea): accept sign chars ! if points is not enough, return as SHAPE_UNKNOWN ! ! 2002-11-14 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03425] charset of title ! * display.c (displayBuffer): buffername converted to system coding ! for term title ! ! 2002-11-14 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03424] Content length ! * file.c (loadGeneralFile): current_content_length before do_download ! (save2tmp): current_content_length move before return ! ! 2002-11-12 Fumitoshi UKAI <ukai@debian.or.jp> ! ! * [w3m-dev 03422] Re: setting form on loading ! * form.c (loadPreForm): initialize name ! check textarea, name for /textarea ! ! 2002-11-12 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03418] Re: tab browser ! * display.c (redrawNLine): s/clrtoeol/clrtoeolx/ ! move rootY ! ! 2002-11-12 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03417] install_w3mimgdisplay ! * configure: define install_w3mimgdisplay ! after use_w3mimg_fb determined ! ! 2002-11-12 Akira TAGOH <at@gclab.org> ! ! * [w3m-dev 03415] fix a build issue for 64bit arch ! * gcmain.c: deleted ! * main.c: no need gcmain.c ! s/MAIN/main/ ! * mktable.c: ditto ! * w3mbookmark.c: ditto ! * w3mhelperpanel.c: ditto ! ! 2002-11-12 Fumitoshi UKAI <ukai@debian.or.jp> ! ! * doc/w3m.1: update ! * doc-jp/w3m.1: update ! * NEWS: update: -show-option ! ! 2002-11-12 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03414] Re: show parameter ! * main.c (fusage): add -show-option ! (MAIN): check -show-option ! ! 2002-11-12 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03413] Re: setting form on loading ! * form.c (loadPreForm): add textarea ! (preFormUpdateBuffer): submit if value is matched as well ! case FORM_TEXTAREA ! case FORM_SELECT ifdef MENU_SELECT ! ! 2002-11-12 Yuji Abe <cbo46560@pop12.odn.ne.jp> ! ! * [w3m-dev 03411] do AUXBIN_TARGETS ! * scripts/Makefile (all): add AUXBIN_TARGETS ! (clean): add AUXBIN_TARGETS ! ! 2002-11-12 AIDA Shinra <aida-s@jcom.home.ne.jp> ! ! * [w3m-dev 03408] edit From in w3mail.cgi ! * scripts/w3mmail.cgi.in: edit from as well ! ! 2002-11-12 AIDA Shinra <aida-s@jcom.home.ne.jp> ! ! * [w3m-dev 03408] fix Bug#87472 ! MOUSE_SCROLL_LINE should be a run-time option ! * fm.h (relative_wheel_scroll): added ! (fixed_wheel_scroll_count): added ! (relative_wheel_scroll_ratio): added ! * main.c (mouse_scroll_line): added ! (process_mouse): s/MOUSE_SCROLL_LINE/mouse_scroll_line()/ ! * menu.c (MOUSE_SCROLL_LINE): deleted ! * terms.h (MOUSE_SCROLL_LINE): deleted ! * rc.c (CMT_RELATIVE_WHEEL_SCROLL): added ! (CMT_RELATIVE_WHEEL_SCROLL_RATIO): added ! (CMT_FIXED_WHEEL_SCROLL_COUNT): added ! (wheelmode): added ! (params3): add relative_wheel_scroll, ! relative_wheel_scroll_ratio, ! fixed_wheel_scroll_count ! * NEWS: updated ! ! 2002-11-12 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03407] char GlobalKeymap -> unsigned char GlobalKeymap ! * fm.h (GlobalKeymap): char->unsigned char ! (EscKeymap): ditto ! (EscBKeymap): ditto ! (EscDKeymap): ditto ! (PcKeymap): ditto ! * keybind.c: ditto ! * keybind_lynx.c: ditto ! ! 2002-11-12 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03406] ! * scripts/Makefile: add AUXBIN_DIR ! update LIB_DIR, HELP_DIR ! xface2xpm installed in AUXBIN_DIR ! * scripts/multipart/Makefile: update LIB_DIR ! * scripts/w3mman/Makefile: update LIB_DIR ! ! 2002-11-12 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03405] Re: tab browser ! * main.c (moveTab): B_FORCE_REDRAW ! ! 2002-11-10 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03401] w3mhelp.cgi ! * proto.h (tabMn): nulcmd ifndef USE_MENU ! * scripts/w3mhelp-funcdesc.en.pl.in: add LINEEDIT:EDITOR ! * scripts/w3mhelp-funcdesc.ja.pl.in: add LINEEDIT:EDITOR ! Tab operation ! * scripts/w3mhelp-funcname.pl.in: add LINEEDIT:EDITOR C-o ! * scripts/w3mhelp.cgi.in: add tabA in Hyperlink operation ! add tabURL, tabrURL in File/Stream operation ! add Tab operation ! add lineedit_editor in Line edit mode ! ! 2002-11-10 NOMIYA Masaru <nomiya@ttmy.ne.jp> ! ! * [w3m-dev 03399] ! * XMakefile: ;; -> ; ! ! 2002-11-10 Fumitoshi UKAI <ukai@debian.or.jp> ! ! * [w3m-dev 03398] auxbindir ! * XMakefile: EXT_TARGETS -> LIB_TARGETS, AUXBIN_TARGETS ! * config.h.dist: add AUXBIN_DIR ! LIB_DIR is cgi-bin ! * configure: add -auxbindir ! add AUXBIN_DIR ! LIB_DIR is cgi-bin ! EXT_TARGETS -> LIB_TARGETS, AUXBIN_TARGETS ! * file.c (compression_decoder): libfile_p -> auxbin_p ! (check_command): libfile_p -> auxbin_p ! use w3m_auxbin_dir() instead of w3m_lib_dir() ! (acceptableEncoding): libfile_p -> auxbin_p ! (xface2xpm): use auxbinFile() instead of libFile() ! (uncompress_stream): libfile_p -> auxbin_p ! use auxbinFile() instead of libFile() ! * image.c (getCharSize): use w3m_auxbin_dir() instead of w3m_lib_dir() ! (openImgdisplay): use w3m_auxbin_dir() instead of w3m_lib_dir() ! * indep.c (w3m_auxbin_dir): added ! * indep.h (w3m_auxbin_dir): added ! * proto.h (auxbinFile): added ! * rc.c (auxbinFile): added ! (libFile): #if 0, no longer used ! (helpFile): used only #ifndef USE_HELP_CGI ! * NEWS: separate auxbindir and libdir (local-CGI, file:///$LIB/) ! ! 2002-11-09 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03396] Re: meta refresh problem ! * main.c (MAIN): AL_IMPLICIT -> alarm_status ! (SigAlarm): AL_IMPLICIT -> alarm_status ! ! 2002-11-09 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03391] use editor when input at last line ! * linein.c (_editor): added ! ! 2002-11-09 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03390] some fixes related with form ! * form.c (input_textarea): goto input_end ! unlink(tmpf); ! * main.c (_followForm): s/TEXT/Password/ ! ! 2002-11-09 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03388] meta refresh problem ! * fm.h (AL_IMPLICIT_DONE): 3->4 ! (AL_ONCE): 8 ! (AL_IMPLICIT_ONCE): (AL_IMPLICIT|AL_ONCE) ! * main.c (MAIN): & AL_IMPLICIT, & AL_IMPLICIT_DONE ! (SigAlarm): & AL_IMPLICIT, & AL_IMPLICIT_DONE, & AL_ONCE ! (setAlaramEvent): & AL_IMPLICIT ! ! 2002-11-09 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03387] Re: tab browser ! * buffer.c (newBuffer): buf->LINES initialize ! (gotoLine): use buf->LINES ! (gotoRealLine): use buf->LINES ! * display.c (displayBuffer): check by buf->LINES ! (redrawNLine): buf->LINES ! (redrawLine): buf->LINES ! (redrawLineImage): no need buf->rootY ! (cursorDown): buf->LINES ! (arrangeCursor): buf->LINES ! * etc.c (columnSkip): buf->LINES ! (lineSkip): buf->LINES ! (currentLineSkip): buf->LINES ! * fm.h (Buffer): add LINES ! * main.c (nscroll): Currentbuf->LINES ! (pgFore): Currentbuf->LINES ! (pgBack): Currentbuf->LINES ! (ctrCsrV): Currentbuf->LINES ! (movD): Currentbuf->LINES ! (movU): Currentbuf->LINES ! (_goLine): Currentbuf->LINES ! (drawAnchorCursor): Currentbuf->LINES ! (setOpt): B_REDRAW_IMAGE ! (newT): B_REDRAW_IMAGE ! (closeT): B_REDRAW_IMAGE ! (nextT): B_REDRAW_IMAGE ! (prevT): B_REDRAW_IMAGE ! (moveTab): B_NORMAL ! ! 2002-11-09 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03386] Re: Interrupt in no_proxy_check() ! * file.c (getAuthCookie): term_cbreak() ! (loadGeneralFile): term_cbreak() ! term_raw() ! preFormUpdateBuffer() before term_raw() ! (loadHTMLstream): term_raw() ! ! 2002-11-07 Katsumi@yamaoka.cc ! ! * [w3m-dev 03385] install-sh typo ! * install-sh: s/'/"/ ! ! 2002-11-07 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03383] Select the nearest map area as default. ! * fm.h (MapArea): add center_x, center_y ! * map.c (nearestMapArea): added ! (follow_map_menu): initial by nearestMapArea() ! (newMapArea): set center_x, center_y ! ! 2002-11-07 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03382] Interrupt in no_proxy_check() ! * url.c (check_no_proxy): SIGINT trap by KeyAbort ! ! 2002-11-06 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03380] fix configure ! * configure: s/INSTALL_W3MIMGDISPLAY/install_w3mimgdisplay/ ! already define ! * config.h.dist (INSTALL_W3MIMGDISPLAY): added ! ! 2002-11-06 Fumitoshi UKAI <ukai@debian.or.jp> ! ! * [w3m-dev 03379] setuid w3mimgdisplay and check console tty ! * XMakefile: w3mimgdisplay install by INSTALL_W3MIMGDISPLAY ! * configure: ask setuid w3mimgdisplay ! (w3mimgdisplay_setuid): added ! (INSTALL_W3MIMGDISPLAY): added ! * etc.c (mySystem): close until FOPEN_MAX ! * image.c (openImgdisplay): setenv W3M_TTY ! stderr to /dev/null ! close until FOPEN_MAX ! * install-sh: -o, -g for owner, group ! * proto.h (ttyname_tty): added ! * search.c (open_migemo): stderr to /dev/null ! close until FOPEN_MAX ! * terms.c (ttyname_tty): added ! * w3mimgdisplay.c: include <sys/types.h>, <unistd.h> ! W3MIMGDISPLAY_SETUID ! stderr to /dev/null ! * w3mimg/w3mimg.c: include <sys/types.h>, <unistd.h> ! W3MIMGDISPLAY_SETUID ! * w3mimg/fb/fb_w3mimg.c (check_tty_console): added ! ! 2002-11-06 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03377] sync_with_option ! * etc.c (loadPassword): reset passwords ! * form.c (loadPreForm): reset PreForm ! * main.c (option_assigned): deleted ! (parse_proxy): deleted ! (MAIN): move initCookie(), setLocalCookie() ! after sync_with_option() ! delete parseURL for *_proxy ! s/WrapSearch/WrapDefault/ ! move initKeymap(), initMenu() after setupscreen() ! sync_with_option() after init_rc() ! * rc.c (pre_form_file): move in params9 (network settting) ! (sync_with_option): initKeymap(), initMenu() is done ! if fmInitialized ! (init_rc): delete sync_with_option() ! ! 2002-11-06 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03375] NULL check of CurrentTab ! * display.c (disp_message_nsec): check CurrentTab ! * file.c (doExternal): check CurrentTab ! * image.c (loadImage): check CurrentTab ! ! 2002-11-06 Fumitoshi UKAI <ukai@debian.or.jp> ! ! * [w3m-dev 03374] disable_secret_security_check ! * etc.c (openSecurityFile): disable_secret_security_check ! * fm.h (disable_secret_security_check): added ! * rc.c (CMT_DISABLE_SECRET_SECURITY_CHECK): added ! (disable_secret_security_check): added ! * NEWS: rc: disable_secret_security_check ! ! 2002-11-06 Fumitoshi UKAI <ukai@debian.or.jp> ! ! * NEWS: update ! ! 2002-11-06 Fumitoshi UKAI <ukai@debian.or.jp> ! ! * rc.c (CMT_PRE_FORM_FILE): added ! (pre_form_file): added ! ! 2002-11-06 Fumitoshi UKAI <ukai@debian.or.jp> ! ! * doc-jp/README.tab: added [w3m-dev 03372] ! * doc/README.tab: brief translation ! ! 2002-11-06 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03372] tab browser ! * display.c (displayBuffer): add ny ! rootY offset by tab ! tab line ! (cursorDown): offset rootY ! (arrangeCursor): offset rootY ! * etc.c (columnSkip): offset rootY ! (lineSkip): offset rootY ! (currentLineSkip): offset rootY ! * file.c (HTMLlineproc2body): ATTR_TARGET ! * fm.h (MapArea): add target ! (Buffer): add rootY ! (TabBuffer): added ! (Currentbuf): comment out ! (Firstbuf): comment out ! (CurrentTab): added ! (FirstTab): added ! (LastTab): added ! (open_tab_blank): added ! (close_tab_back): added ! (nTab): added ! (TabCols): added ! (N_TAB): added ! (Currentbuf): CurrentTab->currentBuffer ! (Firstbuf): CurrentTab->firstBuffer ! * funcname.tab (CLOSE_TAB): added ! (NEW_TAB): added ! (NEXT_TAB): added ! (PREV_TAB): added ! (TAB_GOTO): added ! (TAB_GOTO_RELATIVE): added ! (TAB_LEFT): added ! (TAB_LINK): added ! (TAB_MENU): added ! (TAB_RIGHT): added ! * html.c (ALST_AREA): add ATTR_TARGET ! * image.c (showImageProgress): offset rootY ! * main.c (_newT): added ! (followTab): added ! (moveTab): added ! (check_target): added ! (MAIN): init tab related values ! buf => tab ! (nscroll): offset rootY ! (pgFore): offset rootY ! (pgBack): offset rootY ! (ctrCsrV): offset rootY ! (_movD): offset rootY ! (_movU): offset rootY ! (_goLine): offset rootY ! (_mark): offset rootY ! (followA): check target ! (_followForm): offset rootY ! (drawAnchorCursor0): offset rootY ! (drawAnchorCursor): offset rootY ! (backBf): check close_tab_back ! (follow_map): rewrite for tab, check target ! (posTab): added ! (process_mouse): tab operation ! offset rootY ! (deleteFiles): for all buffers in all tabs ! (newTab): added ! (newT): added ! (numTab): added ! (deleteTab): added ! (closeT): added ! (nextT): added ! (prevT): added ! (followTab): added ! (tabA): added ! (tabURL0): added ! (tabURL): added ! (tabrURL): added ! (moveTab): added ! (tabR): added ! (tabL): added ! * map.c (follow_map_menu): return MapArea ! (newMapArea): add target args ! * menu.c (SelTabMenu): added ! (SelTabV): added ! (initSelTabMenu): added ! (smChTab): added ! (smDelTab): added ! (MainMenuItem): add Select Tab ! on New Tab ! (popupMenu): add initSelTabMenu() ! offset rootY ! (mainMn): offset rootY ! (selMn): offset rootY ! (initSelectMenu): offset rootY ! (tabMn): added ! * proto.h (newT): added ! (closeT): added ! (nextT): added ! (prevT): added ! (tabA): added ! (tabURL): added ! (tabrURL): added ! (tabR): added ! (tabL): added ! (newTab): added ! (deleteTab): added ! (follow_map_menu): return MapArea ! (newMapArea): add target arg ! (tabMn): added ! * rc.c (CMT_OPEN_TAB_BLANK): added ! (CMT_CLOSE_TAB_BACK): added ! (open_tab_blank): added ! (close_tab_back): added ! * doc/README.func (CLOSE_TAB): added ! (NEW_TAB): added ! (NEXT_TAB): added ! (PREV_TAB): added ! (TAB_GOTO): added ! (TAB_GOTO_RELATIVE): added ! (TAB_LEFT): added ! (TAB_LINK): added ! (TAB_MENU): added ! (TAB_RIGHT): added ! * doc-jp/README.func: ditto doc/README.func ! ! 2002-11-06 Fumitoshi UKAI <ukai@debian.or.jp> ! ! * doc-jp/README.pre_form: added [w3m-dev 03373] ! * doc/README.pre_form: brief translation ! ! 2002-11-06 Fumitoshi UKAI <ukai@debian.or.jp> ! ! * etc.c (PASS_IS_READABLE_MSG): deleted ! (FILE_IS_READABLE_MSG): added ! (openPasswdFile): deleted ! (openSecretFile): delete error_msg arg ! (loadPasswd): use openSecretFile() ! * form.c (next_token): delete unused static decl ! (FILE_IS_READABLE_MSG): deleted ! (loadPreForm): no need pass error_msg ! * proto.h (openSecretFile): delete error_msg arg ! ! 2002-11-06 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> ! ! * [w3m-dev 03373] setting form on loading ! * config.h.dist (PRE_FORM_FILE): added ! * configure (PRE_FORM_FILE): added ! * etc.c (openPasswdFile): define by openSecretFile() ! (openSecretFile): renamed, not static ! * file.c (loadGeneralFile): preFOrmUpdateBuffer() ! * fm.h (Buffer): add submit ! (pre_form_file): added ! * form.c (struct pre_form_item): added ! (struct pre_form): added ! (next_token): added ! (PreForm): added ! (add_pre_form): added ! (add_pre_form_item): added ! (loadPreForm): added ! (preFormUpdateBuffer): added ! * frame.c (renderFrame): add preFormUpdateBuffer() ! * main.c (MAIN): buf->submit check ! * proto.h (preFormUpdateBuffer): added ! (openSecretFile): added ! (loadPreForm): added ! * rc.c (sync_with_option): add loadPreForm() ! ! 2002-11-06 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> * [w3m-dev 03371] segmentation fault by large complex table. * table.c (bsearch_2short): indexarry char to short (bsearch_double): ditto *************** *** 53,58 **** --- 3024,3033 ---- * doc-jp/README: ditto * NEWS: update + 2002-11-05 Fumitoshi UKAI <ukai@debian.or.jp> + + * scripts/w3mhelp.cgi.in: add chkWORD + 2002-11-04 Fumitoshi UKAI <ukai@debian.or.jp> * [w3m-dev-en 00827] Re: w3m-cvs segfaults on news://<mid> URLs *************** *** 4148,4151 **** * release-0-2-1 * import w3m-0.2.1 ! $Id: ChangeLog,v 1.467.4.7 2002/12/05 16:53:19 ukai Exp $ --- 7123,7126 ---- * release-0-2-1 * import w3m-0.2.1 ! $Id: ChangeLog,v 1.743 2003/02/07 15:06:15 ukai Exp $ diff -crN -x CVS w3m-0.3.2.2/NEWS w3m-js-1.743/NEWS *** w3m-0.3.2.2/NEWS 2002-12-06 01:48:31.000000000 +0900 --- w3m-js-1.743/NEWS 2003-02-06 02:23:01.000000000 +0900 *************** *** 1,7 **** --- 1,53 ---- + w3m 0.4? + + * rc: decode_url + * func: RESHAPE + * rc: fold_line + * local cookie: passed via file named $LOCAL_COOKIE or posted not in url query + * func: SEARCH can take arg + * URL data: support + * URL news:, nntp: newsgroup support + * rc: nntpserver, nntpmode, max_news + * rc: graphic_char + * rc: use_proxy + * rc: preserve_timestamp + * func: REDO, UNDO + * func: LIST, LIST_MENU, MOVE_LIST_MENU + * func: ACCESSKEY, LINK_MENU + * rc: display_ins_del + * 2 stroke keybinding + * func: MULTIMAP + * func: CLOSE_TAB_MOUSE, MENU_MOUSE, MOVE_MOUSE, TAB_MOUSE + * options: -N + * func: NEXT, PREV + * rc: image_map_list + * rc: open_tab_dl_list + * func: DOWNLOAD_LIST + * env: https_proxy + * rc: https_proxy + * options: -show-option + * rc: relative_wheel_scroll + * rc: relative_wheel_scroll_ratio + * rc: fixed_wheel_scroll_count + * separate auxbindir and libdir (local-CGI, file:///$LIB/) + * configure: -auxbindir + * rc: disable_secret_security_check (for windows?) + * tab browsing + * rc: open_tab_blank, close_tab_back + * func: CLOSE_TAB, NEW_TAB, NEXT_TAB, PREV_TAB, + * func: TAB_GOTO, TAB_GOTO_RELATIVE + * func: TAB_LEFT, TAB_LINK, TAB_MENU, TAB_RIGHT + * pre_form: ~/.w3m/pre_form + * rc: pre_form_file: pre_form configuration file + + ---------------------------------------------------------------- + w3m 0.3.2.2 - 2002-12-06 * security fix: html_quote for img alt attributes + ---------------------------------------------------------------- + w3m 0.3.2.1 - 2002-11-27 * security fix: html_quote for frame contents *************** *** 9,14 **** --- 55,61 ---- - fix segmentation fault by large complex table. [w3m-dev 03371][w3m-dev 03438] + ---------------------------------------------------------------- w3m 0.3.2 - 2002-11-05 * ~/.netrc: password for ftp diff -crN -x CVS w3m-0.3.2.2/Str.c w3m-js-1.743/Str.c *** w3m-0.3.2.2/Str.c 2001-12-22 06:37:12.000000000 +0900 --- w3m-js-1.743/Str.c 2002-12-25 02:26:32.000000000 +0900 *************** *** 1,4 **** ! /* $Id: Str.c,v 1.7 2001/12/21 21:37:12 ukai Exp $ */ /* * String manipulation library for Boehm GC * --- 1,4 ---- ! /* $Id: Str.c,v 1.8 2002/12/24 17:20:46 ukai Exp $ */ /* * String manipulation library for Boehm GC * *************** *** 262,268 **** int i; STR_LENGTH_CHECK(s); for (i = 0; i < s->length; i++) ! s->ptr[i] = tolower(s->ptr[i]); } void --- 262,268 ---- int i; STR_LENGTH_CHECK(s); for (i = 0; i < s->length; i++) ! s->ptr[i] = TOLOWER(s->ptr[i]); } void *************** *** 271,277 **** int i; STR_LENGTH_CHECK(s); for (i = 0; i < s->length; i++) ! s->ptr[i] = toupper(s->ptr[i]); } void --- 271,277 ---- int i; STR_LENGTH_CHECK(s); for (i = 0; i < s->length; i++) ! s->ptr[i] = TOUPPER(s->ptr[i]); } void diff -crN -x CVS w3m-0.3.2.2/Str.h w3m-js-1.743/Str.h *** w3m-0.3.2.2/Str.h 2001-11-24 11:01:26.000000000 +0900 --- w3m-js-1.743/Str.h 2003-01-21 22:18:19.000000000 +0900 *************** *** 1,4 **** ! /* $Id: Str.h,v 1.4 2001/11/24 02:01:26 ukai Exp $ */ /* * String manipulation library for Boehm GC * --- 1,4 ---- ! /* $Id: Str.h,v 1.5 2003/01/20 15:30:19 ukai Exp $ */ /* * String manipulation library for Boehm GC * *************** *** 70,83 **** #define Strcmp(x,y) strcmp((x)->ptr,(y)->ptr) #define Strcmp_charp(x,y) strcmp((x)->ptr,(y)) #define Strncmp(x,y,n) strncmp((x)->ptr,(y)->ptr,(n)) ! #define Strncmp_charp(x,y,n) strncmp((x)->ptr,y,(n)) #define Strcasecmp(x,y) strcasecmp((x)->ptr,(y)->ptr) #define Strcasecmp_charp(x,y) strcasecmp((x)->ptr,(y)) #define Strncasecmp(x,y,n) strncasecmp((x)->ptr,(y)->ptr,(n)) ! #define Strncasecmp_charp(x,y,n) strncasecmp((x)->ptr,y,(n)) #define Strlastchar(s) ((s)->length>0?(s)->ptr[(s)->length-1]:'\0') ! #define Strinsert(s,n,p) Strinsert_charp(s,n,(p)->ptr) ! #define Strshrinkfirst(s,n) Strdelete(s,0,n) #define Strfputs(s,f) fwrite((s)->ptr,1,(s)->length,(f)) #endif /* not GC_STR_H */ --- 70,83 ---- #define Strcmp(x,y) strcmp((x)->ptr,(y)->ptr) #define Strcmp_charp(x,y) strcmp((x)->ptr,(y)) #define Strncmp(x,y,n) strncmp((x)->ptr,(y)->ptr,(n)) ! #define Strncmp_charp(x,y,n) strncmp((x)->ptr,(y),(n)) #define Strcasecmp(x,y) strcasecmp((x)->ptr,(y)->ptr) #define Strcasecmp_charp(x,y) strcasecmp((x)->ptr,(y)) #define Strncasecmp(x,y,n) strncasecmp((x)->ptr,(y)->ptr,(n)) ! #define Strncasecmp_charp(x,y,n) strncasecmp((x)->ptr,(y),(n)) #define Strlastchar(s) ((s)->length>0?(s)->ptr[(s)->length-1]:'\0') ! #define Strinsert(s,n,p) Strinsert_charp((s),(n),(p)->ptr) ! #define Strshrinkfirst(s,n) Strdelete((s),0,(n)) #define Strfputs(s,f) fwrite((s)->ptr,1,(s)->length,(f)) #endif /* not GC_STR_H */ diff -crN -x CVS w3m-0.3.2.2/TODO w3m-js-1.743/TODO *** w3m-0.3.2.2/TODO 1970-01-01 09:00:00.000000000 +0900 --- w3m-js-1.743/TODO 2003-02-06 02:23:03.000000000 +0900 *************** *** 0 **** --- 1,71 ---- + TODO lists + + Documentation + + new features + * Keep alive + * incremental display, background download + [w3m-dev 03389] background download + * bookmark editor + [w3m-dev 03394] bookmark editor + * w3mimgdisplay without X + [w3m-dev 03723] Re: w3mimgdisplayfb (independent of X) + http://homepage3.nifty.com/slokar/fb/w3mimgfb-0.6.tar.gz + http://homepage3.nifty.com/slokar/stimg/stimg-0.0.0.tar.gz + * Internationalized Domain Name support + [w3m-dev 03727] Re: IDN support (test) + idnkit (http://www.nic.ad.jp/ja/idn/) 、ネ iconv 、ャノャヘラ、ヌ、ケ。」 + + * SMB + * merge m17n + * JavaScript + + cleanups + * autoconfisicate + * code review, cleanup + + bugs + * fix [w3m-dev 02658] problem when form is reset + http://mi.med.tohoku.ac.jp/~satodai/w3m-dev/200112.month/2658.html + + * wishlist? [w3m-dev 03507] save space in JP chars + + [sf.net] http://sf.net/projects/w3m + + [bugs] http://bugs.debian.org/w3m + + * parsing bug: omitting </p> should not matter, but it does + http://bugs.debian.org/115521 + + * MOUSE_SCROLL_LINE should be a run-time option + http://bugs.debian.org/87472 + + * support for the <button> tag (HTML 4.01) + http://bugs.debian.org/136810 + + * not working 'Ignore case when search' on non latin pages + http://bugs.debian.org/138891 + => after m17n merge + + * w3m: Unable to use mozilla bugzilla + http://bugs.debian.org/170506 + => [w3m-dev 03469]? + backport from w3m-js? + + fixed? + * would like "forward to next buffer" + http://bugs.debian.org/51771 + => tab browse? + + * alt attributes in area elements are ignored + http://bugs.debian.org/81555 + => fixed in w3m 0.3? + + wontfix / impossible to fix + * w3m -dump generates too long lines + http://bugs.debian.org/149288 + + wishlist? + * w3mman -l doesn't work + http://bugs.debian.org/138805 + diff -crN -x CVS w3m-0.3.2.2/XMakefile w3m-js-1.743/XMakefile *** w3m-0.3.2.2/XMakefile 2002-10-29 02:09:18.000000000 +0900 --- w3m-js-1.743/XMakefile 2003-02-08 02:38:49.000000000 +0900 *************** *** 1,14 **** ! # $Id: XMakefile,v 1.29 2002/10/28 17:09:18 ukai Exp $ SRCS=main.c file.c buffer.c display.c etc.c search.c linein.c table.c local.c \ form.c map.c frame.c rc.c menu.c mailcap.c image.c\ ! func.c cookie.c history.c backend.c $(KEYBIND_SRC) OBJS=main.o file.o buffer.o display.o etc.o search.o linein.o table.o local.o\ form.o map.o frame.o rc.o menu.o mailcap.o image.o\ ! func.o cookie.o history.o backend.o $(KEYBIND_OBJ) LSRCS=terms.c conv.c url.c ftp.c anchor.c mimehead.c parsetagx.c\ ! tagtable.c istream.c LOBJS=terms.o conv.o url.o ftp.o anchor.o mimehead.o parsetagx.o\ ! tagtable.o istream.o LLOBJS=version.o ALIBOBJS=Str.o indep.o regex.o textlist.o parsetag.o myctype.o entity.o hash.o ALIB=libindep.a --- 1,16 ---- ! # $Id: XMakefile,v 1.34 2002/12/27 16:07:44 ukai Exp $ SRCS=main.c file.c buffer.c display.c etc.c search.c linein.c table.c local.c \ form.c map.c frame.c rc.c menu.c mailcap.c image.c\ ! func.c cookie.c history.c backend.c $(KEYBIND_SRC)\ ! script.c js_html.c OBJS=main.o file.o buffer.o display.o etc.o search.o linein.o table.o local.o\ form.o map.o frame.o rc.o menu.o mailcap.o image.o\ ! func.o cookie.o history.o backend.o $(KEYBIND_OBJ)\ ! script.o js_html.o LSRCS=terms.c conv.c url.c ftp.c anchor.c mimehead.c parsetagx.c\ ! tagtable.c istream.c news.c LOBJS=terms.o conv.o url.o ftp.o anchor.o mimehead.o parsetagx.o\ ! tagtable.o istream.o news.o LLOBJS=version.o ALIBOBJS=Str.o indep.o regex.o textlist.o parsetag.o myctype.o entity.o hash.o ALIB=libindep.a *************** *** 19,27 **** HELPER=w3mhelperpanel$(EXT) INFLATE=inflate$(EXT) IMGDISPLAY=w3mimgdisplay$(EXT) MAN1=doc/w3m.1 MAN1_JA=doc-jp/w3m.1 ! TARGETS=$(TARGET) $(EXT_TARGETS) HELP_ALLFILES=w3mhelp-w3m_en.html w3mhelp-w3m_ja.html \ w3mhelp-lynx_en.html w3mhelp-lynx_ja.html --- 21,31 ---- HELPER=w3mhelperpanel$(EXT) INFLATE=inflate$(EXT) IMGDISPLAY=w3mimgdisplay$(EXT) + MAN1_TARGET=w3m.1 MAN1=doc/w3m.1 MAN1_JA=doc-jp/w3m.1 ! TARGETS=$(TARGET) $(LIB_TARGETS) $(AUXBIN_TARGETS) ! HELP_TARGET=w3mhelp.html HELP_ALLFILES=w3mhelp-w3m_en.html w3mhelp-w3m_ja.html \ w3mhelp-lynx_en.html w3mhelp-lynx_ja.html *************** *** 121,139 **** install-core: $(TARGETS) -$(MKDIR) $(DESTDIR)$(BIN_DIR) -$(MKDIR) $(DESTDIR)$(LIB_DIR) -$(MKDIR) $(DESTDIR)$(HELP_DIR) -$(MKDIR) $(DESTDIR)$(MAN1_DIR) -$(MKDIR) $(DESTDIR)$(MAN1_JA_DIR) $(INSTALL_PROGRAM) $(TARGET) $(DESTDIR)$(BIN_DIR)/$(TARGET) ! $(INSTALL_DATA) $(HELP_FILE) $(DESTDIR)$(HELP_DIR)/w3mhelp.html ! $(INSTALL_DATA) $(MAN1) $(DESTDIR)$(MAN1_DIR)/$(TARGET).1 ! $(INSTALL_DATA) $(MAN1_JA) $(DESTDIR)$(MAN1_JA_DIR)/$(TARGET).1 ! for file in $(EXT_TARGETS); \ do \ $(INSTALL_PROGRAM) $$file $(DESTDIR)$(LIB_DIR)/$$file; \ done install-helpfile: -$(MKDIR) $(DESTDIR)$(HELP_DIR) for file in $(HELP_ALLFILES); \ --- 125,152 ---- install-core: $(TARGETS) -$(MKDIR) $(DESTDIR)$(BIN_DIR) + -$(MKDIR) $(DESTDIR)$(AUXBIN_DIR) -$(MKDIR) $(DESTDIR)$(LIB_DIR) -$(MKDIR) $(DESTDIR)$(HELP_DIR) -$(MKDIR) $(DESTDIR)$(MAN1_DIR) -$(MKDIR) $(DESTDIR)$(MAN1_JA_DIR) $(INSTALL_PROGRAM) $(TARGET) $(DESTDIR)$(BIN_DIR)/$(TARGET) ! $(INSTALL_DATA) $(HELP_FILE) $(DESTDIR)$(HELP_DIR)/$(HELP_TARGET) ! $(INSTALL_DATA) $(MAN1) $(DESTDIR)$(MAN1_DIR)/$(MAN1_TARGET) ! $(INSTALL_DATA) $(MAN1_JA) $(DESTDIR)$(MAN1_JA_DIR)/$(MAN1_TARGET) ! for file in $(AUXBIN_TARGETS); \ ! do \ ! case $$file in \ ! $(IMGDISPLAY)) $(INSTALL_W3MIMGDISPLAY) $$file $(DESTDIR)$(AUXBIN_DIR)/$$file;; \ ! *) $(INSTALL_PROGRAM) $$file $(DESTDIR)$(AUXBIN_DIR)/$$file;; \ ! esac; \ ! done ! for file in $(LIB_TARGETS); \ do \ $(INSTALL_PROGRAM) $$file $(DESTDIR)$(LIB_DIR)/$$file; \ done + install-helpfile: -$(MKDIR) $(DESTDIR)$(HELP_DIR) for file in $(HELP_ALLFILES); \ *************** *** 144,162 **** all-scripts: for dir in $(SCRIPTSUBDIRS); \ do \ ! (cd $$dir; $(MAKE) PERL='$(PERL)' BIN_DIR='$(BIN_DIR)' LIB_DIR='$(LIB_DIR)' HELP_DIR='$(HELP_DIR)' RC_DIR='$(RC_DIR)' KEYBIND_SRC='$(KEYBIND_SRC)'); \ done install-scripts: all-scripts topdir=`pwd`; \ for dir in $(SCRIPTSUBDIRS); \ do \ ! (cd $$dir; $(MAKE) PERL='$(PERL)' MKDIR='$(MKDIR)' BIN_DIR='$(BIN_DIR)' LIB_DIR='$(LIB_DIR)' HELP_DIR='$(HELP_DIR)' MAN_DIR='$(MAN_DIR)' DESTDIR='$(DESTDIR)' INSTALL="sh $$topdir/install-sh" install); \ done uninstall: -rm -f $(BIN_DIR)/$(TARGET) ! -for file in $(EXT_TARGETS); \ do \ rm -f $(LIB_DIR)/$$file; \ done --- 157,179 ---- all-scripts: for dir in $(SCRIPTSUBDIRS); \ do \ ! (cd $$dir; $(MAKE) PERL='$(PERL)' BIN_DIR='$(BIN_DIR)' AUXBIN_DIR='$(AUXBIN_DIR)' LIB_DIR='$(LIB_DIR)' HELP_DIR='$(HELP_DIR)' RC_DIR='$(RC_DIR)' KEYBIND_SRC='$(KEYBIND_SRC)'); \ done install-scripts: all-scripts topdir=`pwd`; \ for dir in $(SCRIPTSUBDIRS); \ do \ ! (cd $$dir; $(MAKE) PERL='$(PERL)' MKDIR='$(MKDIR)' BIN_DIR='$(BIN_DIR)' AUXBIN_DIR='$(AUXBIN_DIR)' LIB_DIR='$(LIB_DIR)' HELP_DIR='$(HELP_DIR)' MAN_DIR='$(MAN_DIR)' DESTDIR='$(DESTDIR)' INSTALL="sh $$topdir/install-sh" install); \ done uninstall: -rm -f $(BIN_DIR)/$(TARGET) ! -for file in $(AUXBIN_TARGETS); \ ! do \ ! rm -f $(AUXBIN_DIR)/$$file; \ ! done ! -for file in $(LIB_TARGETS); \ do \ rm -f $(LIB_DIR)/$$file; \ done *************** *** 164,171 **** do \ rm -f $(HELP_DIR)/$$file; \ done ! -rm -f $(MAN1_DIR)/$(TARGET).1 ! -rm -f $(MAN1_JA_DIR)/$(TARGET).1 -for dir in $(SCRIPTSUBDIRS); \ do \ (cd $$dir; $(MAKE) BIN_DIR='$(BIN_DIR)' LIB_DIR='$(LIB_DIR)' HELP_DIR='$(HELP_DIR)' MAN_DIR='$(MAN_DIR)' uninstall); \ --- 181,189 ---- do \ rm -f $(HELP_DIR)/$$file; \ done ! -rm -f $(HELP_DIR)/$(HELP_TARGET) ! -rm -f $(MAN1_DIR)/$(MAN1_TARGET) ! -rm -f $(MAN1_JA_DIR)/$(MAN1_TARGET) -for dir in $(SCRIPTSUBDIRS); \ do \ (cd $$dir; $(MAKE) BIN_DIR='$(BIN_DIR)' LIB_DIR='$(LIB_DIR)' HELP_DIR='$(HELP_DIR)' MAN_DIR='$(MAN_DIR)' uninstall); \ diff -crN -x CVS w3m-0.3.2.2/anchor.c w3m-js-1.743/anchor.c *** w3m-0.3.2.2/anchor.c 2002-09-06 00:43:21.000000000 +0900 --- w3m-js-1.743/anchor.c 2003-02-06 02:23:05.000000000 +0900 *************** *** 1,4 **** ! /* $Id: anchor.c,v 1.11 2002/09/05 15:43:21 ukai Exp $ */ #include "fm.h" #include "myctype.h" #include "regex.h" --- 1,4 ---- ! /* $Id: anchor.c,v 1.24 2003/02/05 16:45:07 ukai Exp $ */ #include "fm.h" #include "myctype.h" #include "regex.h" *************** *** 7,13 **** AnchorList * putAnchor(AnchorList *al, char *url, char *target, Anchor **anchor_return, ! char *referer, int line, int pos) { int n, i, j; Anchor *a; --- 7,13 ---- AnchorList * putAnchor(AnchorList *al, char *url, char *target, Anchor **anchor_return, ! char *referer, char *title, unsigned char key, int line, int pos) { int n, i, j; Anchor *a; *************** *** 44,49 **** --- 44,52 ---- a->url = url; a->target = target; a->referer = referer; + a->title = title; + a->accesskey = key; + a->slave = FALSE; a->start = bp; a->end = bp; al->nanchor++; *************** *** 54,64 **** Anchor * ! registerHref(Buffer *buf, char *url, char *target, char *referer, int line, ! int pos) { Anchor *a; ! buf->href = putAnchor(buf->href, url, target, &a, referer, line, pos); return a; } --- 57,68 ---- Anchor * ! registerHref(Buffer *buf, char *url, char *target, char *referer, char *title, ! unsigned char key, int line, int pos) { Anchor *a; ! buf->href = putAnchor(buf->href, url, target, &a, referer, title, key, ! line, pos); return a; } *************** *** 66,80 **** registerName(Buffer *buf, char *url, int line, int pos) { Anchor *a; ! buf->name = putAnchor(buf->name, url, NULL, &a, NULL, line, pos); return a; } Anchor * ! registerImg(Buffer *buf, char *url, int line, int pos) { Anchor *a; ! buf->img = putAnchor(buf->img, url, NULL, &a, NULL, line, pos); return a; } --- 70,86 ---- registerName(Buffer *buf, char *url, int line, int pos) { Anchor *a; ! buf->name = putAnchor(buf->name, url, NULL, &a, NULL, NULL, '\0', line, ! pos); return a; } Anchor * ! registerImg(Buffer *buf, char *url, char *title, int line, int pos) { Anchor *a; ! buf->img = putAnchor(buf->img, url, NULL, &a, NULL, title, '\0', line, ! pos); return a; } *************** *** 88,95 **** fi = formList_addInput(flist, tag); if (fi == NULL) return NULL; ! buf->formitem = putAnchor(buf->formitem, ! (char *)fi, flist->target, &a, NULL, line, pos); return a; } --- 94,101 ---- fi = formList_addInput(flist, tag); if (fi == NULL) return NULL; ! buf->formitem = putAnchor(buf->formitem, (char *)fi, flist->target, &a, ! NULL, NULL, '\0', line, pos); return a; } *************** *** 187,207 **** { Str tmp; ! p1++; ! if (*(p2 - 1) == '>') ! p2--; ! tmp = Strnew_size(sizeof("news:") - 1 + (p2 - p1)); ! Strcat_charp_n(tmp, "news:", sizeof("news:") - 1); ! Strcat_charp_n(tmp, p1, p2 - p1); ! return registerHref(buf, tmp->ptr, NULL, NO_REFERER, line, pos); } #endif /* USE_NNTP */ static Anchor * _put_anchor_all(Buffer *buf, char *p1, char *p2, int line, int pos) { ! return registerHref(buf, allocStr(p1, p2 - p1), NULL, NO_REFERER, line, ! pos); } static void --- 193,218 ---- { Str tmp; ! if (*p1 == '<') { ! p1++; ! if (*(p2 - 1) == '>') ! p2--; ! } ! tmp = conv_str(Strnew_charp_n(p1, p2 - p1), InnerCode, buf->document_code); ! tmp = Sprintf("news:%s", file_quote(tmp->ptr)); ! return registerHref(buf, tmp->ptr, NULL, NO_REFERER, NULL, '\0', line, ! pos); } #endif /* USE_NNTP */ static Anchor * _put_anchor_all(Buffer *buf, char *p1, char *p2, int line, int pos) { ! Str tmp; ! ! tmp = conv_str(Strnew_charp_n(p1, p2 - p1), InnerCode, buf->document_code); ! return registerHref(buf, url_quote(tmp->ptr), NULL, NO_REFERER, NULL, ! '\0', line, pos); } static void *************** *** 283,289 **** { Anchor *a; int spos, epos; ! int i; spos = p1 - l->lineBuf; epos = p2 - l->lineBuf; --- 294,300 ---- { Anchor *a; int spos, epos; ! int i, hseq = -2; spos = p1 - l->lineBuf; epos = p2 - l->lineBuf; *************** *** 291,302 **** if (l->propBuf[i] & (PE_ANCHOR | PE_FORM)) return p2; } ! a = anchorproc(buf, p1, p2, l->linenumber, p1 - l->lineBuf); ! a->end.line = l->linenumber; ! a->end.pos = epos; ! a->hseq = -2; ! for (i = a->start.pos; i < a->end.pos; i++) l->propBuf[i] |= PE_ANCHOR; return p2; } --- 302,328 ---- if (l->propBuf[i] & (PE_ANCHOR | PE_FORM)) return p2; } ! for (i = spos; i < epos; i++) l->propBuf[i] |= PE_ANCHOR; + while (1) { + a = anchorproc(buf, p1, p2, l->linenumber, spos); + a->hseq = hseq; + if (hseq == -2) { + reseq_anchor(buf); + hseq = a->hseq; + } + a->end.line = l->linenumber; + if (epos > l->len) { + a->end.pos = l->len; + spos = 0; + epos -= l->len; + l = l->next; + } + else { + a->end.pos = epos; + break; + } + } return p2; } *************** *** 304,310 **** reAnchorWord(Buffer *buf, Line *l, int spos, int epos) { reAnchorPos(buf, l, &l->lineBuf[spos], &l->lineBuf[epos], _put_anchor_all); - reseq_anchor(buf); } /* search regexp and register them as anchors */ --- 330,335 ---- *************** *** 314,320 **** Anchor *(*anchorproc) (Buffer *, char *, char *, int, int)) { Line *l; ! char *p, *p1, *p2; if (re == NULL || *re == '\0') { return NULL; --- 339,345 ---- Anchor *(*anchorproc) (Buffer *, char *, char *, int, int)) { Line *l; ! char *p = NULL, *p1, *p2; if (re == NULL || *re == '\0') { return NULL; *************** *** 325,333 **** for (l = MarkAllPages ? buf->firstLine : buf->topLine; l != NULL && (MarkAllPages || l->linenumber < buf->topLine->linenumber + LASTLINE); l = l->next) { p = l->lineBuf; for (;;) { ! if (regexMatch(p, &l->lineBuf[l->len] - p, p == l->lineBuf) == 1) { matchedPosition(&p1, &p2); p = reAnchorPos(buf, l, p1, p2, anchorproc); } --- 350,360 ---- for (l = MarkAllPages ? buf->firstLine : buf->topLine; l != NULL && (MarkAllPages || l->linenumber < buf->topLine->linenumber + LASTLINE); l = l->next) { + if (p && l->bpos) + continue; p = l->lineBuf; for (;;) { ! if (regexMatch(p, &l->lineBuf[l->size] - p, p == l->lineBuf) == 1) { matchedPosition(&p1, &p2); p = reAnchorPos(buf, l, p1, p2, anchorproc); } *************** *** 335,341 **** break; } } - reseq_anchor(buf); return NULL; } --- 362,367 ---- *************** *** 351,356 **** --- 377,439 ---- { return reAnchorAny(buf, re, _put_anchor_news); } + + char * + reAnchorNewsheader(Buffer *buf) + { + Line *l; + char *p, *p1, *p2; + static char *header_mid[] = { + "Message-Id:", "References:", "In-Reply-To:", NULL + }; + static char *header_group[] = { + "Newsgroups:", NULL + }; + char **header, **q; + int i, search = FALSE; + + if (!buf || !buf->firstLine) + return NULL; + for (i = 0; i <= 1; i++) { + if (i == 0) { + regexCompile("<[!-;=?-~]+@[a-zA-Z0-9\\.\\-_]+>", 1); + header = header_mid; + } + else { + regexCompile("[a-zA-Z0-9\\.\\-_]+", 1); + header = header_group; + } + for (l = buf->firstLine; l != NULL && l->real_linenumber == 0; + l = l->next) { + if (l->bpos) + continue; + p = l->lineBuf; + if (!IS_SPACE(*p)) { + search = FALSE; + for (q = header; *q; q++) { + if (!strncasecmp(p, *q, strlen(*q))) { + search = TRUE; + p = strchr(p, ':') + 1; + break; + } + } + } + if (!search) + continue; + for (;;) { + if (regexMatch(p, &l->lineBuf[l->size] - p, p == l->lineBuf) + == 1) { + matchedPosition(&p1, &p2); + p = reAnchorPos(buf, l, p1, p2, _put_anchor_news); + } + else + break; + } + } + } + reseq_anchor(buf); + return NULL; + } #endif /* USE_NNTP */ #define FIRST_MARKER_SIZE 30 *************** *** 471,493 **** if (a_img.start.line == l->linenumber) continue; pos = columnPos(l, col); ! a = registerImg(buf, a_img.url, l->linenumber, pos); a->hseq = -a_img.hseq; a->image = img; a->end.pos = pos + ecol - col; for (k = pos; k < a->end.pos; k++) l->propBuf[k] |= PE_IMAGE; if (a_href.url) { a = registerHref(buf, a_href.url, a_href.target, ! a_href.referer, l->linenumber, pos); a->hseq = a_href.hseq; a->end.pos = pos + ecol - col; for (k = pos; k < a->end.pos; k++) l->propBuf[k] |= PE_ANCHOR; } if (a_form.url) { buf->formitem = putAnchor(buf->formitem, a_form.url, ! a_form.target, &a, NULL, l->linenumber, pos); a->hseq = a_form.hseq; a->end.pos = pos + ecol - col; --- 554,579 ---- if (a_img.start.line == l->linenumber) continue; pos = columnPos(l, col); ! a = registerImg(buf, a_img.url, a_img.title, l->linenumber, pos); a->hseq = -a_img.hseq; + a->slave = TRUE; a->image = img; a->end.pos = pos + ecol - col; for (k = pos; k < a->end.pos; k++) l->propBuf[k] |= PE_IMAGE; if (a_href.url) { a = registerHref(buf, a_href.url, a_href.target, ! a_href.referer, a_href.title, ! a_href.accesskey, l->linenumber, pos); a->hseq = a_href.hseq; + a->slave = TRUE; a->end.pos = pos + ecol - col; for (k = pos; k < a->end.pos; k++) l->propBuf[k] |= PE_ANCHOR; } if (a_form.url) { buf->formitem = putAnchor(buf->formitem, a_form.url, ! a_form.target, &a, NULL, NULL, '\0', l->linenumber, pos); a->hseq = a_form.hseq; a->end.pos = pos + ecol - col; *************** *** 542,549 **** if (a_form.start.line == l->linenumber) continue; buf->formitem = putAnchor(buf->formitem, a_form.url, ! a_form.target, &a, NULL, l->linenumber, ! pos); a->hseq = a_form.hseq; a->y = a_form.y; a->end.pos = pos + ecol - col; --- 628,635 ---- if (a_form.start.line == l->linenumber) continue; buf->formitem = putAnchor(buf->formitem, a_form.url, ! a_form.target, &a, NULL, NULL, '\0', ! l->linenumber, pos); a->hseq = a_form.hseq; a->y = a_form.y; a->end.pos = pos + ecol - col; *************** *** 554,556 **** --- 640,812 ---- } } } + + char * + getAnchorText(Buffer *buf, AnchorList *al, Anchor *a) + { + int hseq, i; + Line *l; + Str tmp = NULL; + char *p, *ep; + + if (!a || a->hseq < 0) + return NULL; + hseq = a->hseq; + l = buf->firstLine; + for (i = 0; i < al->nanchor; i++) { + a = &al->anchors[i]; + if (a->hseq != hseq) + continue; + for (; l; l = l->next) { + if (l->linenumber == a->start.line) + break; + } + if (!l) + break; + p = l->lineBuf + a->start.pos; + ep = l->lineBuf + a->end.pos; + for (; p < ep && IS_SPACE(*p); p++) ; + if (p == ep) + continue; + if (!tmp) + tmp = Strnew_size(ep - p); + else + Strcat_char(tmp, ' '); + Strcat_charp_n(tmp, p, ep - p); + } + return tmp ? tmp->ptr : NULL; + } + + Buffer * + link_list_panel(Buffer *buf) + { + LinkList *l; + AnchorList *al; + Anchor *a; + FormItemList *fi; + int i; + char *t, *u, *p; + ParsedURL pu; + Str tmp = Strnew_charp("<title>Link List\ +

Link List

\n"); + + if (buf->bufferprop & BP_INTERNAL || + (buf->linklist == NULL && buf->href == NULL && buf->img == NULL)) { + return NULL; + } + + if (buf->linklist) { + Strcat_charp(tmp, "

Links

\n
    \n"); + for (l = buf->linklist; l; l = l->next) { + if (l->url) { + parseURL2(l->url, &pu, baseURL(buf)); + p = parsedURL2Str(&pu)->ptr; + u = html_quote(p); + if (DecodeURL) + p = html_quote(url_unquote_conv(p, buf->document_code)); + else + p = u; + } + else + u = p = ""; + if (l->type == LINK_TYPE_REL) + t = " [Rel]"; + else if (l->type == LINK_TYPE_REV) + t = " [Rev]"; + else + t = ""; + t = Sprintf("%s%s\n", l->title ? l->title : "", t)->ptr; + t = html_quote(t); + Strcat_m_charp(tmp, "
  1. ", t, "
    ", p, + "\n", NULL); + } + Strcat_charp(tmp, "
\n"); + } + + if (buf->href) { + Strcat_charp(tmp, "

Anchors

\n
    \n"); + al = buf->href; + for (i = 0; i < al->nanchor; i++) { + a = &al->anchors[i]; + if (a->slave) + continue; + parseURL2(a->url, &pu, baseURL(buf)); + p = parsedURL2Str(&pu)->ptr; + u = html_quote(p); + if (DecodeURL) + p = html_quote(url_unquote_conv(p, buf->document_code)); + else + p = u; + t = getAnchorText(buf, al, a); + t = t ? html_quote(t) : ""; + Strcat_m_charp(tmp, "
  1. ", t, "
    ", p, + "\n", NULL); + } + Strcat_charp(tmp, "
\n"); + } + + if (buf->img) { + Strcat_charp(tmp, "

Images

\n
    \n"); + al = buf->img; + for (i = 0; i < al->nanchor; i++) { + a = &al->anchors[i]; + if (a->slave) + continue; + parseURL2(a->url, &pu, baseURL(buf)); + p = parsedURL2Str(&pu)->ptr; + u = html_quote(p); + if (DecodeURL) + p = html_quote(url_unquote_conv(p, buf->document_code)); + else + p = u; + if (a->title && *a->title) + t = html_quote(a->title); + else if (DecodeURL) + t = html_quote(url_unquote_conv(a->url, buf->document_code)); + else + t = html_quote(a->url); + Strcat_m_charp(tmp, "
  1. ", t, "
    ", p, + "\n", NULL); + a = retrieveAnchor(buf->formitem, a->start.line, a->start.pos); + if (!a) + continue; + fi = (FormItemList *)a->url; + fi = fi->parent->item; + if (fi->parent->method == FORM_METHOD_INTERNAL && + !Strcmp_charp(fi->parent->action, "map") && fi->value) { + MapList *ml = searchMapList(buf, fi->value->ptr); + ListItem *mi; + MapArea *m; + if (!ml) + continue; + Strcat_charp(tmp, "
    \nImage map\n
      \n"); + for (mi = ml->area->first; mi != NULL; mi = mi->next) { + m = (MapArea *) mi->ptr; + if (!m) + continue; + parseURL2(m->url, &pu, baseURL(buf)); + p = parsedURL2Str(&pu)->ptr; + u = html_quote(p); + if (DecodeURL) + p = html_quote(url_unquote_conv(p, + buf->document_code)); + else + p = u; + if (m->alt && *m->alt) + t = html_quote(m->alt); + else if (DecodeURL) + t = html_quote(url_unquote_conv(m->url, + buf->document_code)); + else + t = html_quote(m->url); + Strcat_m_charp(tmp, "
    1. ", t, + "
      ", p, "\n", NULL); + } + Strcat_charp(tmp, "
    \n"); + } + } + Strcat_charp(tmp, "
\n"); + } + + return loadHTMLString(tmp); + } diff -crN -x CVS w3m-0.3.2.2/backend.c w3m-js-1.743/backend.c *** w3m-0.3.2.2/backend.c 2002-02-04 00:25:45.000000000 +0900 --- w3m-js-1.743/backend.c 2003-01-24 21:58:51.000000000 +0900 *************** *** 1,8 **** ! /* $Id: backend.c,v 1.9 2002/02/03 15:25:45 ukai Exp $ */ #include #include #include - #include #include "fm.h" #include "gc.h" #include "terms.h" --- 1,7 ---- ! /* $Id: backend.c,v 1.11 2003/01/23 18:37:20 ukai Exp $ */ #include #include #include #include "fm.h" #include "gc.h" #include "terms.h" *************** *** 149,155 **** } print_headers(buf, len); printf("\n"); ! saveBuffer(buf, stdout); } else { print_headers(buf, 0); --- 148,154 ---- } print_headers(buf, len); printf("\n"); ! saveBuffer(buf, stdout, TRUE); } else { print_headers(buf, 0); diff -crN -x CVS w3m-0.3.2.2/buffer.c w3m-js-1.743/buffer.c *** w3m-0.3.2.2/buffer.c 2002-03-16 04:02:40.000000000 +0900 --- w3m-js-1.743/buffer.c 2003-02-08 02:38:49.000000000 +0900 *************** *** 1,4 **** ! /* $Id: buffer.c,v 1.13 2002/03/15 19:02:40 ukai Exp $ */ #include "fm.h" #ifdef USE_MOUSE --- 1,4 ---- ! /* $Id: buffer.c,v 1.27 2003/02/03 15:49:19 ukai Exp $ */ #include "fm.h" #ifdef USE_MOUSE *************** *** 32,37 **** --- 32,38 ---- bzero((void *)n, sizeof(Buffer)); n->width = width; n->COLS = COLS; + n->LINES = LASTLINE; n->currentURL.scheme = SCM_UNKNOWN; n->baseURL = NULL; n->baseTarget = NULL; *************** *** 39,45 **** n->bufferprop = BP_NORMAL; n->clone = New(int); *n->clone = 1; - n->linelen = 0; n->trbyte = 0; #ifdef USE_SSL n->ssl_certificate = NULL; --- 40,45 ---- *************** *** 96,107 **** return; if (buf->pagerSource) ISclose(buf->pagerSource); ! if (buf->sourcefile) { if (buf->real_scheme != SCM_LOCAL || buf->bufferprop & BP_FRAME) unlink(buf->sourcefile); } if (buf->mailcap_source) unlink(buf->mailcap_source); while (buf->frameset) { deleteFrameSet(buf->frameset); buf->frameset = popFrameTree(&(buf->frameQ)); --- 96,114 ---- return; if (buf->pagerSource) ISclose(buf->pagerSource); ! if (buf->sourcefile && ! (!buf->real_type || strncasecmp(buf->real_type, "image/", 6))) { if (buf->real_scheme != SCM_LOCAL || buf->bufferprop & BP_FRAME) unlink(buf->sourcefile); } + if (buf->header_source) + unlink(buf->header_source); if (buf->mailcap_source) unlink(buf->mailcap_source); + #ifdef USE_SCRIPT + if (buf->script_lang) + script_close(buf); + #endif while (buf->frameset) { deleteFrameSet(buf->frameset); buf->frameset = popFrameTree(&(buf->frameQ)); *************** *** 252,266 **** sprintf(msg, "Last line is #%ld", buf->lastLine->linenumber); set_delayed_message(msg); buf->currentLine = l; ! buf->topLine = lineSkip(buf, buf->currentLine, -(LASTLINE - 1), FALSE); return; } for (; l != NULL; l = l->next) { if (l->linenumber >= n) { buf->currentLine = l; if (n < buf->topLine->linenumber || ! buf->topLine->linenumber + LASTLINE <= n) ! buf->topLine = lineSkip(buf, l, -(LASTLINE + 1) / 2, FALSE); break; } } --- 259,274 ---- sprintf(msg, "Last line is #%ld", buf->lastLine->linenumber); set_delayed_message(msg); buf->currentLine = l; ! buf->topLine = lineSkip(buf, buf->currentLine, -(buf->LINES - 1), ! FALSE); return; } for (; l != NULL; l = l->next) { if (l->linenumber >= n) { buf->currentLine = l; if (n < buf->topLine->linenumber || ! buf->topLine->linenumber + buf->LINES <= n) ! buf->topLine = lineSkip(buf, l, -(buf->LINES + 1) / 2, FALSE); break; } } *************** *** 294,308 **** sprintf(msg, "Last line is #%ld", buf->lastLine->real_linenumber); set_delayed_message(msg); buf->currentLine = l; ! buf->topLine = lineSkip(buf, buf->currentLine, -(LASTLINE - 1), FALSE); return; } for (; l != NULL; l = l->next) { if (l->real_linenumber >= n) { buf->currentLine = l; if (n < buf->topLine->real_linenumber || ! buf->topLine->real_linenumber + LASTLINE <= n) ! buf->topLine = lineSkip(buf, l, -(LASTLINE + 1) / 2, FALSE); break; } } --- 302,317 ---- sprintf(msg, "Last line is #%ld", buf->lastLine->real_linenumber); set_delayed_message(msg); buf->currentLine = l; ! buf->topLine = lineSkip(buf, buf->currentLine, -(buf->LINES - 1), ! FALSE); return; } for (; l != NULL; l = l->next) { if (l->real_linenumber >= n) { buf->currentLine = l; if (n < buf->topLine->real_linenumber || ! buf->topLine->real_linenumber + buf->LINES <= n) ! buf->topLine = lineSkip(buf, l, -(buf->LINES + 1) / 2, FALSE); break; } } *************** *** 495,500 **** --- 504,510 ---- if (!buf->need_reshape) return; buf->need_reshape = FALSE; + buf->width = INIT_BUFFER_WIDTH; if (buf->sourcefile == NULL) return; init_stream(&f, SCM_LOCAL, NULL); *************** *** 513,527 **** buf->name = NULL; buf->img = NULL; buf->formitem = NULL; ! buf->width = INIT_BUFFER_WIDTH; ! ! #ifdef JP_CHARSET ! UseContentCharset = FALSE; ! UseAutoDetect = FALSE; ! #endif ! if (buf->search_header && buf->currentURL.scheme == SCM_LOCAL) { ! if (buf->header_source && (buf->mailcap_source || ! !strcmp(buf->currentURL.file, "-"))) { URLFile h; init_stream(&h, SCM_LOCAL, NULL); examineFile(buf->header_source, &h); --- 523,539 ---- buf->name = NULL; buf->img = NULL; buf->formitem = NULL; ! buf->formlist = NULL; ! buf->linklist = NULL; ! buf->maplist = NULL; ! if (buf->hmarklist) ! buf->hmarklist->nmark = 0; ! if (buf->imarklist) ! buf->imarklist->nmark = 0; ! ! if (buf->header_source) { ! if (buf->currentURL.scheme != SCM_LOCAL || ! buf->mailcap_source || !strcmp(buf->currentURL.file, "-")) { URLFile h; init_stream(&h, SCM_LOCAL, NULL); examineFile(buf->header_source, &h); *************** *** 530,539 **** UFclose(&h); } } ! else readHeader(&f, buf, TRUE, NULL); } if (!strcasecmp(buf->type, "text/html")) loadHTMLBuffer(&f, buf); else --- 542,555 ---- UFclose(&h); } } ! else if (buf->search_header) /* -m option */ readHeader(&f, buf, TRUE, NULL); } + #ifdef JP_CHARSET + UseContentCharset = FALSE; + UseAutoDetect = FALSE; + #endif if (!strcasecmp(buf->type, "text/html")) loadHTMLBuffer(&f, buf); else *************** *** 545,557 **** #endif buf->height = LASTLINE + 1; ! if (buf->firstLine) ! restorePosition(buf, &sbuf); if (buf->check_url & CHK_URL) chkURLBuffer(buf); #ifdef USE_NNTP if (buf->check_url & CHK_NMID) chkNMIDBuffer(buf); #endif formResetBuffer(buf, sbuf.formitem); } --- 561,600 ---- #endif buf->height = LASTLINE + 1; ! if (buf->firstLine && sbuf.firstLine) { ! Line *cur = sbuf.currentLine; ! int n; ! ! buf->pos = sbuf.pos + cur->bpos; ! while (cur->bpos && cur->prev) ! cur = cur->prev; ! if (cur->real_linenumber > 0) ! gotoRealLine(buf, cur->real_linenumber); ! else ! gotoLine(buf, cur->linenumber); ! n = (buf->currentLine->linenumber - buf->topLine->linenumber) ! - (cur->linenumber - sbuf.topLine->linenumber); ! if (n) { ! buf->topLine = lineSkip(buf, buf->topLine, n, FALSE); ! if (cur->real_linenumber > 0) ! gotoRealLine(buf, cur->real_linenumber); ! else ! gotoLine(buf, cur->linenumber); ! } ! buf->pos -= buf->currentLine->bpos; ! if (FoldLine && strcasecmp(buf->type, "text/html")) ! buf->currentColumn = 0; ! else ! buf->currentColumn = sbuf.currentColumn; ! arrangeCursor(buf); ! } if (buf->check_url & CHK_URL) chkURLBuffer(buf); #ifdef USE_NNTP if (buf->check_url & CHK_NMID) chkNMIDBuffer(buf); + if (buf->real_scheme == SCM_NNTP || buf->real_scheme == SCM_NEWS) + reAnchorNewsheader(buf); #endif formResetBuffer(buf, sbuf.formitem); } *************** *** 607,622 **** fwrite1(l->usrflags, cache) || fwrite1(l->width, cache) || fwrite1(l->len, cache) || ! fwrite(l->lineBuf, 1, l->len, cache) < l->len || ! fwrite(l->propBuf, sizeof(Lineprop), l->len, cache) < l->len) goto _error; #ifdef USE_ANSI_COLOR colorflag = l->colorBuf ? 1 : 0; if (fwrite1(colorflag, cache)) goto _error; if (colorflag) { ! if (fwrite(l->colorBuf, sizeof(Linecolor), l->len, cache) < l->len) ! goto _error; } #endif } --- 650,673 ---- fwrite1(l->usrflags, cache) || fwrite1(l->width, cache) || fwrite1(l->len, cache) || ! fwrite1(l->size, cache) || ! fwrite1(l->bpos, cache) || fwrite1(l->bwidth, cache)) goto _error; + if (l->bpos == 0) { + if (fwrite(l->lineBuf, 1, l->size, cache) < l->size || + fwrite(l->propBuf, sizeof(Lineprop), l->size, cache) < l->size) + goto _error; + } #ifdef USE_ANSI_COLOR colorflag = l->colorBuf ? 1 : 0; if (fwrite1(colorflag, cache)) goto _error; if (colorflag) { ! if (l->bpos == 0) { ! if (fwrite(l->colorBuf, sizeof(Linecolor), l->size, cache) < ! l->size) ! goto _error; ! } } #endif } *************** *** 635,641 **** readBufferCache(Buffer *buf) { FILE *cache; ! Line *l = NULL, *prevl = NULL; long lnum = 0, clnum, tlnum; #ifdef USE_ANSI_COLOR int colorflag; --- 686,692 ---- readBufferCache(Buffer *buf) { FILE *cache; ! Line *l = NULL, *prevl = NULL, *basel = NULL; long lnum = 0, clnum, tlnum; #ifdef USE_ANSI_COLOR int colorflag; *************** *** 666,684 **** buf->topLine = l; if (fread1(l->real_linenumber, cache) || fread1(l->usrflags, cache) || ! fread1(l->width, cache) || fread1(l->len, cache)) break; - l->lineBuf = NewAtom_N(char, l->len + 1); - fread(l->lineBuf, 1, l->len, cache); - l->lineBuf[l->len] = '\0'; - l->propBuf = NewAtom_N(Lineprop, l->len); - fread(l->propBuf, sizeof(Lineprop), l->len, cache); #ifdef USE_ANSI_COLOR if (fread1(colorflag, cache)) break; if (colorflag) { ! l->colorBuf = NewAtom_N(Linecolor, l->len); ! fread(l->colorBuf, sizeof(Linecolor), l->len, cache); } else { l->colorBuf = NULL; --- 717,751 ---- buf->topLine = l; if (fread1(l->real_linenumber, cache) || fread1(l->usrflags, cache) || ! fread1(l->width, cache) || ! fread1(l->len, cache) || ! fread1(l->size, cache) || ! fread1(l->bpos, cache) || fread1(l->bwidth, cache)) ! break; ! if (l->bpos == 0) { ! basel = l; ! l->lineBuf = NewAtom_N(char, l->size + 1); ! fread(l->lineBuf, 1, l->size, cache); ! l->lineBuf[l->size] = '\0'; ! l->propBuf = NewAtom_N(Lineprop, l->size); ! fread(l->propBuf, sizeof(Lineprop), l->size, cache); ! } ! else if (basel) { ! l->lineBuf = basel->lineBuf + l->bpos; ! l->propBuf = basel->propBuf + l->bpos; ! } ! else break; #ifdef USE_ANSI_COLOR if (fread1(colorflag, cache)) break; if (colorflag) { ! if (l->bpos == 0) { ! l->colorBuf = NewAtom_N(Linecolor, l->size); ! fread(l->colorBuf, sizeof(Linecolor), l->size, cache); ! } ! else ! l->colorBuf = basel->colorBuf + l->bpos; } else { l->colorBuf = NULL; diff -crN -x CVS w3m-0.3.2.2/config.h.dist w3m-js-1.743/config.h.dist *** w3m-0.3.2.2/config.h.dist 2002-10-29 02:09:19.000000000 +0900 --- w3m-js-1.743/config.h.dist 2003-02-08 02:38:49.000000000 +0900 *************** *** 37,43 **** /* * Save Current-buffer Information */ ! #define BUFINFO /* * Support EGD (Entropy Gathering Daemon) --- 37,43 ---- /* * Save Current-buffer Information */ ! #undef BUFINFO /* * Support EGD (Entropy Gathering Daemon) *************** *** 55,60 **** --- 55,65 ---- #undef MENU_THIN_FRAME /* + * Use raw scroll + */ + #undef USE_RAW_SCROLL + + /* */ #undef TABLE_EXPAND #undef TABLE_NO_COMPACT *************** *** 65,71 **** #ifdef makefile_parameter BIN_DIR = /usr/local/bin ! LIB_DIR = /usr/local/lib/w3m HELP_DIR = /usr/local/share/w3m MAN_DIR = /usr/local/man MAN1_DIR = $(MAN_DIR)/man1 --- 70,77 ---- #ifdef makefile_parameter BIN_DIR = /usr/local/bin ! AUXBIN_DIR = /usr/local/lib/w3m ! LIB_DIR = /usr/local/lib/w3m/cgi-bin HELP_DIR = /usr/local/share/w3m MAN_DIR = /usr/local/man MAN1_DIR = $(MAN_DIR)/man1 *************** *** 84,90 **** MATHLIB=-lm Z_CFLAGS=-I/usr/include ZLIB=-L/usr/lib -lz ! EXT_TARGETS=$(BOOKMARKER) $(HELPER) $(INFLATE) IMGCFLAGS= IMGLDFLAGS= IMGX11CFLAGS= --- 90,97 ---- MATHLIB=-lm Z_CFLAGS=-I/usr/include ZLIB=-L/usr/lib -lz ! AUXBIN_TARGETS=$(INFLATE) ! LIB_TARGETS=$(BOOKMARKER) $(HELPER) IMGCFLAGS= IMGLDFLAGS= IMGX11CFLAGS= *************** *** 98,103 **** --- 105,111 ---- PERL=/usr/local/bin/perl VERSION=0.2.2 MODEL=Linux.i686-monster-ja + INSTALL_W3MIMGDISPLAY=$(INSTALL_PROGRAM) #else *************** *** 137,142 **** --- 145,151 ---- #undef USE_IMLIB2 #define USE_HELP_CGI #undef USE_XFACE + #undef USE_JAVASCRIPT #define DEF_EDITOR "/bin/vi" #define DEF_MAILER "/bin/mail" *************** *** 149,155 **** /* for USE_MIGEMO */ #define DEF_MIGEMO_COMMAND "migemo -t egrep /usr/share/migemo/migemo-dict" ! #define LIB_DIR "/usr/local/lib/w3m" #define HELP_DIR "/usr/local/lib/w3m" #define ETC_DIR "/usr/local/etc/w3m" #define HELP_FILE "w3mhelp.html" --- 158,165 ---- /* for USE_MIGEMO */ #define DEF_MIGEMO_COMMAND "migemo -t egrep /usr/share/migemo/migemo-dict" ! #define AUXBIN_DIR "/usr/local/lib/w3m" ! #define LIB_DIR "/usr/local/lib/w3m/cgi-bin" #define HELP_DIR "/usr/local/lib/w3m" #define ETC_DIR "/usr/local/etc/w3m" #define HELP_FILE "w3mhelp.html" *************** *** 167,172 **** --- 177,183 ---- #define HISTORY_FILE "history" #define PASSWD_FILE RC_DIR "/passwd" + #define PRE_FORM_FILE RC_DIR "/pre_form" #define USER_MAILCAP RC_DIR "/mailcap" #define SYS_MAILCAP "/etc/mailcap" #define USER_MIMETYPES "~/.mime.types" *************** *** 233,238 **** --- 244,253 ---- #endif /* HAVE_SRANDOM */ #endif + #ifndef HAVE_LSTAT + #define lstat stat + #endif + #if defined( __CYGWIN32__ ) && !defined( __CYGWIN__ ) #define __CYGWIN__ #endif diff -crN -x CVS w3m-0.3.2.2/configure w3m-js-1.743/configure *** w3m-0.3.2.2/configure 2002-10-29 02:09:20.000000000 +0900 --- w3m-js-1.743/configure 2003-02-08 02:38:49.000000000 +0900 *************** *** 1,5 **** #!/bin/sh ! # $Id: configure,v 1.81 2002/10/28 17:09:20 ukai Exp $ # Configuration. # --- 1,5 ---- #!/bin/sh ! # $Id: configure,v 1.97 2003/02/06 17:15:10 ukai Exp $ # Configuration. # *************** *** 22,36 **** echo $sysname $sysversion1 $sysversion2 $sysversion3 /$platform at $host - if [ -f config.param ] ; then - confhost=`awk 'NR==1{print $4}' config.param` - if [ "$confhost" = "$host" ] ; then - . ./config.param - fi - fi - - echo "# Configuration at $host" > config.param - # parameters: prefix=/usr/local --- 22,27 ---- *************** *** 40,45 **** --- 31,44 ---- gc_libdir= mimetypes= + # local overrides + if [ -f config.param ] ; then + confhost=`awk 'NR==1{print $4}' config.param` + if [ "$confhost" = "$host" ] ; then + . ./config.param + fi + fi + all_yes=0 while [ $# -gt 0 ] do *************** *** 53,74 **** shift ;; -prefix=*|--prefix=*) ! prefix=`expr "$1" : "-*prefix=\(.*\)"` ;; -bindir=*|--bindir=*) ! bindir=`expr "$1" : "-*bindir=\(.*\)"` ;; -libdir=*|--libdir=*) ! libdir=`expr "$1" : "-*libdir=\(.*\)"` ;; -helpdir=*|--helpdir=*) ! helpdir=`expr "$1" : "-*helpdir=\(.*\)"` ;; -mandir=*|--mandir=*) ! mandir=`expr "$1" : "-*mandir=\(.*\)"` ;; -sysconfdir=*|--sysconfdir=*) ! sysconfdir=`expr "$1" : "-*sysconfdir=\(.*\)"` ;; -lang=en|--lang=en|-lang=EN|--lang=EN) lang=EN --- 52,76 ---- shift ;; -prefix=*|--prefix=*) ! prefix=`expr "X$1" : "X-*prefix=\(.*\)"` ;; -bindir=*|--bindir=*) ! bindir=`expr "X$1" : "X-*bindir=\(.*\)"` ! ;; ! -auxbindir=*|--auxbindir=*) ! auxbindir=`expr "X$1" : "X-*auxbindir=\(.*\)"` ;; -libdir=*|--libdir=*) ! libdir=`expr "X$1" : "X-*libdir=\(.*\)"` ;; -helpdir=*|--helpdir=*) ! helpdir=`expr "X$1" : "X-*helpdir=\(.*\)"` ;; -mandir=*|--mandir=*) ! mandir=`expr "X$1" : "X-*mandir=\(.*\)"` ;; -sysconfdir=*|--sysconfdir=*) ! sysconfdir=`expr "X$1" : "X-*sysconfdir=\(.*\)"` ;; -lang=en|--lang=en|-lang=EN|--lang=EN) lang=EN *************** *** 95,101 **** dmodel=6 ;; -code=*|--code=*) ! display_code=`expr "$1" : "-*code=\(.*\)"` ;; -cflags=*|--cflags=*) dcflags=`echo $1 | sed -e 's/-*cflags=//'` --- 97,103 ---- dmodel=6 ;; -code=*|--code=*) ! display_code=`expr "X$1" : "X-*code=\(.*\)"` ;; -cflags=*|--cflags=*) dcflags=`echo $1 | sed -e 's/-*cflags=//'` *************** *** 104,129 **** dldflags=`echo $1 | sed -e 's/-*ldflags=//'` ;; --ssl-includedir=*) ! ssl_includedir=`expr "$1" : "--ssl-includedir=\(.*\)"` ;; --ssl-libdir=*) ! ssl_libdir=`expr "$1" : "--ssl-libdir=\(.*\)"` ;; --gc-includedir=*) ! gc_includedir=`expr "$1" : "--gc-includedir=\(.*\)"` ;; --gc-libdir=*) ! gc_libdir=`expr "$1" : "--gc-libdir=\(.*\)"` ;; --mimetypes=*) ! mimetypes=`expr "$1" : "--mimetypes=\(.*\)"` ;; -help|--help) echo "-yes, -nonstop Set all parameters to the default" echo "-prefix=DIR Specify prefix (default: /usr/local)" echo "-bindir=DIR user executable in DIR (default: PREFIX/bin)" ! echo "-libdir=DIR program executables in DIR (default: PREFIX/lib/w3m)" echo "-helpdir=DIR help file in DIR (default: PREFIX/share/w3m)" echo "-mandir=DIR manual in DIR (default: PREFIX/man)" echo "-sysconfdir=DIR w3mconfig in DIR [PREFIX/etc/w3m]" --- 106,132 ---- dldflags=`echo $1 | sed -e 's/-*ldflags=//'` ;; --ssl-includedir=*) ! ssl_includedir=`expr "X$1" : "X--ssl-includedir=\(.*\)"` ;; --ssl-libdir=*) ! ssl_libdir=`expr "X$1" : "X--ssl-libdir=\(.*\)"` ;; --gc-includedir=*) ! gc_includedir=`expr "X$1" : "X--gc-includedir=\(.*\)"` ;; --gc-libdir=*) ! gc_libdir=`expr "X$1" : "X--gc-libdir=\(.*\)"` ;; --mimetypes=*) ! mimetypes=`expr "X$1" : "X--mimetypes=\(.*\)"` ;; -help|--help) echo "-yes, -nonstop Set all parameters to the default" echo "-prefix=DIR Specify prefix (default: /usr/local)" echo "-bindir=DIR user executable in DIR (default: PREFIX/bin)" ! echo "-auxbindir=DIR support programs in DIR (default: PREFIX/lib/w3m)" ! echo "-libdir=DIR local cgi in DIR (default: PREFIX/lib/w3m/cgi-bin)" echo "-helpdir=DIR help file in DIR (default: PREFIX/share/w3m)" echo "-mandir=DIR manual in DIR (default: PREFIX/man)" echo "-sysconfdir=DIR w3mconfig in DIR [PREFIX/etc/w3m]" *************** *** 146,151 **** --- 149,159 ---- shift done + if [ -f config.param ]; then + mv -f config.param config.param.bak + fi + echo "# Configuration at $host" > config.param + if [ "x$IMLIB_CONFIG" = x ]; then IMLIB_CONFIG=imlib-config fi *************** *** 577,594 **** bindir=$_dir echo "bindir='$bindir'" >> config.param d_libdir=$libdir if [ -z "$d_libdir" ]; then case "$sysname" in *BSD) ! d_libdir="$topdir/libexec/w3m" ;; *) ! d_libdir="$topdir/lib/w3m" ;; esac fi ! echo "Which directory do you want to put the support binary files?" Echo "(default: $d_libdir) " readdir "$d_libdir" libdir=$_dir --- 585,619 ---- bindir=$_dir echo "bindir='$bindir'" >> config.param + d_auxbindir=$auxbindir + if [ -z "$d_auxbindir" ]; then + case "$sysname" in + *BSD) + d_auxbindir="$topdir/libexec/w3m" + ;; + *) + d_auxbindir="$topdir/lib/w3m" + ;; + esac + fi + echo "Which directory do you want to put the support binary files?" + Echo "(default: $d_auxbindir) " + readdir "$d_auxbindir" + auxbindir=$_dir + echo "auxbindir='$auxbindir'" >> config.param + d_libdir=$libdir if [ -z "$d_libdir" ]; then case "$sysname" in *BSD) ! d_libdir="$topdir/libexec/w3m/cgi-bin" ;; *) ! d_libdir="$topdir/lib/w3m/cgi-bin" ;; esac fi ! echo "Which directory do you want to use local cgi?" Echo "(default: $d_libdir) " readdir "$d_libdir" libdir=$_dir *************** *** 794,804 **** def_param "use_digest_auth" n fi ask_param "Inline image support" use_image n if [ "$use_image" = y ]; then def_use_image="#define USE_IMAGE" imgtarget='$(IMGDISPLAY)' ! ask_param "X11 inline image support (you need Imlib1 or GdkPixbuf library)" use_w3mimg_x11 y d_w3mimg_fb=n case $sysname in Linux|linux|LINUX) --- 819,831 ---- def_param "use_digest_auth" n fi + ask_param "EXPERIMENTAL JavaScript support" use_javascript n + ask_param "Inline image support" use_image n if [ "$use_image" = y ]; then def_use_image="#define USE_IMAGE" imgtarget='$(IMGDISPLAY)' ! ask_param "X11 inline image support (you need Imlib, Imlib2 or GdkPixbuf library)" use_w3mimg_x11 y d_w3mimg_fb=n case $sysname in Linux|linux|LINUX) *************** *** 806,811 **** --- 833,841 ---- d_w3mimg_fb=y fi ask_param "Linux Framebuffer inline image support (you need Imlib2 or GdkPixbuf)" use_w3mimg_fb $d_w3mimg_fb + if [ "$use_w3mimg_fb" = y ]; then + ask_param "setuid w3mimgdisplay to open /dev/fb0?" w3mimgdisplay_setuid y + fi ;; esac else *************** *** 851,860 **** def_param use_bg_color y def_param format_nice n def_param id_ext y ! def_param use_bufinfo y def_param use_egd y def_param enable_remove_trailingspaces n def_param menu_thin_frame n def_param emacs_like_lineedit $include_opt def_param vi_prec_num $include_opt def_param label_topline $include_opt --- 881,891 ---- def_param use_bg_color y def_param format_nice n def_param id_ext y ! def_param use_bufinfo n def_param use_egd y def_param enable_remove_trailingspaces n def_param menu_thin_frame n + def_param use_raw_scroll n def_param emacs_like_lineedit $include_opt def_param vi_prec_num $include_opt def_param label_topline $include_opt *************** *** 1051,1056 **** --- 1082,1136 ---- if [ -n "$extlib" ]; then echo "additional library found: $extlib" fi + + ## Search js + jslib= + jsinclude= + jstype= + if [ "$use_javascript" = "y" ]; then + for tlibdir in /lib /usr/lib /usr/local/lib /usr/ucblib /usr/ccslib /usr/ccs/lib $prefix/lib ${HOME}/lib + do + if [ -f $tlibdir/libnjs.a -o -f $tlibdir/libnjs.$so_ext ] ; then + echo "$tlibdir/libnjs found" + jslib="-L$tlibdir -lnjs" + jstype=njs + break + elif [ -f $tlibdir/libjs.a -o -f $tlibdir/libjs.$so_ext ] ; then + echo "$tlibdir/libjs found" + jslib="-L$tlibdir -ljs" + jstype=js + break + fi + done + for inc in /usr/include /usr/local/include $prefix/include ${HOME}/include + do + if [ -f $inc/njs/njs.h ]; then + echo "$inc/njs/njs.h found" + if [ "$jstype" != njs ]; then + echo "js version mismatch." + exit 1 + fi + jsinclude="-I$inc" + break + elif [ -f $inc/js.h ]; then + echo "$inc/js.h found" + if [ "$jstype" != js ]; then + echo "js version mismatch." + exit 1 + fi + jsinclude="-I$inc" + break + fi + done + if [ -z "$jslib" -o -z "$jsinclude" ]; then + echo "Error: It seems you don't have libjs or js.h." + echo " JavaScript cannot be supported." + exit 1 + fi + if [ "$jstype" = njs ]; then + cflags="$cflags -DHAVE_NJS" + fi + fi extlib="$extlib $ldflags" ## Search zlib *************** *** 1984,1989 **** --- 2064,2070 ---- def_setpgrp='#define SETPGRP() setpgrp( 0, 0 )' else def_have_setpgrp='' + def_setpgrp='#define SETPGRP() /* no setpgrp() */' fi fi *************** *** 2151,2156 **** --- 2232,2243 ---- imgobjs="$imgobjs w3mimg/x11/x11_w3mimg.o" imgx11cflags="`${IMLIB_CONFIG} --cflags`" imgx11ldflags="`${IMLIB_CONFIG} --libs`" + elif find_imlib2; then + def_use_w3mimg_x11="#define USE_W3MIMG_X11" + def_use_imlib2='#define USE_IMLIB2' + imgobjs="$imgobjs w3mimg/x11/x11_w3mimg.o" + imgx11cflags="`${IMLIB2_CONFIG} --cflags`" + imgx11ldflags="`${IMLIB2_CONFIG} --libs`" else use_w3mimg_x11=n echo "Disable X11 inline image" *************** *** 2164,2170 **** imgfbcflags="`${GDKPIXBUF_CONFIG} --cflags`" imgfbldflags="`${GDKPIXBUF_CONFIG} --libs`" elif find_imlib2; then ! def_use_imlib2='#define USE_IMLIB2' imgobjs="$imgobjs w3mimg/fb/fb_w3mimg.o w3mimg/fb/fb.o w3mimg/fb/fb_img.o" def_use_imlib2='#define USE_IMLIB2' imgfbcflags="`${IMLIB2_CONFIG} --cflags`" --- 2251,2257 ---- imgfbcflags="`${GDKPIXBUF_CONFIG} --cflags`" imgfbldflags="`${GDKPIXBUF_CONFIG} --libs`" elif find_imlib2; then ! def_use_w3mimg_fb='#define USE_W3MIMG_FB' imgobjs="$imgobjs w3mimg/fb/fb_w3mimg.o w3mimg/fb/fb.o w3mimg/fb/fb_img.o" def_use_imlib2='#define USE_IMLIB2' imgfbcflags="`${IMLIB2_CONFIG} --cflags`" *************** *** 2174,2179 **** --- 2261,2272 ---- echo "Disable Linux framebuffer inline image" fi fi + install_w3mimgdisplay='$(INSTALL_PROGRAM)' + if [ "$use_w3mimg_fb" = y ]; then + if [ "$w3mimgdisplay_setuid" = y ]; then + install_w3mimgdisplay='$(INSTALL) -o root -m 4755 -s' + fi + fi fi rm -f _zmachdep$extension _zmachdep.c _zmachdep.o *************** *** 2275,2280 **** --- 2368,2378 ---- $def_menu_thin_frame /* + * Use raw scroll + */ + $def_use_raw_scroll + + /* */ $def_table_expand $def_table_no_compact *************** *** 2285,2290 **** --- 2383,2389 ---- #ifdef makefile_parameter BIN_DIR = $bindir + AUXBIN_DIR = $auxbindir LIB_DIR = $libdir HELP_DIR = $helpdir MAN_DIR = $mandir *************** *** 2293,2302 **** ETC_DIR = $sysconfdir RC_DIR = ~/.w3m HELP_FILE = $helpfile ! SYS_LIBRARIES = $gpmlib $termlib $ssllib $v6lib LOCAL_LIBRARIES = $extlib CC = $cc ! MYCFLAGS = $cflags $bsdinclude $sslinclude LDFLAGS = $ldflags GCCFLAGS = $cflags -I./\$(srcdir)/include -DATOMIC_UNCOLLECTABLE -DNO_SIGNALS -DNO_EXECUTE_PERMISSION -DSILENT -DALL_INTERIOR_POINTERS KEYBIND_SRC = $keymap_file.c --- 2392,2401 ---- ETC_DIR = $sysconfdir RC_DIR = ~/.w3m HELP_FILE = $helpfile ! SYS_LIBRARIES = $gpmlib $termlib $ssllib $v6lib $jslib LOCAL_LIBRARIES = $extlib CC = $cc ! MYCFLAGS = $cflags $bsdinclude $sslinclude $jsinclude LDFLAGS = $ldflags GCCFLAGS = $cflags -I./\$(srcdir)/include -DATOMIC_UNCOLLECTABLE -DNO_SIGNALS -DNO_EXECUTE_PERMISSION -DSILENT -DALL_INTERIOR_POINTERS KEYBIND_SRC = $keymap_file.c *************** *** 2305,2311 **** MATHLIB=$mathlib Z_CFLAGS=$z_cflags ZLIB=$zlib ! EXT_TARGETS=\$(BOOKMARKER) \$(HELPER) $inflate $imgtarget IMGCFLAGS=$imgx11cflags $imgfbcflags IMGLDFLAGS=$imgx11ldflags $imgfbldflags IMGX11CFLAGS=$imgx11cflags --- 2404,2411 ---- MATHLIB=$mathlib Z_CFLAGS=$z_cflags ZLIB=$zlib ! AUXBIN_TARGETS=$inflate $imgtarget ! LIB_TARGETS=\$(BOOKMARKER) \$(HELPER) IMGCFLAGS=$imgx11cflags $imgfbcflags IMGLDFLAGS=$imgx11ldflags $imgfbldflags IMGX11CFLAGS=$imgx11cflags *************** *** 2319,2324 **** --- 2419,2425 ---- PERL=$perl VERSION=$w3mversion MODEL=$sysname.$platform-$modelname-$lang + INSTALL_W3MIMGDISPLAY=$install_w3mimgdisplay #else $special_sys *************** *** 2354,2364 **** --- 2455,2467 ---- $def_use_image $def_use_w3mimg_x11 $def_use_w3mimg_fb + $def_w3mimgdisplay_setuid $def_use_imlib $def_use_gdkpixbuf $def_use_imlib2 $def_use_help_cgi $def_use_xface + $def_use_javascript #define DEF_EDITOR "$editor" #define DEF_MAILER "$mailer" *************** *** 2371,2376 **** --- 2474,2480 ---- /* for USE_MIGEMO */ #define DEF_MIGEMO_COMMAND "$def_migemo_command" + #define AUXBIN_DIR "$auxbindir" #define LIB_DIR "$libdir" #define HELP_DIR "$helpdir" #define ETC_DIR "$sysconfdir" *************** *** 2385,2394 **** --- 2489,2500 ---- #define CONFIG_FILE "config" #define KEYMAP_FILE "keymap" #define MENU_FILE "menu" + #define MOUSE_FILE "mouse" #define COOKIE_FILE "cookie" #define HISTORY_FILE "history" #define PASSWD_FILE RC_DIR "/passwd" + #define PRE_FORM_FILE RC_DIR "/pre_form" #define USER_MAILCAP RC_DIR "/mailcap" #define SYS_MAILCAP "/etc/mailcap" #define USER_MIMETYPES "~/.mime.types" *************** *** 2456,2461 **** --- 2562,2571 ---- #endif /* HAVE_SRANDOM */ #endif + #ifndef HAVE_LSTAT + #define lstat stat + #endif + #if defined( __CYGWIN32__ ) && !defined( __CYGWIN__ ) #define __CYGWIN__ #endif *************** *** 2466,2471 **** --- 2576,2584 ---- #if defined( __CYGWIN__ ) #define SUPPORT_NETBIOS_SHARE 1 + #if LANG == JA + #define SUPPORT_WIN9X_CONSOLE_MBCS 1 + #endif #endif #if defined(__DJGPP__) diff -crN -x CVS w3m-0.3.2.2/cookie.c w3m-js-1.743/cookie.c *** w3m-0.3.2.2/cookie.c 2002-01-11 00:39:21.000000000 +0900 --- w3m-js-1.743/cookie.c 2003-01-17 23:37:12.000000000 +0900 *************** *** 1,4 **** ! /* $Id: cookie.c,v 1.7 2002/01/10 15:39:21 ukai Exp $ */ /* * References for version 0 cookie: --- 1,4 ---- ! /* $Id: cookie.c,v 1.8 2003/01/15 17:13:21 ukai Exp $ */ /* * References for version 0 cookie: *************** *** 417,423 **** check_expired_cookies(); ! if (!First_cookie || is_saved || rc_dir_is_tmp) return; cookie_file = rcFile(COOKIE_FILE); --- 417,423 ---- check_expired_cookies(); ! if (!First_cookie || is_saved || no_rc_dir) return; cookie_file = rcFile(COOKIE_FILE); diff -crN -x CVS w3m-0.3.2.2/display.c w3m-js-1.743/display.c *** w3m-0.3.2.2/display.c 2002-10-30 01:19:41.000000000 +0900 --- w3m-js-1.743/display.c 2003-02-07 02:21:13.000000000 +0900 *************** *** 1,4 **** ! /* $Id: display.c,v 1.25 2002/10/29 16:19:41 ukai Exp $ */ #include #include "fm.h" --- 1,4 ---- ! /* $Id: display.c,v 1.64 2003/02/06 17:16:56 ukai Exp $ */ #include #include "fm.h" *************** *** 164,170 **** refresh(); #ifdef USE_IMAGE if (activeImage) ! loadImage(IMG_FLAG_STOP); #endif #ifdef USE_MOUSE if (use_mouse) --- 164,170 ---- refresh(); #ifdef USE_IMAGE if (activeImage) ! loadImage(NULL, IMG_FLAG_STOP); #endif #ifdef USE_MOUSE if (use_mouse) *************** *** 214,243 **** static Buffer *save_current_buf = NULL; #endif ! char *delayed_msg = NULL; #ifdef USE_IMAGE static int image_touch = 0; static int draw_image_flag = FALSE; static Line *redrawLineImage(Buffer *buf, Line *l, int i); #endif void displayBuffer(Buffer *buf, int mode) { Str msg; ! Anchor *aa = NULL; if (buf->topLine == NULL && readBufferCache(buf) == 0) { /* clear_buffer */ mode = B_FORCE_REDRAW; } if (buf->width == 0) ! buf->width = COLS; if (buf->height == 0) buf->height = LASTLINE + 1; ! if ((buf->width != INIT_BUFFER_WIDTH && buf->type && ! !strcmp(buf->type, "text/html")) || buf->need_reshape) { buf->need_reshape = TRUE; reshapeBuffer(buf); } --- 214,388 ---- static Buffer *save_current_buf = NULL; #endif ! static char *delayed_msg = NULL; + static void drawAnchorCursor(Buffer *buf); + #define redrawBuffer(buf) redrawNLine(buf, LASTLINE) + static void redrawNLine(Buffer *buf, int n); + static Line *redrawLine(Buffer *buf, Line *l, int i); #ifdef USE_IMAGE static int image_touch = 0; static int draw_image_flag = FALSE; static Line *redrawLineImage(Buffer *buf, Line *l, int i); #endif + static int redrawLineRegion(Buffer *buf, Line *l, int i, int bpos, int epos); + static void do_effects(Lineprop m); + #ifdef USE_ANSI_COLOR + static void do_color(Linecolor c); + #endif + + static Str + make_lastline_link(Buffer *buf, char *title, char *url) + { + Str s = NULL, u; + #ifdef JP_CHARSET + Lineprop *pr; + #endif + ParsedURL pu; + char *p; + int l = COLS - 1, i; + + if (title && *title) { + s = Strnew_m_charp("[", title, "]", NULL); + for (p = s->ptr; *p; p++) { + if (IS_CNTRL(*p) || IS_SPACE(*p)) + *p = ' '; + } + if (url) + Strcat_charp(s, " "); + l -= s->length; + if (l <= 0) + return s; + } + if (!url) + return s; + parseURL2(url, &pu, baseURL(buf)); + u = parsedURL2Str(&pu); + if (DecodeURL) + u = Strnew_charp(url_unquote_conv(u->ptr, buf->document_code)); + #ifdef JP_CHARSET + u = checkType(u, &pr, NULL); + #endif + if (l <= 4 || l >= u->length) { + if (!s) + return u; + Strcat(s, u); + return s; + } + if (!s) + s = Strnew_size(COLS); + i = (l - 2) / 2; + #ifdef JP_CHARSET + if (CharType(pr[i]) == PC_KANJI2) + i--; + #endif + Strcat_charp_n(s, u->ptr, i); + #if LANG == JA + Strcat_charp(s, "。ト"); + #else /* LANG != JA */ + Strcat_charp(s, ".."); + #endif /* LANG != JA */ + i = u->length - (COLS - 1 - s->length); + #ifdef JP_CHARSET + if (CharType(pr[i]) == PC_KANJI2) + i++; + #endif + Strcat_charp(s, &u->ptr[i]); + return s; + } + + static Str + make_lastline_message(Buffer *buf) + { + Str msg, s = NULL; + + if (displayLink) { + #ifdef USE_IMAGE + MapArea *a = retrieveCurrentMapArea(buf); + if (a) + s = make_lastline_link(buf, a->alt, a->url); + else + #endif + { + Anchor *a = retrieveCurrentAnchor(buf); + char *p = NULL; + if (a && a->title && *a->title) + p = a->title; + else { + Anchor *a_img = retrieveCurrentImg(buf); + if (a_img && a_img->title && *a_img->title) + p = a_img->title; + } + if (p || a) + s = make_lastline_link(buf, p, a ? a->url : NULL); + } + if (s && s->length >= COLS - 3) + return s; + } + + #ifdef USE_MOUSE + if (use_mouse && mouse_action.lastline_str) + msg = Strnew_charp(mouse_action.lastline_str); + else + #endif /* not USE_MOUSE */ + msg = Strnew(); + if (displayLineInfo && buf->currentLine != NULL && buf->lastLine != NULL) { + int cl = buf->currentLine->real_linenumber; + int ll = buf->lastLine->real_linenumber; + int r = (int)((double)cl * 100.0 / (double)(ll ? ll : 1) + 0.5); + Strcat(msg, Sprintf("%d/%d (%d%%)", cl, ll, r)); + } + else + Strcat_charp(msg, "Viewing"); + #ifdef USE_SSL + if (buf->ssl_certificate) + Strcat_charp(msg, "[SSL]"); + #endif + Strcat_charp(msg, " <"); + Strcat_charp(msg, buf->buffername); + + if (s) { + int l = COLS - 3 - s->length; + if (msg->length > l) { + #ifdef JP_CHARSET + char *p; + int i; + for (p = msg->ptr; *p; p += i) { + i = get_mclen(get_mctype(p)); + l -= i; + if (l < 0) + break; + } + l = p - msg->ptr; + #endif + Strtruncate(msg, l); + } + Strcat_charp(msg, "> "); + Strcat(msg, s); + } + else { + Strcat_charp(msg, ">"); + } + return msg; + } void displayBuffer(Buffer *buf, int mode) { Str msg; ! int ny = 0; if (buf->topLine == NULL && readBufferCache(buf) == 0) { /* clear_buffer */ mode = B_FORCE_REDRAW; } if (buf->width == 0) ! buf->width = INIT_BUFFER_WIDTH; if (buf->height == 0) buf->height = LASTLINE + 1; ! if ((buf->width != INIT_BUFFER_WIDTH && ! ((buf->type && !strcmp(buf->type, "text/html")) || FoldLine)) ! || buf->need_reshape) { buf->need_reshape = TRUE; reshapeBuffer(buf); } *************** *** 253,276 **** else buf->rootX = 0; buf->COLS = COLS - buf->rootX; ! if (mode == B_FORCE_REDRAW || mode == B_SCROLL || ! #ifdef USE_IMAGE ! mode == B_REDRAW_IMAGE || #endif cline != buf->topLine || ccolumn != buf->currentColumn) { if ( #ifdef USE_IMAGE !(activeImage && displayImage && draw_image_flag) && #endif mode == B_SCROLL && cline && buf->currentColumn == ccolumn) { int n = buf->topLine->linenumber - cline->linenumber; ! if (n > 0 && n < LASTLINE) { move(LASTLINE, 0); clrtoeolx(); refresh(); scroll(n); } ! else if (n < 0 && n > -LASTLINE) { #if defined(__CYGWIN__) && LANG == JA move(LASTLINE + n + 1, 0); clrtoeolx(); --- 398,436 ---- else buf->rootX = 0; buf->COLS = COLS - buf->rootX; ! if (nTab > 1 ! #ifdef USE_MOUSE ! || mouse_action.menu_str #endif + ) { + if (mode == B_FORCE_REDRAW || mode == B_REDRAW_IMAGE) + calcTabPos(); + ny = LastTab->y + 2; + if (ny > LASTLINE) + ny = LASTLINE; + } + if (buf->rootY != ny || buf->LINES != LASTLINE - ny) { + buf->rootY = ny; + buf->LINES = LASTLINE - ny; + arrangeCursor(buf); + mode = B_REDRAW_IMAGE; + } + if (mode == B_FORCE_REDRAW || mode == B_SCROLL || mode == B_REDRAW_IMAGE || cline != buf->topLine || ccolumn != buf->currentColumn) { + #ifdef USE_RAW_SCROLL if ( #ifdef USE_IMAGE !(activeImage && displayImage && draw_image_flag) && #endif mode == B_SCROLL && cline && buf->currentColumn == ccolumn) { int n = buf->topLine->linenumber - cline->linenumber; ! if (n > 0 && n < buf->LINES) { move(LASTLINE, 0); clrtoeolx(); refresh(); scroll(n); } ! else if (n < 0 && n > -buf->LINES) { #if defined(__CYGWIN__) && LANG == JA move(LASTLINE + n + 1, 0); clrtoeolx(); *************** *** 280,286 **** } redrawNLine(buf, n); } ! else { #ifdef USE_IMAGE if (activeImage && (mode == B_REDRAW_IMAGE || --- 440,448 ---- } redrawNLine(buf, n); } ! else ! #endif ! { #ifdef USE_IMAGE if (activeImage && (mode == B_REDRAW_IMAGE || *************** *** 288,294 **** if (draw_image_flag) clear(); clearImage(); ! loadImage(IMG_FLAG_STOP); image_touch++; draw_image_flag = FALSE; } --- 450,456 ---- if (draw_image_flag) clear(); clearImage(); ! loadImage(buf, IMG_FLAG_STOP); image_touch++; draw_image_flag = FALSE; } *************** *** 308,386 **** } #endif ! #ifdef USE_MOUSE ! if (use_mouse) ! #if LANG == JA ! msg = Strnew_charp("「罎ャ「ュ"); ! #else /* LANG != JA */ ! msg = Strnew_charp("<=UpDn "); ! #endif /* LANG != JA */ ! else ! #endif /* not USE_MOUSE */ ! msg = Strnew(); ! if (displayLineInfo && buf->currentLine != NULL && buf->lastLine != NULL) { ! int cl = buf->currentLine->real_linenumber; ! int ll = buf->lastLine->real_linenumber; ! int r = (int)((double)cl * 100.0 / (double)ll + 0.5); ! Strcat(msg, Sprintf("%d/%d (%d%%)", cl, ll, r)); ! } ! else ! Strcat_charp(msg, "Viewing"); ! #ifdef USE_SSL ! if (buf->ssl_certificate) ! Strcat_charp(msg, "[SSL]"); ! #endif ! Strcat_charp(msg, " <"); ! Strcat_charp(msg, buf->buffername); ! if (displayLink) ! aa = retrieveCurrentAnchor(buf); ! if (aa) { ! ParsedURL url; ! Str s; ! int l; ! parseURL2(aa->url, &url, baseURL(buf)); ! s = parsedURL2Str(&url); ! l = buf->width - 2; ! if (s->length > l) { ! if (l >= 4) { ! msg = Strsubstr(s, 0, (l - 2) / 2); ! #if LANG == JA ! Strcat_charp(msg, "。ト"); ! #else /* LANG != JA */ ! Strcat_charp(msg, ".."); ! #endif /* LANG != JA */ ! l = buf->width - msg->length; ! Strcat(msg, Strsubstr(s, s->length - l, l)); ! } ! else { ! msg = s; ! } ! } ! else { ! l -= s->length; ! if (msg->length > l) { ! #ifdef JP_CHARSET ! char *bn = msg->ptr; ! int i, j; ! for (i = 0; bn[i]; i += j) { ! j = get_mclen(get_mctype(&bn[i])); ! if (i + j > l) ! break; ! } ! l = i; ! #endif ! Strtruncate(msg, l); ! } ! Strcat_charp(msg, "> "); ! Strcat(msg, s); ! } ! } ! else { ! Strcat_charp(msg, ">"); ! } if (buf->firstLine == NULL) { Strcat_charp(msg, "\tNo Line"); - clear(); } if (delayed_msg != NULL) { disp_message(delayed_msg, FALSE); --- 470,480 ---- } #endif ! drawAnchorCursor(buf); ! ! msg = make_lastline_message(buf); if (buf->firstLine == NULL) { Strcat_charp(msg, "\tNo Line"); } if (delayed_msg != NULL) { disp_message(delayed_msg, FALSE); *************** *** 388,402 **** refresh(); } standout(); ! message(msg->ptr, buf->cursorX + buf->rootX, buf->cursorY); standend(); ! term_title(buf->buffername); refresh(); #ifdef USE_IMAGE if (activeImage && displayImage && buf->img) { - /* - * loadImage(IMG_FLAG_START); - */ drawImage(); } #endif --- 482,493 ---- refresh(); } standout(); ! message(msg->ptr, buf->cursorX + buf->rootX, buf->cursorY + buf->rootY); standend(); ! term_title(conv_to_system(buf->buffername)); refresh(); #ifdef USE_IMAGE if (activeImage && displayImage && buf->img) { drawImage(); } #endif *************** *** 408,423 **** #endif } ! void ! redrawBuffer(Buffer *buf) { ! redrawNLine(buf, LASTLINE); } ! void redrawNLine(Buffer *buf, int n) { ! Line *l, *l0; int i; #ifdef USE_COLOR --- 499,584 ---- #endif } ! static void ! drawAnchorCursor0(Buffer *buf, AnchorList *al, int hseq, int prevhseq, ! int tline, int eline, int active) { ! int i, j; ! Line *l; ! Anchor *an; ! ! l = buf->topLine; ! for (j = 0; j < al->nanchor; j++) { ! an = &al->anchors[j]; ! if (an->start.line < tline) ! continue; ! if (an->start.line >= eline) ! return; ! for (;; l = l->next) { ! if (l == NULL) ! return; ! if (l->linenumber == an->start.line) ! break; ! } ! if (hseq >= 0 && an->hseq == hseq) { ! for (i = an->start.pos; i < an->end.pos; i++) { ! if (l->propBuf[i] & (PE_IMAGE | PE_ANCHOR | PE_FORM)) { ! if (active) ! l->propBuf[i] |= PE_ACTIVE; ! else ! l->propBuf[i] &= ~PE_ACTIVE; ! } ! } ! if (active) ! redrawLineRegion(buf, l, l->linenumber - tline + buf->rootY, ! an->start.pos, an->end.pos); ! } ! else if (prevhseq >= 0 && an->hseq == prevhseq) { ! if (active) ! redrawLineRegion(buf, l, l->linenumber - tline + buf->rootY, ! an->start.pos, an->end.pos); ! } ! } } ! static void ! drawAnchorCursor(Buffer *buf) ! { ! Anchor *an; ! int hseq, prevhseq; ! int tline, eline; ! ! if (!buf->firstLine || !buf->hmarklist) ! return; ! if (!buf->href && !buf->formitem) ! return; ! ! an = retrieveCurrentAnchor(buf); ! if (!an) ! an = retrieveCurrentMap(buf); ! if (an) ! hseq = an->hseq; ! else ! hseq = -1; ! tline = buf->topLine->linenumber; ! eline = tline + buf->LINES; ! prevhseq = buf->hmarklist->prevhseq; ! ! if (buf->href) { ! drawAnchorCursor0(buf, buf->href, hseq, prevhseq, tline, eline, 1); ! drawAnchorCursor0(buf, buf->href, hseq, -1, tline, eline, 0); ! } ! if (buf->formitem) { ! drawAnchorCursor0(buf, buf->formitem, hseq, prevhseq, tline, eline, 1); ! drawAnchorCursor0(buf, buf->formitem, hseq, -1, tline, eline, 0); ! } ! buf->hmarklist->prevhseq = hseq; ! } ! ! static void redrawNLine(Buffer *buf, int n) { ! Line *l; int i; #ifdef USE_COLOR *************** *** 428,459 **** #endif /* USE_BG_COLOR */ } #endif /* USE_COLOR */ ! for (i = 0, l = buf->topLine; i < LASTLINE; i++) { ! if (i >= LASTLINE - n || i < -n) ! l0 = redrawLine(buf, l, i); ! else { ! l0 = (l) ? l->next : NULL; ! } ! if (l0 == NULL && l == NULL) break; - l = l0; } ! if (n > 0) clrtobotx(); #ifdef USE_IMAGE if (!(activeImage && displayImage && buf->img)) return; ! move(buf->cursorY, buf->cursorX); ! for (i = 0, l = buf->topLine; i < LASTLINE; i++) { ! if (i >= LASTLINE - n || i < -n) ! l0 = redrawLineImage(buf, l, i); ! else { ! l0 = (l) ? l->next : NULL; ! } ! if (l0 == NULL && l == NULL) ! break; ! l = l0; } getAllImage(buf); #endif --- 589,656 ---- #endif /* USE_BG_COLOR */ } #endif /* USE_COLOR */ ! if (nTab > 1 ! #ifdef USE_MOUSE ! || mouse_action.menu_str ! #endif ! ) { ! TabBuffer *t; ! int l; ! ! move(0, 0); ! #ifdef USE_MOUSE ! if (mouse_action.menu_str) ! addstr(mouse_action.menu_str); ! #endif ! clrtoeolx(); ! for (t = FirstTab; t; t = t->nextTab) { ! move(t->y, t->x1); ! if (t == CurrentTab) ! bold(); ! addch('['); ! l = t->x2 - t->x1 - 1 - strlen(t->currentBuffer->buffername); ! if (l < 0) ! l = 0; ! if (l / 2 > 0) ! addnstr_sup(" ", l / 2); ! if (t == CurrentTab) ! EFFECT_ACTIVE_START; ! addnstr(t->currentBuffer->buffername, t->x2 - t->x1 - l); ! if (t == CurrentTab) ! EFFECT_ACTIVE_END; ! if ((l + 1) / 2 > 0) ! addnstr_sup(" ", (l + 1) / 2); ! move(t->y, t->x2); ! addch(']'); ! if (t == CurrentTab) ! boldend(); ! } ! #if 0 ! move(0, COLS - 2); ! addstr(" x"); ! #endif ! move(LastTab->y + 1, 0); ! for (i = 0; i < COLS; i++) ! addch('~'); ! } ! for (i = 0, l = buf->topLine; i < buf->LINES; i++, l = l->next) { ! if (i >= buf->LINES - n || i < -n) ! l = redrawLine(buf, l, i + buf->rootY); ! if (l == NULL) break; } ! if (n > 0) { ! move(i + buf->rootY, 0); clrtobotx(); + } #ifdef USE_IMAGE if (!(activeImage && displayImage && buf->img)) return; ! move(buf->cursorY + buf->rootY, buf->cursorX + buf->rootX); ! for (i = 0, l = buf->topLine; i < buf->LINES && l; i++, l = l->next) { ! if (i >= buf->LINES - n || i < -n) ! redrawLineImage(buf, l, i + buf->rootY); } getAllImage(buf); #endif *************** *** 461,467 **** #define addKanji(pc,pr) (addChar((pc)[0],(pr)[0]),addChar((pc)[1],(pr)[1])) ! Line * redrawLine(Buffer *buf, Line *l, int i) { int j, pos, rcol, ncol, delta; --- 658,664 ---- #define addKanji(pc,pr) (addChar((pc)[0],(pr)[0]),addChar((pc)[1],(pr)[1])) ! static Line * redrawLine(Buffer *buf, Line *l, int i) { int j, pos, rcol, ncol, delta; *************** *** 479,485 **** if (l == NULL) { if (buf->pagerSource) { ! l = getNextPage(buf, LASTLINE - i); if (l == NULL) return NULL; } --- 676,682 ---- if (l == NULL) { if (buf->pagerSource) { ! l = getNextPage(buf, buf->LINES + buf->rootY - i); if (l == NULL) return NULL; } *************** *** 499,505 **** buf->rootX = COLS; buf->COLS = COLS - buf->rootX; } ! if (l->real_linenumber) sprintf(tmp, "%*ld:", buf->rootX - 1, l->real_linenumber); else sprintf(tmp, "%*s ", buf->rootX - 1, ""); --- 696,702 ---- buf->rootX = COLS; buf->COLS = COLS - buf->rootX; } ! if (l->real_linenumber && !l->bpos) sprintf(tmp, "%*ld:", buf->rootX - 1, l->real_linenumber); else sprintf(tmp, "%*s ", buf->rootX - 1, ""); *************** *** 510,516 **** l->width = COLPOS(l, l->len); if (l->len == 0 || l->width - 1 < column) { clrtoeolx(); ! return l->next; } /* need_clrtoeol(); */ pos = columnPos(l, column); --- 707,713 ---- l->width = COLPOS(l, l->len); if (l->len == 0 || l->width - 1 < column) { clrtoeolx(); ! return l; } /* need_clrtoeol(); */ pos = columnPos(l, column); *************** *** 626,636 **** #endif if (rcol - column < buf->COLS) clrtoeolx(); ! return l->next; } #ifdef USE_IMAGE ! Line * redrawLineImage(Buffer *buf, Line *l, int i) { int j, pos, rcol; --- 823,833 ---- #endif if (rcol - column < buf->COLS) clrtoeolx(); ! return l; } #ifdef USE_IMAGE ! static Line * redrawLineImage(Buffer *buf, Line *l, int i) { int j, pos, rcol; *************** *** 643,649 **** if (l->width < 0) l->width = COLPOS(l, l->len); if (l->len == 0 || l->width - 1 < column) ! return l->next; pos = columnPos(l, column); rcol = COLPOS(l, pos); for (j = 0; rcol - column < buf->COLS && pos + j < l->len; j++) { --- 840,846 ---- if (l->width < 0) l->width = COLPOS(l, l->len); if (l->len == 0 || l->width - 1 < column) ! return l; pos = columnPos(l, column); rcol = COLPOS(l, pos); for (j = 0; rcol - column < buf->COLS && pos + j < l->len; j++) { *************** *** 696,706 **** } rcol = COLPOS(l, pos + j + 1); } ! return l->next; } #endif ! int redrawLineRegion(Buffer *buf, Line *l, int i, int bpos, int epos) { int j, pos, rcol, ncol, delta; --- 893,903 ---- } rcol = COLPOS(l, pos + j + 1); } ! return l; } #endif ! static int redrawLineRegion(Buffer *buf, Line *l, int i, int bpos, int epos) { int j, pos, rcol, ncol, delta; *************** *** 853,859 **** modeflag = FALSE; \ } ! void do_effects(Lineprop m) { /* effect end */ --- 1050,1056 ---- modeflag = FALSE; \ } ! static void do_effects(Lineprop m) { /* effect end */ *************** *** 898,904 **** } #ifdef USE_ANSI_COLOR ! void do_color(Linecolor c) { if (c & 0x8) --- 1095,1101 ---- } #ifdef USE_ANSI_COLOR ! static void do_color(Linecolor c) { if (c & 0x8) *************** *** 951,957 **** addch(' '); } ! GeneralList *message_list = NULL; void record_err_message(char *s) --- 1148,1154 ---- addch(' '); } ! static GeneralList *message_list = NULL; void record_err_message(char *s) *************** *** 999,1004 **** --- 1196,1208 ---- } void + disp_err_message(char *s, int redraw_current) + { + record_err_message(s); + disp_message(s, redraw_current); + } + + void disp_message_nsec(char *s, int redraw_current, int sec, int purge, int mouse) { if (QuietMessage) *************** *** 1007,1015 **** fprintf(stderr, "%s\n", conv_to_system(s)); return; } ! if (Currentbuf != NULL) message(s, Currentbuf->cursorX + Currentbuf->rootX, ! Currentbuf->cursorY); else message(s, LASTLINE, 0); refresh(); --- 1211,1219 ---- fprintf(stderr, "%s\n", conv_to_system(s)); return; } ! if (CurrentTab != NULL && Currentbuf != NULL) message(s, Currentbuf->cursorX + Currentbuf->rootX, ! Currentbuf->cursorY + Currentbuf->rootY); else message(s, LASTLINE, 0); refresh(); *************** *** 1022,1028 **** if (mouse && use_mouse) mouse_inactive(); #endif ! if (Currentbuf != NULL && redraw_current) displayBuffer(Currentbuf, B_NORMAL); } --- 1226,1232 ---- if (mouse && use_mouse) mouse_inactive(); #endif ! if (CurrentTab != NULL && Currentbuf != NULL && redraw_current) displayBuffer(Currentbuf, B_NORMAL); } *************** *** 1046,1055 **** } void ! cursorUp(Buffer *buf, int n) { - if (buf->firstLine == NULL) - return; if (buf->cursorY > 0) cursorUpDown(buf, -1); else { --- 1250,1257 ---- } void ! cursorUp0(Buffer *buf, int n) { if (buf->cursorY > 0) cursorUpDown(buf, -1); else { *************** *** 1061,1071 **** } void ! cursorDown(Buffer *buf, int n) { if (buf->firstLine == NULL) return; ! if (buf->cursorY < LASTLINE - 1) cursorUpDown(buf, 1); else { buf->topLine = lineSkip(buf, buf->topLine, n, FALSE); --- 1263,1290 ---- } void ! cursorUp(Buffer *buf, int n) { + Line *l = buf->currentLine; if (buf->firstLine == NULL) return; ! while (buf->currentLine->prev && buf->currentLine->bpos) ! cursorUp0(buf, n); ! if (buf->currentLine == buf->firstLine) { ! gotoLine(buf, l->linenumber); ! arrangeLine(buf); ! return; ! } ! cursorUp0(buf, n); ! while (buf->currentLine->prev && buf->currentLine->bpos && ! buf->currentLine->bwidth >= buf->currentColumn + buf->visualpos) ! cursorUp0(buf, n); ! } ! ! void ! cursorDown0(Buffer *buf, int n) ! { ! if (buf->cursorY < buf->LINES - 1) cursorUpDown(buf, 1); else { buf->topLine = lineSkip(buf, buf->topLine, n, FALSE); *************** *** 1076,1081 **** --- 1295,1320 ---- } void + cursorDown(Buffer *buf, int n) + { + Line *l = buf->currentLine; + if (buf->firstLine == NULL) + return; + while (buf->currentLine->next && buf->currentLine->next->bpos) + cursorDown0(buf, n); + if (buf->currentLine == buf->lastLine) { + gotoLine(buf, l->linenumber); + arrangeLine(buf); + return; + } + cursorDown0(buf, n); + while (buf->currentLine->next && buf->currentLine->next->bpos && + buf->currentLine->bwidth + buf->currentLine->width < + buf->currentColumn + buf->visualpos) + cursorDown0(buf, n); + } + + void cursorUpDown(Buffer *buf, int n) { Line *cl = buf->currentLine; *************** *** 1096,1102 **** if (buf->firstLine == NULL) return; ! if (buf->pos == l->len) return; i = buf->pos; p = l->propBuf; --- 1335,1341 ---- if (buf->firstLine == NULL) return; ! if (buf->pos == l->len && !(l->next && l->next->bpos)) return; i = buf->pos; p = l->propBuf; *************** *** 1110,1115 **** --- 1349,1360 ---- else if (l->len == 0) { buf->pos = 0; } + else if (l->next && l->next->bpos) { + cursorDown0(buf, 1); + buf->pos = 0; + arrangeCursor(buf); + return; + } else { buf->pos = l->len - 1; #ifdef JP_CHARSET *************** *** 1118,1124 **** #endif /* JP_CHARSET */ } cpos = COLPOS(l, buf->pos); ! buf->visualpos = cpos - buf->currentColumn; delta = 1; #ifdef JP_CHARSET if (CharType(p[buf->pos]) == PC_KANJI1) --- 1363,1369 ---- #endif /* JP_CHARSET */ } cpos = COLPOS(l, buf->pos); ! buf->visualpos = l->bwidth + cpos - buf->currentColumn; delta = 1; #ifdef JP_CHARSET if (CharType(p[buf->pos]) == PC_KANJI1) *************** *** 1127,1135 **** vpos2 = COLPOS(l, buf->pos + delta) - buf->currentColumn - 1; if (vpos2 >= buf->COLS && n) { columnSkip(buf, n + (vpos2 - buf->COLS) - (vpos2 - buf->COLS) % n); ! buf->visualpos = cpos - buf->currentColumn; } ! buf->cursorX = buf->visualpos; } void --- 1372,1380 ---- vpos2 = COLPOS(l, buf->pos + delta) - buf->currentColumn - 1; if (vpos2 >= buf->COLS && n) { columnSkip(buf, n + (vpos2 - buf->COLS) - (vpos2 - buf->COLS) % n); ! buf->visualpos = l->bwidth + cpos - buf->currentColumn; } ! buf->cursorX = buf->visualpos - l->bwidth; } void *************** *** 1147,1163 **** if (i >= 2 && CharType(p[i - 1]) == PC_KANJI2) delta = 2; #endif /* JP_CHARSET */ ! if (i > delta) buf->pos = i - delta; else buf->pos = 0; cpos = COLPOS(l, buf->pos); ! buf->visualpos = cpos - buf->currentColumn; ! if (buf->visualpos < 0 && n) { ! columnSkip(buf, -n + buf->visualpos - buf->visualpos % n); ! buf->visualpos = cpos - buf->currentColumn; } ! buf->cursorX = buf->visualpos; } void --- 1392,1416 ---- if (i >= 2 && CharType(p[i - 1]) == PC_KANJI2) delta = 2; #endif /* JP_CHARSET */ ! if (i >= delta) buf->pos = i - delta; + else if (l->prev && l->bpos) { + cursorUp0(buf, -1); + buf->pos = buf->currentLine->len - 1; + arrangeCursor(buf); + return; + } else buf->pos = 0; cpos = COLPOS(l, buf->pos); ! buf->visualpos = l->bwidth + cpos - buf->currentColumn; ! if (buf->visualpos - l->bwidth < 0 && n) { ! columnSkip(buf, ! -n + buf->visualpos - l->bwidth - (buf->visualpos - ! l->bwidth) % n); ! buf->visualpos = l->bwidth + cpos - buf->currentColumn; } ! buf->cursorX = buf->visualpos - l->bwidth; } void *************** *** 1175,1191 **** void arrangeCursor(Buffer *buf) { ! int col, col2; int delta = 1; if (buf == NULL || buf->currentLine == NULL) return; /* Arrange line */ ! if (buf->currentLine->linenumber - buf->topLine->linenumber >= LASTLINE || ! buf->currentLine->linenumber < buf->topLine->linenumber) { ! buf->topLine = buf->currentLine; } /* Arrange column */ ! if (buf->currentLine->len == 0) buf->pos = 0; else if (buf->pos >= buf->currentLine->len) buf->pos = buf->currentLine->len - 1; --- 1428,1458 ---- void arrangeCursor(Buffer *buf) { ! int col, col2, pos; int delta = 1; if (buf == NULL || buf->currentLine == NULL) return; /* Arrange line */ ! if (buf->currentLine->linenumber - buf->topLine->linenumber >= buf->LINES ! || buf->currentLine->linenumber < buf->topLine->linenumber) { ! /* ! * buf->topLine = buf->currentLine; ! */ ! buf->topLine = lineSkip(buf, buf->currentLine, 0, FALSE); } /* Arrange column */ ! while (buf->pos < 0 && buf->currentLine->prev && buf->currentLine->bpos) { ! pos = buf->pos + buf->currentLine->prev->len; ! cursorUp0(buf, 1); ! buf->pos = pos; ! } ! while (buf->pos >= buf->currentLine->len && buf->currentLine->next && ! buf->currentLine->next->bpos) { ! pos = buf->pos - buf->currentLine->len; ! cursorDown0(buf, 1); ! buf->pos = pos; ! } ! if (buf->currentLine->len == 0 || buf->pos < 0) buf->pos = 0; else if (buf->pos >= buf->currentLine->len) buf->pos = buf->currentLine->len - 1; *************** *** 1206,1213 **** } /* Arrange cursor */ buf->cursorY = buf->currentLine->linenumber - buf->topLine->linenumber; ! buf->visualpos = buf->cursorX = COLPOS(buf->currentLine, buf->pos) - buf->currentColumn; #ifdef DISPLAY_DEBUG fprintf(stderr, "arrangeCursor: column=%d, cursorX=%d, visualpos=%d, pos=%d, len=%d\n", --- 1473,1481 ---- } /* Arrange cursor */ buf->cursorY = buf->currentLine->linenumber - buf->topLine->linenumber; ! buf->visualpos = buf->currentLine->bwidth + COLPOS(buf->currentLine, buf->pos) - buf->currentColumn; + buf->cursorX = buf->visualpos - buf->currentLine->bwidth; #ifdef DISPLAY_DEBUG fprintf(stderr, "arrangeCursor: column=%d, cursorX=%d, visualpos=%d, pos=%d, len=%d\n", *************** *** 1224,1230 **** if (buf->firstLine == NULL) return; buf->cursorY = buf->currentLine->linenumber - buf->topLine->linenumber; ! i = columnPos(buf->currentLine, buf->currentColumn + buf->visualpos); cpos = COLPOS(buf->currentLine, i) - buf->currentColumn; if (cpos >= 0) { buf->cursorX = cpos; --- 1492,1499 ---- if (buf->firstLine == NULL) return; buf->cursorY = buf->currentLine->linenumber - buf->topLine->linenumber; ! i = columnPos(buf->currentLine, buf->currentColumn + buf->visualpos ! - buf->currentLine->bwidth); cpos = COLPOS(buf->currentLine, i) - buf->currentColumn; if (cpos >= 0) { buf->cursorX = cpos; *************** *** 1286,1291 **** --- 1555,1562 ---- FALSE); gotoLine(buf, CUR_LINENUMBER(orig)); buf->pos = orig->pos; + if (buf->currentLine && orig->currentLine) + buf->pos += orig->currentLine->bpos - buf->currentLine->bpos; buf->currentColumn = orig->currentColumn; arrangeCursor(buf); } diff -crN -x CVS w3m-0.3.2.2/doc/README.func w3m-js-1.743/doc/README.func *** w3m-0.3.2.2/doc/README.func 2002-09-06 00:43:22.000000000 +0900 --- w3m-js-1.743/doc/README.func 2003-01-24 21:59:01.000000000 +0900 *************** *** 1,4 **** --- 1,5 ---- ABORT Quit w3m without confirmation + ACCESSSKEY Popup acceskey menu ADD_BOOKMARK Add current page to bookmark ALARM Set alarm BACK Back to previous buffer *************** *** 6,11 **** --- 7,14 ---- BOOKMARK Read bookmark CENTER_H Move to the center line CENTER_V Move to the center column + CLOSE_TAB Close current tab + CLOSE_TAB_MOUSE Close tab on mouse cursor (for mouse action) COMMAND Execute w3m command(s) COOKIE View cookie list DEFINE_KEY Define a binding between a key stroke and a user command *************** *** 15,20 **** --- 18,24 ---- DISPLAY_IMAGE Restart loading and drawing of images DOWN Scroll down one line DOWNLOAD Save document source to file + DOWNLOAD_LIST Display download list panel EDIT Edit current document EDIT_SCREEN Edit currently rendered document END Go to the last line *************** *** 40,45 **** --- 44,52 ---- LINE_INFO Show current line number LINK_BEGIN Go to the first link LINK_END Go to the last link + LINK_MENU Popup link element menu + LIST Show all links and images + LIST_MENU Popup link list menu and go to selected link LOAD Load local file MAIN_MENU Popup menu MARK Set/unset mark *************** *** 47,62 **** --- 54,74 ---- MARK_URL Mark URL-like strings as anchors MARK_WORD Mark current word as anchor MENU Popup menu + MENU_MOUSE Popup menu at mouse cursor (for mouse action) MOUSE_TOGGLE Toggle activity of mouse MOVE_DOWN Move cursor down (a half screen scroll at the end of screen) MOVE_DOWN1 Move cursor down (1 line scroll at the end of screen) MOVE_LEFT Move cursor left (a half screen shift at the left edge) MOVE_LEFT1 Move cursor left (1 columns shift at the left edge) + MOVE_LIST_MENU Popup link list menu and move cursor to selected link + MOVE_MOUSE Move cursor to mouse cursor (for mouse action) MOVE_RIGHT Move cursor right (a half screen shift at the right edge) MOVE_RIGHT1 Move cursor right (1 columns shift at the right edge) MOVE_UP Move cursor up (a half screen scroll at the top of screen) MOVE_UP1 Move cursor up (1 line scrol at the top of screen) MSGS Display error messages + NEW_TAB Open new tab + NEXT Move to next buffer NEXT_DOWN Move to next downward link NEXT_LEFT Move to next left link NEXT_LEFT_UP Move to next left (or upward) link *************** *** 65,70 **** --- 77,83 ---- NEXT_PAGE Move to next page NEXT_RIGHT Move to next right link NEXT_RIGHT_DOWN Move to next right (or downward) link + NEXT_TAB Move to next tab NEXT_UP Move to next upward link NEXT_WORD Move to next word NOTHING Do nothing *************** *** 75,90 **** --- 88,108 ---- PEEK_LINK Peek link URL PIPE_BUF Send rendered document to pipe PIPE_SHELL Execute shell command and browse + PREV Move to previous buffer PREV_LINK Move to previous link PREV_MARK Move to previous mark PREV_PAGE Move to previous page + PREV_TAB Move to previous tab PREV_WORD Move to previous word PRINT Save buffer to file QUIT Quit w3m READ_SHELL Execute shell command and load + REDO Cancel the last undo REDRAW Redraw screen REG_MARK Set mark using regexp + REINIT Reload configuration files RELOAD Reload buffer + RESHAPE Re-render buffer RIGHT Shift screen one column right SAVE Save document source to file SAVE_IMAGE Save image to file *************** *** 106,111 **** --- 124,137 ---- STOP_IMAGE Stop loading and drawing of images SUBMIT Submit form SUSPEND Stop loading document + TAB_GOTO Open URL on new tab + TAB_GOTO_RELATIVE Open relative URL on new tab + TAB_LEFT Move current tab left + TAB_LINK Open current link on new tab + TAB_MENU Popup tab selection menu + TAB_MOUSE Move to tab on mouse cursor (for mouse action) + TAB_RIGHT Move current tab right + UNDO Cancel the last cursor movement UP Scroll up one line VERSION Display version of w3m VIEW View HTML source diff -crN -x CVS w3m-0.3.2.2/doc/README.mouse w3m-js-1.743/doc/README.mouse *** w3m-0.3.2.2/doc/README.mouse 1970-01-01 09:00:00.000000000 +0900 --- w3m-js-1.743/doc/README.mouse 2002-11-26 02:23:45.000000000 +0900 *************** *** 0 **** --- 1,61 ---- + ~/.w3m/mouse syntax: + + menu + lastline + button [] + + : 1 : left button + 2 : middle button + 3 : right button + + : menu : click on menu + lastline : click on last line + default : default action + anchor : click on anchor + active : click on active anchor + tab : click on tab + + : left column pos + : right column pos + + menu in can be omited for backward compatibility. + + default configuration (in func.c) + + + button 1 default MOVE_MOUSE + button 2 default BACK + button 3 default MENU_MOUSE + + button 1 active GOTO_LINK + + button 1 tab TAB_MOUSE + button 2 tab CLOSE_TAB_MOUSE + + lastline "<=UpDn" + button 1 lastline 0 1 BACK + button 1 lastline 2 3 PREV_PAGE + button 1 lastline 4 5 NEXT_PAGE + + For example + + - In ~/.w3m/mouse + + button 1 anchor COMMAND "MOVE_MOUSE; GOTO_LINK" + + you can jump to link by left click on non-active anchor. + + - In ~/.w3m/menu + + menu Active + func "Display LInk (a)" GOTO_LINK "a" + func "Open in new tag (t)" TAB_LINK "t" + func "Save link (d)" SAVE_LINK "d" + func "External browser (m)" EXTERN_LINK "m" + end + + and ~/.w3m/mouse + + button 3 anchor MENU_MOUSE Active + + then you can open menu by right click on anchor. diff -crN -x CVS w3m-0.3.2.2/doc/README.pre_form w3m-js-1.743/doc/README.pre_form *** w3m-0.3.2.2/doc/README.pre_form 1970-01-01 09:00:00.000000000 +0900 --- w3m-js-1.743/doc/README.pre_form 2003-01-11 11:38:48.000000000 +0900 *************** *** 0 **** --- 1,43 ---- + pre_form: Feature to configure form parameters when opening specific site. + + It would be convinient for sites where you often visit, but it may introduce + some security issues. Be careful to use this feature, especially `submit' + params described below. + + Default configuration file for pre_form is ~/.w3m/pre_form. + + Syntax as follows: + + url |// + form [] + text + file + password + checkbox [] + radio + section + submit [] + textarea + + : + /textarea + + If is set, form which has matched attributes + will be configured by this pre_form. + + The line begining with text, file, passwd, select, textarea means that + it will set value to in input, select or textarea element which + name attribute matches with . + + The line beginning with checkbox, radio means that it will check + input element which name and value attribute matches with and + respectively. If is 0, no, or off, disable check of the checkbox. + + The line beginning with submit means that it will submit input element which + name attribute matches with , or submit last + element if no specified. + + You quote \, ' (single-quote) or " (double quote) as you do in shell. + + + diff -crN -x CVS w3m-0.3.2.2/doc/README.tab w3m-js-1.743/doc/README.tab *** w3m-0.3.2.2/doc/README.tab 1970-01-01 09:00:00.000000000 +0900 --- w3m-js-1.743/doc/README.tab 2002-11-06 02:24:47.000000000 +0900 *************** *** 0 **** --- 1,45 ---- + w3m tab browsing + + No default keybinding for tab browsing. Pleaes configure following + function to appropriate keys: + + NEW_TAB open new tab, clone current page + TAB_LINK open document refered by link in a new tab + Num(N) + TAB_LINK will open in Nth tab + TAB_GOTO open URL in a new tab + Num(N) + TAB_GOTO will open in Nth tab + TAB_GOTO_RELATIVE + open relative URL in a new tab + Num(N) + TAB_GOTO_RELATIVE will open in Nth tab + CLOSE_TAB close current tab + Num(N) + CLOSE_TAB will close Nth tab + NEXT_TAB change to next tab + Num(N) + NEXT_TAB will change to Nth next tab + PREV_TAB change to prev tab + Num(N) + PREV_TAB will change to Nth prev tab + TAB_RIGHT move current tab to right + Num(N) + TAB_RIGHT will move current tab to N right + TAB_LEFT move current tab to left + Num(N) + TAB_LEFT will move current tab to N left + TAB_MENU open tab selection menu + operation in tab selection menu is same as operation + in buffer selection menu + + You can operate with mouse + + left button .. move the tab if you click on the tab + dragging a tab to another tab will move tab + dragging a link to tab will open the link in the tab + clicking on right upper `x' will current tab + middle button .. close the tab if you clink on the tab + right button .. open menu as usual + + Options: + + open_tab_blank ... open new tab if target is _blank or _new + default: OFF + close_tab_back ... close the tab when you back from last buffer in the tab + default: OFF (= Can't back...) + + + diff -crN -x CVS w3m-0.3.2.2/doc/keymap.default w3m-js-1.743/doc/keymap.default *** w3m-0.3.2.2/doc/keymap.default 2002-09-06 00:43:22.000000000 +0900 --- w3m-js-1.743/doc/keymap.default 2002-12-13 22:15:54.000000000 +0900 *************** *** 24,31 **** --- 24,33 ---- keymap C-m GOTO_LINK keymap C-n MOVE_DOWN keymap C-p MOVE_UP + keymap C-q CLOSE_TAB keymap C-r ISEARCH_BACK keymap C-s ISEARCH + keymap C-t TAB_LINK keymap C-u PREV_LINK keymap C-v NEXT_PAGE keymap C-w WRAP_TOGGLE *************** *** 36,52 **** keymap \" REG_MARK keymap # PIPE_SHELL keymap $ LINE_END keymap , LEFT keymap . RIGHT keymap / SEARCH keymap : MARK_URL ! keymap ; MARK_WORD keymap < SHIFT_LEFT keymap = INFO keymap > SHIFT_RIGHT keymap ? SEARCH_BACK keymap @ READ_SHELL keymap B BACK keymap E EDIT keymap F FRAME keymap G END --- 38,59 ---- keymap \" REG_MARK keymap # PIPE_SHELL keymap $ LINE_END + keymap ( UNDO + keymap ) REDO + keymap + NEXT_PAGE keymap , LEFT + keymap - PREV_PAGE keymap . RIGHT keymap / SEARCH keymap : MARK_URL ! keymap ; MARK_WORD keymap < SHIFT_LEFT keymap = INFO keymap > SHIFT_RIGHT keymap ? SEARCH_BACK keymap @ READ_SHELL keymap B BACK + keymap D DOWNLOAD_LIST keymap E EDIT keymap F FRAME keymap G END *************** *** 54,64 **** --- 61,73 ---- keymap I VIEW_IMAGE keymap J UP keymap K DOWN + keymap L LIST keymap M EXTERN keymap N SEARCH_PREV keymap Q EXIT keymap R RELOAD keymap S SAVE_SCREEN + keymap T NEW_TAB keymap U GOTO keymap V LOAD keymap W PREV_WORD *************** *** 75,88 **** keymap j MOVE_DOWN keymap k MOVE_UP keymap l MOVE_RIGHT keymap n SEARCH_NEXT keymap o OPTIONS keymap q QUIT ! keymap s SELECT_MENU keymap u PEEK_LINK keymap v VIEW keymap w NEXT_WORD keymap z CENTER_V keymap M-TAB PREV_LINK keymap M-C-j SAVE_LINK --- 84,102 ---- keymap j MOVE_DOWN keymap k MOVE_UP keymap l MOVE_RIGHT + keymap m MOUSE_TOGGLE keymap n SEARCH_NEXT keymap o OPTIONS keymap q QUIT ! keymap r VERSION ! keymap s SELECT_MENU keymap u PEEK_LINK keymap v VIEW keymap w NEXT_WORD keymap z CENTER_V + keymap { PREV_TAB + keymap | PIPE_BUF + keymap } NEXT_TAB keymap M-TAB PREV_LINK keymap M-C-j SAVE_LINK *************** *** 96,106 **** --- 110,126 ---- keymap M-W DICT_WORD_AT keymap M-a ADD_BOOKMARK keymap M-b BOOKMARK + keymap M-c COMMAND keymap M-e EDIT_SCREEN keymap M-g GOTO_LINE + keymap M-k DEFINE_KEY + keymap M-l LIST_MENU + keymap M-m MOVE_LIST_MENU keymap M-n NEXT_MARK + keymap M-o SET_OPTION keymap M-p PREV_MARK keymap M-s SAVE + keymap M-t TAB_MENU keymap M-u GOTO_RELATIVE keymap M-v PREV_PAGE keymap M-w DICT_WORD diff -crN -x CVS w3m-0.3.2.2/doc/keymap.lynx w3m-js-1.743/doc/keymap.lynx *** w3m-0.3.2.2/doc/keymap.lynx 2002-01-24 02:19:47.000000000 +0900 --- w3m-js-1.743/doc/keymap.lynx 2002-12-13 22:15:54.000000000 +0900 *************** *** 24,31 **** --- 24,34 ---- keymap C-m GOTO_LINK keymap C-n NEXT_LINK keymap C-p PREV_LINK + keymap C-q CLOSE_TAB keymap C-r RELOAD keymap C-s SEARCH + keymap C-t TAB_LINK + keymap C-u PREV_LINK keymap C-v NEXT_PAGE keymap C-w REDRAW keymap C-z SUSPEND *************** *** 35,50 **** --- 38,59 ---- keymap \" REG_MARK keymap # PIPE_SHELL keymap $ LINE_END + keymap ( UNDO + keymap ) REDO keymap + NEXT_PAGE + keymap , LEFT keymap - PREV_PAGE + keymap . RIGHT keymap / SEARCH keymap : MARK_URL + keymap ; MARK_WORD keymap < SHIFT_LEFT keymap = INFO keymap > SHIFT_RIGHT keymap ? HELP keymap @ READ_SHELL keymap B BACK + keymap D DOWNLOAD_LIST keymap E EDIT keymap F FRAME keymap G GOTO_LINE *************** *** 52,67 **** --- 61,81 ---- keymap I VIEW_IMAGE keymap J UP keymap K DOWN + keymap L LIST keymap M EXTERN keymap N NEXT_MARK keymap P PREV_MARK keymap Q EXIT keymap R RELOAD keymap S SAVE_SCREEN + keymap T NEW_TAB keymap U GOTO keymap V LOAD + keymap W PREV_WORD keymap Z CENTER_H + keymap [ LINK_BEGIN keymap \\ SOURCE + keymap ] LINK_END keymap \^ LINE_BEGIN keymap a ADD_BOOKMARK keymap b PREV_PAGE *************** *** 73,101 **** keymap j MOVE_DOWN keymap k MOVE_UP keymap l MOVE_RIGHT keymap n SEARCH_NEXT keymap o OPTIONS keymap p SAVE_SCREEN keymap q QUIT ! keymap s SELECT_MENU keymap u PEEK_LINK keymap v BOOKMARK ! keymap w WRAP_TOGGLE keymap z CENTER_V keymap M-TAB PREV_LINK keymap M-C-j SAVE_LINK keymap M-C-m SAVE_LINK keymap M-: MARK_MID keymap M-I SAVE_IMAGE keymap M-M EXTERN_LINK keymap M-a ADD_BOOKMARK keymap M-b BOOKMARK keymap M-e EDIT_SCREEN keymap M-s SAVE keymap M-u GOTO_RELATIVE keymap M-v PREV_PAGE keymap UP PREV_LINK keymap DOWN NEXT_LINK --- 87,133 ---- keymap j MOVE_DOWN keymap k MOVE_UP keymap l MOVE_RIGHT + keymap m MOUSE_TOGGLE keymap n SEARCH_NEXT keymap o OPTIONS keymap p SAVE_SCREEN keymap q QUIT ! keymap r VERSION ! keymap s SELECT_MENU keymap u PEEK_LINK keymap v BOOKMARK ! keymap w NEXT_WORD keymap z CENTER_V + keymap { PREV_TAB + keymap | PIPE_BUF + keymap } NEXT_TAB keymap M-TAB PREV_LINK keymap M-C-j SAVE_LINK keymap M-C-m SAVE_LINK keymap M-: MARK_MID + keymap M-< BEGIN + keymap M-> END keymap M-I SAVE_IMAGE keymap M-M EXTERN_LINK + keymap M-W DICT_WORD_AT keymap M-a ADD_BOOKMARK keymap M-b BOOKMARK + keymap M-c COMMAND keymap M-e EDIT_SCREEN + keymap M-g GOTO_LINE + keymap M-k DEFINE_KEY + keymap M-l LIST_MENU + keymap M-m MOVE_LIST_MENU + keymap M-n NEXT_MARK + keymap M-o SET_OPTION + keymap M-p PREV_MARK keymap M-s SAVE + keymap M-t TAB_MENU keymap M-u GOTO_RELATIVE keymap M-v PREV_PAGE + keymap M-w DICT_WORD keymap UP PREV_LINK keymap DOWN NEXT_LINK diff -crN -x CVS w3m-0.3.2.2/doc/menu.default w3m-js-1.743/doc/menu.default *** w3m-0.3.2.2/doc/menu.default 2001-11-08 14:16:15.000000000 +0900 --- w3m-js-1.743/doc/menu.default 2002-12-13 22:15:54.000000000 +0900 *************** *** 12,18 **** menu Main func " Back (b) " BACK "b" ! func " Select Buffer(s) " SELECT "s" func " View Source (v) " VIEW "vV" func " Edit Source (e) " EDIT "eE" func " Save Source (S) " SAVE "S" --- 12,19 ---- menu Main func " Back (b) " BACK "b" ! popup " Select Buffer(s) " Select "s" ! popup " Select Tab (t) " SelectTab "tT" func " View Source (v) " VIEW "vV" func " Edit Source (e) " EDIT "eE" func " Save Source (S) " SAVE "S" *************** *** 20,25 **** --- 21,27 ---- nop " -----------------" func " Go Link (a) " GOTO_LINK "a" + func " on New Tab (n) " TAB_LINK "nN" func " Save Link (A) " SAVE_LINK "A" func " View Image (i) " VIEW_IMAGE "i" func " Save Image (I) " SAVE_IMAGE "I" diff -crN -x CVS w3m-0.3.2.2/doc/w3m.1 w3m-js-1.743/doc/w3m.1 *** w3m-0.3.2.2/doc/w3m.1 2001-11-21 13:29:14.000000000 +0900 --- w3m-js-1.743/doc/w3m.1 2002-11-12 22:18:55.000000000 +0900 *************** *** 53,67 **** .B -l line # of preserved line (default 10000) .TP - .B -s - Shift_JIS - .TP - .B -j - JIS - .TP - .B -e - EUC-JP - .TP .B -B load bookmark .TP --- 53,58 ---- *************** *** 123,128 **** --- 114,125 ---- .B -no-mouse don't use mouse .TP + .B -cookie + use cookie. + .TP + .B -no-cookie + don't use cookie + .TP .B -pauth user:pass proxy authentication .TP *************** *** 135,146 **** --- 132,156 ---- .B -X don't use termcap init/deinit .TP + .B -title [=TERM] + set buffer name to termianl title string. + If TERM is specified, use the TERM style title configuration. + .TP .B -o opt=value assign value to config option .TP + .B -show-option + show all available config option + .TP .B -config file specify config file .TP + .B -help + show usage + .TP + .B -version + show w3m version + .TP .B -debug DO NOT USE .SH EXAMPLES diff -crN -x CVS w3m-0.3.2.2/doc-jp/README.func w3m-js-1.743/doc-jp/README.func *** w3m-0.3.2.2/doc-jp/README.func 2002-09-06 00:43:22.000000000 +0900 --- w3m-js-1.743/doc-jp/README.func 2003-01-24 21:59:02.000000000 +0900 *************** *** 1,4 **** --- 1,5 ---- ABORT ウホヌァ、サ、コ、ヒw3m、スェホサ、キ、゙、ケ + ACCESSKEY Accesskey ・皈ヒ・蝪シ、ホゥ、チセ螟イ、゙、ケ ALARM ・「・鬘シ・爨タ゚ト熙キ、゙、ケ ADD_BOOKMARK クスコ゚クォ、ニ、、、・レ。シ・ク、・ヨ・テ・ッ・゙。シ・ッ、ヒトノイテ、キ、゙、ケ BACK ー、トチー、ホ・ミ・テ・ユ・。、ノスシィ、キ、゙、ケ *************** *** 6,11 **** --- 7,14 ---- BOOKMARK ・ヨ・テ・ッ・゙。シ・ッ、ニノ、゚ケ、゚、゙、ケ CENTER_H ・ォ。シ・ス・、ホ、「、ーフテヨ、ケヤ、ホテ豎、ヒーワニー、キ、゙、ケ CENTER_V ・ォ。シ・ス・、ホ、「、ケヤ、イ靂フ、ホテ豎、ヒーワニー、キ、゙、ケ + CLOSE_TAB クスコ゚、ホ・ソ・ヨ、ハト、ク、゙、ケ + CLOSE_TAB_MOUSE ・゙・ヲ・ケ・ォ。シ・ス・、ホーフテヨ、ホ・ソ・ヨ、ハト、ク、゙、ケ(・゙・ヲ・ケチ犲ヘム) COMMAND w3m、ホ・ウ・゙・・ノ、シツケヤ、キ、゙、ケ COOKIE ・ッ・テ・ュ。シーヘ、ノスシィ、キ、゙、ケ DEFINE_KEY ・ュ。シニホマ、ネ・ウ・゙・・ノ、ホツミア、トオチ、キ、゙、ケ *************** *** 15,20 **** --- 18,24 ---- DISPLAY_IMAGE イ霖、ホニノケ/ノスシィ、コニウォ、キ、゙、ケ DOWN イ靂フ、1ケヤイシ、ヒ・ケ・ッ・。シ・、キ、゙、ケ DOWNLOAD ハクス、ホ・ス。シ・ケ、・ユ・。・、・、ヒハンツク、キ、゙、ケ + DOWNLOAD_LIST ・タ・ヲ・・。シ・ノセカキ、ホーヘ、ノスシィ、キ、゙、ケ EDIT ・ス。シ・ケ・ユ・。・、・、・ィ・ヌ・」・ソ、ヌハヤスク、キ、゙、ケ EDIT_SCREEN ・ミ・テ・ユ・。、ホノスシィニ簣ニ、・ィ・ヌ・」・ソ、ヌハヤスク、キ、゙、ケ END ハクス、ホ、、、チ、ミ、イシ、ホケヤ、ヒーワニー、キ、゙、ケ *************** *** 40,45 **** --- 44,52 ---- LINE_INFO ・レ。シ・クテ讀ヌ、ホクスコ゚ーフテヨ、ノスシィ、キ、゙、ケ LINK_BEGIN コヌス鬢ホ・・・ッ、ヒーワニー、キ、゙、ケ LINK_END コヌク螟ホ・・・ッ、ヒーワニー、キ、゙、ケ + LINK_MENU Link ヘラチヌーヘ、ホ・皈ヒ・蝪シ、ホゥ、チセ螟イ、゙、ケ + LIST ・・・ッ、ネイ霖、ホーヘ、ノスシィ、キ、゙、ケ + LIST_MENU ・・・ッタ隹ヘ、ホ・皈ヒ・蝪シ、ホゥ、チセ螟イ。「・・・ッタ隍ホハクス、ニノ、゚、ウ、゚、゙、ケ LOAD ・。シ・ォ・・ユ・。・、・、サリト熙キ、ニウォ、ュ、゙、ケ MAIN_MENU ・皈ヒ・蝪シ、ホゥ、チセ螟イ、゙、ケ MARK ・゙。シ・ッ、タ゚ト遙ソイス、キ、゙、ケ *************** *** 47,62 **** --- 54,74 ---- MARK_URL URLノ、ホハクサホ、・・・ッ、ヒ、キ、゙、ケ MARK_WORD ・ォ。シ・ス・、ホ、「、ク、・・・ッ、ヒ、キ、゙、ケ MENU ・皈ヒ・蝪シ、ホゥ、チセ螟イ、゙、ケ + MENU_MOUSE ・゙・ヲ・ケ・ォ。シ・ス・、ホーフテヨ、ヌ・皈ヒ・蝪シ、ホゥ、チセ螟イ、゙、ケ(・゙・ヲ・ケチ犲ヘム) MOUSE_TOGGLE ・゙・ヲ・ケ、ホヘュク/フオク、・ネ・ー・、ケ、 MOVE_DOWN ・ォ。シ・ス・、イシ、ヒーワニー、キ、゙、ケ(イ・レ。シ・クサ、ヒ、マネセ・レ。シ・ク・ケ・ッ・。シ・) MOVE_DOWN1 ・ォ。シ・ス・、イシ、ヒーワニー、キ、゙、ケ(イ・レ。シ・クサ、ヒ、マ」アケヤ・ケ・ッ・。シ・) MOVE_LEFT ・ォ。シ・ス・、コク、ヒーワニー、キ、゙、ケ(コクテシ、ホセケ遉ヒ、マネセイ靂フハャ・キ・ユ・ネ) MOVE_LEFT1 ・ォ。シ・ス・、コク、ヒーワニー、キ、゙、ケ(コクテシ、ホセケ遉ヒ、マ」アハクサハャ・キ・ユ・ネ) + MOVE_LIST_MENU ・・・ッタ隹ヘ、ホ・皈ヒ・蝪シ、ホゥ、チセ螟イ。「・ォ。シ・ス・、ーワニー、キ、゙、ケ + MOVE_MOUSE ・ォ。シ・ス・、・゙・ヲ・ケ・ォ。シ・ス・、ホーフテヨ、ヒーワニー、キ、゙、ケ(・゙・ヲ・ケチ犲ヘム) MOVE_RIGHT ・ォ。シ・ス・、アヲ、ヒーワニー、キ、゙、ケ(アヲテシ、ホセケ遉ヒ、マネセイ靂フハャ・キ・ユ・ネ) MOVE_RIGHT1 ・ォ。シ・ス・、アヲ、ヒーワニー、キ、゙、ケ(アヲテシ、ホセケ遉ヒ、マ」アハクサハャ・キ・ユ・ネ) MOVE_UP ・ォ。シ・ス・、セ螟ヒーワニー、キ、゙、ケ(イ・レ。シ・クサ、ヒ、マネセ・レ。シ・ク・ケ・ッ・。シ・) MOVE_UP1 ・ォ。シ・ス・、セ螟ヒーワニー、キ、゙、ケ(イ・レ。シ・クサ、ヒ、マ」アケヤ・ケ・ッ・。シ・) MSGS ・ィ・鬘シ・皈テ・サ。シ・ク、ホーヘ、ホノスシィ + NEW_TAB ソキ、キ、、・ソ・ヨ、ウォ、ュ、゙、ケ + NEXT シ。、ホ・ミ・テ・ユ・。、ノスシィ、キ、゙、ケ NEXT_DOWN ・ォ。シ・ス・、ホイシツヲ、ヒ、「、・・・ッ、ヒーワニー、キ、゙、ケ NEXT_LEFT ・ォ。シ・ス・、ホコクツヲ、ヒ、「、・・・ッ、ヒーワニー、キ、゙、ケ NEXT_LEFT_UP ・ォ。シ・ス・、ホコクツヲ(フオ、ア、、ミチー、ホケヤーハチー)、ヒ、「、・・・ッ、ヒーワニー、キ、゙、ケ *************** *** 65,70 **** --- 77,83 ---- NEXT_PAGE シ。、ホ・レ。シ・ク、ノスシィ、キ、゙、ケ NEXT_RIGHT ・ォ。シ・ス・、ホアヲツヲ、ヒ、「、・・・ッ、ヒーワニー、キ、゙、ケ NEXT_RIGHT_DOWN ・ォ。シ・ス・、ホアヲツヲ(フオ、ア、、ミシ。ケヤーハケ゚)、ヒ、「、・・・ッ、ヒーワニー、キ、゙、ケ + NEXT_TAB シ。、ホ・ソ・ヨ、ヒーワニー、キ、゙、ケ NEXT_UP ・ォ。シ・ス・、ホセ蠶ヲ、ヒ、「、・・・ッ、ヒーワニー、キ、゙、ケ NEXT_WORD シ。、ホテアク、ヒーワニー、キ、゙、ケ NOTHING イソ、筅キ、゙、サ、 *************** *** 75,90 **** --- 88,108 ---- PEEK_LINK ・・・ッ、ャサリ、ケタ隍ホURL、ノスシィ、キ、゙、ケ PIPE_BUF ・ミ・テ・ユ・。、ホニ簣ニ、・ム・、・ラ、ヒナマ、キ、゙、ケ PIPE_SHELL ・ウ・゙・・ノ、シツケヤ、キ。、キイフ、ニノ、゚、ウ、゚、ハ、ャ、鯔スシィ、キ、゙、ケ + PREV チー、ホ・ミ・テ・ユ・。、ノスシィ、キ、゙、ケ PREV_LINK チー、ホ・・・ッ、ヒーワニー、キ、゙、ケ PREV_MARK ー、トチー、ホ・゙。シ・ッ、ヒーワニー、キ、゙、ケ PREV_PAGE チー、ホ・レ。シ・ク、ノスシィ、キ、゙、ケ + PREV_TAB チー、ホ・ソ・ヨ、ヒーワニー、キ、゙、ケ PREV_WORD チー、ホテアク、ヒーワニー、キ、゙、ケ PRINT ・ミ・テ・ユ・。、ホノスシィニ簣ニ、・ユ・。・、・、ヒハンツク、キ、゙、ケ QUIT w3m、スェホサ、キ、゙、ケ READ_SHELL ・ウ・゙・・ノ、シツケヤ、キ。、キイフ、チエノニノ、、ヌ、ォ、鯔スシィ、キ、゙、ケ + REDO Undo 、シ隍セテ、キ、゙、ケ REDRAW コニノチイ隍キ、゙、ケ REG_MARK タオオャノスクス、ヌサリト熙オ、、ソハクサホ、チエ、ニ・゙。シ・ッ、キ、゙、ケ + REINIT タ゚ト・ユ・。・、・、コニニノケ、キ、゙、ケ。」 RELOAD ・ミ・テ・ユ・。、コニナルニノ、゚ケ、゚、゙、ケ + RESHAPE コニ・・・タ・・・ー、ケ、 RIGHT イ靂フチエツホ、1ハクサアヲ、ヒ、コ、鬢キ、゙、ケ SAVE ハクス、ホ・ス。シ・ケ、・ユ・。・、・、ヒハンツク、キ、゙、ケ SAVE_IMAGE ・・・ッ、ャサリ、ケイ霖、・ユ・。・、・、ヒハンツク、キ、゙、ケ *************** *** 106,111 **** --- 124,137 ---- STOP_IMAGE イ霖、ホニノケ/ノスシィ、ト莉゚、キ、゙、ケ SUBMIT ・ユ・ゥ。シ・爨ヒ・オ・ヨ・゚・テ・ネ、キ、゙、ケ SUSPEND ・オ・ケ・レ・・ノ + TAB_GOTO URL、サリト熙キ、ニソキ、キ、、・ソ・ヨ、ヌウォ、ュ、゙、ケ + TAB_GOTO_RELATIVE チツミURL、サリト熙キ、ニソキ、キ、、・ソ・ヨ、ヌウォ、ュ、゙、ケ + TAB_LEFT クスコ゚、ホ・ソ・ヨ、コク、ヒーワニー、キ、゙、ケ + TAB_LINK ・・・ッ、ャサリ、ケタ隍ホハクス、ソキ、キ、、・ソ・ヨ、ヌウォ、ュ、゙、ケ + TAB_MENU ・ソ・ヨチェツ・皈ヒ・蝪シ、ホゥ、チセ螟イ、゙、ケ + TAB_MOUSE ・゙・ヲ・ケ・ォ。シ・ス・、ホーフテヨ、ホ・ソ・ヨ、ヒーワニー、キ、゙、ケ(・゙・ヲ・ケチ犲ヘム) + TAB_RIGHT クスコ゚、ホ・ソ・ヨ、アヲ、ヒーワニー、キ、゙、ケ + UNDO コヌク螟ホ・ォ。シ・ス・ーワニー、シ隍セテ、キ、゙、ケ UP イ靂フ、1ケヤセ螟ヒ・ケ・ッ・。シ・、キ、゙、ケ VERSION w3m 、ホ・ミ。シ・ク・逾、ノスシィ、キ、゙、ケ VIEW HTML、ホ・ス。シ・ケ、ノスシィ、キ、゙、ケ diff -crN -x CVS w3m-0.3.2.2/doc-jp/README.menu w3m-js-1.743/doc-jp/README.menu *** w3m-0.3.2.2/doc-jp/README.menu 2001-11-08 14:16:37.000000000 +0900 --- w3m-js-1.743/doc-jp/README.menu 2002-11-28 01:29:44.000000000 +0900 *************** *** 1,6 **** w3m 、ホ・皈ヒ・蝪シ、ヒ、ト、、、ニ ! (1999/11/03) コ萢ワ ケタツァ hsaka@mth.biglobe.ne.jp [1] ・ュ。シチ犲 --- 1,6 ---- w3m 、ホ・皈ヒ・蝪シ、ヒ、ト、、、ニ ! (2002/11/27) コ萢ワ ケタツァ hsaka@mth.biglobe.ne.jp [1] ・ュ。シチ犲 *************** *** 13,22 **** --- 13,28 ---- BS(C-h), DEL(C-?), 「ォ・ュ。シ : フ皃 C-n, j, 「ュ・ュ。シ : イシ、ホケ猯ワ、リ C-p, k, 「ャ・ュ。シ : セ螟ホケ猯ワ、リ + J : ケ猯ワ、セ螟ヒ・ケ・ッ・。シ・ + K : ケ猯ワ、イシ、ヒ・ケ・ッ・。シ・ C-a : タ霹ャ、ホケ猯ワ、リ C-e : コヌク螟ホケ猯ワ、リ C-f, C-v : シ。・レ。シ・ク、ホケ猯ワ、リ C-b, M-v : チー・レ。シ・ク、ホケ猯ワ、リ + C-s, / : ケ猯ワ、イシ、ヒク、ォ、テ、ニク。コ + C-r, ? : ケ猯ワ、セ螟ヒク、ォ、テ、ニク。コ + n : シ。、ホケ猯ワ、ク。コ + N : チー、ホケ猯ワ、ク。コ C-z : ・オ・ケ・レ・・ノ # INS 、マトフセ ^[[2~ 、ヌ、ケ、ャ ^[[L(・ウ・・ス。シ・), ^[[E(PocketBSD) 、ヒ、 *************** *** 41,46 **** --- 47,53 ---- 。 (マネウー) : フ皃(・皈ヒ・蝪シ、ホセテオ) 。 ( : ) : シ。・レ。シ・ク、゙、ソ、マチー・レ。シ・ク、ホケ猯ワ、リ (トケ、、・皈ヒ・蝪シ、ホセケ) + 。 (・ノ・鬣テ・ー) : ・ケ・ッ・。シ・ [3] ・皈ヒ・蝪シ、ホ・ォ・ケ・ソ・゙・、・コ *************** *** 62,68 **** ホ网マ menu.default 、 menu.submenu 、クォ、ニ、ッ、タ、オ、、。」 タ゚ト熙ヌ、ュ、・ウ・゙・・ノ(FUNCTION)、マ README.func 、クォ、ニ、ッ、タ、オ、、。」 MENU_ID 、ネ、キ、ニ "Main" 、マ・皈、・・皈ヒ・蝪シ、ヒ。「"Select" 、マ・ミ・テ・ユ・。チェツ ! ・皈ヒ・蝪シ、ヒヘスフ、オ、、ニ、、、゙、ケ。」 KEYS 、マ・ミ・、・・ノ、ケ、・ュ。シ、ヌハ」ソサリトイトヌス、ヌ、ケ。」 DATA 、ャタ゚ト熙オ、、ニ、、、、ミ・ウ・゙・・ノ(FUNCTION)、ホーソ、ネ、キ、ニサネ、、、゙、ケ。」 --- 69,75 ---- ホ网マ menu.default 、 menu.submenu 、クォ、ニ、ッ、タ、オ、、。」 タ゚ト熙ヌ、ュ、・ウ・゙・・ノ(FUNCTION)、マ README.func 、クォ、ニ、ッ、タ、オ、、。」 MENU_ID 、ネ、キ、ニ "Main" 、マ・皈、・・皈ヒ・蝪シ、ヒ。「"Select" 、マ・ミ・テ・ユ・。チェツ ! ・皈ヒ・蝪シ、ヒ。「"SelectTab" 、マ・ソ・ヨチェツ・皈ヒ・蝪シ、ヒヘスフ、オ、、ニ、、、゙、ケ。」 KEYS 、マ・ミ・、・・ノ、ケ、・ュ。シ、ヌハ」ソサリトイトヌス、ヌ、ケ。」 DATA 、ャタ゚ト熙オ、、ニ、、、、ミ・ウ・゙・・ノ(FUNCTION)、ホーソ、ネ、キ、ニサネ、、、゙、ケ。」 diff -crN -x CVS w3m-0.3.2.2/doc-jp/README.mouse w3m-js-1.743/doc-jp/README.mouse *** w3m-0.3.2.2/doc-jp/README.mouse 1970-01-01 09:00:00.000000000 +0900 --- w3m-js-1.743/doc-jp/README.mouse 2002-11-26 02:23:47.000000000 +0900 *************** *** 0 **** --- 1,66 ---- + ~/.w3m/mouse 、ホキチシー、マ。「 + + menu ・皈ヒ・蝪シ、ホハクサホ(・ヌ・ユ・ゥ・・ネ、ハ、キ) + lastline コヌイシケヤ、ホハクサホ(・ヌ・ユ・ゥ・・ネ。リ「罎ャ「ュ。ル) + button ネヨケ ーフテヨ エリソ [ーソ] + + + ネヨケ: 1。トコク・ワ・ソ・ + 2。トテ讌ワ・ソ・ + 3。トアヲ・ワ・ソ・ + + ーフテヨ: menu 。ト ・皈ヒ・蝪シセ螟ヌ・ッ・・テ・ッ + lastline 。ト コヌイシケヤ、ヌ・ッ・・テ・ッ + default 。ト ツセ、ホタ゚ト熙ャフオ、、サ、ホ・ヌ・ユ・ゥ・・ネ + anchor 。ト ・「・・ォ。シセ螟ヌ・ッ・・テ・ッ + active 。ト ・「・ッ・ニ・」・ヨ、ハ・「・・ォ。シセ螟ヌ・ッ・・テ・ッ + tab 。ト ・ソ・ヨセ螟ヌ・ッ・・テ・ッ + + : コクテシ、ホ・ォ・鬣牴フテヨ + : アヲテシ、ホ・ォ・鬣牴フ + + 、ヌ、ケ。」 + ク゚エケタュ、ホ、ソ、皃ヒ <ーフテヨ> 、ヌ、ホ menu 、マセハホャイトヌス、ヌ、ケ。」 + + ・ヌ・ユ・ゥ・・ネ、ホタ゚ト(func.c ニ)、マ。「 + + button 1 default MOVE_MOUSE + button 2 default BACK + button 3 default MENU_MOUSE + + button 1 active GOTO_LINK + + button 1 tab TAB_MOUSE + button 2 tab CLOSE_TAB_MOUSE + + lastline "「罎ャ「ュ" + button 1 lastline 0 1 BACK + button 1 lastline 2 3 PREV_PAGE + button 1 lastline 4 5 NEXT_PAGE + + 、ネニアナ、ヌ、ケ。」(、ウ、、゙、ヌ、ネニア、ク、マ、コ) + + 。ヲホ网ィ、ミ。「 + + button 1 anchor COMMAND "MOVE_MOUSE; GOTO_LINK" + + 、ネタ゚ト熙ケ、、ネ・「・ッ・ニ・」・ヨ、ヌ、ハ、、・「・・ォ。シセ螟ヌ、篌ク・ッ・・テ・ッ、キ、ソ、タ、ア、ヌ。「 + ・・・ッタ隍ヒネ、モ、゙、ケ。」(GUI ・ヨ・鬣ヲ・カ、ネニア、クヘヘ、ハニーコ) + + 。ヲ~/.w3m/menu 、ヌ + + menu Active + func "・・・ッ、ノスシィ (a)" GOTO_LINK "a" + func "ソキ、キ、、・ソ・ヨ、ヌノスシィ (t)" TAB_LINK "t" + func "・・・ッ、ハンツク (d)" SAVE_LINK "d" + func "ウーノ・ヨ・鬣ヲ・カ、ヌノスシィ (m)" EXTERN_LINK "m" + end + + 、ホヘヘ、ヒタ゚ト熙キ、ニ、ェ、、、ニ。「~/.w3m/mouse 、ヌ + + button 3 anchor MENU_MOUSE Active + + 、ネタ゚ト熙ケ、、ネ。「・「・・ォ。シセ螟ヌアヲ・ッ・・テ・ッ、キ、ケ、、ネ・「・・ォ。シヘム、ホ + ・皈ヒ・蝪シ、ャウォ、ュ、゙、ケ。」 + + 、ウ、、ハエカ、ク、ヌサネ、テ、ニ、゚、ニ、ッ、タ、オ、、。」 diff -crN -x CVS w3m-0.3.2.2/doc-jp/README.pre_form w3m-js-1.743/doc-jp/README.pre_form *** w3m-0.3.2.2/doc-jp/README.pre_form 1970-01-01 09:00:00.000000000 +0900 --- w3m-js-1.743/doc-jp/README.pre_form 2003-01-11 11:38:49.000000000 +0900 *************** *** 0 **** --- 1,34 ---- + pre_form: $BFCDj$N%5%$%H$r3+$$$?;~$K!"(Bform $B$rM=$a@_Dj$9$k5!G=$G$9!#(B + + $BNI$/;H$&7G<(HD$H$+$G$OJXMx$H;W$$$^$9$,!"0BA4@-$,5>@7$K$J$k$+$b(B + $B$7$l$^$;$s!#FC$K(B submit $B$O5$$r$D$1$F;H$C$F2<$5$$!#(B + + $B%G%U%)%k%H$N@_Dj%U%!%$%k$O(B ~/.w3m/pre_form $B$G$9!#(B + $B@_Dj%U%)!<%^%C%H$O!"(B + + url |// + form [] + text + file + password + checkbox [] + radio + section + submit [] + textarea + + : + /textarea + + $B$G$9!#(B + $B$,@_Dj$7$F$"$k;~$O!"0lCW$9$k(B action $BB0@-$r;}$D(B form $B$N$_(B + $B@_Dj$7$^$9!#(B + text, file, password, select, textarea $B$O0lCW$9$k(B name $BB0@-$r;}$D(B + input, select $B$^$?$O(B textarea $BMWAG$N(B value $BB0@-$r@_Dj$7$^$9!#(B + checkbox, radio $B$O(B name $BB0@-$H(B value $BB0@-$,0lCW$9$k(B input $BMWAG$r(B + check $B$7$^$9!#(B + $B$,(B 0$B!"(Bno $B$^$?$O(B off $B$N>l9g$O(B checkbox $B$N(B check $B$r30$7$^$9!#(B + submit $B$N>l9g!"(B $B$,@_Dj$7$F$"$k;~$O!"0lCW$9$k(B name $BB0@-$r;}$D(B + input $BMWAG$r(B submit $B$7$^$9!#(B $B$,@_Dj$7$F$$$J$$>l9g$O!":G8e$N(B + input type=submit $BMWAG$r(B submit $B$7$^$9!#(B + $B$d(B $B$O!"%7%'%k$NMM$K(B \,'$B!A(B',"$B!A(B" $B$G%/%)!<%H2DG=$G$9!#(B diff -crN -x CVS w3m-0.3.2.2/doc-jp/README.tab w3m-js-1.743/doc-jp/README.tab *** w3m-0.3.2.2/doc-jp/README.tab 1970-01-01 09:00:00.000000000 +0900 --- w3m-js-1.743/doc-jp/README.tab 2002-11-06 02:24:48.000000000 +0900 *************** *** 0 **** --- 1,43 ---- + w3m $B$r%?%V%V%i%&%62=(B + + $B%-!e$2$^$9(B + $B%?%VA*Br%a%K%e!<$NA`:n$O%P%C%U%!A*Br%a%K%e!<$HF1MM$G$9!#(B + + $B$^$?!"%^%&%9$G$NA`:n$b=PMh$^$9!#(B + + $B:8%\%?%s(B $B!D(B $B%?%V>e$G%/%j%C%/$9$k$H!"$=$N%?%V$K0\F0$7$^$9(B + $B%?%V$+$iJL$N%?%V$^$G%I%i%C%0$9$k$H!"%?%V$r0\F0$7$^$9!#(B + $B%j%s%/$+$i%?%V$^$G%I%i%C%0$9$k$H!"$=$N%?%V$G%j%s%/$r3+$-$^$9(B + $B1&>e6y$N!V(Bx$B!W$r%/%j%C%/$9$k$H!"8=:_$N%?%V$rJD$8$^$9(B + $BCf%\%?%s(B $B!D(B $B%?%V>e$G%/%j%C%/$9$k$H!"%?%V$rJD$8$^$9(B + $B1&%\%?%s(B $B!D(B $BFC$K$J$7(B(= $B%a%K%e!<$r3+$/(B) + + $B%*%W%7%g%s$H$7$F!"(B + + open_tab_blank $B!D(B target $B$,(B _blank $B$+(B _new $B$N>l9g$O?7$7$$%?%V$G3+$/(B + $B%G%U%)%k%H$O(B OFF + close_tab_back $B!D(B $BLa$k;~$K%P%C%U%!$,:G8e$J$i%?%V$rJD$8$k(B + $B%G%U%)%k%H$O(B OFF (= Can't back...) + + $B$rDI2C$7$F$$$^$9!#(B diff -crN -x CVS w3m-0.3.2.2/doc-jp/keymap.default w3m-js-1.743/doc-jp/keymap.default *** w3m-0.3.2.2/doc-jp/keymap.default 2002-09-06 00:43:22.000000000 +0900 --- w3m-js-1.743/doc-jp/keymap.default 2002-12-13 22:15:54.000000000 +0900 *************** *** 24,31 **** --- 24,33 ---- keymap C-m GOTO_LINK keymap C-n MOVE_DOWN keymap C-p MOVE_UP + keymap C-q CLOSE_TAB keymap C-r ISEARCH_BACK keymap C-s ISEARCH + keymap C-t TAB_LINK keymap C-u PREV_LINK keymap C-v NEXT_PAGE keymap C-w WRAP_TOGGLE *************** *** 36,42 **** --- 38,48 ---- keymap \" REG_MARK keymap # PIPE_SHELL keymap $ LINE_END + keymap ( UNDO + keymap ) REDO + keymap + NEXT_PAGE keymap , LEFT + keymap - PREV_PAGE keymap . RIGHT keymap / SEARCH keymap : MARK_URL *************** *** 47,52 **** --- 53,59 ---- keymap ? SEARCH_BACK keymap @ READ_SHELL keymap B BACK + keymap D DOWNLOAD_LIST keymap E EDIT keymap F FRAME keymap G END *************** *** 54,64 **** --- 61,73 ---- keymap I VIEW_IMAGE keymap J UP keymap K DOWN + keymap L LIST keymap M EXTERN keymap N SEARCH_PREV keymap Q EXIT keymap R RELOAD keymap S SAVE_SCREEN + keymap T NEW_TAB keymap U GOTO keymap V LOAD keymap W PREV_WORD *************** *** 75,88 **** keymap j MOVE_DOWN keymap k MOVE_UP keymap l MOVE_RIGHT keymap n SEARCH_NEXT keymap o OPTIONS keymap q QUIT ! keymap s SELECT_MENU keymap u PEEK_LINK keymap v VIEW keymap w NEXT_WORD keymap z CENTER_V keymap M-TAB PREV_LINK keymap M-C-j SAVE_LINK --- 84,102 ---- keymap j MOVE_DOWN keymap k MOVE_UP keymap l MOVE_RIGHT + keymap m MOUSE_TOGGLE keymap n SEARCH_NEXT keymap o OPTIONS keymap q QUIT ! keymap r VERSION ! keymap s SELECT_MENU keymap u PEEK_LINK keymap v VIEW keymap w NEXT_WORD keymap z CENTER_V + keymap { PREV_TAB + keymap | PIPE_BUF + keymap } NEXT_TAB keymap M-TAB PREV_LINK keymap M-C-j SAVE_LINK *************** *** 96,106 **** --- 110,126 ---- keymap M-W DICT_WORD_AT keymap M-a ADD_BOOKMARK keymap M-b BOOKMARK + keymap M-c COMMAND keymap M-e EDIT_SCREEN keymap M-g GOTO_LINE + keymap M-k DEFINE_KEY + keymap M-l LIST_MENU + keymap M-m MOVE_LIST_MENU keymap M-n NEXT_MARK + keymap M-o SET_OPTION keymap M-p PREV_MARK keymap M-s SAVE + keymap M-t TAB_MENU keymap M-u GOTO_RELATIVE keymap M-v PREV_PAGE keymap M-w DICT_WORD diff -crN -x CVS w3m-0.3.2.2/doc-jp/keymap.lynx w3m-js-1.743/doc-jp/keymap.lynx *** w3m-0.3.2.2/doc-jp/keymap.lynx 2002-01-24 02:19:47.000000000 +0900 --- w3m-js-1.743/doc-jp/keymap.lynx 2002-12-13 22:15:54.000000000 +0900 *************** *** 24,31 **** --- 24,34 ---- keymap C-m GOTO_LINK keymap C-n NEXT_LINK keymap C-p PREV_LINK + keymap C-q CLOSE_TAB keymap C-r RELOAD keymap C-s SEARCH + keymap C-t TAB_LINK + keymap C-u PREV_LINK keymap C-v NEXT_PAGE keymap C-w REDRAW keymap C-z SUSPEND *************** *** 35,50 **** --- 38,59 ---- keymap \" REG_MARK keymap # PIPE_SHELL keymap $ LINE_END + keymap ( UNDO + keymap ) REDO keymap + NEXT_PAGE + keymap , LEFT keymap - PREV_PAGE + keymap . RIGHT keymap / SEARCH keymap : MARK_URL + keymap ; MARK_WORD keymap < SHIFT_LEFT keymap = INFO keymap > SHIFT_RIGHT keymap ? HELP keymap @ READ_SHELL keymap B BACK + keymap D DOWNLOAD_LIST keymap E EDIT keymap F FRAME keymap G GOTO_LINE *************** *** 52,67 **** --- 61,81 ---- keymap I VIEW_IMAGE keymap J UP keymap K DOWN + keymap L LIST keymap M EXTERN keymap N NEXT_MARK keymap P PREV_MARK keymap Q EXIT keymap R RELOAD keymap S SAVE_SCREEN + keymap T NEW_TAB keymap U GOTO keymap V LOAD + keymap W PREV_WORD keymap Z CENTER_H + keymap [ LINK_BEGIN keymap \\ SOURCE + keymap ] LINK_END keymap \^ LINE_BEGIN keymap a ADD_BOOKMARK keymap b PREV_PAGE *************** *** 73,101 **** keymap j MOVE_DOWN keymap k MOVE_UP keymap l MOVE_RIGHT keymap n SEARCH_NEXT keymap o OPTIONS keymap p SAVE_SCREEN keymap q QUIT ! keymap s SELECT_MENU keymap u PEEK_LINK keymap v BOOKMARK ! keymap w WRAP_TOGGLE keymap z CENTER_V keymap M-TAB PREV_LINK keymap M-C-j SAVE_LINK keymap M-C-m SAVE_LINK keymap M-: MARK_MID keymap M-I SAVE_IMAGE keymap M-M EXTERN_LINK keymap M-a ADD_BOOKMARK keymap M-b BOOKMARK keymap M-e EDIT_SCREEN keymap M-s SAVE keymap M-u GOTO_RELATIVE keymap M-v PREV_PAGE keymap UP PREV_LINK keymap DOWN NEXT_LINK --- 87,133 ---- keymap j MOVE_DOWN keymap k MOVE_UP keymap l MOVE_RIGHT + keymap m MOUSE_TOGGLE keymap n SEARCH_NEXT keymap o OPTIONS keymap p SAVE_SCREEN keymap q QUIT ! keymap r VERSION ! keymap s SELECT_MENU keymap u PEEK_LINK keymap v BOOKMARK ! keymap w NEXT_WORD keymap z CENTER_V + keymap { PREV_TAB + keymap | PIPE_BUF + keymap } NEXT_TAB keymap M-TAB PREV_LINK keymap M-C-j SAVE_LINK keymap M-C-m SAVE_LINK keymap M-: MARK_MID + keymap M-< BEGIN + keymap M-> END keymap M-I SAVE_IMAGE keymap M-M EXTERN_LINK + keymap M-W DICT_WORD_AT keymap M-a ADD_BOOKMARK keymap M-b BOOKMARK + keymap M-c COMMAND keymap M-e EDIT_SCREEN + keymap M-g GOTO_LINE + keymap M-k DEFINE_KEY + keymap M-l LIST_MENU + keymap M-m MOVE_LIST_MENU + keymap M-n NEXT_MARK + keymap M-o SET_OPTION + keymap M-p PREV_MARK keymap M-s SAVE + keymap M-t TAB_MENU keymap M-u GOTO_RELATIVE keymap M-v PREV_PAGE + keymap M-w DICT_WORD keymap UP PREV_LINK keymap DOWN NEXT_LINK diff -crN -x CVS w3m-0.3.2.2/doc-jp/menu.default w3m-js-1.743/doc-jp/menu.default *** w3m-0.3.2.2/doc-jp/menu.default 2001-11-08 14:16:38.000000000 +0900 --- w3m-js-1.743/doc-jp/menu.default 2002-12-13 22:15:54.000000000 +0900 *************** *** 12,24 **** menu Main func "フ皃 (b)" BACK "b" ! func "・ミ・テ・ユ・。チェツ (s)" SELECT "s" func "・ス。シ・ケ、ノスシィ (v)" VIEW "vV" func "・ス。シ・ケ、ハヤスク (e)" EDIT "eE" func "・ス。シ・ケ、ハンツク (S)" SAVE "S" func "コニニノ、゚ケ、゚ (r)" RELOAD "rR" nop "ィ。ィ。ィ。ィ。ィ。ィ。ィ。ィ。" func "・・・ッ、ノスシィ (a)" GOTO_LINK "a" func "・・・ッ、ハンツク (A)" SAVE_LINK "A" func "イ霖、ノスシィ (i)" VIEW_IMAGE "i" func "イ霖、ハンツク (I)" SAVE_IMAGE "I" --- 12,26 ---- menu Main func "フ皃 (b)" BACK "b" ! popup "・ミ・テ・ユ・。チェツ (s)" Select "s" ! popup "・ソ・ヨチェツ (t)" SelectTab "tT" func "・ス。シ・ケ、ノスシィ (v)" VIEW "vV" func "・ス。シ・ケ、ハヤスク (e)" EDIT "eE" func "・ス。シ・ケ、ハンツク (S)" SAVE "S" func "コニニノ、゚ケ、゚ (r)" RELOAD "rR" nop "ィ。ィ。ィ。ィ。ィ。ィ。ィ。ィ。" func "・・・ッ、ノスシィ (a)" GOTO_LINK "a" + func "ソキ・ソ・ヨ、ヌノスシィ (n)" TAB_LINK "nN" func "・・・ッ、ハンツク (A)" SAVE_LINK "A" func "イ霖、ノスシィ (i)" VIEW_IMAGE "i" func "イ霖、ハンツク (I)" SAVE_IMAGE "I" diff -crN -x CVS w3m-0.3.2.2/doc-jp/w3m.1 w3m-js-1.743/doc-jp/w3m.1 *** w3m-0.3.2.2/doc-jp/w3m.1 2001-11-21 13:29:14.000000000 +0900 --- w3m-js-1.743/doc-jp/w3m.1 2002-11-12 22:18:55.000000000 +0900 *************** *** 48,53 **** --- 48,56 ---- .B \-j JIS (ISO-2022-JP)・ウ。シ・ノ、ヌノスシィ、ケ、。・ .TP + .BI \-O\ e|s|j|N|m + ノスシィ、ヒサネ、ヲハクサ・ウ。シ・ノ、サリト熙ケ、. + .TP .BI \-I\ e|s ニホマハクス、ホハクサ・ウ。シ・ノ、サリト熙ケ、。・ .TP *************** *** 94,105 **** --- 97,114 ---- .B w3m スェホササ、ヒ。、ーハチー、ホイ靂フ、ヒフ皃鬢ハ、、。・ .TP + .BI \-title =TERM + テシヒ、ホ・ソ・、・ネ・ハクサホ、タ゚ト熙ケ、. + .TP .B \-W ダ、ハヨ、キ・オ。シ・チ、サネ、ヲ、ォ、ノ、ヲ、ォ、タレ、熙ォ、ィ、。・ .TP .BI \-o\ option=value ・ェ・ラ・キ・逾、サリト熙ケ、。・ .TP + .B \-show-option + ヘヘム、ヌ、ュ、・ェ・ラ・キ・逾、ノスシィ、ケ、. + .TP .B \-no\-proxy ・ラ・・ュ・キ、ヘヘム、キ、ハ、、。・ .TP *************** *** 151,156 **** --- 160,171 ---- .TP .BI \-config\ file config、ホ・ユ・。・、・、サリト熙ケ、。・ + .TP + .B -help + ・リ・・ラ、ノスシィ、ケ、. + .TP + .B -version + w3m version、ノスシィ、ケ、. .SS ハクス、ホノスシィニ簣ニ HTMLハクス、ノスシィ、キ、ニ、、、、ネ、ュ、ヒ、マ。、シ。、ホ、隍ヲ、ハノスシィ、ヒ、ハ、熙゙、ケ。・ .in +8n diff -crN -x CVS w3m-0.3.2.2/etc.c w3m-js-1.743/etc.c *** w3m-0.3.2.2/etc.c 2002-10-31 02:21:40.000000000 +0900 --- w3m-js-1.743/etc.c 2003-02-07 02:21:13.000000000 +0900 *************** *** 1,4 **** ! /* $Id: etc.c,v 1.28 2002/10/30 17:21:40 ukai Exp $ */ #include "fm.h" #include #include "myctype.h" --- 1,4 ---- ! /* $Id: etc.c,v 1.64 2003/02/06 17:21:43 ukai Exp $ */ #include "fm.h" #include #include "myctype.h" *************** *** 7,17 **** #include "hash.h" #include "terms.h" ! #ifdef HAVE_GETCWD /* ??? ukai */ ! #include ! #include ! #endif /* HAVE_GETCWD */ ! #include #include #if defined(HAVE_WAITPID) || defined(HAVE_WAIT3) --- 7,13 ---- #include "hash.h" #include "terms.h" ! #include #include #include #if defined(HAVE_WAITPID) || defined(HAVE_WAIT3) *************** *** 42,48 **** { int i, maxColumn; int column = buf->currentColumn + offset; ! int nlines = LASTLINE + 1; Line *l; maxColumn = 0; --- 38,44 ---- { int i, maxColumn; int column = buf->currentColumn + offset; ! int nlines = buf->LINES + 1; Line *l; maxColumn = 0; *************** *** 91,97 **** #ifdef NEXTPAGE_TOPLINE if (!nextpage_topline) #endif ! for (i = (LASTLINE - 1) - (buf->lastLine->linenumber - l->linenumber); i > 0 && l->prev != NULL; i--, l = l->prev) ; return l; } --- 87,93 ---- #ifdef NEXTPAGE_TOPLINE if (!nextpage_topline) #endif ! for (i = buf->LINES - 1 - (buf->lastLine->linenumber - l->linenumber); i > 0 && l->prev != NULL; i--, l = l->prev) ; return l; } *************** *** 103,109 **** Line *l = line; if (buf->pagerSource && !(buf->bufferprop & BP_CLOSE)) { ! n = line->linenumber + offset + LASTLINE; if (buf->lastLine->linenumber < n) getNextPage(buf, n - buf->lastLine->linenumber); while ((last || (buf->lastLine->linenumber < n)) && --- 99,105 ---- Line *l = line; if (buf->pagerSource && !(buf->bufferprop & BP_CLOSE)) { ! n = line->linenumber + offset + buf->LINES; if (buf->lastLine->linenumber < n) getNextPage(buf, n - buf->lastLine->linenumber); while ((last || (buf->lastLine->linenumber < n)) && *************** *** 134,147 **** (*s)++; /* first character */ ! if (IS_ALNUM(**s) || **s == '_' || **s == '/') ! *(p++) = tolower(*((*s)++)); else return HTML_UNKNOWN; if (p[-1] == '/') SKIP_BLANKS(*s); while ((IS_ALNUM(**s) || **s == '_') && p - cmdstr < MAX_CMD_LEN) { ! *(p++) = tolower(*((*s)++)); } if (p - cmdstr == MAX_CMD_LEN) { /* buffer overflow: perhaps caused by bad HTML source */ --- 130,146 ---- (*s)++; /* first character */ ! if (IS_ALNUM(**s) || **s == '_' || **s == '/') { ! *(p++) = TOLOWER(**s); ! (*s)++; ! } else return HTML_UNKNOWN; if (p[-1] == '/') SKIP_BLANKS(*s); while ((IS_ALNUM(**s) || **s == '_') && p - cmdstr < MAX_CMD_LEN) { ! *(p++) = TOLOWER(**s); ! (*s)++; } if (p - cmdstr == MAX_CMD_LEN) { /* buffer overflow: perhaps caused by bad HTML source */ *************** *** 237,286 **** */ Str ! checkType(Str s, Lineprop *oprop, ! #ifdef USE_ANSI_COLOR ! Linecolor *ocolor, int *check_color, ! #endif ! int len) { Lineprop mode; Lineprop effect = PE_NORMAL; ! Lineprop *prop = oprop; char *str = s->ptr, *endp = &s->ptr[s->length], *bs = NULL; #ifdef USE_ANSI_COLOR Lineprop ceffect = PE_NORMAL; Linecolor cmode = 0; Linecolor *color = NULL; char *es = NULL; #endif int do_copy = FALSE; - int size = (len < s->length) ? len : s->length; ! #ifdef USE_ANSI_COLOR ! if (check_color) ! *check_color = FALSE; ! #endif if (ShowEffect) { bs = memchr(str, '\b', s->length); #ifdef USE_ANSI_COLOR if (ocolor) { es = memchr(str, ESC_CODE, s->length); ! if (es) ! color = ocolor; } #endif ! if (s->length > size || (bs != NULL) #ifdef USE_ANSI_COLOR || (es != NULL) #endif ) { ! s = Strnew_size(size); do_copy = TRUE; } } while (str < endp) { ! if (prop - oprop >= len) break; if (bs != NULL) { if (str == bs - 2 && !strncmp(str, "__\b\b", 4)) { --- 236,293 ---- */ Str ! checkType(Str s, Lineprop **oprop, Linecolor **ocolor) { Lineprop mode; Lineprop effect = PE_NORMAL; ! Lineprop *prop; ! static Lineprop *prop_buffer = NULL; ! static int prop_size = 0; char *str = s->ptr, *endp = &s->ptr[s->length], *bs = NULL; #ifdef USE_ANSI_COLOR Lineprop ceffect = PE_NORMAL; Linecolor cmode = 0; + int check_color = FALSE; Linecolor *color = NULL; + static Linecolor *color_buffer = NULL; + static int color_size = 0; char *es = NULL; #endif int do_copy = FALSE; ! if (prop_size < s->length) { ! prop_size = (s->length > LINELEN) ? s->length : LINELEN; ! prop_buffer = New_Reuse(Lineprop, prop_buffer, prop_size); ! } ! prop = prop_buffer; ! if (ShowEffect) { bs = memchr(str, '\b', s->length); #ifdef USE_ANSI_COLOR if (ocolor) { es = memchr(str, ESC_CODE, s->length); ! if (es) { ! if (color_size < s->length) { ! color_size = (s->length > LINELEN) ? s->length : LINELEN; ! color_buffer = New_Reuse(Linecolor, color_buffer, ! color_size); ! } ! color = color_buffer; ! } } #endif ! if ((bs != NULL) #ifdef USE_ANSI_COLOR || (es != NULL) #endif ) { ! s = Strnew_size(s->length); do_copy = TRUE; } } while (str < endp) { ! if (prop - prop_buffer >= prop_size) break; if (bs != NULL) { if (str == bs - 2 && !strncmp(str, "__\b\b", 4)) { *************** *** 411,417 **** es = memchr(str, ESC_CODE, endp - str); if (ok) { if (cmode) ! *check_color = TRUE; continue; } } --- 418,424 ---- es = memchr(str, ESC_CODE, endp - str); if (ok) { if (cmode) ! check_color = TRUE; continue; } } *************** *** 459,471 **** } effect = PE_NORMAL; } return s; } int calcPosition(char *l, Lineprop *pr, int len, int pos, int bpos, int mode) { ! static short realColumn[LINELEN + 1]; static char *prevl = NULL; int i, j; --- 466,500 ---- } effect = PE_NORMAL; } + *oprop = prop_buffer; + #ifdef USE_ANSI_COLOR + if (ocolor) + *ocolor = check_color ? color_buffer : NULL; + #endif return s; } + static int + nextColumn(int n, char *p, Lineprop *pr) + { + if (*p == '\t' && *pr == PC_CTRL) + return (n + Tabstop) / Tabstop * Tabstop; + #ifndef KANJI_SYMBOLS + else if (*pr & PC_RULE) + return n + 1; + #endif + else if (IS_UNPRINTABLE_ASCII(*p, *pr)) + return n + 4; + else if (IS_UNPRINTABLE_CONTROL(*p, *pr)) + return n + 2; + return n + 1; + } + int calcPosition(char *l, Lineprop *pr, int len, int pos, int bpos, int mode) { ! static int *realColumn = NULL; ! static int size = 0; static char *prevl = NULL; int i, j; *************** *** 475,504 **** if (pos <= len) return realColumn[pos]; } prevl = l; j = bpos; for (i = 0;; i++) { realColumn[i] = j; if (i == len) break; ! if (l[i] == '\t' && pr[i] == PC_CTRL) ! j = (j + Tabstop) / Tabstop * Tabstop; ! #ifndef KANJI_SYMBOLS ! else if (pr[i] & PC_RULE) ! j++; ! #endif ! else if (IS_UNPRINTABLE_ASCII(l[i], pr[i])) ! j = j + 4; ! else if (IS_UNPRINTABLE_CONTROL(l[i], pr[i])) ! j = j + 2; ! else ! j++; } if (pos >= i) return j; return realColumn[pos]; } char * lastFileName(char *path) { --- 504,544 ---- if (pos <= len) return realColumn[pos]; } + if (size < len + 1) { + size = (len + 1 > LINELEN) ? (len + 1) : LINELEN; + realColumn = New_N(int, size); + } prevl = l; j = bpos; for (i = 0;; i++) { realColumn[i] = j; if (i == len) break; ! j = nextColumn(j, &l[i], &pr[i]); } if (pos >= i) return j; return realColumn[pos]; } + int + columnLen(Line *line, int column) + { + int i, j; + + for (i = 0, j = 0; i < line->len; i++) { + j = nextColumn(j, &line->lineBuf[i], &line->propBuf[i]); + if (j > column) { + #ifdef JP_CHARSET + if (CharType(line->propBuf[i]) == PC_KANJI2) + return i - 1; + #endif + return i; + } + } + return line->len; + } + char * lastFileName(char *path) { *************** *** 637,643 **** else if (c == '>') *status = R_ST_NORMAL; else ! *status = R_ST_TAG; return 0; case R_ST_QUOTE: if (c == '\'') --- 677,683 ---- else if (c == '>') *status = R_ST_NORMAL; else ! *status = R_ST_VALUE; return 0; case R_ST_QUOTE: if (c == '\'') *************** *** 647,652 **** --- 687,698 ---- if (c == '"') *status = R_ST_TAG; return 0; + case R_ST_VALUE: + if (c == '>') + *status = R_ST_NORMAL; + else if (IS_SPACE(c)) + *status = R_ST_TAG; + return 0; case R_ST_AMP: if (c == ';') { *status = R_ST_NORMAL; *************** *** 755,762 **** } if (prev_status == R_ST_NCMNT2 || prev_status == R_ST_NCMNT3 || prev_status == R_ST_IRRTAG || prev_status == R_ST_CMNT1) { ! if (prev_status == R_ST_CMNT1 && !append) Strclear(buf); p++; goto proc_end; } --- 801,810 ---- } if (prev_status == R_ST_NCMNT2 || prev_status == R_ST_NCMNT3 || prev_status == R_ST_IRRTAG || prev_status == R_ST_CMNT1) { ! if (prev_status == R_ST_CMNT1 && !append && !pre) Strclear(buf); + if (pre) + Strcat_char(buf, *p); p++; goto proc_end; } *************** *** 779,785 **** } if (*status == R_ST_TAG0 && !REALLY_THE_BEGINNING_OF_A_TAG(p)) { /* it seems that this '<' is not a beginning of a tag */ ! Strcat_charp(buf, "<"); *status = R_ST_NORMAL; } else --- 827,836 ---- } if (*status == R_ST_TAG0 && !REALLY_THE_BEGINNING_OF_A_TAG(p)) { /* it seems that this '<' is not a beginning of a tag */ ! /* ! * Strcat_charp(buf, "<"); ! */ ! Strcat_char(buf, '<'); *status = R_ST_NORMAL; } else *************** *** 788,799 **** case R_ST_EQL: case R_ST_QUOTE: case R_ST_DQUOTE: case R_ST_AMP: Strcat_char(buf, *p); break; case R_ST_CMNT: case R_ST_IRRTAG: ! if (!append) Strclear(buf); break; case R_ST_CMNT1: --- 839,853 ---- case R_ST_EQL: case R_ST_QUOTE: case R_ST_DQUOTE: + case R_ST_VALUE: case R_ST_AMP: Strcat_char(buf, *p); break; case R_ST_CMNT: case R_ST_IRRTAG: ! if (pre) ! Strcat_char(buf, *p); ! else if (!append) Strclear(buf); break; case R_ST_CMNT1: *************** *** 802,807 **** --- 856,863 ---- case R_ST_NCMNT2: case R_ST_NCMNT3: /* do nothing */ + if (pre) + Strcat_char(buf, *p); break; } } *************** *** 830,835 **** --- 886,892 ---- case R_ST_TAG: case R_ST_TAG0: case R_ST_EQL: /* required ">" */ + case R_ST_VALUE: c = '>'; break; case R_ST_QUOTE: *************** *** 1033,1080 **** add_auth_pass_entry(&ent, netrc); } ! #define PASS_IS_READABLE_MSG "SECURITY NOTE: passwd file must not be accessible by others" ! static FILE * ! openPasswdFile(char *fname) { struct stat st; if (fname == NULL) return NULL; ! if (stat(expandName(fname), &st) < 0) return NULL; /* check permissions, if group or others readable or writable, * refuse it, because it's insecure. */ ! if ((st.st_mode & (S_IRWXG | S_IRWXO)) != 0) { if (fmInitialized) { ! message(PASS_IS_READABLE_MSG, 0, 0); refresh(); } else { ! fputs(PASS_IS_READABLE_MSG, stderr); fputc('\n', stderr); } sleep(2); return NULL; } ! return fopen(expandName(fname), "r"); } void loadPasswd(void) { FILE *fp; ! fp = openPasswdFile(passwd_file); if (fp != NULL) { parsePasswd(fp, 0); fclose(fp); } /* for FTP */ ! fp = openPasswdFile("~/.netrc"); if (fp != NULL) { parsePasswd(fp, 1); fclose(fp); --- 1090,1150 ---- add_auth_pass_entry(&ent, netrc); } ! #define FILE_IS_READABLE_MSG "SECURITY NOTE: file %s must not be accessible by others" ! FILE * ! openSecretFile(char *fname) { + char *efname; struct stat st; + if (fname == NULL) return NULL; ! efname = expandPath(fname); ! if (stat(efname, &st) < 0) return NULL; /* check permissions, if group or others readable or writable, * refuse it, because it's insecure. + * + * XXX: disable_secret_security_check will introduce some + * security issues, but on some platform such as Windows + * it's not possible (or feasible) to disable group|other + * readable and writable. + * [w3m-dev 03368][w3m-dev 03369][w3m-dev 03370] */ ! if (disable_secret_security_check) ! /* do nothing */ ; ! else if ((st.st_mode & (S_IRWXG | S_IRWXO)) != 0) { if (fmInitialized) { ! message(Sprintf(FILE_IS_READABLE_MSG, fname)->ptr, 0, 0); refresh(); } else { ! fputs(Sprintf(FILE_IS_READABLE_MSG, fname)->ptr, stderr); fputc('\n', stderr); } sleep(2); return NULL; } ! return fopen(efname, "r"); } void loadPasswd(void) { FILE *fp; ! ! passwords = NULL; ! fp = openSecretFile(passwd_file); if (fp != NULL) { parsePasswd(fp, 0); fclose(fp); } /* for FTP */ ! fp = openSecretFile("~/.netrc"); if (fp != NULL) { parsePasswd(fp, 1); fclose(fp); *************** *** 1262,1268 **** #define SIGIOT SIGABRT #endif /* not SIGIOT */ ! void reset_signals(void) { signal(SIGHUP, SIG_DFL); /* terminate process */ --- 1332,1338 ---- #define SIGIOT SIGABRT #endif /* not SIGIOT */ ! static void reset_signals(void) { signal(SIGHUP, SIG_DFL); /* terminate process */ *************** *** 1281,1314 **** #ifdef SIGPIPE signal(SIGPIPE, SIG_IGN); #endif ! signal(SIGUSR1, SIG_IGN); } void mySystem(char *command, int background) { if (background) { ! #ifndef HAVE_SETPGRP Str cmd = Strnew_charp("start /f "); Strcat_charp(cmd, command); system(cmd->ptr); - #else - int pid; - flush_tty(); - if ((pid = fork()) == 0) { - int fd, i; - reset_signals(); - SETPGRP(); - close_tty(); - dup2(open("/dev/null", O_RDONLY), 0); - dup2(open("/dev/null", O_WRONLY), 1); - dup2(fd = open("/dev/null", O_WRONLY), 2); - /* close all other file descriptors (socket, ...) */ - for (i = 3; i <= fd; i++) - close(i); - execl("/bin/sh", "sh", "-c", command, NULL); - exit(127); - } #endif } else --- 1351,1474 ---- #ifdef SIGPIPE signal(SIGPIPE, SIG_IGN); #endif ! } ! ! #ifndef FOPEN_MAX ! #define FOPEN_MAX 1024 /* XXX */ ! #endif ! ! static void ! close_all_fds_except(int i, int f) ! { ! switch (i) { /* fall through */ ! case 0: ! dup2(open(DEV_NULL_PATH, O_RDONLY), 0); ! case 1: ! dup2(open(DEV_NULL_PATH, O_WRONLY), 1); ! case 2: ! dup2(open(DEV_NULL_PATH, O_WRONLY), 2); ! } ! /* close all other file descriptors (socket, ...) */ ! for (i = 3; i < FOPEN_MAX; i++) { ! if (i != f) ! close(i); ! } ! } ! ! void ! setup_child(int child, int i, int f) ! { ! reset_signals(); ! signal(SIGINT, SIG_IGN); ! if (!child) ! SETPGRP(); ! close_tty(); ! close_all_fds_except(i, f); ! QuietMessage = TRUE; ! fmInitialized = FALSE; ! TrapSignal = FALSE; ! } ! ! pid_t ! open_pipe_rw(FILE ** fr, FILE ** fw) ! { ! int fdr[2]; ! int fdw[2]; ! pid_t pid; ! ! if (fr && pipe(fdr) < 0) ! goto err0; ! if (fw && pipe(fdw) < 0) ! goto err1; ! ! flush_tty(); ! pid = fork(); ! if (pid < 0) ! goto err2; ! if (pid == 0) { ! /* child */ ! if (fr) { ! close(fdr[0]); ! dup2(fdr[1], 1); ! } ! if (fw) { ! close(fdw[1]); ! dup2(fdw[0], 0); ! } ! } ! else { ! if (fr) { ! close(fdr[1]); ! if (*fr == stdin) ! dup2(fdr[0], 0); ! else ! *fr = fdopen(fdr[0], "r"); ! } ! if (fw) { ! close(fdw[0]); ! if (*fw == stdout) ! dup2(fdw[1], 1); ! else ! *fw = fdopen(fdw[1], "w"); ! } ! } ! return pid; ! err2: ! if (fw) { ! close(fdw[0]); ! close(fdw[1]); ! } ! err1: ! if (fr) { ! close(fdr[0]); ! close(fdr[1]); ! } ! err0: ! return (pid_t) - 1; ! } ! ! void ! myExec(char *command) ! { ! signal(SIGINT, SIG_DFL); ! execl("/bin/sh", "sh", "-c", command, NULL); ! exit(127); } void mySystem(char *command, int background) { if (background) { ! #ifndef __EMX__ ! flush_tty(); ! if (!fork()) { ! setup_child(FALSE, 0, -1); ! myExec(command); ! } ! #else Str cmd = Strnew_charp("start /f "); Strcat_charp(cmd, command); system(cmd->ptr); #endif } else *************** *** 1380,1414 **** char * expandName(char *name) { - Str userName = NULL; char *p; struct passwd *passent, *getpwnam(const char *); ! Str extpath = Strnew(); p = name; ! if (*p == '/' && *(p + 1) == '~' && IS_ALPHA(*(p + 2))) { ! if (personal_document_root != NULL) { ! userName = Strnew(); p += 2; ! while (IS_ALNUM(*p) || *p == '_' || *p == '-') ! Strcat_char(userName, *(p++)); ! passent = getpwnam(userName->ptr); ! if (passent == NULL) { ! p = name; ! goto rest; } ! Strcat_charp(extpath, passent->pw_dir); ! Strcat_char(extpath, '/'); ! Strcat_charp(extpath, personal_document_root); ! if (Strcmp_charp(extpath, "/") == 0 && *p == '/') p++; } } else ! p = expandPath(p); rest: ! Strcat_charp(extpath, p); ! return extpath->ptr; } char * --- 1540,1583 ---- char * expandName(char *name) { char *p; struct passwd *passent, *getpwnam(const char *); ! Str extpath = NULL; + if (name == NULL) + return NULL; p = name; ! if (*p == '/') { ! if (*(p + 1) == '~' && IS_ALPHA(*(p + 2)) && personal_document_root) { ! char *q; p += 2; ! q = strchr(p, '/'); ! if (q) { /* /~user/dir... */ ! passent = getpwnam(allocStr(p, q - p)); ! p = q; ! } ! else { /* /~user */ ! passent = getpwnam(p); ! p = ""; } ! if (!passent) ! goto rest; ! extpath = Strnew_m_charp(passent->pw_dir, "/", ! personal_document_root, NULL); ! if (*personal_document_root == '\0' && *p == '/') p++; } + else + goto rest; + if (Strcmp_charp(extpath, "/") == 0 && *p == '/') + p++; + Strcat_charp(extpath, p); + return extpath->ptr; } else ! return expandPath(p); rest: ! return name; } char * *************** *** 1422,1428 **** char *host = NULL; #endif ! file = expandName(file); #ifdef SUPPORT_NETBIOS_SHARE if (file[0] == '/' && file[1] == '/') { char *p; --- 1591,1597 ---- char *host = NULL; #endif ! file = expandPath(file); #ifdef SUPPORT_NETBIOS_SHARE if (file[0] == '/' && file[1] == '/') { char *p; *************** *** 1463,1470 **** return tmp->ptr; } static char *tmpf_base[MAX_TMPF_TYPE] = { ! "tmp", "src", "frame", "cache" }; static unsigned int tmpf_seq[MAX_TMPF_TYPE]; --- 1632,1652 ---- return tmp->ptr; } + char * + url_unquote_conv(char *url, char code) + { + Str tmp; + tmp = Str_url_unquote(Strnew_charp(url), FALSE, TRUE); + #ifdef JP_CHARSET + if (code == CODE_INNER_EUC) + code = CODE_EUC; + tmp = convertLine(NULL, tmp, &code, RAW_MODE); + #endif + return tmp->ptr; + } + static char *tmpf_base[MAX_TMPF_TYPE] = { ! "tmp", "src", "frame", "cache", "cookie", }; static unsigned int tmpf_seq[MAX_TMPF_TYPE]; *************** *** 1473,1485 **** { Str tmpf; tmpf = Sprintf("%s/w3m%s%d-%d%s", ! rc_dir, tmpf_base[type], ! (int)getpid(), tmpf_seq[type]++, (ext) ? ext : ""); return tmpf; } - #ifdef USE_COOKIE static char *monthtbl[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" --- 1655,1667 ---- { Str tmpf; tmpf = Sprintf("%s/w3m%s%d-%d%s", ! tmp_dir, tmpf_base[type], ! CurrentPid, tmpf_seq[type]++, (ext) ? ext : ""); ! pushText(fileToDelete, tmpf->ptr); return tmpf; } static char *monthtbl[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" *************** *** 1605,1616 **** return 0; } /* RFC 1123 or RFC 850 or ANSI C asctime() format string -> time_t */ time_t mymktime(char *timestr) { char *s; ! int day, mon, year, hour, min, sec; if (!(timestr && *timestr)) return -1; --- 1787,1824 ---- return 0; } + static int + get_zone(char **s, int *z_hour, int *z_min) + { + Str tmp = Strnew(); + int zone; + char *ss = *s; + + if (!**s) + return -1; + + if (**s == '+' || **s == '-') + Strcat_char(tmp, *((*s)++)); + while (**s && IS_DIGIT(**s)) + Strcat_char(tmp, *((*s)++)); + if (!(tmp->length == 4 && IS_DIGIT(*ss)) && + !(tmp->length == 5 && (*ss == '+' || *ss == '-'))) { + *s = ss; + return -1; + } + + zone = atoi(tmp->ptr); + *z_hour = zone / 100; + *z_min = zone - (zone / 100) * 100; + return 0; + } + /* RFC 1123 or RFC 850 or ANSI C asctime() format string -> time_t */ time_t mymktime(char *timestr) { char *s; ! int day, mon, year, hour, min, sec, z_hour = 0, z_min = 0; if (!(timestr && *timestr)) return -1; *************** *** 1647,1654 **** min = 0; sec = 0; } ! else if (get_time(&s, &hour, &min, &sec) == -1) { ! return -1; } } else { --- 1855,1866 ---- min = 0; sec = 0; } ! else { ! if (get_time(&s, &hour, &min, &sec) == -1) ! return -1; ! while (*s && !IS_DIGIT(*s) && *s != '+' && *s != '-') ! s++; ! get_zone(&s, &z_hour, &z_min); } } else { *************** *** 1674,1681 **** return -1; } #ifdef DEBUG ! fprintf(stderr, "year=%d month=%d day=%d hour:min:sec=%d:%d:%d\n", ! year, mon, day, hour, min, sec); #endif /* DEBUG */ mon -= 3; --- 1886,1894 ---- return -1; } #ifdef DEBUG ! fprintf(stderr, ! "year=%d month=%d day=%d hour:min:sec=%d:%d:%d zone=%d:%d\n", year, ! mon, day, hour, min, sec, z_hour, z_min); #endif /* DEBUG */ mon -= 3; *************** *** 1685,1694 **** --- 1898,1910 ---- } day += (year - 1968) * 1461 / 4; day += ((((mon * 153) + 2) / 5) - 672); + hour -= z_hour; + min -= z_min; return (time_t) ((day * 60 * 60 * 24) + (hour * 60 * 60) + (min * 60) + sec); } + #ifdef USE_COOKIE #ifdef INET6 #include #endif /* INET6 */ diff -crN -x CVS w3m-0.3.2.2/file.c w3m-js-1.743/file.c *** w3m-0.3.2.2/file.c 2002-12-06 01:53:19.000000000 +0900 --- w3m-js-1.743/file.c 2003-02-08 02:38:49.000000000 +0900 *************** *** 1,4 **** ! /* $Id: file.c,v 1.109.2.2 2002/12/05 16:53:19 ukai Exp $ */ #include "fm.h" #include #include "myctype.h" --- 1,4 ---- ! /* $Id: file.c,v 1.218 2003/02/06 17:21:43 ukai Exp $ */ #include "fm.h" #include #include "myctype.h" *************** *** 11,16 **** --- 11,17 ---- #include #include #include + #include /* foo */ #include "html.h" *************** *** 27,62 **** static int frame_source = 0; static int _MoveFile(char *path1, char *path2); ! static void uncompress_stream(URLFile *uf); static FILE *lessopen_stream(char *path); static Buffer *loadcmdout(char *cmd, Buffer *(*loadproc) (URLFile *, Buffer *), Buffer *defaultbuf); ! static void close_textarea(struct html_feed_environ *h_env); ! static void addnewline(Buffer *buf, char *line, Lineprop *prop, ! #ifdef USE_ANSI_COLOR ! Linecolor *color, ! #endif ! int pos, int nlines); ! ! static Lineprop propBuffer[LINELEN]; ! #ifdef USE_ANSI_COLOR ! static Linecolor colorBuffer[LINELEN]; #endif static JMP_BUF AbortLoading; static struct table *tables[MAX_TABLE]; static struct table_mode table_mode[MAX_TABLE]; ! #ifdef USE_IMAGE static ParsedURL *cur_baseURL = NULL; #ifdef JP_CHARSET static char cur_document_code; #endif #endif static Str cur_select; static Str select_str; static int select_is_multiple; --- 28,60 ---- static int frame_source = 0; + static char *guess_filename(char *file); static int _MoveFile(char *path1, char *path2); ! static void uncompress_stream(URLFile *uf, char **src); static FILE *lessopen_stream(char *path); static Buffer *loadcmdout(char *cmd, Buffer *(*loadproc) (URLFile *, Buffer *), Buffer *defaultbuf); ! #ifndef USE_ANSI_COLOR ! #define addnewline(a,b,c,d,e,f,g) _addnewline(a,b,c,e,f,g) #endif + static void addnewline(Buffer *buf, char *line, Lineprop *prop, + Linecolor *color, int pos, int width, int nlines); + static void addLink(Buffer *buf, struct parsed_tag *tag); static JMP_BUF AbortLoading; static struct table *tables[MAX_TABLE]; static struct table_mode table_mode[MAX_TABLE]; ! #if defined(USE_IMAGE) || defined(USE_SCRIPT) static ParsedURL *cur_baseURL = NULL; #ifdef JP_CHARSET static char cur_document_code; #endif #endif + static Str cur_title; static Str cur_select; static Str select_str; static int select_is_multiple; *************** *** 93,101 **** static char check_accept_charset(char *s); #endif - static Str save_line = NULL; - static int save_prevchar = ' '; - struct link_stack { int cmd; short offset; --- 91,96 ---- *************** *** 163,169 **** int type; char *ext; char *mime_type; ! int libfile_p; char *cmd; char *name; char *encoding; --- 158,164 ---- int type; char *ext; char *mime_type; ! int auxbin_p; char *cmd; char *name; char *encoding; *************** *** 194,199 **** --- 189,213 ---- SIGNAL_RETURN; } + static void + UFhalfclose(URLFile *f) + { + switch (f->scheme) { + case SCM_FTP: + closeFTP(); + break; + #ifdef USE_NNTP + case SCM_NEWS: + case SCM_NNTP: + closeFTP(); + break; + #endif + default: + UFclose(f); + break; + } + } + int currentLn(Buffer *buf) { *************** *** 215,228 **** return NULL; buf->filename = path; ! if (buf->buffername == NULL || buf->buffername[0] == '\0') ! buf->buffername = conv_from_system(lastFileName(path)); if (buf->currentURL.scheme == SCM_UNKNOWN) buf->currentURL.scheme = f->scheme; buf->real_scheme = f->scheme; if (f->scheme == SCM_LOCAL && buf->sourcefile == NULL) buf->sourcefile = path; - UFclose(f); return buf; } --- 229,244 ---- return NULL; buf->filename = path; ! if (buf->buffername == NULL || buf->buffername[0] == '\0') { ! buf->buffername = checkHeader(buf, "Subject:"); ! if (buf->buffername == NULL) ! buf->buffername = conv_from_system(lastFileName(path)); ! } if (buf->currentURL.scheme == SCM_UNKNOWN) buf->currentURL.scheme = f->scheme; buf->real_scheme = f->scheme; if (f->scheme == SCM_LOCAL && buf->sourcefile == NULL) buf->sourcefile = path; return buf; } *************** *** 330,335 **** --- 346,365 ---- return t0; } + static int + setModtime(char *path, time_t modtime) + { + struct utimbuf t; + struct stat st; + + if (stat(path, &st) == 0) + t.actime = st.st_atime; + else + t.actime = time(NULL); + t.modtime = modtime; + return utime(path, &t); + } + void examineFile(char *path, URLFile *uf) { *************** *** 363,369 **** char *t0 = uncompressed_file_type(path, &ext); uf->guess_type = t0; uf->ext = ext; ! uncompress_stream(uf); return; } } --- 393,399 ---- char *t0 = uncompressed_file_type(path, &ext); uf->guess_type = t0; uf->ext = ext; ! uncompress_stream(uf, NULL); return; } } *************** *** 372,378 **** #define S_IXANY (S_IXUSR|S_IXGRP|S_IXOTH) int ! check_command(char *cmd, int libfile_p) { static char *path = NULL; Str dirs; --- 402,408 ---- #define S_IXANY (S_IXUSR|S_IXGRP|S_IXOTH) int ! check_command(char *cmd, int auxbin_p) { static char *path = NULL; Str dirs; *************** *** 382,389 **** if (path == NULL) path = getenv("PATH"); ! if (libfile_p) ! dirs = Strnew_charp(w3m_lib_dir()); else dirs = Strnew_charp(path); for (p = dirs->ptr; p != NULL; p = np) { --- 412,419 ---- if (path == NULL) path = getenv("PATH"); ! if (auxbin_p) ! dirs = Strnew_charp(w3m_auxbin_dir()); else dirs = Strnew_charp(path); for (p = dirs->ptr; p != NULL; p = np) { *************** *** 413,419 **** return encodings->ptr; l = newTextList(); for (d = compression_decoders; d->type != CMP_NOCOMPRESS; d++) { ! if (check_command(d->cmd, d->libfile_p)) { pushText(l, d->encoding); } } --- 443,449 ---- return encodings->ptr; l = newTextList(); for (d = compression_decoders; d->type != CMP_NOCOMPRESS; d++) { ! if (check_command(d->cmd, d->auxbin_p)) { pushText(l, d->encoding); } } *************** *** 440,448 **** line = conv_str(line, *code, InnerCode); } #endif /* JP_CHARSET */ ! cleanup_line(line, mode); #ifdef USE_NNTP ! if (uf->scheme == SCM_NEWS) Strchop(line); #endif /* USE_NNTP */ return line; --- 470,479 ---- line = conv_str(line, *code, InnerCode); } #endif /* JP_CHARSET */ ! if (mode != RAW_MODE) ! cleanup_line(line, mode); #ifdef USE_NNTP ! if (uf && uf->scheme == SCM_NEWS) Strchop(line); #endif /* USE_NNTP */ return line; *************** *** 454,469 **** Buffer * loadFile(char *path) { URLFile uf; init_stream(&uf, SCM_LOCAL, NULL); examineFile(path, &uf); if (uf.stream == NULL) return NULL; current_content_length = 0; #ifdef JP_CHARSET content_charset = '\0'; #endif ! return loadSomething(&uf, path, loadBuffer, NULL); } int --- 485,504 ---- Buffer * loadFile(char *path) { + Buffer *buf; URLFile uf; init_stream(&uf, SCM_LOCAL, NULL); examineFile(path, &uf); if (uf.stream == NULL) return NULL; + buf = newBuffer(INIT_BUFFER_WIDTH); current_content_length = 0; #ifdef JP_CHARSET content_charset = '\0'; #endif ! buf = loadSomething(&uf, path, loadBuffer, buf); ! UFclose(&uf); ! return buf; } int *************** *** 509,530 **** static char * xface2xpm(char *xface) { ! char *xpm; FILE *f; struct stat st; ! xpm = tmpfname(TMPF_DFL, ".xpm")->ptr; ! f = popen(Sprintf("%s > %s", libFile(XFACE2XPM), xpm)->ptr, "w"); if (!f) return NULL; ! fprintf(f, "%s", xface); pclose(f); ! if (stat(xpm, &st)) return NULL; ! pushText(fileToDelete, xpm); ! if (!st.st_size) ! return NULL; ! return xpm; } #endif #endif --- 544,576 ---- static char * xface2xpm(char *xface) { ! Image image; ! ImageCache *cache; FILE *f; struct stat st; ! SKIP_BLANKS(xface); ! image.url = xface; ! image.ext = ".xpm"; ! image.width = 48; ! image.height = 48; ! image.cache = NULL; ! cache = getImage(&image, NULL, IMG_FLAG_AUTO); ! if (cache->loaded & IMG_FLAG_LOADED && !stat(cache->file, &st)) ! return cache->file; ! cache->loaded = IMG_FLAG_ERROR; ! ! f = popen(Sprintf("%s > %s", shell_quote(auxbinFile(XFACE2XPM)), ! shell_quote(cache->file))->ptr, "w"); if (!f) return NULL; ! fputs(xface, f); pclose(f); ! if (stat(cache->file, &st) || !st.st_size) return NULL; ! cache->loaded = IMG_FLAG_LOADED | IMG_FLAG_DONT_REMOVE; ! cache->index = 0; ! return cache->file; } #endif #endif *************** *** 540,549 **** Str lineBuf2 = NULL; Str tmp; TextList *headerlist; ! #ifdef JP_CHARSET ! char code = DocumentCode, ic; ! #endif FILE *src = NULL; headerlist = newBuf->document_header = newTextList(); if (uf->scheme == SCM_HTTP --- 586,595 ---- Str lineBuf2 = NULL; Str tmp; TextList *headerlist; ! char code; ! char *tmpf; FILE *src = NULL; + Lineprop *propBuffer; headerlist = newBuf->document_header = newTextList(); if (uf->scheme == SCM_HTTP *************** *** 555,568 **** else http_response_code = 0; ! if (thru && !newBuf->header_source) { ! Str tmpf = tmpfname(TMPF_DFL, NULL); ! pushText(fileToDelete, tmpf->ptr); ! src = fopen(tmpf->ptr, "w"); if (src) ! newBuf->header_source = tmpf->ptr; } while ((tmp = StrmyUFgets(uf))->length) { #ifdef HTTP_DEBUG { FILE *ff; --- 601,624 ---- else http_response_code = 0; ! if (thru && !newBuf->header_source ! #ifdef USE_IMAGE ! && !image_source ! #endif ! ) { ! tmpf = tmpfname(TMPF_DFL, NULL)->ptr; ! src = fopen(tmpf, "w"); if (src) ! newBuf->header_source = tmpf; } + #ifdef JP_CHARSET + code = DocumentCode; + #endif while ((tmp = StrmyUFgets(uf))->length) { + #ifdef USE_NNTP + if (uf->scheme == SCM_NEWS && tmp->ptr[0] == '.') + Strshrinkfirst(tmp, 1); + #endif #ifdef HTTP_DEBUG { FILE *ff; *************** *** 574,586 **** if (src) Strfputs(tmp, src); cleanup_line(tmp, HEADER_MODE); ! if ((tmp->ptr[0] == '\n' || tmp->ptr[0] == '\r' || tmp->ptr[0] == '\0') ! #ifdef USE_NNTP ! || ! (uf->scheme == SCM_NEWS && ! Str_news_endline(tmp) && (iseos(uf->stream) = TRUE)) ! #endif /* USE_NNTP */ ! ) { if (!lineBuf2) /* there is no header */ break; --- 630,636 ---- if (src) Strfputs(tmp, src); cleanup_line(tmp, HEADER_MODE); ! if (tmp->ptr[0] == '\n' || tmp->ptr[0] == '\r' || tmp->ptr[0] == '\0') { if (!lineBuf2) /* there is no header */ break; *************** *** 599,644 **** /* header line is continued */ continue; lineBuf2 = decodeMIME(lineBuf2->ptr); ! #ifdef JP_CHARSET ! if ((ic = checkShiftCode(lineBuf2, code)) != '\0') { ! if (UseAutoDetect) ! code = ic; ! lineBuf2 = conv_str(lineBuf2, code, InnerCode); ! } ! #endif /* JP_CHARSET */ /* separated with line and stored */ tmp = Strnew_size(lineBuf2->length); for (p = lineBuf2->ptr; *p; p = q) { for (q = p; *q && *q != '\r' && *q != '\n'; q++) ; ! lineBuf2 = checkType(Strnew_charp_n(p, q - p), propBuffer, ! #ifdef USE_ANSI_COLOR ! NULL, NULL, ! #endif ! min(LINELEN, q - p)); Strcat(tmp, lineBuf2); if (thru) ! addnewline(newBuf, lineBuf2->ptr, propBuffer, ! #ifdef USE_ANSI_COLOR ! NULL, ! #endif ! lineBuf2->length, -1); for (; *q && (*q == '\r' || *q == '\n'); q++) ; } #ifdef USE_IMAGE #ifdef USE_XFACE ! if (thru && activeImage && displayImage && ! !strncasecmp(tmp->ptr, "X-Face:", 7)) { ! char *tmpf; ! Str src; ! URLFile f; ! Line *l; ! ! tmpf = xface2xpm(&tmp->ptr[7]); ! if (tmpf) { ! src = ! Sprintf ! ("\"X-Face\"", ! html_quote(tmpf)); init_stream(&f, SCM_LOCAL, newStrStream(src)); loadHTMLstream(&f, newBuf, NULL, TRUE); for (l = newBuf->lastLine; l && l->real_linenumber; --- 649,689 ---- /* header line is continued */ continue; lineBuf2 = decodeMIME(lineBuf2->ptr); ! lineBuf2 = convertLine(NULL, lineBuf2, &code, RAW_MODE); /* separated with line and stored */ tmp = Strnew_size(lineBuf2->length); for (p = lineBuf2->ptr; *p; p = q) { for (q = p; *q && *q != '\r' && *q != '\n'; q++) ; ! lineBuf2 = checkType(Strnew_charp_n(p, q - p), &propBuffer, ! NULL); Strcat(tmp, lineBuf2); if (thru) ! addnewline(newBuf, lineBuf2->ptr, propBuffer, NULL, ! lineBuf2->length, FOLD_BUFFER_WIDTH, -1); for (; *q && (*q == '\r' || *q == '\n'); q++) ; } #ifdef USE_IMAGE + if (thru && activeImage && displayImage) { + Str src = NULL; + if (!strncasecmp(tmp->ptr, "X-Image-URL:", 12)) { + tmpf = &tmp->ptr[12]; + SKIP_BLANKS(tmpf); + src = Strnew_m_charp("\"X-Image-URL\"", NULL); + } #ifdef USE_XFACE ! else if (!strncasecmp(tmp->ptr, "X-Face:", 7)) { ! tmpf = xface2xpm(&tmp->ptr[7]); ! if (tmpf) ! src = Strnew_m_charp("\"X-Face\"",", NULL); ! } ! #endif ! if (src) { ! URLFile f; ! Line *l; init_stream(&f, SCM_LOCAL, newStrStream(src)); loadHTMLstream(&f, newBuf, NULL, TRUE); for (l = newBuf->lastLine; l && l->real_linenumber; *************** *** 647,653 **** } } #endif - #endif lineBuf2 = tmp; } else { --- 692,697 ---- *************** *** 812,818 **** Strcat_charp(msg, " (y/n)"); ans = inputAnswer(msg->ptr); } ! if (ans == NULL || tolower(*ans) != 'y' || (err = add_cookie(pu, name, value, expires, domain, path, flag | COO_OVERRIDE, comment, version, --- 856,862 ---- Strcat_charp(msg, " (y/n)"); ans = inputAnswer(msg->ptr); } ! if (ans == NULL || TOLOWER(*ans) != 'y' || (err = add_cookie(pu, name, value, expires, domain, path, flag | COO_OVERRIDE, comment, version, *************** *** 826,832 **** emsg = "This cookie was rejected to prevent security violation."; record_err_message(emsg); ! disp_message_nsec(emsg, FALSE, 10, TRUE, FALSE); } else disp_message_nsec(Sprintf --- 870,876 ---- emsg = "This cookie was rejected to prevent security violation."; record_err_message(emsg); ! disp_message_nsec(emsg, FALSE, 1, TRUE, FALSE); } else disp_message_nsec(Sprintf *************** *** 860,870 **** lineBuf2 = NULL; } if (thru) ! addnewline(newBuf, "", propBuffer, ! #ifdef USE_ANSI_COLOR ! NULL, ! #endif ! 0, -1); if (src) fclose(src); } --- 904,910 ---- lineBuf2 = NULL; } if (thru) ! addnewline(newBuf, "", propBuffer, NULL, 0, -1, -1); if (src) fclose(src); } *************** *** 876,888 **** TextListItem *i; char *p; ! if (buf == NULL || field == NULL) return NULL; for (i = buf->document_header->first; i != NULL; i = i->next) { if (!strncasecmp(i->ptr, field, len)) { p = i->ptr + len; ! SKIP_BLANKS(p); ! return p; } } return NULL; --- 916,927 ---- TextListItem *i; char *p; ! if (buf == NULL || field == NULL || buf->document_header == NULL) return NULL; for (i = buf->document_header->first; i != NULL; i = i->next) { if (!strncasecmp(i->ptr, field, len)) { p = i->ptr + len; ! return remove_space(p); } } return NULL; *************** *** 1410,1415 **** --- 1449,1455 ---- IN_PASSWORD)) == NULL) return NULL; pwd = Str_conv_to_system(Strnew_charp(pp)); + term_cbreak(); } else { /* *************** *** 1460,1465 **** --- 1500,1544 ---- file ? !strcmp(pu1->file, pu2->file) : 0 : 1)); } + static int + checkRedirection(ParsedURL *pu) + { + static ParsedURL *puv = NULL; + static int nredir = 0; + static int nredir_size = 0; + Str tmp; + + if (pu == NULL) { + nredir = 0; + nredir_size = 0; + puv = NULL; + return TRUE; + } + if (nredir >= FollowRedirection) { + tmp = Sprintf("Number of redirections exceeded %d at %s", + FollowRedirection, parsedURL2Str(pu)->ptr); + disp_err_message(tmp->ptr, FALSE); + return FALSE; + } + else if (nredir_size > 0 && + (same_url_p(pu, &puv[(nredir - 1) % nredir_size]) || + (!(nredir % 2) + && same_url_p(pu, &puv[(nredir / 2) % nredir_size])))) { + tmp = Sprintf("Redirection loop detected (%s)", + parsedURL2Str(pu)->ptr); + disp_err_message(tmp->ptr, FALSE); + return FALSE; + } + if (!puv) { + nredir_size = FollowRedirection / 2 + 1; + puv = New_N(ParsedURL, nredir_size); + memset(puv, 0, sizeof(ParsedURL) * nredir_size); + } + copyParsedURL(&puv[nredir % nredir_size], pu); + nredir++; + return TRUE; + } + /* * loadGeneralFile: load file to buffer */ *************** *** 1468,1476 **** int flag, FormList *volatile request) { URLFile f, *volatile of = NULL; ! ParsedURL pu, *volatile puv = NULL; ! int volatile nredir = 0; ! int volatile nredir_size = 0; Buffer *b = NULL, *(*volatile proc)() = loadBuffer; char *volatile tpath; char *volatile t = "text/plain", *p, *volatile real_type = NULL; --- 1547,1553 ---- int flag, FormList *volatile request) { URLFile f, *volatile of = NULL; ! ParsedURL pu; Buffer *b = NULL, *(*volatile proc)() = loadBuffer; char *volatile tpath; char *volatile t = "text/plain", *p, *volatile real_type = NULL; *************** *** 1485,1490 **** --- 1562,1569 ---- unsigned char status = HTST_NORMAL; URLOption url_option; Str tmp; + Str volatile page = NULL; + char code = '\0'; HRequest hr; ParsedURL *volatile auth_pu; *************** *** 1492,1498 **** --- 1571,1579 ---- prevtrap = NULL; add_auth_cookie_flag = 0; + checkRedirection(NULL); load_doc: + TRAP_OFF; url_option.referer = referer; url_option.flag = flag; f = openURL(tpath, &pu, current, &url_option, request, extra_header, of, *************** *** 1502,1540 **** content_charset = '\0'; #endif if (f.stream == NULL) { - /* openURL failure: it means either (1) the requested URL is a directory name - * on an FTP server, or (2) is a local directory name. - */ - if (fmInitialized) - term_raw(); - if (prevtrap) - signal(SIGINT, prevtrap); switch (f.scheme) { - case SCM_FTPDIR: - { - Str ftpdir = readFTPDir(&pu); - if (ftpdir && ftpdir->length > 0) { - FILE *src; - tmp = tmpfname(TMPF_SRC, ".html"); - pushText(fileToDelete, tmp->ptr); - src = fopen(tmp->ptr, "w"); - if (src) { - Strfputs(ftpdir, src); - fclose(src); - } - b = loadHTMLString(ftpdir); - if (b) { - if (b->currentURL.host == NULL - && b->currentURL.file == NULL) - copyParsedURL(&b->currentURL, &pu); - b->real_scheme = pu.scheme; - if (src) - b->sourcefile = tmp->ptr; - } - return b; - } - } - break; case SCM_LOCAL: { struct stat st; --- 1583,1589 ---- *************** *** 1542,1550 **** return NULL; if (S_ISDIR(st.st_mode)) { if (UseExternalDirBuffer) { ! Str cmd = Strnew_charp(DirBufferCommand); ! Strcat_m_charp(cmd, "?dir=", ! pu.file, "#current", NULL); b = loadGeneralFile(cmd->ptr, NULL, NO_REFERER, 0, NULL); if (b != NULL && b != NO_BUFFER) { --- 1591,1598 ---- return NULL; if (S_ISDIR(st.st_mode)) { if (UseExternalDirBuffer) { ! Str cmd = Sprintf("%s?dir=%s#current", ! DirBufferCommand, pu.file); b = loadGeneralFile(cmd->ptr, NULL, NO_REFERER, 0, NULL); if (b != NULL && b != NO_BUFFER) { *************** *** 1554,1586 **** return b; } else { ! b = dirBuffer(pu.real_file); ! if (b == NULL) ! return NULL; ! t = "text/html"; ! b->real_scheme = pu.scheme; ! goto loaded; } } } break; ! #ifdef USE_EXTERNAL_URI_LOADER case SCM_UNKNOWN: tmp = searchURIMethods(&pu); if (tmp != NULL) { ! b = loadGeneralFile(tmp->ptr, NULL, NO_REFERER, 0, request); ! if (b != NO_BUFFER) ! return b; } - break; #endif } ! disp_err_message(Sprintf("Unknown URI: %s", ! parsedURL2Str(&pu)->ptr)->ptr, FALSE); return NULL; } if (status == HTST_MISSING) { UFclose(&f); return NULL; } --- 1602,1660 ---- return b; } else { ! page = loadLocalDir(pu.real_file); ! t = "local:directory"; ! #ifdef JP_CHARSET ! code = SystemCode; ! #endif } } } break; ! case SCM_FTPDIR: ! page = loadFTPDir(&pu, &code); ! t = "ftp:directory"; ! break; ! #ifdef USE_NNTP ! case SCM_NEWS_GROUP: ! page = loadNewsgroup(&pu, &code); ! t = "news:group"; ! break; ! #endif ! #ifdef USE_JAVASCRIPT ! case SCM_JAVASCRIPT: ! if (! use_script) ! return NULL; ! if (! Currentbuf) ! return NULL; ! script_eval(Currentbuf, "JavaScript", pu.file); ! if (Currentbuf->location) ! return loadGeneralFile(Currentbuf->location, current, referer, ! flag, NULL); ! displayBuffer(Currentbuf, B_FORCE_REDRAW); ! return NO_BUFFER; ! #endif case SCM_UNKNOWN: + #ifdef USE_EXTERNAL_URI_LOADER tmp = searchURIMethods(&pu); if (tmp != NULL) { ! b = loadGeneralFile(tmp->ptr, current, referer, flag, request); ! if (b != NULL && b != NO_BUFFER) ! copyParsedURL(&b->currentURL, &pu); ! return b; } #endif + disp_err_message(Sprintf("Unknown URI: %s", + parsedURL2Str(&pu)->ptr)->ptr, FALSE); + break; } ! if (page && page->length > 0) ! goto page_loaded; return NULL; } if (status == HTST_MISSING) { + TRAP_OFF; UFclose(&f); return NULL; } *************** *** 1588,1596 **** /* openURL() succeeded */ if (SETJMP(AbortLoading) != 0) { /* transfer interrupted */ ! if (fmInitialized) ! term_raw(); ! signal(SIGINT, prevtrap); if (b) discardBuffer(b); UFclose(&f); --- 1662,1668 ---- /* openURL() succeeded */ if (SETJMP(AbortLoading) != 0) { /* transfer interrupted */ ! TRAP_OFF; if (b) discardBuffer(b); UFclose(&f); *************** *** 1605,1613 **** } if (header_string) header_string = NULL; ! prevtrap = signal(SIGINT, KeyAbort); ! if (fmInitialized) ! term_cbreak(); if (pu.scheme == SCM_HTTP || #ifdef USE_SSL pu.scheme == SCM_HTTPS || --- 1677,1683 ---- } if (header_string) header_string = NULL; ! TRAP_ON; if (pu.scheme == SCM_HTTP || #ifdef USE_SSL pu.scheme == SCM_HTTPS || *************** *** 1620,1625 **** --- 1690,1696 ---- ) && !Do_not_use_proxy && !check_no_proxy(pu.host))) { if (fmInitialized) { + term_cbreak(); message(Sprintf("%s contacted. Waiting for reply...", pu.host)-> ptr, 0, 0); refresh(); *************** *** 1636,1685 **** } #endif readHeader(&f, t_buf, FALSE, &pu); - t = checkContentType(t_buf); - if (t == NULL && pu.file != NULL) - t = guessContentType(pu.file); - if (t == NULL) - t = "text/plain"; if (http_response_code >= 301 && http_response_code <= 303 ! && (p = checkHeader(t_buf, "Location:")) != NULL) { /* document moved */ ! if (nredir >= FollowRedirection) { ! tmp = ! Sprintf("Number of redirections exceeded %d at %s", ! FollowRedirection, parsedURL2Str(&pu)->ptr); ! disp_err_message(tmp->ptr, FALSE); ! } ! else if (nredir_size > 0 && ! (same_url_p(&pu, &puv[(nredir - 1) % nredir_size]) || ! (!(nredir % 2) ! && same_url_p(&pu, &puv[(nredir / 2) % nredir_size])))) { ! tmp = ! Sprintf("Redirection loop detected (%s)", ! parsedURL2Str(&pu)->ptr); ! disp_err_message(tmp->ptr, FALSE); ! } ! else { ! if (!puv) { ! nredir_size = FollowRedirection / 2 + 1; ! puv = New_N(ParsedURL, nredir_size); ! memset(puv, 0, sizeof(ParsedURL) * nredir_size); ! } ! ! copyParsedURL(&puv[nredir % nredir_size], &pu); ! ++nredir; ! tmp = Strnew_charp(p); ! Strchop(tmp); ! tpath = tmp->ptr; ! request = NULL; ! UFclose(&f); ! current = New(ParsedURL); ! copyParsedURL(current, &pu); ! t_buf->bufferprop |= BP_REDIRECTED; ! status = HTST_NORMAL; ! goto load_doc; ! } } if (add_auth_cookie_flag && realm && ss) { /* If authorization is required and passed */ add_auth_cookie(auth_pu->host, auth_pu->port, auth_pu->file, --- 1707,1734 ---- } #endif readHeader(&f, t_buf, FALSE, &pu); if (http_response_code >= 301 && http_response_code <= 303 ! && (p = checkHeader(t_buf, "Location:")) != NULL ! && checkRedirection(&pu)) { /* document moved */ ! tpath = url_quote_conv(p, DocumentCode); ! request = NULL; ! UFclose(&f); ! current = New(ParsedURL); ! copyParsedURL(current, &pu); ! t_buf = newBuffer(INIT_BUFFER_WIDTH); ! t_buf->bufferprop |= BP_REDIRECTED; ! status = HTST_NORMAL; ! goto load_doc; ! } ! t = checkContentType(t_buf); ! if (t == NULL && pu.file != NULL) { ! if (!((http_response_code >= 400 && http_response_code <= 407) || ! (http_response_code >= 500 && http_response_code <= 505))) ! t = guessContentType(pu.file); } + if (t == NULL) + t = "text/plain"; if (add_auth_cookie_flag && realm && ss) { /* If authorization is required and passed */ add_auth_cookie(auth_pu->host, auth_pu->port, auth_pu->file, *************** *** 1698,1704 **** if (ss == NULL) { /* abort */ UFclose(&f); ! signal(SIGINT, prevtrap); return NULL; } UFclose(&f); --- 1747,1753 ---- if (ss == NULL) { /* abort */ UFclose(&f); ! TRAP_OFF; return NULL; } UFclose(&f); *************** *** 1720,1726 **** if (ss == NULL) { /* abort */ UFclose(&f); ! signal(SIGINT, prevtrap); return NULL; } UFclose(&f); --- 1769,1775 ---- if (ss == NULL) { /* abort */ UFclose(&f); ! TRAP_OFF; return NULL; } UFclose(&f); *************** *** 1735,1744 **** of = &f; goto load_doc; } } #ifdef USE_NNTP ! else if (pu.scheme == SCM_NEWS) { ! t_buf = newBuffer(INIT_BUFFER_WIDTH); readHeader(&f, t_buf, TRUE, &pu); t = checkContentType(t_buf); if (t == NULL) --- 1784,1796 ---- of = &f; goto load_doc; } + + f.modtime = mymktime(checkHeader(t_buf, "Last-Modified:")); } #ifdef USE_NNTP ! else if (pu.scheme == SCM_NEWS || pu.scheme == SCM_NNTP) { ! if (t_buf == NULL) ! t_buf = newBuffer(INIT_BUFFER_WIDTH); readHeader(&f, t_buf, TRUE, &pu); t = checkContentType(t_buf); if (t == NULL) *************** *** 1752,1762 **** t = "text/plain"; break; case '1': - t = "gopher:directory"; - break; case 'm': t = "gopher:directory"; ! break; case 's': t = "audio/basic"; break; --- 1804,1814 ---- t = "text/plain"; break; case '1': case 'm': + page = loadGopherDir(&f, &pu, &code); t = "gopher:directory"; ! TRAP_OFF; ! goto page_loaded; case 's': t = "audio/basic"; break; *************** *** 1799,1834 **** if (save2tmp(f, tmpf) < 0) UFclose(&f); else { ! if (fmInitialized) { ! term_raw(); ! signal(SIGINT, prevtrap); ! } doFileMove(tmpf, guess_save_name(t_buf, pu.file)); } return NO_BUFFER; } #endif } else if (searchHeader) { ! t_buf = newBuffer(INIT_BUFFER_WIDTH); readHeader(&f, t_buf, searchHeader_through, &pu); ! t = checkContentType(t_buf); ! if (t == NULL) ! t = "text/plain"; ! if (f.is_cgi && (p = checkHeader(t_buf, "Location:")) != NULL) { /* document moved */ ! tmp = Strnew_charp(p); ! Strchop(tmp); ! tpath = tmp->ptr; request = NULL; UFclose(&f); add_auth_cookie_flag = 0; current = New(ParsedURL); copyParsedURL(current, &pu); t_buf->bufferprop |= BP_REDIRECTED; status = HTST_NORMAL; goto load_doc; } searchHeader = SearchHeader = FALSE; } else if (DefaultType) { --- 1851,1888 ---- if (save2tmp(f, tmpf) < 0) UFclose(&f); else { ! UFclose(&f); ! TRAP_OFF; doFileMove(tmpf, guess_save_name(t_buf, pu.file)); } return NO_BUFFER; } #endif } + else if (pu.scheme == SCM_DATA) { + t = f.guess_type; + } else if (searchHeader) { ! if (t_buf == NULL) ! t_buf = newBuffer(INIT_BUFFER_WIDTH); readHeader(&f, t_buf, searchHeader_through, &pu); ! if (f.is_cgi && (p = checkHeader(t_buf, "Location:")) != NULL && ! checkRedirection(&pu)) { /* document moved */ ! tpath = url_quote_conv(remove_space(p), DocumentCode); request = NULL; UFclose(&f); add_auth_cookie_flag = 0; current = New(ParsedURL); copyParsedURL(current, &pu); + t_buf = newBuffer(INIT_BUFFER_WIDTH); t_buf->bufferprop |= BP_REDIRECTED; status = HTST_NORMAL; goto load_doc; } + t = checkContentType(t_buf); + if (t == NULL) + t = "text/plain"; searchHeader = SearchHeader = FALSE; } else if (DefaultType) { *************** *** 1843,1870 **** if (f.guess_type) t = f.guess_type; } if (real_type == NULL) real_type = t; proc = loadBuffer; ! #ifdef USE_IMAGE cur_baseURL = New(ParsedURL); copyParsedURL(cur_baseURL, &pu); #endif if (do_download) { /* download only */ char *file; ! if (fmInitialized) ! term_raw(); ! signal(SIGINT, prevtrap); if (DecodeCTE && IStype(f.stream) != IST_ENCODED) f.stream = newEncodedStream(f.stream, f.encoding); ! if (pu.scheme == SCM_LOCAL) file = conv_from_system(guess_save_name(NULL, pu.real_file)); else file = guess_save_name(t_buf, pu.file); ! doFileSave(f, file); ! UFclose(&f); return NO_BUFFER; } --- 1897,1976 ---- if (f.guess_type) t = f.guess_type; } + + page_loaded: + if (page) { + FILE *src; + #ifdef USE_IMAGE + if (image_source) + return NULL; + #endif + tmp = tmpfname(TMPF_SRC, ".html"); + src = fopen(tmp->ptr, "w"); + if (src) { + Str s = conv_str(page, InnerCode, code); + Strfputs(s, src); + fclose(src); + } + if (do_download) { + char *file; + if (!src) + return NULL; + file = guess_filename(pu.file); + #ifdef USE_GOPHER + if (f.scheme == SCM_GOPHER) + file = Sprintf("%s.html", file)->ptr; + #endif + #ifdef USE_NNTP + if (f.scheme == SCM_NEWS_GROUP) + file = Sprintf("%s.html", file)->ptr; + #endif + doFileMove(tmp->ptr, file); + return NO_BUFFER; + } + b = loadHTMLString(page); + if (b) { + copyParsedURL(&b->currentURL, &pu); + b->real_scheme = pu.scheme; + b->real_type = t; + if (src) + b->sourcefile = tmp->ptr; + #ifdef JP_CHARSET + b->document_code = code; + #endif + } + return b; + } + if (real_type == NULL) real_type = t; proc = loadBuffer; ! #if defined(USE_IMAGE) || defined(USE_SCRIPT) cur_baseURL = New(ParsedURL); copyParsedURL(cur_baseURL, &pu); #endif + current_content_length = 0; + if ((p = checkHeader(t_buf, "Content-Length:")) != NULL) + current_content_length = strtoclen(p); if (do_download) { /* download only */ char *file; ! TRAP_OFF; if (DecodeCTE && IStype(f.stream) != IST_ENCODED) f.stream = newEncodedStream(f.stream, f.encoding); ! if (pu.scheme == SCM_LOCAL) { ! struct stat st; ! if (PreserveTimestamp && !stat(pu.real_file, &st)) ! f.modtime = st.st_mtime; file = conv_from_system(guess_save_name(NULL, pu.real_file)); + } else file = guess_save_name(t_buf, pu.file); ! if (doFileSave(f, file) == 0) ! UFhalfclose(&f); ! else ! UFclose(&f); return NO_BUFFER; } *************** *** 1872,1878 **** if (!(w3m_dump & DUMP_SOURCE) && (w3m_dump & ~DUMP_FRAME || is_text_type(t) || searchExtViewer(t))) { ! uncompress_stream(&f); uncompressed_file_type(pu.file, &f.ext); } else { --- 1978,1986 ---- if (!(w3m_dump & DUMP_SOURCE) && (w3m_dump & ~DUMP_FRAME || is_text_type(t) || searchExtViewer(t))) { ! if (t_buf == NULL) ! t_buf = newBuffer(INIT_BUFFER_WIDTH); ! uncompress_stream(&f, &t_buf->sourcefile); uncompressed_file_type(pu.file, &f.ext); } else { *************** *** 1890,1903 **** b->sourcefile = image_source; b->real_type = t; } - if (fmInitialized) - term_raw(); - signal(SIGINT, prevtrap); UFclose(&f); return b; } #endif if (!strcasecmp(t, "text/html")) proc = loadHTMLBuffer; else if (is_plain_text_type(t)) --- 1998,2014 ---- b->sourcefile = image_source; b->real_type = t; } UFclose(&f); + TRAP_OFF; return b; } #endif + #ifdef USE_SCRIPT + if (flag & RG_SCRIPT) + proc = loadBuffer; + else + #endif if (!strcasecmp(t, "text/html")) proc = loadHTMLBuffer; else if (is_plain_text_type(t)) *************** *** 1907,1917 **** !(w3m_dump & ~DUMP_FRAME) && !strncasecmp(t, "image/", 6)) proc = loadImageBuffer; #endif - #ifdef USE_GOPHER - else if (!strcasecmp(t, "gopher:directory")) { - proc = loadGopherDir; - } - #endif /* USE_GOPHER */ else if (w3m_backend) ; else if (!(w3m_dump & ~DUMP_FRAME) || is_dump_text_type(t)) { if (!do_download && doExternal(f, --- 2018,2023 ---- *************** *** 1924,1960 **** copyParsedURL(&b->currentURL, &pu); } UFclose(&f); ! if (fmInitialized) ! term_raw(); ! signal(SIGINT, prevtrap); return b; } else { ! if (fmInitialized) ! term_raw(); ! signal(SIGINT, prevtrap); if (pu.scheme == SCM_LOCAL) { UFclose(&f); ! doFileCopy(pu.real_file, ! conv_from_system(guess_save_name ! (NULL, pu.real_file))); } else { if (DecodeCTE && IStype(f.stream) != IST_ENCODED) f.stream = newEncodedStream(f.stream, f.encoding); ! doFileSave(f, guess_save_name(t_buf, pu.file)); ! UFclose(&f); } return NO_BUFFER; } } ! ! current_content_length = 0; ! if ((p = checkHeader(t_buf, "Content-Length:")) != NULL) ! current_content_length = strtoclen(p); if (flag & RG_FRAME) { ! t_buf = newBuffer(INIT_BUFFER_WIDTH); t_buf->bufferprop |= BP_FRAME; } #ifdef USE_SSL --- 2030,2063 ---- copyParsedURL(&b->currentURL, &pu); } UFclose(&f); ! TRAP_OFF; return b; } else { ! TRAP_OFF; if (pu.scheme == SCM_LOCAL) { UFclose(&f); ! _doFileCopy(pu.real_file, ! conv_from_system(guess_save_name ! (NULL, pu.real_file)), TRUE); } else { if (DecodeCTE && IStype(f.stream) != IST_ENCODED) f.stream = newEncodedStream(f.stream, f.encoding); ! if (doFileSave(f, guess_save_name(t_buf, pu.file)) == 0) ! UFhalfclose(&f); ! else ! UFclose(&f); } return NO_BUFFER; } } ! else if (w3m_dump & DUMP_FRAME) ! return NULL; if (flag & RG_FRAME) { ! if (t_buf == NULL) ! t_buf = newBuffer(INIT_BUFFER_WIDTH); t_buf->bufferprop |= BP_FRAME; } #ifdef USE_SSL *************** *** 1963,1974 **** #endif frame_source = flag & RG_FRAME_SRC; b = loadSomething(&f, pu.real_file ? pu.real_file : pu.file, proc, t_buf); - frame_source = 0; UFclose(&f); if (b) { b->real_scheme = f.scheme; b->real_type = real_type; - loaded: if (b->currentURL.host == NULL && b->currentURL.file == NULL) copyParsedURL(&b->currentURL, &pu); if (!strcasecmp(t, "text/html")) --- 2066,2076 ---- #endif frame_source = flag & RG_FRAME_SRC; b = loadSomething(&f, pu.real_file ? pu.real_file : pu.file, proc, t_buf); UFclose(&f); + frame_source = 0; if (b) { b->real_scheme = f.scheme; b->real_type = real_type; if (b->currentURL.host == NULL && b->currentURL.file == NULL) copyParsedURL(&b->currentURL, &pu); if (!strcasecmp(t, "text/html")) *************** *** 1981,1990 **** else if (proc == loadImageBuffer) b->type = "text/html"; #endif - #ifdef USE_GOPHER - else if (proc == loadGopherDir) - b->type = "text/html"; - #endif else b->type = "text/plain"; if (pu.label) { --- 2083,2088 ---- *************** *** 2019,2027 **** } if (header_string) header_string = NULL; ! if (fmInitialized) ! term_raw(); ! signal(SIGINT, prevtrap); return b; } --- 2117,2128 ---- } if (header_string) header_string = NULL; ! #ifdef USE_NNTP ! if (f.scheme == SCM_NNTP || f.scheme == SCM_NEWS) ! reAnchorNewsheader(b); ! #endif ! preFormUpdateBuffer(b); ! TRAP_OFF; return b; } *************** *** 2224,2232 **** if (!obuf->bp.init_flag) return; ! obuf->bp.anchor = obuf->anchor; ! obuf->bp.anchor_target = obuf->anchor_target; ! obuf->bp.anchor_hseq = obuf->anchor_hseq; obuf->bp.img_alt = obuf->img_alt; obuf->bp.in_bold = obuf->in_bold; obuf->bp.in_under = obuf->in_under; --- 2325,2332 ---- if (!obuf->bp.init_flag) return; ! bcopy((void *)&obuf->anchor, (void *)&obuf->bp.anchor, ! sizeof(obuf->anchor)); obuf->bp.img_alt = obuf->img_alt; obuf->bp.in_bold = obuf->in_bold; obuf->bp.in_under = obuf->in_under; *************** *** 2239,2247 **** back_to_breakpoint(struct readbuffer *obuf) { obuf->flag = obuf->bp.flag; ! obuf->anchor = obuf->bp.anchor; ! obuf->anchor_target = obuf->bp.anchor_target; ! obuf->anchor_hseq = obuf->bp.anchor_hseq; obuf->img_alt = obuf->bp.img_alt; obuf->in_bold = obuf->bp.in_bold; obuf->in_under = obuf->bp.in_under; --- 2339,2346 ---- back_to_breakpoint(struct readbuffer *obuf) { obuf->flag = obuf->bp.flag; ! bcopy((void *)&obuf->bp.anchor, (void *)&obuf->anchor, ! sizeof(obuf->anchor)); obuf->img_alt = obuf->bp.img_alt; obuf->in_bold = obuf->bp.in_bold; obuf->in_under = obuf->bp.in_under; *************** *** 2510,2516 **** append_tags(obuf); ! if (obuf->anchor) hidden = hidden_anchor = has_hidden_link(obuf, HTML_A); if (obuf->img_alt) { if ((hidden_img = has_hidden_link(obuf, HTML_IMG_ALT)) != NULL) { --- 2609,2615 ---- append_tags(obuf); ! if (obuf->anchor.url) hidden = hidden_anchor = has_hidden_link(obuf, HTML_A); if (obuf->img_alt) { if ((hidden_img = has_hidden_link(obuf, HTML_IMG_ALT)) != NULL) { *************** *** 2547,2553 **** } } ! if (obuf->anchor && !hidden_anchor) Strcat_charp(line, ""); if (obuf->img_alt && !hidden_img) Strcat_charp(line, ""); --- 2646,2652 ---- } } ! if (obuf->anchor.url && !hidden_anchor) Strcat_charp(line, ""); if (obuf->img_alt && !hidden_img) Strcat_charp(line, ""); *************** *** 2720,2734 **** fillline(obuf, indent); if (pass) passthrough(obuf, pass->ptr, 0); ! if (!hidden_anchor && obuf->anchor) { Str tmp; ! if (obuf->anchor_hseq > 0) ! obuf->anchor_hseq = -obuf->anchor_hseq; ! tmp = Sprintf("anchor_hseq); ! Strcat_charp(tmp, html_quote(obuf->anchor->ptr)); ! if (obuf->anchor_target) { Strcat_charp(tmp, "\" TARGET=\""); ! Strcat_charp(tmp, html_quote(obuf->anchor_target->ptr)); } Strcat_charp(tmp, "\">"); push_tag(obuf, tmp->ptr, HTML_A); --- 2819,2849 ---- fillline(obuf, indent); if (pass) passthrough(obuf, pass->ptr, 0); ! if (!hidden_anchor && obuf->anchor.url) { Str tmp; ! if (obuf->anchor.hseq > 0) ! obuf->anchor.hseq = -obuf->anchor.hseq; ! tmp = Sprintf("anchor.hseq); ! Strcat_charp(tmp, html_quote(obuf->anchor.url)); ! if (obuf->anchor.target) { Strcat_charp(tmp, "\" TARGET=\""); ! Strcat_charp(tmp, html_quote(obuf->anchor.target)); ! } ! if (obuf->anchor.referer) { ! Strcat_charp(tmp, "\" REFERER=\""); ! Strcat_charp(tmp, html_quote(obuf->anchor.referer)); ! } ! if (obuf->anchor.title) { ! Strcat_charp(tmp, "\" TITLE=\""); ! Strcat_charp(tmp, html_quote(obuf->anchor.title)); ! } ! if (obuf->anchor.accesskey) { ! char *c = html_quote_char(obuf->anchor.accesskey); ! Strcat_charp(tmp, "\" ACCESSKEY=\""); ! if (c) ! Strcat_charp(tmp, c); ! else ! Strcat_char(tmp, obuf->anchor.accesskey); } Strcat_charp(tmp, "\">"); push_tag(obuf, tmp->ptr, HTML_A); *************** *** 2745,2763 **** push_tag(obuf, "", HTML_U); } - static void - discardline(struct readbuffer *obuf, int indent) - { - append_tags(obuf); - Strclear(obuf->line); - obuf->pos = 0; - obuf->prevchar = ' '; - obuf->bp.init_flag = 1; - set_breakpoint(obuf, 0); - obuf->prev_ctype = PC_ASCII; - fillline(obuf, indent); - } - void do_blankline(struct html_feed_environ *h_env, struct readbuffer *obuf, int indent, int indent_incr, int width) --- 2860,2865 ---- *************** *** 2813,2819 **** static void close_anchor(struct html_feed_environ *h_env, struct readbuffer *obuf) { ! if (obuf->anchor) { int i; char *p = NULL; int is_erased = 0; --- 2915,2921 ---- static void close_anchor(struct html_feed_environ *h_env, struct readbuffer *obuf) { ! if (obuf->anchor.url) { int i; char *p = NULL; int is_erased = 0; *************** *** 2822,2835 **** if (obuf->tag_stack[i]->cmd == HTML_A) break; } ! if (i < 0 && obuf->anchor_hseq > 0 && Strlastchar(obuf->line) == ' ') { Strshrink(obuf->line, 1); obuf->pos--; is_erased = 1; } if (i >= 0 || (p = has_hidden_link(obuf, HTML_A))) { ! if (obuf->anchor_hseq > 0) { HTMLlineproc1(ANSP, h_env); obuf->prevchar = ' '; } --- 2924,2937 ---- if (obuf->tag_stack[i]->cmd == HTML_A) break; } ! if (i < 0 && obuf->anchor.hseq > 0 && Strlastchar(obuf->line) == ' ') { Strshrink(obuf->line, 1); obuf->pos--; is_erased = 1; } if (i >= 0 || (p = has_hidden_link(obuf, HTML_A))) { ! if (obuf->anchor.hseq > 0) { HTMLlineproc1(ANSP, h_env); obuf->prevchar = ' '; } *************** *** 2842,2849 **** else { passthrough(obuf, p, 1); } ! obuf->anchor = NULL; ! obuf->anchor_target = NULL; return; } is_erased = 0; --- 2944,2950 ---- else { passthrough(obuf, p, 1); } ! bzero((void *)&obuf->anchor, sizeof(obuf->anchor)); return; } is_erased = 0; *************** *** 2854,2862 **** } push_tag(obuf, "", HTML_N_A); - obuf->anchor = NULL; } ! obuf->anchor_target = NULL; } void --- 2955,2962 ---- } push_tag(obuf, "", HTML_N_A); } ! bzero((void *)&obuf->anchor, sizeof(obuf->anchor)); } void *************** *** 2887,2896 **** push_tag(obuf, "", HTML_U); } Str process_img(struct parsed_tag *tag, int width) { ! char *p, *q, *r, *r2 = NULL, *s; #ifdef USE_IMAGE int w, i, nw, ni = 1, n, w0 = -1, i0 = -1; int align, xoffset, yoffset, top, bottom, ismap = 0; --- 2987,3035 ---- push_tag(obuf, "", HTML_U); } + static Str + process_title(struct parsed_tag *tag) + { + cur_title = Strnew(); + return NULL; + } + + static Str + process_n_title(struct parsed_tag *tag) + { + Str tmp; + + if (!cur_title) + return NULL; + Strremovefirstspaces(cur_title); + Strremovetrailingspaces(cur_title); + tmp = Strnew_m_charp("ptr), "\">", NULL); + cur_title = NULL; + return tmp; + } + + static void + feed_title(char *str) + { + if (!cur_title) + return; + while (*str) { + if (*str == '&') + Strcat_charp(cur_title, getescapecmd(&str)); + else if (*str == '\n' || *str == '\r') { + Strcat_char(cur_title, ' '); + str++; + } + else + Strcat_char(cur_title, *(str++)); + } + } + Str process_img(struct parsed_tag *tag, int width) { ! char *p, *q, *r, *r2 = NULL, *s, *t, *id; #ifdef USE_IMAGE int w, i, nw, ni = 1, n, w0 = -1, i0 = -1; int align, xoffset, yoffset, top, bottom, ismap = 0; *************** *** 2906,2911 **** --- 3045,3056 ---- p = remove_space(p); q = NULL; parsedtag_get_value(tag, ATTR_ALT, &q); + t = q; + parsedtag_get_value(tag, ATTR_TITLE, &t); + id = NULL; + parsedtag_get_value(tag, ATTR_ID, &id); + if (id == NULL) + parsedtag_get_value(tag, ATTR_NAME, &id); w = -1; if (parsedtag_get_value(tag, ATTR_WIDTH, &w)) { if (w < 0) { *************** *** 2920,2925 **** --- 3065,3072 ---- w = (int)(w * image_scale / 100 + 0.5); if (w == 0) w = 1; + else if (w > MAX_IMAGE_SIZE) + w = MAX_IMAGE_SIZE; } } #endif *************** *** 2932,2937 **** --- 3079,3086 ---- i = (int)(i * image_scale / 100 + 0.5); if (i == 0) i = 1; + else if (i > MAX_IMAGE_SIZE) + i = MAX_IMAGE_SIZE; } else { i = -1; *************** *** 2954,2966 **** if (use_image) { switch (align) { case ALIGN_LEFT: ! Strcat_charp(tmp, "
"); break; case ALIGN_CENTER: ! Strcat_charp(tmp, "
"); break; case ALIGN_RIGHT: ! Strcat_charp(tmp, "
"); break; } } --- 3103,3115 ---- if (use_image) { switch (align) { case ALIGN_LEFT: ! Strcat_charp(tmp, ""); break; case ALIGN_CENTER: ! Strcat_charp(tmp, ""); break; case ALIGN_RIGHT: ! Strcat_charp(tmp, ""); break; } } *************** *** 2994,3000 **** parseURL2(p, &u, cur_baseURL); #endif image.url = parsedURL2Str(&u)->ptr; ! image.ext = filename_extension(u.file, TRUE); image.cache = NULL; image.width = w; image.height = i; --- 3143,3150 ---- parseURL2(p, &u, cur_baseURL); #endif image.url = parsedURL2Str(&u)->ptr; ! if (!uncompressed_file_type(u.file, &image.ext)) ! image.ext = filename_extension(u.file, TRUE); image.cache = NULL; image.width = w; image.height = i; *************** *** 3030,3035 **** --- 3180,3190 ---- } Strcat_charp(tmp, html_quote(p)); Strcat_charp(tmp, "\""); + if (t) { + Strcat_charp(tmp, " title=\""); + Strcat_charp(tmp, html_quote(t)); + Strcat_charp(tmp, "\""); + } #ifdef USE_IMAGE if (use_image) { if (w0 >= 0) *************** *** 3085,3090 **** --- 3240,3247 ---- Strcat_charp(tmp, " ismap"); } #endif + if (id != NULL) + Strcat(tmp, Sprintf(" name=\"%s\"", id)); Strcat_charp(tmp, ">"); if (q != NULL && *q == '\0' && ignore_null_img_alt) q = NULL; *************** *** 3182,3188 **** case ALIGN_RIGHT: case ALIGN_CENTER: case ALIGN_LEFT: ! Strcat_charp(tmp, "
"); break; } } --- 3339,3345 ---- case ALIGN_RIGHT: case ALIGN_CENTER: case ALIGN_LEFT: ! Strcat_charp(tmp, ""); break; } } *************** *** 3648,3680 **** } } Str ! process_hr(struct parsed_tag *tag, int width, int indent_width) { ! Str tmp = Strnew_charp(""); ! int i, w = 0; ! int x = ALIGN_CENTER; ! if (width > indent_width) ! width -= indent_width; ! if (parsedtag_get_value(tag, ATTR_WIDTH, &w)) ! w = REAL_WIDTH(w, width); ! else ! w = width; ! parsedtag_get_value(tag, ATTR_ALIGN, &x); ! switch (x) { ! case ALIGN_CENTER: ! Strcat_charp(tmp, "
"); ! break; ! case ALIGN_RIGHT: ! Strcat_charp(tmp, "
"); ! break; ! case ALIGN_LEFT: ! Strcat_charp(tmp, "
"); ! break; } ! #ifndef KANJI_SYMBOLS Strcat_charp(tmp, "<_RULE TYPE=10>"); #endif /* not KANJI_SYMBOLS */ w -= HR_RULE_WIDTH - 1; --- 3805,3961 ---- } } + #ifdef USE_SCRIPT Str ! process_script(struct parsed_tag * tag, struct html_feed_environ *h_env) { ! char *p = "JavaScript", *q, *t; ! struct stat st; ! int wait_st; ! if (frame_source) ! return NULL; ! parsedtag_get_value(tag, ATTR_LANGUAGE, &p); ! h_env->cur_script_lang = p; ! h_env->cur_script_str = Strnew(); ! t = NULL; ! if (parsedtag_get_value(tag, ATTR_FRAMENAME, &t)) { ! h_env->script_target = t; } ! q = NULL; ! if (parsedtag_get_value(tag, ATTR_SRC, &q)) { ! Buffer *b; ! Line *l; ! Str s; ! char *file; ! pid_t pid; ! ! file = tmpfname(TMPF_DFL, ".js")->ptr; ! if ((pid = fork()) == 0) { ! FILE *f; ! ParsedURL u; ! ! q = remove_space(q); ! #ifdef JP_CHARSET ! parseURL2(conv(q, InnerCode, cur_document_code)->ptr, &u, cur_baseURL); ! #else ! parseURL2(q, &u, cur_baseURL); ! #endif ! setup_child(FALSE, 0, -1); ! UseContentCharset = TRUE; ! UseAutoDetect = TRUE; ! b = loadGeneralFile(parsedURL2Str(&u)->ptr, cur_baseURL, NULL, RG_SCRIPT, NULL); ! if (b) { ! if (b->real_type) { ! f = fopen(file, "w"); ! if (f) { ! saveBuffer(b, f, TRUE); ! fclose(f); ! } ! } ! discardBuffer(b); ! } ! exit(0); ! } else if (pid < 0) { ! return NULL; ! } ! ! #ifdef HAVE_WAITPID ! waitpid(pid, &wait_st, 0); ! #else ! wait(&wait_st); ! #endif ! if (stat(file, &st)) ! return NULL; ! ! b = loadFile(file); ! if (b) { ! l = b->firstLine; ! while (l) { ! Strcat(h_env->cur_script_str, Sprintf("%s\n", l->lineBuf)); ! l = l->next; ! } ! discardBuffer(b); ! } ! unlink(file); ! s = process_n_script(h_env); ! if (s == NULL) { ! s = Strnew(); ! } ! return s; ! } ! return NULL; ! } ! ! Str ! process_n_script(struct html_feed_environ *h_env) ! { ! Buffer *buf; ! Str tmp = NULL; ! ! if (! use_script) ! return NULL; ! if (h_env != NULL && ! h_env->cur_script_str != NULL && h_env->cur_script_str->length) { ! char *p; ! buf = newBuffer(INIT_BUFFER_WIDTH); ! p = h_env->cur_script_str->ptr; ! while (IS_SPACE(*p)) p++; ! if (! strncmp(p, "", f1); goto token_end; case HTML_BASE: if (parsedtag_get_value(tag, ATTR_HREF, &q)) { ! q = url_quote_conv(q, code); parseURL(q, &base, NULL); } if (parsedtag_get_value(tag, ATTR_TARGET, &q)) { --- 649,657 ---- fputs("-->", f1); goto token_end; case HTML_BASE: + /* "BASE" is prohibit tag */ if (parsedtag_get_value(tag, ATTR_HREF, &q)) { ! q = url_quote_conv(remove_space(q), code); parseURL(q, &base, NULL); } if (parsedtag_get_value(tag, ATTR_TARGET, &q)) { *************** *** 611,622 **** else d_target = url_quote_conv(q, code); } ! /* fall thru, "BASE" is prohibit tag */ case HTML_HEAD: case HTML_N_HEAD: case HTML_BODY: case HTML_N_BODY: - case HTML_META: case HTML_DOCTYPE: /* prohibit_tags */ Strshrinkfirst(tok, 1); --- 662,692 ---- else d_target = url_quote_conv(q, code); } ! Strshrinkfirst(tok, 1); ! Strshrink(tok, 1); ! fprintf(f1, "", html_quote(tok->ptr)); ! goto token_end; ! case HTML_META: ! if (parsedtag_get_value(tag, ATTR_HTTP_EQUIV, &q) ! && !strcasecmp(q, "refresh")) { ! if (parsedtag_get_value(tag, ATTR_CONTENT, &q) ! ) { ! Str s_tmp = NULL; ! int refresh_interval = ! getMetaRefreshParam(q, &s_tmp); ! if (s_tmp) { ! q = html_quote(s_tmp->ptr); ! fprintf(f1, ! "Refresh (%d sec) %s\n", ! refresh_interval, q, q); ! } ! } ! } ! /* fall thru, "META" is prohibit tag */ case HTML_HEAD: case HTML_N_HEAD: case HTML_BODY: case HTML_N_BODY: case HTML_DOCTYPE: /* prohibit_tags */ Strshrinkfirst(tok, 1); *************** *** 638,655 **** goto token_end; } break; ! case HTML_THEAD: ! case HTML_N_THEAD: ! case HTML_TBODY: ! case HTML_N_TBODY: ! case HTML_TFOOT: ! case HTML_N_TFOOT: ! case HTML_TD: ! case HTML_N_TD: ! case HTML_TR: ! case HTML_N_TR: ! case HTML_TH: ! case HTML_N_TH: /* table_tags MUST be in table stack */ if (!t_stack) { Strshrinkfirst(tok, 1); --- 708,714 ---- goto token_end; } break; ! CASE_TABLE_TAG: /* table_tags MUST be in table stack */ if (!t_stack) { Strshrinkfirst(tok, 1); *************** *** 660,665 **** --- 719,763 ---- } break; + case HTML_SELECT: + pre_mode = RB_INSELECT; + end_tag = HTML_N_SELECT; + break; + case HTML_TEXTAREA: + pre_mode = RB_INTXTA; + end_tag = HTML_N_TEXTAREA; + break; + case HTML_SCRIPT: + pre_mode = RB_SCRIPT; + end_tag = HTML_N_SCRIPT; + parsedtag_set_value(tag, + ATTR_FRAMENAME, s_target); + break; + case HTML_STYLE: + pre_mode = RB_STYLE; + end_tag = HTML_N_STYLE; + break; + case HTML_LISTING: + pre_mode = RB_PLAIN; + end_tag = HTML_N_LISTING; + fputs("", f1); + goto token_end; + case HTML_XMP: + pre_mode = RB_PLAIN; + end_tag = HTML_N_XMP; + fputs("", f1); + goto token_end; + case HTML_PLAINTEXT: + pre_mode = RB_PLAIN; + end_tag = MAX_HTMLTAG; + fputs("", f1); + goto token_end; + #ifdef USE_SCRIPT + case HTML_NOSCRIPT: + pre_mode = RB_NOSCRIPT; + end_tag = HTML_N_NOSCRIPT; + break; + #endif default: break; } *************** *** 671,677 **** if (!tag->value[j]) break; tag->value[j] = ! url_quote_conv(tag->value[j], code); parseURL2(tag->value[j], &url, &base); if (url.scheme == SCM_UNKNOWN || #ifndef USE_W3MMAILER --- 769,777 ---- if (!tag->value[j]) break; tag->value[j] = ! url_quote_conv(remove_space(tag->value[j]), ! code); ! tag->need_reconstruct = TRUE; parseURL2(tag->value[j], &url, &base); if (url.scheme == SCM_UNKNOWN || #ifndef USE_W3MMAILER *************** *** 681,687 **** break; a_target |= 1; tag->value[j] = parsedURL2Str(&url)->ptr; - tag->need_reconstruct = TRUE; parsedtag_set_value(tag, ATTR_REFERER, parsedURL2Str(&base)->ptr); --- 781,786 ---- *************** *** 721,736 **** parsedtag_set_value(tag, ATTR_TARGET, d_target); } if (parsedtag_need_reconstruct(tag)) ! Strfputs(parsedtag2str(tag), f1); ! else ! Strfputs(tok, f1); } else { ! Strfputs(tok, f1); } token_end: Strclear(tok); } while (*p != '\0' || !iseos(f2.stream)); while (t_stack--) fputs("\n", f1); UFclose(&f2); --- 820,855 ---- parsedtag_set_value(tag, ATTR_TARGET, d_target); } if (parsedtag_need_reconstruct(tag)) ! tok = parsedtag2str(tag); ! Strfputs(tok, f1); } else { ! if (pre_mode & (RB_PLAIN | RB_INTXTA)) ! fprintf(f1, "%s", html_quote(tok->ptr)); ! else ! Strfputs(tok, f1); } token_end: Strclear(tok); } while (*p != '\0' || !iseos(f2.stream)); + if (pre_mode & RB_PLAIN) + fputs("\n", f1); + else if (pre_mode & RB_INTXTA) + fputs("\n", f1); + else if (pre_mode & RB_INSELECT) + fputs("\n", f1); + else if (pre_mode & (RB_SCRIPT | RB_STYLE)) { + if (status != R_ST_NORMAL) + fputs(correct_irrtag(status)->ptr, f1); + if (pre_mode & RB_SCRIPT) + fputs("\n", f1); + else if (pre_mode & RB_STYLE) + fputs("\n", f1); + } + #ifdef USE_SCRIPT + else if (pre_mode & RB_NOSCRIPT) + fputs("\n", f1); + #endif while (t_stack--) fputs("\n", f1); UFclose(&f2); *************** *** 752,760 **** fputs("\n", f1); if (level == 0) { fputs("\n", f1); ! signal(SIGINT, prevtrap); ! if (fmInitialized) ! term_raw(); } return 0; } --- 871,877 ---- fputs("\n", f1); if (level == 0) { fputs("\n", f1); ! TRAP_OFF; } return 0; } *************** *** 792,797 **** --- 909,915 ---- buf->document_code = Cbuf->document_code; #endif copyParsedURL(&buf->currentURL, &Cbuf->currentURL); + preFormUpdateBuffer(buf); return buf; } diff -crN -x CVS w3m-0.3.2.2/frame.h w3m-js-1.743/frame.h *** w3m-0.3.2.2/frame.h 2002-02-08 20:45:07.000000000 +0900 --- w3m-js-1.743/frame.h 2003-01-26 04:03:04.000000000 +0900 *************** *** 1,4 **** ! /* $Id: frame.h,v 1.4 2002/02/08 11:45:07 ukai Exp $ */ /* * frame support */ --- 1,4 ---- ! /* $Id: frame.h,v 1.6 2003/01/25 17:42:17 ukai Exp $ */ /* * frame support */ *************** *** 15,23 **** struct frame_body { char attr; char flags; ! #define FB_NOCACHE 0x01 ! #define FB_TODELETE 0x02 ! #define FB_NO_BUFFER 0x04 char *name; char *url; ParsedURL *baseURL; --- 15,21 ---- struct frame_body { char attr; char flags; ! #define FB_NO_BUFFER 0x01 char *name; char *url; ParsedURL *baseURL; *************** *** 56,63 **** struct frameset *frameset; long linenumber; long top_linenumber; ! short pos; ! short currentColumn; struct _anchorList *formitem; }; --- 54,61 ---- struct frameset *frameset; long linenumber; long top_linenumber; ! int pos; ! int currentColumn; struct _anchorList *formitem; }; diff -crN -x CVS w3m-0.3.2.2/ftp.c w3m-js-1.743/ftp.c *** w3m-0.3.2.2/ftp.c 2002-10-31 02:21:42.000000000 +0900 --- w3m-js-1.743/ftp.c 2003-01-17 23:37:15.000000000 +0900 *************** *** 1,10 **** ! /* $Id: ftp.c,v 1.13 2002/10/30 17:21:42 ukai Exp $ */ #include #include #include - #include #include #include #include "fm.h" #include "html.h" --- 1,10 ---- ! /* $Id: ftp.c,v 1.26 2003/01/15 16:24:25 ukai Exp $ */ #include #include #include #include #include + #include #include "fm.h" #include "html.h" *************** *** 22,192 **** #endif typedef struct _FTP { ! FILE *rcontrol; ! FILE *wcontrol; FILE *data; } *FTP; ! #define FtpError(status) ((status)<0) ! #define FTPDATA(ftp) ((ftp)->data) ! ! typedef int STATUS; ! ! static FTP current_ftp; static Str ! read_response1(FTP ftp) { ! char c; ! Str buf = Strnew(); while (1) { ! c = getc(ftp->rcontrol); ! if (c == '\r') { ! c = getc(ftp->rcontrol); ! if (c == '\n') { ! Strcat_charp(buf, "\r\n"); ! break; ! } ! else { ! Strcat_char(buf, '\r'); ! Strcat_char(buf, c); ! } ! } ! else if (c == '\n') { ! Strcat_charp(buf, "\r\n"); break; } - else if (feof(ftp->rcontrol)) - break; - else - Strcat_char(buf, c); } ! return buf; } ! Str ! read_response(FTP ftp) { ! Str tmp; ! ! tmp = read_response1(ftp); ! if (feof(ftp->rcontrol)) { ! return tmp; } ! if (tmp->ptr[3] == '-') { ! /* RFC959 4.2 FTP REPLIES */ ! /* multi-line response start */ ! /* ! * Thus the format for multi-line replies is that the ! * first line will begin with the exact required reply ! * code, followed immediately by a Hyphen, "-" (also known ! * as Minus), followed by text. The last line will begin ! * with the same code, followed immediately by Space , ! * optionally some text, and the Telnet end-of-line code. */ ! while (1) { ! tmp = read_response1(ftp); ! if (feof(ftp->rcontrol)) { ! break; ! } ! if (IS_DIGIT(tmp->ptr[0]) ! && IS_DIGIT(tmp->ptr[1]) ! && IS_DIGIT(tmp->ptr[2]) ! && tmp->ptr[3] == ' ') { ! break; ! } ! } } ! return tmp; } ! int ! FtpLogin(FTP * ftp_return, char *host, char *user, char *pass) { Str tmp; ! FTP ftp = New(struct _FTP); ! int fd; ! *ftp_return = current_ftp = ftp; ! fd = openSocket(host, "ftp", 21); ! if (fd < 0) ! return -1; #ifdef FTPPASS_HOSTNAMEGEN ! if (ftppass_hostnamegen && !strcmp(user, "anonymous")) { ! size_t n = strlen(pass); ! if (n > 0 && pass[n - 1] == '@') { struct sockaddr_in sockname; int socknamelen = sizeof(sockname); ! if (!getsockname(fd, (struct sockaddr *)&sockname, &socknamelen)) { struct hostent *sockent; ! Str tmp2 = Strnew_charp(pass); if ((sockent = gethostbyaddr((char *)&sockname.sin_addr, sizeof(sockname.sin_addr), sockname.sin_family))) ! Strcat_charp(tmp2, sockent->h_name); else ! Strcat_m_charp(tmp2, "[", inet_ntoa(sockname.sin_addr), "]", NULL); ! pass = tmp2->ptr; } } } #endif ! ftp->rcontrol = fdopen(fd, "rb"); ! ftp->wcontrol = fdopen(dup(fd), "wb"); ! ftp->data = NULL; ! tmp = read_response(ftp); ! if (atoi(tmp->ptr) != 220) ! return -1; if (fmInitialized) { ! message(Sprintf("Sending FTP username (%s) to remote server.", user)-> ! ptr, 0, 0); refresh(); } ! tmp = Sprintf("USER %s\r\n", user); ! fwrite(tmp->ptr, tmp->length, sizeof(char), ftp->wcontrol); ! fflush(ftp->wcontrol); ! tmp = read_response(ftp); /* * Some ftp daemons(e.g. publicfile) return code 230 for user command. */ ! if (atoi(tmp->ptr) == 230) goto succeed; ! if (atoi(tmp->ptr) != 331) ! return -1; if (fmInitialized) { ! message(Sprintf("Sending FTP password to remote server.")->ptr, 0, 0); refresh(); } ! tmp = Sprintf("PASS %s\r\n", pass); ! fwrite(tmp->ptr, tmp->length, sizeof(char), ftp->wcontrol); ! fflush(ftp->wcontrol); ! tmp = read_response(ftp); ! if (atoi(tmp->ptr) != 230) ! return -1; succeed: ! return 0; } ! int ! FtpBinary(FTP ftp) ! { ! Str tmp; ! fwrite("TYPE I\r\n", 8, sizeof(char), ftp->wcontrol); ! fflush(ftp->wcontrol); ! tmp = read_response(ftp); ! if (atoi(tmp->ptr) != 200) ! return -1; ! return 0; ! } ! ! int ftp_pasv(FTP ftp) { int n1, n2, n3, n4, p1, p2; ! int data_s; char *p; Str tmp; int family; --- 22,182 ---- #endif typedef struct _FTP { ! char *host; ! int port; ! char *user; ! char *pass; ! InputStream rf; ! FILE *wf; FILE *data; } *FTP; ! static struct _FTP current_ftp = { ! NULL, 0, NULL, NULL, NULL, NULL, NULL ! }; static Str ! ftp_command(FTP ftp, char *cmd, char *arg, int *status) { ! Str tmp; ! ! if (!ftp->host) ! return NULL; ! if (cmd) { ! if (arg) ! tmp = Sprintf("%s %s\r\n", cmd, arg); ! else ! tmp = Sprintf("%s\r\n", cmd); ! fwrite(tmp->ptr, sizeof(char), tmp->length, ftp->wf); ! fflush(ftp->wf); ! } ! if (!status) ! return NULL; ! *status = -1; /* error */ ! tmp = StrISgets(ftp->rf); ! if (IS_DIGIT(tmp->ptr[0]) && IS_DIGIT(tmp->ptr[1]) && ! IS_DIGIT(tmp->ptr[2]) && tmp->ptr[3] == ' ') ! sscanf(tmp->ptr, "%d", status); ! ! if (tmp->ptr[3] != '-') ! return tmp; ! /* RFC959 4.2 FTP REPLIES */ ! /* multi-line response start */ ! /* ! * Thus the format for multi-line replies is that the ! * first line will begin with the exact required reply ! * code, followed immediately by a Hyphen, "-" (also known ! * as Minus), followed by text. The last line will begin ! * with the same code, followed immediately by Space , ! * optionally some text, and the Telnet end-of-line code. */ while (1) { ! tmp = StrISgets(ftp->rf); ! if (IS_DIGIT(tmp->ptr[0]) && IS_DIGIT(tmp->ptr[1]) && ! IS_DIGIT(tmp->ptr[2]) && tmp->ptr[3] == ' ') { ! sscanf(tmp->ptr, "%d", status); break; } } ! return tmp; } ! static void ! ftp_close(FTP ftp) { ! if (!ftp->host) ! return; ! if (ftp->rf) { ! IStype(ftp->rf) &= ~IST_UNCLOSE; ! ISclose(ftp->rf); ! ftp->rf = NULL; ! } ! if (ftp->wf) { ! fclose(ftp->wf); ! ftp->wf = NULL; } ! if (ftp->data) { ! fclose(ftp->data); ! ftp->data = NULL; } ! ftp->host = NULL; ! return; } ! static int ! ftp_login(FTP ftp) { Str tmp; ! int sock, status; ! ! sock = openSocket(ftp->host, "ftp", 21); ! if (sock < 0) ! goto open_err; #ifdef FTPPASS_HOSTNAMEGEN ! if (ftppass_hostnamegen && !strcmp(ftp->user, "anonymous")) { ! size_t n = strlen(ftp->pass); ! if (n > 0 && ftp->pass[n - 1] == '@') { struct sockaddr_in sockname; int socknamelen = sizeof(sockname); ! if (!getsockname(sock, (struct sockaddr *)&sockname, &socknamelen)) { struct hostent *sockent; ! tmp = Strnew_charp(ftp->pass); if ((sockent = gethostbyaddr((char *)&sockname.sin_addr, sizeof(sockname.sin_addr), sockname.sin_family))) ! Strcat_charp(tmp, sockent->h_name); else ! Strcat_m_charp(tmp, "[", inet_ntoa(sockname.sin_addr), "]", NULL); ! ftp->pass = tmp->ptr; } } } #endif ! ftp->rf = newInputStream(sock); ! ftp->wf = fdopen(dup(sock), "wb"); ! if (!ftp->rf || !ftp->wf) ! goto open_err; ! IStype(ftp->rf) |= IST_UNCLOSE; ! ftp_command(ftp, NULL, NULL, &status); ! if (status != 220) ! goto open_err; if (fmInitialized) { ! message(Sprintf("Sending FTP username (%s) to remote server.", ! ftp->user)->ptr, 0, 0); refresh(); } ! ftp_command(ftp, "USER", ftp->user, &status); /* * Some ftp daemons(e.g. publicfile) return code 230 for user command. */ ! if (status == 230) goto succeed; ! if (status != 331) ! goto open_err; if (fmInitialized) { ! message("Sending FTP password to remote server.", 0, 0); refresh(); } ! ftp_command(ftp, "PASS", ftp->pass, &status); ! if (status != 230) ! goto open_err; succeed: ! return TRUE; ! open_err: ! ftp_close(ftp); ! return FALSE; } ! static int ftp_pasv(FTP ftp) { + int status; int n1, n2, n3, n4, p1, p2; ! int data; char *p; Str tmp; int family; *************** *** 199,205 **** #ifdef INET6 sockaddrlen = sizeof(sockaddr); ! if (getpeername(fileno(ftp->wcontrol), (struct sockaddr *)&sockaddr, &sockaddrlen) < 0) return -1; family = sockaddr.ss_family; --- 189,195 ---- #ifdef INET6 sockaddrlen = sizeof(sockaddr); ! if (getpeername(fileno(ftp->wf), (struct sockaddr *)&sockaddr, &sockaddrlen) < 0) return -1; family = sockaddr.ss_family; *************** *** 209,218 **** switch (family) { #ifdef INET6 case AF_INET6: ! fwrite("EPSV\r\n", 6, sizeof(char), ftp->wcontrol); ! fflush(ftp->wcontrol); ! tmp = read_response(ftp); ! if (atoi(tmp->ptr) != 229) return -1; for (p = tmp->ptr + 4; *p && *p != '('; p++) ; if (*p == '\0') --- 199,206 ---- switch (family) { #ifdef INET6 case AF_INET6: ! tmp = ftp_command(ftp, "EPSV", NULL, &status); ! if (status != 229) return -1; for (p = tmp->ptr + 4; *p && *p != '('; p++) ; if (*p == '\0') *************** *** 223,381 **** if (getnameinfo((struct sockaddr *)&sockaddr, sockaddrlen, abuf, sizeof(abuf), NULL, 0, NI_NUMERICHOST) != 0) return -1; ! tmp = Sprintf("%s", abuf); ! data_s = openSocket(tmp->ptr, "", port); break; #endif case AF_INET: ! fwrite("PASV\r\n", 6, sizeof(char), ftp->wcontrol); ! fflush(ftp->wcontrol); ! tmp = read_response(ftp); ! if (atoi(tmp->ptr) != 227) return -1; for (p = tmp->ptr + 4; *p && !IS_DIGIT(*p); p++) ; if (*p == '\0') return -1; sscanf(p, "%d,%d,%d,%d,%d,%d", &n1, &n2, &n3, &n4, &p1, &p2); tmp = Sprintf("%d.%d.%d.%d", n1, n2, n3, n4); ! data_s = openSocket(tmp->ptr, "", p1 * 256 + p2); break; default: return -1; } ! if (data_s < 0) return -1; ! ftp->data = fdopen(data_s, "rb"); return 0; } ! int ! FtpCwd(FTP ftp, char *path) ! { ! Str tmp; ! ! tmp = Sprintf("CWD %s\r\n", path); ! fwrite(tmp->ptr, tmp->length, sizeof(char), ftp->wcontrol); ! fflush(ftp->wcontrol); ! tmp = read_response(ftp); ! if (tmp->ptr[0] == '5') { ! return -1; ! } ! return 0; ! } ! ! int ! FtpOpenReadBody(FTP ftp, char *path) ! { ! Str tmp; ! ! tmp = Sprintf("RETR %s\r\n", path); ! fwrite(tmp->ptr, tmp->length, sizeof(char), ftp->wcontrol); ! fflush(ftp->wcontrol); ! tmp = read_response(ftp); ! if (tmp->ptr[0] == '5') { ! return -1; ! } ! return 0; ! } ! ! int ! FtpOpenRead(FTP ftp, char *path) ! { ! if (ftp_pasv(ftp) < 0) ! return -1; ! if (FtpOpenReadBody(ftp, path) < 0) { ! fclose(ftp->data); ! ftp->data = NULL; ! return -1; ! } ! return 0; ! } ! ! int ! Ftpfclose(FILE * f) ! { ! fclose(f); ! if (f == current_ftp->data) ! current_ftp->data = NULL; ! read_response(current_ftp); ! return 0; ! } ! ! int ! FtpDataBody(FTP ftp, char *cmd, char *arg, char *mode) { Str tmp; ! tmp = Sprintf(cmd, arg); ! Strcat_charp(tmp, "\r\n"); ! fwrite(tmp->ptr, tmp->length, sizeof(char), ftp->wcontrol); ! fflush(ftp->wcontrol); ! tmp = read_response(ftp); ! if (tmp->ptr[0] == '5') { ! fclose(ftp->data); ! ftp->data = NULL; return -1; ! } ! return 0; } ! int ! FtpData(FTP ftp, char *cmd, char *arg, char *mode) ! { ! if (ftp_pasv(ftp) < 0) ! return -1; ! ! return FtpDataBody(ftp, cmd, arg, mode); ! } ! ! int ! FtpClose(FTP ftp) { ! Str tmp; ! ! fclose(ftp->data); ! ftp->data = NULL; ! tmp = read_response(ftp); ! if (atoi(tmp->ptr) != 226) ! return -1; return 0; } - int - FtpBye(FTP ftp) - { - Str tmp; - int ret_val, control_closed; - - fwrite("QUIT\r\n", 6, sizeof(char), ftp->wcontrol); - fflush(ftp->wcontrol); - tmp = read_response(ftp); - if (atoi(tmp->ptr) != 221) - ret_val = -1; - else - ret_val = 0; - control_closed = 0; - if (ftp->rcontrol != NULL) { - fclose(ftp->rcontrol); - ftp->rcontrol = NULL; - control_closed = 1; - } - if (ftp->wcontrol != NULL) { - fclose(ftp->wcontrol); - ftp->wcontrol = NULL; - control_closed = 1; - } - if (control_closed && ftp->data != NULL) { - fclose(ftp->data); - ftp->data = NULL; - } - return ret_val; - } - - static int ex_ftpdir_name_size_date(char *, char **, char **, char **); - static int ftp_system(FTP); #define SERVER_NONE 0 #define UNIXLIKE_SERVER 1 --- 211,281 ---- if (getnameinfo((struct sockaddr *)&sockaddr, sockaddrlen, abuf, sizeof(abuf), NULL, 0, NI_NUMERICHOST) != 0) return -1; ! data = openSocket(abuf, "", port); break; #endif case AF_INET: ! tmp = ftp_command(ftp, "PASV", NULL, &status); ! if (status != 227) return -1; for (p = tmp->ptr + 4; *p && !IS_DIGIT(*p); p++) ; if (*p == '\0') return -1; sscanf(p, "%d,%d,%d,%d,%d,%d", &n1, &n2, &n3, &n4, &p1, &p2); tmp = Sprintf("%d.%d.%d.%d", n1, n2, n3, n4); ! data = openSocket(tmp->ptr, "", p1 * 256 + p2); break; default: return -1; } ! if (data < 0) return -1; ! ftp->data = fdopen(data, "rb"); return 0; } ! static time_t ! ftp_modtime(FTP ftp, char *path) { + int status; Str tmp; + char *p; + struct tm tm; + time_t t, lt, gt; ! tmp = ftp_command(ftp, "MDTM", path, &status); ! if (status != 213) return -1; ! for (p = tmp->ptr + 4; *p && *p == ' '; p++) ; ! memset(&tm, 0, sizeof(struct tm)); ! if (sscanf(p, "%04d%02d%02d%02d%02d%02d", ! &tm.tm_year, &tm.tm_mon, &tm.tm_mday, ! &tm.tm_hour, &tm.tm_min, &tm.tm_sec) < 6) ! return -1; ! tm.tm_year -= 1900; ! tm.tm_mon--; ! t = mktime(&tm); ! lt = mktime(localtime(&t)); ! gt = mktime(gmtime(&t)); ! return t + (lt - gt); } ! static int ! ftp_quit(FTP ftp) { ! /* ! * int status; ! * ftp_command(ftp, "QUIT", NULL, &status); ! * ftp_close(ftp); ! * if (status != 221) ! * return -1; ! */ ! ftp_command(ftp, "QUIT", NULL, NULL); ! ftp_close(ftp); return 0; } static int ex_ftpdir_name_size_date(char *, char **, char **, char **); #define SERVER_NONE 0 #define UNIXLIKE_SERVER 1 *************** *** 385,407 **** #define FTPDIR_LINK 2 #define FTPDIR_FILE 3 ! FILE * ! openFTP(ParsedURL *pu) { ! Str tmp2 = Strnew(); ! Str tmp3 = Strnew(); ! STATUS s; char *user = NULL; char *pass = NULL; Str pwd = NULL; ! int add_auth_cookie_flag; char *realpathname = NULL; - #ifdef JP_CHARSET - char code = '\0', ic; - Str pathStr; - #endif ! add_auth_cookie_flag = 0; if (pu->user == NULL && pu->pass == NULL) { Str uname, pwd; if (find_auth_user_passwd(pu, NULL, &uname, &pwd, 0)) { --- 285,323 ---- #define FTPDIR_LINK 2 #define FTPDIR_FILE 3 ! static void ! closeFTPdata(FILE * f) ! { ! int status; ! if (f) { ! fclose(f); ! if (f == current_ftp.data) ! current_ftp.data = NULL; ! } ! ftp_command(¤t_ftp, NULL, NULL, &status); ! /* status == 226 */ ! } ! ! void ! closeFTP(void) { ! ftp_close(¤t_ftp); ! } ! ! InputStream ! openFTPStream(ParsedURL *pu, URLFile *uf) ! { ! Str tmp; ! int status; char *user = NULL; char *pass = NULL; Str pwd = NULL; ! int add_auth_cookie_flag = FALSE; char *realpathname = NULL; ! if (!pu->host) ! return NULL; ! if (pu->user == NULL && pu->pass == NULL) { Str uname, pwd; if (find_auth_user_passwd(pu, NULL, &uname, &pwd, 0)) { *************** *** 415,424 **** /* do nothing */ ; else if (pu->user) user = pu->user; ! else { ! Strcat_charp(tmp3, "anonymous"); ! user = tmp3->ptr; } if (pass) /* do nothing */ ; else if (pu->pass) --- 331,352 ---- /* do nothing */ ; else if (pu->user) user = pu->user; ! else ! user = "anonymous"; ! ! if (current_ftp.host) { ! if (!strcmp(current_ftp.host, pu->host) && ! current_ftp.port == pu->port && !strcmp(current_ftp.user, user)) { ! ftp_command(¤t_ftp, "NOOP", NULL, &status); ! if (status != 200) ! ftp_close(¤t_ftp); ! else ! goto ftp_read; ! } ! else ! ftp_quit(¤t_ftp); } + if (pass) /* do nothing */ ; else if (pu->pass) *************** *** 435,441 **** else { pwd = Strnew_charp((char *)getpass("Password: ")); } ! add_auth_cookie_flag = 1; } pass = pwd->ptr; } --- 363,369 ---- else { pwd = Strnew_charp((char *)getpass("Password: ")); } ! add_auth_cookie_flag = TRUE; } pass = pwd->ptr; } *************** *** 443,576 **** pass = ftppasswd; else { struct passwd *mypw = getpwuid(getuid()); ! if (mypw == NULL) ! Strcat_charp(tmp2, "anonymous"); ! else ! Strcat_charp(tmp2, mypw->pw_name); ! Strcat_char(tmp2, '@'); ! pass = tmp2->ptr; } - s = FtpLogin(¤t_ftp, pu->host, user, pass); - if (FtpError(s)) - return NULL; if (add_auth_cookie_flag) add_auth_cookie(pu->host, pu->port, pu->file, pu->user, pwd); if (pu->file == NULL || *pu->file == '\0') goto ftp_dir; else realpathname = file_unquote(pu->file); - if (pu->file[strlen(pu->file) - 1] == '/') goto ftp_dir; - /* Get file */ ! FtpBinary(current_ftp); ! if (ftp_pasv(current_ftp) < 0) { ! FtpBye(current_ftp); ! return NULL; ! } ! s = FtpOpenReadBody(current_ftp, realpathname); ! if (!FtpError(s)) { ! #ifdef JP_CHARSET ! pathStr = Strnew_charp(realpathname); ! if ((ic = checkShiftCode(pathStr, code)) != '\0') { ! pathStr = conv_str(pathStr, (code = ic), InnerCode); ! realpathname = pathStr->ptr; ! } ! #endif /* JP_CHARSET */ ! pu->file = realpathname; ! return FTPDATA(current_ftp); ! } ! goto ftp_dir1; - /* Get directory */ ftp_dir: - if (ftp_pasv(current_ftp) < 0) { - FtpBye(current_ftp); - return NULL; - } - ftp_dir1: pu->scheme = SCM_FTPDIR; return NULL; } Str ! readFTPDir(ParsedURL *pu) { ! Str FTPDIRtmp = Strnew(); ! Str host; ! Str curdir; ! char *fn; ! char *qdir; char **flist; int i, nfile, nfile_max = 100; - int sv_type; - STATUS s; - char *realpathname = NULL; - Str tmp2 = Strnew(); ! if (current_ftp->data == NULL) ! return FTPDIRtmp; ! sv_type = ftp_system(current_ftp); if (pu->file == NULL || *pu->file == '\0') { ! if (sv_type == UNIXLIKE_SERVER) { ! s = FtpDataBody(current_ftp, "LIST", NULL, "r"); ! } ! else { ! s = FtpDataBody(current_ftp, "NLST", NULL, "r"); ! } ! curdir = Strnew_charp("/"); } else { realpathname = file_unquote(pu->file); if (sv_type == UNIXLIKE_SERVER) { ! s = FtpCwd(current_ftp, realpathname); ! if (!FtpError(s)) { ! s = FtpDataBody(current_ftp, "LIST", NULL, "r"); ! } } - else { - s = FtpDataBody(current_ftp, "NLST %s", realpathname, "r"); - } - if (realpathname[0] == '/') - curdir = Strnew_charp(realpathname); else ! curdir = Sprintf("/%s", realpathname); ! if (Strlastchar(curdir) != '/') ! Strcat_char(curdir, '/'); } ! if (FtpError(s)) { ! FtpBye(current_ftp); return NULL; } ! host = Strnew_charp("ftp://"); ! if (pu->user) { ! Strcat_m_charp(host, pu->user, "@", NULL); ! } ! Strcat_charp(host, pu->host); ! if (Strlastchar(host) == '/') ! Strshrink(host, 1); ! qdir = html_quote(curdir->ptr); ! FTPDIRtmp = ! Sprintf ! ("%s%s

Index of %s%s

\n", ! host->ptr, qdir, host->ptr, qdir); ! curdir = Strnew_charp(file_quote(curdir->ptr)); ! qdir = curdir->ptr; ! tmp2 = Strdup(curdir); ! if (Strcmp_charp(curdir, "/") != 0) { ! Strshrink(tmp2, 1); ! while (Strlastchar(tmp2) != '/' && tmp2->length > 0) ! Strshrink(tmp2, 1); ! } ! if (sv_type == UNIXLIKE_SERVER) { ! Strcat_charp(FTPDIRtmp, "
  • ptr, ! html_quote(tmp2->ptr), "\">[Upper Directory]\n", NULL); flist = New_N(char *, nfile_max); nfile = 0; --- 371,474 ---- pass = ftppasswd; else { struct passwd *mypw = getpwuid(getuid()); ! tmp = Strnew_charp(mypw ? mypw->pw_name : "anonymous"); ! Strcat_char(tmp, '@'); ! pass = tmp->ptr; ! } ! ! if (!current_ftp.host) { ! current_ftp.host = allocStr(pu->host, -1); ! current_ftp.port = pu->port; ! current_ftp.user = allocStr(user, -1); ! current_ftp.pass = allocStr(pass, -1); ! if (!ftp_login(¤t_ftp)) ! return NULL; } if (add_auth_cookie_flag) add_auth_cookie(pu->host, pu->port, pu->file, pu->user, pwd); + + ftp_read: + ftp_command(¤t_ftp, "TYPE", "I", &status); + if (ftp_pasv(¤t_ftp) < 0) { + ftp_quit(¤t_ftp); + return NULL; + } if (pu->file == NULL || *pu->file == '\0') goto ftp_dir; else realpathname = file_unquote(pu->file); if (pu->file[strlen(pu->file) - 1] == '/') goto ftp_dir; /* Get file */ ! uf->modtime = ftp_modtime(¤t_ftp, realpathname); ! ftp_command(¤t_ftp, "RETR", realpathname, &status); ! if (status == 125 || status == 150) ! return newFileStream(current_ftp.data, (void (*)())closeFTPdata); ftp_dir: pu->scheme = SCM_FTPDIR; return NULL; } Str ! loadFTPDir(ParsedURL *pu, char *code) { ! Str FTPDIRtmp; ! Str tmp; ! int status, sv_type; ! char *realpathname, *fn, *q; char **flist; int i, nfile, nfile_max = 100; ! #ifdef JP_CHARSET ! *code = DocumentCode; ! #endif ! if (current_ftp.data == NULL) ! return NULL; ! tmp = ftp_command(¤t_ftp, "SYST", NULL, &status); ! if (strstr(tmp->ptr, "UNIX") != NULL || !strncmp(tmp->ptr + 4, "Windows_NT", 10)) /* :-) */ ! sv_type = UNIXLIKE_SERVER; ! else ! sv_type = SERVER_NONE; if (pu->file == NULL || *pu->file == '\0') { ! if (sv_type == UNIXLIKE_SERVER) ! ftp_command(¤t_ftp, "LIST", NULL, &status); ! else ! ftp_command(¤t_ftp, "NLST", NULL, &status); ! pu->file = "/"; } else { realpathname = file_unquote(pu->file); if (sv_type == UNIXLIKE_SERVER) { ! ftp_command(¤t_ftp, "CWD", realpathname, &status); ! if (status == 250) ! ftp_command(¤t_ftp, "LIST", NULL, &status); } else ! ftp_command(¤t_ftp, "NLST", realpathname, &status); } ! if (status != 125 && status != 150) { ! fclose(current_ftp.data); ! current_ftp.data = NULL; return NULL; } ! tmp = parsedURL2Str(pu); ! if (Strlastchar(tmp) != '/') ! Strcat_char(tmp, '/'); ! fn = html_quote(tmp->ptr); ! tmp = ! convertLine(NULL, Strnew_charp(file_unquote(tmp->ptr)), code, ! RAW_MODE); ! q = html_quote(tmp->ptr); ! FTPDIRtmp = Strnew_m_charp("\n\n\n", q, ! "\n\n\n

    Index of ", q, ! "

    \n", NULL); ! if (sv_type == UNIXLIKE_SERVER) ! Strcat_charp(FTPDIRtmp, "
    \n");
    !     else
    ! 	Strcat_charp(FTPDIRtmp, "
    \n"); } else { ! while (tmp2 = Strfgets(FTPDATA(current_ftp)), tmp2->length > 0) { ! Strchop(tmp2); ! flist[nfile++] = mybasename(tmp2->ptr); if (nfile == nfile_max) { nfile_max *= 2; flist = New_Reuse(char *, flist, nfile_max); --- 545,556 ---- } Strcat_m_charp(FTPDIRtmp, date, "\n", NULL); } ! Strcat_charp(FTPDIRtmp, "
  • \n"); } else { ! while (tmp = Strfgets(current_ftp.data), tmp->length > 0) { ! Strchop(tmp); ! flist[nfile++] = mybasename(tmp->ptr); if (nfile == nfile_max) { nfile_max *= 2; flist = New_Reuse(char *, flist, nfile_max); *************** *** 670,702 **** qsort(flist, nfile, sizeof(char *), strCmp); for (i = 0; i < nfile; i++) { fn = flist[i]; Strcat_m_charp(FTPDIRtmp, "
  • ptr, qdir, ! html_quote(file_quote(fn)), ! "\">", html_quote(fn), "\n", NULL); } ! Strcat_charp(FTPDIRtmp, "\n"); } ! FtpClose(current_ftp); ! FtpBye(current_ftp); return FTPDIRtmp; } ! static int ! ftp_system(FTP ftp) { ! int sv_type = SERVER_NONE; ! Str tmp; ! ! fwrite("SYST\r\n", 6, sizeof(char), ftp->wcontrol); ! fflush(ftp->wcontrol); ! tmp = read_response(ftp); ! if (strstr(tmp->ptr, "UNIX") != NULL || !strncmp(tmp->ptr + 4, "Windows_NT", 10)) { /* :-) */ ! sv_type = UNIXLIKE_SERVER; ! } ! ! return (sv_type); } #define XD_CTOD(c) {\ --- 559,581 ---- qsort(flist, nfile, sizeof(char *), strCmp); for (i = 0; i < nfile; i++) { fn = flist[i]; + tmp = convertLine(NULL, Strnew_charp(fn), code, RAW_MODE); Strcat_m_charp(FTPDIRtmp, "
  • ", ! html_quote(tmp->ptr), "\n", NULL); } ! Strcat_charp(FTPDIRtmp, "\n"); } + Strcat_charp(FTPDIRtmp, "\n\n"); ! closeFTPdata(current_ftp.data); return FTPDIRtmp; } ! void ! disconnectFTP(void) { ! ftp_quit(¤t_ftp); } #define XD_CTOD(c) {\ *************** *** 859,872 **** return (size_str); } - - void - closeFTP(FILE * f) - { - if (f) { - fclose(f); - if (f == current_ftp->data) - current_ftp->data = NULL; - } - FtpBye(current_ftp); - } --- 738,740 ---- diff -crN -x CVS w3m-0.3.2.2/func.c w3m-js-1.743/func.c *** w3m-0.3.2.2/func.c 2002-06-02 01:50:16.000000000 +0900 --- w3m-js-1.743/func.c 2002-12-05 22:13:11.000000000 +0900 *************** *** 1,4 **** ! /* $Id: func.c,v 1.10 2002/06/01 16:50:16 ukai Exp $ */ /* * w3m func.c */ --- 1,4 ---- ! /* $Id: func.c,v 1.22 2002/12/04 17:15:35 ukai Exp $ */ /* * w3m func.c */ *************** *** 14,25 **** #define KEYDATA_HASH_SIZE 16 static Hash_iv *keyData = NULL; ! static char keymap_initialized; static struct stat current_keymap_file; void setKeymap(char *p, int lineno, int verbose) { char *s, *emsg; int c, f; --- 14,26 ---- #define KEYDATA_HASH_SIZE 16 static Hash_iv *keyData = NULL; ! static char keymap_initialized = FALSE; static struct stat current_keymap_file; void setKeymap(char *p, int lineno, int verbose) { + unsigned char *map = NULL; char *s, *emsg; int c, f; *************** *** 47,66 **** disp_message_nsec(emsg, FALSE, 1, TRUE, FALSE); return; } ! if (c & K_ESCD) ! EscDKeymap[c ^ K_ESCD] = f; ! else if (c & K_ESCB) ! EscBKeymap[c ^ K_ESCB] = f; ! else if (c & K_ESC) ! EscKeymap[c ^ K_ESC] = f; ! else ! GlobalKeymap[c] = f; s = getQWord(&p); if (*s) { if (keyData == NULL) keyData = newHash_iv(KEYDATA_HASH_SIZE); putHash_iv(keyData, c, (void *)s); } } void --- 48,111 ---- disp_message_nsec(emsg, FALSE, 1, TRUE, FALSE); return; } ! if (c & K_MULTI) { ! unsigned char **mmap = NULL; ! int i, j, m = MULTI_KEY(c); ! ! if (m & K_ESCD) ! map = EscDKeymap; ! else if (m & K_ESCB) ! map = EscBKeymap; ! else if (m & K_ESC) ! map = EscKeymap; ! else ! map = GlobalKeymap; ! if (map[m & 0x7F] == FUNCNAME_multimap) ! mmap = (unsigned char **)getKeyData(m); ! else ! map[m & 0x7F] = FUNCNAME_multimap; ! if (!mmap) { ! mmap = New_N(unsigned char *, 4); ! for (i = 0; i < 4; i++) { ! mmap[i] = New_N(unsigned char, 128); ! for (j = 0; j < 128; j++) ! mmap[i][j] = FUNCNAME_nulcmd; ! } ! mmap[0][ESC_CODE] = FUNCNAME_escmap; ! mmap[1]['['] = FUNCNAME_escbmap; ! mmap[1]['O'] = FUNCNAME_escbmap; ! } ! if (keyData == NULL) ! keyData = newHash_iv(KEYDATA_HASH_SIZE); ! putHash_iv(keyData, m, (void *)mmap); ! if (c & K_ESCD) ! map = mmap[3]; ! else if (c & K_ESCB) ! map = mmap[2]; ! else if (c & K_ESC) ! map = mmap[1]; ! else ! map = mmap[0]; ! } ! else { ! if (c & K_ESCD) ! map = EscDKeymap; ! else if (c & K_ESCB) ! map = EscBKeymap; ! else if (c & K_ESC) ! map = EscKeymap; ! else ! map = GlobalKeymap; ! } ! map[c & 0x7F] = f; s = getQWord(&p); if (*s) { if (keyData == NULL) keyData = newHash_iv(KEYDATA_HASH_SIZE); putHash_iv(keyData, c, (void *)s); } + else if (getKeyData(c)) + putHash_iv(keyData, c, NULL); } void *************** *** 75,83 **** struct stat kstat; extern int str_to_bool(char *value, int old); - if (!force && !keymap_initialized) - return; - if ((kf = fopen(rcFile(keymap_file), "rt")) == NULL || ((fd = fileno(kf)) < 0 || fstat(fd, &kstat) || (!force && keymap_initialized && --- 120,125 ---- *************** *** 134,155 **** return (char *)getHash_iv(keyData, key, NULL); } ! int ! getKey(char *s) { int c, esc = 0, ctrl = 0; if (s == NULL || *s == '\0') return -1; ! if (strcasecmp(s, "UP") == 0) /* ^[[A */ return K_ESCB | 'A'; ! else if (strcasecmp(s, "DOWN") == 0) /* ^[[B */ return K_ESCB | 'B'; ! else if (strcasecmp(s, "RIGHT") == 0) /* ^[[C */ return K_ESCB | 'C'; ! else if (strcasecmp(s, "LEFT") == 0) /* ^[[D */ return K_ESCB | 'D'; if (strncasecmp(s, "ESC-", 4) == 0 || strncasecmp(s, "ESC ", 4) == 0) { /* ^[ */ s += 4; --- 176,206 ---- return (char *)getHash_iv(keyData, key, NULL); } ! static int ! getKey2(char **str) { + char *s = *str; int c, esc = 0, ctrl = 0; if (s == NULL || *s == '\0') return -1; ! if (strcasecmp(s, "UP") == 0) { /* ^[[A */ ! *str = s + 2; return K_ESCB | 'A'; ! } ! else if (strcasecmp(s, "DOWN") == 0) { /* ^[[B */ ! *str = s + 4; return K_ESCB | 'B'; ! } ! else if (strcasecmp(s, "RIGHT") == 0) { /* ^[[C */ ! *str = s + 5; return K_ESCB | 'C'; ! } ! else if (strcasecmp(s, "LEFT") == 0) { /* ^[[D */ ! *str = s + 4; return K_ESCB | 'D'; + } if (strncasecmp(s, "ESC-", 4) == 0 || strncasecmp(s, "ESC ", 4) == 0) { /* ^[ */ s += 4; *************** *** 192,197 **** --- 243,249 ---- } if (ctrl) { + *str = s + 1; if (*s >= '@' && *s <= '_') /* ^@ .. ^_ */ return esc | (*s - '@'); else if (*s >= 'a' && *s <= 'z') /* ^a .. ^z */ *************** *** 209,229 **** c = c * 10 + (int)(*s - '0'); s++; } if (*s == '~') return K_ESCD | c; else return -1; } ! if (strncasecmp(s, "SPC", 3) == 0) /* ' ' */ return esc | ' '; ! else if (strncasecmp(s, "TAB", 3) == 0) /* ^i */ return esc | '\t'; ! else if (strncasecmp(s, "DEL", 3) == 0) /* ^? */ return esc | DEL_CODE; if (*s == '\\' && *(s + 1) != '\0') { ! switch (*(s + 1)) { case 'a': /* ^g */ return esc | CTRL_G; case 'b': /* ^h */ --- 261,290 ---- c = c * 10 + (int)(*s - '0'); s++; } + *str = s + 1; if (*s == '~') return K_ESCD | c; else return -1; } ! if (strncasecmp(s, "SPC", 3) == 0) { /* ' ' */ ! *str = s + 3; return esc | ' '; ! } ! else if (strncasecmp(s, "TAB", 3) == 0) { /* ^i */ ! *str = s + 3; return esc | '\t'; ! } ! else if (strncasecmp(s, "DEL", 3) == 0) { /* ^? */ ! *str = s + 3; return esc | DEL_CODE; + } if (*s == '\\' && *(s + 1) != '\0') { ! s++; ! *str = s + 1; ! switch (*s) { case 'a': /* ^g */ return esc | CTRL_G; case 'b': /* ^h */ *************** *** 244,255 **** --- 305,336 ---- return -1; } } + *str = s + 1; if (IS_ASCII(*s)) /* Ascii */ return esc | *s; else return -1; } + int + getKey(char *s) + { + int c, c2; + + c = getKey2(&s); + if (c < 0) + return -1; + if (*s == ' ' || *s == '-') + s++; + if (*s) { + c2 = getKey2(&s); + if (c2 < 0) + return -1; + c = K_MULTI | (c << 16) | c2; + } + return c; + } + char * getWord(char **str) { *************** *** 320,322 **** --- 401,582 ---- *str = p; return tmp->ptr; } + + #ifdef USE_MOUSE + static MouseAction default_mouse_action = { + NULL, + #if LANG == JA + "「罎ャ「ュ", + #else + "<=UpDn", + #endif + 0, 6, FALSE, 0, 0, + {{movMs, NULL}, {backBf, NULL}, {menuMs, NULL}}, /* default */ + {{NULL, NULL}, {NULL, NULL}, {NULL, NULL}}, /* anchor */ + {{followA, NULL}, {NULL, NULL}, {NULL, NULL}}, /* active */ + {{tabMs, NULL}, {closeTMs, NULL}, {NULL, NULL}}, /* tab */ + {NULL, NULL, NULL}, /* menu */ + {NULL, NULL, NULL} /* lastline */ + }; + static MouseActionMap default_lastline_action[6] = { + {backBf, NULL}, + {backBf, NULL}, + {pgBack, NULL}, + {pgBack, NULL}, + {pgFore, NULL}, + {pgFore, NULL} + }; + + static void + setMouseAction0(char **str, int *width, MouseActionMap ** map, char *p) + { + char *s; + int b, w, x; + + s = getQWord(&p); + if (!*s) { + *str = NULL; + width = 0; + for (b = 0; b < 3; b++) + map[b] = NULL; + return; + } + w = *width; + *str = s; + *width = strlen(s); + if (*width >= LIMIT_MOUSE_MENU) + *width = LIMIT_MOUSE_MENU; + if (*width <= w) + return; + for (b = 0; b < 3; b++) { + if (!map[b]) + continue; + map[b] = New_Reuse(MouseActionMap, map[b], *width); + for (x = w + 1; x < *width; x++) { + map[b][x].func = NULL; + map[b][x].data = NULL; + } + } + } + + static void + setMouseAction1(MouseActionMap ** map, int width, char *p) + { + char *s; + int x, x2, f; + + if (!*map) { + *map = New_N(MouseActionMap, width); + for (x = 0; x < width; x++) { + (*map)[x].func = NULL; + (*map)[x].data = NULL; + } + } + s = getWord(&p); + x = atoi(s); + if (!(IS_DIGIT(*s) && x >= 0 && x < width)) + return; /* error */ + s = getWord(&p); + x2 = atoi(s); + if (!(IS_DIGIT(*s) && x2 >= 0 && x2 < width)) + return; /* error */ + s = getWord(&p); + f = getFuncList(s); + s = getQWord(&p); + if (!*s) + s = NULL; + for (; x <= x2; x++) { + (*map)[x].func = (f >= 0) ? w3mFuncList[f].func : NULL; + (*map)[x].data = s; + } + } + + static void + setMouseAction2(MouseActionMap * map, char *p) + { + char *s; + int f; + + s = getWord(&p); + f = getFuncList(s); + s = getQWord(&p); + if (!*s) + s = NULL; + map->func = (f >= 0) ? w3mFuncList[f].func : NULL; + map->data = s; + } + + void + initMouseAction(void) + { + FILE *mf; + Str line; + char *p, *s; + int b; + + bcopy((void *)&default_mouse_action, (void *)&mouse_action, + sizeof(default_mouse_action)); + mouse_action.lastline_map[0] = New_N(MouseActionMap, 6); + bcopy((void *)&default_lastline_action, + (void *)mouse_action.lastline_map[0], + sizeof(default_lastline_action)); + + if ((mf = fopen(rcFile(MOUSE_FILE), "rt")) == NULL) + return; + + while (!feof(mf)) { + line = Strfgets(mf); + Strchop(line); + Strremovefirstspaces(line); + if (line->length == 0) + continue; + p = conv_from_system(line->ptr); + s = getWord(&p); + if (*s == '#') /* comment */ + continue; + if (!strcmp(s, "menu")) { + setMouseAction0(&mouse_action.menu_str, &mouse_action.menu_width, + mouse_action.menu_map, p); + continue; + } + else if (!strcmp(s, "lastline")) { + setMouseAction0(&mouse_action.lastline_str, + &mouse_action.lastline_width, + mouse_action.lastline_map, p); + continue; + } + if (strcmp(s, "button")) + continue; /* error */ + s = getWord(&p); + b = atoi(s) - 1; + if (!(b >= 0 && b <= 2)) + continue; /* error */ + SKIP_BLANKS(p); + if (IS_DIGIT(*p)) + s = "menu"; + else + s = getWord(&p); + if (!strcasecmp(s, "menu")) { + if (!mouse_action.menu_str) + continue; + setMouseAction1(&mouse_action.menu_map[b], mouse_action.menu_width, + p); + } + else if (!strcasecmp(s, "lastline")) { + if (!mouse_action.lastline_str) + continue; + setMouseAction1(&mouse_action.lastline_map[b], + mouse_action.lastline_width, p); + } + else if (!strcasecmp(s, "default")) + setMouseAction2(&mouse_action.default_map[b], p); + else if (!strcasecmp(s, "anchor")) + setMouseAction2(&mouse_action.anchor_map[b], p); + else if (!strcasecmp(s, "active")) + setMouseAction2(&mouse_action.active_map[b], p); + else if (!strcasecmp(s, "tab")) + setMouseAction2(&mouse_action.tab_map[b], p); + } + fclose(mf); + } + #endif diff -crN -x CVS w3m-0.3.2.2/func.h w3m-js-1.743/func.h *** w3m-0.3.2.2/func.h 2001-12-11 02:02:44.000000000 +0900 --- w3m-js-1.743/func.h 2002-12-04 00:58:16.000000000 +0900 *************** *** 1,4 **** ! /* $Id: func.h,v 1.3 2001/12/10 17:02:44 ukai Exp $ */ /* * w3m func.h */ --- 1,4 ---- ! /* $Id: func.h,v 1.4 2002/12/03 16:01:33 ukai Exp $ */ /* * w3m func.h */ *************** *** 14,19 **** --- 14,21 ---- #define K_ESC 0x100 #define K_ESCB 0x200 #define K_ESCD 0x400 + #define K_MULTI 0x10000000 + #define MULTI_KEY(c) (((c) >> 16) & 0x77F) typedef struct _FuncList { char *id; diff -crN -x CVS w3m-0.3.2.2/funcname.tab w3m-js-1.743/funcname.tab *** w3m-0.3.2.2/funcname.tab 2002-09-06 00:43:21.000000000 +0900 --- w3m-js-1.743/funcname.tab 2003-01-24 21:58:54.000000000 +0900 *************** *** 1,8 **** ! # $Id: funcname.tab,v 1.11 2002/09/05 15:43:21 ukai Exp $ # macro name function name #---------------------------- @@@ nulcmd ABORT quitfm ADD_BOOKMARK adBmark ALARM setAlarm BACK backBf --- 1,9 ---- ! # $Id: funcname.tab,v 1.20 2003/01/23 18:37:21 ukai Exp $ # macro name function name #---------------------------- @@@ nulcmd ABORT quitfm + ACCESSKEY accessKey ADD_BOOKMARK adBmark ALARM setAlarm BACK backBf *************** *** 10,15 **** --- 11,18 ---- BOOKMARK ldBmark CENTER_H ctrCsrH CENTER_V ctrCsrV + CLOSE_TAB closeT + CLOSE_TAB_MOUSE closeTMs COMMAND execCmd COOKIE cooLst DEFINE_KEY defKey *************** *** 19,24 **** --- 22,28 ---- DISPLAY_IMAGE dispI DOWN ldown1 DOWNLOAD svSrc + DOWNLOAD_LIST ldDL EDIT editBf EDIT_SCREEN editScr END goLineL *************** *** 45,50 **** --- 49,57 ---- LINE_INFO curlno LINK_BEGIN topA LINK_END lastA + LINK_MENU linkMn + LIST linkLst + LIST_MENU listMn LOAD ldfile MAIN_MENU mainMn MARK _mark *************** *** 52,68 **** --- 59,81 ---- MARK_URL chkURL MARK_WORD chkWORD MENU mainMn + MENU_MOUSE menuMs MOUSE mouse MOUSE_TOGGLE msToggle MOVE_DOWN movD MOVE_DOWN1 movD1 MOVE_LEFT movL MOVE_LEFT1 movL1 + MOVE_LIST_MENU movlistMn + MOVE_MOUSE movMs MOVE_RIGHT movR MOVE_RIGHT1 movR1 MOVE_UP movU MOVE_UP1 movU1 MSGS msgs + MULTIMAP multimap + NEW_TAB newT + NEXT nextBf NEXT_DOWN nextD NEXT_LEFT nextL NEXT_LEFT_UP nextLU *************** *** 71,76 **** --- 84,90 ---- NEXT_PAGE pgFore NEXT_RIGHT nextR NEXT_RIGHT_DOWN nextRD + NEXT_TAB nextT NEXT_UP nextU NEXT_WORD movRW NOTHING nulcmd *************** *** 82,98 **** --- 96,116 ---- PEEK_LINK peekURL PIPE_BUF pipeBuf PIPE_SHELL pipesh + PREV prevBf PREV_LINK prevA PREV_MARK prevMk PREV_PAGE pgBack + PREV_TAB prevT PREV_WORD movLW PRINT svBuf QUIT qquitfm READ_SHELL readsh + REDO redoPos REDRAW rdrwSc REG_MARK reMark REINIT reinit RELOAD reload + RESHAPE reshape RIGHT col1R SAVE svSrc SAVE_IMAGE svI *************** *** 114,119 **** --- 132,145 ---- STOP_IMAGE stopI SUBMIT submitForm SUSPEND susp + TAB_GOTO tabURL + TAB_GOTO_RELATIVE tabrURL + TAB_LEFT tabL + TAB_LINK tabA + TAB_MENU tabMn + TAB_MOUSE tabMs + TAB_RIGHT tabR + UNDO undoPos UP lup1 VERSION dispVer VIEW vwSrc diff -crN -x CVS w3m-0.3.2.2/gc/.cvsignore w3m-js-1.743/gc/.cvsignore *** w3m-0.3.2.2/gc/.cvsignore 2001-11-19 16:53:56.000000000 +0900 --- w3m-js-1.743/gc/.cvsignore 2002-11-19 21:02:14.000000000 +0900 *************** *** 1,3 **** --- 1,4 ---- + base_lib gctest if_mach if_not_there diff -crN -x CVS w3m-0.3.2.2/gcmain.c w3m-js-1.743/gcmain.c *** w3m-0.3.2.2/gcmain.c 2001-11-21 02:49:23.000000000 +0900 --- w3m-js-1.743/gcmain.c 1970-01-01 09:00:00.000000000 +0900 *************** *** 1,28 **** - /* $Id: gcmain.c,v 1.2 2001/11/20 17:49:23 ukai Exp $ */ - #ifndef GC_MAIN - #define GC_MAIN - - #if defined(AIX) || defined(linux) - /* to cope with Boehm GC... */ - - #define MAIN real_main - - #if defined(DEBIAN) - #include "gc/private/gc_priv.h" - #else - #include "private/gc_priv.h" - #endif - int real_main(int, char **, char **); - - int - main(int argc, char **argv, char **envp) - { - int dummy; - GC_stackbottom = (ptr_t) (&dummy); - return (real_main(argc, argv, envp)); - } - #else - #define MAIN main - #endif - - #endif --- 0 ---- diff -crN -x CVS w3m-0.3.2.2/history.c w3m-js-1.743/history.c *** w3m-0.3.2.2/history.c 2002-01-27 02:24:01.000000000 +0900 --- w3m-js-1.743/history.c 2003-02-06 02:23:10.000000000 +0900 *************** *** 1,4 **** ! /* $Id: history.c,v 1.7 2002/01/26 17:24:01 ukai Exp $ */ #include "fm.h" #ifdef USE_HISTORY --- 1,4 ---- ! /* $Id: history.c,v 1.9 2003/02/05 16:43:57 ukai Exp $ */ #include "fm.h" #ifdef USE_HISTORY *************** *** 7,13 **** { Str src = Strnew(); HistItem *item; ! char *q; Strcat_charp(src, "\nHistory Page\n"); Strcat_charp(src, "\n

    History Page

    \n
    \n"); --- 7,13 ---- { Str src = Strnew(); HistItem *item; ! char *p, *q; Strcat_charp(src, "\nHistory Page\n"); Strcat_charp(src, "\n

    History Page

    \n
    \n"); *************** *** 15,24 **** if (hist && hist->list) { for (item = hist->list->last; item; item = item->prev) { q = html_quote((char *)item->ptr); Strcat_charp(src, "
  • "); ! Strcat_charp(src, q); Strcat_charp(src, "\n"); } } --- 15,28 ---- if (hist && hist->list) { for (item = hist->list->last; item; item = item->prev) { q = html_quote((char *)item->ptr); + if (DecodeURL) + p = html_quote(url_unquote_conv((char *)item->ptr, 0)); + else + p = q; Strcat_charp(src, "
  • "); ! Strcat_charp(src, p); Strcat_charp(src, "\n"); } } *************** *** 54,63 **** { FILE *f; HistItem *item; if (hist == NULL || hist->list == NULL) return; ! if ((f = fopen(rcFile(HISTORY_FILE), "w")) == NULL) { disp_err_message("Can't open history", FALSE); return; } --- 58,69 ---- { FILE *f; HistItem *item; + char *tmpf; if (hist == NULL || hist->list == NULL) return; ! tmpf = tmpfname(TMPF_DFL, NULL)->ptr; ! if ((f = fopen(tmpf, "w")) == NULL) { disp_err_message("Can't open history", FALSE); return; } *************** *** 67,72 **** --- 73,79 ---- for (; item; item = item->next) fprintf(f, "%s\n", (char *)item->ptr); fclose(f); + rename(tmpf, rcFile(HISTORY_FILE)); } #endif /* USE_HISTORY */ diff -crN -x CVS w3m-0.3.2.2/html.c w3m-js-1.743/html.c *** w3m-0.3.2.2/html.c 2002-10-17 03:11:15.000000000 +0900 --- w3m-js-1.743/html.c 2003-02-08 02:38:49.000000000 +0900 *************** *** 1,4 **** ! /* $Id: html.c,v 1.14 2002/10/16 18:11:15 ukai Exp $ */ #include "html.h" /* Define HTML Tag Infomation Table */ --- 1,4 ---- ! /* $Id: html.c,v 1.22 2002/12/09 15:40:36 ukai Exp $ */ #include "html.h" /* Define HTML Tag Infomation Table */ *************** *** 7,15 **** #define MAXA_CORE 1 unsigned char ALST_A[] = { ATTR_NAME, ATTR_HREF, ATTR_TARGET, ATTR_HSEQ, ATTR_REFERER, ! ATTR_FRAMENAME, ATTR_CORE }; ! #define MAXA_A MAXA_CORE + 6 unsigned char ALST_P[] = { ATTR_ALIGN, ATTR_CORE }; #define MAXA_P MAXA_CORE + 1 unsigned char ALST_UL[] = { ATTR_START, ATTR_TYPE, ATTR_CORE }; --- 7,15 ---- #define MAXA_CORE 1 unsigned char ALST_A[] = { ATTR_NAME, ATTR_HREF, ATTR_TARGET, ATTR_HSEQ, ATTR_REFERER, ! ATTR_FRAMENAME, ATTR_TITLE, ATTR_ACCESSKEY, ATTR_CORE }; ! #define MAXA_A MAXA_CORE + 8 unsigned char ALST_P[] = { ATTR_ALIGN, ATTR_CORE }; #define MAXA_P MAXA_CORE + 1 unsigned char ALST_UL[] = { ATTR_START, ATTR_TYPE, ATTR_CORE }; *************** *** 18,32 **** #define MAXA_LI MAXA_CORE + 2 unsigned char ALST_HR[] = { ATTR_WIDTH, ATTR_ALIGN, ATTR_CORE }; #define MAXA_HR MAXA_CORE + 2 unsigned char ALST_DL[] = { ATTR_COMPACT, ATTR_CORE }; #define MAXA_DL MAXA_CORE + 1 unsigned char ALST_PRE[] = { ATTR_FOR_TABLE, ATTR_CORE }; #define MAXA_PRE MAXA_CORE + 1 unsigned char ALST_IMG[] = { ATTR_SRC, ATTR_ALT, ATTR_WIDTH, ATTR_HEIGHT, ATTR_ALIGN, ATTR_USEMAP, ! ATTR_ISMAP, ATTR_CORE }; ! #define MAXA_IMG MAXA_CORE + 7 unsigned char ALST_TABLE[] = { ATTR_BORDER, ATTR_WIDTH, ATTR_HBORDER, ATTR_CELLSPACING, ATTR_CELLPADDING, ATTR_VSPACE, ATTR_CORE --- 18,36 ---- #define MAXA_LI MAXA_CORE + 2 unsigned char ALST_HR[] = { ATTR_WIDTH, ATTR_ALIGN, ATTR_CORE }; #define MAXA_HR MAXA_CORE + 2 + unsigned char ALST_LINK[] = { ATTR_HREF, ATTR_HSEQ, ATTR_REL, ATTR_REV, + ATTR_TITLE, ATTR_TYPE, ATTR_CORE + }; + #define MAXA_LINK MAXA_CORE + sizeof ALST_LINK/sizeof ALST_LINK[0] - 1 unsigned char ALST_DL[] = { ATTR_COMPACT, ATTR_CORE }; #define MAXA_DL MAXA_CORE + 1 unsigned char ALST_PRE[] = { ATTR_FOR_TABLE, ATTR_CORE }; #define MAXA_PRE MAXA_CORE + 1 unsigned char ALST_IMG[] = { ATTR_SRC, ATTR_ALT, ATTR_WIDTH, ATTR_HEIGHT, ATTR_ALIGN, ATTR_USEMAP, ! ATTR_ISMAP, ATTR_TITLE, ATTR_NAME, ATTR_CORE }; ! #define MAXA_IMG MAXA_CORE + 9 unsigned char ALST_TABLE[] = { ATTR_BORDER, ATTR_WIDTH, ATTR_HBORDER, ATTR_CELLSPACING, ATTR_CELLPADDING, ATTR_VSPACE, ATTR_CORE *************** *** 64,71 **** unsigned char ALST_MAP[] = { ATTR_NAME, ATTR_CORE }; #define MAXA_MAP MAXA_CORE + 1 unsigned char ALST_AREA[] = ! { ATTR_HREF, ATTR_ALT, ATTR_SHAPE, ATTR_COORDS, ATTR_CORE }; ! #define MAXA_AREA MAXA_CORE + 4 unsigned char ALST_BASE[] = { ATTR_HREF, ATTR_TARGET, ATTR_CORE }; #define MAXA_BASE MAXA_CORE + 2 unsigned char ALST_BODY[] = { ATTR_BACKGROUND, ATTR_CORE }; --- 68,78 ---- unsigned char ALST_MAP[] = { ATTR_NAME, ATTR_CORE }; #define MAXA_MAP MAXA_CORE + 1 unsigned char ALST_AREA[] = ! { ATTR_HREF, ATTR_TARGET, ATTR_ALT, ATTR_SHAPE, ATTR_COORDS, ATTR_CORE }; ! #define MAXA_AREA MAXA_CORE + 5 ! unsigned char ALST_SCRIPT[] = ! { ATTR_LANGUAGE, ATTR_SRC, ATTR_FRAMENAME, ATTR_CORE }; ! #define MAXA_SCRIPT MAXA_CORE + 3 unsigned char ALST_BASE[] = { ATTR_HREF, ATTR_TARGET, ATTR_CORE }; #define MAXA_BASE MAXA_CORE + 2 unsigned char ALST_BODY[] = { ATTR_BACKGROUND, ATTR_CORE }; *************** *** 108,116 **** #define MAXA_INPUT_ALT 16 unsigned char ALST_IMG_ALT[] = { ATTR_SRC, ATTR_WIDTH, ATTR_HEIGHT, ATTR_USEMAP, ATTR_ISMAP, ATTR_HSEQ, ! ATTR_XOFFSET, ATTR_YOFFSET, ATTR_TOP_MARGIN, ATTR_BOTTOM_MARGIN }; ! #define MAXA_IMG_ALT 10 unsigned char ALST_NOP[] = { ATTR_CORE }; #define MAXA_NOP MAXA_CORE --- 115,124 ---- #define MAXA_INPUT_ALT 16 unsigned char ALST_IMG_ALT[] = { ATTR_SRC, ATTR_WIDTH, ATTR_HEIGHT, ATTR_USEMAP, ATTR_ISMAP, ATTR_HSEQ, ! ATTR_XOFFSET, ATTR_YOFFSET, ATTR_TOP_MARGIN, ATTR_BOTTOM_MARGIN, ! ATTR_TITLE, ATTR_NAME }; ! #define MAXA_IMG_ALT 12 unsigned char ALST_NOP[] = { ATTR_CORE }; #define MAXA_NOP MAXA_CORE *************** *** 173,179 **** {"map", ALST_MAP, MAXA_MAP, 0}, /* 55 HTML_MAP */ {"/map", NULL, 0, TFLG_END}, /* 56 HTML_N_MAP */ {"area", ALST_AREA, MAXA_AREA, 0}, /* 57 HTML_AREA */ ! {"script", NULL, 0, 0}, /* 58 HTML_SCRIPT */ {"/script", NULL, 0, TFLG_END}, /* 59 HTML_N_SCRIPT */ {"base", ALST_BASE, MAXA_BASE, 0}, /* 60 HTML_BASE */ {"del", NULL, 0, 0}, /* 61 HTML_DEL */ --- 181,187 ---- {"map", ALST_MAP, MAXA_MAP, 0}, /* 55 HTML_MAP */ {"/map", NULL, 0, TFLG_END}, /* 56 HTML_N_MAP */ {"area", ALST_AREA, MAXA_AREA, 0}, /* 57 HTML_AREA */ ! {"script", ALST_SCRIPT, MAXA_SCRIPT, 0}, /* 58 HTML_SCRIPT */ {"/script", NULL, 0, TFLG_END}, /* 59 HTML_N_SCRIPT */ {"base", ALST_BASE, MAXA_BASE, 0}, /* 60 HTML_BASE */ {"del", NULL, 0, 0}, /* 61 HTML_DEL */ *************** *** 220,251 **** {"/sup", NULL, 0, 0}, /* 101 HTML_N_SUP */ {"sub", NULL, 0, 0}, /* 102 HTML_SUB */ {"/sub", NULL, 0, 0}, /* 103 HTML_N_SUB */ ! {NULL, NULL, 0, 0}, /* 104 Undefined */ ! {NULL, NULL, 0, 0}, /* 105 Undefined */ /* pseudo tag */ ! {"internal", NULL, 0, TFLG_INT}, /* 106 HTML_INTERNAL */ ! {"/internal", NULL, 0, TFLG_INT | TFLG_END}, /* 107 HTML_N_INTERNAL */ ! {"select_int", ALST_SELECT_INT, MAXA_SELECT_INT, TFLG_INT}, /* 108 HTML_SELECT_INT */ ! {"/select_int", NULL, 0, TFLG_INT | TFLG_END}, /* 109 HTML_N_SELECT_INT */ ! {"option_int", ALST_OPTION, MAXA_OPTION, TFLG_INT}, /* 110 HTML_OPTION_INT */ ! {"textarea_int", ALST_TEXTAREA_INT, MAXA_TEXTAREA_INT, TFLG_INT}, /* 111 HTML_TEXTAREA_INT */ ! {"/textarea_int", NULL, 0, TFLG_INT | TFLG_END}, /* 112 HTML_N_TEXTAREA_INT */ ! {"table_alt", ALST_TABLE_ALT, MAXA_TABLE_ALT, TFLG_INT}, /* 113 HTML_TABLE_ALT */ ! {"rule", ALST_RULE, MAXA_RULE, TFLG_INT}, /* 114 HTML_RULE */ ! {"/rule", NULL, 0, TFLG_INT | TFLG_END}, /* 115 HTML_N_RULE */ ! {"pre_int", NULL, 0, TFLG_INT}, /* 116 HTML_PRE_INT */ ! {"/pre_int", NULL, 0, TFLG_INT | TFLG_END}, /* 117 HTML_N_PRE_INT */ ! {"title_alt", ALST_TITLE_ALT, MAXA_TITLE_ALT, TFLG_INT}, /* 118 HTML_TITLE_ALT */ ! {"form_int", ALST_FORM_INT, MAXA_FORM_INT, TFLG_INT}, /* 119 HTML_FORM_INT */ ! {"/form_int", NULL, 0, TFLG_INT | TFLG_END}, /* 120 HTML_N_FORM_INT */ ! {"dl_compact", NULL, 0, TFLG_INT}, /* 121 HTML_DL_COMPACT */ ! {"input_alt", ALST_INPUT_ALT, MAXA_INPUT_ALT, TFLG_INT}, /* 122 HTML_INPUT_ALT */ ! {"/input_alt", NULL, 0, TFLG_INT | TFLG_END}, /* 123 HTML_N_INPUT_ALT */ ! {"img_alt", ALST_IMG_ALT, MAXA_IMG_ALT, TFLG_INT}, /* 124 HTML_IMG_ALT */ ! {"/img_alt", NULL, 0, TFLG_INT | TFLG_END}, /* 125 HTML_N_IMG_ALT */ ! {"eol", NULL, 0, TFLG_INT}, /* 126 HTML_EOL */ ! {" ", ALST_NOP, MAXA_NOP, TFLG_INT}, /* 127 HTML_NOP */ }; TagAttrInfo AttrMAP[MAX_TAGATTR] = { --- 228,266 ---- {"/sup", NULL, 0, 0}, /* 101 HTML_N_SUP */ {"sub", NULL, 0, 0}, /* 102 HTML_SUB */ {"/sub", NULL, 0, 0}, /* 103 HTML_N_SUB */ ! {"link", ALST_LINK, MAXA_LINK, 0}, /* 104 HTML_LINK */ ! {"s", NULL, 0, 0}, /* 105 HTML_S */ ! {"/s", NULL, 0, TFLG_END}, /* 106 HTML_N_S */ ! {"noscript", NULL, 0, 0}, /* 107 HTML_NOSCRIPT */ ! {"/noscript", NULL, 0, TFLG_END}, /* 108 HTML_N_NOSCRIPT */ ! {NULL, NULL, 0, 0}, /* 109 Undefined */ /* pseudo tag */ ! {"select_int", ALST_SELECT_INT, MAXA_SELECT_INT, TFLG_INT}, /* 110 HTML_SELECT_INT */ ! {"/select_int", NULL, 0, TFLG_INT | TFLG_END}, /* 111 HTML_N_SELECT_INT */ ! {"option_int", ALST_OPTION, MAXA_OPTION, TFLG_INT}, /* 112 HTML_OPTION_INT */ ! {"textarea_int", ALST_TEXTAREA_INT, MAXA_TEXTAREA_INT, TFLG_INT}, /* 113 HTML_TEXTAREA_INT */ ! {"/textarea_int", NULL, 0, TFLG_INT | TFLG_END}, /* 114 HTML_N_TEXTAREA_INT */ ! {"table_alt", ALST_TABLE_ALT, MAXA_TABLE_ALT, TFLG_INT}, /* 115 HTML_TABLE_ALT */ ! {"rule", ALST_RULE, MAXA_RULE, TFLG_INT}, /* 116 HTML_RULE */ ! {"/rule", NULL, 0, TFLG_INT | TFLG_END}, /* 117 HTML_N_RULE */ ! {"pre_int", NULL, 0, TFLG_INT}, /* 118 HTML_PRE_INT */ ! {"/pre_int", NULL, 0, TFLG_INT | TFLG_END}, /* 119 HTML_N_PRE_INT */ ! {"title_alt", ALST_TITLE_ALT, MAXA_TITLE_ALT, TFLG_INT}, /* 120 HTML_TITLE_ALT */ ! {"form_int", ALST_FORM_INT, MAXA_FORM_INT, TFLG_INT}, /* 121 HTML_FORM_INT */ ! {"/form_int", NULL, 0, TFLG_INT | TFLG_END}, /* 122 HTML_N_FORM_INT */ ! {"dl_compact", NULL, 0, TFLG_INT}, /* 123 HTML_DL_COMPACT */ ! {"input_alt", ALST_INPUT_ALT, MAXA_INPUT_ALT, TFLG_INT}, /* 124 HTML_INPUT_ALT */ ! {"/input_alt", NULL, 0, TFLG_INT | TFLG_END}, /* 125 HTML_N_INPUT_ALT */ ! {"img_alt", ALST_IMG_ALT, MAXA_IMG_ALT, TFLG_INT}, /* 126 HTML_IMG_ALT */ ! {"/img_alt", NULL, 0, TFLG_INT | TFLG_END}, /* 127 HTML_N_IMG_ALT */ ! {" ", ALST_NOP, MAXA_NOP, TFLG_INT}, /* 128 HTML_NOP */ ! {"pre_plain", NULL, 0, TFLG_INT}, /* 129 HTML_PRE_PLAIN */ ! {"/pre_plain", NULL, 0, TFLG_INT | TFLG_END}, /* 130 HTML_N_PRE_PLAIN */ ! {"internal", NULL, 0, TFLG_INT}, /* 131 HTML_INTERNAL */ ! {"/internal", NULL, 0, TFLG_INT | TFLG_END}, /* 132 HTML_N_INTERNAL */ ! {"div_int", ALST_P, MAXA_P, TFLG_INT}, /* 133 HTML_DIV_INT */ ! {"/div_int", NULL, 0, TFLG_INT | TFLG_END}, /* 134 HTML_N_DIV_INT */ }; TagAttrInfo AttrMAP[MAX_TAGATTR] = { *************** *** 296,319 **** {"shape", VTYPE_STR, 0}, /* 44 ATTR_SHAPE */ {"coords", VTYPE_STR, 0}, /* 45 ATTR_COORDS */ {"ismap", VTYPE_NONE, 0}, /* 46 ATTR_ISMAP */ ! ! {NULL, VTYPE_NONE, 0}, /* 47 Undefined */ ! {NULL, VTYPE_NONE, 0}, /* 48 Undefined */ /* Internal attribute */ ! {"xoffset", VTYPE_NUMBER, AFLG_INT}, /* 49 ATTR_XOFFSET */ ! {"yoffset", VTYPE_NUMBER, AFLG_INT}, /* 50 ATTR_YOFFSET */ ! {"top_margin", VTYPE_NUMBER, AFLG_INT}, /* 51 ATTR_TOP_MARGIN, */ ! {"bottom_margin", VTYPE_NUMBER, AFLG_INT}, /* 52 ATTR_BOTTOM_MARGIN, */ ! {"tid", VTYPE_NUMBER, AFLG_INT}, /* 53 ATTR_TID */ ! {"fid", VTYPE_NUMBER, AFLG_INT}, /* 54 ATTR_FID */ ! {"for_table", VTYPE_NONE, AFLG_INT}, /* 55 ATTR_FOR_TABLE */ ! {"framename", VTYPE_STR, AFLG_INT}, /* 56 ATTR_FRAMENAME */ ! {"hborder", VTYPE_NONE, 0}, /* 57 ATTR_HBORDER */ ! {"hseq", VTYPE_NUMBER, AFLG_INT}, /* 58 ATTR_HSEQ */ ! {"no_effect", VTYPE_NONE, AFLG_INT}, /* 59 ATTR_NO_EFFECT */ ! {"referer", VTYPE_STR, AFLG_INT}, /* 60 ATTR_REFERER */ ! {"selectnumber", VTYPE_NUMBER, AFLG_INT}, /* 61 ATTR_SELECTNUMBER */ ! {"textareanumber", VTYPE_NUMBER, AFLG_INT}, /* 62 ATTR_TEXTAREANUMBER */ ! {"title", VTYPE_STR, AFLG_INT}, /* 63 ATTR_TITLE */ }; --- 311,343 ---- {"shape", VTYPE_STR, 0}, /* 44 ATTR_SHAPE */ {"coords", VTYPE_STR, 0}, /* 45 ATTR_COORDS */ {"ismap", VTYPE_NONE, 0}, /* 46 ATTR_ISMAP */ ! {"rel", VTYPE_STR, 0}, /* 47 ATTR_REL */ ! {"rev", VTYPE_STR, 0}, /* 48 ATTR_REV */ ! {"title", VTYPE_STR, 0}, /* 49 ATTR_TITLE */ ! {"accesskey", VTYPE_STR, 0}, /* 50 ATTR_ACCESSKEY */ ! {"language", VTYPE_STR, 0}, /* 51 ATTR_LANGUAGE */ ! {NULL, VTYPE_NONE, 0}, /* 52 Undefined */ ! {NULL, VTYPE_NONE, 0}, /* 53 Undefined */ ! {NULL, VTYPE_NONE, 0}, /* 54 Undefined */ ! {NULL, VTYPE_NONE, 0}, /* 55 Undefined */ ! {NULL, VTYPE_NONE, 0}, /* 56 Undefined */ ! {NULL, VTYPE_NONE, 0}, /* 57 Undefined */ ! {NULL, VTYPE_NONE, 0}, /* 58 Undefined */ ! {NULL, VTYPE_NONE, 0}, /* 59 Undefined */ /* Internal attribute */ ! {"xoffset", VTYPE_NUMBER, AFLG_INT}, /* 60 ATTR_XOFFSET */ ! {"yoffset", VTYPE_NUMBER, AFLG_INT}, /* 61 ATTR_YOFFSET */ ! {"top_margin", VTYPE_NUMBER, AFLG_INT}, /* 62 ATTR_TOP_MARGIN, */ ! {"bottom_margin", VTYPE_NUMBER, AFLG_INT}, /* 63 ATTR_BOTTOM_MARGIN, */ ! {"tid", VTYPE_NUMBER, AFLG_INT}, /* 64 ATTR_TID */ ! {"fid", VTYPE_NUMBER, AFLG_INT}, /* 65 ATTR_FID */ ! {"for_table", VTYPE_NONE, AFLG_INT}, /* 66 ATTR_FOR_TABLE */ ! {"framename", VTYPE_STR, AFLG_INT}, /* 67 ATTR_FRAMENAME */ ! {"hborder", VTYPE_NONE, 0}, /* 68 ATTR_HBORDER */ ! {"hseq", VTYPE_NUMBER, AFLG_INT}, /* 69 ATTR_HSEQ */ ! {"no_effect", VTYPE_NONE, AFLG_INT}, /* 70 ATTR_NO_EFFECT */ ! {"referer", VTYPE_STR, AFLG_INT}, /* 71 ATTR_REFERER */ ! {"selectnumber", VTYPE_NUMBER, AFLG_INT}, /* 72 ATTR_SELECTNUMBER */ ! {"textareanumber", VTYPE_NUMBER, AFLG_INT}, /* 73 ATTR_TEXTAREANUMBER */ }; diff -crN -x CVS w3m-0.3.2.2/html.h w3m-js-1.743/html.h *** w3m-0.3.2.2/html.h 2002-10-11 01:59:33.000000000 +0900 --- w3m-js-1.743/html.h 2003-02-08 02:38:49.000000000 +0900 *************** *** 1,4 **** ! /* $Id: html.h,v 1.9 2002/10/10 16:59:33 ukai Exp $ */ #ifndef _HTML_H #define _HTML_H #ifdef USE_SSL --- 1,4 ---- ! /* $Id: html.h,v 1.22 2003/01/15 16:11:43 ukai Exp $ */ #ifndef _HTML_H #define _HTML_H #ifdef USE_SSL *************** *** 14,20 **** #define UFgetc(f) ISgetc((f)->stream) #define UFundogetc(f) ISundogetc((f)->stream) #define UFread(f,buf,len) ISread((f)->stream,buf,len) ! #define UFclose(f) (ISclose((f)->stream), (f)->stream = NULL) struct cmdtable { char *cmdname; --- 14,21 ---- #define UFgetc(f) ISgetc((f)->stream) #define UFundogetc(f) ISundogetc((f)->stream) #define UFread(f,buf,len) ISread((f)->stream,buf,len) ! #define UFclose(f) (void)(ISclose((f)->stream) == 0 && ((f)->stream = NULL)) ! #define UFfileno(f) ISfileno((f)->stream) struct cmdtable { char *cmdname; *************** *** 59,64 **** --- 60,66 ---- char *query; char *label; int is_nocache; + int has_port; } ParsedURL; typedef struct { *************** *** 72,77 **** --- 74,81 ---- #ifdef USE_SSL char *ssl_certificate; #endif + char *url; + time_t modtime; } URLFile; #define CMP_NOCOMPRESS 0 *************** *** 189,220 **** #define HTML_N_SUP 101 #define HTML_SUB 102 #define HTML_N_SUB 103 /* pseudo tag */ ! #define HTML_INTERNAL 106 ! #define HTML_N_INTERNAL 107 ! #define HTML_SELECT_INT 108 ! #define HTML_N_SELECT_INT 109 ! #define HTML_OPTION_INT 110 ! #define HTML_TEXTAREA_INT 111 ! #define HTML_N_TEXTAREA_INT 112 ! #define HTML_TABLE_ALT 113 ! #define HTML_RULE 114 ! #define HTML_N_RULE 115 ! #define HTML_PRE_INT 116 ! #define HTML_N_PRE_INT 117 ! #define HTML_TITLE_ALT 118 ! #define HTML_FORM_INT 119 ! #define HTML_N_FORM_INT 120 ! #define HTML_DL_COMPACT 121 ! #define HTML_INPUT_ALT 122 ! #define HTML_N_INPUT_ALT 123 ! #define HTML_IMG_ALT 124 ! #define HTML_N_IMG_ALT 125 ! #define HTML_EOL 126 ! #define HTML_NOP 127 ! #define MAX_HTMLTAG 128 /* Tag attribute */ --- 193,232 ---- #define HTML_N_SUP 101 #define HTML_SUB 102 #define HTML_N_SUB 103 + #define HTML_LINK 104 + #define HTML_S 105 + #define HTML_N_S 106 + #define HTML_NOSCRIPT 107 + #define HTML_N_NOSCRIPT 108 /* pseudo tag */ ! #define HTML_SELECT_INT 110 ! #define HTML_N_SELECT_INT 111 ! #define HTML_OPTION_INT 112 ! #define HTML_TEXTAREA_INT 113 ! #define HTML_N_TEXTAREA_INT 114 ! #define HTML_TABLE_ALT 115 ! #define HTML_RULE 116 ! #define HTML_N_RULE 117 ! #define HTML_PRE_INT 118 ! #define HTML_N_PRE_INT 119 ! #define HTML_TITLE_ALT 120 ! #define HTML_FORM_INT 121 ! #define HTML_N_FORM_INT 122 ! #define HTML_DL_COMPACT 123 ! #define HTML_INPUT_ALT 124 ! #define HTML_N_INPUT_ALT 125 ! #define HTML_IMG_ALT 126 ! #define HTML_N_IMG_ALT 127 ! #define HTML_NOP 128 ! #define HTML_PRE_PLAIN 129 ! #define HTML_N_PRE_PLAIN 130 ! #define HTML_INTERNAL 131 ! #define HTML_N_INTERNAL 132 ! #define HTML_DIV_INT 133 ! #define HTML_N_DIV_INT 134 ! #define MAX_HTMLTAG 135 /* Tag attribute */ *************** *** 265,289 **** #define ATTR_SHAPE 44 #define ATTR_COORDS 45 #define ATTR_ISMAP 46 /* Internal attribute */ ! #define ATTR_XOFFSET 49 ! #define ATTR_YOFFSET 50 ! #define ATTR_TOP_MARGIN 51 ! #define ATTR_BOTTOM_MARGIN 52 ! #define ATTR_TID 53 ! #define ATTR_FID 54 ! #define ATTR_FOR_TABLE 55 ! #define ATTR_FRAMENAME 56 ! #define ATTR_HBORDER 57 ! #define ATTR_HSEQ 58 ! #define ATTR_NO_EFFECT 59 ! #define ATTR_REFERER 60 ! #define ATTR_SELECTNUMBER 61 ! #define ATTR_TEXTAREANUMBER 62 ! #define ATTR_TITLE 63 ! #define MAX_TAGATTR 64 /* HTML Tag Information Table */ --- 277,305 ---- #define ATTR_SHAPE 44 #define ATTR_COORDS 45 #define ATTR_ISMAP 46 + #define ATTR_REL 47 + #define ATTR_REV 48 + #define ATTR_TITLE 49 + #define ATTR_ACCESSKEY 50 + #define ATTR_LANGUAGE 51 /* Internal attribute */ ! #define ATTR_XOFFSET 60 ! #define ATTR_YOFFSET 61 ! #define ATTR_TOP_MARGIN 62 ! #define ATTR_BOTTOM_MARGIN 63 ! #define ATTR_TID 64 ! #define ATTR_FID 65 ! #define ATTR_FOR_TABLE 66 ! #define ATTR_FRAMENAME 67 ! #define ATTR_HBORDER 68 ! #define ATTR_HSEQ 69 ! #define ATTR_NO_EFFECT 70 ! #define ATTR_REFERER 71 ! #define ATTR_SELECTNUMBER 72 ! #define ATTR_TEXTAREANUMBER 73 ! #define MAX_TAGATTR 74 /* HTML Tag Information Table */ *************** *** 350,359 **** #define SCM_LOCAL_CGI 5 #define SCM_EXEC 6 #define SCM_NNTP 7 ! #define SCM_NEWS 8 ! #define SCM_MAILTO 9 #ifdef USE_SSL ! #define SCM_HTTPS 10 #endif /* USE_SSL */ #endif /* _HTML_H */ --- 366,381 ---- #define SCM_LOCAL_CGI 5 #define SCM_EXEC 6 #define SCM_NNTP 7 ! #define SCM_NNTP_GROUP 8 ! #define SCM_NEWS 9 ! #define SCM_NEWS_GROUP 10 ! #define SCM_DATA 11 ! #define SCM_MAILTO 12 #ifdef USE_SSL ! #define SCM_HTTPS 13 #endif /* USE_SSL */ + #ifdef USE_JAVASCRIPT + #define SCM_JAVASCRIPT 14 + #endif #endif /* _HTML_H */ diff -crN -x CVS w3m-0.3.2.2/image.c w3m-js-1.743/image.c *** w3m-0.3.2.2/image.c 2002-07-30 00:25:37.000000000 +0900 --- w3m-js-1.743/image.c 2003-01-30 04:04:49.000000000 +0900 *************** *** 1,4 **** ! /* $Id: image.c,v 1.11 2002/07/29 15:25:37 ukai Exp $ */ #include "fm.h" #include --- 1,4 ---- ! /* $Id: image.c,v 1.32 2003/01/29 17:31:22 ukai Exp $ */ #include "fm.h" #include *************** *** 12,21 **** #ifdef USE_IMAGE - #ifndef W3M_SIGIMG - #define W3M_SIGIMG (SIGUSR1) - #endif - static int image_index = 0; /* display image */ --- 12,17 ---- *************** *** 57,64 **** tmp = Strnew(); if (!strchr(Imgdisplay, '/')) ! Strcat_m_charp(tmp, w3m_lib_dir(), "/", NULL); ! Strcat_m_charp(tmp, Imgdisplay, " -test 2> /dev/null", NULL); f = popen(tmp->ptr, "r"); if (!f) return FALSE; --- 53,60 ---- tmp = Strnew(); if (!strchr(Imgdisplay, '/')) ! Strcat_m_charp(tmp, w3m_auxbin_dir(), "/", NULL); ! Strcat_m_charp(tmp, Imgdisplay, " -test", NULL); f = popen(tmp->ptr, "r"); if (!f) return FALSE; *************** *** 93,145 **** static int openImgdisplay() { ! int fdr[2], fdw[2]; ! char *cmd; ! ! if (pipe(fdr) < 0) ! goto err0; ! if (pipe(fdw) < 0) ! goto err1; ! ! flush_tty(); ! Imgdisplay_pid = fork(); if (Imgdisplay_pid < 0) ! goto err2; if (Imgdisplay_pid == 0) { /* child */ ! reset_signals(); ! signal(SIGINT, SIG_IGN); ! #ifdef HAVE_SETPGRP ! SETPGRP(); ! #endif ! close_tty(); ! close(fdr[0]); ! close(fdw[1]); ! dup2(fdw[0], 0); ! dup2(fdr[1], 1); ! close(2); if (!strchr(Imgdisplay, '/')) ! cmd = Strnew_m_charp(w3m_lib_dir(), "/", Imgdisplay, NULL)->ptr; else cmd = Imgdisplay; ! execl("/bin/sh", "sh", "-c", cmd, NULL); ! exit(1); } - close(fdr[1]); - close(fdw[0]); - Imgdisplay_rf = fdopen(fdr[0], "r"); - Imgdisplay_wf = fdopen(fdw[1], "w"); activeImage = TRUE; return TRUE; - err2: - close(fdw[0]); - close(fdw[1]); - err1: - close(fdr[0]); - close(fdr[1]); err0: - Imgdisplay_rf = NULL; - Imgdisplay_wf = NULL; Imgdisplay_pid = 0; activeImage = FALSE; return FALSE; --- 89,112 ---- static int openImgdisplay() { ! Imgdisplay_pid = open_pipe_rw(&Imgdisplay_rf, &Imgdisplay_wf); if (Imgdisplay_pid < 0) ! goto err0; if (Imgdisplay_pid == 0) { /* child */ ! char *cmd; ! setup_child(FALSE, 2, -1); ! set_environ("W3M_TTY", ttyname_tty()); if (!strchr(Imgdisplay, '/')) ! cmd = Strnew_m_charp(w3m_auxbin_dir(), "/", Imgdisplay, NULL)->ptr; else cmd = Imgdisplay; ! myExec(cmd); ! /* XXX: ifdef __EMX__, use start /f ? */ } activeImage = TRUE; return TRUE; err0: Imgdisplay_pid = 0; activeImage = FALSE; return FALSE; *************** *** 195,201 **** return; for (j = 0; j < n_terminal_image; j++) { i = &terminal_image[j]; ! if (!(i->cache->loaded == IMG_FLAG_LOADED && i->width > 0 && i->height > 0)) continue; if (!(Imgdisplay_rf && Imgdisplay_wf)) { --- 162,168 ---- return; for (j = 0; j < n_terminal_image; j++) { i = &terminal_image[j]; ! if (!(i->cache->loaded & IMG_FLAG_LOADED && i->width > 0 && i->height > 0)) continue; if (!(Imgdisplay_rf && Imgdisplay_wf)) { *************** *** 276,300 **** static Hash_sv *image_file = NULL; static GeneralList *image_list = NULL; static ImageCache **image_cache = NULL; ! static char *image_lock = NULL; ! static int need_load_image = FALSE; ! ! static MySignalHandler ! load_image_handler(SIGNAL_ARG) ! { ! need_load_image = TRUE; ! signal(W3M_SIGIMG, load_image_handler); ! SIGNAL_RETURN; ! } ! ! static MySignalHandler ! load_image_next(SIGNAL_ARG) ! { ! need_load_image = TRUE; ! signal(W3M_SIGIMG, load_image_handler); ! loadImage(IMG_FLAG_NEXT); ! SIGNAL_RETURN; ! } void deleteImage(Buffer *buf) --- 243,249 ---- static Hash_sv *image_file = NULL; static GeneralList *image_list = NULL; static ImageCache **image_cache = NULL; ! static Buffer *image_buffer = NULL; void deleteImage(Buffer *buf) *************** *** 311,320 **** for (i = 0, a = al->anchors; i < al->nanchor; i++, a++) { if (a->image && a->image->cache && a->image->cache->loaded != IMG_FLAG_UNLOADED && a->image->cache->index < 0) unlink(a->image->cache->file); } ! loadImage(IMG_FLAG_STOP); } void --- 260,270 ---- for (i = 0, a = al->anchors; i < al->nanchor; i++, a++) { if (a->image && a->image->cache && a->image->cache->loaded != IMG_FLAG_UNLOADED && + !(a->image->cache->loaded & IMG_FLAG_DONT_REMOVE) && a->image->cache->index < 0) unlink(a->image->cache->file); } ! loadImage(NULL, IMG_FLAG_STOP); } void *************** *** 325,339 **** ParsedURL *current; int i; if (!buf) return; al = buf->img; if (!al) return; current = baseURL(buf); for (i = 0, a = al->anchors; i < al->nanchor; i++, a++) { ! if (a->image) a->image->cache = getImage(a->image, current, buf->image_flag); } } --- 275,295 ---- ParsedURL *current; int i; + image_buffer = buf; if (!buf) return; + buf->image_loaded = TRUE; al = buf->img; if (!al) return; current = baseURL(buf); for (i = 0, a = al->anchors; i < al->nanchor; i++, a++) { ! if (a->image) { a->image->cache = getImage(a->image, current, buf->image_flag); + if (a->image->cache && + a->image->cache->loaded == IMG_FLAG_UNLOADED) + buf->image_loaded = FALSE; + } } } *************** *** 352,374 **** for (i = 0, l = 0, n = 0, a = al->anchors; i < al->nanchor; i++, a++) { if (a->image && a->hseq >= 0) { n++; ! if (a->image->cache && a->image->cache->loaded == IMG_FLAG_LOADED) l++; } } if (n) { message(Sprintf("%d/%d images loaded", l, n)->ptr, ! buf->cursorX + buf->rootX, buf->cursorY); refresh(); } } void ! loadImage(int flag) { ImageCache *cache; struct stat st; ! int wait_st, i; if (maxLoadImage > MAX_LOAD_IMAGE) maxLoadImage = MAX_LOAD_IMAGE; --- 308,331 ---- for (i = 0, l = 0, n = 0, a = al->anchors; i < al->nanchor; i++, a++) { if (a->image && a->hseq >= 0) { n++; ! if (a->image->cache && a->image->cache->loaded & IMG_FLAG_LOADED) l++; } } if (n) { message(Sprintf("%d/%d images loaded", l, n)->ptr, ! buf->cursorX + buf->rootX, buf->cursorY + buf->rootY); refresh(); } } void ! loadImage(Buffer *buf, int flag) { ImageCache *cache; struct stat st; ! int i, draw = FALSE; ! /* int wait_st; */ if (maxLoadImage > MAX_LOAD_IMAGE) maxLoadImage = MAX_LOAD_IMAGE; *************** *** 380,456 **** image_cache = New_N(ImageCache *, MAX_LOAD_IMAGE); bzero(image_cache, sizeof(ImageCache *) * MAX_LOAD_IMAGE); } ! ! if (flag == IMG_FLAG_STOP) { ! for (i = 0; i < n_load_image; i++) { ! cache = image_cache[i]; ! if (!cache) ! continue; ! if (cache->pid) { ! kill(cache->pid, SIGKILL); ! #ifdef HAVE_WAITPID ! waitpid(cache->pid, &wait_st, 0); ! #else ! wait(&wait_st); ! #endif ! cache->pid = 0; } ! unlink(cache->touch); ! image_cache[i] = NULL; } image_list = NULL; image_file = NULL; - if (image_lock) - unlink(image_lock); - need_load_image = FALSE; n_load_image = maxLoadImage; return; } ! if (need_load_image) { ! int draw = FALSE; ! for (i = 0; i < n_load_image; i++) { ! cache = image_cache[i]; ! if (!cache) ! continue; ! #ifdef HAVE_LSTAT ! if (lstat(cache->touch, &st)) ! #else ! if (stat(cache->touch, &st)) ! #endif ! continue; ! if (cache->pid) { ! kill(cache->pid, SIGKILL); ! #ifdef HAVE_WAITPID ! waitpid(cache->pid, &wait_st, 0); ! #else ! wait(&wait_st); ! #endif ! cache->pid = 0; ! } ! if (!stat(cache->file, &st)) { ! cache->loaded = IMG_FLAG_LOADED; ! if (getImageSize(cache)) { ! if (flag == IMG_FLAG_NEXT && Currentbuf) ! Currentbuf->need_reshape = TRUE; ! } ! draw = TRUE; ! } ! else ! cache->loaded = IMG_FLAG_ERROR; ! unlink(cache->touch); ! image_cache[i] = NULL; ! } ! if (flag == IMG_FLAG_NEXT && draw) ! drawImage(); ! if (Currentbuf) ! showImageProgress(Currentbuf); } ! if (image_lock) ! unlink(image_lock); ! need_load_image = FALSE; ! signal(W3M_SIGIMG, load_image_handler); if (!image_list) return; --- 337,406 ---- image_cache = New_N(ImageCache *, MAX_LOAD_IMAGE); bzero(image_cache, sizeof(ImageCache *) * MAX_LOAD_IMAGE); } ! for (i = 0; i < n_load_image; i++) { ! cache = image_cache[i]; ! if (!cache) ! continue; ! if (lstat(cache->touch, &st)) ! continue; ! if (cache->pid) { ! kill(cache->pid, SIGKILL); ! /* ! * #ifdef HAVE_WAITPID ! * waitpid(cache->pid, &wait_st, 0); ! * #else ! * wait(&wait_st); ! * #endif ! */ ! cache->pid = 0; ! } ! if (!stat(cache->file, &st)) { ! cache->loaded = IMG_FLAG_LOADED; ! if (getImageSize(cache)) { ! if (image_buffer) ! image_buffer->need_reshape = TRUE; } ! draw = TRUE; } + else + cache->loaded = IMG_FLAG_ERROR; + unlink(cache->touch); + image_cache[i] = NULL; + } + + for (i = (buf != image_buffer) ? 0 : maxLoadImage; i < n_load_image; i++) { + cache = image_cache[i]; + if (!cache) + continue; + if (cache->pid) { + kill(cache->pid, SIGKILL); + /* + * #ifdef HAVE_WAITPID + * waitpid(cache->pid, &wait_st, 0); + * #else + * wait(&wait_st); + * #endif + */ + cache->pid = 0; + } + unlink(cache->touch); + image_cache[i] = NULL; + } + + if (flag == IMG_FLAG_STOP) { image_list = NULL; image_file = NULL; n_load_image = maxLoadImage; + image_buffer = NULL; return; } ! if (draw && image_buffer) { ! drawImage(); ! showImageProgress(image_buffer); } ! image_buffer = buf; if (!image_list) return; *************** *** 462,473 **** if (!cache) { for (i = 0; i < n_load_image; i++) { if (image_cache[i]) ! goto load_image_end; } image_list = NULL; image_file = NULL; ! if (Currentbuf) ! displayBuffer(Currentbuf, B_NORMAL); return; } if (cache->loaded == IMG_FLAG_UNLOADED) --- 412,423 ---- if (!cache) { for (i = 0; i < n_load_image; i++) { if (image_cache[i]) ! return; } image_list = NULL; image_file = NULL; ! if (image_buffer) ! displayBuffer(image_buffer, B_NORMAL); return; } if (cache->loaded == IMG_FLAG_UNLOADED) *************** *** 475,517 **** } image_cache[i] = cache; - if (!image_lock) { - image_lock = tmpfname(TMPF_DFL, ".lock")->ptr; - pushText(fileToDelete, image_lock); - } - flush_tty(); if ((cache->pid = fork()) == 0) { Buffer *b; ! #if !(defined(HAVE_SYMLINK) && defined(HAVE_LSTAT)) ! FILE *f; ! #endif ! reset_signals(); ! signal(SIGINT, SIG_IGN); ! close_tty(); ! QuietMessage = TRUE; ! fmInitialized = FALSE; image_source = cache->file; b = loadGeneralFile(cache->url, cache->current, NULL, 0, NULL); if (!b || !b->real_type || strncasecmp(b->real_type, "image/", 6)) unlink(cache->file); #if defined(HAVE_SYMLINK) && defined(HAVE_LSTAT) symlink(cache->file, cache->touch); - if (lstat(image_lock, &st)) { - if (symlink(cache->file, image_lock)) - exit(0); #else ! f = fopen(cache->touch, "w"); ! if (f) ! fclose(f); ! if (stat(image_lock, &st)) { ! f = fopen(image_lock, "w"); ! if (!f) ! exit(0); ! fclose(f); ! #endif ! kill(getppid(), W3M_SIGIMG); } exit(0); } else if (cache->pid < 0) { --- 425,450 ---- } image_cache[i] = cache; flush_tty(); if ((cache->pid = fork()) == 0) { Buffer *b; ! /* ! * setup_child(TRUE, 0, -1); ! */ ! setup_child(FALSE, 0, -1); image_source = cache->file; b = loadGeneralFile(cache->url, cache->current, NULL, 0, NULL); if (!b || !b->real_type || strncasecmp(b->real_type, "image/", 6)) unlink(cache->file); #if defined(HAVE_SYMLINK) && defined(HAVE_LSTAT) symlink(cache->file, cache->touch); #else ! { ! FILE *f = fopen(cache->touch, "w"); ! if (f) ! fclose(f); } + #endif exit(0); } else if (cache->pid < 0) { *************** *** 519,527 **** return; } } - load_image_end: - if (flag == IMG_FLAG_NEXT) - signal(W3M_SIGIMG, load_image_next); } ImageCache * --- 452,457 ---- *************** *** 562,569 **** cache->width = image->width; cache->height = image->height; putHash_sv(image_hash, key->ptr, (void *)cache); - pushText(fileToDelete, cache->file); - pushText(fileToDelete, cache->touch); } if (flag != IMG_FLAG_SKIP) { if (cache->loaded == IMG_FLAG_UNLOADED) { --- 492,497 ---- *************** *** 579,585 **** if (!cache->index) cache->index = ++image_index; } ! if (cache->loaded == IMG_FLAG_LOADED) getImageSize(cache); return cache; } --- 507,513 ---- if (!cache->index) cache->index = ++image_index; } ! if (cache->loaded & IMG_FLAG_LOADED) getImageSize(cache); return cache; } *************** *** 588,616 **** getImageSize(ImageCache * cache) { Str tmp; int w = 0, h = 0; if (!activeImage) return FALSE; ! if (!cache || cache->loaded != IMG_FLAG_LOADED || (cache->width > 0 && cache->height > 0)) return FALSE; tmp = Strnew(); ! if (!(Imgdisplay_rf && Imgdisplay_wf)) { ! if (!openImgdisplay()) ! return FALSE; ! } ! fputs("5;", Imgdisplay_wf); /* Get Size */ ! fputs(cache->file, Imgdisplay_wf); ! fputs("\n", Imgdisplay_wf); ! fflush(Imgdisplay_wf); ! { ! char buf[1024]; ! fgets(buf, sizeof(buf), Imgdisplay_rf); ! if (sscanf(buf, "%d %d", &w, &h) != 2) { ! return FALSE; ! } } if (!(w > 0 && h > 0)) return FALSE; --- 516,541 ---- getImageSize(ImageCache * cache) { Str tmp; + FILE *f; int w = 0, h = 0; if (!activeImage) return FALSE; ! if (!cache || !(cache->loaded & IMG_FLAG_LOADED) || (cache->width > 0 && cache->height > 0)) return FALSE; tmp = Strnew(); ! if (!strchr(Imgdisplay, '/')) ! Strcat_m_charp(tmp, w3m_auxbin_dir(), "/", NULL); ! Strcat_m_charp(tmp, Imgdisplay, " -size ", shell_quote(cache->file), NULL); ! f = popen(tmp->ptr, "r"); ! if (!f) ! return FALSE; ! while (fscanf(f, "%d %d", &w, &h) < 0) { ! if (feof(f)) ! break; } + pclose(f); if (!(w > 0 && h > 0)) return FALSE; *************** *** 621,634 **** if (h == 0) h = 1; if (cache->width < 0 && cache->height < 0) { ! cache->width = w; ! cache->height = h; } else if (cache->width < 0) { ! cache->width = (int)((double)cache->height * w / h + 0.5); } else if (cache->height < 0) { ! cache->height = (int)((double)cache->width * h / w + 0.5); } if (cache->width == 0) cache->width = 1; --- 546,561 ---- if (h == 0) h = 1; if (cache->width < 0 && cache->height < 0) { ! cache->width = (w > MAX_IMAGE_SIZE) ? MAX_IMAGE_SIZE : w; ! cache->height = (h > MAX_IMAGE_SIZE) ? MAX_IMAGE_SIZE : h; } else if (cache->width < 0) { ! int tmp = (int)((double)cache->height * w / h + 0.5); ! cache->width = (tmp > MAX_IMAGE_SIZE) ? MAX_IMAGE_SIZE : tmp; } else if (cache->height < 0) { ! int tmp = (int)((double)cache->width * h / w + 0.5); ! cache->height = (tmp > MAX_IMAGE_SIZE) ? MAX_IMAGE_SIZE : tmp; } if (cache->width == 0) cache->width = 1; diff -crN -x CVS w3m-0.3.2.2/indep.c w3m-js-1.743/indep.c *** w3m-0.3.2.2/indep.c 2002-08-28 01:35:15.000000000 +0900 --- w3m-js-1.743/indep.c 2003-02-06 02:23:10.000000000 +0900 *************** *** 1,4 **** ! /* $Id: indep.c,v 1.24 2002/08/27 16:35:15 ukai Exp $ */ #include "fm.h" #include #include --- 1,4 ---- ! /* $Id: indep.c,v 1.32 2003/02/05 16:45:08 ukai Exp $ */ #include "fm.h" #include #include *************** *** 11,16 **** --- 11,55 ---- #include "myctype.h" #include "entity.h" + unsigned char QUOTE_MAP[0x100] = { + /* NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI */ + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + /* DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US */ + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + /* SPC ! " # $ % & ' ( ) * + , - . / */ + 24, 72, 76, 40, 8, 40, 41, 72, 72, 72, 72, 40, 72, 8, 0, 64, + /* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 72, 74, 72, 75, 40, + /* @ A B C D E F G H I J K L M N O */ + 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + /* P Q R S T U V W X Y Z [ \ ] ^ _ */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 72, 72, 72, 0, + /* ` a b c d e f g h i j k l m n o */ + 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + /* p q r s t u v w x y z { | } ~ DEL */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 72, 72, 72, 24, + + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + }; + + char *HTML_QUOTE_MAP[] = { + NULL, + "&", + "<", + ">", + """, + NULL, + NULL, + NULL, + }; + clen_t strtoclen(const char *s) { *************** *** 177,186 **** char * expandPath(char *name) { - Str userName = NULL; char *p; struct passwd *passent, *getpwnam(const char *); ! Str extpath = Strnew(); if (name == NULL) return NULL; --- 216,224 ---- char * expandPath(char *name) { char *p; struct passwd *passent, *getpwnam(const char *); ! Str extpath = NULL; if (name == NULL) return NULL; *************** *** 188,212 **** if (*p == '~') { p++; if (IS_ALPHA(*p)) { ! userName = Strnew(); ! while (IS_ALNUM(*p) || *p == '_' || *p == '-') ! Strcat_char(userName, *(p++)); ! passent = getpwnam(userName->ptr); ! if (passent == NULL) { ! p = name; ! goto rest; } ! Strcat_charp(extpath, passent->pw_dir); } ! else { ! Strcat_charp(extpath, getenv("HOME")); } if (Strcmp_charp(extpath, "/") == 0 && *p == '/') p++; } rest: ! Strcat_charp(extpath, p); ! return extpath->ptr; } #ifndef HAVE_STRCHR --- 226,256 ---- if (*p == '~') { p++; if (IS_ALPHA(*p)) { ! char *q = strchr(p, '/'); ! if (q) { /* ~user/dir... */ ! passent = getpwnam(allocStr(p, q - p)); ! p = q; ! } ! else { /* ~user */ ! passent = getpwnam(p); ! p = ""; } ! if (!passent) ! goto rest; ! extpath = Strnew_charp(passent->pw_dir); } ! else if (*p == '/' || *p == '\0') { /* ~/dir... or ~ */ ! extpath = Strnew_charp(getenv("HOME")); } + else + goto rest; if (Strcmp_charp(extpath, "/") == 0 && *p == '/') p++; + Strcat_charp(extpath, p); + return extpath->ptr; } rest: ! return name; } #ifndef HAVE_STRCHR *************** *** 228,240 **** { int x; while (*s1) { ! x = tolower(*s1) - tolower(*s2); if (x != 0) return x; s1++; s2++; } ! return -tolower(*s2); } int --- 272,284 ---- { int x; while (*s1) { ! x = TOLOWER(*s1) - TOLOWER(*s2); if (x != 0) return x; s1++; s2++; } ! return -TOLOWER(*s2); } int *************** *** 242,255 **** { int x; while (*s1 && n) { ! x = tolower(*s1) - tolower(*s2); if (x != 0) return x; s1++; s2++; n--; } ! return n ? -tolower(*s2) : 0; } #endif /* not HAVE_STRCASECMP */ --- 286,299 ---- { int x; while (*s1 && n) { ! x = TOLOWER(*s1) - TOLOWER(*s2); if (x != 0) return x; s1++; s2++; n--; } ! return n ? -TOLOWER(*s2) : 0; } #endif /* not HAVE_STRCASECMP */ *************** *** 282,288 **** while (*s1) { if (*s2 == '\0') return 1; ! x = tolower(*s1) - tolower(*s2); if (x != 0) break; s1++; --- 326,332 ---- while (*s1) { if (*s2 == '\0') return 1; ! x = TOLOWER(*s1) - TOLOWER(*s2); if (x != 0) break; s1++; *************** *** 440,461 **** } char * - html_quote_char(char c) - { - switch (c) { - case '&': - return "&"; - case '<': - return "<"; - case '>': - return ">"; - case '"': - return """; - } - return NULL; - } - - char * html_quote(char *str) { Str tmp = NULL; --- 484,489 ---- *************** *** 506,515 **** static char xdigit[0x10] = "0123456789ABCDEF"; #define url_unquote_char(pstr) \ ! (IS_XDIGIT((*(pstr))[1]) ? \ ! (IS_XDIGIT((*(pstr))[2]) ? \ (*(pstr) += 3, (GET_MYCDIGIT((*(pstr))[-2]) << 4) | GET_MYCDIGIT((*(pstr))[-1])) : \ - (*(pstr) += 2, GET_MYCDIGIT((*(pstr))[-1]))) : \ -1) char * --- 534,541 ---- static char xdigit[0x10] = "0123456789ABCDEF"; #define url_unquote_char(pstr) \ ! ((IS_XDIGIT((*(pstr))[1]) && IS_XDIGIT((*(pstr))[2])) ? \ (*(pstr) += 3, (GET_MYCDIGIT((*(pstr))[-2]) << 4) | GET_MYCDIGIT((*(pstr))[-1])) : \ -1) char * *************** *** 519,525 **** char *p; for (p = str; *p; p++) { ! if (IS_CNTRL(*p) || *p == ' ' || !IS_ASCII(*p)) { if (tmp == NULL) tmp = Strnew_charp_n(str, (int)(p - str)); Strcat_char(tmp, '%'); --- 545,551 ---- char *p; for (p = str; *p; p++) { ! if (is_url_quote(*p)) { if (tmp == NULL) tmp = Strnew_charp_n(str, (int)(p - str)); Strcat_char(tmp, '%'); *************** *** 537,571 **** } char * - url_unquote(char *str) - { - Str tmp = NULL; - char *p, *q; - int c; - - for (p = str; *p;) { - if (*p == '%') { - q = p; - c = url_unquote_char(&q); - if (c >= 0 && (IS_CNTRL(c) || c == ' ' || !IS_ASCII(c))) { - if (tmp == NULL) - tmp = Strnew_charp_n(str, (int)(p - str)); - if (c != '\0' && c != '\n' && c != '\r') - Strcat_char(tmp, (char)c); - p = q; - continue; - } - } - if (tmp) - Strcat_char(tmp, *p); - p++; - } - if (tmp) - return tmp->ptr; - return str; - } - - char * file_quote(char *str) { Str tmp = NULL; --- 563,568 ---- *************** *** 573,580 **** char buf[4]; for (p = str; *p; p++) { ! if (IS_CNTRL(*p) || *p == ' ' || !IS_ASCII(*p) || *p == '+' || ! *p == ':' || *p == '#' || *p == '?' || *p == '&' || *p == '%') { if (tmp == NULL) tmp = Strnew_charp_n(str, (int)(p - str)); sprintf(buf, "%%%02X", (unsigned char)*p); --- 570,576 ---- char buf[4]; for (p = str; *p; p++) { ! if (is_file_quote(*p)) { if (tmp == NULL) tmp = Strnew_charp_n(str, (int)(p - str)); sprintf(buf, "%%%02X", (unsigned char)*p); *************** *** 619,640 **** return str; } - /* rfc1808 safe */ - static int - is_url_safe(char c) - { - switch (c) { - /* safe */ - case '$': - case '-': - case '_': - case '.': - return 1; - default: - return IS_ALNUM(c); - } - } - Str Str_form_quote(Str x) { --- 615,620 ---- *************** *** 648,654 **** tmp = Strnew_charp_n(x->ptr, (int)(p - x->ptr)); Strcat_char(tmp, '+'); } ! else if (!is_url_safe(*p)) { if (tmp == NULL) tmp = Strnew_charp_n(x->ptr, (int)(p - x->ptr)); sprintf(buf, "%%%02X", (unsigned char)*p); --- 628,634 ---- tmp = Strnew_charp_n(x->ptr, (int)(p - x->ptr)); Strcat_char(tmp, '+'); } ! else if (is_url_unsafe(*p)) { if (tmp == NULL) tmp = Strnew_charp_n(x->ptr, (int)(p - x->ptr)); sprintf(buf, "%%%02X", (unsigned char)*p); *************** *** 664,678 **** return x; } Str ! Str_form_unquote(Str x) { Str tmp = NULL; char *p = x->ptr, *ep = x->ptr + x->length, *q; int c; for (; p < ep;) { ! if (*p == '+') { if (tmp == NULL) tmp = Strnew_charp_n(x->ptr, (int)(p - x->ptr)); Strcat_char(tmp, ' '); --- 644,659 ---- return x; } + Str ! Str_url_unquote(Str x, int is_form, int safe) { Str tmp = NULL; char *p = x->ptr, *ep = x->ptr + x->length, *q; int c; for (; p < ep;) { ! if (is_form && *p == '+') { if (tmp == NULL) tmp = Strnew_charp_n(x->ptr, (int)(p - x->ptr)); Strcat_char(tmp, ' '); *************** *** 682,688 **** else if (*p == '%') { q = p; c = url_unquote_char(&q); ! if (c >= 0) { if (tmp == NULL) tmp = Strnew_charp_n(x->ptr, (int)(p - x->ptr)); Strcat_char(tmp, (char)c); --- 663,669 ---- else if (*p == '%') { q = p; c = url_unquote_char(&q); ! if (c >= 0 && (!safe || !IS_ASCII(c) || !is_file_quote(c))) { if (tmp == NULL) tmp = Strnew_charp_n(x->ptr, (int)(p - x->ptr)); Strcat_char(tmp, (char)c); *************** *** 699,719 **** return x; } - static int - is_shell_safe(char c) - { - switch (c) { - /* safe */ - case '/': - case '.': - case '_': - case ':': - return 1; - default: - return IS_ALNUM(c) || (c & 0x80); - } - } - char * shell_quote(char *str) { --- 680,685 ---- *************** *** 721,727 **** char *p; for (p = str; *p; p++) { ! if (!is_shell_safe(*p)) { if (tmp == NULL) tmp = Strnew_charp_n(str, (int)(p - str)); Strcat_char(tmp, '\\'); --- 687,693 ---- char *p; for (p = str; *p; p++) { ! if (is_shell_unsafe(*p)) { if (tmp == NULL) tmp = Strnew_charp_n(str, (int)(p - str)); Strcat_char(tmp, '\\'); *************** *** 749,754 **** --- 715,726 ---- } char * + w3m_auxbin_dir() + { + return w3m_dir("W3M_AUXBIN_DIR", AUXBIN_DIR); + } + + char * w3m_lib_dir() { return w3m_dir("W3M_LIB_DIR", LIB_DIR); diff -crN -x CVS w3m-0.3.2.2/indep.h w3m-js-1.743/indep.h *** w3m-0.3.2.2/indep.h 2002-08-21 02:49:39.000000000 +0900 --- w3m-js-1.743/indep.h 2003-02-06 02:23:11.000000000 +0900 *************** *** 1,4 **** ! /* $Id: indep.h,v 1.9 2002/08/20 17:49:39 ukai Exp $ */ #ifndef INDEP_H #define INDEP_H #include "gc.h" --- 1,4 ---- ! /* $Id: indep.h,v 1.13 2003/02/05 16:43:57 ukai Exp $ */ #ifndef INDEP_H #define INDEP_H #include "gc.h" *************** *** 12,20 **** #define FALSE 0 #endif /* FALSE */ ! #define PAGER_MODE 0 ! #define HTML_MODE 1 ! #define HEADER_MODE 2 extern clen_t strtoclen(const char *s); extern char *conv_entity(int ch); --- 12,36 ---- #define FALSE 0 #endif /* FALSE */ ! #define RAW_MODE 0 ! #define PAGER_MODE 1 ! #define HTML_MODE 2 ! #define HEADER_MODE 3 ! ! extern unsigned char QUOTE_MAP[]; ! extern char *HTML_QUOTE_MAP[]; ! #define HTML_QUOTE_MASK 0x07 /* &, <, >, " */ ! #define SHELL_UNSAFE_MASK 0x08 /* [^A-Za-z0-9_./:\200-\377] */ ! #define URL_QUOTE_MASK 0x10 /* [\0- \177-\377] */ ! #define FILE_QUOTE_MASK 0x30 /* [\0- #%&+:?\177-\377] */ ! #define URL_UNSAFE_MASK 0x70 /* [^A-Za-z0-9_$\-.] */ ! #define GET_QUOTE_TYPE(c) QUOTE_MAP[(int)(unsigned char)(c)] ! #define is_html_quote(c) (GET_QUOTE_TYPE(c) & HTML_QUOTE_MASK) ! #define is_shell_unsafe(c) (GET_QUOTE_TYPE(c) & SHELL_UNSAFE_MASK) ! #define is_url_quote(c) (GET_QUOTE_TYPE(c) & URL_QUOTE_MASK) ! #define is_file_quote(c) (GET_QUOTE_TYPE(c) & FILE_QUOTE_MASK) ! #define is_url_unsafe(c) (GET_QUOTE_TYPE(c) & URL_UNSAFE_MASK) ! #define html_quote_char(c) HTML_QUOTE_MAP[(int)is_html_quote(c)] extern clen_t strtoclen(const char *s); extern char *conv_entity(int ch); *************** *** 39,55 **** extern char *remove_space(char *str); extern int non_null(char *s); extern void cleanup_line(Str s, int mode); - extern char *html_quote_char(char c); extern char *html_quote(char *str); extern char *html_unquote(char *str); extern char *file_quote(char *str); extern char *file_unquote(char *str); extern char *url_quote(char *str); ! extern char *url_unquote(char *str); extern Str Str_form_quote(Str x); ! extern Str Str_form_unquote(Str x); extern char *shell_quote(char *str); extern char *w3m_lib_dir(); extern char *w3m_etc_dir(); extern char *w3m_help_dir(); --- 55,71 ---- extern char *remove_space(char *str); extern int non_null(char *s); extern void cleanup_line(Str s, int mode); extern char *html_quote(char *str); extern char *html_unquote(char *str); extern char *file_quote(char *str); extern char *file_unquote(char *str); extern char *url_quote(char *str); ! extern Str Str_url_unquote(Str x, int is_form, int safe); extern Str Str_form_quote(Str x); ! #define Str_form_unquote(x) Str_url_unquote((x), TRUE, FALSE) extern char *shell_quote(char *str); + extern char *w3m_auxbin_dir(); extern char *w3m_lib_dir(); extern char *w3m_etc_dir(); extern char *w3m_help_dir(); diff -crN -x CVS w3m-0.3.2.2/install-sh w3m-js-1.743/install-sh *** w3m-0.3.2.2/install-sh 2002-09-09 22:51:46.000000000 +0900 --- w3m-js-1.743/install-sh 2002-11-08 05:25:01.000000000 +0900 *************** *** 1,5 **** #! /bin/sh ! # $Id: install-sh,v 1.4 2002/09/09 13:51:46 ukai Exp $ set -e --- 1,5 ---- #! /bin/sh ! # $Id: install-sh,v 1.6 2002/11/06 15:09:16 ukai Exp $ set -e *************** *** 18,23 **** --- 18,29 ---- fi shift; ;; + -o) owner=$2 + shift; shift + ;; + -g) group=$2 + shift; shift + ;; -*) shift ;; *************** *** 45,50 **** --- 51,62 ---- if [ -n "$strip" ]; then $strip $dest fi + if [ -n "$owner" ]; then + chown $owner $dest + fi + if [ -n "$group" ]; then + chgrp $group $dest + fi if [ -n "$mode" ]; then chmod $mode $dest fi diff -crN -x CVS w3m-0.3.2.2/istream.c w3m-js-1.743/istream.c *** w3m-0.3.2.2/istream.c 2002-09-29 01:30:07.000000000 +0900 --- w3m-js-1.743/istream.c 2003-01-21 22:18:19.000000000 +0900 *************** *** 1,5 **** ! /* $Id: istream.c,v 1.15 2002/09/28 16:30:07 ukai Exp $ */ #include "fm.h" #include "istream.h" #include #ifdef USE_SSL --- 1,6 ---- ! /* $Id: istream.c,v 1.20 2003/01/20 15:25:30 ukai Exp $ */ #include "fm.h" + #include "myctype.h" #include "istream.h" #include #ifdef USE_SSL *************** *** 175,189 **** return stream; } ! void ISclose(InputStream stream) { MySignalHandler(*prevtrap) (); ! if (stream == NULL || stream->base.close == NULL) ! return; prevtrap = signal(SIGINT, SIG_IGN); stream->base.close(stream->base.handle); signal(SIGINT, prevtrap); } int --- 176,192 ---- return stream; } ! int ISclose(InputStream stream) { MySignalHandler(*prevtrap) (); ! if (stream == NULL || stream->base.close == NULL || ! stream->base.type & IST_UNCLOSE) ! return -1; prevtrap = signal(SIGINT, SIG_IGN); stream->base.close(stream->base.handle); signal(SIGINT, prevtrap); + return 0; } int *************** *** 335,345 **** { if (stream == NULL) return -1; ! switch (IStype(stream)) { case IST_BASIC: return *(int *)stream->base.handle; case IST_FILE: return fileno(stream->file.handle->f); case IST_ENCODED: return ISfileno(stream->ens.handle->is); default: --- 338,352 ---- { if (stream == NULL) return -1; ! switch (IStype(stream) & ~IST_UNCLOSE) { case IST_BASIC: return *(int *)stream->base.handle; case IST_FILE: return fileno(stream->file.handle->f); + #ifdef USE_SSL + case IST_SSL: + return stream->ssl.handle->sock; + #endif case IST_ENCODED: return ISfileno(stream->ens.handle->is); default: *************** *** 443,449 **** } } method = X509V3_EXT_get(ex); ! method->ext_free(alt); if (i < n) /* Found a match */ match_ident = TRUE; else if (seen_dnsname) --- 450,456 ---- } } method = X509V3_EXT_get(ex); ! sk_GENERAL_NAME_free(alt); if (i < n) /* Found a match */ match_ident = TRUE; else if (seen_dnsname) *************** *** 494,500 **** emsg = Strnew_charp("No SSL peer certificate: accept? (y/n)"); ans = inputAnswer(emsg->ptr); } ! if (ans && tolower(*ans) == 'y') amsg = Strnew_charp ("Accept SSL session without any peer certificate"); else { --- 501,507 ---- emsg = Strnew_charp("No SSL peer certificate: accept? (y/n)"); ans = inputAnswer(emsg->ptr); } ! if (ans && TOLOWER(*ans) == 'y') amsg = Strnew_charp ("Accept SSL session without any peer certificate"); else { *************** *** 527,533 **** emsg = Sprintf("%s: accept? (y/n)", em); ans = inputAnswer(emsg->ptr); } ! if (ans && tolower(*ans) == 'y') { amsg = Sprintf("Accept unsecure SSL session: " "unverified: %s", em); } --- 534,540 ---- emsg = Sprintf("%s: accept? (y/n)", em); ans = inputAnswer(emsg->ptr); } ! if (ans && TOLOWER(*ans) == 'y') { amsg = Sprintf("Accept unsecure SSL session: " "unverified: %s", em); } *************** *** 553,559 **** Strcat_charp(ep, ": accept? (y/n)"); ans = inputAnswer(ep->ptr); } ! if (ans && tolower(*ans) == 'y') { amsg = Strnew_charp("Accept unsecure SSL session:"); Strcat(amsg, emsg); } --- 560,566 ---- Strcat_charp(ep, ": accept? (y/n)"); ans = inputAnswer(ep->ptr); } ! if (ans && TOLOWER(*ans) == 'y') { amsg = Strnew_charp("Accept unsecure SSL session:"); Strcat(amsg, emsg); } *************** *** 577,583 **** Strcat_m_charp(s, " subject=", buf, NULL); xn = X509_get_issuer_name(x); if (X509_NAME_get_text_by_NID(xn, NID_commonName, buf, sizeof(buf)) == -1) ! Strcat_charp(s, ": issuer="); else Strcat_m_charp(s, ": issuer=", buf, NULL); Strcat_charp(s, "\n\n"); --- 584,590 ---- Strcat_m_charp(s, " subject=", buf, NULL); xn = X509_get_issuer_name(x); if (X509_NAME_get_text_by_NID(xn, NID_commonName, buf, sizeof(buf)) == -1) ! Strcat_charp(s, ": issuer="); else Strcat_m_charp(s, ": issuer=", buf, NULL); Strcat_charp(s, "\n\n"); diff -crN -x CVS w3m-0.3.2.2/istream.h w3m-js-1.743/istream.h *** w3m-0.3.2.2/istream.h 2002-09-29 01:30:07.000000000 +0900 --- w3m-js-1.743/istream.h 2003-01-11 11:38:47.000000000 +0900 *************** *** 1,4 **** ! /* $Id: istream.h,v 1.9 2002/09/28 16:30:07 ukai Exp $ */ #ifndef IO_STREAM_H #define IO_STREAM_H --- 1,4 ---- ! /* $Id: istream.h,v 1.10 2003/01/10 17:06:24 ukai Exp $ */ #ifndef IO_STREAM_H #define IO_STREAM_H *************** *** 116,122 **** extern InputStream newSSLStream(SSL * ssl, int sock); #endif extern InputStream newEncodedStream(InputStream is, char encoding); ! extern void ISclose(InputStream stream); extern int ISgetc(InputStream stream); extern int ISundogetc(InputStream stream); extern Str StrISgets(InputStream stream); --- 116,122 ---- extern InputStream newSSLStream(SSL * ssl, int sock); #endif extern InputStream newEncodedStream(InputStream is, char encoding); ! extern int ISclose(InputStream stream); extern int ISgetc(InputStream stream); extern int ISundogetc(InputStream stream); extern Str StrISgets(InputStream stream); *************** *** 134,139 **** --- 134,140 ---- #define IST_STR 2 #define IST_SSL 3 #define IST_ENCODED 4 + #define IST_UNCLOSE 0x10 #define IStype(stream) ((stream)->base.type) #define is_eos(stream) ISeos(stream) diff -crN -x CVS w3m-0.3.2.2/js_html.c w3m-js-1.743/js_html.c *** w3m-0.3.2.2/js_html.c 1970-01-01 09:00:00.000000000 +0900 --- w3m-js-1.743/js_html.c 2003-02-08 02:38:49.000000000 +0900 *************** *** 0 **** --- 1,779 ---- + #include "fm.h" + #ifdef USE_JAVASCRIPT + #include "js_html.h" + #include + + static JSMethodResult + window_new(JSClassPtr cls, JSInterpPtr interp, int argc, JSType *argv, + void **ictx_return, JSFreeProc *ictx_destructor_return, + char *error_return) + { + WindowCtx *ictx; + + ictx = (WindowCtx *)GC_MALLOC(sizeof(WindowCtx)); + ictx->win = newGeneralList(); + ictx->close = FALSE; + *ictx_return = ictx; + *ictx_destructor_return = NULL; + return JS_OK; + } + + static JSMethodResult + window_open(JSClassPtr cls, void *instance_context, JSInterpPtr interp, + int argc, JSType *argv, JSType *result_return, char *error_return) + { + WindowCtx *ictx = (WindowCtx *)instance_context; + jse_windowopen_t *w; + + if (! ictx && !(ictx = js_class_context(cls))) + return JS_ERROR; + + if (argc <= 1) + return JS_ERROR; + + if (argv[0].type != JS_TYPE_STRING || argv[1].type != JS_TYPE_STRING) + return JS_ERROR; + + w = (jse_windowopen_t *)GC_MALLOC(sizeof(jse_windowopen_t)); + w->url = allocStr(argv[0].u.s->data, argv[0].u.s->len); + w->name = allocStr(argv[1].u.s->data, argv[1].u.s->len); + pushValue(ictx->win, (void *)w); + + return JS_OK; + } + + static JSMethodResult + window_close(JSClassPtr cls, void *instance_context, JSInterpPtr interp, + int argc, JSType *argv, JSType *result_return, char *error_return) + { + WindowCtx *ictx = (WindowCtx *)instance_context; + + if (! ictx && !(ictx = js_class_context(cls))) + return JS_ERROR; + + ictx->close = TRUE; + + return JS_OK; + } + + static JSMethodResult + location_new(JSClassPtr cls, JSInterpPtr interp, int argc, JSType *argv, + void **ictx_return, JSFreeProc *ictx_destructor_return, + char *error_return) + { + LocationCtx *ictx; + + ictx = (LocationCtx *)GC_MALLOC(sizeof(LocationCtx)); + bzero(ictx, sizeof(LocationCtx)); + if (argc > 0 && argv[0].type == JS_TYPE_STRING) { + ictx->url = Strnew_charp_n(argv[0].u.s->data, argv[0].u.s->len); + parseURL(ictx->url->ptr, &ictx->pu, NULL); + } else { + ictx->url = Strnew(); + } + ictx->refresh = 0; + *ictx_return = ictx; + *ictx_destructor_return = NULL; + return JS_OK; + } + + static JSMethodResult + location_replace(JSClassPtr cls, void *instance_context, JSInterpPtr interp, + int argc, JSType *argv, JSType *result_return, char *error_return) + { + LocationCtx *ictx = (LocationCtx *)instance_context; + + if (! ictx && !(ictx = js_class_context(cls))) + return JS_ERROR; + + if (argc != 1) + return JS_ERROR; + + if (argv[0].type != JS_TYPE_STRING) + return JS_ERROR; + + ictx->url = Strnew_charp_n(argv[0].u.s->data, argv[0].u.s->len); + parseURL(ictx->url->ptr, &ictx->pu, NULL); + ictx->refresh |= JS_LOC_REFRESH; + + return JS_OK; + } + + static JSMethodResult + location_reload(JSClassPtr cls, void *instance_context, JSInterpPtr interp, + int argc, JSType *argv, JSType *result_return, char *error_return) + { + LocationCtx *ictx = (LocationCtx *)instance_context; + + if (! ictx && !(ictx = js_class_context(cls))) + return JS_ERROR; + + if (argc != 0) + return JS_ERROR; + + ictx->refresh |= JS_LOC_REFRESH; + return JS_OK; + } + + static JSMethodResult + location_href(JSClassPtr cls, void *instance_context, + JSInterpPtr interp, int setp, JSType *value, char *error_return) + { + LocationCtx *ictx = (LocationCtx *)instance_context; + if (! ictx && !(ictx = js_class_context(cls))) + return JS_ERROR; + + if (setp) { + if (value->type != JS_TYPE_STRING) + return JS_ERROR; + ictx->url = Strnew_charp_n(value->u.s->data, value->u.s->len); + parseURL(ictx->url->ptr, &ictx->pu, NULL); + ictx->refresh |= JS_LOC_REFRESH; + } else { + js_type_make_string(interp, value, ictx->url->ptr, ictx->url->length); + } + + return JS_OK; + } + + static JSMethodResult + location_protocol(JSClassPtr cls, void *instance_context, + JSInterpPtr interp, int setp, JSType *value, char *error_return) + { + LocationCtx *ictx = (LocationCtx *)instance_context; + Str s; + char *p; + + if (! ictx && !(ictx = js_class_context(cls))) + return JS_ERROR; + + if (setp) { + if (value->type != JS_TYPE_STRING) + return JS_ERROR; + s = Strnew_charp_n(value->u.s->data, value->u.s->len); + Strcat_charp(s, ":"); + p = allocStr(s->ptr, s->length); + ictx->pu.scheme = getURLScheme(&p); + ictx->url = parsedURL2Str(&ictx->pu); + fprintf(stderr, "*****URL:%s\n", ictx->url->ptr); + ictx->refresh |= JS_LOC_REFRESH; + } else { + s = Strnew(); + switch (ictx->pu.scheme) { + case SCM_HTTP: + Strcat_charp(s, "http:"); + break; + case SCM_GOPHER: + Strcat_charp(s, "gopher:"); + break; + case SCM_FTP: + Strcat_charp(s, "ftp:"); + break; + case SCM_LOCAL: + Strcat_charp(s, "file:"); + break; + case SCM_NNTP: + Strcat_charp(s, "nntp:"); + break; + case SCM_NEWS: + Strcat_charp(s, "news:"); + break; + #ifndef USE_W3MMAILER + case SCM_MAILTO: + Strcat_charp(s, "mailto:"); + break; + #endif + #ifdef USE_SSL + case SCM_HTTPS: + Strcat_charp(s, "https:"); + break; + #endif + case SCM_JAVASCRIPT: + Strcat_charp(s, "javascript:"); + break; + default: + break; + } + js_type_make_string(interp, value, s->ptr, s->length); + } + + return JS_OK; + } + + static JSMethodResult + location_host(JSClassPtr cls, void *instance_context, + JSInterpPtr interp, int setp, JSType *value, char *error_return) + { + LocationCtx *ictx = (LocationCtx *)instance_context; + Str s; + char *p, *q; + + if (! ictx && !(ictx = js_class_context(cls))) + return JS_ERROR; + + if (setp) { + if (value->type != JS_TYPE_STRING) + return JS_ERROR; + p = allocStr(value->u.s->data, value->u.s->len); + if ((q = strchr(p, ':')) != NULL) { + *q++ = '\0'; + ictx->pu.port = atoi(q); + ictx->pu.has_port = 1; + } + ictx->pu.host = Strnew_charp(p)->ptr; + ictx->url = parsedURL2Str(&ictx->pu); + ictx->refresh |= JS_LOC_REFRESH; + } else { + s = Strnew(); + if (ictx->pu.host) { + Strcat_charp_n(s, ictx->pu.host, strlen(ictx->pu.host)); + if (ictx->pu.has_port) + Strcat(s, Sprintf(":%d", ictx->pu.port)); + } + js_type_make_string(interp, value, s->ptr, s->length); + } + + return JS_OK; + } + + static JSMethodResult + location_hostname(JSClassPtr cls, void *instance_context, + JSInterpPtr interp, int setp, JSType *value, char *error_return) + { + LocationCtx *ictx = (LocationCtx *)instance_context; + Str s; + + if (! ictx && !(ictx = js_class_context(cls))) + return JS_ERROR; + + if (setp) { + if (value->type != JS_TYPE_STRING) + return JS_ERROR; + ictx->pu.host = allocStr(value->u.s->data, value->u.s->len); + ictx->url = parsedURL2Str(&ictx->pu); + ictx->refresh |= JS_LOC_REFRESH; + } else { + s = Strnew(); + if (ictx->pu.host) { + Strcat_charp_n(s, ictx->pu.host, strlen(ictx->pu.host)); + } + js_type_make_string(interp, value, s->ptr, s->length); + } + + return JS_OK; + } + + static JSMethodResult + location_port(JSClassPtr cls, void *instance_context, + JSInterpPtr interp, int setp, JSType *value, char *error_return) + { + LocationCtx *ictx = (LocationCtx *)instance_context; + Str s; + + if (! ictx && !(ictx = js_class_context(cls))) + return JS_ERROR; + + if (setp) { + switch (value->type) { + case JS_TYPE_INTEGER: + ictx->pu.port = value->u.i; + break; + case JS_TYPE_DOUBLE: + ictx->pu.port = (int)value->u.d; + break; + case JS_TYPE_STRING: + ictx->pu.port = atoi(value->u.s->data); + break; + default: + return JS_ERROR; + } + ictx->url = parsedURL2Str(&ictx->pu); + ictx->refresh |= JS_LOC_REFRESH; + } else { + if (ictx->pu.has_port) + s = Sprintf("%d", ictx->pu.port); + else + s = Strnew(); + js_type_make_string(interp, value, s->ptr, s->length); + } + + return JS_OK; + } + + static JSMethodResult + location_pathname(JSClassPtr cls, void *instance_context, + JSInterpPtr interp, int setp, JSType *value, char *error_return) + { + LocationCtx *ictx = (LocationCtx *)instance_context; + Str s; + + if (! ictx && !(ictx = js_class_context(cls))) + return JS_ERROR; + + if (setp) { + if (value->type != JS_TYPE_STRING) + return JS_ERROR; + ictx->pu.file = allocStr(value->u.s->data, value->u.s->len); + ictx->url = parsedURL2Str(&ictx->pu); + ictx->refresh |= JS_LOC_REFRESH; + } else { + s = Strnew(); + if (ictx->pu.file) { + Strcat_charp_n(s, ictx->pu.file, strlen(ictx->pu.file)); + } + js_type_make_string(interp, value, s->ptr, s->length); + } + + return JS_OK; + } + + static JSMethodResult + location_search(JSClassPtr cls, void *instance_context, + JSInterpPtr interp, int setp, JSType *value, char *error_return) + { + LocationCtx *ictx = (LocationCtx *)instance_context; + Str s; + + if (! ictx && !(ictx = js_class_context(cls))) + return JS_ERROR; + + if (setp) { + if (value->type != JS_TYPE_STRING) + return JS_ERROR; + ictx->pu.query = allocStr(value->u.s->data, value->u.s->len); + ictx->url = parsedURL2Str(&ictx->pu); + ictx->refresh |= JS_LOC_REFRESH; + } else { + s = Strnew(); + if (ictx->pu.query) { + Strcat_charp(s, "?"); + Strcat_charp_n(s, ictx->pu.query, strlen(ictx->pu.query)); + } + js_type_make_string(interp, value, s->ptr, s->length); + } + + return JS_OK; + } + + static JSMethodResult + location_hash(JSClassPtr cls, void *instance_context, + JSInterpPtr interp, int setp, JSType *value, char *error_return) + { + LocationCtx *ictx = (LocationCtx *)instance_context; + Str s; + + if (! ictx && !(ictx = js_class_context(cls))) + return JS_ERROR; + + if (setp) { + if (value->type != JS_TYPE_STRING) + return JS_ERROR; + ictx->pu.label = allocStr(value->u.s->data, value->u.s->len); + ictx->url = parsedURL2Str(&ictx->pu); + ictx->refresh |= JS_LOC_HASH; + } else { + s = Strnew(); + if (ictx->pu.label) { + Strcat_charp(s, "#"); + Strcat_charp_n(s, ictx->pu.label, strlen(ictx->pu.label)); + } + js_type_make_string(interp, value, s->ptr, s->length); + } + + return JS_OK; + } + + static JSMethodResult + cookie_new(JSClassPtr cls, JSInterpPtr interp, int argc, JSType *argv, + void **ictx_return, JSFreeProc *ictx_destructor_return, + char *error_return) + { + *ictx_destructor_return = NULL; + return JS_OK; + } + + static JSMethodResult + image_new(JSClassPtr cls, JSInterpPtr interp, int argc, JSType *argv, + void **ictx_return, JSFreeProc *ictx_destructor_return, + char *error_return) + { + *ictx_destructor_return = NULL; + return JS_OK; + } + + static JSMethodResult + formitem_new(JSClassPtr cls, JSInterpPtr interp, int argc, JSType *argv, + void **ictx_return, JSFreeProc *ictx_destructor_return, + char *error_return) + { + *ictx_destructor_return = NULL; + return JS_OK; + } + + static JSMethodResult + form_new(JSClassPtr cls, JSInterpPtr interp, int argc, JSType *argv, + void **ictx_return, JSFreeProc *ictx_destructor_return, + char *error_return) + { + *ictx_destructor_return = NULL; + return JS_OK; + } + + static JSMethodResult + form_submit(JSClassPtr cls, void *instance_context, JSInterpPtr interp, + int argc, JSType *argv, JSType *result_return, char *error_return) + { + /* TODO: form submit flag on */ + return JS_OK; + } + + static JSMethodResult + form_reset(JSClassPtr cls, void *instance_context, JSInterpPtr interp, + int argc, JSType *argv, JSType *result_return, char *error_return) + { + /* TODO: form reset flag on */ + return JS_OK; + } + + static JSMethodResult + anchor_new(JSClassPtr cls, JSInterpPtr interp, int argc, JSType *argv, + void **ictx_return, JSFreeProc *ictx_destructor_return, + char *error_return) + { + *ictx_destructor_return = NULL; + return JS_OK; + } + + static JSMethodResult + history_new(JSClassPtr cls, JSInterpPtr interp, int argc, JSType *argv, + void **ictx_return, JSFreeProc *ictx_destructor_return, + char *error_return) + { + HistoryCtx *ictx; + + ictx = (HistoryCtx *)GC_MALLOC(sizeof(HistoryCtx)); + ictx->pos = 0; + *ictx_return = ictx; + *ictx_destructor_return = NULL; /* TODO: GC_free() ? */ + return JS_OK; + } + + static JSMethodResult + history_back(JSClassPtr cls, void *instance_context, JSInterpPtr interp, + int argc, JSType *argv, JSType *result_return, char *error_return) + { + HistoryCtx *ictx = (HistoryCtx *)instance_context; + + if (! ictx && !(ictx = js_class_context(cls))) + return JS_ERROR; + + ictx->pos = -1; + + return JS_OK; + } + + static JSMethodResult + history_forward(JSClassPtr cls, void *instance_context, JSInterpPtr interp, + int argc, JSType *argv, JSType *result_return, char *error_return) + { + HistoryCtx *ictx = (HistoryCtx *)instance_context; + + if (! ictx && !(ictx = js_class_context(cls))) + return JS_ERROR; + + ictx->pos = 1; + + return JS_OK; + } + + static JSMethodResult + history_go(JSClassPtr cls, void *instance_context, JSInterpPtr interp, + int argc, JSType *argv, JSType *result_return, char *error_return) + { + HistoryCtx *ictx = (HistoryCtx *)instance_context; + int i; + + if (! ictx && !(ictx = js_class_context(cls))) + return JS_ERROR; + + if (argc != 1) + return JS_OK; + + switch (argv[0].type) { + case JS_TYPE_INTEGER: + ictx->pos = argv[0].u.i; + break; + case JS_TYPE_DOUBLE: + ictx->pos = (int)argv[0].u.d; + break; + } + + return JS_OK; + } + + static JSMethodResult + navigator_new(JSClassPtr cls, JSInterpPtr interp, int argc, JSType *argv, + void **ictx_return, JSFreeProc *ictx_destructor_return, + char *error_return) + { + NavigatorCtx *ictx; + + ictx = (NavigatorCtx *)GC_MALLOC(sizeof(NavigatorCtx)); + ictx->appcodename = NULL; + ictx->appname = NULL; + ictx->appversion = NULL; + ictx->useragent = NULL; + *ictx_return = ictx; + *ictx_destructor_return = NULL; /* TODO: GC_free() ? */ + return JS_OK; + } + + static JSMethodResult + navigator_appcodename(JSClassPtr cls, void *instance_context, + JSInterpPtr interp, int setp, JSType *value, char *error_return) + { + NavigatorCtx *ictx = (NavigatorCtx *)instance_context; + if (! ictx && !(ictx = js_class_context(cls))) + return JS_ERROR; + + if (setp) + return JS_ERROR; /* Forbidden */ + + if (! ictx->appcodename) + ictx->appcodename = Strnew_charp("w3m"); + + js_type_make_string(interp, value, + ictx->appcodename->ptr, ictx->appcodename->length); + + return JS_OK; + } + + static JSMethodResult + navigator_appname(JSClassPtr cls, void *instance_context, + JSInterpPtr interp, int setp, JSType *value, char *error_return) + { + NavigatorCtx *ictx = (NavigatorCtx *)instance_context; + if (! ictx && !(ictx = js_class_context(cls))) + return JS_ERROR; + + if (setp) + return JS_ERROR; /* Forbidden */ + + if (! ictx->appname) + ictx->appname = Strnew_charp("w3m"); + + js_type_make_string(interp, value, + ictx->appname->ptr, ictx->appname->length); + + return JS_OK; + } + + static JSMethodResult + navigator_appversion(JSClassPtr cls, void *instance_context, + JSInterpPtr interp, int setp, JSType *value, char *error_return) + { + NavigatorCtx *ictx = (NavigatorCtx *)instance_context; + #if LANG == JA + const char *lang = "ja-JP"; + #else + const char *lang = "en-US"; + #endif + char *platform; + struct utsname unamebuf; + char *p; + int n; + + if (! ictx && !(ictx = js_class_context(cls))) + return JS_ERROR; + + if (setp) + return JS_ERROR; /* Forbidden */ + + if (! ictx->appversion) { + if (uname(&unamebuf) == -1) { + platform = "Unknown"; + } else { + platform = unamebuf.sysname; + } + p = strchr(w3m_version, '/'); + if (p != NULL) { + p++; + n = strspn(p, "0123456789."); + if (n > 0) { + Str rnum = Strnew(); + Strcopy_charp_n(rnum, p, n); + ictx->appversion = Sprintf("%s (%s; %s)", rnum->ptr, platform, lang); + Strfree(rnum); + } + } + } + + js_type_make_string(interp, value, + ictx->appversion->ptr, ictx->appversion->length); + + return JS_OK; + } + + static JSMethodResult + navigator_useragent(JSClassPtr cls, void *instance_context, + JSInterpPtr interp, int setp, JSType *value, char *error_return) + { + NavigatorCtx *ictx = (NavigatorCtx *)instance_context; + if (! ictx && !(ictx = js_class_context(cls))) + return JS_ERROR; + + if (setp) + return JS_ERROR; /* Forbidden */ + + if (! ictx->useragent) { + if (UserAgent == NULL || *UserAgent == '\0') + ictx->useragent = Strnew_charp(w3m_version); + else + ictx->useragent = Strnew_charp(UserAgent); + } + + js_type_make_string(interp, value, + ictx->useragent->ptr, ictx->useragent->length); + + return JS_OK; + } + + static JSMethodResult + document_new(JSClassPtr cls, JSInterpPtr interp, int argc, JSType *argv, + void **ictx_return, JSFreeProc *ictx_destructor_return, + char *error_return) + { + DocumentCtx *ictx; + + ictx = (DocumentCtx *)GC_MALLOC(sizeof(DocumentCtx)); + ictx->write = NULL; + *ictx_return = ictx; + *ictx_destructor_return = NULL; + return JS_OK; + } + + static JSMethodResult + document_write(JSClassPtr cls, void *instance_context, JSInterpPtr interp, + int argc, JSType *argv, JSType *result_return, char *error_return) + { + DocumentCtx *ictx = (DocumentCtx *)instance_context; + JSType *a; + int i; + + if (! ictx) + return JS_ERROR; + + if (! ictx->write) + ictx->write = Strnew(); + for (i = 0; i < argc; i++) { + a = &argv[i]; + switch (a->type) { + case JS_TYPE_BOOLEAN: + Strcat_charp(ictx->write, a->u.d ? "true" : "false"); + break; + case JS_TYPE_INTEGER: + Strcat(ictx->write, Sprintf("%d", a->u.i)); + break; + case JS_TYPE_DOUBLE: + Strcat(ictx->write, Sprintf("%.21g", a->u.d)); + break; + case JS_TYPE_STRING: + Strcat_charp_n(ictx->write, a->u.s->data, a->u.s->len); + break; + default: + break; + } + } + return JS_OK; + } + + static JSMethodResult + document_writeln(JSClassPtr cls, void *instance_context, JSInterpPtr interp, + int argc, JSType *argv, JSType *result_return, char *error_return) + { + DocumentCtx *ictx = (DocumentCtx *)instance_context; + JSType *a; + int i; + + if (! ictx) + return JS_ERROR; + + document_write(cls, instance_context, interp, + argc, argv, result_return, error_return); + Strcat_charp(ictx->write, "\n"); + + return JS_OK; + } + + JSInterpPtr + js_html_init(void) + { + JSInterpPtr interp; + JSClassPtr window_cls; + JSClassPtr document_cls, navigator_cls, history_cls; + JSClassPtr anchor_cls, form_cls, formitem_cls, image_cls; + JSClassPtr cookie_cls, location_cls; + + interp = js_create_interp(NULL); + + window_cls = js_class_create("(Window)", NULL, 0, window_new); + js_class_define_method(window_cls, "open", JS_CF_STATIC, window_open); + js_class_define_method(window_cls, "close", JS_CF_STATIC, window_close); + js_define_class(interp, window_cls, "Window"); + + document_cls = js_class_create("(Document)", NULL, 0, document_new); + js_class_define_method(document_cls, "write", JS_CF_STATIC, document_write); + js_class_define_method(document_cls, "writeln", JS_CF_STATIC, document_writeln); + js_define_class(interp, document_cls, "Document"); + + navigator_cls = js_class_create("(Navigator)", NULL, 0, navigator_new); + js_class_define_property(navigator_cls, "appCodeName", + JS_CF_STATIC|JS_CF_IMMUTABLE, navigator_appcodename); + js_class_define_property(navigator_cls, "appName", + JS_CF_STATIC|JS_CF_IMMUTABLE, navigator_appname); + js_class_define_property(navigator_cls, "appVersion", + JS_CF_STATIC|JS_CF_IMMUTABLE, navigator_appversion); + js_class_define_property(navigator_cls, "userAgent", + JS_CF_STATIC|JS_CF_IMMUTABLE, navigator_useragent); + js_define_class(interp, navigator_cls, "Navigator"); + + history_cls = js_class_create("(History)", NULL, 0, history_new); + js_class_define_method(history_cls, "back", JS_CF_STATIC, history_back); + js_class_define_method(history_cls, "forward", + JS_CF_STATIC, history_forward); + js_class_define_method(history_cls, "go", JS_CF_STATIC, history_go); + js_define_class(interp, history_cls, "History"); + + anchor_cls = js_class_create("(Anchor)", NULL, 0, anchor_new); + js_define_class(interp, anchor_cls, "Anchor"); + + form_cls = js_class_create("(Form)", NULL, 0, form_new); + js_class_define_method(form_cls, "submit", JS_CF_STATIC, form_submit); + js_class_define_method(form_cls, "reset", JS_CF_STATIC, form_reset); + js_define_class(interp, form_cls, "Form"); + + formitem_cls = js_class_create("(FormItem)", NULL, 0, formitem_new); + js_define_class(interp, formitem_cls, "FormItem"); + + image_cls = js_class_create("(Image)", NULL, 0, image_new); + js_define_class(interp, image_cls, "Image"); + + cookie_cls = js_class_create("(Cookie)", NULL, 0, cookie_new); + js_define_class(interp, cookie_cls, "Cookie"); + + location_cls = js_class_create("(Location)", NULL, 0, location_new); + js_class_define_method(location_cls, "replace", JS_CF_STATIC, location_replace); + js_class_define_method(location_cls, "reload", JS_CF_STATIC, location_reload); + js_class_define_property(location_cls, "href", JS_CF_STATIC, location_href); + js_class_define_property(location_cls, "protocol", JS_CF_STATIC, location_protocol); + js_class_define_property(location_cls, "host", JS_CF_STATIC, location_host); + js_class_define_property(location_cls, "hostname", JS_CF_STATIC, location_hostname); + js_class_define_property(location_cls, "port", JS_CF_STATIC, location_port); + js_class_define_property(location_cls, "pathname", JS_CF_STATIC, location_pathname); + js_class_define_property(location_cls, "search", JS_CF_STATIC, location_search); + js_class_define_property(location_cls, "hash", JS_CF_STATIC, location_hash); + js_define_class(interp, location_cls, "Location"); + + return interp; + } + #endif diff -crN -x CVS w3m-0.3.2.2/js_html.h w3m-js-1.743/js_html.h *** w3m-0.3.2.2/js_html.h 1970-01-01 09:00:00.000000000 +0900 --- w3m-js-1.743/js_html.h 2003-02-08 02:38:49.000000000 +0900 *************** *** 0 **** --- 1,82 ---- + #ifndef JS_HTML_H + #define JS_HTML_H + + #ifdef HAVE_NJS + + /* for NJS 0.3.0 or later. */ + #include + + #define JSType NJSValue + #define JSInterpPtr NJSInterpPtr + #define JSClassPtr NJSClassPtr + #define JSFreeProc NJSFreeProc + #define JSMethodResult NJSMethodResult + + #define JS_ERROR NJS_ERROR + #define JS_OK NJS_OK + + #define JS_TYPE_STRING NJS_VALUE_STRING + #define JS_TYPE_BOOLEAN NJS_VALUE_BOOLEAN + #define JS_TYPE_DOUBLE NJS_VALUE_DOUBLE + #define JS_TYPE_INTEGER NJS_VALUE_INTEGER + + #define JS_CF_STATIC NJS_CF_STATIC + #define JS_CF_IMMUTABLE NJS_CF_IMMUTABLE + + #define js_eval njs_eval + #define js_result njs_result + #define js_create_interp njs_create_interp + #define js_destroy_interp njs_destroy_interp + #define js_class_context njs_class_context + #define js_class_create njs_class_create + #define js_define_class njs_define_class + #define js_lookup_class njs_lookup_class + #define js_class_define_method njs_class_define_method + #define js_class_define_property njs_class_define_property + #define js_type_make_string njs_type_make_string + #define js_type_make_array njs_type_make_array + #define js_isa njs_isa + + #else /* HAVE_NJS */ + + /* for NJS 0.2.5. */ + #include + + #endif + + typedef struct jse_windowopen { + char *url; + char *name; + } jse_windowopen_t; + + typedef struct window_ctx_st { + GeneralList *win; + int close; + } WindowCtx; + + typedef struct document_ctx_st { + Str write; + } DocumentCtx; + + typedef struct navigator_ctx_st { + Str appcodename; + Str appname; + Str appversion; + Str useragent; + } NavigatorCtx; + + typedef struct history_ctx_st { + int pos; + } HistoryCtx; + + typedef struct location_ctx_st { + Str url; + ParsedURL pu; + int refresh; + #define JS_LOC_REFRESH 1 + #define JS_LOC_HASH 2 + } LocationCtx; + + extern JSInterpPtr js_html_init(void); + + #endif diff -crN -x CVS w3m-0.3.2.2/keybind.c w3m-js-1.743/keybind.c *** w3m-0.3.2.2/keybind.c 2002-09-06 00:43:21.000000000 +0900 --- w3m-js-1.743/keybind.c 2002-12-13 22:15:53.000000000 +0900 *************** *** 1,7 **** ! /* $Id: keybind.c,v 1.7 2002/09/05 15:43:21 ukai Exp $ */ #include "funcname2.h" ! char GlobalKeymap[128] = { /* C-@ C-a C-b C-c C-d C-e C-f C-g */ #ifdef __EMX__ pcmap, linbeg, movL, nulcmd, nulcmd, linend, movR, curlno, --- 1,7 ---- ! /* $Id: keybind.c,v 1.9 2002/12/13 03:02:03 ukai Exp $ */ #include "funcname2.h" ! unsigned char GlobalKeymap[128] = { /* C-@ C-a C-b C-c C-d C-e C-f C-g */ #ifdef __EMX__ pcmap, linbeg, movL, nulcmd, nulcmd, linend, movR, curlno, *************** *** 11,46 **** /* C-h C-i C-j C-k C-l C-m C-n C-o */ ldHist, nextA, followA, cooLst, rdrwSc, followA, movD, nulcmd, /* C-p C-q C-r C-s C-t C-u C-v C-w */ ! movU, nulcmd, isrchbak, isrchfor, nulcmd, prevA, pgFore, wrapToggle, /* C-x C-y C-z C-[ C-\ C-] C-^ C-_ */ nulcmd, nulcmd, susp, escmap, nulcmd, nulcmd, nulcmd, nulcmd, /* SPC ! " # $ % & ' */ pgFore, execsh, reMark, pipesh, linend, nulcmd, nulcmd, nulcmd, /* ( ) * + , - . / */ ! nulcmd, nulcmd, nulcmd, nulcmd, col1L, nulcmd, col1R, srchfor, /* 0 1 2 3 4 5 6 7 */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* 8 9 : ; < = > ? */ nulcmd, nulcmd, chkURL, chkWORD, shiftl, pginfo, shiftr, srchbak, /* @ A B C D E F G */ ! readsh, nulcmd, backBf, nulcmd, nulcmd, editBf, rFrame, goLineL, /* H I J K L M N O */ ! ldhelp, followI, lup1, ldown1, nulcmd, extbrz, srchprv, nulcmd, /* P Q R S T U V W */ ! nulcmd, quitfm, reload, svBuf, nulcmd, goURL, ldfile, movLW, /* X Y Z [ \ ] ^ _ */ nulcmd, nulcmd, ctrCsrH, topA, nulcmd, lastA, linbeg, nulcmd, /* ` a b c d e f g */ nulcmd, svA, pgBack, curURL, nulcmd, nulcmd, nulcmd, goLineF, /* h i j k l m n o */ ! movL, peekIMG, movD, movU, movR, nulcmd, srchnxt, ldOpt, /* p q r s t u v w */ ! nulcmd, qquitfm, nulcmd, selMn, nulcmd, peekURL, vwSrc, movRW, /* x y z { | } ~ DEL */ ! nulcmd, nulcmd, ctrCsrV, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, }; ! char EscKeymap[128] = { /* C-@ C-a C-b C-c C-d C-e C-f C-g */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* C-h C-i C-j C-k C-l C-m C-n C-o */ --- 11,46 ---- /* C-h C-i C-j C-k C-l C-m C-n C-o */ ldHist, nextA, followA, cooLst, rdrwSc, followA, movD, nulcmd, /* C-p C-q C-r C-s C-t C-u C-v C-w */ ! movU, closeT, isrchbak, isrchfor, tabA, prevA, pgFore, wrapToggle, /* C-x C-y C-z C-[ C-\ C-] C-^ C-_ */ nulcmd, nulcmd, susp, escmap, nulcmd, nulcmd, nulcmd, nulcmd, /* SPC ! " # $ % & ' */ pgFore, execsh, reMark, pipesh, linend, nulcmd, nulcmd, nulcmd, /* ( ) * + , - . / */ ! undoPos, redoPos, nulcmd, pgFore, col1L, pgBack, col1R, srchfor, /* 0 1 2 3 4 5 6 7 */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* 8 9 : ; < = > ? */ nulcmd, nulcmd, chkURL, chkWORD, shiftl, pginfo, shiftr, srchbak, /* @ A B C D E F G */ ! readsh, nulcmd, backBf, nulcmd, ldDL, editBf, rFrame, goLineL, /* H I J K L M N O */ ! ldhelp, followI, lup1, ldown1, linkLst, extbrz, srchprv, nulcmd, /* P Q R S T U V W */ ! nulcmd, quitfm, reload, svBuf, newT, goURL, ldfile, movLW, /* X Y Z [ \ ] ^ _ */ nulcmd, nulcmd, ctrCsrH, topA, nulcmd, lastA, linbeg, nulcmd, /* ` a b c d e f g */ nulcmd, svA, pgBack, curURL, nulcmd, nulcmd, nulcmd, goLineF, /* h i j k l m n o */ ! movL, peekIMG, movD, movU, movR, msToggle, srchnxt, ldOpt, /* p q r s t u v w */ ! nulcmd, qquitfm, dispVer, selMn, nulcmd, peekURL, vwSrc, movRW, /* x y z { | } ~ DEL */ ! nulcmd, nulcmd, ctrCsrV, prevT, pipeBuf, nextT, nulcmd, nulcmd, }; ! unsigned char EscKeymap[128] = { /* C-@ C-a C-b C-c C-d C-e C-f C-g */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* C-h C-i C-j C-k C-l C-m C-n C-o */ *************** *** 66,81 **** /* X Y Z [ \ ] ^ _ */ nulcmd, nulcmd, nulcmd, escbmap, nulcmd, nulcmd, nulcmd, nulcmd, /* ` a b c d e f g */ ! nulcmd, adBmark, ldBmark, nulcmd, nulcmd, editScr, nulcmd, goLine, /* h i j k l m n o */ ! nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nextMk, nulcmd, /* p q r s t u v w */ ! prevMk, nulcmd, nulcmd, svSrc, nulcmd, gorURL, pgBack, dictword, /* x y z { | } ~ DEL */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, }; ! char EscBKeymap[128] = { /* C-@ C-a C-b C-c C-d C-e C-f C-g */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* C-h C-i C-j C-k C-l C-m C-n C-o */ --- 66,81 ---- /* X Y Z [ \ ] ^ _ */ nulcmd, nulcmd, nulcmd, escbmap, nulcmd, nulcmd, nulcmd, nulcmd, /* ` a b c d e f g */ ! nulcmd, adBmark, ldBmark, execCmd, nulcmd, editScr, nulcmd, goLine, /* h i j k l m n o */ ! nulcmd, nulcmd, nulcmd, defKey, listMn, movlistMn, nextMk, setOpt, /* p q r s t u v w */ ! prevMk, nulcmd, nulcmd, svSrc, tabMn, gorURL, pgBack, dictword, /* x y z { | } ~ DEL */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, }; ! unsigned char EscBKeymap[128] = { /* C-@ C-a C-b C-c C-d C-e C-f C-g */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* C-h C-i C-j C-k C-l C-m C-n C-o */ *************** *** 110,116 **** nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, }; ! char EscDKeymap[128] = { /* 0 1 INS 3 4 PgUp, PgDn 7 */ nulcmd, goLineF, mainMn, nulcmd, goLineL, pgBack, pgFore, nulcmd, /* 8 9 10 F1 F2 F3 F4 F5 */ --- 110,116 ---- nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, }; ! unsigned char EscDKeymap[128] = { /* 0 1 INS 3 4 PgUp, PgDn 7 */ nulcmd, goLineF, mainMn, nulcmd, goLineL, pgBack, pgFore, nulcmd, /* 8 9 10 F1 F2 F3 F4 F5 */ *************** *** 137,143 **** }; #ifdef __EMX__ ! char PcKeymap[256] = { // Null nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, // 0 // S-Tab --- 137,143 ---- }; #ifdef __EMX__ ! unsigned char PcKeymap[256] = { // Null nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, // 0 // S-Tab diff -crN -x CVS w3m-0.3.2.2/keybind_lynx.c w3m-js-1.743/keybind_lynx.c *** w3m-0.3.2.2/keybind_lynx.c 2002-01-24 02:19:47.000000000 +0900 --- w3m-js-1.743/keybind_lynx.c 2002-12-13 22:15:53.000000000 +0900 *************** *** 1,4 **** ! /* $Id: keybind_lynx.c,v 1.5 2002/01/23 17:19:47 ukai Exp $ */ /* * Lynx-like key binding. * --- 1,4 ---- ! /* $Id: keybind_lynx.c,v 1.7 2002/12/13 03:02:03 ukai Exp $ */ /* * Lynx-like key binding. * *************** *** 13,54 **** #include "funcname2.h" ! char GlobalKeymap[128] = { /* C-@ C-a C-b C-c C-d C-e C-f C-g */ _mark, goLineF, backBf, nulcmd, nulcmd, goLineL, followA, curlno, /* C-h C-i C-j C-k C-l C-m C-n C-o */ ldHist, nextA, followA, cooLst, rdrwSc, followA, nextA, nulcmd, /* C-p C-q C-r C-s C-t C-u C-v C-w */ ! prevA, nulcmd, reload, srchfor, nulcmd, nulcmd, pgFore, rdrwSc, /* C-x C-y C-z C-[ C-\ C-] C-^ C-_ */ nulcmd, nulcmd, susp, escmap, nulcmd, nulcmd, nulcmd, nulcmd, /* SPC ! " # $ % & ' */ pgFore, execsh, reMark, pipesh, linend, nulcmd, nulcmd, nulcmd, /* ( ) * + , - . / */ ! nulcmd, nulcmd, nulcmd, pgFore, nulcmd, pgBack, nulcmd, srchfor, /* 0 1 2 3 4 5 6 7 */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* 8 9 : ; < = > ? */ ! nulcmd, nulcmd, chkURL, nulcmd, shiftl, pginfo, shiftr, ldhelp, /* @ A B C D E F G */ ! readsh, nulcmd, backBf, nulcmd, nulcmd, editBf, rFrame, goLine, /* H I J K L M N O */ ! ldhelp, followI, lup1, ldown1, nulcmd, extbrz, nextMk, nulcmd, /* P Q R S T U V W */ ! prevMk, quitfm, reload, svBuf, nulcmd, goURL, ldfile, nulcmd, /* X Y Z [ \ ] ^ _ */ ! nulcmd, nulcmd, ctrCsrH, nulcmd, vwSrc, nulcmd, linbeg, nulcmd, /* ` a b c d e f g */ nulcmd, adBmark, pgBack, curURL, svA, nulcmd, nulcmd, goURL, /* h i j k l m n o */ ! movL, peekIMG, movD, movU, movR, nulcmd, srchnxt, ldOpt, /* p q r s t u v w */ ! svBuf, qquitfm, nulcmd, selMn, nulcmd, peekURL, ldBmark, wrapToggle, /* x y z { | } ~ DEL */ ! nulcmd, nulcmd, ctrCsrV, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, }; ! char EscKeymap[128] = { /* C-@ C-a C-b C-c C-d C-e C-f C-g */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* C-h C-i C-j C-k C-l C-m C-n C-o */ --- 13,54 ---- #include "funcname2.h" ! unsigned char GlobalKeymap[128] = { /* C-@ C-a C-b C-c C-d C-e C-f C-g */ _mark, goLineF, backBf, nulcmd, nulcmd, goLineL, followA, curlno, /* C-h C-i C-j C-k C-l C-m C-n C-o */ ldHist, nextA, followA, cooLst, rdrwSc, followA, nextA, nulcmd, /* C-p C-q C-r C-s C-t C-u C-v C-w */ ! prevA, closeT, reload, srchfor, tabA, prevA, pgFore, rdrwSc, /* C-x C-y C-z C-[ C-\ C-] C-^ C-_ */ nulcmd, nulcmd, susp, escmap, nulcmd, nulcmd, nulcmd, nulcmd, /* SPC ! " # $ % & ' */ pgFore, execsh, reMark, pipesh, linend, nulcmd, nulcmd, nulcmd, /* ( ) * + , - . / */ ! undoPos, redoPos, nulcmd, pgFore, col1L, pgBack, col1R, srchfor, /* 0 1 2 3 4 5 6 7 */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* 8 9 : ; < = > ? */ ! nulcmd, nulcmd, chkURL, chkWORD, shiftl, pginfo, shiftr, ldhelp, /* @ A B C D E F G */ ! readsh, nulcmd, backBf, nulcmd, ldDL, editBf, rFrame, goLine, /* H I J K L M N O */ ! ldhelp, followI, lup1, ldown1, linkLst, extbrz, nextMk, nulcmd, /* P Q R S T U V W */ ! prevMk, quitfm, reload, svBuf, newT, goURL, ldfile, movLW, /* X Y Z [ \ ] ^ _ */ ! nulcmd, nulcmd, ctrCsrH, topA, vwSrc, lastA, linbeg, nulcmd, /* ` a b c d e f g */ nulcmd, adBmark, pgBack, curURL, svA, nulcmd, nulcmd, goURL, /* h i j k l m n o */ ! movL, peekIMG, movD, movU, movR, msToggle, srchnxt, ldOpt, /* p q r s t u v w */ ! svBuf, qquitfm, dispVer, selMn, nulcmd, peekURL, ldBmark, movRW, /* x y z { | } ~ DEL */ ! nulcmd, nulcmd, ctrCsrV, prevT, pipeBuf, nextT, nulcmd, nulcmd, }; ! unsigned char EscKeymap[128] = { /* C-@ C-a C-b C-c C-d C-e C-f C-g */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* C-h C-i C-j C-k C-l C-m C-n C-o */ *************** *** 64,89 **** /* 0 1 2 3 4 5 6 7 */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* 8 9 : ; < = > ? */ ! nulcmd, nulcmd, chkNMID, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* @ A B C D E F G */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* H I J K L M N O */ nulcmd, svI, nulcmd, nulcmd, nulcmd, linkbrz, nulcmd, escbmap, /* P Q R S T U V W */ ! nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* X Y Z [ \ ] ^ _ */ nulcmd, nulcmd, nulcmd, escbmap, nulcmd, nulcmd, nulcmd, nulcmd, /* ` a b c d e f g */ ! nulcmd, adBmark, ldBmark, nulcmd, nulcmd, editScr, nulcmd, nulcmd, /* h i j k l m n o */ ! nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* p q r s t u v w */ ! nulcmd, nulcmd, nulcmd, svSrc, nulcmd, gorURL, pgBack, nulcmd, /* x y z { | } ~ DEL */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, }; ! char EscBKeymap[128] = { /* C-@ C-a C-b C-c C-d C-e C-f C-g */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* C-h C-i C-j C-k C-l C-m C-n C-o */ --- 64,89 ---- /* 0 1 2 3 4 5 6 7 */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* 8 9 : ; < = > ? */ ! nulcmd, nulcmd, chkNMID, nulcmd, goLineF, nulcmd, goLineL, nulcmd, /* @ A B C D E F G */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* H I J K L M N O */ nulcmd, svI, nulcmd, nulcmd, nulcmd, linkbrz, nulcmd, escbmap, /* P Q R S T U V W */ ! nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, dictwordat, /* X Y Z [ \ ] ^ _ */ nulcmd, nulcmd, nulcmd, escbmap, nulcmd, nulcmd, nulcmd, nulcmd, /* ` a b c d e f g */ ! nulcmd, adBmark, ldBmark, execCmd, nulcmd, editScr, nulcmd, goLine, /* h i j k l m n o */ ! nulcmd, nulcmd, nulcmd, defKey, listMn, movlistMn, nextMk, setOpt, /* p q r s t u v w */ ! prevMk, nulcmd, nulcmd, svSrc, tabMn, gorURL, pgBack, dictword, /* x y z { | } ~ DEL */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, }; ! unsigned char EscBKeymap[128] = { /* C-@ C-a C-b C-c C-d C-e C-f C-g */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* C-h C-i C-j C-k C-l C-m C-n C-o */ *************** *** 101,109 **** /* 8 9 : ; < = > ? */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* @ A B C D E F G */ ! nulcmd, prevA, nextA, followA, backBf, nulcmd, nulcmd, nulcmd, /* H I J K L M N O */ ! nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, mouse, nulcmd, nulcmd, /* P Q R S T U V W */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* X Y Z [ \ ] ^ _ */ --- 101,109 ---- /* 8 9 : ; < = > ? */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* @ A B C D E F G */ ! nulcmd, prevA, nextA, followA, backBf, nulcmd, goLineL, pgFore, /* H I J K L M N O */ ! goLineF, pgBack, nulcmd, nulcmd, nulcmd, mouse, nulcmd, nulcmd, /* P Q R S T U V W */ nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, /* X Y Z [ \ ] ^ _ */ *************** *** 118,124 **** nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, }; ! char EscDKeymap[128] = { /* 0 1 INS 3 4 PgUp, PgDn 7 */ nulcmd, goLineF, mainMn, nulcmd, goLineL, pgBack, pgFore, nulcmd, /* 8 9 10 F1 F2 F3 F4 F5 */ --- 118,124 ---- nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, }; ! unsigned char EscDKeymap[128] = { /* 0 1 INS 3 4 PgUp, PgDn 7 */ nulcmd, goLineF, mainMn, nulcmd, goLineL, pgBack, pgFore, nulcmd, /* 8 9 10 F1 F2 F3 F4 F5 */ diff -crN -x CVS w3m-0.3.2.2/linein.c w3m-js-1.743/linein.c *** w3m-0.3.2.2/linein.c 2002-06-02 01:31:55.000000000 +0900 --- w3m-js-1.743/linein.c 2003-02-06 02:23:11.000000000 +0900 *************** *** 1,4 **** ! /* $Id: linein.c,v 1.23 2002/06/01 16:31:55 ukai Exp $ */ #include "fm.h" #include "local.h" #include "myctype.h" --- 1,4 ---- ! /* $Id: linein.c,v 1.27 2003/02/05 16:43:58 ukai Exp $ */ #include "fm.h" #include "local.h" #include "myctype.h" *************** *** 35,41 **** static void insertself(char c), _mvR(void), _mvL(void), _mvRw(void), _mvLw(void), delC(void), insC(void), _mvB(void), _mvE(void), _enter(void), _quo(void), _bs(void), _bsw(void), ! killn(void), killb(void), _inbrk(void), _esc(void), _prev(void), _next(void), _compl(void), _tcompl(void), _dcompl(void), _rdcompl(void), _rcompl(void); #ifdef __EMX__ --- 35,41 ---- static void insertself(char c), _mvR(void), _mvL(void), _mvRw(void), _mvLw(void), delC(void), insC(void), _mvB(void), _mvE(void), _enter(void), _quo(void), _bs(void), _bsw(void), ! killn(void), killb(void), _inbrk(void), _esc(void), _editor(void), _prev(void), _next(void), _compl(void), _tcompl(void), _dcompl(void), _rdcompl(void), _rcompl(void); #ifdef __EMX__ *************** *** 54,60 **** /* C-@ C-a C-b C-c C-d C-e C-f C-g */ _compl, _mvB, _mvL, _inbrk, delC, _mvE, _mvR, _inbrk, /* C-h C-i C-j C-k C-l C-m C-n C-o */ ! _bs, iself, _enter, killn, iself, _enter, _next, iself, /* C-p C-q C-r C-s C-t C-u C-v C-w */ _prev, _quo, _bsw, iself, _mvLw, killb, _quo, _bsw, /* C-x C-y C-z C-[ C-\ C-] C-^ C-_ */ --- 54,60 ---- /* C-@ C-a C-b C-c C-d C-e C-f C-g */ _compl, _mvB, _mvL, _inbrk, delC, _mvE, _mvR, _inbrk, /* C-h C-i C-j C-k C-l C-m C-n C-o */ ! _bs, iself, _enter, killn, iself, _enter, _next, _editor, /* C-p C-q C-r C-s C-t C-u C-v C-w */ _prev, _quo, _bsw, iself, _mvLw, killb, _quo, _bsw, /* C-x C-y C-z C-[ C-\ C-] C-^ C-_ */ *************** *** 139,144 **** --- 139,147 ---- CLen = CPos = 0; } + #ifdef SUPPORT_WIN9X_CONSOLE_MBCS + enable_win9x_console_input(); + #endif i_cont = TRUE; i_broken = FALSE; i_quote = FALSE; *************** *** 287,292 **** --- 290,299 ---- if (need_redraw) displayBuffer(Currentbuf, B_FORCE_REDRAW); + #ifdef SUPPORT_WIN9X_CONSOLE_MBCS + disable_win9x_console_input(); + #endif + if (i_broken) return NULL; *************** *** 302,308 **** pushHist(hist, p); } if (flag & IN_FILENAME) ! return expandName(p); else return allocStr(p, -1); } --- 309,315 ---- pushHist(hist, p); } if (flag & IN_FILENAME) ! return expandPath(p); else return allocStr(p, -1); } *************** *** 443,457 **** case 'D': _mvL(); break; - #if defined(__CYGWIN__) && defined(USE_MOUSE) - case 'M': - if ((is_xterm & (NEED_XTERM_ON | NEED_XTERM_OFF)) == NEED_XTERM_ON) { - getch(); - getch(); - getch(); - } - break; - #endif } break; case CTRL_I: --- 450,455 ---- *************** *** 855,861 **** f = Strdup(d); Strcat_charp(f, CFileBuf[n]); addstr(conv_from_system(CFileBuf[n])); ! if (stat(expandName(f->ptr), &st) != -1 && S_ISDIR(st.st_mode)) addstr("/"); } y++; --- 853,859 ---- f = Strdup(d); Strcat_charp(f, CFileBuf[n]); addstr(conv_from_system(CFileBuf[n])); ! if (stat(expandPath(f->ptr), &st) != -1 && S_ISDIR(st.st_mode)) addstr("/"); } y++; *************** *** 959,965 **** if (Strlastchar(CompleteBuf) == '/' && CompleteBuf->length > 1) { Strshrink(CompleteBuf, 1); } ! if ((d = opendir(expandName(CompleteBuf->ptr))) == NULL) { CompleteBuf = Strdup(ifn); *status = CPL_FAIL; if (cm_mode & CPL_ON) --- 957,963 ---- if (Strlastchar(CompleteBuf) == '/' && CompleteBuf->length > 1) { Strshrink(CompleteBuf, 1); } ! if ((d = opendir(expandPath(CompleteBuf->ptr))) == NULL) { CompleteBuf = Strdup(ifn); *status = CPL_FAIL; if (cm_mode & CPL_ON) *************** *** 1033,1039 **** else if (strncmp(p, "file:/", 6) == 0 && p[6] != '/') p = &p[5]; } ! if (stat(expandName(p), &st) != -1 && S_ISDIR(st.st_mode)) Strcat_char(CompleteBuf, '/'); } if (cm_mode & CPL_ON) --- 1031,1037 ---- else if (strncmp(p, "file:/", 6) == 0 && p[6] != '/') p = &p[5]; } ! if (stat(expandPath(p), &st) != -1 && S_ISDIR(st.st_mode)) Strcat_char(CompleteBuf, '/'); } if (cm_mode & CPL_ON) *************** *** 1060,1065 **** --- 1058,1065 ---- return; strCurrentBuf = strBuf; } + if (DecodeURL) + p = url_unquote_conv(p, 0); strBuf = Strnew_charp(p); CLen = CPos = setStrType(strBuf, strProp); offset = 0; *************** *** 1077,1082 **** --- 1077,1084 ---- return; p = nextHist(hist); if (p) { + if (DecodeURL) + p = url_unquote_conv(p, 0); strBuf = Strnew_charp(p); } else { *************** *** 1125,1127 **** --- 1127,1154 ---- return 0; } + + static void + _editor(void) + { + FormItemList fi; + char *p; + + if (is_passwd) + return; + + fi.readonly = FALSE; + fi.value = Strdup(strBuf); + Strcat_char(fi.value, '\n'); + + input_textarea(&fi); + + strBuf = Strnew(); + for (p = fi.value->ptr; *p; p++) { + if (*p == '\r' || *p == '\n') + continue; + Strcat_char(strBuf, *p); + } + CLen = CPos = setStrType(strBuf, strProp); + displayBuffer(Currentbuf, B_FORCE_REDRAW); + } diff -crN -x CVS w3m-0.3.2.2/local.c w3m-js-1.743/local.c *** w3m-0.3.2.2/local.c 2002-02-05 00:18:42.000000000 +0900 --- w3m-js-1.743/local.c 2003-02-01 03:09:44.000000000 +0900 *************** *** 1,4 **** ! /* $Id: local.c,v 1.14 2002/02/04 15:18:42 ukai Exp $ */ #include "fm.h" #include #include --- 1,4 ---- ! /* $Id: local.c,v 1.27 2003/01/31 16:26:41 ukai Exp $ */ #include "fm.h" #include #include *************** *** 14,41 **** #include /* _MAX_PATH ? */ #endif /* __EMX__ */ #include "local.h" #define CGIFN_NORMAL 0 ! #define CGIFN_DROOT 1 #define CGIFN_CGIBIN 2 - #define CGIFN_MODE(x) ((x)&3) ! #define CGIFN_CONTAIN_SLASH 4 /* setup cookie for local CGI */ void setLocalCookie() { - Str buf; char hostname[256]; gethostname(hostname, 256); ! buf = Sprintf("%d.%ld@%s", getpid(), lrand48(), hostname); ! Local_cookie = buf->ptr; } ! Buffer * ! dirBuffer(char *dname) { Str tmp; DIR *d; --- 14,58 ---- #include /* _MAX_PATH ? */ #endif /* __EMX__ */ #include "local.h" + #include "hash.h" #define CGIFN_NORMAL 0 ! #define CGIFN_LIBDIR 1 #define CGIFN_CGIBIN 2 ! static char *Local_cookie_file = NULL; ! ! static void ! writeLocalCookie() ! { ! FILE *f; ! ! if (no_rc_dir) ! return; ! if (Local_cookie_file) ! return; ! Local_cookie_file = tmpfname(TMPF_COOKIE, NULL)->ptr; ! set_environ("LOCAL_COOKIE_FILE", Local_cookie_file); ! f = fopen(Local_cookie_file, "wb"); ! if (!f) ! return; ! fwrite(Local_cookie->ptr, sizeof(char), Local_cookie->length, f); ! fclose(f); ! chmod(Local_cookie_file, S_IRUSR | S_IWUSR); ! } /* setup cookie for local CGI */ void setLocalCookie() { char hostname[256]; gethostname(hostname, 256); ! Local_cookie = Sprintf("%d.%ld@%s", CurrentPid, lrand48(), hostname); } ! Str ! loadLocalDir(char *dname) { Str tmp; DIR *d; *************** *** 53,69 **** int i, l, nrow = 0, n = 0, maxlen = 0; int nfile, nfile_max = 100; Str dirname; - Buffer *buf; d = opendir(dname); if (d == NULL) return NULL; dirname = Strnew_charp(dname); qdir = html_quote(Str_conv_from_system(dirname)->ptr); ! tmp = ! Sprintf ! ("Directory list of %s

    Directory list of %s

    \n", ! qdir, qdir); flist = New_N(char *, nfile_max); nfile = 0; while ((dir = readdir(d)) != NULL) { --- 70,87 ---- int i, l, nrow = 0, n = 0, maxlen = 0; int nfile, nfile_max = 100; Str dirname; d = opendir(dname); if (d == NULL) return NULL; dirname = Strnew_charp(dname); + if (Strlastchar(dirname) != '/') + Strcat_char(dirname, '/'); qdir = html_quote(Str_conv_from_system(dirname)->ptr); ! tmp = Strnew_m_charp("\n\n\nDirectory list of ", qdir, ! "\n\n\n

    Directory list of ", ! qdir, "

    \n", NULL); flist = New_N(char *, nfile_max); nfile = 0; while ((dir = readdir(d)) != NULL) { *************** *** 86,92 **** l = 1; nrow = (n + l - 1) / l; n = 1; ! Strcat_charp(tmp, "\n"); } qsort((void *)flist, nfile, sizeof(char *), strCmp); for (i = 0; i < nfile; i++) { --- 104,110 ---- l = 1; nrow = (n + l - 1) / l; n = 1; ! Strcat_charp(tmp, "
    \n\n"); } qsort((void *)flist, nfile, sizeof(char *), strCmp); for (i = 0; i < nfile; i++) { *************** *** 108,129 **** Strcat_charp(tmp, "\n"); --- 126,148 ---- Strcat_charp(tmp, "\n"); *************** *** 149,163 **** } } if (multicolList) { ! Strcat_charp(tmp, "
    "); } else { - if (S_ISDIR(st.st_mode)) - Strcat_charp(tmp, "[DIR]  "); #ifdef HAVE_LSTAT ! else if (S_ISLNK(lst.st_mode)) Strcat_charp(tmp, "[LINK] "); #endif /* HAVE_LSTAT */ else Strcat_charp(tmp, "[FILE] "); } ! Strcat_m_charp(tmp, "ptr), NULL); if (S_ISDIR(st.st_mode)) Strcat_char(tmp, '/'); Strcat_m_charp(tmp, "\">", html_quote(conv_from_system(p)), NULL); if (S_ISDIR(st.st_mode)) Strcat_char(tmp, '/'); ! Strcat_charp(tmp, ""); if (multicolList) { if (n++ == nrow) { Strcat_charp(tmp, ""); } else { #ifdef HAVE_LSTAT ! if (S_ISLNK(lst.st_mode)) Strcat_charp(tmp, "[LINK] "); + else #endif /* HAVE_LSTAT */ + if (S_ISDIR(st.st_mode)) + Strcat_charp(tmp, "[DIR]  "); else Strcat_charp(tmp, "[FILE] "); } ! Strcat_m_charp(tmp, "", html_quote(conv_from_system(p)), NULL); if (S_ISDIR(st.st_mode)) Strcat_char(tmp, '/'); ! Strcat_charp(tmp, ""); if (multicolList) { if (n++ == nrow) { Strcat_charp(tmp, "
    \n"); } ! buf = loadHTMLString(tmp); ! #ifdef JP_CHARSET ! if (buf) ! buf->document_code = SystemCode; ! #endif ! return buf; } static int --- 168,178 ---- } } if (multicolList) { ! Strcat_charp(tmp, "\n\n"); } + Strcat_charp(tmp, "\n\n"); ! return tmp; } static int *************** *** 165,209 **** { struct stat st; ! if (status & CGIFN_CONTAIN_SLASH) { ! /* local CGI file must be just under /cgi-bin/ ! * or /$LIB/ ! */ return -1; - } - #ifdef __EMX__ - if (CGIFN_MODE(status) != CGIFN_CGIBIN) { - char tmp[_MAX_PATH]; - int len; - - _abspath(tmp, w3m_lib_dir(), _MAX_PATH); /* Translate '\\' to '/' */ - len = strlen(tmp); - while (len > 1 && tmp[len - 1] == '/') - len--; - if (strnicmp(file, tmp, len) || /* and ignore case */ - (file[len] != '/')) - return -1; - } - #else /* not __EMX__ */ - if (CGIFN_MODE(status) != CGIFN_CGIBIN) { - char *tmp = Strnew_charp(w3m_lib_dir())->ptr; - int len = strlen(tmp); - - while (len > 1 && tmp[len - 1] == '/') - len--; - if (strncmp(file, tmp, len) || (file[len] != '/')) - /* - * a local-CGI script should be located on either - * /cgi-bin/ directory or LIB_DIR (typically /usr/local/lib/w3m). - */ - return -1; - } - #endif /* not __EMX__ */ if (stat(file, &st) < 0) return -1; ! if ((st.st_uid == geteuid() && (st.st_mode & S_IXUSR)) || (st.st_gid == getegid() && (st.st_mode & S_IXGRP)) || (st.st_mode & S_IXOTH)) { /* executable */ return 0; - } return -1; } --- 180,193 ---- { struct stat st; ! if (status != CGIFN_LIBDIR && status != CGIFN_CGIBIN) return -1; if (stat(file, &st) < 0) return -1; ! if (S_ISDIR(st.st_mode)) ! return -1; ! if ((st.st_uid == geteuid() && (st.st_mode & S_IXUSR)) || (st.st_gid == getegid() && (st.st_mode & S_IXGRP)) || (st.st_mode & S_IXOTH)) /* executable */ return 0; return -1; } *************** *** 215,221 **** --- 199,210 ---- setenv(var, value, 1); #else /* not HAVE_SETENV */ #ifdef HAVE_PUTENV + static Hash_sv *env_hash = NULL; Str tmp = Strnew_m_charp(var, "=", value, NULL); + + if (env_hash == NULL) + env_hash = newHash_sv(20); + putHash_sv(env_hash, var, (void *)tmp->ptr); putenv(tmp->ptr); #else /* not HAVE_PUTENV */ extern char **environ; *************** *** 268,479 **** set_environ("SCRIPT_NAME", name); set_environ("SCRIPT_FILENAME", fn); set_environ("REQUEST_URI", req_uri); - set_environ("LOCAL_COOKIE", Local_cookie); } static Str checkPath(char *fn, char *path) { Str tmp; struct stat st; while (*path) { ! tmp = Strnew(); ! while (*path && *path != ':') ! Strcat_char(tmp, *path++); ! if (*path == ':') ! path++; if (Strlastchar(tmp) != '/') Strcat_char(tmp, '/'); Strcat_charp(tmp, fn); if (stat(tmp->ptr, &st) == 0) return tmp; } return NULL; } ! static char * ! cgi_filename(char *fn, int *status) { Str tmp; ! struct stat st; ! if (cgi_bin != NULL && strncmp(fn, "/cgi-bin/", 9) == 0) { ! *status = CGIFN_CGIBIN; ! if (strchr(fn + 9, '/')) ! *status |= CGIFN_CONTAIN_SLASH; ! tmp = checkPath(fn + 9, cgi_bin); ! if (tmp == NULL) ! return fn; ! return tmp->ptr; ! } ! if (strncmp(fn, "/$LIB/", 6) == 0) { ! *status = CGIFN_NORMAL; ! tmp = Strnew_charp(w3m_lib_dir()); ! fn += 5; ! if (strchr(fn + 1, '/')) ! *status |= CGIFN_CONTAIN_SLASH; ! if (Strlastchar(tmp) == '/') ! fn++; ! Strcat_charp(tmp, fn); ! return tmp->ptr; ! } ! if (*fn == '/' && document_root != NULL && stat(fn, &st) < 0) { ! *status = CGIFN_DROOT; ! if (strchr(fn + 1, '/')) ! *status |= CGIFN_CONTAIN_SLASH; ! tmp = Strnew_charp(document_root); ! if (Strlastchar(tmp) != '/') ! Strcat_char(tmp, '/'); ! Strcat_charp(tmp, fn); ! return tmp->ptr; ! } ! *status = CGIFN_NORMAL; ! return fn; ! } ! ! static pid_t ! localcgi_popen_r(FILE ** p_fp) ! { ! int fd[2]; ! FILE *fp; ! pid_t pid; ! Str emsg; ! ! if (pipe(fd) < 0) { ! emsg = Sprintf("localcgi_popen_r: pipe: %s", strerror(errno)); ! disp_err_message(emsg->ptr, FALSE); ! return (pid_t) - 1; ! } ! ! flush_tty(); ! if ((pid = fork()) < 0) { ! emsg = Sprintf("localcgi_popen_r: fork: %s", strerror(errno)); ! disp_err_message(emsg->ptr, FALSE); ! close(fd[0]); ! close(fd[1]); ! return (pid_t) - 1; ! } ! else if (!pid) { ! close_tty(); ! dup2(fd[1], 1); ! ! if (fd[1] > 1) ! close(fd[1]); ! close(fd[0]); } - else { - close(fd[1]); ! if (!(fp = fdopen(fd[0], "r"))) { ! emsg = ! Sprintf("localcgi_popen_r: fdopen(%d, \"r\"): %s", fd[0], ! strerror(errno)); ! disp_err_message(emsg->ptr, FALSE); ! kill(pid, SIGTERM); ! close(fd[0]); ! return (pid_t) - 1; ! } ! ! *p_fp = fp; } ! ! return pid; } FILE * localcgi_post(char *uri, char *qstr, FormList *request, char *referer) { ! FILE *f, *f1; ! Str tmp1; int status; pid_t pid; ! char *file; ! file = cgi_filename(uri, &status); if (check_local_cgi(file, status) < 0) return NULL; ! tmp1 = tmpfname(TMPF_DFL, NULL); ! f1 = fopen(tmp1->ptr, "w"); ! if (f1 == NULL) return NULL; ! pushText(fileToDelete, tmp1->ptr); ! if ((pid = localcgi_popen_r(&f))) { ! fclose(f1); ! return pid > 0 ? f : NULL; ! } ! if (qstr == NULL) { ! set_cgi_environ(uri, file, uri); ! } ! else { ! set_cgi_environ(uri, file, Strnew_m_charp(uri, "?", qstr, NULL)->ptr); } ! set_environ("REQUEST_METHOD", "POST"); if (qstr) ! set_environ("QUERY_STRING", qstr); ! set_environ("CONTENT_LENGTH", Sprintf("%d", request->length)->ptr); if (referer && referer != NO_REFERER) set_environ("HTTP_REFERER", referer); ! if (request->enctype == FORM_ENCTYPE_MULTIPART) { ! set_environ("CONTENT_TYPE", ! Sprintf("multipart/form-data; boundary=%s", ! request->boundary)->ptr); ! } ! else { ! set_environ("CONTENT_TYPE", "application/x-www-form-urlencoded"); ! } ! if (request->enctype == FORM_ENCTYPE_MULTIPART) { ! FILE *fd; ! int c; ! fd = fopen(request->body, "r"); ! if (fd != NULL) { ! while ((c = fgetc(fd)) != EOF) ! fputc(c, f1); ! fclose(fd); } } else { ! fputs(request->body, f1); } - fclose(f1); - freopen(tmp1->ptr, "r", stdin); - #ifdef HAVE_CHDIR /* ifndef __EMX__ ? */ - chdir(mydirname(file)); - #endif - execl(file, mybasename(file), NULL); - fprintf(stderr, "execl(\"%s\", \"%s\", NULL): %s\n", - file, mybasename(file), strerror(errno)); - exit(1); - return NULL; - } - - FILE * - localcgi_get(char *uri, char *request, char *referer) - { - FILE *f; - int status; - pid_t pid; - char *file; ! file = cgi_filename(uri, &status); ! if (check_local_cgi(file, status) < 0) ! return NULL; ! if ((pid = localcgi_popen_r(&f)) < 0) ! return NULL; ! else if (pid) ! return f; ! if (request == NULL) { ! set_cgi_environ(Strnew_charp(uri)->ptr, file, Strnew_charp(uri)->ptr); ! } ! else { ! set_cgi_environ(Strnew_charp(uri)->ptr, file, ! Strnew_m_charp(uri, "?", request, NULL)->ptr); ! } ! if (referer && referer != NO_REFERER) ! set_environ("HTTP_REFERER", referer); ! set_environ("REQUEST_METHOD", "GET"); ! set_environ("QUERY_STRING", request ? request : ""); ! freopen(DEV_NULL_PATH, "r", stdin); ! #ifdef HAVE_CHDIR /* ifndef __EMX__? */ chdir(mydirname(file)); #endif execl(file, mybasename(file), NULL); --- 257,398 ---- set_environ("SCRIPT_NAME", name); set_environ("SCRIPT_FILENAME", fn); set_environ("REQUEST_URI", req_uri); } static Str checkPath(char *fn, char *path) { + char *p; Str tmp; struct stat st; while (*path) { ! p = strchr(path, ':'); ! tmp = Strnew_charp(expandPath(p ? allocStr(path, p - path) : path)); if (Strlastchar(tmp) != '/') Strcat_char(tmp, '/'); Strcat_charp(tmp, fn); if (stat(tmp->ptr, &st) == 0) return tmp; + if (!p) + break; + path = p + 1; + while (*path == ':') + path++; } return NULL; } ! static int ! cgi_filename(char *uri, char **fn, char **name, char **path_info) { Str tmp; ! int offset; ! *fn = uri; ! *name = uri; ! *path_info = NULL; ! ! if (cgi_bin != NULL && strncmp(uri, "/cgi-bin/", 9) == 0) { ! offset = 9; ! if ((*path_info = strchr(uri + offset, '/'))) ! *name = allocStr(uri, *path_info - uri); ! tmp = checkPath(*name + offset, cgi_bin); ! if (tmp == NULL) ! return CGIFN_NORMAL; ! *fn = tmp->ptr; ! return CGIFN_CGIBIN; } ! #ifdef __EMX__ ! { ! char lib[_MAX_PATH]; ! _abspath(lib, w3m_lib_dir(), _MAX_PATH); /* Translate '\\' to '/' */ ! tmp = Strnew_charp(lib); } ! #else ! tmp = Strnew_charp(w3m_lib_dir()); ! #endif ! if (Strlastchar(tmp) != '/') ! Strcat_char(tmp, '/'); ! if (strncmp(uri, "/$LIB/", 6) == 0) ! offset = 6; ! else if (strncmp(uri, tmp->ptr, tmp->length) == 0) ! offset = tmp->length; ! else if (*uri == '/' && document_root != NULL) { ! Str tmp2 = Strnew_charp(document_root); ! if (Strlastchar(tmp2) != '/') ! Strcat_char(tmp2, '/'); ! Strcat_charp(tmp2, uri + 1); ! if (strncmp(tmp2->ptr, tmp->ptr, tmp->length) != 0) ! return CGIFN_NORMAL; ! uri = tmp2->ptr; ! *name = uri; ! offset = tmp->length; ! } ! else ! return CGIFN_NORMAL; ! if ((*path_info = strchr(uri + offset, '/'))) ! *name = allocStr(uri, *path_info - uri); ! Strcat_charp(tmp, *name + offset); ! *fn = tmp->ptr; ! return CGIFN_LIBDIR; } FILE * localcgi_post(char *uri, char *qstr, FormList *request, char *referer) { ! FILE *fr = NULL, *fw = NULL; int status; pid_t pid; ! char *file = uri, *name = uri, *path_info = NULL; ! status = cgi_filename(uri, &file, &name, &path_info); if (check_local_cgi(file, status) < 0) return NULL; ! writeLocalCookie(); ! if (request && request->enctype != FORM_ENCTYPE_MULTIPART) ! pid = open_pipe_rw(&fr, &fw); ! else ! pid = open_pipe_rw(&fr, NULL); ! if (pid < 0) return NULL; ! else if (pid) { ! if (fw) { ! fwrite(request->body, sizeof(char), request->length, fw); ! fclose(fw); ! } ! return fr; } ! setup_child(TRUE, 2, -1); ! if (qstr) ! uri = Strnew_m_charp(uri, "?", qstr, NULL)->ptr; ! set_cgi_environ(name, file, uri); ! if (path_info) ! set_environ("PATH_INFO", path_info); if (referer && referer != NO_REFERER) set_environ("HTTP_REFERER", referer); ! if (request) { ! set_environ("REQUEST_METHOD", "POST"); ! if (qstr) ! set_environ("QUERY_STRING", qstr); ! set_environ("CONTENT_LENGTH", Sprintf("%d", request->length)->ptr); ! if (request->enctype == FORM_ENCTYPE_MULTIPART) { ! set_environ("CONTENT_TYPE", ! Sprintf("multipart/form-data; boundary=%s", ! request->boundary)->ptr); ! freopen(request->body, "r", stdin); } + else + set_environ("CONTENT_TYPE", "application/x-www-form-urlencoded"); } else { ! set_environ("REQUEST_METHOD", "GET"); ! set_environ("QUERY_STRING", qstr ? qstr : ""); ! freopen(DEV_NULL_PATH, "r", stdin); } ! #ifdef HAVE_CHDIR /* ifndef __EMX__ ? */ chdir(mydirname(file)); #endif execl(file, mybasename(file), NULL); diff -crN -x CVS w3m-0.3.2.2/mailcap.c w3m-js-1.743/mailcap.c *** w3m-0.3.2.2/mailcap.c 2002-01-06 01:13:27.000000000 +0900 --- w3m-js-1.743/mailcap.c 2003-01-18 02:42:26.000000000 +0900 *************** *** 1,4 **** ! /* $Id: mailcap.c,v 1.10 2002/01/05 16:13:27 ukai Exp $ */ #include "fm.h" #include "myctype.h" #include --- 1,4 ---- ! /* $Id: mailcap.c,v 1.12 2003/01/17 17:06:04 ukai Exp $ */ #include "fm.h" #include "myctype.h" #include *************** *** 21,27 **** char *cap = mcap->type, *p; int level; for (p = cap; *p != '/'; p++) { ! if (tolower(*p) != tolower(*type)) return 0; type++; } --- 21,27 ---- char *cap = mcap->type, *p; int level; for (p = cap; *p != '/'; p++) { ! if (TOLOWER(*p) != TOLOWER(*type)) return 0; type++; } *************** *** 36,42 **** if (*p == '*') return 10 + level; while (*p) { ! if (tolower(*p) != tolower(*type)) return 0; p++; type++; --- 36,42 ---- if (*p == '*') return 10 + level; while (*p) { ! if (TOLOWER(*p) != TOLOWER(*type)) return 0; p++; type++; *************** *** 187,193 **** Str tmp; struct mailcap *mcap; ! f = fopen(expandName(filename), "r"); if (f == NULL) return NULL; i = 0; --- 187,193 ---- Str tmp; struct mailcap *mcap; ! f = fopen(expandPath(filename), "r"); if (f == NULL) return NULL; i = 0; diff -crN -x CVS w3m-0.3.2.2/main.c w3m-js-1.743/main.c *** w3m-0.3.2.2/main.c 2002-10-31 02:03:27.000000000 +0900 --- w3m-js-1.743/main.c 2003-02-08 02:38:49.000000000 +0900 *************** *** 1,10 **** ! /* $Id: main.c,v 1.116 2002/10/30 17:03:27 ukai Exp $ */ #define MAINPROGRAM #include "fm.h" #include #include #include #include #include #if defined(HAVE_WAITPID) || defined(HAVE_WAIT3) #include --- 1,11 ---- ! /* $Id: main.c,v 1.210 2003/02/05 16:45:08 ukai Exp $ */ #define MAINPROGRAM #include "fm.h" #include #include #include #include + #include #include #if defined(HAVE_WAITPID) || defined(HAVE_WAIT3) #include *************** *** 25,51 **** #define DSTR_LEN 256 - static char *config_filename = NULL; - Hist *LoadHist; Hist *SaveHist; Hist *URLHist; Hist *ShellHist; Hist *TextHist; ! typedef struct { int cmd; ! void *user_data; } Event; ! #define N_EVENT_QUEUE 10 ! static Event eventQueue[N_EVENT_QUEUE]; ! static int n_event_queue; #ifdef USE_ALARM ! static int alarm_sec = 0; ! static short alarm_status = AL_UNSET; ! static Buffer *alarm_buffer; ! static Event alarm_event; static MySignalHandler SigAlarm(SIGNAL_ARG); #endif --- 26,50 ---- #define DSTR_LEN 256 Hist *LoadHist; Hist *SaveHist; Hist *URLHist; Hist *ShellHist; Hist *TextHist; ! typedef struct _Event { int cmd; ! void *data; ! struct _Event *next; } Event; ! static Event *CurrentEvent = NULL; ! static Event *LastEvent = NULL; #ifdef USE_ALARM ! static AlarmEvent DefaultAlarm = { ! 0, AL_UNSET, FUNCNAME_nulcmd, NULL ! }; ! static AlarmEvent *CurrentAlarm = &DefaultAlarm; static MySignalHandler SigAlarm(SIGNAL_ARG); #endif *************** *** 68,75 **** JMP_BUF IntReturn; static void cmd_loadfile(char *path); ! static void cmd_loadURL(char *url, ParsedURL *current, char *referer); static void cmd_loadBuffer(Buffer *buf, int prop, int linkid); static void keyPressEventProc(int c); int show_params_p = 0; --- 67,76 ---- JMP_BUF IntReturn; + static void delBuffer(Buffer *buf); static void cmd_loadfile(char *path); ! static void cmd_loadURL(char *url, ParsedURL *current, char *referer, ! FormList *request); static void cmd_loadBuffer(Buffer *buf, int prop, int linkid); static void keyPressEventProc(int c); int show_params_p = 0; *************** *** 79,101 **** const char *badchars); static int display_ok = FALSE; ! static void dump_source(Buffer *); ! static void dump_head(Buffer *); ! static void dump_extra(Buffer *); int prec_num = 0; int prev_key = -1; int on_target = 1; void set_buffer_environ(Buffer *); static void _followForm(int); static void _goLine(char *); #define PREC_NUM (prec_num ? prec_num : 1) #define PREC_LIMIT 10000 static int searchKeyNum(void); - #include "gcmain.c" - #define help() fusage(stdout, 0) #define usage() fusage(stderr, 1) --- 80,104 ---- const char *badchars); static int display_ok = FALSE; ! static void do_dump(Buffer *); int prec_num = 0; int prev_key = -1; int on_target = 1; + static int add_download_list = FALSE; void set_buffer_environ(Buffer *); + static void save_buffer_position(Buffer *buf); static void _followForm(int); static void _goLine(char *); + static void _newT(void); + static void followTab(TabBuffer * tab); + static void moveTab(TabBuffer * t, TabBuffer * t2, int right); + static int check_target = TRUE; #define PREC_NUM (prec_num ? prec_num : 1) #define PREC_LIMIT 10000 static int searchKeyNum(void); #define help() fusage(stdout, 0) #define usage() fusage(stderr, 1) *************** *** 165,170 **** --- 168,176 ---- #ifdef USE_MIGEMO ",migemo" #endif + #ifdef USE_JAVASCRIPT + ",javascript" + #endif ); } *************** *** 193,198 **** --- 199,206 ---- #ifdef USE_COLOR fprintf(f, " -M monochrome display\n"); #endif /* USE_COLOR */ + fprintf(f, + " -N open URL of command line on each new tab\n"); fprintf(f, " -F automatically render frame\n"); fprintf(f, " -cols width specify column width (used with -dump)\n"); *************** *** 235,240 **** --- 243,249 ---- fprintf(f, " -title[=TERM] set buffer name to terminal title string\n"); fprintf(f, " -o opt=value assign value to config option\n"); + fprintf(f, " -show-option print all config options\n"); fprintf(f, " -config file specify config file\n"); fprintf(f, " -help print this usage message\n"); fprintf(f, " -version print w3m version\n"); *************** *** 244,252 **** exit(err); } - static int option_assigned = 0; - extern void parse_proxy(void); - static GC_warn_proc orig_GC_warn_proc = NULL; #define GC_WARN_KEEP_MAX (20) --- 253,258 ---- *************** *** 344,350 **** } int ! MAIN(int argc, char **argv, char **envp) { Buffer *newbuf = NULL; char *p, c; --- 350,356 ---- } int ! main(int argc, char **argv, char **envp) { Buffer *newbuf = NULL; char *p, c; *************** *** 356,361 **** --- 362,368 ---- int load_argc = 0; int load_bookmark = FALSE; int visual_start = FALSE; + int open_new_tab = FALSE; char search_header = FALSE; char *default_type = NULL; char *post_file = NULL; *************** *** 374,386 **** load_argc = 0; CurrentDir = currentdir(); BookmarkFile = NULL; ! rc_dir = expandName(RC_DIR); ! i = strlen(rc_dir); ! if (i > 1 && rc_dir[i - 1] == '/') ! rc_dir[i - 1] = '\0'; ! config_filename = rcFile(CONFIG_FILE); ! create_option_search_table(); /* argument search 1 */ for (i = 1; i < argc; i++) { --- 381,389 ---- load_argc = 0; CurrentDir = currentdir(); + CurrentPid = (int)getpid(); BookmarkFile = NULL; ! config_file = NULL; /* argument search 1 */ for (i = 1; i < argc; i++) { *************** *** 389,395 **** argv[i] = "-dummy"; if (++i >= argc) usage(); ! config_filename = argv[i]; argv[i] = "-dummy"; } else if (!strcmp("-h", argv[i]) || !strcmp("-help", argv[i])) --- 392,398 ---- argv[i] = "-dummy"; if (++i >= argc) usage(); ! config_file = argv[i]; argv[i] = "-dummy"; } else if (!strcmp("-h", argv[i]) || !strcmp("-help", argv[i])) *************** *** 402,412 **** } /* initializations */ ! init_rc(config_filename); ! #ifdef USE_COOKIE ! initCookie(); ! #endif /* USE_COOKIE */ ! setLocalCookie(); /* setup cookie for local CGI */ LoadHist = newHist(); SaveHist = newHist(); --- 405,411 ---- } /* initializations */ ! init_rc(); LoadHist = newHist(); SaveHist = newHist(); *************** *** 419,448 **** if (!non_null(HTTP_proxy) && ((p = getenv("HTTP_PROXY")) || ! (p = getenv("http_proxy")) || (p = getenv("HTTP_proxy")))) { HTTP_proxy = p; ! parseURL(p, &HTTP_proxy_parsed, NULL); ! } #ifdef USE_GOPHER if (!non_null(GOPHER_proxy) && ((p = getenv("GOPHER_PROXY")) || ! (p = getenv("gopher_proxy")) || (p = getenv("GOPHER_proxy")))) { GOPHER_proxy = p; - parseURL(p, &GOPHER_proxy_parsed, NULL); - } #endif /* USE_GOPHER */ if (!non_null(FTP_proxy) && ((p = getenv("FTP_PROXY")) || ! (p = getenv("ftp_proxy")) || (p = getenv("FTP_proxy")))) { FTP_proxy = p; - parseURL(p, &FTP_proxy_parsed, NULL); - } if (!non_null(NO_proxy) && ((p = getenv("NO_PROXY")) || ! (p = getenv("no_proxy")) || (p = getenv("NO_proxy")))) { NO_proxy = p; ! set_no_proxy(p); ! } if (!non_null(Editor) && (p = getenv("EDITOR")) != NULL) Editor = p; --- 418,453 ---- if (!non_null(HTTP_proxy) && ((p = getenv("HTTP_PROXY")) || ! (p = getenv("http_proxy")) || (p = getenv("HTTP_proxy")))) HTTP_proxy = p; ! #ifdef USE_SSL ! if (!non_null(HTTPS_proxy) && ! ((p = getenv("HTTPS_PROXY")) || ! (p = getenv("https_proxy")) || (p = getenv("HTTPS_proxy")))) ! HTTPS_proxy = p; ! if (HTTPS_proxy == NULL && non_null(HTTP_proxy)) ! HTTPS_proxy = HTTP_proxy; ! #endif /* USE_SSL */ #ifdef USE_GOPHER if (!non_null(GOPHER_proxy) && ((p = getenv("GOPHER_PROXY")) || ! (p = getenv("gopher_proxy")) || (p = getenv("GOPHER_proxy")))) GOPHER_proxy = p; #endif /* USE_GOPHER */ if (!non_null(FTP_proxy) && ((p = getenv("FTP_PROXY")) || ! (p = getenv("ftp_proxy")) || (p = getenv("FTP_proxy")))) FTP_proxy = p; if (!non_null(NO_proxy) && ((p = getenv("NO_PROXY")) || ! (p = getenv("no_proxy")) || (p = getenv("NO_proxy")))) NO_proxy = p; ! #ifdef USE_NNTP ! if (!non_null(NNTP_server) && (p = getenv("NNTPSERVER")) != NULL) ! NNTP_server = p; ! if (!non_null(NNTP_mode) && (p = getenv("NNTPMODE")) != NULL) ! NNTP_mode = p; ! #endif if (!non_null(Editor) && (p = getenv("EDITOR")) != NULL) Editor = p; *************** *** 509,515 **** #endif /* JP_CHARSET */ #ifndef KANJI_SYMBOLS else if (!strcmp("-no-graph", argv[i])) ! no_graphic_char = TRUE; #endif /* not KANJI_SYMBOLS */ else if (!strcmp("-T", argv[i])) { if (++i >= argc) --- 514,520 ---- #endif /* JP_CHARSET */ #ifndef KANJI_SYMBOLS else if (!strcmp("-no-graph", argv[i])) ! UseGraphicChar = FALSE; #endif /* not KANJI_SYMBOLS */ else if (!strcmp("-T", argv[i])) { if (++i >= argc) *************** *** 520,525 **** --- 525,532 ---- SearchHeader = search_header = TRUE; else if (!strcmp("-v", argv[i])) visual_start = TRUE; + else if (!strcmp("-N", argv[i])) + open_new_tab = TRUE; #ifdef USE_COLOR else if (!strcmp("-M", argv[i])) useColor = FALSE; *************** *** 541,552 **** else if (!strcmp("-F", argv[i])) RenderFrame = TRUE; else if (!strcmp("-W", argv[i])) { ! if (WrapSearch) { ! WrapSearch = FALSE; ! } ! else { ! WrapSearch = TRUE; ! } } else if (!strcmp("-dump", argv[i])) w3m_dump = DUMP_BUFFER; --- 548,557 ---- else if (!strcmp("-F", argv[i])) RenderFrame = TRUE; else if (!strcmp("-W", argv[i])) { ! if (WrapDefault) ! WrapDefault = FALSE; ! else ! WrapDefault = TRUE; } else if (!strcmp("-dump", argv[i])) w3m_dump = DUMP_BUFFER; *************** *** 608,614 **** else if (!strcmp("-num", argv[i])) showLineNum = TRUE; else if (!strcmp("-no-proxy", argv[i])) ! Do_not_use_proxy = TRUE; else if (!strcmp("-post", argv[i])) { if (++i >= argc) usage(); --- 613,619 ---- else if (!strcmp("-num", argv[i])) showLineNum = TRUE; else if (!strcmp("-no-proxy", argv[i])) ! use_proxy = FALSE; else if (!strcmp("-post", argv[i])) { if (++i >= argc) usage(); *************** *** 667,676 **** displayTitleTerm = getenv("TERM"); else if (!strncmp("-title=", argv[i], 7)) displayTitleTerm = argv[i] + 7; ! else if (!strcmp("-o", argv[i])) { ! if (++i >= argc || !strcmp(argv[i], "?")) { ! show_params_p = 1; ! usage(); } if (!set_param_option(argv[i])) { /* option set failed */ --- 672,683 ---- displayTitleTerm = getenv("TERM"); else if (!strncmp("-title=", argv[i], 7)) displayTitleTerm = argv[i] + 7; ! else if (!strcmp("-o", argv[i]) || ! !strcmp("-show-option", argv[i])) { ! if (!strcmp("-show-option", argv[i]) || ++i >= argc || ! !strcmp(argv[i], "?")) { ! show_params(stdout); ! exit(0); } if (!set_param_option(argv[i])) { /* option set failed */ *************** *** 678,684 **** show_params_p = 1; usage(); } - option_assigned = 1; } else if (!strcmp("-dummy", argv[i])) { /* do nothing */ --- 685,690 ---- *************** *** 698,714 **** i++; } - if (option_assigned) - sync_with_option(); - #ifdef __WATT32__ if (w3m_debug) dbug_init(); sock_init(); #endif ! Firstbuf = NULL; ! Currentbuf = NULL; CurrentKey = -1; if (BookmarkFile == NULL) BookmarkFile = rcFile(BOOKMARK); --- 704,719 ---- i++; } #ifdef __WATT32__ if (w3m_debug) dbug_init(); sock_init(); #endif ! FirstTab = NULL; ! LastTab = NULL; ! nTab = 0; ! CurrentTab = NULL; CurrentKey = -1; if (BookmarkFile == NULL) BookmarkFile = rcFile(BOOKMARK); *************** *** 725,737 **** #ifdef USE_BINMODE_STREAM setmode(fileno(stdout), O_BINARY); #endif ! if (w3m_backend) ! backend(); ! if (!w3m_dump) { ! initKeymap(TRUE); ! #ifdef USE_MENU ! initMenu(); ! #endif /* MENU */ fmInit(); #ifdef SIGWINCH signal(SIGWINCH, resize_hook); --- 730,736 ---- #ifdef USE_BINMODE_STREAM setmode(fileno(stdout), O_BINARY); #endif ! if (!w3m_dump && !w3m_backend) { fmInit(); #ifdef SIGWINCH signal(SIGWINCH, resize_hook); *************** *** 744,749 **** --- 743,760 ---- else if (w3m_halfdump && displayImage) activeImage = TRUE; #endif + + sync_with_option(); + #ifdef USE_COOKIE + initCookie(); + #endif /* USE_COOKIE */ + setLocalCookie(); /* setup cookie for local CGI */ + + if (w3m_backend) + backend(); + + if (w3m_dump) + signal(SIGINT, SIG_IGN); #ifdef SIGCHLD signal(SIGCHLD, sig_chld); #endif *************** *** 862,871 **** else if (newbuf == NO_BUFFER) continue; switch (newbuf->real_scheme) { - #ifdef USE_NNTP - case SCM_NNTP: - case SCM_NEWS: - #endif /* USE_NNTP */ case SCM_MAILTO: break; case SCM_LOCAL: --- 873,878 ---- *************** *** 878,906 **** } else if (newbuf == NO_BUFFER) continue; ! newbuf->search_header = search_header; ! if (Currentbuf == NULL) Firstbuf = Currentbuf = newbuf; else { Currentbuf->nextBuffer = newbuf; Currentbuf = newbuf; } ! if (w3m_dump) { ! if (w3m_dump & DUMP_EXTRA) ! dump_extra(Currentbuf); ! if (w3m_dump & DUMP_HEAD) ! dump_head(Currentbuf); ! if (w3m_dump & DUMP_SOURCE) ! dump_source(Currentbuf); ! if (w3m_dump == DUMP_BUFFER) { ! if (Currentbuf->frameset != NULL && RenderFrame) ! rFrame(); ! saveBuffer(Currentbuf, stdout); ! } ! } ! else { if (Currentbuf->frameset != NULL && RenderFrame) rFrame(); Currentbuf = newbuf; #ifdef USE_BUFINFO saveBufferInfo(); --- 885,915 ---- } else if (newbuf == NO_BUFFER) continue; ! if (newbuf->pagerSource || ! (newbuf->real_scheme == SCM_LOCAL && newbuf->header_source && ! newbuf->currentURL.file && strcmp(newbuf->currentURL.file, "-"))) ! newbuf->search_header = search_header; ! if (CurrentTab == NULL) { ! FirstTab = LastTab = CurrentTab = newTab(); ! nTab = 1; Firstbuf = Currentbuf = newbuf; + } + else if (open_new_tab) { + _newT(); + Currentbuf->nextBuffer = newbuf; + delBuffer(Currentbuf); + } else { Currentbuf->nextBuffer = newbuf; Currentbuf = newbuf; } ! if (!w3m_dump || w3m_dump == DUMP_BUFFER) { if (Currentbuf->frameset != NULL && RenderFrame) rFrame(); + } + if (w3m_dump) + do_dump(Currentbuf); + else { Currentbuf = newbuf; #ifdef USE_BUFINFO saveBufferInfo(); *************** *** 908,920 **** } } if (w3m_dump) { #ifdef USE_COOKIE save_cookies(); #endif /* USE_COOKIE */ w3m_exit(0); } ! if (!Firstbuf || Firstbuf == NO_BUFFER) { if (newbuf == NO_BUFFER) { if (fmInitialized) inputChar("Hit any key to quit w3m:"); --- 917,949 ---- } } if (w3m_dump) { + if (err_msg->length) + fprintf(stderr, "%s", err_msg->ptr); #ifdef USE_COOKIE save_cookies(); #endif /* USE_COOKIE */ w3m_exit(0); } ! if (add_download_list) { ! add_download_list = FALSE; ! CurrentTab = LastTab; ! if (!FirstTab) { ! FirstTab = LastTab = CurrentTab = newTab(); ! nTab = 1; ! } ! if (!Firstbuf || Firstbuf == NO_BUFFER) { ! Firstbuf = Currentbuf = newBuffer(INIT_BUFFER_WIDTH); ! Currentbuf->bufferprop = BP_INTERNAL | BP_NO_URL; ! Currentbuf->buffername = DOWNLOAD_LIST_TITLE; ! } ! else ! Currentbuf = Firstbuf; ! ldDL(); ! } ! else ! CurrentTab = FirstTab; ! if (!FirstTab || !Firstbuf || Firstbuf == NO_BUFFER) { if (newbuf == NO_BUFFER) { if (fmInitialized) inputChar("Hit any key to quit w3m:"); *************** *** 943,982 **** #endif Currentbuf = Firstbuf; ! displayBuffer(Currentbuf, B_NORMAL); if (line_str) { _goLine(line_str); } - onA(); for (;;) { /* event processing */ ! if (n_event_queue > 0) { ! for (i = 0; i < n_event_queue; i++) { ! CurrentKey = -1; ! CurrentKeyData = eventQueue[i].user_data; ! CurrentCmdData = NULL; ! w3mFuncList[eventQueue[i].cmd].func(); ! } ! n_event_queue = 0; } - CurrentKeyData = NULL; /* get keypress event */ #ifdef USE_MOUSE if (use_mouse) mouse_active(); #endif /* USE_MOUSE */ #ifdef USE_ALARM ! if (alarm_status == AL_IMPLICIT) { ! alarm_buffer = Currentbuf; ! alarm_status = AL_IMPLICIT_DONE; ! } ! else if (alarm_status == AL_IMPLICIT_DONE ! && alarm_buffer != Currentbuf) { ! setAlarmEvent(0, AL_UNSET, FUNCNAME_nulcmd, NULL); ! } ! if (alarm_sec > 0) { signal(SIGALRM, SigAlarm); ! alarm(alarm_sec); } #endif #ifdef SIGWINCH --- 972,1034 ---- #endif Currentbuf = Firstbuf; ! displayBuffer(Currentbuf, B_FORCE_REDRAW); if (line_str) { _goLine(line_str); } for (;;) { + if (add_download_list) { + add_download_list = FALSE; + ldDL(); + } + if (Currentbuf->submit) { + Anchor *a = Currentbuf->submit; + Currentbuf->submit = NULL; + gotoLine(Currentbuf, a->start.line); + Currentbuf->pos = a->start.pos; + _followForm(TRUE); + continue; + } /* event processing */ ! if (CurrentEvent) { ! CurrentKey = -1; ! CurrentKeyData = NULL; ! CurrentCmdData = (char *)CurrentEvent->data; ! w3mFuncList[CurrentEvent->cmd].func(); ! CurrentCmdData = NULL; ! CurrentEvent = CurrentEvent->next; ! continue; } /* get keypress event */ + #ifdef USE_ALARM + if (Currentbuf->event) { + if (Currentbuf->event->status != AL_UNSET) { + CurrentAlarm = Currentbuf->event; + if (CurrentAlarm->sec == 0) { /* refresh (0sec) */ + Currentbuf->event = NULL; + CurrentKey = -1; + CurrentKeyData = NULL; + CurrentCmdData = (char *)CurrentAlarm->data; + w3mFuncList[CurrentAlarm->cmd].func(); + CurrentCmdData = NULL; + continue; + } + } + else + Currentbuf->event = NULL; + } + if (!Currentbuf->event) + CurrentAlarm = &DefaultAlarm; + #endif #ifdef USE_MOUSE + mouse_action.in_action = FALSE; if (use_mouse) mouse_active(); #endif /* USE_MOUSE */ #ifdef USE_ALARM ! if (CurrentAlarm->sec > 0) { signal(SIGALRM, SigAlarm); ! alarm(CurrentAlarm->sec); } #endif #ifdef SIGWINCH *************** *** 987,1005 **** signal(SIGWINCH, resize_handler); #endif #ifdef USE_IMAGE ! if (activeImage && displayImage) ! loadImage(IMG_FLAG_NEXT); #endif c = getch(); - #ifdef USE_IMAGE - if (activeImage && displayImage) - loadImage(IMG_FLAG_START); - #endif #ifdef SIGWINCH signal(SIGWINCH, resize_hook); #endif #ifdef USE_ALARM ! if (alarm_sec > 0) { alarm(0); } #endif --- 1039,1057 ---- signal(SIGWINCH, resize_handler); #endif #ifdef USE_IMAGE ! if (activeImage && displayImage && Currentbuf->img && ! !Currentbuf->image_loaded) { ! do { ! loadImage(Currentbuf, IMG_FLAG_NEXT); ! } while (sleep_till_anykey(1, 0) <= 0); ! } #endif c = getch(); #ifdef SIGWINCH signal(SIGWINCH, resize_hook); #endif #ifdef USE_ALARM ! if (CurrentAlarm->sec > 0) { alarm(0); } #endif *************** *** 1015,1026 **** --- 1067,1080 ---- } else { set_buffer_environ(Currentbuf); + save_buffer_position(Currentbuf); keyPressEventProc((int)c); prec_num = 0; } } prev_key = CurrentKey; CurrentKey = -1; + CurrentKeyData = NULL; } } *************** *** 1029,1045 **** { CurrentKey = c; w3mFuncList[(int)GlobalKeymap[c]].func(); - onA(); } void ! pushEvent(int event, void *user_data) { ! if (n_event_queue < N_EVENT_QUEUE) { ! eventQueue[n_event_queue].cmd = event; ! eventQueue[n_event_queue].user_data = user_data; ! n_event_queue++; ! } } static void --- 1083,1104 ---- { CurrentKey = c; w3mFuncList[(int)GlobalKeymap[c]].func(); } void ! pushEvent(int cmd, void *data) { ! Event *event; ! ! event = New(Event); ! event->cmd = cmd; ! event->data = data; ! event->next = NULL; ! if (CurrentEvent) ! LastEvent->next = event; ! else ! CurrentEvent = event; ! LastEvent = event; } static void *************** *** 1102,1107 **** --- 1161,1187 ---- #endif } + static void + do_dump(Buffer *buf) + { + MySignalHandler(*volatile prevtrap) (SIGNAL_ARG) = NULL; + + prevtrap = signal(SIGINT, intTrap); + if (SETJMP(IntReturn) != 0) { + signal(SIGINT, prevtrap); + return; + } + if (w3m_dump & DUMP_EXTRA) + dump_extra(buf); + if (w3m_dump & DUMP_HEAD) + dump_head(buf); + if (w3m_dump & DUMP_SOURCE) + dump_source(buf); + if (w3m_dump == DUMP_BUFFER) + saveBuffer(buf, stdout, FALSE); + signal(SIGINT, prevtrap); + } + void nulcmd(void) { /* do nothing */ *************** *** 1120,1134 **** } #endif void escmap(void) { char c; c = getch(); ! if (IS_ASCII(c)) { ! CurrentKey = K_ESC | c; ! w3mFuncList[(int)EscKeymap[(int)c]].func(); ! } } void --- 1200,1240 ---- } #endif + static void + escKeyProc(int c, int esc, unsigned char *map) + { + if (CurrentKey >= 0 && CurrentKey & K_MULTI) { + unsigned char **mmap; + mmap = (unsigned char **)getKeyData(MULTI_KEY(CurrentKey)); + if (!mmap) + return; + switch (esc) { + case K_ESCD: + map = mmap[3]; + break; + case K_ESCB: + map = mmap[2]; + break; + case K_ESC: + map = mmap[1]; + break; + default: + map = mmap[0]; + break; + } + esc |= (CurrentKey & ~0xFFFF); + } + CurrentKey = esc | c; + w3mFuncList[(int)map[c]].func(); + } + void escmap(void) { char c; c = getch(); ! if (IS_ASCII(c)) ! escKeyProc((int)c, K_ESC, EscKeymap); } void *************** *** 1136,1164 **** { char c; c = getch(); ! ! if (IS_DIGIT(c)) escdmap(c); ! else if (IS_ASCII(c)) { ! CurrentKey = K_ESCB | c; ! w3mFuncList[(int)EscBKeymap[(int)c]].func(); } } void escdmap(char c) { int d; - d = (int)c - (int)'0'; c = getch(); if (IS_DIGIT(c)) { d = d * 10 + (int)c - (int)'0'; c = getch(); } ! if (c == '~') { ! CurrentKey = K_ESCD | d; ! w3mFuncList[(int)EscDKeymap[d]].func(); } } --- 1242,1277 ---- { char c; c = getch(); ! if (IS_DIGIT(c)) { escdmap(c); ! return; } + if (IS_ASCII(c)) + escKeyProc((int)c, K_ESCB, EscBKeymap); } void escdmap(char c) { int d; d = (int)c - (int)'0'; c = getch(); if (IS_DIGIT(c)) { d = d * 10 + (int)c - (int)'0'; c = getch(); } ! if (c == '~') ! escKeyProc((int)d, K_ESCD, EscDKeymap); ! } ! ! void ! multimap(void) ! { ! char c; ! c = getch(); ! if (IS_ASCII(c)) { ! CurrentKey = K_MULTI | (CurrentKey << 16) | c; ! escKeyProc((int)c, 0, NULL); } } *************** *** 1175,1180 **** --- 1288,1294 ---- static Str currentURL(void); + #ifdef USE_BUFINFO void saveBufferInfo() { *************** *** 1188,1193 **** --- 1302,1308 ---- fprintf(fp, "%s\n", currentURL()->ptr); fclose(fp); } + #endif static void pushBuffer(Buffer *buf) *************** *** 1290,1326 **** static void nscroll(int n, int mode) { ! Line *curtop = Currentbuf->topLine; int lnum, tlnum, llnum, diff_n; ! if (Currentbuf->firstLine == NULL) return; ! lnum = Currentbuf->currentLine->linenumber; ! Currentbuf->topLine = lineSkip(Currentbuf, curtop, n, FALSE); ! if (Currentbuf->topLine == curtop) { lnum += n; ! if (lnum < Currentbuf->topLine->linenumber) ! lnum = Currentbuf->topLine->linenumber; ! else if (lnum > Currentbuf->lastLine->linenumber) ! lnum = Currentbuf->lastLine->linenumber; } else { ! tlnum = Currentbuf->topLine->linenumber; ! llnum = Currentbuf->topLine->linenumber + LASTLINE - 1; #ifdef NEXTPAGE_TOPLINE if (nextpage_topline) diff_n = 0; else #endif ! diff_n = n - (tlnum - curtop->linenumber); if (lnum < tlnum) lnum = tlnum + diff_n; if (lnum > llnum) lnum = llnum + diff_n; } ! gotoLine(Currentbuf, lnum); ! arrangeLine(Currentbuf); ! displayBuffer(Currentbuf, mode); } /* Move page forward */ --- 1405,1464 ---- static void nscroll(int n, int mode) { ! Buffer *buf = Currentbuf; ! Line *top = buf->topLine, *cur = buf->currentLine; int lnum, tlnum, llnum, diff_n; ! if (buf->firstLine == NULL) return; ! lnum = cur->linenumber; ! buf->topLine = lineSkip(buf, top, n, FALSE); ! if (buf->topLine == top) { lnum += n; ! if (lnum < buf->topLine->linenumber) ! lnum = buf->topLine->linenumber; ! else if (lnum > buf->lastLine->linenumber) ! lnum = buf->lastLine->linenumber; } else { ! tlnum = buf->topLine->linenumber; ! llnum = buf->topLine->linenumber + buf->LINES - 1; #ifdef NEXTPAGE_TOPLINE if (nextpage_topline) diff_n = 0; else #endif ! diff_n = n - (tlnum - top->linenumber); if (lnum < tlnum) lnum = tlnum + diff_n; if (lnum > llnum) lnum = llnum + diff_n; } ! gotoLine(buf, lnum); ! arrangeLine(buf); ! if (n > 0) { ! if (buf->currentLine->bpos && ! buf->currentLine->bwidth >= buf->currentColumn + buf->visualpos) ! cursorDown(buf, 1); ! else { ! while (buf->currentLine->next && buf->currentLine->next->bpos && ! buf->currentLine->bwidth + buf->currentLine->width < ! buf->currentColumn + buf->visualpos) ! cursorDown0(buf, 1); ! } ! } ! else { ! if (buf->currentLine->bwidth + buf->currentLine->width < ! buf->currentColumn + buf->visualpos) ! cursorUp(buf, 1); ! else { ! while (buf->currentLine->prev && buf->currentLine->bpos && ! buf->currentLine->bwidth >= ! buf->currentColumn + buf->visualpos) ! cursorUp0(buf, 1); ! } ! } ! displayBuffer(buf, mode); } /* Move page forward */ *************** *** 1329,1339 **** { #ifdef VI_PREC_NUM if (vi_prec_num) ! nscroll(searchKeyNum() * (LASTLINE - 1), B_NORMAL); else #endif ! nscroll(prec_num ? searchKeyNum() : searchKeyNum() * (LASTLINE - 1), ! prec_num ? B_SCROLL : B_NORMAL); } /* Move page backward */ --- 1467,1477 ---- { #ifdef VI_PREC_NUM if (vi_prec_num) ! nscroll(searchKeyNum() * (Currentbuf->LINES - 1), B_NORMAL); else #endif ! nscroll(prec_num ? searchKeyNum() : searchKeyNum() ! * (Currentbuf->LINES - 1), prec_num ? B_SCROLL : B_NORMAL); } /* Move page backward */ *************** *** 1342,1352 **** { #ifdef VI_PREC_NUM if (vi_prec_num) ! nscroll(-searchKeyNum() * (LASTLINE - 1), B_NORMAL); else #endif ! nscroll(-(prec_num ? searchKeyNum() : searchKeyNum() * (LASTLINE - 1)), ! prec_num ? B_SCROLL : B_NORMAL); } /* 1 line up */ --- 1480,1490 ---- { #ifdef VI_PREC_NUM if (vi_prec_num) ! nscroll(-searchKeyNum() * (Currentbuf->LINES - 1), B_NORMAL); else #endif ! nscroll(-(prec_num ? searchKeyNum() : searchKeyNum() ! * (Currentbuf->LINES - 1)), prec_num ? B_SCROLL : B_NORMAL); } /* 1 line up */ *************** *** 1370,1376 **** int offsety; if (Currentbuf->firstLine == NULL) return; ! offsety = LASTLINE / 2 - Currentbuf->cursorY; if (offsety != 0) { #if 0 Currentbuf->currentLine = lineSkip(Currentbuf, --- 1508,1514 ---- int offsety; if (Currentbuf->firstLine == NULL) return; ! offsety = Currentbuf->LINES / 2 - Currentbuf->cursorY; if (offsety != 0) { #if 0 Currentbuf->currentLine = lineSkip(Currentbuf, *************** *** 1410,1419 **** static void clear_mark(Line *l) { ! short pos; if (!l) return; ! for (pos = 0; pos < l->len; pos++) l->propBuf[pos] &= ~PE_MARK; } --- 1548,1557 ---- static void clear_mark(Line *l) { ! int pos; if (!l) return; ! for (pos = 0; pos < l->size; pos++) l->propBuf[pos] &= ~PE_MARK; } *************** *** 1431,1455 **** prevtrap = signal(SIGINT, intTrap); crmode(); ! if (SETJMP(IntReturn) == 0) ! for (i = 0; i < PREC_NUM; i++) result = func(Currentbuf, SearchString); signal(SIGINT, prevtrap); term_raw(); return result; } ! void disp_srchresult(int result, char *prompt, char *str) { if (str == NULL) str = ""; if (result & SR_NOTFOUND) ! disp_message(Sprintf("Not found: %s", str)->ptr, FALSE); else if (result & SR_WRAPPED) ! disp_message(Sprintf("Search wrapped: %s", str)->ptr, FALSE); else if (show_srch_str) ! disp_message(Sprintf("%s%s", prompt, str)->ptr, FALSE); } static int --- 1569,1597 ---- prevtrap = signal(SIGINT, intTrap); crmode(); ! if (SETJMP(IntReturn) == 0) { ! for (i = 0; i < PREC_NUM; i++) { result = func(Currentbuf, SearchString); + if (i < PREC_NUM - 1 && result & SR_FOUND) + clear_mark(Currentbuf->currentLine); + } + } signal(SIGINT, prevtrap); term_raw(); return result; } ! static void disp_srchresult(int result, char *prompt, char *str) { if (str == NULL) str = ""; if (result & SR_NOTFOUND) ! disp_message(Sprintf("Not found: %s", str)->ptr, TRUE); else if (result & SR_WRAPPED) ! disp_message(Sprintf("Search wrapped: %s", str)->ptr, TRUE); else if (show_srch_str) ! disp_message(Sprintf("%s%s", prompt, str)->ptr, TRUE); } static int *************** *** 1457,1463 **** { static Buffer sbuf; static Line *currentLine; ! static short pos; char *str; int do_next_search = FALSE; --- 1599,1605 ---- { static Buffer sbuf; static Line *currentLine; ! static int pos; char *str; int do_next_search = FALSE; *************** *** 1544,1550 **** RESTORE_BUFPOSITION(&sbuf); } displayBuffer(Currentbuf, B_FORCE_REDRAW); - onA(); } void --- 1686,1691 ---- *************** *** 1552,1569 **** { char *str; int result; ! str = inputStrHist(prompt, NULL, TextHist); ! if (str != NULL && *str == '\0') ! str = SearchString; ! if (str == NULL) ! return; result = srchcore(str, func); if (result & SR_FOUND) clear_mark(Currentbuf->currentLine); displayBuffer(Currentbuf, B_NORMAL); ! onA(); ! disp_srchresult(result, prompt, str); searchRoutine = func; } --- 1693,1717 ---- { char *str; int result; + int disp = FALSE; ! str = searchKeyData(); ! if (str == NULL || *str == '\0') { ! str = inputStrHist(prompt, NULL, TextHist); ! if (str != NULL && *str == '\0') ! str = SearchString; ! if (str == NULL) { ! displayBuffer(Currentbuf, B_NORMAL); ! return; ! } ! disp = TRUE; ! } result = srchcore(str, func); if (result & SR_FOUND) clear_mark(Currentbuf->currentLine); displayBuffer(Currentbuf, B_NORMAL); ! if (disp) ! disp_srchresult(result, prompt, str); searchRoutine = func; } *************** *** 1617,1623 **** if (result & SR_FOUND) clear_mark(Currentbuf->currentLine); displayBuffer(Currentbuf, B_NORMAL); - onA(); disp_srchresult(result, (reverse ? "Backward: " : "Forward: "), SearchString); } --- 1765,1770 ---- *************** *** 1639,1652 **** static void shiftvisualpos(Buffer *buf, int shift) { buf->visualpos -= shift; ! if (buf->visualpos >= buf->COLS) ! buf->visualpos = buf->COLS - 1; ! else if (buf->visualpos < 0) ! buf->visualpos = 0; arrangeLine(buf); ! if (buf->visualpos == -shift && buf->cursorX == 0) ! buf->visualpos = 0; } /* Shift screen left */ --- 1786,1800 ---- static void shiftvisualpos(Buffer *buf, int shift) { + Line *l = buf->currentLine; buf->visualpos -= shift; ! if (buf->visualpos - l->bwidth >= buf->COLS) ! buf->visualpos = l->bwidth + buf->COLS - 1; ! else if (buf->visualpos - l->bwidth < 0) ! buf->visualpos = l->bwidth; arrangeLine(buf); ! if (buf->visualpos - l->bwidth == -shift && buf->cursorX == 0) ! buf->visualpos = l->bwidth; } /* Shift screen left */ *************** *** 1761,1772 **** disp_message(Sprintf("Can't save buffer to %s", cmd)->ptr, TRUE); return; } ! saveBuffer(Currentbuf, f); fclose(f); - pushText(fileToDelete, tmpf); buf = getpipe(myExtCommand(cmd, tmpf, TRUE)->ptr); if (buf == NULL) { ! disp_message("Execution failed", FALSE); } else { buf->bufferprop |= (BP_INTERNAL | BP_NO_URL); --- 1909,1920 ---- disp_message(Sprintf("Can't save buffer to %s", cmd)->ptr, TRUE); return; } ! saveBuffer(Currentbuf, f, TRUE); fclose(f); buf = getpipe(myExtCommand(cmd, tmpf, TRUE)->ptr); if (buf == NULL) { ! disp_message("Execution failed", TRUE); ! return; } else { buf->bufferprop |= (BP_INTERNAL | BP_NO_URL); *************** *** 1797,1803 **** } buf = getpipe(cmd); if (buf == NULL) { ! disp_message("Execution failed", FALSE); } else { buf->bufferprop |= (BP_INTERNAL | BP_NO_URL); --- 1945,1952 ---- } buf = getpipe(cmd); if (buf == NULL) { ! disp_message("Execution failed", TRUE); ! return; } else { buf->bufferprop |= (BP_INTERNAL | BP_NO_URL); *************** *** 1833,1839 **** signal(SIGINT, prevtrap); term_raw(); if (buf == NULL) { ! disp_message("Execution failed", FALSE); } else { buf->bufferprop |= (BP_INTERNAL | BP_NO_URL); --- 1982,1989 ---- signal(SIGINT, prevtrap); term_raw(); if (buf == NULL) { ! disp_message("Execution failed", TRUE); ! return; } else { buf->bufferprop |= (BP_INTERNAL | BP_NO_URL); *************** *** 1859,1864 **** --- 2009,2015 ---- cmd = conv_to_system(cmd); if (cmd != NULL && *cmd != '\0') { fmTerm(); + printf("\n"); system(cmd); printf("\n[Hit any key]"); fflush(stdout); *************** *** 1894,1909 **** #ifdef USE_HELP_CGI char *lang; int n; lang = AcceptLang; n = strcspn(lang, ";, \t"); ! cmd_loadURL(Sprintf("file:///$LIB/" HELP_CGI CGI_EXTENSION ! "?version=%s&lang=%s", ! Str_form_quote(Strnew_charp(w3m_version))->ptr, ! Str_form_quote(Strnew_charp_n(lang, n))->ptr)->ptr, ! NULL, NO_REFERER); #else ! cmd_loadURL(helpFile(HELP_FILE), NULL, NO_REFERER); #endif } --- 2045,2060 ---- #ifdef USE_HELP_CGI char *lang; int n; + Str tmp; lang = AcceptLang; n = strcspn(lang, ";, \t"); ! tmp = Sprintf("file:///$LIB/" HELP_CGI CGI_EXTENSION "?version=%s&lang=%s", ! Str_form_quote(Strnew_charp(w3m_version))->ptr, ! Str_form_quote(Strnew_charp_n(lang, n))->ptr); ! cmd_loadURL(tmp->ptr, NULL, NO_REFERER, NULL); #else ! cmd_loadURL(helpFile(HELP_FILE), NULL, NO_REFERER, NULL); #endif } *************** *** 1964,1970 **** void movD(void) { ! _movD((LASTLINE + 1) / 2); } void --- 2115,2121 ---- void movD(void) { ! _movD((Currentbuf->LINES + 1) / 2); } void *************** *** 1988,1994 **** void movU(void) { ! _movU((LASTLINE + 1) / 2); } void --- 2139,2145 ---- void movU(void) { ! _movU((Currentbuf->LINES + 1) / 2); } void *************** *** 2156,2178 **** displayBuffer(Currentbuf, B_NORMAL); } ! /* Question and Quit */ ! void ! qquitfm(void) { ! char *ans; ! if (!confirm_on_quit) ! quitfm(); ! ans = inputChar("Do you want to exit w3m? (y/n)"); ! if (ans && tolower(*ans) == 'y') ! quitfm(); ! displayBuffer(Currentbuf, B_NORMAL); ! } - /* Quit */ - void - quitfm(void) - { term_title(""); /* XXX */ #ifdef USE_IMAGE if (activeImage) --- 2307,2327 ---- displayBuffer(Currentbuf, B_NORMAL); } ! static void ! _quitfm(int confirm) { ! char *ans = "y"; ! ! if (checkDownloadList()) ! ans = inputChar("Download process retains. " ! "Do you want to exit w3m? (y/n)"); ! else if (confirm) ! ans = inputChar("Do you want to exit w3m? (y/n)"); ! if (!(ans && TOLOWER(*ans) == 'y')) { ! displayBuffer(Currentbuf, B_NORMAL); ! return; ! } term_title(""); /* XXX */ #ifdef USE_IMAGE if (activeImage) *************** *** 2189,2194 **** --- 2338,2357 ---- w3m_exit(0); } + /* Quit */ + void + quitfm(void) + { + _quitfm(FALSE); + } + + /* Question and Quit */ + void + qquitfm(void) + { + _quitfm(confirm_on_quit); + } + /* Select buffer */ void selBuf(void) *************** *** 2278,2285 **** } else if (*l == '$') { Currentbuf->topLine = ! lineSkip(Currentbuf, Currentbuf->lastLine, -(LASTLINE + 1) / 2, ! TRUE); Currentbuf->currentLine = Currentbuf->lastLine; } else --- 2441,2448 ---- } else if (*l == '$') { Currentbuf->topLine = ! lineSkip(Currentbuf, Currentbuf->lastLine, ! -(Currentbuf->LINES + 1) / 2, TRUE); Currentbuf->currentLine = Currentbuf->lastLine; } else *************** *** 2291,2298 **** --- 2454,2465 ---- void goLine(void) { + + char *str = searchKeyData(); if (prec_num) _goLine("^"); + else if (str) + _goLine(str); else _goLine(inputStr("Goto line: ", "")); } *************** *** 2315,2320 **** --- 2482,2489 ---- { if (Currentbuf->firstLine == NULL) return; + while (Currentbuf->currentLine->prev && Currentbuf->currentLine->bpos) + cursorUp0(Currentbuf, 1); Currentbuf->pos = 0; arrangeCursor(Currentbuf); displayBuffer(Currentbuf, B_NORMAL); *************** *** 2326,2331 **** --- 2495,2503 ---- { if (Currentbuf->firstLine == NULL) return; + while (Currentbuf->currentLine->next + && Currentbuf->currentLine->next->bpos) + cursorDown0(Currentbuf, 1); Currentbuf->pos = Currentbuf->currentLine->len - 1; arrangeCursor(Currentbuf); displayBuffer(Currentbuf, B_NORMAL); *************** *** 2336,2345 **** editBf(void) { char *fn = Currentbuf->filename; - Buffer *buf, *fbuf = NULL, sbuf; - #ifdef JP_CHARSET - char old_code; - #endif Str cmd; if (fn == NULL || Currentbuf->pagerSource != NULL || /* Behaving as a pager */ --- 2508,2513 ---- *************** *** 2349,2357 **** disp_err_message("Can't edit other than local file", TRUE); return; } - if (Currentbuf->frameset != NULL) - fbuf = Currentbuf->linkBuffer[LB_FRAME]; - copyBuffer(&sbuf, Currentbuf); if (Currentbuf->edit) cmd = unquote_mailcap(Currentbuf->edit, Currentbuf->real_type, fn, checkHeader(Currentbuf, "Content-Type:"), NULL); --- 2517,2522 ---- *************** *** 2361,2402 **** system(cmd->ptr); fmInit(); - #ifdef JP_CHARSET - old_code = DocumentCode; - DocumentCode = Currentbuf->document_code; - #endif - SearchHeader = Currentbuf->search_header; - DefaultType = Currentbuf->real_type; - buf = loadGeneralFile(file_to_url(fn), NULL, NO_REFERER, 0, NULL); - #ifdef JP_CHARSET - DocumentCode = old_code; - #endif - SearchHeader = FALSE; - DefaultType = NULL; - - if (buf == NULL) { - disp_err_message("Re-loading failed", FALSE); - buf = nullBuffer(); - } - else if (buf == NO_BUFFER) { - buf = nullBuffer(); - } - if (fbuf != NULL) - Firstbuf = deleteBuffer(Firstbuf, fbuf); - repBuffer(Currentbuf, buf); - if ((buf->type != NULL) && (sbuf.type != NULL) && - ((!strcasecmp(buf->type, "text/plain") && - !strcasecmp(sbuf.type, "text/html")) || - (!strcasecmp(buf->type, "text/html") && - !strcasecmp(sbuf.type, "text/plain")))) { - vwSrc(); - if (Currentbuf != buf) - Firstbuf = deleteBuffer(Firstbuf, buf); - } - Currentbuf->search_header = sbuf.search_header; - if (Currentbuf->firstLine) - restorePosition(Currentbuf, &sbuf); displayBuffer(Currentbuf, B_FORCE_REDRAW); } /* Run editor on the current screen */ --- 2526,2533 ---- system(cmd->ptr); fmInit(); displayBuffer(Currentbuf, B_FORCE_REDRAW); + reload(); } /* Run editor on the current screen */ *************** *** 2412,2418 **** disp_err_message(Sprintf("Can't open %s", tmpf)->ptr, TRUE); return; } ! saveBuffer(Currentbuf, f); fclose(f); fmTerm(); system(myEditor(Editor, tmpf, CUR_LINENUMBER(Currentbuf))->ptr); --- 2543,2549 ---- disp_err_message(Sprintf("Can't open %s", tmpf)->ptr, TRUE); return; } ! saveBuffer(Currentbuf, f, TRUE); fclose(f); fmTerm(); system(myEditor(Editor, tmpf, CUR_LINENUMBER(Currentbuf))->ptr); *************** *** 2434,2440 **** return; l = Currentbuf->currentLine; l->propBuf[Currentbuf->pos] ^= PE_MARK; ! redrawLine(Currentbuf, l, l->linenumber - Currentbuf->topLine->linenumber); } /* Go to next mark */ --- 2565,2571 ---- return; l = Currentbuf->currentLine; l->propBuf[Currentbuf->pos] ^= PE_MARK; ! displayBuffer(Currentbuf, B_FORCE_REDRAW); } /* Go to next mark */ *************** *** 2515,2524 **** if (!use_mark) return; ! str = inputStrHist("(Mark)Regexp: ", MarkString, TextHist); if (str == NULL || *str == '\0') { ! displayBuffer(Currentbuf, B_NORMAL); ! return; } if ((p = regexCompile(str, 1)) != NULL) { disp_message(p, TRUE); --- 2646,2658 ---- if (!use_mark) return; ! str = searchKeyData(); if (str == NULL || *str == '\0') { ! str = inputStrHist("(Mark)Regexp: ", MarkString, TextHist); ! if (str == NULL || *str == '\0') { ! displayBuffer(Currentbuf, B_NORMAL); ! return; ! } } if ((p = regexCompile(str, 1)) != NULL) { disp_message(p, TRUE); *************** *** 2568,2573 **** --- 2702,2709 ---- referer = NO_REFERER; if (referer == NULL) referer = parsedURL2Str(&Currentbuf->currentURL)->ptr; + if (Currentbuf) + Currentbuf->script_target = target; buf = loadGeneralFile(url, baseURL(Currentbuf), referer, flag, request); if (buf == NULL) { char *emsg = Sprintf("Can't load %s", url)->ptr; *************** *** 2702,2710 **** return; } if (a && a->image && a->image->ismap) { ! getMapXY(Currentbuf, retrieveCurrentImg(Currentbuf), &x, &y); map = 1; } #endif a = retrieveCurrentAnchor(Currentbuf); if (a == NULL) { --- 2838,2852 ---- return; } if (a && a->image && a->image->ismap) { ! getMapXY(Currentbuf, a, &x, &y); map = 1; } + #else + a = retrieveCurrentMap(Currentbuf); + if (a) { + _followForm(FALSE); + return; + } #endif a = retrieveCurrentAnchor(Currentbuf); if (a == NULL) { *************** *** 2740,2753 **** Strtruncate(to, pos - to->ptr); #endif fmTerm(); ! system(myExtCommand(Mailer, shell_quote(url_unquote(to->ptr)), FALSE)->ptr); fmInit(); displayBuffer(Currentbuf, B_FORCE_REDRAW); pushHashHist(URLHist, a->url); return; } ! #ifdef USE_NNTP else if (!strncasecmp(a->url, "news:", 5) && strchr(a->url, '@') == NULL) { /* news:newsgroup is not supported */ disp_err_message("news:newsgroup_name is not supported", TRUE); --- 2882,2895 ---- Strtruncate(to, pos - to->ptr); #endif fmTerm(); ! system(myExtCommand(Mailer, shell_quote(file_unquote(to->ptr)), FALSE)->ptr); fmInit(); displayBuffer(Currentbuf, B_FORCE_REDRAW); pushHashHist(URLHist, a->url); return; } ! #if 0 else if (!strncasecmp(a->url, "news:", 5) && strchr(a->url, '@') == NULL) { /* news:newsgroup is not supported */ disp_err_message("news:newsgroup_name is not supported", TRUE); *************** *** 2759,2764 **** --- 2901,2921 ---- if (map) url = Sprintf("%s?%d,%d", a->url, x, y)->ptr; #endif + + if (check_target && open_tab_blank && a->target && + (!strcasecmp(a->target, "_new") || !strcasecmp(a->target, "_blank"))) { + Buffer *buf; + + _newT(); + buf = Currentbuf; + loadLink(url, a->target, a->referer, NULL); + if (buf != Currentbuf) + delBuffer(buf); + else + deleteTab(CurrentTab); + displayBuffer(Currentbuf, B_FORCE_REDRAW); + return; + } loadLink(url, a->target, a->referer, NULL); displayBuffer(Currentbuf, B_NORMAL); } *************** *** 2902,2908 **** } fi->parent->body = (*query)->ptr; fi->parent->boundary = ! Sprintf("------------------------------%d%ld%ld%ld", getpid(), fi->parent, fi->parent->body, fi->parent->boundary)->ptr; } *query = Strnew(); --- 3059,3065 ---- } fi->parent->body = (*query)->ptr; fi->parent->boundary = ! Sprintf("------------------------------%d%ld%ld%ld", CurrentPid, fi->parent, fi->parent->body, fi->parent->boundary)->ptr; } *query = Strnew(); *************** *** 3047,3053 **** disp_message_nsec("Read only field!", FALSE, 1, TRUE, FALSE); p = inputStrHist("TEXT:", fi->value ? fi->value->ptr : NULL, TextHist); if (p == NULL || fi->readonly) ! return; fi->value = Strnew_charp(p); formUpdateBuffer(a, Currentbuf, fi); if (fi->accept || fi->parent->nitems == 1) --- 3204,3210 ---- disp_message_nsec("Read only field!", FALSE, 1, TRUE, FALSE); p = inputStrHist("TEXT:", fi->value ? fi->value->ptr : NULL, TextHist); if (p == NULL || fi->readonly) ! break; fi->value = Strnew_charp(p); formUpdateBuffer(a, Currentbuf, fi); if (fi->accept || fi->parent->nitems == 1) *************** *** 3061,3067 **** p = inputFilenameHist("Filename:", fi->value ? fi->value->ptr : NULL, NULL); if (p == NULL || fi->readonly) ! return; fi->value = Strnew_charp(p); formUpdateBuffer(a, Currentbuf, fi); if (fi->accept || fi->parent->nitems == 1) --- 3218,3224 ---- p = inputFilenameHist("Filename:", fi->value ? fi->value->ptr : NULL, NULL); if (p == NULL || fi->readonly) ! break; fi->value = Strnew_charp(p); formUpdateBuffer(a, Currentbuf, fi); if (fi->accept || fi->parent->nitems == 1) *************** *** 3072,3082 **** goto do_submit; if (fi->readonly) { disp_message_nsec("Read only field!", FALSE, 1, TRUE, FALSE); ! return; } ! p = inputLine("TEXT:", fi->value ? fi->value->ptr : NULL, IN_PASSWORD); if (p == NULL) ! return; fi->value = Strnew_charp(p); formUpdateBuffer(a, Currentbuf, fi); if (fi->accept) --- 3229,3240 ---- goto do_submit; if (fi->readonly) { disp_message_nsec("Read only field!", FALSE, 1, TRUE, FALSE); ! break; } ! p = inputLine("Password:", fi->value ? fi->value->ptr : NULL, ! IN_PASSWORD); if (p == NULL) ! break; fi->value = Strnew_charp(p); formUpdateBuffer(a, Currentbuf, fi); if (fi->accept) *************** *** 3095,3101 **** goto do_submit; if (fi->readonly) { disp_message_nsec("Read only field!", FALSE, 1, TRUE, FALSE); ! return; } formRecheckRadio(a, Currentbuf, fi); break; --- 3253,3259 ---- goto do_submit; if (fi->readonly) { disp_message_nsec("Read only field!", FALSE, 1, TRUE, FALSE); ! break; } formRecheckRadio(a, Currentbuf, fi); break; *************** *** 3104,3110 **** goto do_submit; if (fi->readonly) { disp_message_nsec("Read only field!", FALSE, 1, TRUE, FALSE); ! return; } fi->checked = !fi->checked; formUpdateBuffer(a, Currentbuf, fi); --- 3262,3268 ---- goto do_submit; if (fi->readonly) { disp_message_nsec("Read only field!", FALSE, 1, TRUE, FALSE); ! break; } fi->checked = !fi->checked; formUpdateBuffer(a, Currentbuf, fi); *************** *** 3116,3122 **** if (!formChooseOptionByMenu(fi, Currentbuf->cursorX - Currentbuf->pos + a->start.pos + Currentbuf->rootX, ! Currentbuf->cursorY)) break; formUpdateBuffer(a, Currentbuf, fi); if (fi->parent->nitems == 1) --- 3274,3280 ---- if (!formChooseOptionByMenu(fi, Currentbuf->cursorX - Currentbuf->pos + a->start.pos + Currentbuf->rootX, ! Currentbuf->cursorY + Currentbuf->rootY)) break; formUpdateBuffer(a, Currentbuf, fi); if (fi->parent->nitems == 1) *************** *** 3203,3293 **** displayBuffer(Currentbuf, B_FORCE_REDRAW); } ! static void ! drawAnchorCursor0(Buffer *buf, int hseq, int prevhseq, int tline, int eline, ! int active) { ! int i, j; ! Line *l; Anchor *an; ! ! l = buf->topLine; ! for (j = 0; j < buf->href->nanchor; j++) { ! an = &buf->href->anchors[j]; ! if (an->start.line < tline) ! continue; ! if (an->start.line >= eline) ! return; ! for (;; l = l->next) { ! if (l == NULL) ! return; ! if (l->linenumber == an->start.line) ! break; ! } ! if (hseq >= 0 && an->hseq == hseq) { ! for (i = an->start.pos; i < an->end.pos; i++) { ! if (l->propBuf[i] & (PE_IMAGE | PE_ANCHOR | PE_FORM)) { ! if (active) ! l->propBuf[i] |= PE_ACTIVE; ! else ! l->propBuf[i] &= ~PE_ACTIVE; ! } ! } ! if (active) ! redrawLineRegion(buf, l, l->linenumber - tline, ! an->start.pos, an->end.pos); ! } ! else if (prevhseq >= 0 && an->hseq == prevhseq) { ! if (active) ! redrawLineRegion(buf, l, l->linenumber - tline, ! an->start.pos, an->end.pos); ! } ! } ! } ! ! ! void ! drawAnchorCursor(Buffer *buf) ! { ! Anchor *an; ! int hseq, prevhseq; ! int tline, eline; ! ! if (buf->firstLine == NULL) ! return; ! if (buf->href == NULL) ! return; ! ! an = retrieveCurrentAnchor(buf); ! if (an != NULL) ! hseq = an->hseq; ! else ! hseq = -1; ! tline = buf->topLine->linenumber; ! eline = tline + LASTLINE; ! prevhseq = buf->hmarklist->prevhseq; ! ! drawAnchorCursor0(buf, hseq, prevhseq, tline, eline, 1); ! drawAnchorCursor0(buf, hseq, -1, tline, eline, 0); ! buf->hmarklist->prevhseq = hseq; ! } ! ! /* underline an anchor if cursor is on the anchor. */ ! void ! onA(void) ! { ! drawAnchorCursor(Currentbuf); ! displayBuffer(Currentbuf, B_NORMAL); ! } ! ! /* go to the top anchor */ ! void ! topA(void) ! { ! HmarkerList *hl = Currentbuf->hmarklist; ! BufferPoint *po; ! Anchor *an; ! int hseq = 0; if (Currentbuf->firstLine == NULL) return; --- 3361,3374 ---- displayBuffer(Currentbuf, B_FORCE_REDRAW); } ! /* go to the top anchor */ ! void ! topA(void) { ! HmarkerList *hl = Currentbuf->hmarklist; ! BufferPoint *po; Anchor *an; ! int hseq = 0; if (Currentbuf->firstLine == NULL) return; *************** *** 3614,3619 **** --- 3695,3738 ---- nextY(-1); } + /* go to the next bufferr */ + void + nextBf(void) + { + Buffer *buf; + int i; + + for (i = 0; i < PREC_NUM; i++) { + buf = prevBuffer(Firstbuf, Currentbuf); + if (!buf) { + if (i == 0) + return; + break; + } + Currentbuf = buf; + } + displayBuffer(Currentbuf, B_FORCE_REDRAW); + } + + /* go to the previous bufferr */ + void + prevBf(void) + { + Buffer *buf; + int i; + + for (i = 0; i < PREC_NUM; i++) { + buf = Currentbuf->nextBuffer; + if (!buf) { + if (i == 0) + return; + break; + } + Currentbuf = buf; + } + displayBuffer(Currentbuf, B_FORCE_REDRAW); + } + static int checkBackBuffer(Buffer *buf) { *************** *** 3645,3651 **** Buffer *buf = Currentbuf->linkBuffer[LB_N_FRAME]; if (!checkBackBuffer(Currentbuf)) { ! disp_message("Can't back...", TRUE); return; } --- 3764,3775 ---- Buffer *buf = Currentbuf->linkBuffer[LB_N_FRAME]; if (!checkBackBuffer(Currentbuf)) { ! if (close_tab_back && nTab >= 1) { ! deleteTab(CurrentTab); ! displayBuffer(Currentbuf, B_FORCE_REDRAW); ! } ! else ! disp_message("Can't back...", TRUE); return; } *************** *** 3656,3663 **** struct frameset *fs; long linenumber = buf->frameQ->linenumber; long top = buf->frameQ->top_linenumber; ! short pos = buf->frameQ->pos; ! short currentColumn = buf->frameQ->currentColumn; AnchorList *formitem = buf->frameQ->formitem; fs = popFrameTree(&(buf->frameQ)); --- 3780,3787 ---- struct frameset *fs; long linenumber = buf->frameQ->linenumber; long top = buf->frameQ->top_linenumber; ! int pos = buf->frameQ->pos; ! int currentColumn = buf->frameQ->currentColumn; AnchorList *formitem = buf->frameQ->formitem; fs = popFrameTree(&(buf->frameQ)); *************** *** 3692,3698 **** } static void ! cmd_loadURL(char *url, ParsedURL *current, char *referer) { Buffer *buf; --- 3816,3822 ---- } static void ! cmd_loadURL(char *url, ParsedURL *current, char *referer, FormList *request) { Buffer *buf; *************** *** 3713,3726 **** Strtruncate(to, pos - to->ptr); #endif fmTerm(); ! system(myExtCommand(Mailer, shell_quote(url_unquote(to->ptr)), FALSE)->ptr); fmInit(); displayBuffer(Currentbuf, B_FORCE_REDRAW); pushHashHist(URLHist, url); return; } ! #ifdef USE_NNTP if (!strncasecmp(url, "news:", 5) && strchr(url, '@') == NULL) { /* news:newsgroup is not supported */ disp_err_message("news:newsgroup_name is not supported", TRUE); --- 3837,3850 ---- Strtruncate(to, pos - to->ptr); #endif fmTerm(); ! system(myExtCommand(Mailer, shell_quote(file_unquote(to->ptr)), FALSE)->ptr); fmInit(); displayBuffer(Currentbuf, B_FORCE_REDRAW); pushHashHist(URLHist, url); return; } ! #if 0 if (!strncasecmp(url, "news:", 5) && strchr(url, '@') == NULL) { /* news:newsgroup is not supported */ disp_err_message("news:newsgroup_name is not supported", TRUE); *************** *** 3729,3735 **** #endif /* USE_NNTP */ refresh(); ! buf = loadGeneralFile(url, current, referer, 0, NULL); if (buf == NULL) { char *emsg = Sprintf("Can't load %s", conv_from_system(url))->ptr; disp_err_message(emsg, FALSE); --- 3853,3859 ---- #endif /* USE_NNTP */ refresh(); ! buf = loadGeneralFile(url, current, referer, 0, request); if (buf == NULL) { char *emsg = Sprintf("Can't load %s", conv_from_system(url))->ptr; disp_err_message(emsg, FALSE); *************** *** 3759,3766 **** current = baseURL(Currentbuf); if (current) { char *c_url = parsedURL2Str(current)->ptr; ! if (DefaultURLString == DEFAULT_URL_CURRENT) url = c_url; else pushHist(hist, c_url); } --- 3883,3893 ---- current = baseURL(Currentbuf); if (current) { char *c_url = parsedURL2Str(current)->ptr; ! if (DefaultURLString == DEFAULT_URL_CURRENT) { url = c_url; + if (DecodeURL) + url = url_unquote_conv(url, 0); + } else pushHist(hist, c_url); } *************** *** 3769,3776 **** char *a_url; parseURL2(a->url, &p_url, current); a_url = parsedURL2Str(&p_url)->ptr; ! if (DefaultURLString == DEFAULT_URL_LINK) url = a_url; else pushHist(hist, a_url); } --- 3896,3906 ---- char *a_url; parseURL2(a->url, &p_url, current); a_url = parsedURL2Str(&p_url)->ptr; ! if (DefaultURLString == DEFAULT_URL_LINK) { url = a_url; + if (DecodeURL) + url = url_unquote_conv(url, Currentbuf->document_code); + } else pushHist(hist, a_url); } *************** *** 3780,3786 **** } #ifdef JP_CHARSET if (url != NULL) { ! if (Currentbuf->document_code) url = conv(url, InnerCode, Currentbuf->document_code)->ptr; else url = conv_to_system(url); --- 3910,3916 ---- } #ifdef JP_CHARSET if (url != NULL) { ! if ((relative || *url == '#') && Currentbuf->document_code) url = conv(url, InnerCode, Currentbuf->document_code)->ptr; else url = conv_to_system(url); *************** *** 3804,3810 **** } parseURL2(url, &p_url, current); pushHashHist(URLHist, parsedURL2Str(&p_url)->ptr); ! cmd_loadURL(url, current, referer); if (Currentbuf != cur_buf) /* success */ pushHashHist(URLHist, parsedURL2Str(&Currentbuf->currentURL)->ptr); } --- 3934,3940 ---- } parseURL2(url, &p_url, current); pushHashHist(URLHist, parsedURL2Str(&p_url)->ptr); ! cmd_loadURL(url, current, referer, NULL); if (Currentbuf != cur_buf) /* success */ pushHashHist(URLHist, parsedURL2Str(&Currentbuf->currentURL)->ptr); } *************** *** 3844,3850 **** void ldBmark(void) { ! cmd_loadURL(BookmarkFile, NULL, NO_REFERER); } --- 3974,3980 ---- void ldBmark(void) { ! cmd_loadURL(BookmarkFile, NULL, NO_REFERER, NULL); } *************** *** 3853,3867 **** adBmark(void) { Str tmp; ! tmp = Sprintf("file://%s/" W3MBOOKMARK_CMDNAME ! "?mode=panel&bmark=%s&url=%s&title=%s", ! w3m_lib_dir(), (Str_form_quote(Strnew_charp(BookmarkFile)))->ptr, (Str_form_quote(parsedURL2Str(&Currentbuf->currentURL)))-> ptr, (Str_form_quote(Strnew_charp(Currentbuf->buffername)))->ptr); ! cmd_loadURL(tmp->ptr, NULL, NO_REFERER); } /* option setting */ --- 3983,4001 ---- adBmark(void) { Str tmp; + FormList *request; ! tmp = Sprintf("mode=panel&cookie=%s&bmark=%s&url=%s&title=%s", ! (Str_form_quote(Local_cookie))->ptr, (Str_form_quote(Strnew_charp(BookmarkFile)))->ptr, (Str_form_quote(parsedURL2Str(&Currentbuf->currentURL)))-> ptr, (Str_form_quote(Strnew_charp(Currentbuf->buffername)))->ptr); ! request = newFormList(NULL, "post", NULL, NULL, NULL, NULL, NULL); ! request->body = tmp->ptr; ! request->length = tmp->length; ! cmd_loadURL("file:///$LIB/" W3MBOOKMARK_CMDNAME, NULL, NO_REFERER, ! request); } /* option setting */ *************** *** 3892,3902 **** } if (set_param_option(opt)) sync_with_option(); ! #ifdef USE_IMAGE ! if (activeImage) ! displayBuffer(Currentbuf, B_REDRAW_IMAGE); ! #endif ! displayBuffer(Currentbuf, B_FORCE_REDRAW); } /* error message list */ --- 4026,4032 ---- } if (set_param_option(opt)) sync_with_option(); ! displayBuffer(Currentbuf, B_REDRAW_IMAGE); } /* error message list */ *************** *** 3930,3961 **** void follow_map(struct parsed_tagarg *arg) { ! #ifdef MENU_MAP ! Anchor *a; ! char *url; ! int x; ParsedURL p_url; ! a = retrieveCurrentImg(Currentbuf); x = Currentbuf->cursorX + Currentbuf->rootX; ! url = follow_map_menu(Currentbuf, arg, a, x, Currentbuf->cursorY); ! if (url == NULL || *url == '\0') return; ! if (*url == '#') { ! gotoLabel(url + 1); return; } ! parseURL2(url, &p_url, baseURL(Currentbuf)); pushHashHist(URLHist, parsedURL2Str(&p_url)->ptr); ! cmd_loadURL(url, baseURL(Currentbuf), ! parsedURL2Str(&Currentbuf->currentURL)->ptr); ! #else Buffer *buf; ! buf = follow_map_panel(Currentbuf, arg); ! if (buf != NULL) cmd_loadBuffer(buf, BP_NORMAL, LB_NOLINK); ! #endif } #ifdef USE_COOKIE --- 4060,4191 ---- void follow_map(struct parsed_tagarg *arg) { ! char *name = tag_get_value(arg, "link"); ! #if defined(MENU_MAP) || defined(USE_IMAGE) ! Anchor *an; ! MapArea *a; ! int x, y; ParsedURL p_url; ! an = retrieveCurrentImg(Currentbuf); x = Currentbuf->cursorX + Currentbuf->rootX; ! y = Currentbuf->cursorY + Currentbuf->rootY; ! a = follow_map_menu(Currentbuf, name, an, x, y); ! if (a == NULL || a->url == NULL || *(a->url) == '\0') { ! #endif ! #ifndef MENU_MAP ! Buffer *buf = follow_map_panel(Currentbuf, name); ! ! if (buf != NULL) { ! #ifdef JP_CHARSET ! buf->document_code = Currentbuf->document_code; ! #endif /* JP_CHARSET */ ! cmd_loadBuffer(buf, BP_NORMAL, LB_NOLINK); ! } ! #endif ! #if defined(MENU_MAP) || defined(USE_IMAGE) return; ! } ! if (*(a->url) == '#') { ! gotoLabel(a->url + 1); return; } ! parseURL2(a->url, &p_url, baseURL(Currentbuf)); pushHashHist(URLHist, parsedURL2Str(&p_url)->ptr); ! if (check_target && open_tab_blank && a->target && ! (!strcasecmp(a->target, "_new") || !strcasecmp(a->target, "_blank"))) { ! Buffer *buf; ! ! _newT(); ! buf = Currentbuf; ! cmd_loadURL(a->url, baseURL(Currentbuf), ! parsedURL2Str(&Currentbuf->currentURL)->ptr, NULL); ! if (buf != Currentbuf) ! delBuffer(buf); ! else ! deleteTab(CurrentTab); ! displayBuffer(Currentbuf, B_FORCE_REDRAW); ! return; ! } ! cmd_loadURL(a->url, baseURL(Currentbuf), ! parsedURL2Str(&Currentbuf->currentURL)->ptr, NULL); ! #endif ! } ! ! #ifdef USE_MENU ! /* link menu */ ! void ! linkMn(void) ! { ! LinkList *l = link_menu(Currentbuf); ! ParsedURL p_url; ! ! if (!l || !l->url) ! return; ! if (*(l->url) == '#') { ! gotoLabel(l->url + 1); ! return; ! } ! parseURL2(l->url, &p_url, baseURL(Currentbuf)); ! pushHashHist(URLHist, parsedURL2Str(&p_url)->ptr); ! cmd_loadURL(l->url, baseURL(Currentbuf), ! parsedURL2Str(&Currentbuf->currentURL)->ptr, NULL); ! } ! ! static void ! anchorMn(Anchor *(*menu_func) (Buffer *), int go) ! { ! Anchor *a; ! BufferPoint *po; ! ! if (!Currentbuf->href || !Currentbuf->hmarklist) ! return; ! a = menu_func(Currentbuf); ! if (!a || a->hseq < 0) ! return; ! po = &Currentbuf->hmarklist->marks[a->hseq]; ! gotoLine(Currentbuf, po->line); ! Currentbuf->pos = po->pos; ! arrangeCursor(Currentbuf); ! displayBuffer(Currentbuf, B_NORMAL); ! if (go) ! followA(); ! } ! ! /* accesskey */ ! void ! accessKey(void) ! { ! anchorMn(accesskey_menu, TRUE); ! } ! ! /* list menu */ ! void ! listMn(void) ! { ! anchorMn(list_menu, TRUE); ! } ! ! void ! movlistMn(void) ! { ! anchorMn(list_menu, FALSE); ! } ! #endif ! ! /* link,anchor,image list */ ! void ! linkLst(void) ! { Buffer *buf; ! buf = link_list_panel(Currentbuf); ! if (buf != NULL) { ! #ifdef JP_CHARSET ! buf->document_code = Currentbuf->document_code; ! #endif /* JP_CHARSET */ cmd_loadBuffer(buf, BP_NORMAL, LB_NOLINK); ! } } #ifdef USE_COOKIE *************** *** 4013,4019 **** if (file == NULL || *file == '\0') { qfile = inputLineHist("Save buffer to: ", NULL, IN_COMMAND, SaveHist); if (qfile == NULL || *qfile == '\0') { ! displayBuffer(Currentbuf, B_FORCE_REDRAW); return; } } --- 4243,4249 ---- if (file == NULL || *file == '\0') { qfile = inputLineHist("Save buffer to: ", NULL, IN_COMMAND, SaveHist); if (qfile == NULL || *qfile == '\0') { ! displayBuffer(Currentbuf, B_NORMAL); return; } } *************** *** 4027,4035 **** file = unescape_spaces(Strnew_charp(qfile))->ptr; file = conv_to_system(file); } ! file = expandName(file); ! if (checkOverWrite(file) < 0) return; f = fopen(file, "w"); is_pipe = FALSE; } --- 4257,4267 ---- file = unescape_spaces(Strnew_charp(qfile))->ptr; file = conv_to_system(file); } ! file = expandPath(file); ! if (checkOverWrite(file) < 0) { ! displayBuffer(Currentbuf, B_NORMAL); return; + } f = fopen(file, "w"); is_pipe = FALSE; } *************** *** 4038,4044 **** disp_err_message(emsg, TRUE); return; } ! saveBuffer(Currentbuf, f); if (is_pipe) pclose(f); else --- 4270,4276 ---- disp_err_message(emsg, TRUE); return; } ! saveBuffer(Currentbuf, f, TRUE); if (is_pipe) pclose(f); else *************** *** 4074,4079 **** --- 4306,4315 ---- Anchor *a; ParsedURL pu; static Str s = NULL; + #ifdef JP_CHARSET + static Lineprop *p = NULL; + Lineprop *pp; + #endif static int offset = 0, n; if (Currentbuf->firstLine == NULL) *************** *** 4088,4116 **** else { offset = 0; } a = (only_img ? NULL : retrieveCurrentAnchor(Currentbuf)); if (a == NULL) { a = (only_img ? NULL : retrieveCurrentForm(Currentbuf)); if (a == NULL) { a = retrieveCurrentImg(Currentbuf); ! if (a == NULL) { ! s = NULL; return; - } } ! else { s = Strnew_charp(form2str((FormItemList *)a->url)); - goto disp; - } } ! parseURL2(a->url, &pu, baseURL(Currentbuf)); ! s = parsedURL2Str(&pu); disp: n = searchKeyNum(); if (n > 1 && s->length > (n - 1) * (COLS - 1)) ! disp_message_nomouse(&s->ptr[(n - 1) * (COLS - 1)], TRUE); ! else ! disp_message_nomouse(&s->ptr[offset], TRUE); } /* peek URL */ --- 4324,4361 ---- else { offset = 0; } + s = NULL; a = (only_img ? NULL : retrieveCurrentAnchor(Currentbuf)); if (a == NULL) { a = (only_img ? NULL : retrieveCurrentForm(Currentbuf)); if (a == NULL) { a = retrieveCurrentImg(Currentbuf); ! if (a == NULL) return; } ! else s = Strnew_charp(form2str((FormItemList *)a->url)); } ! if (s == NULL) { ! parseURL2(a->url, &pu, baseURL(Currentbuf)); ! s = parsedURL2Str(&pu); ! } ! if (DecodeURL) ! s = Strnew_charp(url_unquote_conv(s->ptr, Currentbuf->document_code)); ! #ifdef JP_CHARSET ! s = checkType(s, &pp, NULL); ! p = NewAtom_N(Lineprop, s->length); ! bcopy((void *)pp, (void *)p, s->length * sizeof(Lineprop)); ! #endif disp: n = searchKeyNum(); if (n > 1 && s->length > (n - 1) * (COLS - 1)) ! offset = (n - 1) * (COLS - 1); ! #ifdef JP_CHARSET ! if (CharType(p[offset]) == PC_KANJI2) ! offset++; ! #endif ! disp_message_nomouse(&s->ptr[offset], TRUE); } /* peek URL */ *************** *** 4140,4145 **** --- 4385,4394 ---- curURL(void) { static Str s = NULL; + #ifdef JP_CHARSET + static Lineprop *p = NULL; + Lineprop *pp; + #endif static int offset = 0, n; if (Currentbuf->bufferprop & BP_INTERNAL) *************** *** 4153,4179 **** else { offset = 0; s = currentURL(); } n = searchKeyNum(); if (n > 1 && s->length > (n - 1) * (COLS - 1)) ! disp_message_nomouse(&s->ptr[(n - 1) * (COLS - 1)], TRUE); ! else ! disp_message_nomouse(&s->ptr[offset], TRUE); } /* view HTML source */ void vwSrc(void) { - char *fn; Buffer *buf; if (Currentbuf->type == NULL || Currentbuf->bufferprop & BP_FRAME) return; - #ifdef USE_IMAGE - if (!strncasecmp(Currentbuf->real_type, "image/", 6)) - return; - #endif if ((buf = Currentbuf->linkBuffer[LB_SOURCE]) != NULL || (buf = Currentbuf->linkBuffer[LB_N_SOURCE]) != NULL) { Currentbuf = buf; --- 4402,4433 ---- else { offset = 0; s = currentURL(); + if (DecodeURL) + s = Strnew_charp(url_unquote_conv(s->ptr, 0)); + #ifdef JP_CHARSET + s = checkType(s, &pp, NULL); + p = NewAtom_N(Lineprop, s->length); + bcopy((void *)pp, (void *)p, s->length * sizeof(Lineprop)); + #endif } n = searchKeyNum(); if (n > 1 && s->length > (n - 1) * (COLS - 1)) ! offset = (n - 1) * (COLS - 1); ! #ifdef JP_CHARSET ! if (CharType(p[offset]) == PC_KANJI2) ! offset++; ! #endif ! disp_message_nomouse(&s->ptr[offset], TRUE); } /* view HTML source */ void vwSrc(void) { Buffer *buf; if (Currentbuf->type == NULL || Currentbuf->bufferprop & BP_FRAME) return; if ((buf = Currentbuf->linkBuffer[LB_SOURCE]) != NULL || (buf = Currentbuf->linkBuffer[LB_N_SOURCE]) != NULL) { Currentbuf = buf; *************** *** 4185,4244 **** !strcasecmp(Currentbuf->type, "text/plain")) { FILE *f; Str tmpf = tmpfname(TMPF_SRC, NULL); - pushText(fileToDelete, tmpf->ptr); f = fopen(tmpf->ptr, "w"); if (f == NULL) return; ! saveBuffer(Currentbuf, f); fclose(f); ! fn = tmpf->ptr; } else { return; } } ! else if (Currentbuf->real_scheme == SCM_LOCAL) { ! fn = Currentbuf->filename; ! } ! else { ! fn = Currentbuf->sourcefile; ! } if (!strcasecmp(Currentbuf->type, "text/html")) { - #ifdef JP_CHARSET - char old_code = DocumentCode; - DocumentCode = Currentbuf->document_code; - #endif - buf = loadFile(fn); - #ifdef JP_CHARSET - DocumentCode = old_code; - #endif - if (buf == NULL) - return; buf->type = "text/plain"; if (Currentbuf->real_type && !strcasecmp(Currentbuf->real_type, "text/html")) buf->real_type = "text/plain"; else buf->real_type = Currentbuf->real_type; - buf->bufferprop |= BP_SOURCE; buf->buffername = Sprintf("source of %s", Currentbuf->buffername)->ptr; buf->linkBuffer[LB_N_SOURCE] = Currentbuf; Currentbuf->linkBuffer[LB_SOURCE] = buf; } else if (!strcasecmp(Currentbuf->type, "text/plain")) { ! DefaultType = "text/html"; ! buf = loadGeneralFile(file_to_url(fn), NULL, NO_REFERER, 0, NULL); ! DefaultType = NULL; ! if (buf == NULL || buf == NO_BUFFER) ! return; if (Currentbuf->real_type && !strcasecmp(Currentbuf->real_type, "text/plain")) buf->real_type = "text/html"; else buf->real_type = Currentbuf->real_type; ! if (!strcmp(buf->buffername, conv_from_system(lastFileName(fn)))) ! buf->buffername = ! Sprintf("HTML view of %s", Currentbuf->buffername)->ptr; buf->linkBuffer[LB_SOURCE] = Currentbuf; Currentbuf->linkBuffer[LB_N_SOURCE] = buf; } --- 4439,4478 ---- !strcasecmp(Currentbuf->type, "text/plain")) { FILE *f; Str tmpf = tmpfname(TMPF_SRC, NULL); f = fopen(tmpf->ptr, "w"); if (f == NULL) return; ! saveBufferBody(Currentbuf, f, TRUE); fclose(f); ! Currentbuf->sourcefile = tmpf->ptr; } else { return; } } ! ! buf = newBuffer(INIT_BUFFER_WIDTH); ! if (!strcasecmp(Currentbuf->type, "text/html")) { buf->type = "text/plain"; if (Currentbuf->real_type && !strcasecmp(Currentbuf->real_type, "text/html")) buf->real_type = "text/plain"; else buf->real_type = Currentbuf->real_type; buf->buffername = Sprintf("source of %s", Currentbuf->buffername)->ptr; buf->linkBuffer[LB_N_SOURCE] = Currentbuf; Currentbuf->linkBuffer[LB_SOURCE] = buf; } else if (!strcasecmp(Currentbuf->type, "text/plain")) { ! buf->type = "text/html"; if (Currentbuf->real_type && !strcasecmp(Currentbuf->real_type, "text/plain")) buf->real_type = "text/html"; else buf->real_type = Currentbuf->real_type; ! buf->buffername = Sprintf("HTML view of %s", ! Currentbuf->buffername)->ptr; buf->linkBuffer[LB_SOURCE] = Currentbuf; Currentbuf->linkBuffer[LB_N_SOURCE] = buf; } *************** *** 4247,4255 **** --- 4481,4498 ---- } buf->currentURL = Currentbuf->currentURL; buf->real_scheme = Currentbuf->real_scheme; + buf->filename = Currentbuf->filename; buf->sourcefile = Currentbuf->sourcefile; + buf->header_source = Currentbuf->header_source; + buf->search_header = Currentbuf->search_header; + #ifdef JP_CHARSET + buf->document_code = Currentbuf->document_code; + #endif buf->clone = Currentbuf->clone; (*buf->clone)++; + + buf->need_reshape = TRUE; + reshapeBuffer(buf); pushBuffer(buf); displayBuffer(Currentbuf, B_NORMAL); } *************** *** 4267,4273 **** int multipart; if (Currentbuf->bufferprop & BP_INTERNAL) { ! disp_err_message("Can't reload...", FALSE); return; } if (Currentbuf->currentURL.scheme == SCM_LOCAL && --- 4510,4520 ---- int multipart; if (Currentbuf->bufferprop & BP_INTERNAL) { ! if (!strcmp(Currentbuf->buffername, DOWNLOAD_LIST_TITLE)) { ! ldDL(); ! return; ! } ! disp_err_message("Can't reload...", TRUE); return; } if (Currentbuf->currentURL.scheme == SCM_LOCAL && *************** *** 4283,4290 **** message("Rendering frame", 0, 0); refresh(); } ! if (!(buf = renderFrame(fbuf, 1))) return; if (fbuf->linkBuffer[LB_FRAME]) { if (buf->sourcefile && fbuf->linkBuffer[LB_FRAME]->sourcefile && --- 4530,4539 ---- message("Rendering frame", 0, 0); refresh(); } ! if (!(buf = renderFrame(fbuf, 1))) { ! displayBuffer(Currentbuf, B_NORMAL); return; + } if (fbuf->linkBuffer[LB_FRAME]) { if (buf->sourcefile && fbuf->linkBuffer[LB_FRAME]->sourcefile && *************** *** 4340,4349 **** if (multipart) unlink(request->body); if (buf == NULL) { ! disp_err_message("Can't reload...", FALSE); return; } else if (buf == NO_BUFFER) { return; } if (fbuf != NULL) --- 4589,4599 ---- if (multipart) unlink(request->body); if (buf == NULL) { ! disp_err_message("Can't reload...", TRUE); return; } else if (buf == NO_BUFFER) { + displayBuffer(Currentbuf, B_NORMAL); return; } if (fbuf != NULL) *************** *** 4365,4370 **** --- 4615,4629 ---- displayBuffer(Currentbuf, B_FORCE_REDRAW); } + /* reshape */ + void + reshape(void) + { + Currentbuf->need_reshape = TRUE; + reshapeBuffer(Currentbuf); + displayBuffer(Currentbuf, B_FORCE_REDRAW); + } + /* mark URL-like patterns as anchors */ void chkURLBuffer(Buffer *buf) *************** *** 4411,4417 **** { char *p; int spos, epos; ! p = getCurWord(Currentbuf, &spos, &epos, ":\"\'`<>"); if (p == NULL) return; reAnchorWord(Currentbuf, Currentbuf->currentLine, spos, epos); --- 4670,4676 ---- { char *p; int spos, epos; ! p = getCurWord(Currentbuf, &spos, &epos, ":\"\'`<>()[]{}&|;*?$"); if (p == NULL) return; reAnchorWord(Currentbuf, Currentbuf->currentLine, spos, epos); *************** *** 4424,4430 **** chkNMIDBuffer(Buffer *buf) { static char *url_like_pat[] = { ! "<[^<> ][^<> ]*@[A-z0-9\\.\\-_]+>", NULL, }; int i; --- 4683,4689 ---- chkNMIDBuffer(Buffer *buf) { static char *url_like_pat[] = { ! "<[!-;=?-~]+@[a-zA-Z0-9\\.\\-_]+>", NULL, }; int i; *************** *** 4465,4472 **** refresh(); } buf = renderFrame(Currentbuf, 0); ! if (buf == NULL) return; buf->linkBuffer[LB_N_FRAME] = Currentbuf; Currentbuf->linkBuffer[LB_FRAME] = buf; pushBuffer(buf); --- 4724,4733 ---- refresh(); } buf = renderFrame(Currentbuf, 0); ! if (buf == NULL) { ! displayBuffer(Currentbuf, B_NORMAL); return; + } buf->linkBuffer[LB_N_FRAME] = Currentbuf; Currentbuf->linkBuffer[LB_FRAME] = buf; pushBuffer(buf); *************** *** 4506,4513 **** else { browser = conv_to_system(browser); } ! if (browser == NULL || *browser == '\0') return; if ((len = strlen(browser)) >= 2 && browser[len - 1] == '&' && browser[len - 2] != '\\') { --- 4767,4776 ---- else { browser = conv_to_system(browser); } ! if (browser == NULL || *browser == '\0') { ! displayBuffer(Currentbuf, B_NORMAL); return; + } if ((len = strlen(browser)) >= 2 && browser[len - 1] == '&' && browser[len - 2] != '\\') { *************** *** 4526,4532 **** extbrz() { if (Currentbuf->bufferprop & BP_INTERNAL) { ! disp_err_message("Can't browse...", FALSE); return; } if (Currentbuf->currentURL.scheme == SCM_LOCAL && --- 4789,4795 ---- extbrz() { if (Currentbuf->bufferprop & BP_INTERNAL) { ! disp_err_message("Can't browse...", TRUE); return; } if (Currentbuf->currentURL.scheme == SCM_LOCAL && *************** *** 4557,4585 **** void curlno() { Str tmp; ! int cur = 0, all, col, len = 0; ! if (Currentbuf->currentLine != NULL) { ! Line *l = Currentbuf->currentLine; cur = l->real_linenumber; if (l->width < 0) l->width = COLPOS(l, l->len); ! len = l->width; } ! col = Currentbuf->currentColumn + Currentbuf->cursorX + 1; ! all = ! (Currentbuf->lastLine ? Currentbuf->lastLine-> ! real_linenumber : Currentbuf->allLine); ! if (all == 0 && Currentbuf->lastLine != NULL) ! all = Currentbuf->currentLine->real_linenumber; ! if (all == 0) ! all = 1; if (Currentbuf->pagerSource && !(Currentbuf->bufferprop & BP_CLOSE)) tmp = Sprintf("line %d col %d/%d", cur, col, len); else ! tmp = Sprintf("line %d/%d (%d%%) col %d/%d", ! cur, all, cur * 100 / all, col, len); #ifdef JP_CHARSET Strcat_charp(tmp, " "); Strcat_charp(tmp, code_to_str(Currentbuf->document_code)); --- 4820,4846 ---- void curlno() { + Line *l = Currentbuf->currentLine; Str tmp; ! int cur = 0, all = 0, col = 0, len = 0; ! if (l != NULL) { cur = l->real_linenumber; + col = l->bwidth + Currentbuf->currentColumn + Currentbuf->cursorX + 1; + while (l->next && l->next->bpos) + l = l->next; if (l->width < 0) l->width = COLPOS(l, l->len); ! len = l->bwidth + l->width; } ! if (Currentbuf->lastLine) ! all = Currentbuf->lastLine->real_linenumber; if (Currentbuf->pagerSource && !(Currentbuf->bufferprop & BP_CLOSE)) tmp = Sprintf("line %d col %d/%d", cur, col, len); else ! tmp = Sprintf("line %d/%d (%d%%) col %d/%d", cur, all, ! (int)((double)cur * 100.0 / (double)(all ? all : 1) ! + 0.5), col, len); #ifdef JP_CHARSET Strcat_charp(tmp, " "); Strcat_charp(tmp, code_to_str(Currentbuf->document_code)); *************** *** 4622,4637 **** #ifdef USE_MOUSE static void process_mouse(int btn, int x, int y) { int delta_x, delta_y, i; static int press_btn = MOUSE_BTN_RESET, press_x, press_y; if (btn == MOUSE_BTN_UP) { switch (press_btn) { case MOUSE_BTN1_DOWN: ! if (press_x != x || press_y != y) { delta_x = x - press_x; delta_y = y - press_y; --- 4883,5049 ---- #ifdef USE_MOUSE + static int + mouse_scroll_line(void) + { + if (relative_wheel_scroll) + return (relative_wheel_scroll_ratio * LASTLINE + 99) / 100; + else + return fixed_wheel_scroll_count; + } + + static TabBuffer * + posTab(int x, int y) + { + TabBuffer *tab; + + if (mouse_action.menu_str && x < mouse_action.menu_width && y == 0) + return NO_TABBUFFER; + if (y > LastTab->y) + return NULL; + for (tab = FirstTab; tab; tab = tab->nextTab) { + if (tab->x1 <= x && x <= tab->x2 && tab->y == y) + return tab; + } + return NULL; + } + + static void + do_mouse_action(int btn, int x, int y) + { + MouseActionMap *map = NULL; + int ny = -1; + + if (nTab > 1 || mouse_action.menu_str) + ny = LastTab->y + 1; + + switch (btn) { + case MOUSE_BTN1_DOWN: + btn = 0; + break; + case MOUSE_BTN2_DOWN: + btn = 1; + break; + case MOUSE_BTN3_DOWN: + btn = 2; + break; + default: + return; + } + if (y < ny) { + if (mouse_action.menu_str && x >= 0 && x < mouse_action.menu_width) { + if (mouse_action.menu_map[btn]) + map = &mouse_action.menu_map[btn][x]; + } + else + map = &mouse_action.tab_map[btn]; + } + else if (y == LASTLINE) { + if (mouse_action.lastline_str && x >= 0 && + x < mouse_action.lastline_width) { + if (mouse_action.lastline_map[btn]) + map = &mouse_action.lastline_map[btn][x]; + } + } + else if (y > ny) { + if (y == Currentbuf->cursorY + Currentbuf->rootY && + (x == Currentbuf->cursorX + Currentbuf->rootX + #ifdef JP_CHARSET + || (Currentbuf->currentLine != NULL && + (Currentbuf->currentLine-> + propBuf[Currentbuf->pos] & PC_KANJI1) + && x == Currentbuf->cursorX + Currentbuf->rootX + 1) + #endif /* JP_CHARSET */ + )) { + if (retrieveCurrentAnchor(Currentbuf) || + retrieveCurrentForm(Currentbuf)) { + map = &mouse_action.active_map[btn]; + if (!(map && map->func)) + map = &mouse_action.anchor_map[btn]; + } + } + else { + int cx = Currentbuf->cursorX, cy = Currentbuf->cursorY; + cursorXY(Currentbuf, x - Currentbuf->rootX, y - Currentbuf->rootY); + if (y == Currentbuf->cursorY + Currentbuf->rootY && + (x == Currentbuf->cursorX + Currentbuf->rootX + #ifdef JP_CHARSET + || (Currentbuf->currentLine != NULL && + (Currentbuf->currentLine-> + propBuf[Currentbuf->pos] & PC_KANJI1) + && x == Currentbuf->cursorX + Currentbuf->rootX + 1) + #endif /* JP_CHARSET */ + ) && + (retrieveCurrentAnchor(Currentbuf) || + retrieveCurrentForm(Currentbuf))) + map = &mouse_action.anchor_map[btn]; + cursorXY(Currentbuf, cx, cy); + } + } + if (!(map && map->func)) + map = &mouse_action.default_map[btn]; + if (map && map->func) { + mouse_action.in_action = TRUE; + mouse_action.cursorX = x; + mouse_action.cursorY = y; + CurrentKey = -1; + CurrentKeyData = NULL; + CurrentCmdData = map->data; + (*map->func) (); + CurrentCmdData = NULL; + } + } + static void process_mouse(int btn, int x, int y) { int delta_x, delta_y, i; static int press_btn = MOUSE_BTN_RESET, press_x, press_y; + TabBuffer *t; + int ny = -1; + if (nTab > 1 || mouse_action.menu_str) + ny = LastTab->y + 1; if (btn == MOUSE_BTN_UP) { switch (press_btn) { case MOUSE_BTN1_DOWN: ! if (press_y == y && press_x == x) ! do_mouse_action(press_btn, x, y); ! else if (ny > 0 && y < ny) { ! if (press_y < ny) { ! moveTab(posTab(press_x, press_y), posTab(x, y), ! (press_y == y) ? (press_x < x) : (press_y < y)); ! return; ! } ! else if (press_x >= Currentbuf->rootX) { ! Buffer *buf = Currentbuf; ! int cx = Currentbuf->cursorX, cy = Currentbuf->cursorY; ! ! t = posTab(x, y); ! if (t == NULL) ! return; ! if (t == NO_TABBUFFER) ! t = NULL; /* open new tab */ ! cursorXY(Currentbuf, press_x - Currentbuf->rootX, ! press_y - Currentbuf->rootY); ! if (Currentbuf->cursorY == press_y - Currentbuf->rootY && ! (Currentbuf->cursorX == press_x - Currentbuf->rootX ! #ifdef JP_CHARSET ! || (Currentbuf->currentLine != NULL && ! (Currentbuf->currentLine->propBuf[Currentbuf->pos] ! & PC_KANJI1) && Currentbuf->cursorX == press_x ! - Currentbuf->rootX - 1) ! #endif ! )) { ! displayBuffer(Currentbuf, B_NORMAL); ! followTab(t); ! } ! if (buf == Currentbuf) ! cursorXY(Currentbuf, cx, cy); ! } ! return; ! } ! else { delta_x = x - press_x; delta_y = y - press_y; *************** *** 4660,4728 **** col1R(); } } - else { - if (y == LASTLINE) { - switch (x) { - case 0: - case 1: - backBf(); - break; - case 2: - case 3: - pgBack(); - break; - case 4: - case 5: - pgFore(); - break; - } - return; - } - if (y == Currentbuf->cursorY && - (x == Currentbuf->cursorX + Currentbuf->rootX - #ifdef JP_CHARSET - || (Currentbuf->currentLine != NULL && - (Currentbuf->currentLine-> - propBuf[Currentbuf->pos] & PC_KANJI1) - && x == Currentbuf->cursorX + Currentbuf->rootX + 1) - #endif /* JP_CHARSET */ - )) { - followA(); - return; - } - if (x >= Currentbuf->rootX) - cursorXY(Currentbuf, x - Currentbuf->rootX, y); - displayBuffer(Currentbuf, B_NORMAL); - - } break; case MOUSE_BTN2_DOWN: - backBf(); - break; case MOUSE_BTN3_DOWN: ! #ifdef USE_MENU ! if (x >= Currentbuf->rootX) ! cursorXY(Currentbuf, x - Currentbuf->rootX, y); ! onA(); ! mainMenu(x, y); ! #endif /* USE_MENU */ break; case MOUSE_BTN4_DOWN_RXVT: ! for (i = 0; i < MOUSE_SCROLL_LINE; i++) ldown1(); break; case MOUSE_BTN5_DOWN_RXVT: ! for (i = 0; i < MOUSE_SCROLL_LINE; i++) lup1(); break; } } else if (btn == MOUSE_BTN4_DOWN_XTERM) { ! for (i = 0; i < MOUSE_SCROLL_LINE; i++) ldown1(); } else if (btn == MOUSE_BTN5_DOWN_XTERM) { ! for (i = 0; i < MOUSE_SCROLL_LINE; i++) lup1(); } --- 5072,5099 ---- col1R(); } } break; case MOUSE_BTN2_DOWN: case MOUSE_BTN3_DOWN: ! if (press_y == y && press_x == x) ! do_mouse_action(press_btn, x, y); break; case MOUSE_BTN4_DOWN_RXVT: ! for (i = 0; i < mouse_scroll_line(); i++) ldown1(); break; case MOUSE_BTN5_DOWN_RXVT: ! for (i = 0; i < mouse_scroll_line(); i++) lup1(); break; } } else if (btn == MOUSE_BTN4_DOWN_XTERM) { ! for (i = 0; i < mouse_scroll_line(); i++) ldown1(); } else if (btn == MOUSE_BTN5_DOWN_XTERM) { ! for (i = 0; i < mouse_scroll_line(); i++) lup1(); } *************** *** 4754,4759 **** --- 5125,5138 ---- int btn, x, y; btn = (unsigned char)getch() - 32; + #if defined(__CYGWIN__) + if (cygwin_mouse_btn_swapped) { + if (btn == MOUSE_BTN2_DOWN) + btn = MOUSE_BTN3_DOWN; + else if (btn == MOUSE_BTN3_DOWN) + btn = MOUSE_BTN2_DOWN; + } + #endif x = (unsigned char)getch() - 33; if (x < 0) x += 0x100; *************** *** 4818,4829 **** return 0; } #endif /* USE_SYSMOUSE */ #endif /* USE_MOUSE */ void dispVer() { ! disp_message(Sprintf("w3m version %s", w3m_version)->ptr, FALSE); } void --- 5197,5276 ---- return 0; } #endif /* USE_SYSMOUSE */ + + void + movMs(void) + { + if (!mouse_action.in_action) + return; + if ((nTab > 1 || mouse_action.menu_str) && + mouse_action.cursorY < LastTab->y + 1) + return; + else if (mouse_action.cursorX >= Currentbuf->rootX && + mouse_action.cursorY < LASTLINE) { + cursorXY(Currentbuf, mouse_action.cursorX - Currentbuf->rootX, + mouse_action.cursorY - Currentbuf->rootY); + } + displayBuffer(Currentbuf, B_NORMAL); + } + + #ifdef USE_MENU + #ifdef KANJI_SYMBOLS + #define FRAME_WIDTH 2 + #else + #define FRAME_WIDTH 1 + #endif + void + menuMs(void) + { + if (!mouse_action.in_action) + return; + if ((nTab > 1 || mouse_action.menu_str) && + mouse_action.cursorY < LastTab->y + 1) + mouse_action.cursorX -= FRAME_WIDTH + 1; + else if (mouse_action.cursorX >= Currentbuf->rootX && + mouse_action.cursorY < LASTLINE) { + cursorXY(Currentbuf, mouse_action.cursorX - Currentbuf->rootX, + mouse_action.cursorY - Currentbuf->rootY); + displayBuffer(Currentbuf, B_NORMAL); + } + mainMn(); + } + #endif + + void + tabMs(void) + { + TabBuffer *tab; + + if (!mouse_action.in_action) + return; + tab = posTab(mouse_action.cursorX, mouse_action.cursorY); + if (!tab || tab == NO_TABBUFFER) + return; + CurrentTab = tab; + displayBuffer(Currentbuf, B_FORCE_REDRAW); + } + + void + closeTMs(void) + { + TabBuffer *tab; + + if (!mouse_action.in_action) + return; + tab = posTab(mouse_action.cursorX, mouse_action.cursorY); + if (!tab || tab == NO_TABBUFFER) + return; + deleteTab(tab); + displayBuffer(Currentbuf, B_FORCE_REDRAW); + } #endif /* USE_MOUSE */ void dispVer() { ! disp_message(Sprintf("w3m version %s", w3m_version)->ptr, TRUE); } void *************** *** 4831,4841 **** { if (WrapSearch) { WrapSearch = FALSE; ! disp_message("Wrap search off", FALSE); } else { WrapSearch = TRUE; ! disp_message("Wrap search on", FALSE); } } --- 5278,5288 ---- { if (WrapSearch) { WrapSearch = FALSE; ! disp_message("Wrap search off", TRUE); } else { WrapSearch = TRUE; ! disp_message("Wrap search on", TRUE); } } *************** *** 4907,4913 **** Str_form_quote(Strnew_charp(w))->ptr)->ptr; buf = loadGeneralFile(dictcmd, NULL, NO_REFERER, 0, NULL); if (buf == NULL) { ! disp_message("Execution failed", FALSE); } else { buf->filename = w; --- 5354,5361 ---- Str_form_quote(Strnew_charp(w))->ptr)->ptr; buf = loadGeneralFile(dictcmd, NULL, NO_REFERER, 0, NULL); if (buf == NULL) { ! disp_message("Execution failed", TRUE); ! return; } else { buf->filename = w; *************** *** 4935,4984 **** void set_buffer_environ(Buffer *buf) { ! Anchor *a; ! Str s; ! ParsedURL pu; if (buf == NULL) return; ! set_environ("W3M_SOURCEFILE", buf->sourcefile); ! set_environ("W3M_FILENAME", buf->filename); ! set_environ("W3M_CURRENT_WORD", GetWord(buf)); ! set_environ("W3M_TITLE", buf->buffername); ! set_environ("W3M_URL", parsedURL2Str(&buf->currentURL)->ptr); ! if (buf->real_type) ! set_environ("W3M_TYPE", buf->real_type); ! else ! set_environ("W3M_TYPE", "unknown"); #ifdef JP_CHARSET ! set_environ("W3M_CHARSET", code_to_str(buf->document_code)); #endif /* JP_CHARSET */ - a = retrieveCurrentAnchor(buf); - if (a == NULL) { - set_environ("W3M_CURRENT_LINK", ""); } ! else { ! parseURL2(a->url, &pu, baseURL(buf)); ! s = parsedURL2Str(&pu); ! set_environ("W3M_CURRENT_LINK", s->ptr); } ! a = retrieveCurrentImg(buf); ! if (a == NULL) { set_environ("W3M_CURRENT_IMG", ""); - } - else { - parseURL2(a->url, &pu, baseURL(buf)); - s = parsedURL2Str(&pu); - set_environ("W3M_CURRENT_IMG", s->ptr); - } - a = retrieveCurrentForm(buf); - if (a == NULL) { set_environ("W3M_CURRENT_FORM", ""); } ! else { ! s = Strnew_charp(form2str((FormItemList *)a->url)); ! set_environ("W3M_CURRENT_FORM", s->ptr); ! } } char * --- 5383,5447 ---- void set_buffer_environ(Buffer *buf) { ! static Buffer *prev_buf = NULL; ! static Line *prev_line = NULL; ! static int prev_pos = -1; ! Line *l; if (buf == NULL) return; ! if (buf != prev_buf) { ! set_environ("W3M_SOURCEFILE", buf->sourcefile); ! set_environ("W3M_FILENAME", buf->filename); ! set_environ("W3M_TITLE", buf->buffername); ! set_environ("W3M_URL", parsedURL2Str(&buf->currentURL)->ptr); ! set_environ("W3M_TYPE", buf->real_type ? buf->real_type : "unknown"); #ifdef JP_CHARSET ! set_environ("W3M_CHARSET", code_to_str(buf->document_code)); #endif /* JP_CHARSET */ } ! l = buf->currentLine; ! if (l && (buf != prev_buf || l != prev_line || buf->pos != prev_pos)) { ! Anchor *a; ! ParsedURL pu; ! char *s = GetWord(buf); ! set_environ("W3M_CURRENT_WORD", s ? s : ""); ! a = retrieveCurrentAnchor(buf); ! if (a) { ! parseURL2(a->url, &pu, baseURL(buf)); ! set_environ("W3M_CURRENT_LINK", parsedURL2Str(&pu)->ptr); ! } ! else ! set_environ("W3M_CURRENT_LINK", ""); ! a = retrieveCurrentImg(buf); ! if (a) { ! parseURL2(a->url, &pu, baseURL(buf)); ! set_environ("W3M_CURRENT_IMG", parsedURL2Str(&pu)->ptr); ! } ! else ! set_environ("W3M_CURRENT_IMG", ""); ! a = retrieveCurrentForm(buf); ! if (a) ! set_environ("W3M_CURRENT_FORM", form2str((FormItemList *)a->url)); ! else ! set_environ("W3M_CURRENT_FORM", ""); ! set_environ("W3M_CURRENT_LINE", Sprintf("%d", ! l->real_linenumber)->ptr); ! set_environ("W3M_CURRENT_COLUMN", Sprintf("%d", ! buf->currentColumn + ! buf->cursorX + 1)->ptr); } ! else if (!l) { ! set_environ("W3M_CURRENT_WORD", ""); ! set_environ("W3M_CURRENT_LINK", ""); set_environ("W3M_CURRENT_IMG", ""); set_environ("W3M_CURRENT_FORM", ""); + set_environ("W3M_CURRENT_LINE", "0"); + set_environ("W3M_CURRENT_COLUMN", "0"); } ! prev_buf = buf; ! prev_line = l; ! prev_pos = buf->pos; } char * *************** *** 5016,5025 **** { Buffer *buf; char *f; ! while (Firstbuf && Firstbuf != NO_BUFFER) { ! buf = Firstbuf->nextBuffer; ! discardBuffer(Firstbuf); ! Firstbuf = buf; } while ((f = popText(fileToDelete)) != NULL) unlink(f); --- 5479,5491 ---- { Buffer *buf; char *f; ! ! for (CurrentTab = FirstTab; CurrentTab; CurrentTab = CurrentTab->nextTab) { ! while (Firstbuf && Firstbuf != NO_BUFFER) { ! buf = Firstbuf->nextBuffer; ! discardBuffer(Firstbuf); ! Firstbuf = buf; ! } } while ((f = popText(fileToDelete)) != NULL) unlink(f); *************** *** 5031,5040 **** --- 5497,5511 ---- #ifdef USE_MIGEMO init_migemo(); /* close pipe to migemo */ #endif + stopDownload(); deleteFiles(); #ifdef USE_SSL free_ssl_ctx(); #endif + disconnectFTP(); + #ifdef USE_NNTP + disconnectNews(); + #endif exit(i); } *************** *** 5088,5125 **** { char *data; ! if (alarm_sec > 0) { CurrentKey = -1; CurrentKeyData = NULL; ! CurrentCmdData = data = (char *)alarm_event.user_data; #ifdef USE_MOUSE if (use_mouse) mouse_inactive(); #endif ! w3mFuncList[alarm_event.cmd].func(); #ifdef USE_MOUSE if (use_mouse) mouse_active(); #endif CurrentCmdData = NULL; ! onA(); ! if (alarm_status == AL_EXPLICIT) { ! disp_message_nsec(Sprintf("%s %s", w3mFuncList[alarm_event.cmd].id, ! data ? data : "")->ptr, ! FALSE, alarm_sec - 1, FALSE, TRUE); ! } ! else if (alarm_status == AL_IMPLICIT) { ! alarm_buffer = Currentbuf; ! alarm_status = AL_IMPLICIT_DONE; ! } ! else if ((alarm_status == AL_IMPLICIT_DONE ! && alarm_buffer != Currentbuf) ! || alarm_status == AL_IMPLICIT_ONCE) { ! setAlarmEvent(0, AL_UNSET, FUNCNAME_nulcmd, NULL); } ! if (alarm_sec > 0) { signal(SIGALRM, SigAlarm); ! alarm(alarm_sec); } } SIGNAL_RETURN; --- 5559,5593 ---- { char *data; ! if (CurrentAlarm->sec > 0) { CurrentKey = -1; CurrentKeyData = NULL; ! CurrentCmdData = data = (char *)CurrentAlarm->data; #ifdef USE_MOUSE if (use_mouse) mouse_inactive(); #endif ! w3mFuncList[CurrentAlarm->cmd].func(); #ifdef USE_MOUSE if (use_mouse) mouse_active(); #endif CurrentCmdData = NULL; ! if (CurrentAlarm->status == AL_IMPLICIT_ONCE) { ! CurrentAlarm->sec = 0; ! CurrentAlarm->status = AL_UNSET; ! } ! if (Currentbuf->event) { ! if (Currentbuf->event->status != AL_UNSET) ! CurrentAlarm = Currentbuf->event; ! else ! Currentbuf->event = NULL; } ! if (!Currentbuf->event) ! CurrentAlarm = &DefaultAlarm; ! if (CurrentAlarm->sec > 0) { signal(SIGALRM, SigAlarm); ! alarm(CurrentAlarm->sec); } } SIGNAL_RETURN; *************** *** 5147,5173 **** } if (cmd >= 0) { data = getQWord(&data); ! setAlarmEvent(sec, AL_EXPLICIT, cmd, data); ! disp_message_nsec(Sprintf("%s %s", w3mFuncList[cmd].id, data)->ptr, ! FALSE, sec - 1, FALSE, TRUE); } else { ! setAlarmEvent(0, AL_UNSET, FUNCNAME_nulcmd, NULL); } displayBuffer(Currentbuf, B_NORMAL); } ! void ! setAlarmEvent(int sec, short status, int cmd, void *data) { ! if (status == AL_UNSET || status == AL_EXPLICIT ! || status == AL_IMPLICIT_ONCE ! || (status == AL_IMPLICIT && alarm_status != AL_EXPLICIT)) { ! alarm_sec = sec; ! alarm_status = status; ! alarm_event.cmd = cmd; ! alarm_event.user_data = data; ! } } #endif --- 5615,5640 ---- } if (cmd >= 0) { data = getQWord(&data); ! setAlarmEvent(&DefaultAlarm, sec, AL_EXPLICIT, cmd, data); ! disp_message_nsec(Sprintf("%dsec %s %s", sec, w3mFuncList[cmd].id, ! data)->ptr, FALSE, 1, FALSE, TRUE); } else { ! setAlarmEvent(&DefaultAlarm, 0, AL_UNSET, FUNCNAME_nulcmd, NULL); } displayBuffer(Currentbuf, B_NORMAL); } ! AlarmEvent * ! setAlarmEvent(AlarmEvent * event, int sec, short status, int cmd, void *data) { ! if (event == NULL) ! event = New(AlarmEvent); ! event->sec = sec; ! event->status = status; ! event->cmd = cmd; ! event->data = data; ! return event; } #endif *************** *** 5177,5195 **** char *resource = searchKeyData(); if (resource == NULL) { ! init_rc(config_filename); #ifdef USE_COOKIE initCookie(); #endif ! initKeymap(TRUE); ! #ifdef USE_MENU ! initMenu(); ! #endif return; } if (!strcasecmp(resource, "CONFIG") || !strcasecmp(resource, "RC")) { ! init_rc(config_filename); return; } --- 5644,5662 ---- char *resource = searchKeyData(); if (resource == NULL) { ! init_rc(); ! sync_with_option(); #ifdef USE_COOKIE initCookie(); #endif ! displayBuffer(Currentbuf, B_REDRAW_IMAGE); return; } if (!strcasecmp(resource, "CONFIG") || !strcasecmp(resource, "RC")) { ! init_rc(); ! sync_with_option(); ! displayBuffer(Currentbuf, B_REDRAW_IMAGE); return; } *************** *** 5210,5215 **** --- 5677,5690 ---- return; } + #ifdef USE_MOUSE + if (!strcasecmp(resource, "MOUSE")) { + initMouseAction(); + displayBuffer(Currentbuf, B_REDRAW_IMAGE); + return; + } + #endif + #ifdef USE_MENU if (!strcasecmp(resource, "MENU")) { initMenu(); *************** *** 5250,5252 **** --- 5725,6459 ---- setKeymap(allocStr(data, -1), -1, TRUE); displayBuffer(Currentbuf, B_NORMAL); } + + TabBuffer * + newTab(void) + { + TabBuffer *n; + + n = New(TabBuffer); + if (n == NULL) + return NULL; + n->nextTab = NULL; + n->currentBuffer = NULL; + n->firstBuffer = NULL; + return n; + } + + static void + _newT(void) + { + TabBuffer *tag; + Buffer *buf; + int i; + + tag = newTab(); + if (!tag) + return; + + buf = newBuffer(Currentbuf->width); + copyBuffer(buf, Currentbuf); + buf->nextBuffer = NULL; + for (i = 0; i < MAX_LB; i++) + buf->linkBuffer[i] = NULL; + (*buf->clone)++; + tag->firstBuffer = tag->currentBuffer = buf; + + tag->nextTab = CurrentTab->nextTab; + tag->prevTab = CurrentTab; + if (CurrentTab->nextTab) + CurrentTab->nextTab->prevTab = tag; + else + LastTab = tag; + CurrentTab->nextTab = tag; + CurrentTab = tag; + nTab++; + } + + void + newT(void) + { + _newT(); + displayBuffer(Currentbuf, B_REDRAW_IMAGE); + } + + static TabBuffer * + numTab(int n) + { + TabBuffer *tab; + int i; + + if (n == 0) + return CurrentTab; + if (n == 1) + return FirstTab; + if (nTab <= 1) + return NULL; + for (tab = FirstTab, i = 1; tab && i < n; tab = tab->nextTab, i++) ; + return tab; + } + + void + calcTabPos(void) + { + TabBuffer *tab; + #if 0 + int lcol = 0, rcol = 2, col; + #else + int lcol = 0, rcol = 0, col; + #endif + int n1, n2, na, nx, ny, ix, iy; + + #ifdef USE_MOUSE + lcol = mouse_action.menu_str ? mouse_action.menu_width : 0; + #endif + + if (nTab <= 0) + return; + n1 = (COLS - rcol - lcol) / TabCols; + if (n1 >= nTab) { + n2 = 1; + ny = 1; + } + else { + if (n1 < 0) + n1 = 0; + n2 = COLS / TabCols; + if (n2 == 0) + n2 = 1; + ny = (nTab - n1 - 1) / n2 + 2; + } + na = n1 + n2 * (ny - 1); + n1 -= (na - nTab) / ny; + if (n1 < 0) + n1 = 0; + na = n1 + n2 * (ny - 1); + tab = FirstTab; + for (iy = 0; iy < ny && tab; iy++) { + if (iy == 0) { + nx = n1; + col = COLS - rcol - lcol; + } + else { + nx = n2 - (na - nTab + (iy - 1)) / (ny - 1); + col = COLS; + } + for (ix = 0; ix < nx && tab; ix++, tab = tab->nextTab) { + tab->x1 = col * ix / nx; + tab->x2 = col * (ix + 1) / nx - 1; + tab->y = iy; + if (iy == 0) { + tab->x1 += lcol; + tab->x2 += lcol; + } + } + } + } + + TabBuffer * + deleteTab(TabBuffer * tab) + { + Buffer *buf, *next; + + if (nTab <= 1) + return FirstTab; + if (tab->prevTab) { + if (tab->nextTab) + tab->nextTab->prevTab = tab->prevTab; + else + LastTab = tab->prevTab; + tab->prevTab->nextTab = tab->nextTab; + if (tab == CurrentTab) + CurrentTab = tab->prevTab; + } + else { /* tab == FirstTab */ + tab->nextTab->prevTab = NULL; + FirstTab = tab->nextTab; + if (tab == CurrentTab) + CurrentTab = tab->nextTab; + } + nTab--; + buf = tab->firstBuffer; + while (buf && buf != NO_BUFFER) { + next = buf->nextBuffer; + discardBuffer(buf); + buf = next; + } + return FirstTab; + } + + void + closeT(void) + { + TabBuffer *tab; + + if (nTab <= 1) + return; + if (prec_num) + tab = numTab(PREC_NUM); + else + tab = CurrentTab; + if (tab) + deleteTab(tab); + displayBuffer(Currentbuf, B_REDRAW_IMAGE); + } + + void + nextT(void) + { + int i; + + if (nTab <= 1) + return; + for (i = 0; i < PREC_NUM; i++) { + if (CurrentTab->nextTab) + CurrentTab = CurrentTab->nextTab; + else + CurrentTab = FirstTab; + } + displayBuffer(Currentbuf, B_REDRAW_IMAGE); + } + + void + prevT(void) + { + int i; + + if (nTab <= 1) + return; + for (i = 0; i < PREC_NUM; i++) { + if (CurrentTab->prevTab) + CurrentTab = CurrentTab->prevTab; + else + CurrentTab = LastTab; + } + displayBuffer(Currentbuf, B_REDRAW_IMAGE); + } + + void + followTab(TabBuffer * tab) + { + Buffer *buf; + Anchor *a; + + #ifdef USE_IMAGE + a = retrieveCurrentImg(Currentbuf); + if (!(a && a->image && a->image->map)) + #endif + a = retrieveCurrentAnchor(Currentbuf); + if (a == NULL) + return; + + if (tab == CurrentTab) { + check_target = FALSE; + followA(); + check_target = TRUE; + return; + } + _newT(); + buf = Currentbuf; + check_target = FALSE; + followA(); + check_target = TRUE; + if (tab == NULL) { + if (buf != Currentbuf) + delBuffer(buf); + else + deleteTab(CurrentTab); + } + else if (buf != Currentbuf) { + /* buf <- p <- ... <- Currentbuf = c */ + Buffer *c, *p; + + c = Currentbuf; + p = prevBuffer(c, buf); + p->nextBuffer = NULL; + Firstbuf = buf; + deleteTab(CurrentTab); + CurrentTab = tab; + for (buf = p; buf; buf = p) { + p = prevBuffer(c, buf); + pushBuffer(buf); + } + } + displayBuffer(Currentbuf, B_FORCE_REDRAW); + } + + void + tabA(void) + { + followTab(prec_num ? numTab(PREC_NUM) : NULL); + } + + static void + tabURL0(TabBuffer * tab, char *prompt, int relative) + { + Buffer *buf; + + if (tab == CurrentTab) { + goURL0(prompt, relative); + return; + } + _newT(); + buf = Currentbuf; + goURL0(prompt, relative); + if (tab == NULL) { + if (buf != Currentbuf) + delBuffer(buf); + else + deleteTab(CurrentTab); + } + else if (buf != Currentbuf) { + /* buf <- p <- ... <- Currentbuf = c */ + Buffer *c, *p; + + c = Currentbuf; + p = prevBuffer(c, buf); + p->nextBuffer = NULL; + Firstbuf = buf; + deleteTab(CurrentTab); + CurrentTab = tab; + for (buf = p; buf; buf = p) { + p = prevBuffer(c, buf); + pushBuffer(buf); + } + } + displayBuffer(Currentbuf, B_FORCE_REDRAW); + } + + void + tabURL(void) + { + tabURL0(prec_num ? numTab(PREC_NUM) : NULL, + "Goto URL on new tab: ", FALSE); + } + + void + tabrURL(void) + { + tabURL0(prec_num ? numTab(PREC_NUM) : NULL, + "Goto relative URL on new tab: ", TRUE); + } + + void + moveTab(TabBuffer * t, TabBuffer * t2, int right) + { + if (t2 == NO_TABBUFFER) + t2 = FirstTab; + if (!t || !t2 || t == t2 || t == NO_TABBUFFER) + return; + if (t->prevTab) { + if (t->nextTab) + t->nextTab->prevTab = t->prevTab; + else + LastTab = t->prevTab; + t->prevTab->nextTab = t->nextTab; + } + else { + t->nextTab->prevTab = NULL; + FirstTab = t->nextTab; + } + if (right) { + t->nextTab = t2->nextTab; + t->prevTab = t2; + if (t2->nextTab) + t2->nextTab->prevTab = t; + else + LastTab = t; + t2->nextTab = t; + } + else { + t->prevTab = t2->prevTab; + t->nextTab = t2; + if (t2->prevTab) + t2->prevTab->nextTab = t; + else + FirstTab = t; + t2->prevTab = t; + } + displayBuffer(Currentbuf, B_FORCE_REDRAW); + } + + void + tabR(void) + { + TabBuffer *tab; + int i; + + for (tab = CurrentTab, i = 0; tab && i < PREC_NUM; + tab = tab->nextTab, i++) ; + moveTab(CurrentTab, tab ? tab : LastTab, TRUE); + } + + void + tabL(void) + { + TabBuffer *tab; + int i; + + for (tab = CurrentTab, i = 0; tab && i < PREC_NUM; + tab = tab->prevTab, i++) ; + moveTab(CurrentTab, tab ? tab : FirstTab, FALSE); + } + + void + addDownloadList(pid_t pid, char *url, char *save, char *lock, clen_t size) + { + DownloadList *d; + + d = New(DownloadList); + d->pid = pid; + d->url = url; + if (save[0] != '/' && save[0] != '~') + save = Strnew_m_charp(CurrentDir, "/", save, NULL)->ptr; + d->save = expandPath(save); + d->lock = lock; + d->size = size; + d->time = time(0); + d->ok = FALSE; + d->next = NULL; + d->prev = LastDL; + if (LastDL) + LastDL->next = d; + else + FirstDL = d; + LastDL = d; + add_download_list = TRUE; + } + + int + checkDownloadList(void) + { + DownloadList *d; + struct stat st; + + if (!FirstDL) + return FALSE; + for (d = FirstDL; d != NULL; d = d->next) { + if (!d->ok && !lstat(d->lock, &st)) + return TRUE; + } + return FALSE; + } + + static char * + convert_size3(clen_t size) + { + Str tmp = Strnew(); + int n; + + do { + n = size % 1000; + size /= 1000; + tmp = Sprintf(size ? ",%.3d%s" : "%d%s", n, tmp->ptr); + } while (size); + return tmp->ptr; + } + + static Buffer * + DownloadListBuffer(void) + { + DownloadList *d; + Str src = NULL; + struct stat st; + time_t cur_time; + int duration, rate, eta; + size_t size; + + if (!FirstDL) + return NULL; + cur_time = time(0); + src = Strnew_charp("" DOWNLOAD_LIST_TITLE + "\n

    " + DOWNLOAD_LIST_TITLE "

    \n" + "

    \n"); + for (d = LastDL; d != NULL; d = d->prev) { + if (lstat(d->lock, &st)) + d->ok = TRUE; + Strcat_charp(src, "
    \n");
    + 	Strcat(src, Sprintf("%s\n  --> %s\n  ", html_quote(d->url),
    + 			    html_quote(conv_from_system(d->save))));
    + 	duration = cur_time - d->time;
    + 	if (!stat(d->save, &st)) {
    + 	    size = st.st_size;
    + 	    if (d->ok) {
    + 		d->size = size;
    + 		duration = st.st_mtime - d->time;
    + 	    }
    + 	}
    + 	else
    + 	    size = 0;
    + 	if (d->size) {
    + 	    int i, l = COLS - 6;
    + 	    if (size < d->size)
    + 		i = l * size / d->size;
    + 	    else
    + 		i = l;
    + 	    l -= i;
    + 	    while (i-- > 0)
    + 		Strcat_char(src, '#');
    + 	    while (l-- > 0)
    + 		Strcat_char(src, '_');
    + 	    Strcat_char(src, '\n');
    + 	}
    + 	if (!d->ok && size < d->size)
    + 	    Strcat(src, Sprintf("  %s / %s bytes (%d%%)",
    + 				convert_size3(size), convert_size3(d->size),
    + 				(int)(100.0 * size / d->size)));
    + 	else
    + 	    Strcat(src, Sprintf("  %s bytes loaded", convert_size3(size)));
    + 	if (duration > 0) {
    + 	    rate = size / duration;
    + 	    Strcat(src, Sprintf("  %02d:%02d:%02d  rate %s/sec",
    + 				duration / (60 * 60), (duration / 60) % 60,
    + 				duration % 60, convert_size(rate, 1)));
    + 	    if (!d->ok && size < d->size && rate) {
    + 		eta = (d->size - size) / rate;
    + 		Strcat(src, Sprintf("  eta %02d:%02d:%02d", eta / (60 * 60),
    + 				    (eta / 60) % 60, eta % 60));
    + 	    }
    + 	}
    + 	Strcat_char(src, '\n');
    + 	if (d->ok) {
    + 	    Strcat(src, Sprintf("",
    + 				d->pid));
    + 	    if (size < d->size)
    + 		Strcat_charp(src, " Download incompleted");
    + 	    else
    + 		Strcat_charp(src, " Download completed");
    + 	}
    + 	else
    + 	    Strcat(src, Sprintf("",
    + 				d->pid));
    + 	Strcat_charp(src, "\n

    \n"); + } + Strcat_charp(src, "
    "); + return loadHTMLString(src); + } + + void + download_action(struct parsed_tagarg *arg) + { + DownloadList *d; + pid_t pid; + + for (; arg; arg = arg->next) { + if (!strncmp(arg->arg, "stop", 4)) { + pid = (pid_t) atoi(&arg->arg[4]); + kill(pid, SIGKILL); + } + else if (!strncmp(arg->arg, "ok", 2)) + pid = (pid_t) atoi(&arg->arg[2]); + else + continue; + for (d = FirstDL; d; d = d->next) { + if (d->pid == pid) { + unlink(d->lock); + if (d->prev) + d->prev->next = d->next; + else + FirstDL = d->next; + if (d->next) + d->next->prev = d->prev; + else + LastDL = d->prev; + break; + } + } + } + ldDL(); + } + + void + stopDownload(void) + { + DownloadList *d; + + if (!FirstDL) + return; + for (d = FirstDL; d != NULL; d = d->next) { + if (d->ok) + continue; + kill(d->pid, SIGKILL); + unlink(d->lock); + } + } + + /* download panel */ + void + ldDL(void) + { + Buffer *buf; + int replace = FALSE, new_tab = FALSE; + #ifdef USE_ALARM + int reload; + #endif + + if (Currentbuf->bufferprop & BP_INTERNAL && + !strcmp(Currentbuf->buffername, DOWNLOAD_LIST_TITLE)) + replace = TRUE; + if (!FirstDL) { + if (replace) { + if (Currentbuf == Firstbuf && Currentbuf->nextBuffer == NULL) { + if (nTab > 1) + deleteTab(CurrentTab); + } + else + delBuffer(Currentbuf); + displayBuffer(Currentbuf, B_FORCE_REDRAW); + } + return; + } + #ifdef USE_ALARM + reload = checkDownloadList(); + #endif + buf = DownloadListBuffer(); + if (!buf) { + displayBuffer(Currentbuf, B_NORMAL); + return; + } + buf->bufferprop |= (BP_INTERNAL | BP_NO_URL); + if (replace) + restorePosition(buf, Currentbuf); + if (!replace && open_tab_dl_list) { + _newT(); + new_tab = TRUE; + } + pushBuffer(buf); + if (replace || new_tab) + deletePrevBuf(); + #ifdef USE_ALARM + if (reload) + Currentbuf->event = setAlarmEvent(Currentbuf->event, 1, AL_IMPLICIT, + FUNCNAME_reload, NULL); + #endif + displayBuffer(Currentbuf, B_FORCE_REDRAW); + } + + static void + save_buffer_position(Buffer *buf) + { + BufferPos *b = buf->undo; + + if (!buf->firstLine) + return; + if (b && b->top_linenumber == TOP_LINENUMBER(buf) && + b->cur_linenumber == CUR_LINENUMBER(buf) && + b->currentColumn == buf->currentColumn && b->pos == buf->pos) + return; + b = New(BufferPos); + b->top_linenumber = TOP_LINENUMBER(buf); + b->cur_linenumber = CUR_LINENUMBER(buf); + b->currentColumn = buf->currentColumn; + b->pos = buf->pos; + b->bpos = buf->currentLine ? buf->currentLine->bpos : 0; + b->next = NULL; + b->prev = buf->undo; + if (buf->undo) + buf->undo->next = b; + buf->undo = b; + } + + static void + resetPos(BufferPos * b) + { + Buffer buf; + Line top, cur; + + top.linenumber = b->top_linenumber; + cur.linenumber = b->cur_linenumber; + cur.bpos = b->bpos; + buf.topLine = ⊤ + buf.currentLine = &cur; + buf.pos = b->pos; + buf.currentColumn = b->currentColumn; + restorePosition(Currentbuf, &buf); + Currentbuf->undo = b; + displayBuffer(Currentbuf, B_FORCE_REDRAW); + } + + void + undoPos(void) + { + BufferPos *b = Currentbuf->undo; + int i; + + if (!Currentbuf->firstLine) + return; + if (!b || !b->prev) + return; + for (i = 0; i < PREC_NUM && b->prev; i++, b = b->prev) ; + resetPos(b); + } + + void + redoPos(void) + { + BufferPos *b = Currentbuf->undo; + int i; + + if (!Currentbuf->firstLine) + return; + if (!b || !b->next) + return; + for (i = 0; i < PREC_NUM && b->next; i++, b = b->next) ; + resetPos(b); + } + + #ifdef USE_SCRIPT + void + jWindowOpen(Buffer *buf, char *url, char *target) + { + union frameset_element *f_element = NULL; + Buffer *b; + ParsedURL u; + int i, t = FALSE; + + if (CurrentTab == NULL || Currentbuf == NULL) + return; + + if (!strcasecmp(target, "_top")) { + /* open on frame top */ + ; + } else if (!strcasecmp(target, "_self")) { + b = Currentbuf->linkBuffer[LB_N_FRAME]; + if (b && b->frameset && buf->script_target) { + f_element = search_frame(b->frameset, buf->script_target); + if (f_element) { + /* FIXME */ + /* target = buf->script_target; */ + } + } + } else if (check_target && open_tab_blank && target && + (!strcasecmp(target, "_new") || !strcasecmp(target, "_blank"))) { + t = TRUE; + } else { + b = Currentbuf->linkBuffer[LB_N_FRAME]; + if (b && b->frameset) { + f_element = search_frame(b->frameset, target); + if (f_element == NULL || f_element->body->attr != F_BODY) + t = TRUE; + } + } + + if (!t) { + parseURL2(url, &u, baseURL(Currentbuf)); + loadLink(parsedURL2Str(&u)->ptr, target, + parsedURL2Str(&Currentbuf->currentURL)->ptr, NULL); + } else { + _newT(); + b = Currentbuf; + parseURL2(url, &u, baseURL(Currentbuf)); + loadLink(parsedURL2Str(&u)->ptr, target, + parsedURL2Str(&Currentbuf->currentURL)->ptr, NULL); + if (b != Currentbuf) + delBuffer(b); + else + deleteTab(CurrentTab); + displayBuffer(Currentbuf, B_NORMAL); + + /* TODO: set target name to the "window" */ + } + return; + } + #endif diff -crN -x CVS w3m-0.3.2.2/map.c w3m-js-1.743/map.c *** w3m-0.3.2.2/map.c 2002-03-16 03:48:55.000000000 +0900 --- w3m-js-1.743/map.c 2003-02-06 02:23:11.000000000 +0900 *************** *** 1,11 **** ! /* $Id: map.c,v 1.8 2002/03/15 18:48:55 ukai Exp $ */ /* * client-side image maps */ #include "fm.h" #include ! #ifdef MENU_MAP #ifdef USE_IMAGE static int inMapArea(MapArea * a, int x, int y) --- 1,24 ---- ! /* $Id: map.c,v 1.28 2003/02/05 16:45:08 ukai Exp $ */ /* * client-side image maps */ #include "fm.h" #include ! MapList * ! searchMapList(Buffer *buf, char *name) ! { ! MapList *ml; ! ! if (name == NULL) ! return NULL; ! for (ml = buf->maplist; ml != NULL; ml = ml->next) { ! if (!Strcmp_charp(ml->name, name)) ! break; ! } ! return ml; ! } ! #ifdef USE_IMAGE static int inMapArea(MapArea * a, int x, int y) *************** *** 57,155 **** } return FALSE; } - #endif ! char * ! follow_map_menu(Buffer *buf, struct parsed_tagarg *arg, Anchor *a_img, int x, ! int y) { MapList *ml; ListItem *al; MapArea *a; ! char *name; ! int i, n, selected = -1, initial; ! char **label; ! #ifdef USE_IMAGE ! int px, py, map = 0; ! #endif ! name = tag_get_value(arg, "link"); ! if (name == NULL) return NULL; ! ! for (ml = buf->maplist; ml != NULL; ml = ml->next) { ! if (!Strcmp_charp(ml->name, name)) ! break; } ! if (ml == NULL || ml->area == NULL) return NULL; ! n = ml->area->nitem; ! if (n == 0) return NULL; ! label = New_N(char *, n + 1); #ifdef USE_IMAGE ! if (getMapXY(buf, a_img, &px, &py)) ! map = 1; #endif ! initial = -n; for (i = 0, al = ml->area->first; al != NULL; i++, al = al->next) { a = (MapArea *) al->ptr; ! if (a) { label[i] = *a->alt ? a->alt : a->url; - #ifdef USE_IMAGE - if (initial < 0 && map && inMapArea(a, px, py)) { - if (a->shape == SHAPE_DEFAULT) { - if (initial == -n) - initial = -i; - } - else - initial = i; - } - #endif - } else label[i] = ""; } ! label[n] = NULL; ! if (initial == -n) ! initial = 0; ! else if (initial < 0) ! initial *= -1; optionMenu(x, y, label, &selected, initial, NULL); if (selected >= 0) { for (i = 0, al = ml->area->first; al != NULL; i++, al = al->next) { if (al->ptr && i == selected) ! return ((MapArea *) al->ptr)->url; } } return NULL; } ! #else char *map1 = "Image map links\ !

    Image map links

    "; Buffer * ! follow_map_panel(Buffer *buf, struct parsed_tagarg *arg) { Str mappage; MapList *ml; ListItem *al; MapArea *a; - char *name; ParsedURL pu; ! name = tag_get_value(arg, "link"); ! if (name == NULL) ! return NULL; ! ! for (ml = buf->maplist; ml != NULL; ml = ml->next) { ! if (!Strcmp_charp(ml->name, name)) ! break; ! } if (ml == NULL) return NULL; --- 70,271 ---- } return FALSE; } ! static int ! nearestMapArea(MapList *ml, int x, int y) { + ListItem *al; + MapArea *a; + int i, l, n = -1, min = -1, limit = pixel_per_char * pixel_per_char + + pixel_per_line * pixel_per_line; + + if (!ml || !ml->area) + return n; + for (i = 0, al = ml->area->first; al != NULL; i++, al = al->next) { + a = (MapArea *) al->ptr; + if (a) { + l = (a->center_x - x) * (a->center_x - x) + + (a->center_y - y) * (a->center_y - y); + if ((min < 0 || l < min) && l < limit) { + n = i; + min = l; + } + } + } + return n; + } + + static int + searchMapArea(Buffer *buf, MapList *ml, Anchor *a_img) + { + ListItem *al; + MapArea *a; + int i, n; + int px, py; + + if (!(ml && ml->area && ml->area->nitem)) + return -1; + if (!getMapXY(buf, a_img, &px, &py)) + return -1; + n = -ml->area->nitem; + for (i = 0, al = ml->area->first; al != NULL; i++, al = al->next) { + a = (MapArea *) al->ptr; + if (!a) + continue; + if (n < 0 && inMapArea(a, px, py)) { + if (a->shape == SHAPE_DEFAULT) { + if (n == -ml->area->nitem) + n = -i; + } + else + n = i; + } + } + if (n == -ml->area->nitem) + return nearestMapArea(ml, px, py); + else if (n < 0) + return -n; + return n; + } + + MapArea * + retrieveCurrentMapArea(Buffer *buf) + { + Anchor *a_img, *a_form; + FormItemList *fi; MapList *ml; ListItem *al; MapArea *a; ! int i, n; ! a_img = retrieveCurrentImg(buf); ! if (!(a_img && a_img->image && a_img->image->map)) return NULL; ! a_form = retrieveCurrentForm(buf); ! if (!(a_form && a_form->url)) ! return NULL; ! fi = (FormItemList *)a_form->url; ! if (!(fi && fi->parent && fi->parent->item)) ! return NULL; ! fi = fi->parent->item; ! ml = searchMapList(buf, fi->value ? fi->value->ptr : NULL); ! if (!ml) ! return NULL; ! n = searchMapArea(buf, ml, a_img); ! if (n < 0) ! return NULL; ! for (i = 0, al = ml->area->first; al != NULL; i++, al = al->next) { ! a = (MapArea *) al->ptr; ! if (a && i == n) ! return a; } ! return NULL; ! } ! ! int ! getMapXY(Buffer *buf, Anchor *a, int *x, int *y) ! { ! if (!buf || !a || !a->image || !x || !y) ! return 0; ! *x = (int)((buf->currentColumn + buf->cursorX ! - COLPOS(buf->currentLine, a->start.pos) + 0.5) ! * pixel_per_char) - a->image->xoffset; ! *y = (int)((buf->currentLine->linenumber - a->image->y + 0.5) ! * pixel_per_line) - a->image->yoffset; ! if (*x <= 0) ! *x = 1; ! if (*y <= 0) ! *y = 1; ! return 1; ! } ! #endif ! ! Anchor * ! retrieveCurrentMap(Buffer *buf) ! { ! Anchor *a; ! FormItemList *fi; ! ! a = retrieveCurrentForm(buf); ! if (!a || !a->url) return NULL; + fi = (FormItemList *)a->url; + if (fi->parent->method == FORM_METHOD_INTERNAL && + !Strcmp_charp(fi->parent->action, "map")) + return a; + return NULL; + } + + #if defined(USE_IMAGE) || defined(MENU_MAP) + MapArea * + follow_map_menu(Buffer *buf, char *name, Anchor *a_img, int x, int y) + { + MapList *ml; + ListItem *al; + int i, selected = -1; + int initial = 0; + #ifdef MENU_MAP + MapArea *a; + char **label; + #endif ! ml = searchMapList(buf, name); ! if (ml == NULL || ml->area == NULL || ml->area->nitem == 0) return NULL; ! #ifdef USE_IMAGE ! initial = searchMapArea(buf, ml, a_img); ! if (initial < 0) ! initial = 0; ! else if (!image_map_list) { ! selected = initial; ! goto map_end; ! } #endif ! ! #ifdef MENU_MAP ! label = New_N(char *, ml->area->nitem + 1); for (i = 0, al = ml->area->first; al != NULL; i++, al = al->next) { a = (MapArea *) al->ptr; ! if (a) label[i] = *a->alt ? a->alt : a->url; else label[i] = ""; } ! label[ml->area->nitem] = NULL; optionMenu(x, y, label, &selected, initial, NULL); + #endif + #ifdef USE_IMAGE + map_end: + #endif if (selected >= 0) { for (i = 0, al = ml->area->first; al != NULL; i++, al = al->next) { if (al->ptr && i == selected) ! return (MapArea *) al->ptr; } } return NULL; } + #endif ! #ifndef MENU_MAP char *map1 = "Image map links\ !

    Image map links

    \ ! "; Buffer * ! follow_map_panel(Buffer *buf, char *name) { Str mappage; MapList *ml; ListItem *al; MapArea *a; ParsedURL pu; + char *p, *q; ! ml = searchMapList(buf, name); if (ml == NULL) return NULL; *************** *** 159,211 **** if (!a) continue; parseURL2(a->url, &pu, baseURL(buf)); ! Strcat_charp(mappage, "ptr)); ! Strcat_charp(mappage, "\">"); ! Strcat_charp(mappage, html_quote(a->alt)); ! Strcat_charp(mappage, " "); ! Strcat_charp(mappage, html_quote(a->url)); ! Strcat_charp(mappage, "
    \n"); } ! Strcat_charp(mappage, ""); return loadHTMLString(mappage); } #endif - #ifdef USE_IMAGE - int - getMapXY(Buffer *buf, Anchor *a, int *x, int *y) - { - if (!buf || !a || !a->image || !x || !y) - return 0; - *x = (int)((buf->currentColumn + buf->cursorX - - COLPOS(buf->currentLine, a->start.pos) + 0.5) - * pixel_per_char) - a->image->xoffset; - *y = (int)((buf->currentLine->linenumber - a->image->y + 0.5) - * pixel_per_line) - a->image->yoffset; - if (*x <= 0) - *x = 1; - if (*y <= 0) - *y = 1; - return 1; - } - #endif - MapArea * ! newMapArea(char *url, char *alt, char *shape, char *coords) { MapArea *a = New(MapArea); - #ifdef MENU_MAP #ifdef USE_IMAGE char *p; int i, max; #endif - #endif a->url = url; a->alt = alt ? alt : ""; - #ifdef MENU_MAP #ifdef USE_IMAGE a->shape = SHAPE_RECT; if (shape) { --- 275,308 ---- if (!a) continue; parseURL2(a->url, &pu, baseURL(buf)); ! p = parsedURL2Str(&pu)->ptr; ! q = html_quote(p); ! if (DecodeURL) ! p = html_quote(url_unquote_conv(p, buf->document_code)); ! else ! p = q; ! Strcat_m_charp(mappage, "
    ", ! html_quote(*a->alt ? a->alt : mybasename(a->url)), ! "", p, NULL); } ! Strcat_charp(mappage, "
    "); return loadHTMLString(mappage); } #endif MapArea * ! newMapArea(char *url, char *target, char *alt, char *shape, char *coords) { MapArea *a = New(MapArea); #ifdef USE_IMAGE char *p; int i, max; #endif a->url = url; + a->target = target; a->alt = alt ? alt : ""; #ifdef USE_IMAGE a->shape = SHAPE_RECT; if (shape) { *************** *** 222,227 **** --- 319,326 ---- } a->coords = NULL; a->ncoords = 0; + a->center_x = 0; + a->center_y = 0; if (a->shape == SHAPE_UNKNOWN || a->shape == SHAPE_DEFAULT) return a; if (!coords) { *************** *** 240,246 **** for (i = 0, p = coords; (a->shape == SHAPE_POLY || i < a->ncoords) && *p;) { while (IS_SPACE(*p)) p++; ! if (!IS_DIGIT(*p)) break; if (a->shape == SHAPE_POLY) { if (max <= i) { --- 339,345 ---- for (i = 0, p = coords; (a->shape == SHAPE_POLY || i < a->ncoords) && *p;) { while (IS_SPACE(*p)) p++; ! if (!IS_DIGIT(*p) && *p != '-' && *p != '+') break; if (a->shape == SHAPE_POLY) { if (max <= i) { *************** *** 251,256 **** --- 350,357 ---- } a->coords[i] = (short)atoi(p); i++; + if (*p == '-' || *p == '+') + p++; while (IS_DIGIT(*p)) p++; if (*p != ',' && !IS_SPACE(*p)) *************** *** 264,280 **** a->shape = SHAPE_UNKNOWN; a->coords = NULL; a->ncoords = 0; } if (a->shape == SHAPE_POLY) { a->ncoords = a->ncoords / 2 * 2; a->coords[a->ncoords] = a->coords[0]; a->coords[a->ncoords + 1] = a->coords[1]; } ! #endif #endif return a; } /* append frame URL */ static void append_frame_info(Buffer *buf, Str html, struct frameset *set, int level) --- 365,468 ---- a->shape = SHAPE_UNKNOWN; a->coords = NULL; a->ncoords = 0; + return a; } if (a->shape == SHAPE_POLY) { a->ncoords = a->ncoords / 2 * 2; a->coords[a->ncoords] = a->coords[0]; a->coords[a->ncoords + 1] = a->coords[1]; } ! if (a->shape == SHAPE_CIRCLE) { ! a->center_x = a->coords[0]; ! a->center_y = a->coords[1]; ! } ! else { ! for (i = 0; i < a->ncoords / 2; i++) { ! a->center_x += a->coords[2 * i]; ! a->center_y += a->coords[2 * i + 1]; ! } ! a->center_x /= a->ncoords / 2; ! a->center_y /= a->ncoords / 2; ! } #endif return a; } + /* append image map links */ + static void + append_map_info(Buffer *buf, Str tmp, FormItemList *fi) + { + MapList *ml; + ListItem *al; + MapArea *a; + ParsedURL pu; + char *p, *q; + + ml = searchMapList(buf, fi->value ? fi->value->ptr : NULL); + if (ml == NULL) + return; + + Strcat_m_charp(tmp, + "Links of current image map", + "", NULL); + for (al = ml->area->first; al != NULL; al = al->next) { + a = (MapArea *) al->ptr; + if (!a) + continue; + parseURL2(a->url, &pu, baseURL(buf)); + q = html_quote(parsedURL2Str(&pu)->ptr); + if (DecodeURL) + p = html_quote(url_unquote_conv(a->url, buf->document_code)); + else + p = html_quote(a->url); + Strcat_m_charp(tmp, "
      ", + html_quote(*a->alt ? a->alt : mybasename(a->url)), + "", p, "\n", NULL); + } + Strcat_charp(tmp, "
    "); + } + + /* append links */ + static void + append_link_info(Buffer *buf, Str html, LinkList * link) + { + LinkList *l; + ParsedURL pu; + char *url; + + if (!link) + return; + + Strcat_charp(html, "

    Link information

    \n"); + for (l = link; l; l = l->next) { + if (l->url) { + parseURL2(l->url, &pu, baseURL(buf)); + url = html_quote(parsedURL2Str(&pu)->ptr); + } + else + url = "(empty)"; + Strcat_m_charp(html, "
    ", + l->title ? html_quote(l->title) : "(empty)", "", + NULL); + if (l->type == LINK_TYPE_REL) + Strcat_charp(html, "[Rel]"); + else if (l->type == LINK_TYPE_REV) + Strcat_charp(html, "[Rev]"); + if (!l->url) + url = "(empty)"; + else if (DecodeURL) + url = html_quote(url_unquote_conv(l->url, buf->document_code)); + else + url = html_quote(l->url); + Strcat_m_charp(html, "", url, NULL); + if (l->ctype) + Strcat_m_charp(html, " (", html_quote(l->ctype), ")", NULL); + Strcat_charp(html, "\n"); + } + Strcat_charp(html, "
    \n"); + } + /* append frame URL */ static void append_frame_info(Buffer *buf, Str html, struct frameset *set, int level) *************** *** 293,319 **** case F_BODY: if (frame.body->url == NULL) break; for (j = 0; j < level; j++) Strcat_charp(html, " "); q = html_quote(frame.body->url); ! Strcat_charp(html, ""); if (frame.body->name) { ! p = file_unquote(frame.body->name); ! #ifdef JP_CHARSET ! p = conv(p, buf->document_code, InnerCode)->ptr; ! #endif ! p = html_quote(p); Strcat_charp(html, p); } ! Strcat_charp(html, " "); ! Strcat_charp(html, q); ! Strcat_charp(html, "\n"); #ifdef USE_SSL if (frame.body->ssl_certificate) ! Strcat_m_charp(html, "
    \n",
    ! 				   frame.body->ssl_certificate,
      				   "
    \n", NULL); #endif break; --- 481,507 ---- case F_BODY: if (frame.body->url == NULL) break; + Strcat_charp(html, ""); for (j = 0; j < level; j++) Strcat_charp(html, " "); q = html_quote(frame.body->url); ! Strcat_m_charp(html, "", NULL); if (frame.body->name) { ! p = html_quote(url_unquote_conv(frame.body->name, ! buf->document_code)); Strcat_charp(html, p); } ! if (DecodeURL) ! p = html_quote(url_unquote_conv(frame.body->url, ! buf->document_code)); ! else ! p = q; ! Strcat_m_charp(html, " ", p, "
    \n", NULL); #ifdef USE_SSL if (frame.body->ssl_certificate) ! Strcat_m_charp(html, ! "

    SSL certificate

    \n",
    ! 				   html_quote(frame.body->ssl_certificate),
      				   "
    \n", NULL); #endif break; *************** *** 333,408 **** { Str tmp = Strnew_size(1024); Anchor *a; - Str s; ParsedURL pu; TextListItem *ti; struct frameset *f_set = NULL; int all; ! Strcat_charp(tmp, ! "Information about current page"); ! Strcat_charp(tmp, ! "

    Information about current page

    "); if (buf == NULL) goto end; - Strcat_charp(tmp, "
    Title"); - Strcat_charp(tmp, html_quote(buf->buffername)); - Strcat_charp(tmp, "
    Current URL"); - Strcat_charp(tmp, html_quote(parsedURL2Str(&buf->currentURL)->ptr)); - Strcat_charp(tmp, "
    Document Type"); - if (buf->real_type) - Strcat_charp(tmp, buf->real_type); - else - Strcat_charp(tmp, "unknown"); - Strcat_charp(tmp, "
    Last Modified"); - Strcat_charp(tmp, html_quote(last_modified(buf))); - #ifdef JP_CHARSET - Strcat_charp(tmp, "
    Document Code"); - Strcat_charp(tmp, code_to_str(buf->document_code)); - #endif /* JP_CHARSET */ - Strcat_charp(tmp, "
    Number of lines"); all = buf->allLine; if (all == 0 && buf->lastLine) all = buf->lastLine->linenumber; ! Strcat(tmp, Sprintf("%d", all)); ! Strcat_charp(tmp, "
    Transferred bytes"); ! Strcat(tmp, Sprintf("%d", buf->trbyte)); a = retrieveCurrentAnchor(buf); if (a != NULL) { - char *aurl; parseURL2(a->url, &pu, baseURL(buf)); ! s = parsedURL2Str(&pu); ! aurl = html_quote(s->ptr); ! Strcat_charp(tmp, "
    URL of current anchor"); ! Strcat_m_charp(tmp, "", aurl, "", NULL); } a = retrieveCurrentImg(buf); if (a != NULL) { parseURL2(a->url, &pu, baseURL(buf)); ! s = parsedURL2Str(&pu); ! Strcat_charp(tmp, "
    URL of current image"); ! Strcat_charp(tmp, "ptr)); ! Strcat_charp(tmp, "\">"); ! Strcat_charp(tmp, html_quote(s->ptr)); ! Strcat_charp(tmp, ""); } a = retrieveCurrentForm(buf); if (a != NULL) { ! s = Strnew_charp(form2str((FormItemList *)a->url)); ! Strcat_charp(tmp, "
    Method/type of current form"); ! Strcat_charp(tmp, html_quote(s->ptr)); } Strcat_charp(tmp, "
    \n"); if (buf->document_header != NULL) { ! Strcat_charp(tmp, "
    \n"); ! Strcat_charp(tmp, "

    Header information

    \n"); ! for (ti = buf->document_header->first; ti != NULL; ti = ti->next) { ! Strcat_charp(tmp, html_quote(ti->ptr)); ! Strcat_charp(tmp, "
    "); ! } } if (buf->frameset != NULL) f_set = buf->frameset; else if (buf->bufferprop & BP_FRAME && --- 521,615 ---- { Str tmp = Strnew_size(1024); Anchor *a; ParsedURL pu; TextListItem *ti; struct frameset *f_set = NULL; int all; + char *p, *q; ! Strcat_charp(tmp, "\ ! Information about current page\ ! \ !

    Information about current page

    \n"); if (buf == NULL) goto end; all = buf->allLine; if (all == 0 && buf->lastLine) all = buf->lastLine->linenumber; ! p = parsedURL2Str(&buf->currentURL)->ptr; ! if (DecodeURL) ! p = url_unquote_conv(p, 0); ! Strcat_m_charp(tmp, "", ! "
    Title", ! html_quote(buf->buffername), ! "
    Current URL", ! html_quote(p), ! "
    Document Type", ! buf->real_type ? html_quote(buf->real_type) : "unknown", ! "
    Last Modified", ! html_quote(last_modified(buf)), ! #ifdef JP_CHARSET ! "
    Document Code", ! code_to_str(buf->document_code), ! #endif /* JP_CHARSET */ ! "
    Number of lines", ! Sprintf("%d", all)->ptr, ! "
    Transferred bytes", ! Sprintf("%d", buf->trbyte)->ptr, NULL); a = retrieveCurrentAnchor(buf); if (a != NULL) { parseURL2(a->url, &pu, baseURL(buf)); ! p = parsedURL2Str(&pu)->ptr; ! q = html_quote(p); ! if (DecodeURL) ! p = html_quote(url_unquote_conv(p, buf->document_code)); ! else ! p = q; ! Strcat_m_charp(tmp, ! "
    URL of current anchor", p, "", NULL); } a = retrieveCurrentImg(buf); if (a != NULL) { parseURL2(a->url, &pu, baseURL(buf)); ! p = parsedURL2Str(&pu)->ptr; ! q = html_quote(p); ! if (DecodeURL) ! p = html_quote(url_unquote_conv(p, buf->document_code)); ! else ! p = q; ! Strcat_m_charp(tmp, ! "
    URL of current image", p, "", NULL); } a = retrieveCurrentForm(buf); if (a != NULL) { ! FormItemList *fi = (FormItemList *)a->url; ! p = form2str(fi); ! if (DecodeURL) ! p = html_quote(url_unquote_conv(p, buf->document_code)); ! else ! p = html_quote(p); ! Strcat_m_charp(tmp, ! "
    Method/type of current form ", ! p, NULL); ! if (fi->parent->method == FORM_METHOD_INTERNAL ! && !Strcmp_charp(fi->parent->action, "map")) ! append_map_info(buf, tmp, fi->parent->item); } Strcat_charp(tmp, "
    \n"); + + append_link_info(buf, tmp, buf->linklist); + if (buf->document_header != NULL) { ! Strcat_charp(tmp, "

    Header information

    \n");
    ! 	for (ti = buf->document_header->first; ti != NULL; ti = ti->next)
    ! 	    Strcat_m_charp(tmp, "", html_quote(ti->ptr),
    ! 			   "\n", NULL);
    ! 	Strcat_charp(tmp, "
    \n"); } + if (buf->frameset != NULL) f_set = buf->frameset; else if (buf->bufferprop & BP_FRAME && *************** *** 410,426 **** f_set = buf->nextBuffer->frameset; if (f_set) { ! Strcat_charp(tmp, "

    Frame information

    ");
      	append_frame_info(buf, tmp, f_set, 0);
    - 	Strcat_charp(tmp, "
    "); } #ifdef USE_SSL ! if (buf->ssl_certificate == NULL) ! goto end; ! Strcat_charp(tmp, "

    SSL certificate

    \n"); ! Strcat_charp(tmp, "
    \n");
    !     Strcat_charp(tmp, buf->ssl_certificate);
    !     Strcat_charp(tmp, "
    \n"); #endif end: Strcat_charp(tmp, ""); --- 617,629 ---- f_set = buf->nextBuffer->frameset; if (f_set) { ! Strcat_charp(tmp, "

    Frame information

    \n"); append_frame_info(buf, tmp, f_set, 0); } #ifdef USE_SSL ! if (buf->ssl_certificate) ! Strcat_m_charp(tmp, "

    SSL certificate

    \n",
    ! 		       html_quote(buf->ssl_certificate), "
    \n", NULL); #endif end: Strcat_charp(tmp, ""); diff -crN -x CVS w3m-0.3.2.2/menu.c w3m-js-1.743/menu.c *** w3m-0.3.2.2/menu.c 2002-03-20 01:06:52.000000000 +0900 --- w3m-js-1.743/menu.c 2003-02-06 02:23:11.000000000 +0900 *************** *** 1,4 **** ! /* $Id: menu.c,v 1.15 2002/03/19 16:06:52 ukai Exp $ */ /* * w3m menu.c */ --- 1,4 ---- ! /* $Id: menu.c,v 1.31 2003/02/05 16:44:00 ukai Exp $ */ /* * w3m menu.c */ *************** *** 85,90 **** --- 85,92 ---- static int mPrev(char c); static int mFore(char c); static int mBack(char c); + static int mLineU(char c); + static int mLineD(char c); static int mOk(char c); static int mCancel(char c); static int mClose(char c); *************** *** 109,115 **** /* C-h C-i C-j C-k C-l C-m C-n C-o */ mCancel,mNull, mOk, mNull, mNull, mOk, mDown, mNull, /* C-p C-q C-r C-s C-t C-u C-v C-w */ ! mUp, mNull, mNull, mNull, mNull, mNull, mNext, mNull, /* C-x C-y C-z C-[ C-\ C-] C-^ C-_ */ mNull, mNull, mSusp, mEsc, mNull, mNull, mNull, mNull, /* SPC ! " # $ % & ' */ --- 111,117 ---- /* C-h C-i C-j C-k C-l C-m C-n C-o */ mCancel,mNull, mOk, mNull, mNull, mOk, mDown, mNull, /* C-p C-q C-r C-s C-t C-u C-v C-w */ ! mUp, mNull, mSrchB, mSrchF, mNull, mNull, mNext, mNull, /* C-x C-y C-z C-[ C-\ C-] C-^ C-_ */ mNull, mNull, mSusp, mEsc, mNull, mNull, mNull, mNull, /* SPC ! " # $ % & ' */ *************** *** 123,129 **** /* @ A B C D E F G */ mNull, mNull, mNull, mNull, mNull, mNull, mNull, mNull, /* H I J K L M N O */ ! mNull, mNull, mNull, mNull, mNull, mNull, mSrchP, mNull, /* P Q R S T U V W */ mNull, mNull, mNull, mNull, mNull, mNull, mNull, mNull, /* X Y Z [ \ ] ^ _ */ --- 125,131 ---- /* @ A B C D E F G */ mNull, mNull, mNull, mNull, mNull, mNull, mNull, mNull, /* H I J K L M N O */ ! mNull, mNull, mLineU, mLineD, mNull, mNull, mSrchP, mNull, /* P Q R S T U V W */ mNull, mNull, mNull, mNull, mNull, mNull, mNull, mNull, /* X Y Z [ \ ] ^ _ */ *************** *** 276,281 **** --- 278,293 ---- /* --- SelectMenu (END) --- */ + /* --- SelTabMenu --- */ + + static Menu SelTabMenu; + static int SelTabV = 0; + static void initSelTabMenu(void); + static void smChTab(void); + static int smDelTab(char c); + + /* --- SelTabMenu (END) --- */ + /* --- MainMenu --- */ static Menu MainMenu; *************** *** 284,295 **** --- 296,309 ---- /* type label variabel value func popup keys data */ {MENU_FUNC, "フ皃 (b)", NULL, 0, backBf, NULL, "b", NULL}, {MENU_POPUP, "・ミ・テ・ユ・。チェツ (s)", NULL, 0, NULL, &SelectMenu, "s", NULL}, + {MENU_POPUP, "・ソ・ヨチェツ (t)", NULL, 0, NULL, &SelTabMenu, "tT", NULL}, {MENU_FUNC, "・ス。シ・ケ、ノスシィ (v)", NULL, 0, vwSrc, NULL, "vV", NULL}, {MENU_FUNC, "・ス。シ・ケ、ハヤスク (e)", NULL, 0, editBf, NULL, "eE", NULL}, {MENU_FUNC, "・ス。シ・ケ、ハンツク (S)", NULL, 0, svSrc, NULL, "S", NULL}, {MENU_FUNC, "コニニノ、゚ケ、゚ (r)", NULL, 0, reload, NULL, "rR", NULL}, {MENU_NOP, "ィ。ィ。ィ。ィ。ィ。ィ。ィ。ィ。", NULL, 0, nulcmd, NULL, "", NULL}, {MENU_FUNC, "・・・ッ、ノスシィ (a)", NULL, 0, followA, NULL, "a", NULL}, + {MENU_FUNC, "ソキ・ソ・ヨ、ヌノスシィ (n)", NULL, 0, tabA, NULL, "nN", NULL}, {MENU_FUNC, "・・・ッ、ハンツク (A)", NULL, 0, svA, NULL, "A", NULL}, {MENU_FUNC, "イ霖、ノスシィ (i)", NULL, 0, followI, NULL, "i", NULL}, {MENU_FUNC, "イ霖、ハンツク (I)", NULL, 0, svI, NULL, "I", NULL}, *************** *** 307,318 **** --- 321,334 ---- /* type label variable value func popup keys data */ {MENU_FUNC, " Back (b) ", NULL, 0, backBf, NULL, "b", NULL}, {MENU_POPUP, " Select Buffer(s) ", NULL, 0, NULL, &SelectMenu, "s", NULL}, + {MENU_POPUP, " Select Tab (t) ", NULL, 0, NULL, &SelTabMenu, "tT", NULL}, {MENU_FUNC, " View Source (v) ", NULL, 0, vwSrc, NULL, "vV", NULL}, {MENU_FUNC, " Edit Source (e) ", NULL, 0, editBf, NULL, "eE", NULL}, {MENU_FUNC, " Save Source (S) ", NULL, 0, svSrc, NULL, "S", NULL}, {MENU_FUNC, " Reload (r) ", NULL, 0, reload, NULL, "rR", NULL}, {MENU_NOP, " ---------------- ", NULL, 0, nulcmd, NULL, "", NULL}, {MENU_FUNC, " Go Link (a) ", NULL, 0, followA, NULL, "a", NULL}, + {MENU_FUNC, " on New Tab (n) ", NULL, 0, tabA, NULL, "nN", NULL}, {MENU_FUNC, " Save Link (A) ", NULL, 0, svA, NULL, "A", NULL}, {MENU_FUNC, " View Image (i) ", NULL, 0, followI, NULL, "i", NULL}, {MENU_FUNC, " Save Image (I) ", NULL, 0, svI, NULL, "I", NULL}, *************** *** 883,888 **** --- 899,940 ---- } static int + mLineU(char c) + { + int mselect = CurrentMenu->select; + + if (mselect >= CurrentMenu->nitem) + return mLast(c); + if (CurrentMenu->offset + CurrentMenu->height >= CurrentMenu->nitem) + mselect++; + else { + down_menu(CurrentMenu, 1); + if (mselect < CurrentMenu->offset) + mselect++; + } + goto_menu(CurrentMenu, mselect, 1); + return (MENU_NOTHING); + } + + static int + mLineD(char c) + { + int mselect = CurrentMenu->select; + + if (mselect <= 0) + return mTop(c); + if (CurrentMenu->offset <= 0) + mselect--; + else { + up_menu(CurrentMenu, 1); + if (mselect >= CurrentMenu->offset + CurrentMenu->height) + mselect--; + } + goto_menu(CurrentMenu, mselect, -1); + return (MENU_NOTHING); + } + + static int mOk(char c) { int mselect = CurrentMenu->select; *************** *** 1071,1083 **** #define MOUSE_BTN5_DOWN_XTERM 65 #define MOUSE_BTN_UP 3 #define MOUSE_BTN_RESET -1 ! #define MOUSE_SCROLL_LINE 5 static int process_mMouse(int btn, int x, int y) { Menu *menu; ! int mselect; static int press_btn = MOUSE_BTN_RESET, press_x, press_y; char c = ' '; --- 1123,1145 ---- #define MOUSE_BTN5_DOWN_XTERM 65 #define MOUSE_BTN_UP 3 #define MOUSE_BTN_RESET -1 ! ! static int ! mMouse_scroll_line(void) ! { ! int i = 0; ! if (relative_wheel_scroll) ! i = (relative_wheel_scroll_ratio * CurrentMenu->height + 99) / 100; ! else ! i = fixed_wheel_scroll_count; ! return i ? i : 1; ! } static int process_mMouse(int btn, int x, int y) { Menu *menu; ! int mselect, i; static int press_btn = MOUSE_BTN_RESET, press_x, press_y; char c = ' '; *************** *** 1087,1093 **** return (MENU_NOTHING); if (btn == MOUSE_BTN_UP) { ! if (press_btn == MOUSE_BTN1_DOWN || press_btn == MOUSE_BTN3_DOWN) { if (x < menu->x - FRAME_WIDTH || x >= menu->x + menu->width + FRAME_WIDTH || y < menu->y - 1 || y >= menu->y + menu->height + 1) { --- 1149,1157 ---- return (MENU_NOTHING); if (btn == MOUSE_BTN_UP) { ! switch (press_btn) { ! case MOUSE_BTN1_DOWN: ! case MOUSE_BTN3_DOWN: if (x < menu->x - FRAME_WIDTH || x >= menu->x + menu->width + FRAME_WIDTH || y < menu->y - 1 || y >= menu->y + menu->height + 1) { *************** *** 1099,1104 **** --- 1163,1178 ---- x < menu->x + menu->width + FRAME_WIDTH)) { return (MENU_NOTHING); } + else if (press_y > y) { + for (i = 0; i < press_y - y; i++) + mLineU(c); + return (MENU_NOTHING); + } + else if (press_y < y) { + for (i = 0; i < y - press_y; i++) + mLineD(c); + return (MENU_NOTHING); + } else if (y == menu->y - 1) { mPrev(c); return (MENU_NOTHING); *************** *** 1113,1125 **** return (MENU_NOTHING); return (select_menu(menu, mselect)); } } } ! else { press_btn = btn; press_x = x; press_y = y; } return (MENU_NOTHING); } --- 1187,1220 ---- return (MENU_NOTHING); return (select_menu(menu, mselect)); } + break; + case MOUSE_BTN4_DOWN_RXVT: + for (i = 0; i < mMouse_scroll_line(); i++) + mLineD(c); + break; + case MOUSE_BTN5_DOWN_RXVT: + for (i = 0; i < mMouse_scroll_line(); i++) + mLineU(c); + break; } } ! else if (btn == MOUSE_BTN4_DOWN_XTERM) { ! for (i = 0; i < mMouse_scroll_line(); i++) ! mLineD(c); ! } ! else if (btn == MOUSE_BTN5_DOWN_XTERM) { ! for (i = 0; i < mMouse_scroll_line(); i++) ! mLineU(c); ! } ! ! if (btn != MOUSE_BTN4_DOWN_RXVT || press_btn == MOUSE_BTN_RESET) { press_btn = btn; press_x = x; press_y = y; } + else { + press_btn = MOUSE_BTN_RESET; + } return (MENU_NOTHING); } *************** *** 1129,1134 **** --- 1224,1237 ---- int btn, x, y; btn = (unsigned char)getch() - 32; + #if defined(__CYGWIN__) + if (cygwin_mouse_btn_swapped) { + if (btn == MOUSE_BTN2_DOWN) + btn = MOUSE_BTN3_DOWN; + else if (btn == MOUSE_BTN3_DOWN) + btn = MOUSE_BTN2_DOWN; + } + #endif x = (unsigned char)getch() - 33; if (x < 0) x += 0x100; *************** *** 1209,1217 **** popupMenu(int x, int y, Menu *menu) { initSelectMenu(); menu->cursorX = Currentbuf->cursorX + Currentbuf->rootX; ! menu->cursorY = Currentbuf->cursorY; menu->x = x + FRAME_WIDTH + 1; menu->y = y + 2; --- 1312,1321 ---- popupMenu(int x, int y, Menu *menu) { initSelectMenu(); + initSelTabMenu(); menu->cursorX = Currentbuf->cursorX + Currentbuf->rootX; ! menu->cursorY = Currentbuf->cursorY + Currentbuf->rootY; menu->x = x + FRAME_WIDTH + 1; menu->y = y + 2; *************** *** 1230,1235 **** --- 1334,1341 ---- Menu *menu = &MainMenu; char *data; int n; + int x = Currentbuf->cursorX + Currentbuf->rootX, + y = Currentbuf->cursorY + Currentbuf->rootY; data = searchKeyData(); if (data != NULL) { *************** *** 1238,1245 **** return; menu = w3mMenuList[n].menu; } ! popupMenu(Currentbuf->cursorX + Currentbuf->rootX, Currentbuf->cursorY, ! menu); } /* --- MainMenu (END) --- */ --- 1344,1356 ---- return; menu = w3mMenuList[n].menu; } ! #ifdef USE_MOUSE ! if (mouse_action.in_action) { ! x = mouse_action.cursorX; ! y = mouse_action.cursorY; ! } ! #endif ! popupMenu(x, y, menu); } /* --- MainMenu (END) --- */ *************** *** 1249,1255 **** void selMn(void) { ! popupMenu(Currentbuf->cursorX, Currentbuf->cursorY, &SelectMenu); } static void --- 1360,1375 ---- void selMn(void) { ! int x = Currentbuf->cursorX + Currentbuf->rootX, ! y = Currentbuf->cursorY + Currentbuf->rootY; ! ! #ifdef USE_MOUSE ! if (mouse_action.in_action) { ! x = mouse_action.cursorX; ! y = mouse_action.cursorY; ! } ! #endif ! popupMenu(x, y, &SelectMenu); } static void *************** *** 1259,1264 **** --- 1379,1385 ---- Buffer *buf; Str str; char **label; + char *p; static char *comment = " SPC for select / D for delete buffer "; SelectV = -1; *************** *** 1274,1280 **** if (buf->filename != NULL) { switch (buf->currentURL.scheme) { case SCM_LOCAL: - case SCM_LOCAL_CGI: if (strcmp(buf->currentURL.file, "-")) { Strcat_char(str, ' '); Strcat_charp(str, --- 1395,1400 ---- *************** *** 1286,1292 **** break; default: Strcat_char(str, ' '); ! Strcat(str, parsedURL2Str(&buf->currentURL)); break; } } --- 1406,1415 ---- break; default: Strcat_char(str, ' '); ! p = parsedURL2Str(&buf->currentURL)->ptr; ! if (DecodeURL) ! p = url_unquote_conv(p, 0); ! Strcat_charp(str, p); break; } } *************** *** 1312,1318 **** new_option_menu(&SelectMenu, label, &SelectV, smChBuf); SelectMenu.initial = SelectV; SelectMenu.cursorX = Currentbuf->cursorX + Currentbuf->rootX; ! SelectMenu.cursorY = Currentbuf->cursorY; SelectMenu.keymap['D'] = smDelBuf; SelectMenu.item[nitem].type = MENU_NOP; } --- 1435,1441 ---- new_option_menu(&SelectMenu, label, &SelectV, smChBuf); SelectMenu.initial = SelectV; SelectMenu.cursorX = Currentbuf->cursorX + Currentbuf->rootX; ! SelectMenu.cursorY = Currentbuf->cursorY + Currentbuf->rootY; SelectMenu.keymap['D'] = smDelBuf; SelectMenu.item[nitem].type = MENU_NOP; } *************** *** 1380,1385 **** --- 1503,1652 ---- /* --- SelectMenu (END) --- */ + /* --- SelTabMenu --- */ + + void + tabMn(void) + { + int x = Currentbuf->cursorX + Currentbuf->rootX, + y = Currentbuf->cursorY + Currentbuf->rootY; + + #ifdef USE_MOUSE + if (mouse_action.in_action) { + x = mouse_action.cursorX; + y = mouse_action.cursorY; + } + #endif + popupMenu(x, y, &SelTabMenu); + } + + static void + initSelTabMenu(void) + { + int i, nitem, len = 0, l; + TabBuffer *tab; + Buffer *buf; + Str str; + char **label; + char *p; + static char *comment = " SPC for select / D for delete tab "; + + SelTabV = -1; + for (i = 0, tab = LastTab; tab != NULL; i++, tab = tab->prevTab) { + if (tab == CurrentTab) + SelTabV = i; + } + nitem = i; + + label = New_N(char *, nitem + 2); + for (i = 0, tab = LastTab; i < nitem; i++, tab = tab->prevTab) { + buf = tab->currentBuffer; + str = Sprintf("<%s>", buf->buffername); + if (buf->filename != NULL) { + switch (buf->currentURL.scheme) { + case SCM_LOCAL: + if (strcmp(buf->currentURL.file, "-")) { + Strcat_char(str, ' '); + Strcat_charp(str, + conv_from_system(buf->currentURL.real_file)); + } + break; + /* case SCM_UNKNOWN: */ + case SCM_MISSING: + break; + default: + p = parsedURL2Str(&buf->currentURL)->ptr; + if (DecodeURL) + p = url_unquote_conv(p, 0); + Strcat_charp(str, p); + break; + } + } + label[i] = str->ptr; + if (len < str->length) + len = str->length; + } + l = strlen(comment); + if (len < l + 4) + len = l + 4; + if (len > COLS - 2 * FRAME_WIDTH) + len = COLS - 2 * FRAME_WIDTH; + len = (len > 1) ? ((len - l + 1) / 2) : 0; + str = Strnew(); + for (i = 0; i < len; i++) + Strcat_char(str, '-'); + Strcat_charp(str, comment); + for (i = 0; i < len; i++) + Strcat_char(str, '-'); + label[nitem] = str->ptr; + label[nitem + 1] = NULL; + + new_option_menu(&SelTabMenu, label, &SelTabV, smChTab); + SelTabMenu.initial = SelTabV; + SelTabMenu.cursorX = Currentbuf->cursorX + Currentbuf->rootX; + SelTabMenu.cursorY = Currentbuf->cursorY + Currentbuf->rootY; + SelTabMenu.keymap['D'] = smDelTab; + SelTabMenu.item[nitem].type = MENU_NOP; + } + + static void + smChTab(void) + { + int i; + TabBuffer *tab; + Buffer *buf; + + if (SelTabV < 0 || SelTabV >= SelTabMenu.nitem) + return; + for (i = 0, tab = LastTab; i < SelTabV && tab != NULL; + i++, tab = tab->prevTab) ; + CurrentTab = tab; + for (tab = LastTab; tab != NULL; tab = tab->prevTab) { + if (tab == CurrentTab) + continue; + buf = tab->currentBuffer; + #ifdef USE_IMAGE + deleteImage(buf); + #endif + if (clear_buffer) + tmpClearBuffer(buf); + } + } + + static int + smDelTab(char c) + { + int i, x, y, mselect; + TabBuffer *tab; + + if (CurrentMenu->select < 0 || CurrentMenu->select >= SelTabMenu.nitem) + return (MENU_NOTHING); + for (i = 0, tab = LastTab; i < CurrentMenu->select && tab != NULL; + i++, tab = tab->prevTab) ; + deleteTab(tab); + + x = CurrentMenu->x; + y = CurrentMenu->y; + mselect = CurrentMenu->select; + + initSelTabMenu(); + + CurrentMenu->x = x; + CurrentMenu->y = y; + + geom_menu(CurrentMenu, x, y, 0); + + CurrentMenu->select = (mselect <= CurrentMenu->nitem - 2) ? mselect + : (CurrentMenu->nitem - 2); + + displayBuffer(Currentbuf, B_FORCE_REDRAW); + draw_all_menu(CurrentMenu); + select_menu(CurrentMenu, CurrentMenu->select); + return (MENU_NOTHING); + } + + /* --- SelectMenu (END) --- */ + /* --- OptionMenu --- */ void *************** *** 1419,1425 **** w3mMenuList[1].id = "Select"; w3mMenuList[1].menu = &SelectMenu; w3mMenuList[1].item = NULL; ! w3mMenuList[2].id = NULL; if ((mf = fopen(rcFile(MENU_FILE), "rt")) == NULL) goto create_menu; --- 1686,1695 ---- w3mMenuList[1].id = "Select"; w3mMenuList[1].menu = &SelectMenu; w3mMenuList[1].item = NULL; ! w3mMenuList[2].id = "SelectTab"; ! w3mMenuList[2].menu = &SelTabMenu; ! w3mMenuList[2].item = NULL; ! w3mMenuList[3].id = NULL; if ((mf = fopen(rcFile(MENU_FILE), "rt")) == NULL) goto create_menu; *************** *** 1554,1557 **** --- 1824,2076 ---- /* --- InitMenu (END) --- */ + LinkList * + link_menu(Buffer *buf) + { + Menu menu; + LinkList *l; + int i, nitem, len = 0, linkV = -1; + char **label; + Str str; + char *p; + + if (!buf->linklist) + return NULL; + + for (i = 0, l = buf->linklist; l; i++, l = l->next) ; + nitem = i; + + label = New_N(char *, nitem + 1); + for (i = 0, l = buf->linklist; l; i++, l = l->next) { + str = Strnew_charp(l->title ? l->title : "(empty)"); + if (l->type == LINK_TYPE_REL) + Strcat_charp(str, " [Rel] "); + else if (l->type == LINK_TYPE_REV) + Strcat_charp(str, " [Rev] "); + else + Strcat_charp(str, " "); + if (!l->url) + p = ""; + else if (DecodeURL) + p = url_unquote_conv(l->url, buf->document_code); + else + p = l->url; + Strcat_charp(str, p); + label[i] = str->ptr; + if (len < str->length) + len = str->length; + } + label[nitem] = NULL; + + new_option_menu(&menu, label, &linkV, NULL); + + menu.initial = 0; + menu.cursorX = buf->cursorX + buf->rootX; + menu.cursorY = buf->cursorY + buf->rootY; + menu.x = menu.cursorX + FRAME_WIDTH + 1; + menu.y = menu.cursorY + 2; + + popup_menu(NULL, &menu); + + if (linkV < 0) + return NULL; + for (i = 0, l = buf->linklist; l; i++, l = l->next) { + if (i == linkV) + return l; + } + return NULL; + } + + /* --- LinkMenu (END) --- */ + + Anchor * + accesskey_menu(Buffer *buf) + { + Menu menu; + AnchorList *al = buf->href; + Anchor *a; + Anchor **ap; + int i, n, nitem = 0, key = -1; + char **label; + char *t; + unsigned char c; + + if (!al) + return NULL; + for (i = 0; i < al->nanchor; i++) { + a = &al->anchors[i]; + if (!a->slave && a->accesskey && IS_ASCII(a->accesskey)) + nitem++; + } + if (!nitem) + return NULL; + + label = New_N(char *, nitem + 1); + ap = New_N(Anchor *, nitem); + for (i = 0, n = 0; i < al->nanchor; i++) { + a = &al->anchors[i]; + if (!a->slave && a->accesskey && IS_ASCII(a->accesskey)) { + t = getAnchorText(buf, al, a); + label[n] = Sprintf("%c: %s", a->accesskey, t ? t : "")->ptr; + ap[n] = a; + n++; + } + } + label[nitem] = NULL; + + new_option_menu(&menu, label, &key, NULL); + + menu.initial = 0; + menu.cursorX = buf->cursorX + buf->rootX; + menu.cursorY = buf->cursorY + buf->rootY; + menu.x = menu.cursorX + FRAME_WIDTH + 1; + menu.y = menu.cursorY + 2; + for (i = 0; i < 128; i++) + menu.keyselect[i] = -1; + for (i = 0; i < nitem; i++) { + c = ap[i]->accesskey; + menu.keymap[(int)c] = mSelect; + menu.keyselect[(int)c] = i; + } + for (i = 0; i < nitem; i++) { + c = ap[i]->accesskey; + if (!IS_ALPHA(c) || menu.keyselect[n] >= 0) + continue; + c = TOLOWER(c); + menu.keymap[(int)c] = mSelect; + menu.keyselect[(int)c] = i; + c = TOUPPER(c); + menu.keymap[(int)c] = mSelect; + menu.keyselect[(int)c] = i; + } + + a = retrieveCurrentAnchor(buf); + if (a && a->accesskey && IS_ASCII(a->accesskey)) { + for (i = 0; i < nitem; i++) { + if (a->hseq == ap[i]->hseq) { + menu.initial = i; + break; + } + } + } + + popup_menu(NULL, &menu); + + return (key >= 0) ? ap[key] : NULL; + } + + static char lmKeys[] = "abcdefgimopqrstuvwxyz"; + static char lmKeys2[] = "1234567890ABCDEFGHILMOPQRSTUVWXYZ"; + #define nlmKeys (sizeof(lmKeys) - 1) + #define nlmKeys2 (sizeof(lmKeys2) - 1) + + static int + lmGoto(char c) + { + if (IS_ASCII(c) && CurrentMenu->keyselect[(int)c] >= 0) { + goto_menu(CurrentMenu, CurrentMenu->nitem - 1, -1); + goto_menu(CurrentMenu, CurrentMenu->keyselect[(int)c] * nlmKeys, 1); + } + return (MENU_NOTHING); + } + + static int + lmSelect(char c) + { + if (IS_ASCII(c)) + return select_menu(CurrentMenu, (CurrentMenu->select / nlmKeys) * + nlmKeys + CurrentMenu->keyselect[(int)c]); + else + return (MENU_NOTHING); + } + + Anchor * + list_menu(Buffer *buf) + { + Menu menu; + AnchorList *al = buf->href; + Anchor *a; + Anchor **ap; + int i, n, nitem = 0, key = -1, two = FALSE; + char **label; + char *t; + unsigned char c; + + if (!al) + return NULL; + for (i = 0; i < al->nanchor; i++) { + a = &al->anchors[i]; + if (!a->slave) + nitem++; + } + if (!nitem) + return NULL; + + if (nitem >= nlmKeys) + two = TRUE; + label = New_N(char *, nitem + 1); + ap = New_N(Anchor *, nitem); + for (i = 0, n = 0; i < al->nanchor; i++) { + a = &al->anchors[i]; + if (!a->slave) { + t = getAnchorText(buf, al, a); + if (!t) + t = ""; + if (two && n >= nlmKeys2 * nlmKeys) + label[n] = Sprintf(" : %s", t)->ptr; + else if (two) + label[n] = Sprintf("%c%c: %s", lmKeys2[n / nlmKeys], + lmKeys[n % nlmKeys], t)->ptr; + else + label[n] = Sprintf("%c: %s", lmKeys[n], t)->ptr; + ap[n] = a; + n++; + } + } + label[nitem] = NULL; + + new_option_menu(&menu, label, &key, NULL); + + menu.initial = 0; + menu.cursorX = buf->cursorX + buf->rootX; + menu.cursorY = buf->cursorY + buf->rootY; + menu.x = menu.cursorX + FRAME_WIDTH + 1; + menu.y = menu.cursorY + 2; + for (i = 0; i < 128; i++) + menu.keyselect[i] = -1; + if (two) { + for (i = 0; i < nlmKeys2; i++) { + c = lmKeys2[i]; + menu.keymap[(int)c] = lmGoto; + menu.keyselect[(int)c] = i; + } + for (i = 0; i < nlmKeys; i++) { + c = lmKeys[i]; + menu.keymap[(int)c] = lmSelect; + menu.keyselect[(int)c] = i; + } + } + else { + for (i = 0; i < nitem; i++) { + c = lmKeys[i]; + menu.keymap[(int)c] = mSelect; + menu.keyselect[(int)c] = i; + } + } + + a = retrieveCurrentAnchor(buf); + if (a) { + for (i = 0; i < nitem; i++) { + if (a->hseq == ap[i]->hseq) { + menu.initial = i; + break; + } + } + } + + popup_menu(NULL, &menu); + + return (key >= 0) ? ap[key] : NULL; + } + #endif /* USE_MENU */ diff -crN -x CVS w3m-0.3.2.2/mimehead.c w3m-js-1.743/mimehead.c *** w3m-0.3.2.2/mimehead.c 2001-11-24 11:01:26.000000000 +0900 --- w3m-js-1.743/mimehead.c 2003-01-24 21:58:58.000000000 +0900 *************** *** 1,13 **** ! /* $Id: mimehead.c,v 1.4 2001/11/24 02:01:26 ukai Exp $ */ /* * MIME header support by Akinori ITO */ #include #include "Str.h" - #define LINELEN 4096 - #define MIME_ENCODED_LINE_LIMIT 80 #define MIME_ENCODED_WORD_LENGTH_OFFSET 18 #define MIME_ENCODED_WORD_LENGTH_ESTIMATION(x) \ --- 1,12 ---- ! /* $Id: mimehead.c,v 1.8 2003/01/23 18:37:21 ukai Exp $ */ /* * MIME header support by Akinori ITO */ #include + #include "myctype.h" #include "Str.h" #define MIME_ENCODED_LINE_LIMIT 80 #define MIME_ENCODED_WORD_LENGTH_OFFSET 18 #define MIME_ENCODED_WORD_LENGTH_ESTIMATION(x) \ *************** *** 217,223 **** goto convert_fail; w++; p = w; ! switch (method) { case 'B': a = decodeB(&w); break; --- 216,222 ---- goto convert_fail; w++; p = w; ! switch (TOUPPER(method)) { case 'B': a = decodeB(&w); break; diff -crN -x CVS w3m-0.3.2.2/mktable.c w3m-js-1.743/mktable.c *** w3m-0.3.2.2/mktable.c 2002-02-01 22:58:47.000000000 +0900 --- w3m-js-1.743/mktable.c 2002-12-25 02:26:33.000000000 +0900 *************** *** 1,14 **** ! /* $Id: mktable.c,v 1.9 2002/02/01 13:58:47 inu Exp $ */ #include #include ! #include #include "config.h" #include "hash.h" #include "Str.h" #include - #include "gcmain.c" - /* *INDENT-OFF* */ defhash(HashItem_ss *, int, hss_i) /* *INDENT-ON* */ --- 1,12 ---- ! /* $Id: mktable.c,v 1.11 2002/12/24 17:20:47 ukai Exp $ */ #include #include ! #include "myctype.h" #include "config.h" #include "hash.h" #include "Str.h" #include /* *INDENT-OFF* */ defhash(HashItem_ss *, int, hss_i) /* *INDENT-ON* */ *************** *** 27,33 **** /* *INDENT-ON* */ int ! MAIN(int argc, char *argv[], char **envp) { FILE *f; Hash_ss *hash; --- 25,31 ---- /* *INDENT-ON* */ int ! main(int argc, char *argv[], char **envp) { FILE *f; Hash_ss *hash; *************** *** 76,86 **** Strremovetrailingspaces(s); name = Strnew(); for (p = s->ptr; *p; p++) { ! if (isspace(*p)) break; Strcat_char(name, *p); } ! while (*p && isspace(*p)) p++; putHash_ss(hash, name->ptr, p); n++; --- 74,84 ---- Strremovetrailingspaces(s); name = Strnew(); for (p = s->ptr; *p; p++) { ! if (IS_SPACE(*p)) break; Strcat_char(name, *p); } ! while (*p && IS_SPACE(*p)) p++; putHash_ss(hash, name->ptr, p); n++; diff -crN -x CVS w3m-0.3.2.2/myctype.h w3m-js-1.743/myctype.h *** w3m-0.3.2.2/myctype.h 2001-12-11 00:23:08.000000000 +0900 --- w3m-js-1.743/myctype.h 2002-12-25 02:26:33.000000000 +0900 *************** *** 1,4 **** ! /* $Id: myctype.h,v 1.4 2001/12/10 15:23:08 ukai Exp $ */ #ifndef _MYCTYPE_H #define _MYCTYPE_H --- 1,4 ---- ! /* $Id: myctype.h,v 1.5 2002/12/24 17:20:47 ukai Exp $ */ #ifndef _MYCTYPE_H #define _MYCTYPE_H *************** *** 44,51 **** #define IS_KANJI(x) (GET_INTCTYPE(x) & INTCTYPE_KANJI) #define IS_LATIN1(x) (GET_INTCTYPE(x) & INTCTYPE_LATIN1) ! extern unsigned char INTCTYPE_MAP[]; ! #include #endif --- 44,52 ---- #define IS_KANJI(x) (GET_INTCTYPE(x) & INTCTYPE_KANJI) #define IS_LATIN1(x) (GET_INTCTYPE(x) & INTCTYPE_LATIN1) ! #define TOLOWER(x) (IS_ALPHA(x) ? ((x)|0x20) : (x)) ! #define TOUPPER(x) (IS_ALPHA(x) ? ((x)&~0x20) : (x)) ! extern unsigned char INTCTYPE_MAP[]; #endif diff -crN -x CVS w3m-0.3.2.2/news.c w3m-js-1.743/news.c *** w3m-0.3.2.2/news.c 1970-01-01 09:00:00.000000000 +0900 --- w3m-js-1.743/news.c 2003-01-30 04:04:50.000000000 +0900 *************** *** 0 **** --- 1,506 ---- + /* $Id: news.c,v 1.15 2003/01/29 17:10:49 ukai Exp $ */ + #include "fm.h" + #include "myctype.h" + #include + #include + #include + #include + #include + + #ifdef USE_NNTP + + #define NEWS_ENDLINE(p) \ + ((*(p) == '.' && ((p)[1] == '\n' || (p)[1] == '\r' || (p)[1] == '\0')) || \ + *(p) == '\n' || *(p) == '\r' || *(p) == '\0') + + typedef struct _News { + char *host; + int port; + char *mode; + InputStream rf; + FILE *wf; + } News; + + static News current_news = { NULL, 0, NULL, NULL, NULL }; + + static JMP_BUF AbortLoading; + + static MySignalHandler + KeyAbort(SIGNAL_ARG) + { + LONGJMP(AbortLoading, 1); + SIGNAL_RETURN; + } + + static Str + news_command(News * news, char *cmd, char *arg, int *status) + { + Str tmp; + + if (!news->host) + return NULL; + if (cmd) { + if (arg) + tmp = Sprintf("%s %s\r\n", cmd, arg); + else + tmp = Sprintf("%s\r\n", cmd); + fwrite(tmp->ptr, sizeof(char), tmp->length, news->wf); + fflush(news->wf); + } + if (!status) + return NULL; + *status = -1; + tmp = StrISgets(news->rf); + if (tmp->length) + sscanf(tmp->ptr, "%d", status); + return tmp; + } + + static void + news_close(News * news) + { + if (!news->host) + return; + if (news->rf) { + IStype(news->rf) &= ~IST_UNCLOSE; + ISclose(news->rf); + news->rf = NULL; + } + if (news->wf) { + fclose(news->wf); + news->wf = NULL; + } + news->host = NULL; + } + + static int + news_open(News * news) + { + int sock, status; + + sock = openSocket(news->host, "nntp", news->port); + if (sock < 0) + goto open_err; + news->rf = newInputStream(sock); + news->wf = fdopen(dup(sock), "wb"); + if (!news->rf || !news->wf) + goto open_err; + IStype(news->rf) |= IST_UNCLOSE; + news_command(news, NULL, NULL, &status); + if (status != 200 && status != 201) + goto open_err; + if (news->mode) { + news_command(news, "MODE", news->mode, &status); + if (status != 200 && status != 201) + goto open_err; + } + return TRUE; + open_err: + news_close(news); + return FALSE; + } + + static void + news_quit(News * news) + { + news_command(news, "QUIT", NULL, NULL); + news_close(news); + } + + static char * + name_from_address(char *str, int n) + { + char *s, *p; + int i, l, space = TRUE; + + s = allocStr(str, -1); + SKIP_BLANKS(s); + if (*s == '<' && (p = strchr(s, '>'))) { + *p++ = '\0'; + SKIP_BLANKS(p); + if (*p == '\0') /*
    */ + s++; + else /*
    name ? */ + s = p; + } + else if ((p = strchr(s, '<'))) /* name
    */ + *p = '\0'; + else if ((p = strchr(s, '('))) /* address (name) */ + s = p; + if (*s == '"' && (p = strchr(s + 1, '"'))) { /* "name" */ + *p = '\0'; + s++; + } + else if (*s == '(' && (p = strchr(s + 1, ')'))) { /* (name) */ + *p = '\0'; + s++; + } + for (p = s, l = 0; *p; p += i) { + i = get_mclen(get_mctype(p)); + if (IS_SPACE(*p)) { + if (space) + continue; + space = TRUE; + } + else + space = FALSE; + l += i; + if (l > n) + break; + } + *p = '\0'; + return s; + } + + static char * + html_quote_s(char *str) + { + Str tmp = NULL; + char *p, *q; + int space = TRUE; + + for (p = str; *p; p++) { + if (IS_SPACE(*p)) { + if (space) + continue; + q = " "; + space = TRUE; + } + else { + q = html_quote_char(*p); + space = FALSE; + } + if (q) { + if (tmp == NULL) + tmp = Strnew_charp_n(str, (int)(p - str)); + Strcat_charp(tmp, q); + } + else { + if (tmp) + Strcat_char(tmp, *p); + } + } + if (tmp) + return tmp->ptr; + return str; + } + + static void + add_news_message(Str str, int index, char *date, char *name, char *subject, + char *mid, char *scheme, char *group) + { + time_t t; + struct tm *tm; + + name = name_from_address(name, 16); + t = mymktime(date); + tm = localtime(&t); + Strcat(str, + Sprintf("%d(%02d/%02d)%s", + index, tm->tm_mon + 1, tm->tm_mday, html_quote_s(name))); + if (group) + Strcat(str, Sprintf("%s\n", scheme, group, + index, html_quote(subject))); + else + Strcat(str, Sprintf("%s\n", scheme, + html_quote(file_quote(mid)), html_quote(subject))); + } + + /* + * [News article] + * * RFC 1738 + * nntp://:// + * news: + * + * * Extension + * nntp://:// + * nntp://:/ + * news:/ + * news:/ + * + * [News group] + * * RFC 1738 + * news: + * + * * Extension + * nntp://:/ + * nntp://://- + * news:/- + * + * = @ + */ + + InputStream + openNewsStream(ParsedURL *pu) + { + char *host, *mode, *group, *p; + Str tmp; + int port, status; + + if (pu->file == NULL || *pu->file == '\0') + return NULL; + if (pu->scheme == SCM_NNTP || pu->scheme == SCM_NNTP_GROUP) + host = pu->host; + else + host = NNTP_server; + if (!host || *host == '\0') { + if (current_news.host) + news_quit(¤t_news); + return NULL; + } + if (pu->scheme != SCM_NNTP && pu->scheme != SCM_NNTP_GROUP && + (p = strchr(host, ':'))) { + host = allocStr(host, p - host); + port = atoi(p + 1); + } + else + port = pu->port; + if (NNTP_mode && *NNTP_mode) + mode = NNTP_mode; + else + mode = NULL; + if (current_news.host) { + if (!strcmp(current_news.host, host) && current_news.port == port) { + tmp = news_command(¤t_news, "MODE", mode ? mode : "READER", + &status); + if (status != 200 && status != 201) + news_close(¤t_news); + } + else + news_quit(¤t_news); + } + if (!current_news.host) { + current_news.host = allocStr(host, -1); + current_news.port = port; + current_news.mode = mode ? allocStr(mode, -1) : NULL; + if (!news_open(¤t_news)) + return NULL; + } + if (pu->scheme == SCM_NNTP || pu->scheme == SCM_NEWS) { + /* News article */ + group = file_unquote(allocStr(pu->file, -1)); + p = strchr(group, '/'); + if (p == NULL) { /* */ + if (!strchr(group, '@')) + return NULL; + p = group; + } + else { /* / */ + *p++ = '\0'; + news_command(¤t_news, "GROUP", group, &status); + if (status != 211) + return NULL; + } + if (strchr(p, '@')) /* */ + news_command(¤t_news, "ARTICLE", Sprintf("<%s>", p)->ptr, + &status); + else /* */ + news_command(¤t_news, "ARTICLE", p, &status); + if (status != 220) + return NULL; + return current_news.rf; + } + return NULL; + } + + Str + loadNewsgroup(ParsedURL *pu, char *code) + { + volatile Str page; + Str tmp; + URLFile f; + Buffer *buf; + char *qgroup, *p, *q, *s, *t, *n; + char *volatile scheme, *volatile group, *volatile list; + int status, i, first, last; + volatile int flag = 0, start = 0, end = 0; + MySignalHandler(*volatile prevtrap) (SIGNAL_ARG) = NULL; + + if (current_news.host == NULL || !pu->file || *pu->file == '\0') + return NULL; + #ifdef JP_CHARSET + *code = DocumentCode; + #endif + group = allocStr(pu->file, -1); + if (pu->scheme == SCM_NNTP_GROUP) + scheme = "/"; + else + scheme = "news:"; + if ((list = strchr(group, '/'))) { + /* /- */ + *list++ = '\0'; + } + if (fmInitialized) { + message(Sprintf("Reading newsgroup %s...", group)->ptr, 0, 0); + refresh(); + } + qgroup = html_quote(group); + group = file_unquote(group); + page = Strnew_m_charp("\n\nptr, "\">\nNewsgroup: ", + qgroup, "\n\n\n

    Newsgroup: ", + qgroup, "

    \n
    \n", NULL); + + if (SETJMP(AbortLoading) != 0) { + news_close(¤t_news); + Strcat_charp(page, "\n

    Transfer Interrupted!\n"); + goto news_end; + } + TRAP_ON; + + tmp = news_command(¤t_news, "GROUP", group, &status); + if (status != 211) + goto news_list; + if (sscanf(tmp->ptr, "%d %d %d %d", &status, &i, &first, &last) != 4) + goto news_list; + if (list && *list) { + if ((p = strchr(list, '-'))) { + *p++ = '\0'; + end = atoi(p); + } + start = atoi(list); + if (start > 0) { + if (start < first) + start = first; + if (end <= 0) + end = start + MaxNewsMessage - 1; + } + } + if (start <= 0) { + start = first; + end = last; + if (end - start > MaxNewsMessage - 1) + start = end - MaxNewsMessage + 1; + } + page = Sprintf("\n\n\n\ + Newsgroup: %s %d-%d\n\ + \n\n

    Newsgroup: %s %d-%d

    \n
    \n", parsedURL2Str(pu)->ptr, qgroup, start, end, qgroup, start, end); + if (start > first) { + i = start - MaxNewsMessage; + if (i < first) + i = first; + Strcat(page, Sprintf("[%d-%d]\n", scheme, + qgroup, i, start - 1, i, start - 1)); + } + + Strcat_charp(page, "\n"); + news_command(¤t_news, "XOVER", Sprintf("%d-%d", start, end)->ptr, + &status); + if (status == 224) { + f.scheme = SCM_NEWS; + while (1) { + tmp = StrISgets(current_news.rf); + if (NEWS_ENDLINE(tmp->ptr)) + break; + if (sscanf(tmp->ptr, "%d", &i) != 1) + continue; + if (!(s = strchr(tmp->ptr, '\t'))) + continue; + s++; + if (!(n = strchr(s, '\t'))) + continue; + *n++ = '\0'; + if (!(t = strchr(n, '\t'))) + continue; + *t++ = '\0'; + if (!(p = strchr(t, '\t'))) + continue; + *p++ = '\0'; + if (*p == '<') + p++; + if (!(q = strchr(p, '>')) && !(q = strchr(p, '\t'))) + continue; + *q = '\0'; + s = convertLine(&f, decodeMIME(s), code, HEADER_MODE)->ptr; + n = convertLine(&f, decodeMIME(n), code, HEADER_MODE)->ptr; + add_news_message(page, i, t, n, s, p, scheme, + pu->scheme == SCM_NNTP_GROUP ? qgroup : NULL); + } + } + else { + init_stream(&f, SCM_NEWS, current_news.rf); + buf = newBuffer(INIT_BUFFER_WIDTH); + for (i = start; i <= end && i <= last; i++) { + news_command(¤t_news, "HEAD", Sprintf("%d", i)->ptr, + &status); + if (status != 221) + continue; + readHeader(&f, buf, FALSE, NULL); + if (!(p = checkHeader(buf, "Message-ID:"))) + continue; + if (*p == '<') + p++; + if (!(q = strchr(p, '>')) && !(q = strchr(p, '\t'))) + *q = '\0'; + if (!(s = checkHeader(buf, "Subject:"))) + continue; + if (!(n = checkHeader(buf, "From:"))) + continue; + if (!(t = checkHeader(buf, "Date:"))) + continue; + add_news_message(page, i, t, n, s, p, scheme, + pu->scheme == SCM_NNTP_GROUP ? qgroup : NULL); + } + } + Strcat_charp(page, "
    \n"); + + if (end < last) { + i = end + MaxNewsMessage; + if (i > last) + i = last; + Strcat(page, Sprintf("[%d-%d]\n", scheme, + qgroup, end + 1, i, end + 1, i)); + } + flag = 1; + + news_list: + tmp = Sprintf("ACTIVE %s", group); + if (!strchr(group, '*')) + Strcat_charp(tmp, ".*"); + news_command(¤t_news, "LIST", tmp->ptr, &status); + if (status != 215) + goto news_end; + while (1) { + tmp = StrISgets(current_news.rf); + if (NEWS_ENDLINE(tmp->ptr)) + break; + if (flag < 2) { + if (flag == 1) + Strcat_charp(page, "
    \n"); + Strcat_charp(page, "\n"); + flag = 2; + } + p = tmp->ptr; + for (q = p; *q && !IS_SPACE(*q); q++) ; + *(q++) = '\0'; + if (sscanf(q, "%d %d", &last, &first) == 2 && last >= first) + i = last - first + 1; + else + i = 0; + Strcat(page, + Sprintf + ("
    %d%s\n", i, + scheme, html_quote(file_quote(p)), html_quote(p))); + } + if (flag == 2) + Strcat_charp(page, "
    \n"); + + news_end: + Strcat_charp(page, "\n\n"); + TRAP_OFF; + return page; + } + + void + closeNews(void) + { + news_close(¤t_news); + } + + void + disconnectNews(void) + { + news_quit(¤t_news); + } + + #endif /* USE_NNTP */ diff -crN -x CVS w3m-0.3.2.2/parsetagx.c w3m-js-1.743/parsetagx.c *** w3m-0.3.2.2/parsetagx.c 2002-10-17 03:11:15.000000000 +0900 --- w3m-js-1.743/parsetagx.c 2003-02-06 02:23:12.000000000 +0900 *************** *** 1,4 **** ! /* $Id: parsetagx.c,v 1.10 2002/10/16 18:11:15 ukai Exp $ */ #include "fm.h" #include "myctype.h" #include "indep.h" --- 1,4 ---- ! /* $Id: parsetagx.c,v 1.14 2003/02/05 16:44:00 ukai Exp $ */ #include "fm.h" #include "myctype.h" #include "indep.h" *************** *** 45,51 **** char *ep; int x; ! x = strtol(oval, &ep, 0); if (ep > oval) { *num = x; --- 45,51 ---- char *ep; int x; ! x = strtol(oval, &ep, 10); if (ep > oval) { *num = x; *************** *** 128,136 **** } while (*q && !IS_SPACE(*q) && !(tagname[0] != '/' && *q == '/') && *q != '>' && p - tagname < MAX_TAG_LEN - 1) { ! *(p++) = tolower(*(q++)); } *p = '\0'; tag_id = getHash_si(&tagtable, tagname, HTML_UNKNOWN); --- 128,140 ---- } while (*q && !IS_SPACE(*q) && !(tagname[0] != '/' && *q == '/') && *q != '>' && p - tagname < MAX_TAG_LEN - 1) { ! *(p++) = TOLOWER(*q); ! q++; } *p = '\0'; + while (*q && !IS_SPACE(*q) && !(tagname[0] != '/' && *q == '/') && + *q != '>') + q++; tag_id = getHash_si(&tagtable, tagname, HTML_UNKNOWN); *************** *** 161,173 **** p = attrname; while (*q && *q != '=' && !IS_SPACE(*q) && *q != '>' && p - attrname < MAX_TAG_LEN - 1) { ! *(p++) = tolower(*(q++)); ! } ! if (q == p) { q++; - continue; } *p = '\0'; SKIP_BLANKS(q); if (*q == '=') { /* get value */ --- 165,176 ---- p = attrname; while (*q && *q != '=' && !IS_SPACE(*q) && *q != '>' && p - attrname < MAX_TAG_LEN - 1) { ! *(p++) = TOLOWER(*q); q++; } *p = '\0'; + while (*q && *q != '=' && !IS_SPACE(*q) && *q != '>') + q++; SKIP_BLANKS(q); if (*q == '=') { /* get value */ *************** *** 179,185 **** while (*q && *q != '"') { if (*q != '\n') Strcat_char(value, *q); ! if (!tag->need_reconstruct && html_quote_char(*q)) tag->need_reconstruct = TRUE; q++; } --- 182,188 ---- while (*q && *q != '"') { if (*q != '\n') Strcat_char(value, *q); ! if (!tag->need_reconstruct && is_html_quote(*q)) tag->need_reconstruct = TRUE; q++; } *************** *** 191,197 **** while (*q && *q != '\'') { if (*q != '\n') Strcat_char(value, *q); ! if (!tag->need_reconstruct && html_quote_char(*q)) tag->need_reconstruct = TRUE; q++; } --- 194,200 ---- while (*q && *q != '\'') { if (*q != '\n') Strcat_char(value, *q); ! if (!tag->need_reconstruct && is_html_quote(*q)) tag->need_reconstruct = TRUE; q++; } *************** *** 199,206 **** q++; } else if (*q) { ! while (*q && !IS_SPACE(*q) && *q != '>') ! Strcat_char(value, *q++); } } for (i = 0; i < nattr; i++) { --- 202,213 ---- q++; } else if (*q) { ! while (*q && !IS_SPACE(*q) && *q != '>') { ! Strcat_char(value, *q); ! if (!tag->need_reconstruct && is_html_quote(*q)) ! tag->need_reconstruct = TRUE; ! q++; ! } } } for (i = 0; i < nattr; i++) { *************** *** 225,230 **** --- 232,240 ---- else tag->value[i] = NULL; } + else { + tag->need_reconstruct = TRUE; + } } skip_parse_tagarg: diff -crN -x CVS w3m-0.3.2.2/proto.h w3m-js-1.743/proto.h *** w3m-0.3.2.2/proto.h 2002-10-31 00:39:41.000000000 +0900 --- w3m-js-1.743/proto.h 2003-02-08 02:38:49.000000000 +0900 *************** *** 1,4 **** ! /* $Id: proto.h,v 1.48 2002/10/30 15:39:41 ukai Exp $ */ /* * This file was automatically generated by version 1.7 of cextract. * Manual editing not recommended. --- 1,4 ---- ! /* $Id: proto.h,v 1.90 2003/02/06 17:21:44 ukai Exp $ */ /* * This file was automatically generated by version 1.7 of cextract. * Manual editing not recommended. *************** *** 7,13 **** */ extern int main(int argc, char **argv, char **envp); extern void nulcmd(void); ! extern void pushEvent(int event, void *user_data); extern MySignalHandler intTrap(SIGNAL_ARG); extern void pgFore(void); extern void pgBack(void); --- 7,13 ---- */ extern int main(int argc, char **argv, char **envp); extern void nulcmd(void); ! extern void pushEvent(int cmd, void *data); extern MySignalHandler intTrap(SIGNAL_ARG); extern void pgFore(void); extern void pgBack(void); *************** *** 71,76 **** --- 71,78 ---- extern void nextRD(void); extern void nextD(void); extern void nextU(void); + extern void nextBf(void); + extern void prevBf(void); extern void backBf(void); extern void deletePrevBuf(void); extern void goURL(void); *************** *** 90,95 **** --- 92,98 ---- extern void curURL(void); extern void vwSrc(void); extern void reload(void); + extern void reshape(void); extern void chkURL(void); extern void chkURLBuffer(Buffer *buf); extern void chkWORD(void); *************** *** 113,124 **** #endif #ifdef USE_ALARM extern void setAlarm(void); ! extern void setAlarmEvent(int sec, short status, int cmd, void *data); #else #define setAlarm nulcmd #endif extern void reinit(void); extern void defKey(void); extern int currentLn(Buffer *buf); extern void tmpClearBuffer(Buffer *buf); extern char *filename_extension(char *patch, int is_url); --- 116,156 ---- #endif #ifdef USE_ALARM extern void setAlarm(void); ! extern AlarmEvent *setAlarmEvent(AlarmEvent *event, int sec, short status, ! int cmd, void *data); #else #define setAlarm nulcmd #endif extern void reinit(void); extern void defKey(void); + extern void newT(void); + extern void closeT(void); + extern void nextT(void); + extern void prevT(void); + extern void tabA(void); + extern void tabURL(void); + extern void tabrURL(void); + extern void tabR(void); + extern void tabL(void); + extern void ldDL(void); + extern void linkLst(void); + #ifdef USE_MENU + extern void linkMn(void); + extern LinkList *link_menu(Buffer *buf); + extern void accessKey(void); + extern Anchor *accesskey_menu(Buffer *buf); + extern void listMn(void); + extern void movlistMn(void); + extern Anchor *list_menu(Buffer *buf); + #else + #define linkMn nulcmd + #define accessKey nulcmd + #define listMn nulcmd + #define movlistMn nulcmd + #endif + extern void undoPos(void); + extern void redoPos(void); + extern int currentLn(Buffer *buf); extern void tmpClearBuffer(Buffer *buf); extern char *filename_extension(char *patch, int is_url); *************** *** 152,158 **** #ifdef USE_IMAGE extern void deleteImage(Buffer *buf); extern void getAllImage(Buffer *buf); ! extern void loadImage(int flag); extern ImageCache *getImage(Image * image, ParsedURL *current, int flag); extern int getImageSize(ImageCache * cache); #endif --- 184,190 ---- #ifdef USE_IMAGE extern void deleteImage(Buffer *buf); extern void getAllImage(Buffer *buf); ! extern void loadImage(Buffer *buf, int flag); extern ImageCache *getImage(Image * image, ParsedURL *current, int flag); extern int getImageSize(ImageCache * cache); #endif *************** *** 166,173 **** --- 198,214 ---- extern Str process_textarea(struct parsed_tag *tag, int width); extern Str process_n_textarea(void); extern void feed_textarea(char *str); + #ifdef USE_SCRIPT + extern Str process_script(struct parsed_tag *tag, struct html_feed_environ *h_env); + extern Str process_n_script(struct html_feed_environ *h_env); + extern void feed_script(char *str, struct html_feed_environ *h_env); + extern Str script_eval(Buffer *buf, char *lang, char *script); + extern void script_close(Buffer *buf); + extern void jWindowOpen(Buffer *buf, char *url, char *target); + #endif extern Str process_form(struct parsed_tag *tag); extern Str process_n_form(void); + extern int getMetaRefreshParam(char *q, Str *refresh_uri); extern int HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env); extern void HTMLlineproc2(Buffer *buf, TextLineList *tl); *************** *** 175,180 **** --- 216,223 ---- int internal); #define HTMLlineproc1(x,y) HTMLlineproc0(x,y,TRUE) extern Buffer *loadHTMLBuffer(URLFile *f, Buffer *newBuf); + extern char *convert_size(clen_t size, int usefloat); + extern char *convert_size2(clen_t size1, clen_t size2, int usefloat); extern void showProgress(clen_t *linelen, clen_t *trbyte); extern void init_henv(struct html_feed_environ *, struct readbuffer *, struct environment *, int, TextLineList *, int, int); *************** *** 184,196 **** int internal); extern Buffer *loadHTMLString(Str page); #ifdef USE_GOPHER ! extern Buffer *loadGopherDir(URLFile *uf, Buffer *newBuf); #endif /* USE_GOPHER */ extern Buffer *loadBuffer(URLFile *uf, Buffer *newBuf); #ifdef USE_IMAGE extern Buffer *loadImageBuffer(URLFile *uf, Buffer *newBuf); #endif ! extern void saveBuffer(Buffer *buf, FILE * f); extern Buffer *getshell(char *cmd); extern Buffer *getpipe(char *cmd); extern Buffer *openPagerBuffer(InputStream stream, Buffer *buf); --- 227,240 ---- int internal); extern Buffer *loadHTMLString(Str page); #ifdef USE_GOPHER ! extern Str loadGopherDir(URLFile *uf, ParsedURL *pu, char *code); #endif /* USE_GOPHER */ extern Buffer *loadBuffer(URLFile *uf, Buffer *newBuf); #ifdef USE_IMAGE extern Buffer *loadImageBuffer(URLFile *uf, Buffer *newBuf); #endif ! extern void saveBuffer(Buffer *buf, FILE * f, int cont); ! extern void saveBufferBody(Buffer *buf, FILE * f, int cont); extern Buffer *getshell(char *cmd); extern Buffer *getpipe(char *cmd); extern Buffer *openPagerBuffer(InputStream stream, Buffer *buf); *************** *** 199,207 **** extern int save2tmp(URLFile uf, char *tmpf); extern int doExternal(URLFile uf, char *path, char *type, Buffer **bufp, Buffer *defaultbuf); ! extern void doFileCopy(char *tmpf, char *defstr); ! extern void doFileMove(char *tmpf, char *defstr); ! extern void doFileSave(URLFile uf, char *defstr); extern int checkCopyFile(char *path1, char *path2); extern int checkSaveFile(InputStream stream, char *path); extern int checkOverWrite(char *path); --- 243,252 ---- extern int save2tmp(URLFile uf, char *tmpf); extern int doExternal(URLFile uf, char *path, char *type, Buffer **bufp, Buffer *defaultbuf); ! extern int _doFileCopy(char *tmpf, char *defstr, int download); ! #define doFileCopy(tmpf, defstr) _doFileCopy(tmpf, defstr, FALSE); ! extern int doFileMove(char *tmpf, char *defstr); ! extern int doFileSave(URLFile uf, char *defstr); extern int checkCopyFile(char *path1, char *path2); extern int checkSaveFile(InputStream stream, char *path); extern int checkOverWrite(char *path); *************** *** 209,214 **** --- 254,267 ---- extern int matchattr(char *p, char *attr, int len, Str *value); extern void readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu); extern char *checkHeader(Buffer *buf, char *field); + extern TabBuffer *newTab(void); + extern void calcTabPos(void); + extern TabBuffer *deleteTab(TabBuffer *tab); + extern void addDownloadList(pid_t pid, char *url, char *save, char *lock, + clen_t size); + extern void stopDownload(void); + extern int checkDownloadList(void); + extern void download_action(struct parsed_tagarg *arg); extern Buffer *newBuffer(int width); extern Buffer *nullBuffer(void); extern void clearBuffer(Buffer *buf); *************** *** 229,248 **** extern void fmTerm(void); extern void fmInit(void); extern void displayBuffer(Buffer *buf, int mode); - extern void redrawBuffer(Buffer *buf); - extern void redrawNLine(Buffer *buf, int n); - extern Line *redrawLine(Buffer *buf, Line *l, int i); - extern int redrawLineRegion(Buffer *buf, Line *l, int i, int bpos, int epos); - extern void do_effects(Lineprop m); - #ifdef USE_ANSI_COLOR - extern void do_color(Linecolor c); - #endif extern void addChar(char c, Lineprop mode); - extern GeneralList *message_list; extern void record_err_message(char *s); extern Buffer *message_list_panel(void); extern void message(char *s, int return_x, int return_y); ! #define disp_err_message(s, f) (record_err_message((s)), disp_message((s), (f))) extern void disp_message_nsec(char *s, int redraw_current, int sec, int purge, int mouse); extern void disp_message(char *s, int redraw_current); --- 282,292 ---- extern void fmTerm(void); extern void fmInit(void); extern void displayBuffer(Buffer *buf, int mode); extern void addChar(char c, Lineprop mode); extern void record_err_message(char *s); extern Buffer *message_list_panel(void); extern void message(char *s, int return_x, int return_y); ! extern void disp_err_message(char *s, int redraw_current); extern void disp_message_nsec(char *s, int redraw_current, int sec, int purge, int mouse); extern void disp_message(char *s, int redraw_current); *************** *** 252,258 **** --- 296,304 ---- #define disp_message_nomouse disp_message #endif extern void set_delayed_message(char *s); + extern void cursorUp0(Buffer *buf, int n); extern void cursorUp(Buffer *buf, int n); + extern void cursorDown0(Buffer *buf, int n); extern void cursorDown(Buffer *buf, int n); extern void cursorUpDown(Buffer *buf, int n); extern void cursorRight(Buffer *buf, int n); *************** *** 264,277 **** extern void restorePosition(Buffer *buf, Buffer *orig); extern int columnSkip(Buffer *buf, int offset); extern int columnPos(Line *line, int column); extern Line *lineSkip(Buffer *buf, Line *line, int offset, int last); extern Line *currentLineSkip(Buffer *buf, Line *line, int offset, int last); extern int gethtmlcmd(char **s); ! extern Str checkType(Str s, Lineprop *oprop, ! #ifdef USE_ANSI_COLOR ! Linecolor *ocolor, int *check_color, #endif ! int len); extern int calcPosition(char *l, Lineprop *pr, int len, int pos, int bpos, int mode); extern char *lastFileName(char *path); --- 310,323 ---- extern void restorePosition(Buffer *buf, Buffer *orig); extern int columnSkip(Buffer *buf, int offset); extern int columnPos(Line *line, int column); + extern int columnLen(Line *line, int column); extern Line *lineSkip(Buffer *buf, Line *line, int offset, int last); extern Line *currentLineSkip(Buffer *buf, Line *line, int offset, int last); extern int gethtmlcmd(char **s); ! #ifndef USE_ANSI_COLOR ! #define checkType(a,b,c) _checkType(a,b) #endif ! extern Str checkType(Str s, Lineprop **oprop, Linecolor **ocolor); extern int calcPosition(char *l, Lineprop *pr, int len, int pos, int bpos, int mode); extern char *lastFileName(char *path); *************** *** 289,294 **** --- 335,341 ---- extern void escmap(void); extern void escbmap(void); extern void escdmap(char c); + extern void multimap(void); extern char *inputLineHistSearch(char *prompt, char *def_str, int flag, Hist *hist, int (*incfunc) (int ch, Str buf, Lineprop *prop)); *************** *** 331,353 **** extern void formRecheckRadio(Anchor *a, Buffer *buf, FormItemList *form); extern void formResetBuffer(Buffer *buf, AnchorList *formitem); extern void formUpdateBuffer(Anchor *a, Buffer *buf, FormItemList *form); extern Str textfieldrep(Str s, int width); extern void input_textarea(FormItemList *fi); extern void do_internal(char *action, char *data); extern void form_write_data(FILE * f, char *boundary, char *name, char *value); extern void form_write_from_file(FILE * f, char *boundary, char *name, char *filename, char *file); extern void follow_map(struct parsed_tagarg *arg); ! #ifdef MENU_MAP ! extern char *follow_map_menu(Buffer *buf, struct parsed_tagarg *arg, ! Anchor *a_img, int x, int y); ! #else ! extern Buffer *follow_map_panel(Buffer *buf, struct parsed_tagarg *arg); #endif #ifdef USE_IMAGE extern int getMapXY(Buffer *buf, Anchor *a, int *x, int *y); #endif ! extern MapArea *newMapArea(char *url, char *alt, char *shape, char *coords); extern Buffer *page_info_panel(Buffer *buf); extern struct frame_body *newFrame(struct parsed_tag *tag, Buffer *buf); extern struct frameset *newFrameSet(struct parsed_tag *tag); --- 378,406 ---- extern void formRecheckRadio(Anchor *a, Buffer *buf, FormItemList *form); extern void formResetBuffer(Buffer *buf, AnchorList *formitem); extern void formUpdateBuffer(Anchor *a, Buffer *buf, FormItemList *form); + extern void preFormUpdateBuffer(Buffer *buf); extern Str textfieldrep(Str s, int width); extern void input_textarea(FormItemList *fi); extern void do_internal(char *action, char *data); extern void form_write_data(FILE * f, char *boundary, char *name, char *value); extern void form_write_from_file(FILE * f, char *boundary, char *name, char *filename, char *file); + extern MapList *searchMapList(Buffer *buf, char *name); extern void follow_map(struct parsed_tagarg *arg); ! #if defined(MENU_MAP) || defined(USE_IMAGE) ! extern MapArea *follow_map_menu(Buffer *buf, char *name, Anchor *a_img, int x, ! int y); ! #endif ! #ifndef MENU_MAP ! extern Buffer *follow_map_panel(Buffer *buf, char *name); #endif #ifdef USE_IMAGE extern int getMapXY(Buffer *buf, Anchor *a, int *x, int *y); + extern MapArea *retrieveCurrentMapArea(Buffer *buf); #endif ! extern Anchor *retrieveCurrentMap(Buffer *buf); ! extern MapArea *newMapArea(char *url, char *target, char *alt, char *shape, ! char *coords); extern Buffer *page_info_panel(Buffer *buf); extern struct frame_body *newFrame(struct parsed_tag *tag, Buffer *buf); extern struct frameset *newFrameSet(struct parsed_tag *tag); *************** *** 367,372 **** --- 420,426 ---- extern int set_tty(void); extern void set_cc(int spec, int val); extern void close_tty(void); + extern char *ttyname_tty(void); extern void reset_tty(void); extern MySignalHandler reset_exit(SIGNAL_ARG); extern MySignalHandler error_dump(SIGNAL_ARG); *************** *** 374,379 **** --- 428,434 ---- extern void getTCstr(void); extern void setlinescols(void); extern void setupscreen(void); + extern pid_t open_pipe_rw(FILE **fr, FILE **fw); extern int initscr(void); extern int write1(char c); extern void endline(void); *************** *** 401,409 **** --- 456,468 ---- #endif /* USE_COLOR */ extern void refresh(void); extern void clear(void); + #ifdef USE_RAW_SCROLL extern void scroll(int); extern void rscroll(int); + #endif + #if 0 extern void need_clrtoeol(void); + #endif extern void clrtoeol(void); extern void clrtoeolx(void); extern void clrtobot(void); *************** *** 424,430 **** extern void toggle_stand(void); extern char getch(void); extern void bell(void); ! extern void sleep_till_anykey(int sec, int purge); #ifdef USE_IMAGE extern void touch_cursor(); #endif --- 483,489 ---- extern void toggle_stand(void); extern char getch(void); extern void bell(void); ! extern int sleep_till_anykey(int sec, int purge); #ifdef USE_IMAGE extern void touch_cursor(); #endif *************** *** 437,442 **** --- 496,503 ---- extern char str_to_code(char *str); extern char *code_to_str(char code); extern void put_sjis(Str os, unsigned char ub, unsigned char lb); + #else + #define conv_str(is, fc, tc) (is) #endif /* JP_CHARSET */ extern void initMimeTypes(); extern void free_ssl_ctx(); *************** *** 465,481 **** extern char *guessContentType(char *filename); extern TextList *make_domain_list(char *domain_list); extern int check_no_proxy(char *domain); ! extern FILE *openFTP(ParsedURL *pu); ! extern Str readFTPDir(ParsedURL *pu); ! extern void closeFTP(FILE * f); ! extern int Ftpfclose(FILE * f); extern AnchorList *putAnchor(AnchorList *al, char *url, char *target, ! Anchor **anchor_return, char *referer, int line, int pos); extern Anchor *registerHref(Buffer *buf, char *url, char *target, ! char *referer, int line, int pos); extern Anchor *registerName(Buffer *buf, char *url, int line, int pos); ! extern Anchor *registerImg(Buffer *buf, char *url, int line, int pos); extern Anchor *registerForm(Buffer *buf, FormList *flist, struct parsed_tag *tag, int line, int pos); extern int onAnchor(Anchor *a, int line, int pos); --- 526,551 ---- extern char *guessContentType(char *filename); extern TextList *make_domain_list(char *domain_list); extern int check_no_proxy(char *domain); ! extern InputStream openFTPStream(ParsedURL *pu, URLFile *uf); ! extern Str loadFTPDir(ParsedURL *pu, char *code); ! extern void closeFTP(void); ! extern void disconnectFTP(void); ! #ifdef USE_NNTP ! extern InputStream openNewsStream(ParsedURL *pu); ! extern Str loadNewsgroup(ParsedURL *pu, char *code); ! extern void closeNews(void); ! extern void disconnectNews(void); ! #endif extern AnchorList *putAnchor(AnchorList *al, char *url, char *target, ! Anchor **anchor_return, char *referer, ! char *title, unsigned char key, int line, int pos); extern Anchor *registerHref(Buffer *buf, char *url, char *target, ! char *referer, char *title, unsigned char key, ! int line, int pos); extern Anchor *registerName(Buffer *buf, char *url, int line, int pos); ! extern Anchor *registerImg(Buffer *buf, char *url, char *title, int line, ! int pos); extern Anchor *registerForm(Buffer *buf, FormList *flist, struct parsed_tag *tag, int line, int pos); extern int onAnchor(Anchor *a, int line, int pos); *************** *** 489,494 **** --- 559,565 ---- extern char *reAnchor(Buffer *buf, char *re); #ifdef USE_NNTP extern char *reAnchorNews(Buffer *buf, char *re); + extern char *reAnchorNewsheader(Buffer *buf); #endif /* USE_NNTP */ extern void addMultirowsForm(Buffer *buf, AnchorList *al); extern Anchor *closest_next_anchor(AnchorList *a, Anchor *an, int x, int y); *************** *** 497,502 **** --- 568,576 ---- void addMultirowsImg(Buffer *buf, AnchorList *al); #endif extern HmarkerList *putHmarker(HmarkerList *ml, int line, int pos, int seq); + extern char *getAnchorText(Buffer *buf, AnchorList *al, Anchor *a); + extern Buffer *link_list_panel(Buffer *buf); + extern Str decodeB(char **ww); extern Str decodeQ(char **ww); extern Str decodeQP(char **ww); *************** *** 506,526 **** extern Str encodeB(char *a); extern int set_param_option(char *option); extern char *get_param_option(char *name); ! extern void create_option_search_table(); ! extern void init_rc(char *config_filename); extern Buffer *load_option_panel(void); extern void panel_set_option(struct parsed_tagarg *); extern void sync_with_option(void); extern char *rcFile(char *base); extern char *etcFile(char *base); extern char *libFile(char *base); extern char *helpFile(char *base); extern void setLocalCookie(void); ! extern Buffer *dirBuffer(char *dirname); extern void set_environ(char *var, char *value); extern FILE *localcgi_post(char *, char *, FormList *, char *); ! extern FILE *localcgi_get(char *, char *, char *); extern void loadPasswd(void); extern int find_auth_user_passwd(ParsedURL *pu, char *realm, Str *uname, Str *pwd, int is_proxy); extern Str find_auth_cookie(char *host, int port, char *file, char *realm); --- 580,602 ---- extern Str encodeB(char *a); extern int set_param_option(char *option); extern char *get_param_option(char *name); ! extern void init_rc(void); extern Buffer *load_option_panel(void); extern void panel_set_option(struct parsed_tagarg *); extern void sync_with_option(void); extern char *rcFile(char *base); extern char *etcFile(char *base); + extern char *auxbinFile(char *base); extern char *libFile(char *base); extern char *helpFile(char *base); extern void setLocalCookie(void); ! extern Str loadLocalDir(char *dirname); extern void set_environ(char *var, char *value); extern FILE *localcgi_post(char *, char *, FormList *, char *); ! #define localcgi_get(u, q, r) localcgi_post((u), (q), NULL, (r)) ! extern FILE *openSecretFile(char *fname); extern void loadPasswd(void); + extern void loadPreForm(void); extern int find_auth_user_passwd(ParsedURL *pu, char *realm, Str *uname, Str *pwd, int is_proxy); extern Str find_auth_cookie(char *host, int port, char *file, char *realm); *************** *** 529,543 **** extern char *last_modified(Buffer *buf); extern Str romanNumeral(int n); extern Str romanAlphabet(int n); ! extern void reset_signals(void); extern void mySystem(char *command, int background); extern Str myExtCommand(char *cmd, char *arg, int redirect); extern Str myEditor(char *cmd, char *file, int line); extern char *file_to_url(char *file); extern char *expandName(char *name); extern Str tmpfname(int type, char *ext); - #ifdef USE_COOKIE extern time_t mymktime(char *timestr); extern char *FQDN(char *host); extern Str find_cookie(ParsedURL *pu); extern int add_cookie(ParsedURL *pu, Str name, Str value, time_t expires, --- 605,624 ---- extern char *last_modified(Buffer *buf); extern Str romanNumeral(int n); extern Str romanAlphabet(int n); ! extern void setup_child(int child, int i, int f); ! extern void myExec(char *command); extern void mySystem(char *command, int background); extern Str myExtCommand(char *cmd, char *arg, int redirect); extern Str myEditor(char *cmd, char *file, int line); extern char *file_to_url(char *file); + #ifndef JP_CHARSET + #define url_unquote_conv(x,y) _url_unquote_conv(x) + #endif + extern char *url_unquote_conv(char *url, char code); extern char *expandName(char *name); extern Str tmpfname(int type, char *ext); extern time_t mymktime(char *timestr); + #ifdef USE_COOKIE extern char *FQDN(char *host); extern Str find_cookie(ParsedURL *pu); extern int add_cookie(ParsedURL *pu, Str name, Str value, time_t expires, *************** *** 573,581 **** --- 654,674 ---- extern void mouse_active(void); extern void mouse_inactive(void); extern void msToggle(void); + extern void movMs(void); + #ifdef USE_MENU + extern void menuMs(void); + #else + #define menuMs nulcmd + #endif + extern void tabMs(void); + extern void closeTMs(void); #else /* not USE_MOUSE */ #define mouse nulcmd #define msToggle nulcmd + #define movMs nulcmd + #define menuMs nulcmd + #define tabMs nulcmd + #define closeTMs nulcmd #endif /* not USE_MOUSE */ #ifdef USE_IMAGE *************** *** 596,601 **** --- 689,697 ---- extern char *getKeyData(int key); extern char *getWord(char **str); extern char *getQWord(char **str); + #ifdef USE_MOUSE + extern void initMouseAction(void); + #endif #ifdef USE_MENU extern void new_menu(Menu *menu, MenuItem *item); *************** *** 621,632 **** --- 717,730 ---- extern void mainMenu(int x, int y); extern void mainMn(void); extern void selMn(void); + extern void tabMn(void); extern void optionMenu(int x, int y, char **label, int *variable, int initial, void (*func) ()); extern void initMenu(void); #else /* not USE_MENU */ #define mainMn nulcmd #define selMn selBuf + #define tabMn nulcmd #endif /* not USE_MENU */ #ifdef USE_DICT *************** *** 636,648 **** #define dictword nulcmd #define dictwordat nulcmd #endif /* not USE_DICT */ ! extern void reloadBuffer(Buffer *buf); ! extern char *guess_save_name(Buffer *buf, char *file); extern void wrapToggle(void); extern void saveBufferInfo(void); extern void dispVer(void); --- 734,748 ---- #define dictword nulcmd #define dictwordat nulcmd #endif /* not USE_DICT */ ! #if 0 extern void reloadBuffer(Buffer *buf); ! #endif extern char *guess_save_name(Buffer *buf, char *file); extern void wrapToggle(void); + #ifdef USE_BUFINFO extern void saveBufferInfo(void); + #endif extern void dispVer(void); diff -crN -x CVS w3m-0.3.2.2/rc.c w3m-js-1.743/rc.c *** w3m-0.3.2.2/rc.c 2002-10-29 02:09:29.000000000 +0900 --- w3m-js-1.743/rc.c 2003-02-08 02:38:49.000000000 +0900 *************** *** 1,4 **** ! /* $Id: rc.c,v 1.54 2002/10/28 17:09:29 ukai Exp $ */ /* * Initialization file etc. */ --- 1,4 ---- ! /* $Id: rc.c,v 1.82 2003/02/05 16:48:09 ukai Exp $ */ /* * Initialization file etc. */ *************** *** 33,40 **** static struct rc_search_table *RC_search_table; static int RC_table_size; - static char *config_file = NULL; - #define P_INT 0 #define P_SHORT 1 #define P_CHARINT 2 --- 33,38 ---- *************** *** 65,71 **** --- 63,72 ---- #define CMT_FRAME "・ユ・。シ・爨ホシォニーノスシィ" #define CMT_ARGV_IS_URL "scheme 、ホ、ハ、、ーソ、 URL 、ネ、゚、ハ、ケ" #define CMT_TSELF "target、ャフ、サリト熙ホセケ遉ヒ_self、サネヘム、ケ、" + #define CMT_OPEN_TAB_BLANK "target、ャ_blank、ォ_new、ホセケ遉マソキ、キ、、・ソ・ヨ、ヌウォ、ッ" + #define CMT_OPEN_TAB_DL_LIST "Download list panel 、ソキ、キ、、・ソ・ヨ、ヌウォ、ッ" #define CMT_DISPLINK "・・・ッタ隍ホシォニーノスシィ" + #define CMT_DECODE_URL "URL、・ヌ・ウ。シ・ノ、キ、ニノスシィ" #define CMT_DISPLINEINFO "クスコ゚、ホケヤネヨケ讀ホノスシィ" #define CMT_DISP_IMAGE "・、・・鬣、・イ霖、ノスシィ" #ifdef USE_IMAGE *************** *** 74,83 **** --- 75,87 ---- #define CMT_EXT_IMAGE_VIEWER "イ霖、ウーノ・モ・蝪シ・、ヌノスシィ" #define CMT_IMAGE_SCALE "イ霖、ホ・ケ・ア。シ・(%)" #define CMT_IMGDISPLAY "イ霖、ノスシィ、ケ、、ソ、皃ホ・ウ・゙・・ノ" + #define CMT_IMAGE_MAP_LIST "・、・癸シ・ク・゙・テ・ラ、ホ・・・ッタ隹ヘ、ノスシィ" #endif #define CMT_MULTICOL "・ユ・。・、・フセ、ホ・゙・・チ・ォ・鬣猖スシィ" #define CMT_ALT_ENTITY "・ィ・・ニ・」・ニ・」、 ASCII 、ホツ蠶リノスクス、ヌノス、ケ" + #define CMT_GRAPHIC_CHAR "・ニ。シ・ヨ・、茹皈ヒ・蝪シ、ホマネ、ヒ graphic ハクサ、サネ、ヲ" #define CMT_FOLD_TEXTAREA "TEXTAREA 、ホケヤ、ダ、ハヨ、キ、ニノスシィ" + #define CMT_DISP_INS_DEL "DEL, S, STRIKE ヘラチヌ、ホニ簣ニ、ノスシィ、ケ、。」" #define CMT_COLOR "・ォ・鬘シノスシィ" #define CMT_B_COLOR "ハクサ、ホソァ" #define CMT_A_COLOR "・「・・ォ。シ、ホソァ" *************** *** 89,95 **** --- 93,103 ---- #define CMT_C_COLOR "クスコ゚チェツ、オ、、ニ、、、・・・ッ、ホソァ" #define CMT_VISITED_ANCHOR "ヒャ、、ソ、ウ、ネ、ャ、「、・・・ッ、マソァ、ハム、ィ、" #define CMT_V_COLOR "ヒャ、、ソ、ウ、ネ、ャ、「、・・・ッ、ホソァ" + #define CMT_USE_PROXY "・ラ・・ュ・キ、サネヘム、ケ、" #define CMT_HTTP_PROXY "HTTP・ラ・・ュ・キ(URL、ヌニホマ)" + #ifdef USE_SSL + #define CMT_HTTPS_PROXY "HTTPS・ラ・・ュ・キ(URL、ヌニホマ)" + #endif /* USE_SSL */ #ifdef USE_GOPHER #define CMT_GOPHER_PROXY "GOPHER・ラ・・ュ・キ(URL、ヌニホマ)" #endif /* USE_GOPHER */ *************** *** 97,107 **** --- 105,121 ---- #define CMT_NO_PROXY "・ラ・・ュ・キ、ォ、鮨ウー、ケ、・ノ・皈、・" #define CMT_NOPROXY_NETADDR "・ヘ・テ・ネ・。シ・ッ・「・ノ・・ケ、ヌ・ラ・・ュ・キスウー、ホ・チ・ァ・テ・ッ" #define CMT_NO_CACHE "Cache 、サネ、、ハ、、" + #ifdef USE_NNTP + #define CMT_NNTP_SERVER "News ・オ。シ・ミ" + #define CMT_NNTP_MODE "News ・オ。シ・ミ、ホ・筍シ・ノ" + #define CMT_MAX_NEWS "News 、ーヘノスシィ、ケ、サ、ホソ" + #endif #define CMT_DNS_ORDER "フセチーイキ隍ホス鄂" #define CMT_DROOT "/ 、ヌノス、オ、、・ヌ・」・・ッ・ネ・(document root)" #define CMT_PDROOT "/~user 、ヌノス、オ、、・ヌ・」・・ッ・ネ・" #define CMT_CGIBIN "/cgi-bin 、ヌノス、オ、、・ヌ・」・・ッ・ネ・" #define CMT_CONFIRM_QQ "q 、ヌ、ホスェホササ、ヒウホヌァ、ケ、" + #define CMT_CLOSE_TAB_BACK "フ皃サ、ヒ・ミ・テ・ユ・。、ャコヌク螟ハ、鬣ソ・ヨ、ハト、ク、" #ifdef USE_MARK #define CMT_USE_MARK "・゙。シ・ッオ。ヌス、ヘュク、ヒ、ケ、" #endif *************** *** 117,122 **** --- 131,137 ---- #ifdef NEXTPAGE_TOPLINE #define CMT_NEXTPAGE_TOPLINE "シ。、ホ・レ。シ・ク、ヒーワニー、ケ、サ、ヒ・ォ。シ・ス・、ャ・ネ・テ・ラ、ヒ、ハ、、隍ヲ、ヒ、ケ、" #endif + #define CMT_FOLD_LINE "plain text ・ユ・。・、・、ホケヤ、ダ、ハヨ、ケ" #define CMT_SHOW_NUM "ケヤネヨケ讀ノスシィ、ケ、" #define CMT_SHOW_SRCH_STR "ク。コハクサホ、ノスシィ、ケ、" #define CMT_MIMETYPES "ヘヘム、ケ、mime.types" *************** *** 127,133 **** --- 142,150 ---- #define CMT_EXTBRZ "ウーノ・ヨ・鬣ヲ・カ" #define CMT_EXTBRZ2 "ウーノ・ヨ・鬣ヲ・カ、ス、ホ2" #define CMT_EXTBRZ3 "ウーノ・ヨ・鬣ヲ・カ、ス、ホ3" + #define CMT_DISABLE_SECRET_SECURITY_CHECK "・ム・ケ・。シ・ノ・ユ・。・、・、ホ・ム。シ・゚・テ・キ・逾、・チ・ァ・テ・ッ、キ、ハ、、" #define CMT_PASSWDFILE "・ム・ケ・。シ・ノ・ユ・。・、・" + #define CMT_PRE_FORM_FILE "ハクスニノケサ、ホ・ユ・ゥ。シ・狢゚トヘム・ユ・。・、・" #define CMT_FTPPASS "FTP、ホ・ム・ケ・。シ・ノ(ノ眛フ、マシォハャ、ホmail address、サネ、ヲ)" #ifdef FTPPASS_HOSTNAMEGEN #define CMT_FTPPASS_HOSTNAMEGEN "FTP、ホ・ム・ケ・。シ・ノ、ホ・ノ・皈、・フセ、シォニータクタョ、ケ、" *************** *** 157,167 **** #define CMT_RETRY_HTTP "URL、ヒシォニーナェ、ヒ http:// 、ハ荀ヲ" #define CMT_DEFAULT_URL "URL、ウォ、ッサ、ホ・ヌ・ユ・ゥ・・ネハクサホ" #define CMT_DECODE_CTE "ハンツクサ、ヒ Content-Transfer-Encoding 、・ヌ・ウ。シ・ノ、ケ、" #ifdef USE_MOUSE #define CMT_MOUSE "・゙・ヲ・ケ、サネ、ヲ" #define CMT_REVERSE_MOUSE "・゙・ヲ・ケ、ホ・ノ・鬣テ・ーニーコ、オユ、ヒ、ケ、" #endif /* USE_MOUSE */ ! #define CMT_CLEAR_BUF "ノスシィ、オ、、ニ、、、ハ、、・ミ・テ・ユ・。、ホ・皈筵熙ウォハ、ケ、" #define CMT_NOSENDREFERER "Referer: 、チ、鬢ハ、、、隍ヲ、ヒ、ケ、" #define CMT_IGNORE_CASE "・オ。シ・チサ、ヒツ醋クサセョハクサ、ホカ靆フ、、キ、ハ、、" #define CMT_USE_LESSOPEN "LESSOPEN、サネヘム" --- 174,188 ---- #define CMT_RETRY_HTTP "URL、ヒシォニーナェ、ヒ http:// 、ハ荀ヲ" #define CMT_DEFAULT_URL "URL、ウォ、ッサ、ホ・ヌ・ユ・ゥ・・ネハクサホ" #define CMT_DECODE_CTE "ハンツクサ、ヒ Content-Transfer-Encoding 、・ヌ・ウ。シ・ノ、ケ、" + #define CMT_PRESERVE_TIMESTAMP "ハンツクサ、ヒ・ソ・、・爭ケ・ソ・・ラ、ハンサ、ケ、" #ifdef USE_MOUSE #define CMT_MOUSE "・゙・ヲ・ケ、サネ、ヲ" #define CMT_REVERSE_MOUSE "・゙・ヲ・ケ、ホ・ノ・鬣テ・ーニーコ、オユ、ヒ、ケ、" + #define CMT_RELATIVE_WHEEL_SCROLL "・ロ・、。シ・、ヌ、ホ・ケ・ッ・。シ・ツョナル、ホーキ、、" + #define CMT_RELATIVE_WHEEL_SCROLL_RATIO "(A、ホ、゚)イ靂フ、ホイソ%・ケ・ッ・。シ・、ケ、、ォ" + #define CMT_FIXED_WHEEL_SCROLL_COUNT "(B、ホ、゚)・ケ・ッ・。シ・、ケ、ケヤソ" #endif /* USE_MOUSE */ ! #define CMT_CLEAR_BUF "ノスシィ、オ、、ニ、、、ハ、、・ミ・テ・ユ・。、ホ・皈筵熙イハ、ケ、" #define CMT_NOSENDREFERER "Referer: 、チ、鬢ハ、、、隍ヲ、ヒ、ケ、" #define CMT_IGNORE_CASE "・オ。シ・チサ、ヒツ醋クサセョハクサ、ホカ靆フ、、キ、ハ、、" #define CMT_USE_LESSOPEN "LESSOPEN、サネヘム" *************** *** 193,198 **** --- 214,225 ---- #define CMT_KEYMAP_FILE "keymap・ユ・。・、・" + #ifdef USE_SCRIPT + #define CMT_USE_SCRIPT "JavaScript、サネヘム、ケ、" + #define CMT_ENABLE_JS_WINDOWOPEN "window.open() 、ヘュク、ヒ、ケ、" + #define CMT_CONFIRM_JS_WINDOWCLOSE "window.close() 、ヌウホヌァ、ケ、" + #endif /* USE_SCRIPT */ + #else /* LANG != JA */ *************** *** 207,213 **** --- 234,243 ---- #define CMT_FRAME "Render frames automatically" #define CMT_ARGV_IS_URL "Treat argument without scheme as URL" #define CMT_TSELF "Use _self as default target" + #define CMT_OPEN_TAB_BLANK "Open link on new tab if target is _blank or _new" + #define CMT_OPEN_TAB_DL_LIST "Open download list panel on new tab" #define CMT_DISPLINK "Display link URL automatically" + #define CMT_DECODE_URL "Display decoded URL" #define CMT_DISPLINEINFO "Display current line number" #define CMT_DISP_IMAGE "Display inline images" #ifdef USE_IMAGE *************** *** 216,225 **** --- 246,258 ---- #define CMT_EXT_IMAGE_VIEWER "Use external image viewer" #define CMT_IMAGE_SCALE "Scale of image (%)" #define CMT_IMGDISPLAY "External command to display image" + #define CMT_IMAGE_MAP_LIST "Use link list of image map" #endif #define CMT_MULTICOL "Display file names in multi-column format" #define CMT_ALT_ENTITY "Use ASCII equivalents to display entities" + #define CMT_GRAPHIC_CHAR "Use graphic char for border of table and menu" #define CMT_FOLD_TEXTAREA "Fold lines in TEXTAREA" + #define CMT_DISP_INS_DEL "Display DEL, S and STRIKE element" #define CMT_COLOR "Display with color" #define CMT_B_COLOR "Color of normal character" #define CMT_A_COLOR "Color of anchor" *************** *** 231,237 **** --- 264,274 ---- #define CMT_V_COLOR "Color of visited link" #define CMT_BG_COLOR "Color of background" #define CMT_MARK_COLOR "Color of mark" + #define CMT_USE_PROXY "Use proxy" #define CMT_HTTP_PROXY "URL of HTTP proxy host" + #ifdef USE_SSL + #define CMT_HTTPS_PROXY "URL of HTTPS proxy host" + #endif /* USE_SSL */ #ifdef USE_GOPHER #define CMT_GOPHER_PROXY "URL of GOPHER proxy host" #endif /* USE_GOPHER */ *************** *** 239,249 **** --- 276,292 ---- #define CMT_NO_PROXY "Domains to be accessed directly (no proxy)" #define CMT_NOPROXY_NETADDR "Check noproxy by network address" #define CMT_NO_CACHE "Disable cache" + #ifdef USE_NNTP + #define CMT_NNTP_SERVER "News server" + #define CMT_NNTP_MODE "Mode of news server" + #define CMT_MAX_NEWS "Number of news messages" + #endif #define CMT_DNS_ORDER "Order of name resolution" #define CMT_DROOT "Directory corresponding to / (document root)" #define CMT_PDROOT "Directory corresponding to /~user" #define CMT_CGIBIN "Directory corresponding to /cgi-bin" #define CMT_CONFIRM_QQ "Confirm when quitting with q" + #define CMT_CLOSE_TAB_BACK "Close tab if buffer is last when back" #ifdef USE_MARK #define CMT_USE_MARK "Enable mark operations" #endif *************** *** 259,264 **** --- 302,308 ---- #ifdef NEXTPAGE_TOPLINE #define CMT_NEXTPAGE_TOPLINE "Move cursor to top line when moving to next page" #endif + #define CMT_FOLD_LINE "Fold lines of plain text file" #define CMT_SHOW_NUM "Show line numbers" #define CMT_SHOW_SRCH_STR "Show search string" #define CMT_MIMETYPES "List of mime.types files" *************** *** 269,275 **** --- 313,321 ---- #define CMT_EXTBRZ "External Browser" #define CMT_EXTBRZ2 "Second External Browser" #define CMT_EXTBRZ3 "Third External Browser" + #define CMT_DISABLE_SECRET_SECURITY_CHECK "Disable secret file security check" #define CMT_PASSWDFILE "Password file" + #define CMT_PRE_FORM_FILE "File for setting form on loading" #define CMT_FTPPASS "Password for anonymous FTP (your mail address)" #ifdef FTPPASS_HOSTNAMEGEN #define CMT_FTPPASS_HOSTNAMEGEN "Generate domain part of password for FTP" *************** *** 299,307 **** --- 345,357 ---- #define CMT_RETRY_HTTP "Prepend http:// to URL automatically" #define CMT_DEFAULT_URL "Default value for open-URL command" #define CMT_DECODE_CTE "Decode Content-Transfer-Encoding when saving" + #define CMT_PRESERVE_TIMESTAMP "Preserve timestamp when saving" #ifdef USE_MOUSE #define CMT_MOUSE "Enable mouse" #define CMT_REVERSE_MOUSE "Scroll in reverse direction of mouse drag" + #define CMT_RELATIVE_WHEEL_SCROLL "Behavior of wheel scroll speed" + #define CMT_RELATIVE_WHEEL_SCROLL_RATIO "(A only)Scroll by # % of screen" + #define CMT_FIXED_WHEEL_SCROLL_COUNT "(B only)Scroll by # lines" #endif /* USE_MOUSE */ #define CMT_CLEAR_BUF "Free memory of undisplayed buffers" #define CMT_NOSENDREFERER "Suppress `Referer:' header" *************** *** 334,339 **** --- 384,395 ---- #define CMT_KEYMAP_FILE "keymap file" + #ifdef USE_SCRIPT + #define CMT_USE_SCRIPT "Use JavaScript" + #define CMT_ENABLE_JS_WINDOWOPEN "Enable window.open()" + #define CMT_CONFIRM_JS_WINDOWCLOSE "Confirm window.close()" + #endif /* USE_SCRIPT */ + #endif /* LANG != JA */ #define PI_TEXT 0 *************** *** 425,430 **** --- 481,500 ---- #endif {0, NULL, NULL} }; + #ifdef USE_MOUSE + static struct sel_c wheelmode[] = { + #if LANG == JA + {TRUE, "1", "A:イ靂フ・オ・、・コ、ヒネ賽"}, + {FALSE, "0", "B:ート熙ホケヤソ"}, + {0, NULL, NULL} + #else /* LANG != JA */ + {TRUE, "1", "A:relative to screen height"}, + {FALSE, "0", "B:fixed speed"}, + {0, NULL, NULL} + #endif /* LANG != JA */ + }; + #endif /* MOUSE */ + #ifdef INET6 static struct sel_c dnsorders[] = { {N_S(DNS_ORDER_UNSPEC), "unspecified"}, *************** *** 463,470 **** --- 533,545 ---- #endif /* JP_CHARSET */ {"frame", P_CHARINT, PI_ONOFF, (void *)&RenderFrame, CMT_FRAME, NULL}, {"target_self", P_CHARINT, PI_ONOFF, (void *)&TargetSelf, CMT_TSELF, NULL}, + {"open_tab_blank", P_INT, PI_ONOFF, (void *)&open_tab_blank, + CMT_OPEN_TAB_BLANK, NULL}, + {"open_tab_dl_list", P_INT, PI_ONOFF, (void *)&open_tab_dl_list, + CMT_OPEN_TAB_DL_LIST, NULL}, {"display_link", P_INT, PI_ONOFF, (void *)&displayLink, CMT_DISPLINK, NULL}, + {"decode_url", P_INT, PI_ONOFF, (void *)&DecodeURL, CMT_DECODE_URL, NULL}, {"display_lineinfo", P_INT, PI_ONOFF, (void *)&displayLineInfo, CMT_DISPLINEINFO, NULL}, {"ext_dirlist", P_INT, PI_ONOFF, (void *)&UseExternalDirBuffer, *************** *** 480,487 **** --- 555,568 ---- {"multicol", P_INT, PI_ONOFF, (void *)&multicolList, CMT_MULTICOL, NULL}, {"alt_entity", P_CHARINT, PI_ONOFF, (void *)&UseAltEntity, CMT_ALT_ENTITY, NULL}, + #ifndef KANJI_SYMBOLS + {"graphic_char", P_CHARINT, PI_ONOFF, (void *)&UseGraphicChar, + CMT_GRAPHIC_CHAR, NULL}, + #endif {"fold_textarea", P_CHARINT, PI_ONOFF, (void *)&FoldTextarea, CMT_FOLD_TEXTAREA, NULL}, + {"display_ins_del", P_INT, PI_ONOFF, (void *)&displayInsDel, + CMT_DISP_INS_DEL, NULL}, {"ignore_null_img_alt", P_INT, PI_ONOFF, (void *)&ignore_null_img_alt, CMT_IGNORE_NULL_IMG_ALT, NULL}, {"view_unseenobject", P_INT, PI_ONOFF, (void *)&view_unseenobject, *************** *** 499,505 **** --- 580,589 ---- NULL}, {"imgdisplay", P_STRING, PI_TEXT, (void *)&Imgdisplay, CMT_IMGDISPLAY, NULL}, + {"image_map_list", P_INT, PI_ONOFF, (void *)&image_map_list, + CMT_IMAGE_MAP_LIST, NULL}, #endif + {"fold_line", P_INT, PI_ONOFF, (void *)&FoldLine, CMT_FOLD_LINE, NULL}, {"show_lnum", P_INT, PI_ONOFF, (void *)&showLineNum, CMT_SHOW_NUM, NULL}, {"show_srch_str", P_INT, PI_ONOFF, (void *)&show_srch_str, CMT_SHOW_SRCH_STR, NULL}, *************** *** 551,556 **** --- 635,642 ---- #endif /* USE_HISTORY */ {"confirm_qq", P_INT, PI_ONOFF, (void *)&confirm_on_quit, CMT_CONFIRM_QQ, NULL}, + {"close_tab_back", P_INT, PI_ONOFF, (void *)&close_tab_back, + CMT_CLOSE_TAB_BACK, NULL}, #ifdef USE_MARK {"mark", P_INT, PI_ONOFF, (void *)&use_mark, CMT_USE_MARK, NULL}, #endif *************** *** 577,595 **** --- 663,697 ---- {"use_mouse", P_INT, PI_ONOFF, (void *)&use_mouse, CMT_MOUSE, NULL}, {"reverse_mouse", P_INT, PI_ONOFF, (void *)&reverse_mouse, CMT_REVERSE_MOUSE, NULL}, + {"relative_wheel_scroll", P_INT, PI_SEL_C, (void *)&relative_wheel_scroll, + CMT_RELATIVE_WHEEL_SCROLL, wheelmode}, + {"relative_wheel_scroll_ratio", P_INT, PI_TEXT, + (void *)&relative_wheel_scroll_ratio, + CMT_RELATIVE_WHEEL_SCROLL_RATIO, NULL}, + {"fixed_wheel_scroll_count", P_INT, PI_TEXT, + (void *)&fixed_wheel_scroll_count, + CMT_FIXED_WHEEL_SCROLL_COUNT, NULL}, #endif /* USE_MOUSE */ {"clear_buffer", P_INT, PI_ONOFF, (void *)&clear_buffer, CMT_CLEAR_BUF, NULL}, {"decode_cte", P_CHARINT, PI_ONOFF, (void *)&DecodeCTE, CMT_DECODE_CTE, NULL}, + {"preserve_timestamp", P_CHARINT, PI_ONOFF, (void *)&PreserveTimestamp, + CMT_PRESERVE_TIMESTAMP, NULL}, {"keymap_file", P_STRING, PI_TEXT, (void *)&keymap_file, CMT_KEYMAP_FILE, NULL}, {NULL, 0, 0, NULL, NULL, NULL}, }; struct param_ptr params4[] = { + {"use_proxy", P_CHARINT, PI_ONOFF, (void *)&use_proxy, CMT_USE_PROXY, + NULL}, {"http_proxy", P_STRING, PI_TEXT, (void *)&HTTP_proxy, CMT_HTTP_PROXY, NULL}, + #ifdef USE_SSL + {"https_proxy", P_STRING, PI_TEXT, (void *)&HTTPS_proxy, CMT_HTTPS_PROXY, + NULL}, + #endif /* USE_SSL */ #ifdef USE_GOPHER {"gopher_proxy", P_STRING, PI_TEXT, (void *)&GOPHER_proxy, CMT_GOPHER_PROXY, NULL}, *************** *** 672,682 **** --- 774,789 ---- struct param_ptr params9[] = { {"passwd_file", P_STRING, PI_TEXT, (void *)&passwd_file, CMT_PASSWDFILE, NULL}, + {"disable_secret_security_check", P_INT, PI_ONOFF, + (void *)&disable_secret_security_check, CMT_DISABLE_SECRET_SECURITY_CHECK, + NULL}, {"ftppasswd", P_STRING, PI_TEXT, (void *)&ftppasswd, CMT_FTPPASS, NULL}, #ifdef FTPPASS_HOSTNAMEGEN {"ftppass_hostnamegen", P_INT, PI_ONOFF, (void *)&ftppass_hostnamegen, CMT_FTPPASS_HOSTNAMEGEN, NULL}, #endif + {"pre_form_file", P_STRING, PI_TEXT, (void *)&pre_form_file, + CMT_PRE_FORM_FILE, NULL}, {"user_agent", P_STRING, PI_TEXT, (void *)&UserAgent, CMT_USERAGENT, NULL}, {"no_referer", P_INT, PI_ONOFF, (void *)&NoSendReferer, CMT_NOSENDREFERER, NULL}, *************** *** 702,709 **** --- 809,833 ---- {"dns_order", P_INT, PI_SEL_C, (void *)&DNS_order, CMT_DNS_ORDER, dnsorders}, #endif /* INET6 */ + #ifdef USE_NNTP + {"nntpserver", P_STRING, PI_TEXT, (void *)&NNTP_server, CMT_NNTP_SERVER, + NULL}, + {"nntpmode", P_STRING, PI_TEXT, (void *)&NNTP_mode, CMT_NNTP_MODE, NULL}, + {"max_news", P_INT, PI_TEXT, (void *)&MaxNewsMessage, CMT_MAX_NEWS, NULL}, + #endif + {NULL, 0, 0, NULL, NULL, NULL}, + }; + #ifdef USE_SCRIPT + struct param_ptr params10[] = { + {"use_script", P_INT, PI_ONOFF, (void *)&use_script, CMT_USE_SCRIPT, + NULL}, + {"enable_js_windowopen", P_INT, PI_ONOFF, + (void *)&enable_js_windowopen, CMT_ENABLE_JS_WINDOWOPEN, NULL}, + {"confirm_js_windowclose", P_INT, PI_ONOFF, + (void *)&confirm_js_windowclose, CMT_CONFIRM_JS_WINDOWCLOSE, NULL}, {NULL, 0, 0, NULL, NULL, NULL}, }; + #endif /* USE_SCRIPT */ struct param_section sections[] = { #if LANG == JA *************** *** 722,727 **** --- 846,854 ---- #ifdef USE_COOKIE {"・ッ・テ・ュ。シ、ホタ゚ト", params8}, #endif + #ifdef USE_SCRIPT + {"・ケ・ッ・・ラ・ネ、ホタ゚ト", params10}, + #endif #else /* LANG != JA */ {"Display Settings", params1}, #ifdef USE_COLOR *************** *** 738,743 **** --- 865,873 ---- #ifdef USE_COOKIE {"Cookie Settings", params8}, #endif + #ifdef USE_SCRIPT + {"Script Settings", params10}, + #endif #endif /* LANG != JA */ {NULL, NULL} }; *************** *** 750,756 **** return strcmp(a->param->name, b->param->name); } ! void create_option_search_table() { int i, j, k; --- 880,886 ---- return strcmp(a->param->name, b->param->name); } ! static void create_option_search_table() { int i, j, k; *************** *** 910,927 **** { if (value == NULL) return 1; ! switch (tolower(*value)) { case '0': case 'f': /* false */ case 'n': /* no */ case 'u': /* undef */ return 0; case 'o': ! if (tolower(value[1]) == 'f') /* off */ return 0; return 1; /* on */ case 't': ! if (tolower(value[1]) == 'o') /* toggle */ return !old; return 1; /* true */ case '!': --- 1040,1057 ---- { if (value == NULL) return 1; ! switch (TOLOWER(*value)) { case '0': case 'f': /* false */ case 'n': /* no */ case 'u': /* undef */ return 0; case 'o': ! if (TOLOWER(value[1]) == 'f') /* off */ return 0; return 1; /* on */ case 't': ! if (TOLOWER(value[1]) == 'o') /* toggle */ return !old; return 1; /* true */ case '!': *************** *** 938,944 **** { if (value == NULL) return 8; /* terminal */ ! switch (tolower(*value)) { case '0': return 0; /* black */ case '1': --- 1068,1074 ---- { if (value == NULL) return 8; /* terminal */ ! switch (TOLOWER(*value)) { case '0': return 0; /* black */ case '1': *************** *** 1175,1180 **** --- 1305,1314 ---- { if (non_null(HTTP_proxy)) parseURL(HTTP_proxy, &HTTP_proxy_parsed, NULL); + #ifdef USE_SSL + if (non_null(HTTPS_proxy)) + parseURL(HTTPS_proxy, &HTTPS_proxy_parsed, NULL); + #endif /* USE_SSL */ #ifdef USE_GOPHER if (non_null(GOPHER_proxy)) parseURL(GOPHER_proxy, &GOPHER_proxy_parsed, NULL); *************** *** 1220,1225 **** --- 1354,1361 ---- void sync_with_option(void) { + if (PagerMax < LINES) + PagerMax = LINES; WrapSearch = WrapDefault; parse_proxy(); #ifdef USE_COOKIE *************** *** 1240,1245 **** --- 1376,1382 ---- displayImage = FALSE; /* XXX */ #endif loadPasswd(); + loadPreForm(); if (AcceptLang == NULL || *AcceptLang == '\0') { #if LANG == JA *************** *** 1252,1279 **** AcceptEncoding = acceptableEncoding(); if (AcceptMedia == NULL || *AcceptMedia == '\0') AcceptMedia = acceptableMimeTypes(); ! initKeymap(FALSE); } void ! init_rc(char *config_filename) { struct stat st; FILE *f; - char *tmpdir; ! if (((tmpdir = getenv("TMP")) == NULL || *tmpdir == '\0') ! && ((tmpdir = getenv("TEMP")) == NULL || *tmpdir == '\0') ! && ((tmpdir = getenv("TMPDIR")) == NULL || *tmpdir == '\0')) ! tmpdir = "/tmp"; if (stat(rc_dir, &st) < 0) { if (errno == ENOENT) { /* no directory */ if (do_mkdir(rc_dir, 0700) < 0) { fprintf(stderr, "Can't create config directory (%s)!", rc_dir); ! rc_dir = tmpdir; ! rc_dir_is_tmp = TRUE; ! return; } else { stat(rc_dir, &st); --- 1389,1425 ---- AcceptEncoding = acceptableEncoding(); if (AcceptMedia == NULL || *AcceptMedia == '\0') AcceptMedia = acceptableMimeTypes(); ! if (fmInitialized) { ! initKeymap(FALSE); ! #ifdef USE_MOUSE ! initMouseAction(); ! #endif /* MOUSE */ ! #ifdef USE_MENU ! initMenu(); ! #endif /* MENU */ ! } } void ! init_rc(void) { + int i; struct stat st; FILE *f; ! if (rc_dir != NULL) ! goto open_rc; ! ! rc_dir = expandPath(RC_DIR); ! i = strlen(rc_dir); ! if (i > 1 && rc_dir[i - 1] == '/') ! rc_dir[i - 1] = '\0'; if (stat(rc_dir, &st) < 0) { if (errno == ENOENT) { /* no directory */ if (do_mkdir(rc_dir, 0700) < 0) { fprintf(stderr, "Can't create config directory (%s)!", rc_dir); ! goto rc_dir_err; } else { stat(rc_dir, &st); *************** *** 1281,1318 **** } else { fprintf(stderr, "Can't open config directory (%s)!", rc_dir); ! rc_dir = tmpdir; ! rc_dir_is_tmp = TRUE; ! return; } } if (!S_ISDIR(st.st_mode)) { /* not a directory */ fprintf(stderr, "%s is not a directory!", rc_dir); ! rc_dir = tmpdir; ! rc_dir_is_tmp = TRUE; ! return; } /* open config file */ if ((f = fopen(etcFile(W3MCONFIG), "rt")) != NULL) { interpret_rc(f); fclose(f); } - config_file = config_filename; - if (config_file == NULL) - config_file = rcFile(CONFIG_FILE); if ((f = fopen(config_file, "rt")) != NULL) { interpret_rc(f); fclose(f); } ! sync_with_option(); } static char optionpanel_src1[] = ! "Option Setting Panel\ !
    Option Setting Panel
    (w3m version %s)

    \n" "%s\n" "

    "; static Str to_str(struct param_ptr *p) --- 1427,1482 ---- } else { fprintf(stderr, "Can't open config directory (%s)!", rc_dir); ! goto rc_dir_err; } } if (!S_ISDIR(st.st_mode)) { /* not a directory */ fprintf(stderr, "%s is not a directory!", rc_dir); ! goto rc_dir_err; } + if (!(st.st_mode & S_IWUSR)) { + fprintf(stderr, "%s is not writable!", rc_dir); + goto rc_dir_err; + } + no_rc_dir = FALSE; + tmp_dir = rc_dir; + + if (config_file == NULL) + config_file = rcFile(CONFIG_FILE); + + create_option_search_table(); + open_rc: /* open config file */ if ((f = fopen(etcFile(W3MCONFIG), "rt")) != NULL) { interpret_rc(f); fclose(f); } if ((f = fopen(config_file, "rt")) != NULL) { interpret_rc(f); fclose(f); } ! return; ! ! rc_dir_err: ! no_rc_dir = TRUE; ! if (((tmp_dir = getenv("TMPDIR")) == NULL || *tmp_dir == '\0') && ! ((tmp_dir = getenv("TMP")) == NULL || *tmp_dir == '\0') && ! ((tmp_dir = getenv("TEMP")) == NULL || *tmp_dir == '\0')) ! tmp_dir = "/tmp"; } static char optionpanel_src1[] = ! "Option Setting Panel\ !

    Option Setting Panel
    (w3m version %s)

    \ ! \ ! \ ! \ ! \ !

    \ !
    "; static Str to_str(struct param_ptr *p) *************** *** 1349,1355 **** Buffer * load_option_panel(void) { ! Str src = Sprintf(optionpanel_src1, w3m_version, CMT_HELPER); struct param_ptr *p; struct sel_c *s; int x, i; --- 1513,1520 ---- Buffer * load_option_panel(void) { ! Str src = Sprintf(optionpanel_src1, html_quote(w3m_version), ! html_quote(Local_cookie->ptr), CMT_HELPER); struct param_ptr *p; struct sel_c *s; int x, i; *************** *** 1420,1426 **** { FILE *f = NULL; ! if (rc_dir_is_tmp) { disp_message("There's no ~/.w3m directory... config not saved", FALSE); } else { --- 1585,1591 ---- { FILE *f = NULL; ! if (no_rc_dir) { disp_message("There's no ~/.w3m directory... config not saved", FALSE); } else { *************** *** 1450,1489 **** (base[0] == '.' && (base[1] == '/' || (base[1] == '.' && base[2] == '/'))) || (base[0] == '~' && base[1] == '/'))) ! return expandName(base); ! else { ! Str file = Strnew_charp(rc_dir); ! if (Strlastchar(file) != '/') ! Strcat_char(file, '/'); ! Strcat_charp(file, base); ! return expandName(file->ptr); ! } } char * libFile(char *base) { ! Str file = Strnew_charp(w3m_lib_dir()); ! Strcat_char(file, '/'); ! Strcat_charp(file, base); ! return expandName(file->ptr); } char * etcFile(char *base) { ! Str file = Strnew_charp(w3m_etc_dir()); ! Strcat_char(file, '/'); ! Strcat_charp(file, base); ! return expandName(file->ptr); } char * helpFile(char *base) { ! Str file = Strnew_charp(w3m_help_dir()); ! Strcat_char(file, '/'); ! Strcat_charp(file, base); ! return expandName(file->ptr); } --- 1615,1649 ---- (base[0] == '.' && (base[1] == '/' || (base[1] == '.' && base[2] == '/'))) || (base[0] == '~' && base[1] == '/'))) ! /* /file, ./file, ../file, ~/file */ ! return expandPath(base); ! return expandPath(Strnew_m_charp(rc_dir, "/", base, NULL)->ptr); ! } ! char * ! auxbinFile(char *base) ! { ! return expandPath(Strnew_m_charp(w3m_auxbin_dir(), "/", base, NULL)->ptr); } + #if 0 /* not used */ char * libFile(char *base) { ! return expandPath(Strnew_m_charp(w3m_lib_dir(), "/", base, NULL)->ptr); } + #endif char * etcFile(char *base) { ! return expandPath(Strnew_m_charp(w3m_etc_dir(), "/", base, NULL)->ptr); } + #ifndef USE_HELP_CGI char * helpFile(char *base) { ! return expandPath(Strnew_m_charp(w3m_help_dir(), "/", base, NULL)->ptr); } + #endif diff -crN -x CVS w3m-0.3.2.2/regex.c w3m-js-1.743/regex.c *** w3m-0.3.2.2/regex.c 2002-01-22 02:57:28.000000000 +0900 --- w3m-js-1.743/regex.c 2002-12-25 02:26:33.000000000 +0900 *************** *** 1,4 **** ! /* $Id: regex.c,v 1.16 2002/01/21 17:57:28 ukai Exp $ */ /* * regex: Regular expression pattern match library * --- 1,4 ---- ! /* $Id: regex.c,v 1.20 2002/12/24 17:20:48 ukai Exp $ */ /* * regex: Regular expression pattern match library * *************** *** 13,22 **** #include #include #include - #include #include #include "regex.h" #include "config.h" #ifndef NULL #define NULL 0 --- 13,22 ---- #include #include #include #include #include "regex.h" #include "config.h" + #include "myctype.h" #ifndef NULL #define NULL 0 *************** *** 51,59 **** int verbose; #endif /* REGEX_DEBUG */ ! #ifndef IS_ALPHA ! #define IS_ALPHA(x) (!((x)&0x80) && isalpha(x)) #define IS_KANJI1(x) ((x)&0x80) #endif #ifdef JP_CHARSET --- 51,61 ---- int verbose; #endif /* REGEX_DEBUG */ ! #ifndef IS_KANJI1 ! #include #define IS_KANJI1(x) ((x)&0x80) + #define TOLOWER(x) tolower(x) + #define TOUPPER(x) toupper(x) #endif #ifdef JP_CHARSET *************** *** 68,74 **** static int regmatch(regexchar *, char *, char *, int, char **); static int regmatch1(regexchar *, longchar); ! static int matchWhich(longchar *, longchar); /* * regexCompile: compile regular expression --- 70,76 ---- static int regmatch(regexchar *, char *, char *, int, char **); static int regmatch1(regexchar *, longchar); ! static int matchWhich(longchar *, longchar, int); /* * regexCompile: compile regular expression *************** *** 190,195 **** --- 192,199 ---- *(st_ptr++) = '\0'; re->p.pattern = r; RE_SET_MODE(re, m); + if (igncase) + re->mode |= RE_IGNCASE; re++; break; case '|': *************** *** 625,648 **** *re->p.pattern == c); #endif /* REGEX_DEBUG */ if (re->mode & RE_IGNCASE) { ! if (*re->p.pattern < 127 && c < 127 && ! IS_ALPHA(*re->p.pattern) && IS_ALPHA(c)) ! return tolower(*re->p.pattern) == tolower(c); else return *re->p.pattern == c; } else return (*re->p.pattern == c); case RE_WHICH: ! return matchWhich(re->p.pattern, c); case RE_EXCEPT: ! return !matchWhich(re->p.pattern, c); } return 0; } static int ! matchWhich(longchar * pattern, longchar c) { longchar *p = pattern; int ans = 0; --- 629,651 ---- *re->p.pattern == c); #endif /* REGEX_DEBUG */ if (re->mode & RE_IGNCASE) { ! if (*re->p.pattern < 127 && c < 127) ! return TOLOWER(*re->p.pattern) == TOLOWER(c); else return *re->p.pattern == c; } else return (*re->p.pattern == c); case RE_WHICH: ! return matchWhich(re->p.pattern, c, re->mode & RE_IGNCASE); case RE_EXCEPT: ! return !matchWhich(re->p.pattern, c, re->mode & RE_IGNCASE); } return 0; } static int ! matchWhich(longchar * pattern, longchar c, int igncase) { longchar *p = pattern; int ans = 0; *************** *** 657,662 **** --- 660,671 ---- ans = 1; break; } + else if (igncase && c < 127 && + ((*p <= TOLOWER(c) && TOLOWER(c) <= *(p + 2)) || + (*p <= TOUPPER(c) && TOUPPER(c) <= *(p + 2)))) { + ans = 1; + break; + } p += 3; } else { *************** *** 664,669 **** --- 673,683 ---- ans = 1; break; } + else if (igncase && c < 127 && + (*p == TOLOWER(c) || *p == TOUPPER(c))) { + ans = 1; + break; + } p++; } } diff -crN -x CVS w3m-0.3.2.2/script.c w3m-js-1.743/script.c *** w3m-0.3.2.2/script.c 1970-01-01 09:00:00.000000000 +0900 --- w3m-js-1.743/script.c 2003-02-08 02:38:49.000000000 +0900 *************** *** 0 **** --- 1,394 ---- + #include "fm.h" + #ifdef USE_SCRIPT + #ifdef USE_JAVASCRIPT + #include "js_html.h" + + static void + script_buf2js(Buffer *buf, JSInterpPtr interp) + { + Buffer *tb; + /* Str s;*/ + int i, j; + AnchorList *aln, *alh; + Anchor *an, *ah; + FormList *fl; + FormItemList *fi; + + /* s = Strnew();*/ + + js_eval(interp, "window = new Window();"); + js_eval(interp, "document = new Document();"); + js_eval(interp, "navigator = new Navigator();"); + js_eval(interp, "history = new History();"); + if (buf != NULL) { + js_eval(interp, Sprintf("location = new Location(\"%s\");", + parsedURL2Str(&buf->currentURL)->ptr)->ptr); + } else { + js_eval(interp, "location = new Location();"); + } + js_eval(interp, "document.anchors = new Array();"); + js_eval(interp, "document.forms = new Array();"); + + i = 0; + if (CurrentTab != NULL) { + for (tb = Firstbuf; tb != NULL; i++, tb = tb->nextBuffer); + } + js_eval(interp, Sprintf("history.length = %d;", i)->ptr); + + if (buf != NULL) { + char *t, *c; + Str cs; + + js_eval(interp, Sprintf("document.URL = \"%s\";", parsedURL2Str(&buf->currentURL)->ptr)->ptr); + + switch (buf->currentURL.scheme) { + case SCM_HTTP: + case SCM_GOPHER: + case SCM_FTP: + #ifdef USE_SSL + case SCM_HTTPS: + #endif + if (buf->currentURL.host != NULL) + js_eval(interp, Sprintf("document.domain = \"%s\";", buf->currentURL.host)->ptr); + break; + } + js_eval(interp, Sprintf("document.lastModified = \"%s\";", last_modified(buf))->ptr); + c = t = ""; + if (buf->buffername != NULL) + t = buf->buffername; + cs = find_cookie(&buf->currentURL); + if (cs) c = cs->ptr; + + js_eval(interp, Sprintf("document.title = \"%s\";", t)->ptr); + js_eval(interp, Sprintf("document.cookie = \"%s\";", c)->ptr); + + if (buf->name != NULL) { + aln = buf->name; + alh = buf->href; + for (i = 0; i < aln->nanchor; i++) { + char *n, *h; + + an = &aln->anchors[i]; + ah = &alh->anchors[an->hseq]; + + js_eval(interp, Sprintf("document.anchors[%d] = new Anchor();", i)->ptr); + + n = h = ""; + if (an->url != NULL) + n = an->url; + if (ah->url != NULL) + h = ah->url; /* TODO: It shall be Absolute URL. */ + + js_eval(interp, Sprintf("document.anchors[%d].name = \"%s\";", i, n)->ptr); + js_eval(interp, Sprintf("document.anchors[%d].href = \"%s\";", i, h)->ptr); + if (an->url != NULL) { + js_eval(interp, Sprintf("document.%s = document.anchors[%d];", n, i)->ptr); + /* js_eval(interp, Sprintf("document.anchor[\"%s\"] = document.anchors[%d];", n, i)->ptr);*/ + } + } + } + if (buf->formlist != NULL) { + for (i = 0, fl = buf->formlist; fl != NULL; i++, fl = fl->next) { + char *m, *a, *e, *n, *t; + + js_eval(interp, Sprintf("document.forms[%d] = new Form();", i)->ptr); + m = "get"; + if (fl->method == FORM_METHOD_POST) { + m = "post"; + } + a = e = n = t = ""; + if (fl->enctype == FORM_ENCTYPE_MULTIPART) { + e = "multipart/form-data"; + } + if (fl->action->length > 0) + a = fl->action->ptr; + if (fl->name != NULL) + n = fl->name; + if (fl->target != NULL) + t = fl->target; + + js_eval(interp, Sprintf("document.forms[%d].method = \"%s\";", i, m)->ptr); + js_eval(interp, Sprintf("document.forms[%d].action = \"%s\";", i, a)->ptr); + js_eval(interp, Sprintf("document.forms[%d].encoding = \"%s\";", i, e)->ptr); + js_eval(interp, Sprintf("document.forms[%d].name = \"%s\";", i, n)->ptr); + if (fl->name != NULL) { + js_eval(interp, Sprintf("document.%s = document.forms[%d];", n, i)->ptr); + /* js_eval(interp, Sprintf("document.forms[\"%s\"] = document.forms[%d];", n, i)->ptr);*/ + } + js_eval(interp, Sprintf("document.forms[%d].target = \"%s\";", i, t)->ptr); + js_eval(interp, Sprintf("document.forms[%d].elements = new Array();", i, fl->nitems)->ptr); + + for (j = 0, fi = fl->item; fi != NULL; j++, fi = fi->next) { + char *n, *t, *v; + + js_eval(interp, Sprintf("document.forms[%d].elements[%d] = new FormItem();", i, j)->ptr); + + n = v = ""; + if (fi->name->length > 0) + n = fi->name->ptr; + + switch (fi->type) { /* TODO: ・ソ・、・ラヒ隍ホトオチケ猯ワ、簑゚ト遙」 */ + case FORM_INPUT_TEXT: + t = "text"; + if (fi->init_value->length > 0) + js_eval(interp, Sprintf("document.forms[%d].elements[%d].defaultValue = \"%s\";", i, j, fi->init_value->ptr)->ptr); + break; + case FORM_INPUT_PASSWORD: + t = "password"; + if (fi->init_value->length > 0) + js_eval(interp, Sprintf("document.forms[%d].elements[%d].defaultValue = \"%s\";", i, j, fi->init_value->ptr)->ptr); + break; + case FORM_INPUT_CHECKBOX: + t = "checkbox"; + if (fi->init_checked) + js_eval(interp, Sprintf("document.forms[%d].elements[%d].defaultChecked = true;", i, j)->ptr); + else + js_eval(interp, Sprintf("document.forms[%d].elements[%d].defaultChecked = false;", i, j)->ptr); + if (fi->checked) + js_eval(interp, Sprintf("document.forms[%d].elements[%d].checked = true;", i, j)->ptr); + else + js_eval(interp, Sprintf("document.forms[%d].elements[%d].checked = false;", i, j)->ptr); + break; + case FORM_INPUT_RADIO: + t = "radio"; + if (fi->init_checked) + js_eval(interp, Sprintf("document.forms[%d].elements[%d].defaultChecked = true;", i, j)->ptr); + else + js_eval(interp, Sprintf("document.forms[%d].elements[%d].defaultChecked = false;", i, j)->ptr); + if (fi->checked) + js_eval(interp, Sprintf("document.forms[%d].elements[%d].checked = true;", i, j)->ptr); + else + js_eval(interp, Sprintf("document.forms[%d].elements[%d].checked = false;", i, j)->ptr); + break; + case FORM_INPUT_SUBMIT: + t = "submit"; break; + case FORM_INPUT_RESET: + t = "reset"; break; + case FORM_INPUT_HIDDEN: + t = "hidden"; break; + case FORM_INPUT_IMAGE: + t = "image"; break; + case FORM_SELECT: + t = "select"; + /* TODO: option タ゚ト */ + js_eval(interp, Sprintf("document.forms[%d].elements[%d].selectedIndex = %d;", i, j, fi->selected)->ptr); + break; + case FORM_TEXTAREA: + t = "textarea"; + if (fi->init_value->length > 0) + js_eval(interp, Sprintf("document.forms[%d].elements[%d].defaultValue = \"%s\";", i, j, fi->init_value->ptr)->ptr); + break; + case FORM_INPUT_BUTTON: + t = "button"; break; + case FORM_INPUT_FILE: + t = "file"; + if (fi->init_value->length > 0) /* TODO: Read Only */ + js_eval(interp, Sprintf("document.forms[%d].elements[%d].defaultValue = \"%s\";", i, j, fi->init_value->ptr)->ptr); + break; + default: + t = ""; break; + } + + if (fi->value->length > 0) + v = fi->value->ptr; + + js_eval(interp, Sprintf("document.forms[%d].elements[%d].name = \"%s\";", i, j, n)->ptr); + js_eval(interp, Sprintf("document.forms[%d].elements[%d].type = \"%s\";", i, j, t)->ptr); + js_eval(interp, Sprintf("document.forms[%d].elements[%d].value = \"%s\";", i, j, v)->ptr); + if (fi->name->length > 0) + js_eval(interp, Sprintf("document.forms[%d].%s = document.forms[%d].elements[%d];", i, n, i, j)->ptr); + } + } + } + } + + /* js_eval(interp, s->ptr);*/ + } + + static void + script_chBuf(int pos) + { + int i; + Buffer *buf; + + if (pos > 0) { + for (i = 0; i < pos; i++) { + buf = prevBuffer(Firstbuf, Currentbuf); + if (!buf) { + if (i == 0) + return; + break; + } + Currentbuf = buf; + } + } else { + for (i = 0; i < -pos; i++) { + buf = Currentbuf->nextBuffer; + if (!buf) { + if (i == 0) + return; + break; + } + Currentbuf = buf; + } + } + displayBuffer(Currentbuf, B_FORCE_REDRAW); + } + + static Str + script_js2buf(Buffer *buf, JSInterpPtr interp) + { + JSType value; + DocumentCtx *dictx = NULL; + HistoryCtx *hictx = NULL; + LocationCtx *lictx = NULL; + WindowCtx *wictx = NULL; + + js_eval(interp, "window;"); + js_result(interp, &value); + if (js_isa(interp, &value, js_lookup_class(interp, "Window"), + (void **)&wictx) && wictx) { + if (wictx->win && wictx->win->nitem) { + jse_windowopen_t *w; + while ((w = popValue(wictx->win)) != NULL) { + if (enable_js_windowopen) { + jWindowOpen(buf, w->url, w->name); + } + } + } + if (wictx->close) { + if (CurrentTab != NULL && Currentbuf != NULL) { + char *ans = "y"; + if (buf && confirm_js_windowclose) { + ans = inputChar("window.close() ? (y/n)"); + } + if (ans && tolower(*ans) == 'y') { + closeT(); + return NULL; + } + } + wictx->close = FALSE; + } + } + + if (CurrentTab != NULL && Currentbuf != NULL) { + js_eval(interp, "history;"); + js_result(interp, &value); + if (js_isa(interp, &value, js_lookup_class(interp, "History"), + (void **)&hictx) && hictx && hictx->pos != 0) { + script_chBuf(hictx->pos); + hictx->pos = 0; + return NULL; + } + } + + js_eval(interp, "document.location;"); + js_result(interp, &value); + if (buf && value.type == JS_TYPE_STRING && value.u.s->len) + buf->location = allocStr(value.u.s->data, value.u.s->len); + + js_eval(interp, "location;"); + js_result(interp, &value); + if (js_isa(interp, &value, js_lookup_class(interp, "Location"), + (void **)&lictx) && lictx) { + if (buf && lictx->url && lictx->refresh) { + if (lictx->refresh & JS_LOC_REFRESH) { + buf->location = allocStr(lictx->url->ptr, lictx->url->length); + } else if (lictx->refresh & JS_LOC_HASH) { + Anchor *a; + #ifdef JP_CHARSET + a = searchURLLabel(buf, + conv(lictx->pu.label, buf->document_code, + InnerCode)->ptr); + #else /* not JP_CHARSET */ + a = searchURLLabel(buf, lictx->pu.label); + #endif /* not JP_CHARSET */ + if (a != NULL) { + gotoLine(buf, a->start.line); + #ifdef LABEL_TOPLINE + if (label_topline) + buf->topLine = lineSkip(buf, buf->topLine, + buf->currentLine->linenumber + - buf->topLine->linenumber, + FALSE); + #endif + buf->pos = a->start.pos; + arrangeCursor(buf); + } + } + lictx->refresh = 0; + } + } + + js_eval(interp, "document;"); + js_result(interp, &value); + if (js_isa(interp, &value, js_lookup_class(interp, "Document"), + (void **)&dictx) && dictx) + return dictx->write; + return NULL; + } + + static Str + script_js_eval(Buffer *buf, char *script) + { + JSInterpPtr interp; + + if (buf && buf->script_interp) { + interp = (JSInterpPtr)buf->script_interp; + } else { + interp = js_html_init(); + if (buf) + buf->script_interp = (void *)interp; + } + script_buf2js(buf, interp); + js_eval(interp, script); + return script_js2buf(buf, interp); + } + + static void + script_js_close(Buffer *buf) + { + if (buf && buf->script_interp) { + js_destroy_interp((JSInterpPtr)buf->script_interp); + buf->script_interp = NULL; + } + } + #endif + + Str + script_eval(Buffer *buf, char *lang, char *script) + { + if (buf && buf->location) + buf->location = NULL; + if (! lang || ! script) + return NULL; + if (buf) { + if (buf->script_lang) { + if (strcasecmp(lang, buf->script_lang)) + return NULL; + } else + buf->script_lang = lang; + } + #ifdef USE_JAVASCRIPT + if (! strcasecmp(lang, "javascript") || + ! strcasecmp(lang, "jscript")) + return script_js_eval(buf, script); + else + #endif + return NULL; + } + + void + script_close(Buffer *buf) + { + if (! buf || ! buf->script_lang) + return; + #ifdef USE_JAVASCRIPT + if (! strcasecmp(buf->script_lang, "javascript") || + ! strcasecmp(buf->script_lang, "jscript")) + script_js_close(buf); + #endif + buf->script_interp = NULL; + buf->script_lang = NULL; + } + #endif diff -crN -x CVS w3m-0.3.2.2/scripts/.cvsignore w3m-js-1.743/scripts/.cvsignore *** w3m-0.3.2.2/scripts/.cvsignore 2002-04-27 01:00:58.000000000 +0900 --- w3m-js-1.743/scripts/.cvsignore 2002-11-19 21:02:14.000000000 +0900 *************** *** 5,9 **** w3mhelp-funcdesc.ja.pl w3mhelp-funcname.pl w3mhelp-funcdesc-stamp - xface2xbm xface2xpm --- 5,8 ---- diff -crN -x CVS w3m-0.3.2.2/scripts/Makefile w3m-js-1.743/scripts/Makefile *** w3m-0.3.2.2/scripts/Makefile 2002-04-09 23:45:58.000000000 +0900 --- w3m-js-1.743/scripts/Makefile 2002-11-12 22:18:56.000000000 +0900 *************** *** 2,13 **** prefix = /usr/local DESTDIR = BIN_DIR = $(prefix)/bin ! LIB_DIR = $(prefix)/lib/w3m ! HELP_DIR = $(prefix)/lib/w3m RC_DIR = ~/.w3m ! LIB_TARGETS = dirlist.cgi w3mhelp.cgi w3mmail.cgi xface2xpm ! HELP_LIBS = w3mhelp-funcname.pl w3mhelp-funcdesc.pl MKDIR = mkdir -p INSTALL = install -c --- 2,15 ---- prefix = /usr/local DESTDIR = BIN_DIR = $(prefix)/bin ! AUXBIN_DIR = $(prefix)/lib/w3m ! LIB_DIR = $(prefix)/lib/w3m/cgi-bin ! HELP_DIR = $(prefix)/share/w3m RC_DIR = ~/.w3m ! AUXBIN_TARGETS = xface2xpm ! LIB_TARGETS = dirlist.cgi w3mhelp.cgi w3mmail.cgi ! HELP_TARGETS = w3mhelp-funcname.pl w3mhelp-funcdesc-stamp MKDIR = mkdir -p INSTALL = install -c *************** *** 20,26 **** .SUFFIXES: .in ! all: $(LIB_TARGETS) $(HELP_LIBS) .in: @echo "generating $@..." --- 22,28 ---- .SUFFIXES: .in ! all: $(LIB_TARGETS) $(AUXBIN_TARGETS) $(HELP_TARGETS) .in: @echo "generating $@..." *************** *** 42,49 **** @cat w3mhelp-funcname.pl.in >> w3mhelp-funcname.pl @echo "done" ! w3mhelp-funcdesc.pl: w3mhelp-funcdesc-stamp ! w3mhelp-funcdesc-stamp: @echo "generating w3mhelp-funcdesc*.pl..." @for dirlang in $(DOCDIRS); do \ dir=`expr "$$dirlang" : "\(.*\):.*"`; \ --- 44,50 ---- @cat w3mhelp-funcname.pl.in >> w3mhelp-funcname.pl @echo "done" ! w3mhelp-funcdesc-stamp: ../doc/README.func ../doc-jp/README.func w3mhelp-funcdesc.en.pl.in w3mhelp-funcdesc.ja.pl.in @echo "generating w3mhelp-funcdesc*.pl..." @for dirlang in $(DOCDIRS); do \ dir=`expr "$$dirlang" : "\(.*\):.*"`; \ *************** *** 54,64 **** cat w3mhelp-funcdesc.$$lang.pl.in >> w3mhelp-funcdesc.$$lang.pl; \ done @echo done ! touch w3mhelp-funcdesc-stamp ! install: $(LIB_TARGETS) $(HELP_LIBS) -$(MKDIR) $(DESTDIR)$(LIB_DIR) -$(MKDIR) $(DESTDIR)$(HELP_DIR) for file in $(LIB_TARGETS); \ do \ $(INSTALL_SCRIPT) $$file $(DESTDIR)$(LIB_DIR); \ --- 55,70 ---- cat w3mhelp-funcdesc.$$lang.pl.in >> w3mhelp-funcdesc.$$lang.pl; \ done @echo done ! @touch w3mhelp-funcdesc-stamp ! install: $(LIB_TARGETS) $(HELP_TARGETS) ! -$(MKDIR) $(DESTDIR)$(AUXBIN_DIR) -$(MKDIR) $(DESTDIR)$(LIB_DIR) -$(MKDIR) $(DESTDIR)$(HELP_DIR) + for file in $(AUXBIN_TARGETS); \ + do \ + $(INSTALL_SCRIPT) $$file $(DESTDIR)$(AUXBIN_DIR); \ + done for file in $(LIB_TARGETS); \ do \ $(INSTALL_SCRIPT) $$file $(DESTDIR)$(LIB_DIR); \ *************** *** 69,74 **** --- 75,84 ---- done uninstall: + -for file in $(AUXBIN_TARGETS); \ + do \ + rm -f $(AUXBIN_DIR)/$$file; \ + done -for file in $(LIB_TARGETS); \ do \ rm -f $(LIB_DIR)/$$file; \ *************** *** 79,82 **** done clean: ! -rm -f $(LIB_TARGETS) w3mhelp-*.pl *-stamp --- 89,92 ---- done clean: ! -rm -f $(LIB_TARGETS) $(AUXBIN_TARGETS) $(HELP_TARGETS) w3mhelp-*.pl diff -crN -x CVS w3m-0.3.2.2/scripts/dirlist.cgi.in w3m-js-1.743/scripts/dirlist.cgi.in *** w3m-0.3.2.2/scripts/dirlist.cgi.in 2001-12-22 05:30:54.000000000 +0900 --- w3m-js-1.743/scripts/dirlist.cgi.in 2003-02-08 02:30:24.000000000 +0900 *************** *** 30,65 **** @OPT = &init_option($CONFIG); $query = $ENV{'QUERY_STRING'}; $cmd = ''; ! $cgi = 0; ! if ($query eq '') { ! $_ = `pwd`; # insecure? ! chop; ! s/\r$//; ! $dir = $_; ! $cgi = 0; ! } elsif ($query =~ /^(opt\d+|dir|cmd)=/) { ! foreach(split(/\&/, $query)) { if (s/^dir=//) { $dir = &form_decode($_); } elsif (s/^opt(\d+)=//) { $OPT[$1] = $_; } elsif (s/^cmd=//) { $cmd = $_; } } - $cgi = 1; - } else { - $dir = $query; - if (($dir !~ m@^/@) && - ($WIN32 && $dir !~ /^[a-z]:/i)) { - $_ = `pwd`; # insecure? - chop; - s/\r$//; - $dir = "$_/$dir"; - } - $cgi = -1; } if ($dir !~ m@/$@) { $dir .= '/'; } --- 30,74 ---- @OPT = &init_option($CONFIG); $query = $ENV{'QUERY_STRING'}; + $dir = ''; $cmd = ''; ! $cookie = ''; ! $local_cookie = ''; ! foreach(split(/\&/, $query)) { ! if (s/^dir=//) { ! $dir = &form_decode($_); ! } ! } ! $body = undef; ! if ($ENV{'REQUEST_METHOD'} eq 'POST') { ! sysread(STDIN, $body, $ENV{'CONTENT_LENGTH'}); ! foreach(split(/\&/, $body)) { if (s/^dir=//) { $dir = &form_decode($_); } elsif (s/^opt(\d+)=//) { $OPT[$1] = $_; } elsif (s/^cmd=//) { $cmd = $_; + } elsif (s/^cookie=//) { + $cookie = &form_decode($_); } } } + $cookie_file = $ENV{'LOCAL_COOKIE_FILE'}; + if (-f $cookie_file) { + open(F, "< $cookie_file"); + $local_cookie = ; + close(F); + } + if ($local_cookie eq '' || (defined($body) && $cookie ne $local_cookie)) { + print < 0) && print <

    Directory list of $qdir

    EOF ! &print_form($edir, @OPT); print < EOF --- 121,127 ----

    Directory list of $qdir

    EOF ! &print_form($qdir, @OPT); print < EOF *************** *** 273,281 **** } closedir(DIR); if ($SORT eq $SORT_SIZE) { ! @list = sort { $sizes{$b} <=> $sizes{$a} || $a <=> $b } @list; } elsif ($SORT eq $SORT_TIME) { ! @list = sort { $ctimes{$b} <=> $ctimes{$a} || $a <=> $b } @list; } else { @list = sort @list; } --- 277,285 ---- } closedir(DIR); if ($SORT eq $SORT_SIZE) { ! @list = sort { $sizes{$b} <=> $sizes{$a} || $a cmp $b } @list; } elsif ($SORT eq $SORT_TIME) { ! @list = sort { $ctimes{$b} <=> $ctimes{$a} || $a cmp $b } @list; } else { @list = sort @list; } *************** *** 391,399 **** local($_, @vs, @os, $v, $o); print <
    ! EOF foreach(0 .. 2) { --- 395,403 ---- local($_, @vs, @os, $v, $o); print <
    !
    EOF foreach(0 .. 2) { *************** *** 420,425 **** --- 424,430 ----
    + EOF } diff -crN -x CVS w3m-0.3.2.2/scripts/multipart/Makefile w3m-js-1.743/scripts/multipart/Makefile *** w3m-0.3.2.2/scripts/multipart/Makefile 2001-12-05 01:17:07.000000000 +0900 --- w3m-js-1.743/scripts/multipart/Makefile 2002-11-12 02:28:38.000000000 +0900 *************** *** 1,7 **** prefix = /usr/local BIN_DIR = $(prefix)/bin ! LIB_DIR = $(prefix)/lib/w3m DESTDIR = distdir = ./distfiles --- 1,7 ---- prefix = /usr/local BIN_DIR = $(prefix)/bin ! LIB_DIR = $(prefix)/lib/w3m/cgi-bin DESTDIR = distdir = ./distfiles diff -crN -x CVS w3m-0.3.2.2/scripts/multipart/multipart.cgi.in w3m-js-1.743/scripts/multipart/multipart.cgi.in *** w3m-0.3.2.2/scripts/multipart/multipart.cgi.in 2002-07-18 22:12:07.000000000 +0900 --- w3m-js-1.743/scripts/multipart/multipart.cgi.in 2003-01-17 23:37:58.000000000 +0900 *************** *** 34,41 **** $boundary = $ARGV[1]; } } ! ! open(F, "< $file"); $end = 0; $mbody = ''; if (defined($boundary)) { --- 34,41 ---- $boundary = $ARGV[1]; } } ! (-f $file) || exit(1); ! open(F, "< $file") || exit(1); $end = 0; $mbody = ''; if (defined($boundary)) { *************** *** 185,203 **** s/\>/\>/g; print "
    \n";
      		print $_;
    ! 		print "\n
    \n"; if ($type =~ /name=\"?([^\"]+)\"?/ || $dispos =~ /filename=\"?([^\"]+)\"?/) { $name = $1; } else { $name = "Content"; } ! print "
    \n"; ! print "\n"; ! print "\n"; ! print "\n"; if ($image) { ! print "\n"; } else { print "/\>/g; print "
    \n";
      		print $_;
    ! 		print "
    \n"; if ($type =~ /name=\"?([^\"]+)\"?/ || $dispos =~ /filename=\"?([^\"]+)\"?/) { $name = $1; } else { $name = "Content"; } ! print "\n"; if ($image) { ! print "\n"; } else { print " --- 164,170 ---- split(" ", "lineedit_forward lineedit_back lineedit_backspace lineedit_delete lineedit_kill_after lineedit_kill_before lineedit_top lineedit_bottom lineedit_prev lineedit_next ! lineedit_editor lineedit_complete lineedit_accept")); print < *************** *** 172,184 **** local($func) = @_; while () { ! next if /^#/; ! next if /^\s*$/; ! ($keymap, $key, $fname, $data) = split; ! next if $data; ! next unless $keymap =~ /keymap/; $fname =~ tr/a-z/A-Z/; ! next unless (defined($funcdesc{$fname})); $key = &norm_key($key); $keyfunc{$key} = $fname; } --- 179,192 ---- local($func) = @_; while () { ! /^#/ && next; ! s/^\s*keymap\s+// || next; ! s/^(\"(\\\"|[^\"])+\"|\'(\\\'|[^\'])+\'|\S+)\s+(\S+)\s*// || next; ! ($key, $fname) = ($1, $4); ! ($data = $_) && next; $fname =~ tr/a-z/A-Z/; ! defined($funcdesc{$fname}) || next; ! $key =~ s/^["'](.*)["']$/$1/; $key = &norm_key($key); $keyfunc{$key} = $fname; } *************** *** 187,206 **** sub norm_key { local($_) = @_; s/\\(.)/$1/g; ! s/^\^(.)/C-$1/; ! s/^(C-\[|M-)/ESC-/; if (/^ESC-\[/) { /^ESC-\[A$/ && return "UP"; /^ESC-\[B$/ && return "DOWN"; /^ESC-\[C$/ && return "RIGHT"; /^ESC-\[D$/ && return "LEFT"; - s/^ESC-/\^\[/; - return $_; } ! s/^ESC-\^(.)/ESC-C-$1/; ! s/^(ESC-)?C-[iI]/${1}TAB/; ! s/^(ESC-)?C-\?/${1}DEL/; return $_; } --- 195,214 ---- sub norm_key { local($_) = @_; + s/(ESC|SPC|TAB|DEL|UP|DOWN|RIGHT|LEFT)/\U$1/i; s/\\(.)/$1/g; ! s/(^|\s+|-)\^(.)/${1}C-$2/g; ! s/(^|\s+|-)(C-\[|M-)/${1}ESC-/g; if (/^ESC-\[/) { /^ESC-\[A$/ && return "UP"; /^ESC-\[B$/ && return "DOWN"; /^ESC-\[C$/ && return "RIGHT"; /^ESC-\[D$/ && return "LEFT"; } ! s/(^|\s+|-)ESC-\[/$1\^\[\[/g; ! s/(^|\s+|-)ESC-\^(.)/${1}ESC-C-$2/g; ! s/(^|\s+|-)(ESC-)?C-[iI]/$1${2}TAB/g; ! s/(^|\s+|-)(ESC-)?C-\?/$1${2}DEL/g; return $_; } *************** *** 225,231 **** $keys =~ s/[<>&]/$htmlesc{$&}/ge; $desc =~ s/[<>&]/$htmlesc{$&}/ge; print <$keys$desc PAGE $attr = ""; } --- 233,239 ---- $keys =~ s/[<>&]/$htmlesc{$&}/ge; $desc =~ s/[<>&]/$htmlesc{$&}/ge; print <$keys$desc PAGE $attr = ""; } diff -crN -x CVS w3m-0.3.2.2/scripts/w3mmail.cgi.in w3m-js-1.743/scripts/w3mmail.cgi.in *** w3m-0.3.2.2/scripts/w3mmail.cgi.in 2002-01-30 13:27:32.000000000 +0900 --- w3m-js-1.743/scripts/w3mmail.cgi.in 2003-01-17 23:37:53.000000000 +0900 *************** *** 1,15 **** #!@PERL@ ! $rcsid = q$Id: w3mmail.cgi.in,v 1.10 2002/01/30 04:27:32 ukai Exp $; ($id = $rcsid) =~ s/^.*,v ([\d\.]*).*/$1/; ($prog=$0) =~ s/.*\///; $query = $ENV{'QUERY_STRING'}; ! $local_cookie = $ENV{'LOCAL_COOKIE'}; $SENDMAIL = '/usr/lib/sendmail'; $SENDMAIL = '/usr/sbin/sendmail' if -x '/usr/sbin/sendmail'; $SENDMAIL_OPT = '-oi -t'; if ($query =~ s/^\w+://) { $url = $query; $qurl = &html_quote($url); --- 1,21 ---- #!@PERL@ ! $rcsid = q$Id: w3mmail.cgi.in,v 1.12 2003/01/15 17:13:22 ukai Exp $; ($id = $rcsid) =~ s/^.*,v ([\d\.]*).*/$1/; ($prog=$0) =~ s/.*\///; $query = $ENV{'QUERY_STRING'}; ! $cookie_file = $ENV{'LOCAL_COOKIE_FILE'}; ! $local_cookie = ''; $SENDMAIL = '/usr/lib/sendmail'; $SENDMAIL = '/usr/sbin/sendmail' if -x '/usr/sbin/sendmail'; $SENDMAIL_OPT = '-oi -t'; + if (-f $cookie_file) { + open(F, "< $cookie_file"); + $local_cookie = ; + close(F); + } if ($query =~ s/^\w+://) { $url = $query; $qurl = &html_quote($url); *************** *** 43,63 **** print "\r\n"; print "W3M Mailer: $qurl\n"; print "

    W3M Mailer: $qurl

    \n"; ! print "\n"; ! print "\n"; print "\n"; ! if ($opt{'from'}) { ! $v = &lang_html_quote($opt{'from'}); ! print "
    From:$v\n"; ! print "\n"; ! delete $opt{'from'}; ! } ! foreach $h ('to', 'cc', 'bcc', 'subject') { $v = &lang_html_quote($opt{$h}); print "
    \u$h:\n"; delete $opt{$h}; } if ($boundary) { print "
    Content-Type:multipart/form-data; boundary=\"$boundary\"\n"; print "\n"; } --- 49,65 ---- print "\r\n"; print "W3M Mailer: $qurl\n"; print "

    W3M Mailer: $qurl

    \n"; ! print "\n"; ! $local_cookie = &html_quote($local_cookie); ! print "\n"; print "\n"; ! foreach $h ('from', 'to', 'cc', 'bcc', 'subject') { $v = &lang_html_quote($opt{$h}); print "
    \u$h:\n"; delete $opt{$h}; } if ($boundary) { + $boundary = &html_quote($boundary); print "
    Content-Type:multipart/form-data; boundary=\"$boundary\"\n"; print "\n"; } *************** *** 104,111 **** print "W3M Mailer\n"; print "\n"; print "

    W3M Mailer: preview

    \n"; ! print "\n"; ! print "\n"; print "
    \n"; print "
    \n";
      	foreach $h (keys %opt) {
    --- 106,114 ----
      	print "W3M Mailer\n";
      	print "\n";
      	print "

    W3M Mailer: preview

    \n"; ! print "\n"; ! $local_cookie = &html_quote($local_cookie); ! print "\n"; print "
    \n"; print "
    \n";
      	foreach $h (keys %opt) {
    ***************
    *** 118,130 ****
      	($cs,$cte,$body) = &lang_body(&lang_html_quote($body), 0);
      	print "Mime-Version: 1.0\n";
      	if ($boundary) {
      	    print "Content-Type: multipart/form-data;\n";
      	    print "    boundary=\"$boundary\"\n";
      	} else {
      	    print "Content-Type: text/plain; charset=$cs\n";
      	}
      #	print "Content-Transfer-Encoding: $cte\n";
    ! 	print "User-Agent: $ENV{'SERVER_SOFTWARE'} $prog/$id\n";
      	print "\n";
      	print $body;
      	print "\n" if ($body !~ /\n$/);
    --- 121,135 ----
      	($cs,$cte,$body) = &lang_body(&lang_html_quote($body), 0);
      	print "Mime-Version: 1.0\n";
      	if ($boundary) {
    + 	    $boundary = &html_quote($boundary);
      	    print "Content-Type: multipart/form-data;\n";
      	    print "    boundary=\"$boundary\"\n";
      	} else {
      	    print "Content-Type: text/plain; charset=$cs\n";
      	}
      #	print "Content-Transfer-Encoding: $cte\n";
    ! 	print "User-Agent: ", &html_quote("$ENV{'SERVER_SOFTWARE'} $prog/$id"),
    ! 		"\n";
      	print "\n";
      	print $body;
      	print "\n" if ($body !~ /\n$/);
    ***************
    *** 132,143 ****
      	print "\n";
      	print "
    \n"; print "\n"; ! if ($opt{'from'}) { ! print "
    From:$v{'from'}\n"; ! print "\n"; ! delete $opt{'from'}; ! } ! foreach $h ('to', 'cc', 'bcc', 'subject') { print "
    \u$h:\n"; delete $opt{$h}; } --- 137,143 ---- print "\n"; print "
    \n"; print "\n"; ! foreach $h ('from', 'to', 'cc', 'bcc', 'subject') { print "
    \u$h:\n"; delete $opt{$h}; } *************** *** 148,157 **** foreach $h (keys %opt) { $qh = &html_quote($h); print "
    \u$qh:$v{$h}\n"; ! print "\n"; } print "
    \n"; ! print "