2001-11-21 Akinori Ito <aito@fw.ipsj.or.jp>
* Homepage URLs and author's mail addresses in the documents are changed.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2001-11-21 Akinori Ito <aito@fw.ipsj.or.jp>
|
||||
|
||||
* Homepage URLs and author's mail addresses in the documents
|
||||
are changed.
|
||||
|
||||
2001-11-21 Fumitoshi UKAI <ukai@debian.or.jp>
|
||||
|
||||
* [w3m-dev 02459]
|
||||
|
||||
+10
-10
@@ -6,7 +6,7 @@
|
||||
<h1>w3mに関して良く聞かれる(であろう)質問とその答え</h1>
|
||||
<div align=right>
|
||||
伊藤 彰則<br>
|
||||
aito@ei5sun.yz.yamagata-u.ac.jp
|
||||
aito@fw.ipsj.or.jp
|
||||
</div>
|
||||
<a name="general">
|
||||
<center>
|
||||
@@ -41,28 +41,28 @@ version 990303
|
||||
<dd><a href="http://sourceware.cygnus.com/cygwin/">Cygwin32</a>を使えば動きます.
|
||||
<p>
|
||||
<dt>w3mに関する情報はどこから手に入るの?
|
||||
<dd><a href="http://ei5nazha.yz.yamagata-u.ac.jp/~aito/w3m/">
|
||||
http://ei5nazha.yz.yamagata-u.ac.jp/~aito/w3m/</a>に w3m のページ
|
||||
<dd><a href="http://w3m.sourceforge.net/index.ja.html">
|
||||
http://w3m.sourceforge.net/</a>に w3m のページ
|
||||
があります.
|
||||
<p>
|
||||
<dt>最新版はどこから手に入るの?
|
||||
<dd><a href="ftp://ei5nazha.yz.yamagata-u.ac.jp/w3m/">
|
||||
ftp://ei5nazha.yz.yamagata-u.ac.jp/w3m/</a>から手に入ります.
|
||||
<dd><a href="http://prdownloads.sourceforge.net/w3m/">
|
||||
http://prdownloads.sourceforge.net/w3m/</a>から手に入ります.
|
||||
<p>
|
||||
<dt>w3m に関するMLはありませんか?
|
||||
<dd>
|
||||
開発者向けML(w3m-dev(日本語)とw3m-dev-en(英語))があります。詳しくは
|
||||
<a href="http://ei5nazha.yz.yamagata-u.ac.jp/~aito/w3m/">w3m のページ</a>
|
||||
<a href="http://w3m.sourceforge.net/">w3m のページ</a>
|
||||
をご覧ください。開発関連以外で
|
||||
何か言いたいことがある場合には,作者に<a href="mailto:aito@ei5sun.yz.yamagata-u.ac.jp">
|
||||
直接メール</a>するか,あるいは<a href="http://ei5nazha.yz.yamagata-u.ac.jp/BBS/spool/log.html">
|
||||
作者の運営する掲示板</a>に書いてください.
|
||||
何か言いたいことがある場合には,作者に<a href="mailto:aito@fw.ipsj.or.jp">
|
||||
直接メール</a>するか,あるいは<a href="http://http://mi.med.tohoku.ac.jp/~satodai/w3m/bbs/spool/log.html">
|
||||
w3m BBS</a>に書いてください.
|
||||
<p>
|
||||
<dt>バイナリ配布はしないの?
|
||||
<dd>
|
||||
いくつかのプラットフォームについて,w3mのバイナリ配布をやって
|
||||
くださっているサイトがあります.詳しくは
|
||||
<a href="http://ei5nazha.yz.yamagata-u.ac.jp/~aito/w3m/">
|
||||
<a href="http://w3m.sourceforge.net/">
|
||||
w3mのページ</a>をごらんください.
|
||||
|
||||
</dl>
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<h1>w3m マニュアル</h1>
|
||||
<div align=right>
|
||||
伊藤 彰則<br>
|
||||
aito@ei5sun.yz.yamagata-u.ac.jp
|
||||
aito@fw.ipsj.or.jp
|
||||
</div>
|
||||
<h2>もくじ</h2>
|
||||
<menu>
|
||||
|
||||
+6
-6
@@ -1,5 +1,5 @@
|
||||
w3m: WWW wo Miru Tool version beta-990323
|
||||
(C) Copyright by Akinori ITO March 23, 1999
|
||||
w3m: WWW wo Miru Tool version 0.2.2
|
||||
(C) Copyright by Akinori ITO November 2001
|
||||
|
||||
1. はじめに
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
現在の問題点は以下のようなものです.
|
||||
|
||||
・インライン画像表示ができない(これは原理的に無理でしょう).
|
||||
・インライン画像表示ができない(w3m homepageの w3m-img を参照!).
|
||||
・MIME-body のデコードができない.7bit 以外の Content-Transfer-encoding
|
||||
に対応していない.
|
||||
・オンラインマニュアルが貧弱.簡単な使い方については,MANUAL.html をお読み
|
||||
@@ -86,7 +86,7 @@ Windows
|
||||
3. 著作権
|
||||
|
||||
w3m の著作権は,伊藤彰則に属しています.
|
||||
(C) Copyright 1994-1999 by Akinori Ito
|
||||
(C) Copyright 1994-2001 by Akinori Ito
|
||||
|
||||
添付ライブラリのうち,Boehm GC library の著作権は Hans-J. Boehm,
|
||||
Alan J. Demers および Xerox Corporation, Silicon Graphics に属し
|
||||
@@ -105,5 +105,5 @@ Alan J. Demers
|
||||
|
||||
山形大学工学部電子情報工学科
|
||||
伊藤 彰則
|
||||
aito@ei5sun.yz.yamagata-u.ac.jp
|
||||
http://ei5nazha.yz.yamagata-u.ac.jp/
|
||||
aito@fw.ipsj.or.jp
|
||||
http://w3m.sourceforge.net/
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@
|
||||
1999/2/18<br>
|
||||
1999/3/8改訂<br>
|
||||
伊藤 彰則<br>
|
||||
aito@ei5sun.yz.yamagata-u.ac.jp
|
||||
aito@fw.ipsj.or.jp
|
||||
</div>
|
||||
<h2>はじめに</h2>
|
||||
w3mは,WWWに対応したページャ/ブラウザで,テキストベースで動く.
|
||||
@@ -50,7 +50,7 @@ Lynx
|
||||
|
||||
<h2>w3mの誕生</h2>
|
||||
<P>
|
||||
w3m の前身は,<a href="http://ei5nazha.yz.yamagata-u.ac.jp/~aito/aito-soft.html#fm">fm</a>
|
||||
w3m の前身は,fm
|
||||
というページャ(moreやlessの親戚)だった.fmが書かれたのは1991年以前
|
||||
(記録していなかったので正確な日付はわからない)で,当時まだWWWは
|
||||
一般的ではなかった(存在しなかったかも).その当時「ブラウザ」といえば,lessなどの
|
||||
@@ -163,7 +163,7 @@ w3m
|
||||
Boehm GCは,Cから使えるガベージコレクタだ.table を実装したあたりにこれを
|
||||
使いはじめたのだが,非常に快適だった.GCなしでは,w3mにtableやformを実装
|
||||
する根性が私にあったかどうか疑わしい.Boehm GCの利用については,「
|
||||
<a href="http://ei5nazha.yz.yamagata-u.ac.jp/~aito/gc/gc.html">
|
||||
<a href="http://homepage2.nifty.com/aito/gc/gc.html">
|
||||
Boehm GCを使おう</a>」という文章を書いたので,それも見ていただけると良い
|
||||
と思う.
|
||||
<P>
|
||||
|
||||
+1
-1
@@ -499,5 +499,5 @@ HTML
|
||||
.SH AUTHOR
|
||||
伊藤 彰則
|
||||
.br
|
||||
aito@ei5sun.yz.yamagata-u.ac.jp
|
||||
aito@fw.ipsj.or.jp
|
||||
|
||||
|
||||
+7
-6
@@ -7,7 +7,7 @@
|
||||
<center><h1>Frequently Asked Questions and Answers about w3m</h1></center>
|
||||
<div align=right>
|
||||
Akinori Ito<br>
|
||||
aito@ei5sun.yz.yamagata-u.ac.jp<br>
|
||||
aito@fw.ipsj.or.jp<br>
|
||||
Corrected by Tom Berger <tom.be@gmx.net>
|
||||
</div>
|
||||
<p>
|
||||
@@ -86,15 +86,15 @@ Current versions have been confirmed to run on:
|
||||
<li>EWS4800 Release 12.2 Rev.A
|
||||
</ul>
|
||||
<dt><h3>Where can I get more information about w3m?</h3>
|
||||
<dd>At the <a href="http://ei5nazha.yz.yamagata-u.ac.jp/~aito/w3m/eng/">English w3m home page</a>.
|
||||
<dd>At the <a href="http://w3m.sourceforge.net/index.en.html">English w3m home page</a>.
|
||||
<dt><h3>Is there a mailing list for w3m?</h3>
|
||||
<dd>There is a mailing list for developpers (w3m-dev-en). Please see
|
||||
<a href="http://ei5nazha.yz.yamagata-u.ac.jp/~aito/w3m/eng/">w3m page</a>
|
||||
for details. You may also mail your comments to <a href="mailto:aito@ei5sun.yz.yamagata-u.ac.jp">the author</a>.
|
||||
<a href="http://w3m.sourceforge.net/index.en.html">w3m page</a>
|
||||
for details. You may also mail your comments to <a href="mailto:aito@fw.ipsj.or.jp">the author</a>.
|
||||
<dt><h3>Are there any binary distributions?</h3>
|
||||
<dd>So far there are only binaries for the win/cygnus32 version. You can get
|
||||
them from <a href="ftp://ei5nazha.yz.yamagata-u.ac.jp/w3m/binaries">here</a>.
|
||||
Contact <a href="mailto:aito@ei5sun.yz.yamagata-u.ac.jp">the author</a> if you want to contribute binaries for other platforms.
|
||||
them from <a href="http://prdownloads.sourceforge.net/w3m/">here</a>.
|
||||
Contact <a href="mailto:aito@fw.ipsj.or.jp">the author</a> if you want to contribute binaries for other platforms.
|
||||
</dd>
|
||||
</dl>
|
||||
<br>
|
||||
@@ -114,6 +114,7 @@ arguments. Possible arguments are:
|
||||
<li>A filename or an URL
|
||||
<li>Pipe from standard input
|
||||
<li>The -B option (Show bookmark file)
|
||||
<li>The -v option (visual startup)
|
||||
<li>From a specified HTTP_HOME or WWW_HOME variable
|
||||
</ol>
|
||||
<p>
|
||||
|
||||
+6
-8
@@ -1,5 +1,5 @@
|
||||
w3m: WWW wo Miru Tool version beta-990323
|
||||
(C) Copyright by Akinori ITO March 23, 1999
|
||||
w3m: WWW wo Miru Tool version 0.2.2
|
||||
(C) Copyright by Akinori ITO November 21, 2001
|
||||
|
||||
1. Introduction
|
||||
|
||||
@@ -18,9 +18,7 @@ used as a text-mode WWW browser.
|
||||
|
||||
Current problems are:
|
||||
|
||||
* Resize behaviour is incomplete.
|
||||
* It can't show images inline. (It seems to be impossible as far as using
|
||||
xterm)
|
||||
* It can't show images inline. (See w3m-img info on the w3m homepage)
|
||||
* It doesn't decode MIME-body of the document.
|
||||
* Online manuals are poor.
|
||||
|
||||
@@ -79,7 +77,7 @@ MS-DOS
|
||||
|
||||
3. Copyright
|
||||
|
||||
(C) Copyright 1994-1999 by Akinori Ito.
|
||||
(C) Copyright 1994-2001 by Akinori Ito.
|
||||
|
||||
Hans J. Boehm, Alan J. Demers, Xerox Corp. and Silicon Graphics
|
||||
have the copyright of the GC library comes with w3m package.
|
||||
@@ -102,5 +100,5 @@ Feel free to send your opinion to the author.
|
||||
|
||||
Akinori Ito
|
||||
Faculty of Engineering, Yamagata University
|
||||
aito@ei5sun.yz.yamagata-u.ac.jp
|
||||
http://ei5nazha.yz.yamagata-u.ac.jp/
|
||||
aito@fw.ipsj.or.jp
|
||||
http://w3m.sourceforge.net/
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
1999/3/8 revised<br>
|
||||
1999/6/11 translated into English<br>
|
||||
Akinori Ito<br>
|
||||
aito@ei5sun.yz.yamagata-u.ac.jp
|
||||
aito@fw.ipsj.or.jp
|
||||
</div>
|
||||
<h2>Introduction</h2>
|
||||
W3m is a text-based pager and WWW browser.
|
||||
|
||||
-1750
File diff suppressed because it is too large
Load Diff
@@ -167,10 +167,10 @@ Additional information about
|
||||
.I
|
||||
w3m
|
||||
may be found on its Japanese language Web site located at:
|
||||
http://ei5nazha.yz.yamagata-u.ac.jp/~aito/w3m/
|
||||
http://w3m.sourceforge.net/index.ja.html
|
||||
.br
|
||||
or on its English version of the site at:
|
||||
http://ei5nazha.yz.yamagata-u.ac.jp/~aito/w3m/eng/
|
||||
http://w3m.sourceforge.net/index.en.html
|
||||
.SH ACKNOWLEDGMENTS
|
||||
.I
|
||||
w3m
|
||||
@@ -179,4 +179,4 @@ Hans J. Boehm, Alan J. Demers, Xerox Corp. and Silicon Graphics
|
||||
have the copyright of the GC library comes with w3m package.
|
||||
Users have contributed patches and suggestions over time.
|
||||
.SH AUTHOR
|
||||
Akinori ITO <aito@ei5sun.yz.yamagata-u.ac.jp>
|
||||
Akinori ITO <aito@fw.ipsj.or.jp>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: main.c,v 1.11 2001/11/20 16:46:33 ukai Exp $ */
|
||||
/* $Id: main.c,v 1.12 2001/11/21 04:29:14 a-ito Exp $ */
|
||||
#define MAINPROGRAM
|
||||
#include "fm.h"
|
||||
#include <signal.h>
|
||||
@@ -648,15 +648,11 @@ MAIN(int argc, char **argv, char **envp)
|
||||
else if (visual_start) {
|
||||
Str s_page;
|
||||
s_page = Strnew_charp("<title>W3M startup page</title><center><b>Welcome to ");
|
||||
#ifdef JP_CHARSET
|
||||
Strcat_charp(s_page, "<a href='http://ei5nazha.yz.yamagata-u.ac.jp/~aito/w3m/'>");
|
||||
#else
|
||||
Strcat_charp(s_page, "<a href='http://ei5nazha.yz.yamagata-u.ac.jp/~aito/w3m/eng/'>");
|
||||
#endif /* JP_CHARSET */
|
||||
Strcat_charp(s_page, "<a href='http://w3m.sourceforge.net/'>");
|
||||
Strcat_m_charp(s_page,
|
||||
"w3m</a>!<p><p>This is w3m version ",
|
||||
version,
|
||||
"<br>Written by <a href='mailto:aito@ei5sun.yz.yamagata-u.ac.jp'>Akinori Ito</a>",
|
||||
"<br>Written by <a href='mailto:aito@fw.ipsj.or.jp'>Akinori Ito</a>",
|
||||
NULL);
|
||||
#ifdef DEBIAN
|
||||
Strcat_m_charp(s_page,
|
||||
|
||||
@@ -0,0 +1,532 @@
|
||||
#!/usr/local/bin/perl
|
||||
#
|
||||
# Directory list CGI by Hironori Sakamoto (hsaka@mth.biglobe.ne.jp)
|
||||
#
|
||||
|
||||
if ( $^O =~ /^(ms)?(dos|win(32|nt)?)/i ) {
|
||||
$WIN32 = 1;
|
||||
$CYGPATH = 1;
|
||||
}
|
||||
elsif ( $^O =~ /cygwin|os2/i ) {
|
||||
$WIN32 = 1;
|
||||
$CYGPATH = 0;
|
||||
}
|
||||
else {
|
||||
$WIN32 = 0;
|
||||
$CYGPATH = 0;
|
||||
}
|
||||
$RC_DIR = '~/.w3m/';
|
||||
|
||||
$RC_DIR =~ s@^~/@$ENV{'HOME'}/@;
|
||||
if ($CYGPATH) {
|
||||
$RC_DIR = &cygwin_pathconv("$RC_DIR");
|
||||
}
|
||||
$CONFIG = "$RC_DIR/dirlist";
|
||||
$CGI = $ENV{'SCRIPT_NAME'} || $0;
|
||||
$CGI = "file://" . &file_encode("$CGI");
|
||||
|
||||
$AFMT = '<a href="%s"><nobr>%s</nobr></a>';
|
||||
$NOW = time();
|
||||
|
||||
@OPT = &init_option($CONFIG);
|
||||
|
||||
$query = $ENV{'QUERY_STRING'};
|
||||
$cmd = '';
|
||||
$cgi = 0;
|
||||
if ($query eq '') {
|
||||
$_ = `pwd`;
|
||||
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`;
|
||||
chop;
|
||||
s/\r$//;
|
||||
$dir = "$_/$dir";
|
||||
}
|
||||
$cgi = -1;
|
||||
}
|
||||
if ($dir !~ m@/$@) {
|
||||
$dir .= '/';
|
||||
}
|
||||
if ($dir =~ m@^/@ && $CYGPATH) {
|
||||
$dir = &cygwin_pathconv("$dir");
|
||||
}
|
||||
$ROOT = '';
|
||||
if ($WIN32) {
|
||||
if (($dir =~ s@^//[^/]+@@) || ($dir =~ s@^[a-z]:@@i)) {
|
||||
$ROOT = $&;
|
||||
}
|
||||
if ($CYGPATH) {
|
||||
$ROOT = &cygwin_pathconv("$ROOT");
|
||||
}
|
||||
}
|
||||
if ($cgi) {
|
||||
$dir = &cleanup($dir);
|
||||
}
|
||||
|
||||
$TYPE = $OPT[$OPT_TYPE];
|
||||
$FORMAT = $OPT[$OPT_FORMAT];
|
||||
$SORT = $OPT[$OPT_SORT];
|
||||
if ($cmd) {
|
||||
&update_option($CONFIG);
|
||||
}
|
||||
|
||||
$qdir = "$ROOT" . &html_quote("$dir");
|
||||
$edir = "$ROOT" . &file_encode("$dir");
|
||||
if (! opendir(DIR, "$ROOT$dir")) {
|
||||
print <<EOF;
|
||||
Content-Type: text/html
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Directory list of $qdir</title>
|
||||
</head>
|
||||
<body>
|
||||
<b>$qdir</b>: $! !
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
||||
exit 1;
|
||||
}
|
||||
|
||||
# ($cgi > 0) && print <<EOF;
|
||||
# w3m-control: DELETE_PREVBUF
|
||||
# EOF
|
||||
print <<EOF;
|
||||
Content-Type: text/html
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Directory list of $qdir</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Directory list of $qdir</h1>
|
||||
EOF
|
||||
&print_form($edir, @OPT);
|
||||
print <<EOF;
|
||||
<hr>
|
||||
EOF
|
||||
$dir =~ s@/$@@;
|
||||
@sdirs = split('/', $dir);
|
||||
$_ = $sdirs[0];
|
||||
if ($_ eq '') {
|
||||
$_ = '/';
|
||||
}
|
||||
if ($TYPE eq $TYPE_TREE) {
|
||||
print <<EOF;
|
||||
<table hborder width="640">
|
||||
<tr valign=top><td width="160">
|
||||
<pre>
|
||||
EOF
|
||||
$q = "$ROOT". &html_quote("$_");
|
||||
$e = "$ROOT" . &file_encode("$_");
|
||||
if ($dir =~ m@^$@) {
|
||||
$n = "\" name=\"current";
|
||||
} else {
|
||||
$n = '';
|
||||
}
|
||||
printf("$AFMT\n", "$e$n", "<b>$q</b>");
|
||||
$N = 0;
|
||||
$SKIPLINE = "";
|
||||
|
||||
&left_dir('', @sdirs);
|
||||
|
||||
print <<EOF;
|
||||
</pre>
|
||||
</td><td width="400">
|
||||
<pre>$SKIPLINE
|
||||
EOF
|
||||
} else {
|
||||
print <<EOF;
|
||||
<pre>
|
||||
EOF
|
||||
}
|
||||
|
||||
&right_dir($dir);
|
||||
|
||||
if ($TYPE eq $TYPE_TREE) {
|
||||
print <<EOF;
|
||||
</pre>
|
||||
</td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
||||
} else {
|
||||
print <<EOF;
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
||||
}
|
||||
|
||||
sub left_dir {
|
||||
local($pre, $dir, @sdirs) = @_;
|
||||
local($ok) = (@sdirs == 0);
|
||||
local(@cdirs) = ();
|
||||
local($_, $dir0, $d, $qdir, $q, $edir, $e);
|
||||
|
||||
$dir0 = "$dir/";
|
||||
$dir = "$dir0";
|
||||
opendir(DIR, "$ROOT$dir") || return;
|
||||
|
||||
foreach(sort readdir(DIR)) {
|
||||
-d "$ROOT$dir$_" || next;
|
||||
/^\.$/ && next;
|
||||
/^\.\.$/ && next;
|
||||
push(@cdirs, $_);
|
||||
}
|
||||
closedir(DIR);
|
||||
|
||||
$qdir = "$ROOT" . &html_quote($dir);
|
||||
$edir = "$ROOT" . &file_encode($dir);
|
||||
while(@cdirs) {
|
||||
$_ = shift @cdirs;
|
||||
$q = &html_quote($_);
|
||||
$e = &file_encode($_);
|
||||
$N++;
|
||||
if (!$ok && $_ eq $sdirs[0]) {
|
||||
$d = $dir0 . shift @sdirs;
|
||||
if (!@sdirs) {
|
||||
$n = "\" name=\"current";
|
||||
$SKIPLINE = "\n" x $N;
|
||||
} else {
|
||||
$n = '';
|
||||
}
|
||||
printf("${pre}o-$AFMT\n", "$edir$e$n", "<b>$q</b>");
|
||||
&left_dir(@cdirs ? "$pre| " : "$pre ", $d, @sdirs);
|
||||
$ok = 1;
|
||||
} else {
|
||||
printf("${pre}+-$AFMT\n", "$edir$e", $q);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub right_dir {
|
||||
local($dir) = @_;
|
||||
local(@list);
|
||||
local($_, $qdir, $q, $edir, $e, $f, $max, @d, $type, $u, $g);
|
||||
local($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
|
||||
$atime,$mtime,$ctime,$blksize,$blocks);
|
||||
local(%sizes, %ctimes, %prints);
|
||||
|
||||
$dir = "$dir/";
|
||||
opendir(DIR, "$ROOT$dir") || return;
|
||||
|
||||
$qdir = "$ROOT" . &html_quote($dir);
|
||||
$edir = "$ROOT" . &file_encode($dir);
|
||||
if ($TYPE eq $TYPE_TREE) {
|
||||
print "<b>$qdir</b>\n";
|
||||
}
|
||||
@list = ();
|
||||
$max = 0;
|
||||
foreach(readdir(DIR)) {
|
||||
/^\.$/ && next;
|
||||
# if ($TYPE eq $TYPE_TREE) {
|
||||
# /^\.\.$/ && next;
|
||||
# }
|
||||
$f = "$ROOT$dir$_";
|
||||
(($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
|
||||
$atime,$mtime,$ctime,$blksize,$blocks) = lstat($f)) || next;
|
||||
push(@list, $_);
|
||||
$sizes{$_} = $size;
|
||||
$ctimes{$_} = $ctime;
|
||||
|
||||
if ($FORMAT eq $FORMAT_COLUMN) {
|
||||
if (length($_) > $max) {
|
||||
$max = length($_);
|
||||
}
|
||||
next;
|
||||
}
|
||||
$type = &utype($mode);
|
||||
if ($FORMAT eq $FORMAT_SHORT) {
|
||||
$prints{$_} = sprintf("%-6s ", "[$type]");
|
||||
next;
|
||||
}
|
||||
if ($type =~ /^[CB]/) {
|
||||
$size = sprintf("%3u, %3u", ($rdev >> 8) & 0xff, $rdev & 0xffff00ff);
|
||||
}
|
||||
if ($FORMAT eq $FORMAT_LONG) {
|
||||
$u = $USER{$uid} || ($USER{$uid} = getpwuid($uid) || $uid);
|
||||
$g = $GROUP{$gid} || ($GROUP{$gid} = getgrgid($gid) || $gid);
|
||||
$prints{$_} = sprintf( "%s %-8s %-8s %8s %s ",
|
||||
&umode($mode), $u, $g, $size, &utime($ctime));
|
||||
# } elsif ($FORMAT eq $FORMAT_STANDARD) {
|
||||
} else {
|
||||
$prints{$_} = sprintf("%-6s %8s %s ", "[$type]", $size, &utime($ctime));
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
if ($FORMAT eq $FORMAT_COLUMN) {
|
||||
local($COLS, $l, $nr, $n);
|
||||
if ($TYPE eq $TYPE_TREE) {
|
||||
$COLS = 60;
|
||||
} else {
|
||||
$COLS = 80;
|
||||
}
|
||||
$l = int($COLS / ($max + 2)) || 1;
|
||||
$nr = int($#list / $l + 1);
|
||||
$n = 0;
|
||||
print "<table>\n<tr valign=top>";
|
||||
foreach(@list) {
|
||||
$f = "$ROOT$dir$_";
|
||||
$q = &html_quote($_);
|
||||
$e = &file_encode($_);
|
||||
if ($n % $nr == 0) {
|
||||
print "<td>";
|
||||
}
|
||||
if (-d $f) {
|
||||
printf($AFMT, "$edir$e", "$q/");
|
||||
} else {
|
||||
printf($AFMT, "$edir$e", $q);
|
||||
}
|
||||
$n++;
|
||||
if ($n % $nr == 0) {
|
||||
print "</td>\n";
|
||||
} else {
|
||||
print "<br>\n";
|
||||
}
|
||||
}
|
||||
print "</tr></table>\n";
|
||||
return;
|
||||
}
|
||||
foreach(@list) {
|
||||
$f = "$ROOT$dir$_";
|
||||
$q = &html_quote($_);
|
||||
$e = &file_encode($_);
|
||||
print $prints{$_};
|
||||
if (-d $f) {
|
||||
printf($AFMT, "$edir$e", "$q/");
|
||||
} else {
|
||||
printf($AFMT, "$edir$e", $q);
|
||||
}
|
||||
if (-l $f) {
|
||||
print " -> ", &html_quote(readlink($f));
|
||||
}
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub init_option {
|
||||
local($config) = @_;
|
||||
$OPT_TYPE = 0;
|
||||
$OPT_FORMAT = 1;
|
||||
$OPT_SORT = 2;
|
||||
$TYPE_TREE = 't';
|
||||
$TYPE_STANDARD = 'd';
|
||||
$FORMAT_SHORT = 's';
|
||||
$FORMAT_STANDARD = 'd';
|
||||
$FORMAT_LONG = 'l';
|
||||
$FORMAT_COLUMN = 'c';
|
||||
$SORT_NAME = 'n';
|
||||
$SORT_SIZE = 's';
|
||||
$SORT_TIME = 't';
|
||||
local(@opt) = ($TYPE_TREE, $FORMAT_STANDARD, $SORT_NAME);
|
||||
local($_);
|
||||
|
||||
open(CONFIG, "< $config") || return @opt;
|
||||
while(<CONFIG>) {
|
||||
chop;
|
||||
s/^\s+//;
|
||||
tr/A-Z/a-z/;
|
||||
if (/^type\s+(\S)/i) {
|
||||
$opt[$OPT_TYPE] = $1;
|
||||
} elsif (/^format\s+(\S)/i) {
|
||||
$opt[$OPT_FORMAT] = $1
|
||||
} elsif (/^sort\s+(\S)/i) {
|
||||
$opt[$OPT_SORT] = $1;
|
||||
}
|
||||
}
|
||||
close(CONFIG);
|
||||
return @opt;
|
||||
}
|
||||
|
||||
sub update_option {
|
||||
local($config) = @_;
|
||||
|
||||
open(CONFIG, "> $config") || return;
|
||||
print CONFIG <<EOF;
|
||||
type $TYPE
|
||||
format $FORMAT
|
||||
sort $SORT
|
||||
EOF
|
||||
close(CONFIG);
|
||||
}
|
||||
|
||||
sub print_form {
|
||||
local($d, @OPT) = @_;
|
||||
local(@disc) = ('Type', 'Format', 'Sort');
|
||||
local(@val) = (
|
||||
"('t', 'd')",
|
||||
"('s', 'd', 'c')",
|
||||
"('n', 's', 't')",
|
||||
);
|
||||
local(@opt) = (
|
||||
"('Tree', 'Standard')",
|
||||
"('Short', 'Standard', 'Column')",
|
||||
"('By Name', 'By Size', 'By Time')"
|
||||
);
|
||||
local($_, @vs, @os, $v, $o);
|
||||
|
||||
print <<EOF;
|
||||
<form action=\"$CGI\">
|
||||
<center>
|
||||
<table>
|
||||
<tr valign=top>
|
||||
EOF
|
||||
foreach(0 .. 2) {
|
||||
print "<td align> $disc[$_]</td>\n";
|
||||
}
|
||||
print "</tr><tr>\n";
|
||||
foreach(0 .. 2) {
|
||||
print "<td><select name=opt$_>\n";
|
||||
eval "\@vs = $val[$_]";
|
||||
eval "\@os = $opt[$_]";
|
||||
foreach $v (@vs) {
|
||||
$o = shift(@os);
|
||||
if ($v eq $OPT[$_]) {
|
||||
print "<option value=$v selected>$o\n";
|
||||
} else {
|
||||
print "<option value=$v>$o\n";
|
||||
}
|
||||
}
|
||||
print "</select></td>\n";
|
||||
}
|
||||
print <<EOF;
|
||||
<td><input type=submit name=cmd value="Update"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
<input type=hidden name=dir value="$d">
|
||||
</form>
|
||||
EOF
|
||||
}
|
||||
|
||||
sub html_quote {
|
||||
local($_) = @_;
|
||||
local(%QUOTE) = (
|
||||
'<', '<',
|
||||
'>', '>',
|
||||
'&', '&',
|
||||
'"', '"',
|
||||
);
|
||||
s/[<>&"]/$QUOTE{$&}/g;
|
||||
return $_;
|
||||
}
|
||||
sub file_encode {
|
||||
local($_) = @_;
|
||||
s/[\000-\040\+:#?&%<>"\177-\377]/sprintf('%%%02X', unpack('C', $&))/eg;
|
||||
return $_;
|
||||
}
|
||||
|
||||
sub form_decode {
|
||||
local($_) = @_;
|
||||
s/\+/ /g;
|
||||
s/%([\da-f][\da-f])/pack('C', hex($1))/egi;
|
||||
return $_;
|
||||
}
|
||||
|
||||
sub cleanup {
|
||||
local($_) = @_;
|
||||
|
||||
s@//+@/@g;
|
||||
s@/\./@/@g;
|
||||
while(m@/\.\./@) {
|
||||
s@^/(\.\./)+@/@;
|
||||
s@/[^/]+/\.\./@/@;
|
||||
}
|
||||
return $_;
|
||||
}
|
||||
|
||||
sub utype {
|
||||
local($_) = @_;
|
||||
local(%T) = (
|
||||
0010000, 'PIPE',
|
||||
0020000, 'CHR',
|
||||
0040000, 'DIR',
|
||||
0060000, 'BLK',
|
||||
0100000, 'FILE',
|
||||
0120000, 'LINK',
|
||||
0140000, 'SOCK',
|
||||
);
|
||||
return $T{($_ & 0170000)} || 'FILE';
|
||||
}
|
||||
|
||||
sub umode {
|
||||
local($_) = @_;
|
||||
local(%T) = (
|
||||
0010000, 'p',
|
||||
0020000, 'c',
|
||||
0040000, 'd',
|
||||
0060000, 'b',
|
||||
0100000, '-',
|
||||
0120000, 'l',
|
||||
0140000, 's',
|
||||
);
|
||||
|
||||
return ($T{($_ & 0170000)} || '-')
|
||||
. (($_ & 00400) ? 'r' : '-')
|
||||
. (($_ & 00200) ? 'w' : '-')
|
||||
. (($_ & 04000) ? 's' :
|
||||
(($_ & 00100) ? 'x' : '-'))
|
||||
. (($_ & 00040) ? 'r' : '-')
|
||||
. (($_ & 00020) ? 'w' : '-')
|
||||
. (($_ & 02000) ? 's' :
|
||||
(($_ & 00010) ? 'x' : '-'))
|
||||
. (($_ & 00004) ? 'r' : '-')
|
||||
. (($_ & 00002) ? 'w' : '-')
|
||||
. (($_ & 01000) ? 't' :
|
||||
(($_ & 00001) ? 'x' : '-'));
|
||||
}
|
||||
|
||||
sub utime {
|
||||
local($_) = @_;
|
||||
local(@MON) = (
|
||||
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
|
||||
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
|
||||
);
|
||||
local($sec,$min,$hour,$mday,$mon,
|
||||
$year,$wday,$yday,$isdst) = localtime($_);
|
||||
|
||||
if ($_ > $NOW - 182*24*60*60 && $_ < $NOW + 183*24*60*60) {
|
||||
return sprintf("%3s %2d %.2d:%.2d", $MON[$mon], $mday, $hour, $min);
|
||||
} else {
|
||||
return sprintf("%3s %2d %5d", $MON[$mon], $mday, 1900+$year);
|
||||
}
|
||||
}
|
||||
|
||||
sub cygwin_pathconv {
|
||||
local($_) = @_;
|
||||
local(*CYGPATH);
|
||||
|
||||
open(CYGPATH, '-|') or exec('cygpath', '-w', $_);
|
||||
$_ = <CYGPATH>;
|
||||
close(CYGPATH);
|
||||
s/\r?\n$//;
|
||||
s!\\!/!g;
|
||||
s!/$!!;
|
||||
return $_;
|
||||
}
|
||||
@@ -5,10 +5,10 @@
|
||||
<BODY>
|
||||
<CENTER>
|
||||
*******
|
||||
<A HREF="http://ei5nazha.yz.yamagata-u.ac.jp/~aito/w3m/">
|
||||
<A HREF="http://w3m.sourceforge.net/">
|
||||
w3m</A>
|
||||
(WWW-wo-Miru) Version 0.2.1 by
|
||||
<A HREF="mailto:aito@ei5sun.yz.yamagata-u.ac.jp">A.ITO</A> ********<BR>
|
||||
(WWW-wo-Miru) Version 0.2.2 by
|
||||
<A HREF="mailto:aito@fw.ipsj.or.jp">A.ITO</A> ********<BR>
|
||||
***** Key assign table *****
|
||||
</CENTER>
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
<BODY>
|
||||
<CENTER>
|
||||
*******
|
||||
<A HREF="http://ei5nazha.yz.yamagata-u.ac.jp/~aito/w3m/">w3m</A>
|
||||
(WWW-wo-Miru) Version 0.2.1 by
|
||||
<A HREF="mailto:aito@ei5sun.yz.yamagata-u.ac.jp">A.ITO(°ËÆ£¾´Â§)</A>
|
||||
<A HREF="http://w3m.sourceforge.net/">w3m</A>
|
||||
(WWW-wo-Miru) Version 0.2.2 by
|
||||
<A HREF="mailto:aito@fw.ipsj.or.jp">A.ITO(°ËÆ£¾´Â§)</A>
|
||||
********
|
||||
<BR>
|
||||
***** lynx-like キー割り当て *****
|
||||
|
||||
+3
-3
@@ -5,10 +5,10 @@
|
||||
<BODY>
|
||||
<CENTER>
|
||||
*******
|
||||
<A HREF="http://ei5nazha.yz.yamagata-u.ac.jp/~aito/w3m/">
|
||||
<A HREF="http://w3m.sourceforge.net/">
|
||||
w3m</A>
|
||||
(WWW-wo-Miru) Version 0.2.1 by
|
||||
<A HREF="mailto:aito@ei5sun.yz.yamagata-u.ac.jp">A.ITO</A> ********<BR>
|
||||
(WWW-wo-Miru) Version 0.2.2 by
|
||||
<A HREF="mailto:aito@fw.ipsj.or.jp">A.ITO</A> ********<BR>
|
||||
***** Key assign table *****
|
||||
</CENTER>
|
||||
|
||||
|
||||
+3
-3
@@ -6,9 +6,9 @@
|
||||
<BODY>
|
||||
<CENTER>
|
||||
*******
|
||||
<A HREF="http://ei5nazha.yz.yamagata-u.ac.jp/~aito/w3m/">w3m</A>
|
||||
(WWW-wo-Miru) Version 0.2.1 by
|
||||
<A HREF="mailto:aito@ei5sun.yz.yamagata-u.ac.jp">A.ITO(°ËÆ£¾´Â§)</A>
|
||||
<A HREF="http://w3m.sourceforge.net/">w3m</A>
|
||||
(WWW-wo-Miru) Version 0.2.2 by
|
||||
<A HREF="mailto:aito@fw.ipsj.or.jp">A.ITO(°ËÆ£¾´Â§)</A>
|
||||
********
|
||||
<BR>
|
||||
***** キー割り当て *****
|
||||
|
||||
Reference in New Issue
Block a user