From 72f72d64a422d6628c4796f5c0bf2e508f134214 Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Wed, 4 May 2011 16:05:14 +0900 Subject: Adding upstream version 0.5.1 --- scripts/.cvsignore | 9 + scripts/Makefile.in | 135 ++++++++++ scripts/bm2menu/README | 21 ++ scripts/bm2menu/bm2menu.pl | 58 ++++ scripts/dirlist.cgi.in | 536 +++++++++++++++++++++++++++++++++++++ scripts/multipart/.cvsignore | 2 + scripts/multipart/Makefile.in | 75 ++++++ scripts/multipart/README | 24 ++ scripts/multipart/mailcap | 1 + scripts/multipart/multipart.cgi.in | 313 ++++++++++++++++++++++ scripts/w3mhelp-funcdesc.en.pl.in | 48 ++++ scripts/w3mhelp-funcdesc.ja.pl.in | 66 +++++ scripts/w3mhelp-funcname.pl.in | 105 ++++++++ scripts/w3mhelp.cgi.in | 323 ++++++++++++++++++++++ scripts/w3mmail.cgi.in | 403 ++++++++++++++++++++++++++++ scripts/w3mman/.cvsignore | 5 + scripts/w3mman/Makefile.in | 96 +++++++ scripts/w3mman/README | 54 ++++ scripts/w3mman/hlink.cgi | 97 +++++++ scripts/w3mman/w3mman.1.in | 53 ++++ scripts/w3mman/w3mman.in | 41 +++ scripts/w3mman/w3mman2html.cgi.in | 274 +++++++++++++++++++ scripts/xface2xbm.in | 0 scripts/xface2xpm.in | 94 +++++++ 24 files changed, 2833 insertions(+) create mode 100644 scripts/.cvsignore create mode 100644 scripts/Makefile.in create mode 100644 scripts/bm2menu/README create mode 100644 scripts/bm2menu/bm2menu.pl create mode 100755 scripts/dirlist.cgi.in create mode 100644 scripts/multipart/.cvsignore create mode 100644 scripts/multipart/Makefile.in create mode 100644 scripts/multipart/README create mode 100644 scripts/multipart/mailcap create mode 100644 scripts/multipart/multipart.cgi.in create mode 100644 scripts/w3mhelp-funcdesc.en.pl.in create mode 100644 scripts/w3mhelp-funcdesc.ja.pl.in create mode 100644 scripts/w3mhelp-funcname.pl.in create mode 100644 scripts/w3mhelp.cgi.in create mode 100755 scripts/w3mmail.cgi.in create mode 100644 scripts/w3mman/.cvsignore create mode 100644 scripts/w3mman/Makefile.in create mode 100644 scripts/w3mman/README create mode 100644 scripts/w3mman/hlink.cgi create mode 100644 scripts/w3mman/w3mman.1.in create mode 100644 scripts/w3mman/w3mman.in create mode 100644 scripts/w3mman/w3mman2html.cgi.in create mode 100644 scripts/xface2xbm.in create mode 100644 scripts/xface2xpm.in (limited to 'scripts') diff --git a/scripts/.cvsignore b/scripts/.cvsignore new file mode 100644 index 0000000..67b6dc8 --- /dev/null +++ b/scripts/.cvsignore @@ -0,0 +1,9 @@ +dirlist.cgi +w3mhelp.cgi +w3mmail.cgi +w3mhelp-funcdesc.en.pl +w3mhelp-funcdesc.ja.pl +w3mhelp-funcname.pl +w3mhelp-funcdesc-stamp +xface2xpm +Makefile diff --git a/scripts/Makefile.in b/scripts/Makefile.in new file mode 100644 index 0000000..c90ab2e --- /dev/null +++ b/scripts/Makefile.in @@ -0,0 +1,135 @@ +@SET_MAKE@ +SHELL=@SHELL@ +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ +DOMAIN = $(PACKAGE) +srcidr=@srcdir@ +top_srcdir=@top_srcdir@ +VPATH= $(srcdir):. +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +datadir = @datadir@ +libdir = @libdir@ +includedir = @includedir@ +infodir = @infodir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +top_srcdir = @top_srcdir@ +VPATH = $(srcdir):. +DESTDIR = + +CGIBIN_DIR = $(libexecdir)/$(PACKAGE)/cgi-bin +AUXBIN_DIR = $(libexecdir)/$(PACKAGE) +HELP_DIR = @HELP_DIR@ +RC_DIR = @RC_DIR@ +ETC_DIR = $(sysconfdir) +CONF_DIR = $(sysconfdir)/$(PACKAGE) +DOCDIRS = @DOCDIRS@ + +AUXBIN_TARGETS = xface2xpm +LIB_TARGETS = dirlist.cgi w3mhelp.cgi w3mmail.cgi +HELP_TARGETS = w3mhelp-funcname.pl w3mhelp-funcdesc-stamp +SUBDIRS = multipart w3mman +.PHONY: $(SUBDIRS) + +MKDIR = mkdir -p +INSTALL = @INSTALL@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_DATA = @INSTALL_DATA@ + +PERL = @PERL@ + +all: $(LIB_TARGETS) $(AUXBIN_TARGETS) $(HELP_TARGETS) $(SUBDIRS) + +w3mhelp-funcname.pl: w3mhelp-funcname.pl.in ../funcname.tab $(top_srcdir)/doc/keymap.default $(top_srcdir)/doc/keymap.lynx + @echo "generating w3mhelp-funcname.pl..." + @echo '%funcname = (' > w3mhelp-funcname.pl + @sed -ne "/^[a-zA-Z@]/s/\([a-zA-Z@][a-zA-Z0-9@_]*\)[ ][ ]*\([^ ]*\)/'\1', '\2',/p" < ../funcname.tab >> w3mhelp-funcname.pl + @echo ');' >> w3mhelp-funcname.pl + @echo '%keyfunc = (' >> w3mhelp-funcname.pl + @case "$(KEYBIND_SRC)" in *lynx*) keymap=keymap.lynx;; *) keymap=keymap.default;; esac; \ + sed -ne "/^keymap/s/^keymap[ ][ ]*\([^ ]*\)[ ][ ]*\([a-zA-Z@][a-zA-Z0-9@_]*\)/'\1', '\2', /p" < $(top_srcdir)/doc/$$keymap >> w3mhelp-funcname.pl + @echo ');' >> w3mhelp-funcname.pl + @cat $(srcdir)/w3mhelp-funcname.pl.in >> w3mhelp-funcname.pl + @echo "done" + +w3mhelp-funcdesc-stamp: $(top_srcdir)/doc/README.func $(top_srcdir)/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" : "\(.*\):.*"`; \ + lang=`expr "$$dirlang" : ".*:\(.*\)_.*"`; \ + echo '%funcdesc = (' > w3mhelp-funcdesc.$$lang.pl; \ + sed -ne "/^[a-zA-Z@]/s/\([a-zA-Z@][a-zA-Z0-9@_]*\)[ ][ ]*\(.*\)/'\1', '\2',/p" < $(top_srcdir)/$$dir/README.func >> w3mhelp-funcdesc.$$lang.pl; \ + echo ');' >> w3mhelp-funcdesc.$$lang.pl; \ + cat $(srcdir)/w3mhelp-funcdesc.$$lang.pl.in >> w3mhelp-funcdesc.$$lang.pl; \ + done + @echo done + @touch w3mhelp-funcdesc-stamp + +$(SUBDIRS): + for subdir in $(SUBDIRS); \ + do \ + (cd $$subdir && $(MAKE)); \ + done + +install: $(LIB_TARGETS) $(HELP_TARGETS) + -$(MKDIR) $(DESTDIR)$(AUXBIN_DIR) + -$(MKDIR) $(DESTDIR)$(CGIBIN_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)$(CGIBIN_DIR); \ + done + for file in w3mhelp-*.pl; \ + do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(HELP_DIR); \ + done + for subdir in $(SUBDIRS); \ + do \ + (cd $$subdir && $(MAKE) install); \ + 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; \ + done + -for file in w3mhelp-*.pl; \ + do \ + rm -f $(HELP_DIR)/$$file; \ + done + -for subdir in $(SUBDIRS); \ + do \ + (cd $$subdir && $(MAKE) uninstall); \ + done + +clean: + -rm -f $(HELP_TARGETS) w3mhelp-*.pl + -for subdir in $(SUBDIRS); \ + do \ + (cd $$subdir && $(MAKE) clean); \ + done + +distclean: + -rm -f $(LIB_TARGETS) $(AUXBIN_TARGETS) + -for subdir in $(SUBDIRS); \ + do \ + (cd $$subdir && $(MAKE) distclean); \ + done + -rm -f Makefile + diff --git a/scripts/bm2menu/README b/scripts/bm2menu/README new file mode 100644 index 0000000..b44f144 --- /dev/null +++ b/scripts/bm2menu/README @@ -0,0 +1,21 @@ + +bm2menu.pl + + ブックマークファイル ~/.w3m/bookmark.html を変換して w3m の + ブックマークメニューとして使える様にする。 + +使用法 + + ~/.w3m/bookmark.html を変換して ~/.w3m/menu に追加。 + + perl bm2menu.pl ~/.w3m/bookmark.html >> ~/.w3m/menu + + 次に、~/.w3m/keymap に + + keymap x MENU Bookmarks + + の様にキーの割り当てを追加します。 + + これで、キー `x' でブックマークメニューが開きます。 + メニューの操作は doc-jp/README.menu を読んでください。 + diff --git a/scripts/bm2menu/bm2menu.pl b/scripts/bm2menu/bm2menu.pl new file mode 100644 index 0000000..d89f2b5 --- /dev/null +++ b/scripts/bm2menu/bm2menu.pl @@ -0,0 +1,58 @@ +#!/usr/bin/perl + +$PRE_MENU = ""; +$POST_MENU = <) { + if (/

(.*)<\/h2>/) { + $s = &unquote($1); + push(@section, $s); + } elsif (/
  • (.*)<\/a>/) { + $u = &unquote($1); + $t = &unquote($2); + $url{$s} .= "$u\n"; + $title{$s} .= "$t\n"; + } +} + +print "menu Bookmarks\n"; +print $PRE_MENU; +foreach(@section) { + print " popup\t\"$_\"\t\"$_\"\n"; +} +print $POST_MENU; +print "end\n"; + +foreach(@section) { + print "\n"; + print "menu \"$_\"\n"; + @ts = split("\n", $title{$_}); + @us = split("\n", $url{$_}); + while(@ts) { + $t = shift @ts; + $u = shift @us; + print " func\t\"$t\"\tGOTO\t\"\"\t\"$u\"\n"; + } + print "end\n"; +} + +sub unquote { + local($_) = @_; + + s/\</\/g; + s/\ / /g; + s/\&/\&/g; + + return $_; +} diff --git a/scripts/dirlist.cgi.in b/scripts/dirlist.cgi.in new file mode 100755 index 0000000..5cba1a8 --- /dev/null +++ b/scripts/dirlist.cgi.in @@ -0,0 +1,536 @@ +#!@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 = '@RC_DIR@'; +$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 = '%s'; +$NOW = time(); + +@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 < + +Directory list of $qdir + + +$qdir: $! ! + + +EOF + exit 1; +} + +print < + +Directory list of $qdir + + +

    Directory list of $qdir

    +EOF +&print_form($qdir, @OPT); +print < +EOF +$dir =~ s@/$@@; +@sdirs = split('/', $dir); +$_ = $sdirs[0]; +if ($_ eq '') { + $_ = '/'; +} +if ($TYPE eq $TYPE_TREE) { + print < + +
    +EOF
    +  $q = "$ROOT". &html_quote("$_");
    +  $e = "$ROOT" . &file_encode("$_");
    +  if ($dir =~ m@^$@) {
    +    $n = "\" name=\"current";
    +  } else {
    +    $n = '';
    +  }
    +  printf("$AFMT\n", "$e$n", "$q");
    +  $N = 0;
    +  $SKIPLINE = "";
    +
    +  &left_dir('', @sdirs);
    +
    +  print <
    +
    +
    $SKIPLINE
    +EOF
    +} else {
    +  print <
    +EOF
    +}
    +
    +&right_dir($dir);
    +
    +if ($TYPE eq $TYPE_TREE) {
    +  print <
    +
    +
    +
    +
    +EOF
    +} else {
    +  print <
    +
    +
    +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", "$q");
    +      &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 "$qdir\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 cmp $b } @list;
    +  } elsif ($SORT eq $SORT_TIME) { 
    +    @list = sort { $ctimes{$b} <=> $ctimes{$a} || $a cmp $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 "\n";
    +    foreach(@list) {
    +      $f = "$ROOT$dir$_";
    +      $q = &html_quote($_);
    +      $e = &file_encode($_);
    +      if ($n % $nr == 0) {
    +        print "\n";
    +      } else {
    +        print "
    \n"; + } + } + print "
    "; + } + if (-d $f) { + printf($AFMT, "$edir$e", "$q/"); + } else { + printf($AFMT, "$edir$e", $q); + } + $n++; + if ($n % $nr == 0) { + print "
    \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() { + 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 + foreach(0 .. 2) { + print "\n"; + } + print "\n"; + foreach(0 .. 2) { + print "\n"; + } + print < + +
     $disc[$_]
    +
    + + + +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, '-|') || exec('cygpath', '-w', $_); + $_ = ; + close(CYGPATH); + s/\r?\n$//; + s!\\!/!g; + s!/$!!; + return $_; +} diff --git a/scripts/multipart/.cvsignore b/scripts/multipart/.cvsignore new file mode 100644 index 0000000..db1dff2 --- /dev/null +++ b/scripts/multipart/.cvsignore @@ -0,0 +1,2 @@ +multipart.cgi +Makefile diff --git a/scripts/multipart/Makefile.in b/scripts/multipart/Makefile.in new file mode 100644 index 0000000..ad472ee --- /dev/null +++ b/scripts/multipart/Makefile.in @@ -0,0 +1,75 @@ +@SET_MAKE@ +SHELL=@SHELL@ +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ +DOMAIN = $(PACKAGE) +srcidr=@srcdir@ +top_srcdir=@top_srcdir@ +VPATH= $(srcdir):. +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +datadir = @datadir@ +libdir = @libdir@ +includedir = @includedir@ +infodir = @infodir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +top_srcdir = @top_srcdir@ +VPATH = $(top_srcdir):. +DESTDIR = + +CGIBIN_DIR = $(libexecdir)/$(PACKAGE)/cgi-bin +AUXBIN_DIR = $(libexecdir)/$(PACKAGE) +HELP_DIR = @HELP_DIR@ +RC_DIR = @RC_DIR@ +ETC_DIR = $(sysconfdir) +CONF_DIR = $(sysconfdir)/$(PACKAGE) + +LIB_TARGETS = multipart.cgi + +MKDIR = mkdir -p +INSTALL = @INSTALL@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ + +PERL = @PERL@ +NKF = @NKF@ + +all: $(LIB_TARGETS) + +# do nothing +$(LIB_TARGETS): + +install: $(LIB_TARGETS) + -$(MKDIR) $(DESTDIR)$(CGIBIN_DIR) + for file in $(LIB_TARGETS); \ + do \ + $(INSTALL_SCRIPT) $$file $(DESTDIR)$(CGIBIN_DIR); \ + done + +uninstall: + -for file in $(LIB_TARGETS); \ + do \ + rm -f $(CGIBIN_DIR)/$$file; \ + done + +clean: + +distclean: + -rm -f $(LIB_TARGETS) + -rm -f Makefile + +dist: all + @-rm -fr $(distdir)/multipart + $(MKDIR) $(distdir)/multipart + cp Makefile README multipart.cgi.in $(distdir)/multipart + ( cd $(distdir); tar -cf - multipart | GZIP='' gzip ) \ + > $(distdir)/multipart.tar.gz + -rm -fr $(distdir)/multipart + diff --git a/scripts/multipart/README b/scripts/multipart/README new file mode 100644 index 0000000..b82f585 --- /dev/null +++ b/scripts/multipart/README @@ -0,0 +1,24 @@ + +Content-Type: multipart/* を扱う local-CGI + + Content-Type: multipart/* なファイルを扱うための local-CGI です。 + 主に mailx などでメールを PAGER="w3m -m" で読む場合を想定しています。 + +インストール + + * make install + 必要なら PERL, NKF, LIBDIR を設定してください。 + + * mailcap を ~/.w3m/mailcap にマージ + multipart.cgi のパスに注意 + + * w3m の Option Setting Panel で、 + 『保存時に Content-Transfer-Encoding をデコードする』を ON + 添付ファイルの保存時に便利です。 + +必要なもの + + * NKF モジュールまたは nkf + 文字コード変換や MIME ヘッダのデコードにを使ってます。 + 気にいらなければ変えてください。 + diff --git a/scripts/multipart/mailcap b/scripts/multipart/mailcap new file mode 100644 index 0000000..323ee20 --- /dev/null +++ b/scripts/multipart/mailcap @@ -0,0 +1 @@ +multipart/*; /usr/local/lib/w3m/multipart.cgi %s %{boundary}; htmloutput diff --git a/scripts/multipart/multipart.cgi.in b/scripts/multipart/multipart.cgi.in new file mode 100644 index 0000000..db8001c --- /dev/null +++ b/scripts/multipart/multipart.cgi.in @@ -0,0 +1,313 @@ +#!@PERL@ + +eval "use NKF;"; +if (! $@) { + $use_NKF = 1; + $CONV = "-e"; + $MIME_DECODE = "-m -e"; +} else { + $use_NKF = 0; +# $CONV = "w3m -dump -e"; + $CONV = "@NKF@ -e"; + $MIME_DECODE = "@NKF@ -m -e"; +} +$MIME_TYPE = "$ENV{'HOME'}/.mime.types"; + +$SCRIPT_NAME = $ENV{'SCRIPT_NAME'} || $0; +$CGI = "file://$SCRIPT_NAME"; + +if ($ENV{'REQUEST_METHOD'} eq 'POST') { + sysread(STDIN, $query, $ENV{'CONTENT_LENGTH'}); +} elsif (defined($ENV{'QUERY_STRING'})) { + $query = $ENV{'QUERY_STRING'}; +} +if (defined($query)) { + for (split('&', $query)) { + s/^([^=]*)=//; + $v{$1} = $_; + } + $file = &form_decode($v{'file'}); + $boundary = &form_decode($v{'boundary'}); +} else { + $file = $ARGV[0]; + if (@ARGV >= 2) { + $boundary = $ARGV[1]; + } +} +(-f $file) || exit(1); +open(F, "< $file") || exit(1); +$end = 0; +$mbody = ''; +if (defined($boundary)) { + while() { + s/\r?\n$//; + ($_ eq "--$boundary") && last; + ($_ eq "--$boundary--") && ($end = 1, last); + $mbody .= "$_\n"; + } +} else { + while() { + s/\r?\n$//; + if (s/^\-\-//) { + $boundary = $_; + last; + } + $mbody .= "$_\n"; + } +} + +if (defined($v{'count'})) { + $count = 0; + while($count < $v{'count'}) { + while() { + s/\r?\n$//; + ($_ eq "--$boundary") && last; + } + eof(F) && exit; + $count++; + } + + %header = (); + $hbody = ''; + while() { + /^\s*$/ && last; + $x = $_; + s/\r?\n$//; + if (/=\?/) { + $_ = &decode($_, $MIME_DECODE); + } + if (s/^(\S+)\s*:\s*//) { + $h = $&; + if ($h =~ /^w3m-control/i) { + $h = "WARNING: $h"; + } + $hbody .= "$h$_\n"; + $p = $1; + $p =~ tr/A-Z/a-z/; + $header{$p} = $_; + } elsif (s/^\s+//) { + chop $hbody; + $hbody .= "$_\n"; + $header{$p} .= $_; + } + } + $type = $header{"content-type"}; + $dispos = $header{"content-disposition"}; + if ($type =~ /application\/octet-stream/) { + if ($type =~ /type\=gzip/) { + print "Content-Encoding: x-gzip\n"; + } + if ($type =~ /name=\"?([^\"]+)\"?/ || + $dispos =~ /filename=\"?([^\"]+)\"?/) { + $type = &guess_type($1); + if ($type) { + print "Content-Type: $type; name=\"$1\"\n"; + } else { + print "Content-Type: text/plain; name=\"$1\"\n"; + } + } + } + print $hbody; + print "\n"; + while() { + $x = $_; + s/\r?\n$//; + ($_ eq "--$boundary") && last; + if ($_ eq "--$boundary--") { + last; + } + print $x; + } + close(F); + exit; +} + +$qcgi = &html_quote($CGI); +$qfile = &html_quote($file); +$qboundary = &html_quote($boundary); + +if ($mbody =~ /\S/) { + $_ = $mbody; + s/\&/\&/g; + s/\/\>/g; + print "
    \n";
    +	print $_;
    +	print "
    \n"; +} + +$count = 0; +while(! $end) { + %header = (); + $hbody = ''; + while() { + /^\s*$/ && last; + s/\r?\n$//; + if (/=\?/) { + $_ = &decode($_, $MIME_DECODE); + } + if (s/^(\S+)\s*:\s*//) { + $hbody .= "$&$_\n"; + $p = $1; + $p =~ tr/A-Z/a-z/; + $header{$p} = $_; + } elsif (s/^\s+//) { + chop $hbody; + $hbody .= "$_\n"; + $header{$p} .= $_; + } + } + $type = $header{"content-type"}; + $dispos = $header{"content-disposition"}; + $plain = 0; + $image = 0; + if (! $dispos || $dispos =~ /^inline/i) { + if (! $type || $type =~ /^text\/plain/i) { + $plain = 1; + } elsif ($type =~ /^image\//i) { + $image = 1; + } + } + $body = ''; + while() { + s/\r?\n$//; + ($_ eq "--$boundary") && last; + if ($_ eq "--$boundary--") { + $end = 1; + last; + } + if ($plain) { + $body .= "$_\n"; + } + } + $| = 1; + print "
    \n"; + { + $_ = $hbody; + s/\&/\&/g; + s/\/\>/g; + print "
    \n";
    +		print $_;
    +		print "
    \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 "\n"; + } + print "
    \n" + } + if ($plain) { + $body = &decode($body, $CONV); + $_ = $body; + s/\&/\&/g; + s/\/\>/g; + print "
    \n\n";
    +		print $_;
    +		print "
    \n"; + } + eof(F) && last; + $count++; +} +close(F); + +sub decode { +if ($use_NKF) { + local($body, $opt) = @_; + return nkf($opt, $body); +} + local($body, @cmd) = @_; + local($_); + + $| = 1; + pipe(R, W2); + pipe(R2, W); + if (! fork()) { + close(F); + close(R); + close(W); + open(STDIN, "<&R2"); + open(STDOUT, ">&W2"); + exec @cmd; + die; + } + close(R2); + close(W2); + print W $body; + close(W); + $body = ''; + while() { + $body .= $_; + } + close(R); + return $body; +} + +sub html_quote { + local($_) = @_; + local(%QUOTE) = ( + '<', '<', + '>', '>', + '&', '&', + '"', '"', + ); + s/[<>&"]/$QUOTE{$&}/g; + return $_; +} + +sub form_decode { + local($_) = @_; + s/\+/ /g; + s/%([\da-f][\da-f])/pack('c', hex($1))/egi; + return $_; +} + +sub form_encode { + local($_) = @_; + s/[\000-\040\+:#?&%<>"\177-\377]/sprintf('%%%02X', unpack('C', $&))/eg; + return $_; +} + +sub guess_type { + local($_) = @_; + + /\.(\w+)$/ || return ""; + $_ = $1; + tr/A-Z/a-z/; + %mime_type = &load_mime_type($MIME_TYPE); + $mime_type{$_}; +} + +sub load_mime_type { + local($file) = @_; + local(%m, $a, @b, $_); + + open(M, "< $file") || return (); + while() { + /^#/ && next; + chop; + (($a, @b) = split(" ")) >= 2 || next; + for(@b) { + $m{$_} = $a; + } + } + close(M); + return %m; +} diff --git a/scripts/w3mhelp-funcdesc.en.pl.in b/scripts/w3mhelp-funcdesc.en.pl.in new file mode 100644 index 0000000..d854b59 --- /dev/null +++ b/scripts/w3mhelp-funcdesc.en.pl.in @@ -0,0 +1,48 @@ +# charset +$charset = 'US-ASCII'; + +# Buffer selection mode + +%buf_funcdesc = ( + 'BUF:PREV', 'Select previous buffer', + 'BUF:NEXT', 'Select next buffer', + 'BUF:DELETE', 'Delete current buffer', + 'BUF:GO', 'Go to the selected buffer', +); + +%lineedit_funcdesc = ( + 'LINEEDIT:FORWARD', 'Move cursor forward', + 'LINEEDIT:BACK', 'Move cursor backward', + 'LINEEDIT:BS', 'Delete previous character', + 'LINEEDIT:DEL', 'Delete current character', + 'LINEEDIT:KILL_AFTER', 'Kill everything after cursor', + 'LINEEDIT:KILL_BEFORE', 'Kill everything before cursor', + 'LINEEDIT:TOP', 'Move to the top of line', + 'LINEEDIT:BOTTOM', 'Move to the bottom of line', + 'LINEEDIT:PREV', 'Fetch the previous string from the history list', + 'LINEEDIT:NEXT', 'Fetch the next string from the history list', + 'LINEEDIT:EDITOR', 'Edit with external editor', + 'LINEEDIT:COMPLETE', 'Complete filename', + 'LINEEDIT:ACCEPT', 'Accept', +); + +%menu_funcdesc = ( + 'MENU:SELECT', 'Select item', + 'MENU:CLOSE', 'Close menu', + 'MENU:CANCEL', 'Back', + 'MENU:DOWN', 'Move to next item', + 'MENU:UP', 'Move to previous item', + 'MENU:LINE_UP', 'Scroll up one item', + 'MENU:LINE_DOWN', 'Scroll down one item', + 'MENU:TOP', 'Go to top item', + 'MENU:LAST', 'Go to last item', + 'MENU:NEXT', 'Go to next page', + 'MENU:PREV', 'Go to previous page', + 'MENU:SEARCH_FORE', 'Search foreward', + 'MENU:SEARCH_BACK', 'Search backward', + 'MENU:SEARCH_NEXT', 'Search next regexp', + 'MENU:SEARCH_PREV', 'Search previous regexp', + 'MENU:SUSPEND', 'Suspend', +); + +1; diff --git a/scripts/w3mhelp-funcdesc.ja.pl.in b/scripts/w3mhelp-funcdesc.ja.pl.in new file mode 100644 index 0000000..051c888 --- /dev/null +++ b/scripts/w3mhelp-funcdesc.ja.pl.in @@ -0,0 +1,66 @@ +# charset +$charset = 'EUC-JP'; + +# Buffer selection mode + +%buf_funcdesc = ( + 'BUF:PREV', '一つ上のバッファを選択', + 'BUF:NEXT', '一つ下のバッファを選択', + 'BUF:DELETE', '現在選択しているバッファを削除', + 'BUF:GO', '現在選択しているバッファを表示', +); + +%lineedit_funcdesc = ( + 'LINEEDIT:FORWARD', 'カーソルを右へ移動', + 'LINEEDIT:BACK', 'カーソルを左へ移動', + 'LINEEDIT:BS', '前の文字を削除', + 'LINEEDIT:DEL', 'カーソル位置の文字を削除', + 'LINEEDIT:KILL_AFTER', 'カーソルの後方を全て削除', + 'LINEEDIT:KILL_BEFORE', 'カーソルの前までを全て削除', + 'LINEEDIT:TOP', '行頭に移動', + 'LINEEDIT:BOTTOM', '行末へ移動', + 'LINEEDIT:PREV', 'ヒストリから一つ前の文字列を取り出す', + 'LINEEDIT:NEXT', 'ヒストリから次の文字列を取り出す', + 'LINEEDIT:EDITOR', '外部エディタで編集', + 'LINEEDIT:COMPLETE', 'ファイル名の補完', + 'LINEEDIT:ACCEPT', '入力終了', +); + +%menu_funcdesc = ( + 'MENU:SELECT', '項目を選択', + 'MENU:CLOSE', 'メニューを閉じる', + 'MENU:CANCEL', '戻る', + 'MENU:DOWN', '一つ下の項目へ', + 'MENU:UP', '一つ上の項目へ', + 'MENU:LINE_UP', '項目を下にスクロール', + 'MENU:LINE_DOWN', '項目を上にスクロール', + 'MENU:TOP', '先頭の項目へ', + 'MENU:LAST', '最後の項目へ', + 'MENU:NEXT', '次ページの項目へ', + 'MENU:PREV', '前ページの項目へ', + 'MENU:SEARCH_FORE', '項目を下に向かって検索', + 'MENU:SEARCH_BACK', '項目を上に向かって検索', + 'MENU:SEARCH_NEXT', '次の項目を検索', + 'MENU:SEARCH_PREV', '前の項目を検索', + 'MENU:SUSPEND', 'サスペンド', +); + +%title = ( + "Show keymap file", 'keymap ファイルを見る', + "Page/Cursor motion", 'ページ/カーソル移動', + "Hyperlink operation", 'ハイパーリンク操作', + "File/Stream operation", 'ファイル/ストリーム操作', + "Buffer operation", 'バッファ操作', + "Tab operation", 'タブ操作', + "Buffer selection mode", 'バッファ選択モード', + "Bookmark operation", 'ブックマーク操作', + "Search", '検索', + "Dictionary look-up", '辞書検索', + "Mark operation", 'マーク操作', + "Miscellany", 'その他', + "User defined keymaps", 'ユーザ定義', + "Line-edit mode", '行編集モード', + "Popup menu", 'メニュー', +); + +1; diff --git a/scripts/w3mhelp-funcname.pl.in b/scripts/w3mhelp-funcname.pl.in new file mode 100644 index 0000000..659b7ed --- /dev/null +++ b/scripts/w3mhelp-funcname.pl.in @@ -0,0 +1,105 @@ + +%buf_funcname = ( + 'BUF:PREV', 'buffer_prev', + 'BUF:NEXT', 'buffer_next', + 'BUF:DELETE', 'buffer_delete', + 'BUF:GO', 'buffer_go', +); + +%lineedit_funcname = ( + 'LINEEDIT:FORWARD', 'lineedit_forward', + 'LINEEDIT:BACK', 'lineedit_back', + 'LINEEDIT:BS', 'lineedit_backspace', + 'LINEEDIT:DEL', 'lineedit_delete', + 'LINEEDIT:KILL_AFTER', 'lineedit_kill_after', + 'LINEEDIT:KILL_BEFORE', 'lineedit_kill_before', + 'LINEEDIT:TOP', 'lineedit_top', + 'LINEEDIT:BOTTOM', 'lineedit_bottom', + 'LINEEDIT:PREV', 'lineedit_prev', + 'LINEEDIT:NEXT', 'lineedit_next', + 'LINEEDIT:EDITOR', 'lineedit_editor', + 'LINEEDIT:COMPLETE', 'lineedit_complete', + 'LINEEDIT:ACCEPT', 'lineedit_accept', +); + +%menu_funcname = ( + 'MENU:SELECT', 'menu_select', + 'MENU:CLOSE', 'menu_close', + 'MENU:CANCEL', 'menu_cancel', + 'MENU:DOWN', 'menu_down', + 'MENU:UP', 'menu_up', + 'MENU:LINE_UP', 'menu_line_up', + 'MENU:LINE_DOWN', 'menu_line_down', + 'MENU:TOP', 'menu_top', + 'MENU:LAST', 'menu_last', + 'MENU:NEXT', 'menu_next', + 'MENU:PREV', 'menu_prev', + 'MENU:SEARCH_FORE', 'menu_search_fore', + 'MENU:SEARCH_BACK', 'menu_search_back', + 'MENU:SEARCH_NEXT', 'menu_search_next', + 'MENU:SEARCH_PREV', 'menu_search_prev', + 'MENU:SUSPEND', 'menu_suspend', +); + +%buf_keyfunc = ( + 'k', 'BUF:PREV', + 'C-p', 'BUF:PREV', + 'j', 'BUF:NEXT', + 'C-n', 'BUF:NEXT', + 'D', 'BUF:DELETE', + 'RET', 'BUF:GO' +); + +%lineedit_keyfunc = ( + 'C-f', 'LINEEDIT:FORWARD', + 'C-b', 'LINEEDIT:BACK', + 'C-h', 'LINEEDIT:BS', + 'C-d', 'LINEEDIT:DEL', + 'C-k', 'LINEEDIT:KILL_AFTER', + 'C-u', 'LINEEDIT:KILL_BEFORE', + 'C-a', 'LINEEDIT:TOP', + 'C-e', 'LINEEDIT:BOTTOM', + 'C-p', 'LINEEDIT:PREV', + 'C-n', 'LINEEDIT:NEXT', + 'C-o', 'LINEEDIT:EDITOR', + 'TAB', 'LINEEDIT:COMPLETE', + 'SPC', 'LINEEDIT:COMPLETE', + 'RET', 'LINEEDIT:ACCEPT' +); + +%menu_keyfunc = ( + 'RET', 'MENU:SELECT', + 'SPC', 'MENU:SELECT', + 'RIGHT', 'MENU:SELECT', + '^[[28~', 'MENU:CLOSE', + '^[[2~', 'MENU:CLOSE', + 'C-c', 'MENU:CLOSE', + 'C-h', 'MENU:CANCEL', + 'DEL', 'MENU:CANCEL', + 'LEFT', 'MENU:CANCEL', + 'C-n', 'MENU:DOWN', + 'j', 'MENU:DOWN', + 'DOWN', 'MENU:DOWN', + 'C-p', 'MENU:UP', + 'k', 'MENU:UP', + 'UP', 'MENU:UP', + 'K', 'MENU:LINE_UP', + 'J', 'MENU:LINE_DOWN', + 'C-a', 'MENU:TOP', + 'C-e', 'MENU:LAST', + 'C-f', 'MENU:NEXT', + 'C-v', 'MENU:NEXT', + '^[[6~', 'MENU:NEXT', + 'C-b', 'MENU:PREV', + 'ESC-v', 'MENU:PREV', + '^[[5~', 'MENU:PREV', + 'C-s', 'MENU:SEARCH_FORE', + '/', 'MENU:SEARCH_FORE', + 'C-r', 'MENU:SEARCH_BACK', + '?', 'MENU:SEARCH_BACK', + 'n', 'MENU:SEARCH_NEXT', + 'N', 'MENU:SEARCH_PREV', + 'C-z', 'MENU:SUSPEND', +); + +1; diff --git a/scripts/w3mhelp.cgi.in b/scripts/w3mhelp.cgi.in new file mode 100644 index 0000000..135b835 --- /dev/null +++ b/scripts/w3mhelp.cgi.in @@ -0,0 +1,323 @@ +#!@PERL@ +# $Id: w3mhelp.cgi.in,v 1.28 2004/03/22 17:03:13 ukai Exp $ + +if ( $^O =~ /^(ms)?(dos|win(32|nt)?)/i ) { + $CYGPATH = 1; +} + +$prefix = "@prefix@"; +$helpdir = "@HELP_DIR@"; +if ($CYGPATH) { + $helpdir = &cygwin_pathconv($helpdir); +} +unshift(@INC, $helpdir); +@docdirs = split(" ", "@DOCDIRS@"); + +require "w3mhelp-funcname.pl"; +require "w3mhelp-funcdesc.en.pl"; +$lang = 'en'; +$charset = 'US-ASCII'; + +%htmlesc = ( + '<', '<', + '>', '>', + '&', '&' +); + +$RC_DIR = '@RC_DIR@'; +$RC_DIR =~ s/^~/$ENV{'HOME'}/; +if ($CYGPATH) { + $RC_DIR = &cygwin_pathconv("$RC_DIR"); +} +$keymap = "$RC_DIR/keymap"; +$version = '*unknown*'; +if (defined($ENV{'QUERY_STRING'})) { + print "QUERY_STRING=$ENV{'QUERY_STRING'}\n"; + if ($ENV{'QUERY_STRING'} =~ /(^|&)version=([^&]*)/) { + $version = $2; + $version =~ s/\+|%([0-9A-Fa-f][0-9A-Fa-f])/$& eq '+' ? ' ' : pack('C', hex($1))/ge; + $version =~ s/w3m\///; + } + if ($ENV{'QUERY_STRING'} =~ /(^|&)lang=([^&]*)/) { + local($tlang) = $2; + $tlang =~ s/\+|%([0-9A-Fa-f][0-9A-Fa-f])/$& eq '+' ? ' ' : pack('C', hex($1))/ge; + $tlang =~ tr/A-Z/a-z/; + if ($tlang !~ /^[a-z][a-z]$/) { + $tlang = 'en'; + } + # print "tlang=$tlang\n"; + eval {require "w3mhelp-funcdesc.$tlang.pl";}; + if (defined(%funcdesc)) { + $lang = $tlang; + } + } +} + +%f = %keyfunc; +%keyfunc = (); +while (($key, $fname) = each %f) { + $key = &norm_key($key); + $keyfunc{$key} = $fname; +} + +if (-f $keymap) { + open(KEYMAP, "< $keymap") || die "cannot open keymap: $keymap, $!"; + &load_keymap(*KEYMAP, $func); + close(KEYMAP); +} + +local (%funckeydesc, $key, $fname, $desc); + +%funcname = (%funcname, %buf_funcname, %lineedit_funcname, %menu_funcname); + +%funcdesc = (%funcdesc, %buf_funcdesc, %lineedit_funcdesc, %menu_funcdesc); +while (($fname, $desc) = each %funcdesc) { + $funckeydesc{$funcname{$fname}} = "$fname\n$desc\n"; +} + +while (($key, $fname) = each %keyfunc) { + $keydata{$key} && next; + $funckeydesc{$funcname{$fname}} .= "$key,"; +} +while (($key, $fname) = each %buf_keyfunc) { + $funckeydesc{$funcname{$fname}} .= "$key,"; +} +while (($key, $fname) = each %lineedit_keyfunc) { + $funckeydesc{$funcname{$fname}} .= "$key,"; +} +while (($key, $fname) = each %menu_keyfunc) { + $funckeydesc{$funcname{$fname}} .= "$key,"; +} + +print < + +w3m help page + + +
    +******* +w3m + (WWW-wo-Miru) Version $version by +A.ITO ********
    + ***** Key assign table ***** +
    + +HEADING + +$q_version = $version; +$q_version =~ s/[^A-Za-z0-9_\$\.\-]/sprintf('%%%02X', ord($&))/ge; +$script = "$d[2] version\n"; + } +} + +$keymap =~ s/[<>&]/$htmlesc{$&}/ge; +$head = "Show keymap file"; +if (defined($title{$head})) { + $head = $title{$head}; + $head =~ s/[<>&]/$htmlesc{$&}/ge; +} +print "

    $head\n"; + +&show_keymap("Page/Cursor motion", + split(" ", "pgFore pgBack movR movL movD movU + movR1 movL1 movD1 movU1 ldown1 lup1 + shiftl shiftr col1L col1R linbeg linend ctrCsrH ctrCsrV + goLine goLineF goLineL movRW movLW + topA lastA nextA prevA movlistMn + nextR nextL nextD nextU nextRD nextLU + undoPos redoPos")); + +&show_keymap("Hyperlink operation", + split(" ", "followA tabA svA followI svI submitForm + curURL peekURL peekIMG pginfo curlno chkURL chkWORD chkNMID + rFrame extbrz linkbrz linkLst listMn linkMn accessKey")); + +&show_keymap("File/Stream operation", + split(" ", "goURL gorURL tabURL tabrURL ldfile readsh pipesh + pipeBuf")); + +&show_keymap("Buffer operation", + split(" ", "backBf nextBf prevBf selMn selBuf vwSrc svSrc svBuf + editBf editScr reload reshape rdrwSc dispI stopI")); + +&show_keymap("Tab operation", + split(" ", "newT closeT nextT prevT tabMn tabR tabL")); + +&show_keymap("Bookmark operation", + split(" ", "ldBmark adBmark")); + +&show_keymap("Search", + split(" ", "srchfor srchbak srchnxt srchprv isrchfor isrchbak")); + +&show_keymap("Dictionary look-up", + split(" ", "dictword dictwordat")); + +&show_keymap("Mark operation", + split(" ", "_mark nextMk prevMk reMark")); + +&show_keymap("Miscellany", + split(" ", "mainMn ldhelp ldOpt dispVer cooLst ldHist ldDL + docCSet defCSet + msgs msToggle wrapToggle execCmd setAlarm setOpt setEnv defKey + reinit execsh susp qquitfm quitfm")); + +&show_keymap_data("User defined keymaps"); + +print "
    \n


    \n"; + +&show_keymap("Buffer selection mode", + split(" ", "buffer_next buffer_prev buffer_delete buffer_go")); + +print "
    \n
    \n"; + +&show_keymap("Line-edit mode", + 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 "
    \n
    \n"; + +&show_keymap("Popup menu", + split(" ", "menu_select menu_close menu_cancel menu_down menu_up + menu_line_up menu_line_down menu_top menu_last menu_next + menu_prev menu_search_fore menu_search_back menu_search_next + menu_search_prev menu_suspend")); + +print < + + +PAGE + +exit 0; + +sub load_keymap { + local(*FH) = shift; + local($func) = @_; + + while () { + /^#/ && next; + s/^\s*keymap\s+// || next; + s/^(\"(\\\"|[^\"])+\"|\'(\\\'|[^\'])+\'|\S+)\s+(\S+)\s*// || next; + ($key, $fname) = ($1, $4); + $data = $_; + $fname =~ tr/a-z/A-Z/; + defined($funcdesc{$fname}) || next; + $key =~ s/^["'](.*)["']$/$1/; + $key = &norm_key($key); + $keyfunc{$key} = $fname; + if ($data) { + $keydata{$key} = $data; + } else { + delete $keydata{$key}; + } + } +} + +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 $_; +} + +sub show_keymap { + local($head, @list) = @_; + local($fid); + local($attr) = " WIDTH=140"; + + if (defined($title{$head})) { + $head = $title{$head}; + $head =~ s/[<>&]/$htmlesc{$&}/ge; + } + + print <$head
  • + +PAGE + foreach $fid (@list) { + local ($name, $desc, $keys) = split("\n", $funckeydesc{$fid}, 3); + $keys =~ s/,$//; + $keys = '' if ($keys eq ''); + $keys =~ s/[<>&]/$htmlesc{$&}/ge; + if ($name =~ /:/) { + $name = ""; + } else { + $name =~ s/[<>&]/$htmlesc{$&}/ge; + $name = " ($name)"; + } + $desc =~ s/[<>&]/$htmlesc{$&}/ge; + print <$keys
    $desc$name +PAGE + $attr = ""; + } + print "
    \n"; +} + +sub show_keymap_data { + local($head, @list) = @_; + local($fid); + local($attr) = " WIDTH=140"; + + if (defined($title{$head})) { + $head = $title{$head}; + $head =~ s/[<>&]/$htmlesc{$&}/ge; + } + + print <$head + +PAGE + foreach $keys (sort keys %keydata) { + $keys =~ s/[<>&]/$htmlesc{$&}/ge; + $name = $keyfunc{$keys}; + $data = $keydata{$keys}; + $name =~ s/[<>&]/$htmlesc{$&}/ge; + $data =~ s/[<>&]/$htmlesc{$&}/ge; + print <$keys
    $name$data +PAGE + $attr = ""; + } + print "
    \n"; +} + + +sub cygwin_pathconv { + local($_) = @_; + local(*CYGPATH); + + open(CYGPATH, '-|') || exec('cygpath', '-w', $_); + $_ = ; + close(CYGPATH); + s/\r?\n$//; + s!\\!/!g; + s!/$!!; + return $_; +} diff --git a/scripts/w3mmail.cgi.in b/scripts/w3mmail.cgi.in new file mode 100755 index 0000000..670f26c --- /dev/null +++ b/scripts/w3mmail.cgi.in @@ -0,0 +1,403 @@ +#!@PERL@ + +$rcsid = q$Id: w3mmail.cgi.in,v 1.13 2003/09/22 21:02:29 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); + $to = $query; + $opt = ''; + if ($to =~ /^([^?]*)\?(.*)$/) { + $to = $1; + $opt = $2; + } + $to = &url_unquote($to); + %opt = &parse_opt($opt); + + @to = ($to); + push(@to, $opt{'to'}) if ($opt{'to'}); + $opt{'to'} = join(',', @to); + if ($ENV{'REQUEST_METHOD'} eq 'POST') { + sysread(STDIN, $body, $ENV{'CONTENT_LENGTH'}); + $content_type = $ENV{'CONTENT_TYPE'}; + if ($content_type =~ /^multipart\/form-data;\s+boundary=(.*)$/) { + $boundary = $1; + } + } else { + $body = $opt{'body'}; + delete $opt{'body'}; + } + &lang_setup; + + print "Content-Type: text/html; charset=$charset\r\n"; + print "w3m-control: END\r\n"; + print "w3m-control: PREV_LINK\r\n"; + 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"; + } + foreach $h (keys %opt) { + $qh = &html_quote($h); + $v = &lang_html_quote($opt{$h}); + print "
    \u$h:$v\n"; + print "\n"; + } + print "
    \n"; + print "\n"; + print "
    \n"; + print "\n"; + print "
    \n"; + print "\n"; + exit(0); +} else { + sysread(STDIN, $req, $ENV{'CONTENT_LENGTH'}); + %opt = &parse_opt($req); + if ($local_cookie ne $opt{'cookie'}) { + print "Content-Type: text/plain\r\n"; + print "\r\n"; + print "Local cookie doesn't match: It may be an illegal execution\n"; + exit 1; + } + delete $opt{'cookie'}; + $body = $opt{'body'}; + delete $opt{'body'}; + $act = $opt{'action'}; + delete $opt{'action'}; + $boundary = $opt{'boundary'}; + delete $opt{'boundary'}; + &lang_setup; + + if ($act eq "Preview") { + print "Content-Type: text/html; charset=$charset\r\n"; + print "w3m-control: DELETE_PREVBUF\r\n"; + print "w3m-control: NEXT_LINK\r\n"; + print "\r\n"; + 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) {
    +	    $qh = &html_quote($h);
    +	    $v{$h} = &lang_html_quote($opt{$h});
    +	    if ($v{$h}) {
    +		print "\u$qh: $v{$h}\n";
    +	    }
    +	}
    +	($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$/);
    +	print "
    \n"; + print "\n"; + print "
    \n"; + print "\n"; + foreach $h ('from', 'to', 'cc', 'bcc', 'subject') { + print "
    \u$h:\n"; + delete $opt{$h}; + } + if ($boundary) { + print "
    Content-Type:Content-Type: multipart/form-data; boundary=\"$boundary\"\n"; + print "\n"; + } + foreach $h (keys %opt) { + $qh = &html_quote($h); + print "
    \u$qh:$v{$h}\n"; + print "\n"; + } + print "
    \n"; + print "\n"; + print "
    \n"; + print "
    \n"; + print "\n"; + } else { +# XXX: quote? +# if ($opt{'from'}) { +# $sendmail_fromopt = '-f' . $opt{'from'}; +# } + unless (open(MAIL, "|$SENDMAIL $SENDMAIL_OPT")) { + print "Content-Type: text/html\r\n"; + print "\r\n"; + print "W3M Mailer\n"; + print "

    W3M Mailer: open sendmail failed

    \n"; + print "

    ", &html_quote($@), "

    \n"; + print "\n"; + exit(0); + } + foreach $h (keys %opt) { + $v = &lang_header($opt{$h}); + if ($v) { + print MAIL "\u$h: $v\n"; + } + } + ($cs,$cte,$body) = &lang_body($body, 1); + print MAIL "Mime-Version: 1.0\n"; + if ($boundary) { + print MAIL "Content-Type: multipart/form-data;\n"; + print MAIL " boundary=\"$boundary\"\n"; + } else { + print MAIL "Content-Type: text/plain; charset=$cs\n"; + } + print MAIL "Content-Transfer-Encoding: $cte\n"; + print MAIL "User-Agent: $ENV{'SERVER_SOFTWARE'} $prog/$id\n"; + print MAIL "\n"; + print MAIL $body; + if (close(MAIL)) { + print "w3m-control: DELETE_PREVBUF\r\n"; + print "w3m-control: BACK\r\n"; + print "\r\n"; + } else { + print "Content-Type: text/html\r\n"; + print "\r\n"; + print "W3M Mailer\n"; + print "

    W3M Mailer: close sendmail failed

    \n"; + print "

    ", &html_quote($@), "

    \n"; + print "\n"; + } + } +} + +sub lang_setup { + $lang = $ENV{'LC_ALL'} || $ENV{'LC_CTYPE'} || $ENV{'LANG'}; + if ($lang =~ /^ja/i) { + eval "use NKF;"; + if (! $@) { + $use_NKF = 1; + } else { + $use_NKF = 0; + } + $charset = "EUC-JP"; + } else { + $charset = &guess_charset($lang); + } +} + +sub lang_header { + if ($lang =~ /^ja/i) { + return &lang_header_ja(@_); + } else { + return &lang_header_default(@_); + } +} + +sub lang_body { + if ($lang =~ /^ja/i) { + return &lang_body_ja(@_); + } else { + return &lang_body_default(@_); + } +} + +sub lang_html_quote { + local($_) = @_; + if ($lang =~ /^ja/i) { + if (/[\x80-\xFF]/ || /\033[\$\(][BJ@]/) { + $_ = &conv_nkf("-e", $_); + } + } + return &html_quote($_); +} + +sub lang_header_default { + local($h) = @_; + if ($h =~ s/([=_?\x80-\xFF])/sprintf("=%02x", ord($1))/ge) { + return "=?$charset?Q?$h?="; + } else { + return $h; + } +} + +sub lang_body_default { + local($body, $_7bit) = @_; + if ($body =~ /[\x80-\xFF]/) { + if ($_7bit) { + $body =~ s/([=\x80-\xFF])/sprintf("=%02x", ord($1))/ge; + return ($charset, "quoted-printable", $body); + } else { + return ($charset, "8bit", $body); + } + } else { + return ("US-ASCII", "7bit", $body); + } +} + +sub lang_header_ja { + local($h) = @_; + if ($h =~ /[\x80-\xFF]/ || $h =~ /\033[\$\(][BJ@]/) { + $h = &conv_nkf("-j", $h); + &conv_nkf("-M", $h); + } else { + return $h; + } +} + +sub lang_body_ja { + local($body, $_7bit) = @_; + if ($body =~ /[\x80-\xFF]/ || $body =~ /\033[\$\(][BJ@]/) { + if ($_7bit) { + $body = &conv_nkf("-j", $body); + } + return ("ISO-2022-JP", "7bit", $body); + } else { + return ("US-ASCII", "7bit", $body); + } +} + +sub conv_nkf { + local(@opt) = @_; + if ($use_NKF) { + return nkf(@opt); + } + local($body) = pop(@opt); + $body =~ s/\r+\n/\n/g; + $| = 1; + pipe(R, W2); + pipe(R2, W); + if (! fork()) { + close(F); + close(R); + close(W); + open(STDIN, "<&R2"); + open(STDOUT, ">&W2"); + exec "nkf", @opt; + die; + } + close(R2); + close(W2); + print W $body; + close(W); + $body = ''; + while() { + $body .= $_; + } + close(R); + return $body; +}; + + + +sub parse_opt { + local($opt) = @_; + local(%opt) = (); + if ($opt) { + foreach $o (split('&', $opt)) { + if ($o =~ /(\w+)=(.*)/) { + $opt{"\L$1"} = &url_unquote($2); + } + } + } + return %opt; +} + +sub html_quote { + local($_) = @_; + local(%QUOTE) = ( + '<', '<', + '>', '>', + '&', '&', + '"', '"', + ); + s/[<>&"]/$QUOTE{$&}/g; + return $_; +} + +sub url_unquote { + local($_) = @_; + s/\+|%([0-9A-Fa-f][0-9A-Fa-f])/$& eq '+' ? ' ' : pack('c', hex($1))/ge; + return $_; +} + +sub guess_charset { + local(%lang_charset) = ( + 'cs', 'iso-8859-2', + 'el', 'iso-8859-7', + 'iw', 'iso-8859-8', + 'ja', 'EUC-JP', + 'ko', 'EUC-KR', + 'hu', 'iso-8859-2', + 'pl', 'iso-8859-2', + 'ro', 'iso-8859-2', + 'ru', 'iso-8859-5', + 'sk', 'iso-8859-2', + 'sl', 'iso-8859-2', + 'tr', 'iso-8859-9', + 'zh', 'GB2312', + ); + local($_) = @_; + local($lang); + + if (! s/\.(.*)$//) { + if (/^zh_tw/i) { + return 'Big5'; + } + /^(..)/; + return $lang_charset{$1} || 'iso-8859-1'; + } + $lang = $_; + $_ = $1; + if (/^euc/i) { + if (/^euc$/i) { + $lang =~ /^zh_tw/ && return 'EUC-TW'; + $lang =~ /^zh/ && return 'GB2312'; + $lang =~ /^ko/ && return 'EUC-KR'; + return 'EUC-JP'; + } + /^euccn/i && return 'GB2312'; + s/[\-_]//g; + s/^euc/EUC-/i; + tr/a-z/A-Z/; + } elsif (/^iso8859/i) { + s/[\-_]//g; + s/^iso8859/iso-8859-/i; + } + return $_; +} diff --git a/scripts/w3mman/.cvsignore b/scripts/w3mman/.cvsignore new file mode 100644 index 0000000..e867c6e --- /dev/null +++ b/scripts/w3mman/.cvsignore @@ -0,0 +1,5 @@ +w3mman +w3mman2html.cgi +w3mman.1 + +Makefile diff --git a/scripts/w3mman/Makefile.in b/scripts/w3mman/Makefile.in new file mode 100644 index 0000000..ab941c5 --- /dev/null +++ b/scripts/w3mman/Makefile.in @@ -0,0 +1,96 @@ +@SET_MAKE@ +SHELL=@SHELL@ +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ +DOMAIN = $(PACKAGE) +srcidr=@srcdir@ +top_srcdir=@top_srcdir@ +VPATH= $(srcdir):. +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +datadir = @datadir@ +libdir = @libdir@ +includedir = @includedir@ +infodir = @infodir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +top_srcdir = @top_srcdir@ +VPATH = $(top_srcdir):. +DESTDIR = + +CGIBIN_DIR = $(libexecdir)/$(PACKAGE)/cgi-bin +AUXBIN_DIR = $(libexecdir)/$(PACKAGE) +HELP_DIR = @HELP_DIR@ +RC_DIR = @RC_DIR@ +ETC_DIR = $(sysconfdir) +CONF_DIR = $(sysconfdir)/$(PACKAGE) +BIN_DIR = $(bindir) +MAN1_DIR = $(mandir)/man1 + +TARGETS = w3mman +CGIBIN_TARGETS = w3mman2html.cgi +MAN1_TARGETS = w3mman.1 +MAN_TARGETS = $(MAN1_TARGETS) + +MKDIR = mkdir -p +INSTALL = @INSTALL@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_MAN = @INSTALL_DATA@ + +all: $(TARGETS) $(CGIBIN_TARGETS) $(MAN_TARGETS) + +# do nothing +$(TARGETS) $(CGIBIN_TARGETS) $(MAN_TARGETS): + +install: $(TARGETS) $(CGIBIN_TARGETS) $(MAN_TARGETS) + -$(MKDIR) $(DESTDIR)$(BIN_DIR) + -$(MKDIR) $(DESTDIR)$(CGIBIN_DIR) + -$(MKDIR) $(DESTDIR)$(MAN1_DIR) + for file in $(TARGETS); \ + do \ + $(INSTALL_SCRIPT) $$file $(DESTDIR)$(BIN_DIR); \ + done + for file in $(CGIBIN_TARGETS); \ + do \ + $(INSTALL_SCRIPT) $$file $(DESTDIR)$(CGIBIN_DIR); \ + done + for file in $(MAN1_TARGETS); \ + do \ + $(INSTALL_MAN) $$file $(DESTDIR)$(MAN1_DIR); \ + done + +uninstall: + -for file in $(TARGETS); \ + do \ + rm -f $(BIN_DIR)/$$file; \ + done + -for file in $(CGIBIN_TARGETS); \ + do \ + rm -f $(CGIBIN_DIR)/$$file; \ + done + -for file in $(MAN1_TARGETS); \ + do \ + rm -f $(MAN1_DIR)/$$file; \ + done + +clean: + +distclean: + -rm -f $(TARGETS) $(CGIBIN_TARGETS) $(MAN_TARGETS) + -rm -f Makefile + +dist: all + @-rm -fr $(distdir)/w3mman + -$(MKDIR) $(distdir)/w3mman + cp Makefile README w3mman.in w3mman2html.cgi.in hlink.cgi w3mman.1.in $(distdir)/w3mman + ( cd $(distdir); tar -cf - w3mman | GZIP='' gzip ) \ + > $(distdir)/w3mman.tar.gz + -rm -fr $(distdir)/w3mman + diff --git a/scripts/w3mman/README b/scripts/w3mman/README new file mode 100644 index 0000000..3bcbb3b --- /dev/null +++ b/scripts/w3mman/README @@ -0,0 +1,54 @@ + +w3mman + + 他のマニュアルやヘッダファイルにリンクをはることができる + man コマンドの代替コマンドです。 + +使用法 + + w3mman + w3mman [(
    )] + w3mman [
    ] + w3mman -k + +環境変数 + + W3MMAN_W3M + 使用する w3m コマンドを指定します(デフォルトは w3m) + W3MMAN_MAN + 使用する man コマンドを指定します(デフォルトは man) + +インストール + + make install + 必要なら PERL, MAN, LIBDIR を設定してください。 + w3mman2html.cgi もインストールされます。 + +================ + +w3mman2html.cgi + +使用法 + + w3m file:///$LIB/w3mman2html.cgi + w3m file:///$LIB/w3mman2html.cgi?[(
    )] + w3m file:///$LIB/w3mman2html.cgi?man=[§ion=
    ] + w3m file:///$LIB/w3mman2html.cgi?keyword= + +インストール + + make install + 必要なら PERL, MAN, LIBDIR を設定してください。 + w3mman もインストールされます。 + +================ + +hlink.cgi + + ヘッダファイルなどにリンクを張る + +インストール + + /$LIB/ にコピー + w3mman2html.cgi で使用するならば $CGI2 に設定してください。 + diff --git a/scripts/w3mman/hlink.cgi b/scripts/w3mman/hlink.cgi new file mode 100644 index 0000000..a92ac1d --- /dev/null +++ b/scripts/w3mman/hlink.cgi @@ -0,0 +1,97 @@ +#!/usr/local/bin/perl + +$SCRIPT_NAME = $ENV{'SCRIPT_NAME'} || $0; +$CGI = "file://$SCRIPT_NAME?"; + +if ($ENV{'QUERY_STRING'}) { + $file = $ENV{'QUERY_STRING'}; +} else { + $file = $ARGV[0]; +} +$file = &cleanup($file); + +if (-d $file) { + print <$file +$_ +EOF + exit 1; +} + +$file = &html_quote($file); +($dir = $file) =~ s@[^/]*$@@; + +print <$file +
    +EOF
    +while () {
    +  $_ = &html_quote($_);
    +
    +  s/^(\#\s*include\s+)(\".*\"|\<\;.*\>\;)/$1 . &header_ref($2)/ge;
    +
    +  print;
    +}
    +close(FILE);
    +print "
    \n"; + +sub header_ref { + local($_) = @_; + local($d); + + if (s/^\"//) { + s/\"$//; + return ""$_""; + } + s/^\<\;//; + s/\>\;$//; + + for $d ( + "/usr/include", + "/usr/local/include", + "/usr/X11R6/include", + "/usr/X11/include", + "/usr/X/include", + "/usr/include/X11" + ) { + -f "$d/$_" && return "<$_>"; + } + return $_; +} + + +sub html_quote { + local($_) = @_; + local(%QUOTE) = ( + '<', '<', + '>', '>', + '&', '&', + '"', '"', + ); + s/[<>&"]/$QUOTE{$&}/g; + return $_; +} + +sub cleanup { + local($_) = @_; + + s@//+@/@g; + s@/\./@/@g; + while(m@/\.\./@) { + s@^/(\.\./)+@/@; + s@/[^/]+/\.\./@/@; + } + return $_; +} diff --git a/scripts/w3mman/w3mman.1.in b/scripts/w3mman/w3mman.1.in new file mode 100644 index 0000000..eb30237 --- /dev/null +++ b/scripts/w3mman/w3mman.1.in @@ -0,0 +1,53 @@ +.TH W3MMAN 1 "Mar 14, 2002" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +w3mman \- an interface to the on-line reference manuals by w3m(1) +.SH SYNOPSIS +.B w3mman +.RI "[-M " path ] " " [ section ] " page" +.br +.B w3mman +.RI "[-M " path "] -k " keyword +.SH DESCRIPTION +.B w3mman +is the system's manual pager by +.BR w3m (1). +.SH OPTIONS +A summary of options is included below. +.TP +.BI \-M " path" +Specify +.I path +as MANPATH. +.TP +.B \-k " keyword" +Specify +.I keyword. +.SH ENVIRONMENT +.TP +.B W3MMAN_W3M +If W3MMAN_W3M is set, its value is used instead of @W3M@. +.TP +.B W3MMAN_MAN +If W3MMAN_MAN is set, its value is used instead of @MAN@. +.SH FILES +.TP +.I @libexecdir@/@PACKAGE@/cgi-bin/w3mman2html.cgi +convert manual page to html. +.SH SEE ALSO +.BR man (1), +.BR w3m (1). +.SH AUTHOR +This manual page was written by Fumitoshi UKAI , +for the Debian GNU/Linux system (but may be used by others). diff --git a/scripts/w3mman/w3mman.in b/scripts/w3mman/w3mman.in new file mode 100644 index 0000000..6c6f65d --- /dev/null +++ b/scripts/w3mman/w3mman.in @@ -0,0 +1,41 @@ +#!@PERL@ + +@W3M = split(' ', $ENV{'W3MMAN_W3M'} || '@W3M@'); +$ENV{'W3MMAN_MAN'} ||= '@MAN@'; +$SCRIPT = 'file:///$LIB/w3mman2html.cgi'; + +sub usage { + ($_ = $0) =~ s@.*/@@; + print STDERR "$_ [-M ] [[
    ] ]\n"; + print STDERR "$_ [-M ] [-k ]\n"; + exit 1; +} + +$query = ""; +while (@ARGV) { + $_ = shift @ARGV; + if (/^-M$/) { + @ARGV || &usage(); + $ENV{'MANPATH'} = shift @ARGV; + } elsif (/^-k$/) { + @ARGV || &usage(); + $query = "?keyword=" . &form_encode(shift @ARGV); + } elsif (/^-/) { + &usage(); + } elsif (/^\d/ || $_ eq 'n') { + @ARGV || &usage(); + $query = "?quit=ok&man=" . &form_encode(shift @ARGV); + $query .= "§ion=" . &form_encode($_); + } else { + $query = "?quit=ok&man=" . &form_encode($_); + } +} + +exec @W3M, "$SCRIPT$query"; + +sub form_encode { + local($_) = @_; + s/[\000-\040\+:#?&%<>"\177-\377]/sprintf('%%%02X', unpack('C', $&))/eg; + return $_; +} + diff --git a/scripts/w3mman/w3mman2html.cgi.in b/scripts/w3mman/w3mman2html.cgi.in new file mode 100644 index 0000000..f41d487 --- /dev/null +++ b/scripts/w3mman/w3mman2html.cgi.in @@ -0,0 +1,274 @@ +#!@PERL@ + +$MAN = $ENV{'W3MMAN_MAN'} || '@MAN@'; +$QUERY = $ENV{'QUERY_STRING'} || $ARGV[0]; +$SCRIPT_NAME = $ENV{'SCRIPT_NAME'} || $0; +$CGI = "file://$SCRIPT_NAME"; +$CGI2 = "file:"; +# $CGI2 = "file:///\$LIB/hlink.cgi?"; +$SQUEEZE = 1; +$ENV{'PAGER'} = 'cat'; + +if ($QUERY =~ /\=/) { + for (split('&', $QUERY)) { + ($v, $q) = split('=', $_, 2); + $query{$v} = &form_decode($q); + } +} else { + $QUERY =~ s/^man=//; + $query{"man"} = &form_decode($QUERY); +} + +if (! $query{"man"}) { + if ($query{"keyword"}) { + $keyword = $query{"keyword"}; + $k = &html_quote($keyword); + print < +man -k $k + +

    man -k $k

    +
      +EOF + $keyword =~ s:([^-\w\200-\377.,])::g; + open(F, "$MAN -k $keyword 2> /dev/null |"); + @line = (); + while() { + chop; + $_ = &html_quote($_); + s/(\s+-.*)$//; + $title = $1; + s@(\w[\w.\-]*(\s*\,\s*\w[\w.\-]*)*)\s*(\([\dn]\w*\))@&keyword_ref($1, $3)@ge; + print "
    • $_$title\n"; + } + close(F); + print < + + +EOF + exit; + } + print < +man + + + +
      Manual: +
      Section: +
      Keyword: +
      +
      + + + +EOF + exit; +} + +$man = $query{"man"}; +if ($man =~ s/\((\w+)\)$//) { + $section = $1; + $man_section = "$man($1)"; +} elsif ($query{"section"}) { + $section = $query{"section"}; + $man_section = "$man($section)"; +} else { + $section = ""; + $man_section = "$man"; +} + +$section =~ s:([^-\w\200-\377.,])::g; +$man =~ s:([^-\w\200-\377.,])::g; +open(F, "$MAN $section $man 2> /dev/null |"); +$ok = 0; +undef $header; +$blank = -1; +$cmd = ""; +$prev = ""; +while() { + if (! defined($header)) { + /^\s*$/ && next; + $header = $_; + $space = $header; + chop $space; + $space =~ s/\S.*//; + } elsif ($_ eq $header) { # delete header + $blank = -1; + next; + } elsif (!/\010/ && /^$space[\w\200-\377].*\s\S/o) { # delete footer + $blank = -1; + next; + } + if ($SQUEEZE) { + if (/^\s*$/) { + $blank || $blank++; + next; + } elsif ($blank) { + $blank > 0 && print "\n"; + $blank = 0; + } + } + + s/\&/\&/g; + s/\/\>/g; + + s@([\200-\377].)(\010{1,2}\1)+@$1@g; + s@(\&\w+;|.)(\010\1)+@$1@g; + s@__\010{1,2}((\)?[\200-\377].(\)?)@$1@g; + s@_\010((\)?(\&\w+\;|.)(\)?)@$1@g; + s@((\)?[\200-\377].(\)?)\010{1,2}__@$1@g; + s@((\)?(\&\w+\;|.)(\)?)\010_@$1@g; + s@.\010(.)@$1@g; + + s@\\\_\\\@_@g; + s@\\_\\@_@g; + s@\\@@g; + s@\\@@g; + + if (! $ok) { + /^No/ && last; + print < +man $man_section + +
      +EOF
      +    print;
      +    $ok = 1;
      +    next;
      +  }
      +
      +  s@(http|ftp)://[\w.\-/~]+[\w/]@$&@g;
      +  s@(\W)(mailto:)?(\w[\w.\-]*\@\w[\w.\-]*\.[\w.\-]*\w)@$1$2$3@g;
      +  s@(\W)(\~?/[\w.][\w.\-/~]*)@$1 . &file_ref($2)@ge;
      +  s@(include(<\/?[bu]\>|\s)*\<)([\w.\-/]+)@$1 . &include_ref($3)@ge;
      +  if ($prev && m@^\s*(\<[bu]\>)*(\w[\w.\-]*)(\)*(\([\dm]\w*\))@) {
      +    $cmd .= "$2$4";
      +    $prev =~ s@(\w[\w.\-]*-)((\)*\s*)$@$1$2@;
      +    print $prev;
      +    $prev = '';
      +    s@^(\s*(\<[bu]\>)*)(\w[\w.\-]*)@@;
      +    print "$1$3";
      +  } elsif ($prev) {
      +    print $prev;
      +    $prev = '';
      +  }
      +  s@(\w[\w.\-]*)((\)*)(\([\dm]\w*\))@$1$2$4@g;
      +  if (m@(\w[\w.\-]*)-(\)*\s*$@) {
      +    $cmd = $1;
      +    $prev = $_;
      +    next;
      +  }
      +  print;
      +}
      +if ($prev) {
      +  print $prev;
      +}
      +close(F);
      +if (! $ok) {
      +  if ($query{'quit'}) {
      +    print STDERR "No manual entry for $man_section.\n";
      +    print <
      +man $man_section
      +
      +
      +EOF
      +  print "No manual entry for $man_section.\n";
      +}
      +print <
      +
      +
      +EOF
      +
      +sub is_command {
      +  local($_) = @_;
      +  local($p);
      +
      +  (! -d && -x) || return 0;
      +  if (! defined(%PATH)) {
      +    for $p (split(":", $ENV{'PATH'})) {
      +      $p =~ s@/+$@@;
      +      $PATH{$p} = 1;
      +    }
      +  }
      +  s@/[^/]*$@@;
      +  return defined($PATH{$_});
      +}
      +
      +sub file_ref {
      +  local($_) = @_;
      +
      +  if (&is_command($_)) {
      +    ($man = $_) =~ s@.*/@@;
      +    return "$_";
      +  }
      +  if (/^\~/ || -f || -d) {
      +    return "$_";
      +  }
      +  return $_;
      +}
      +
      +sub include_ref {
      +  local($_) = @_;
      +  local($d);
      +
      +  for $d (
      +	"/usr/include",
      +	"/usr/local/include",
      +	"/usr/X11R6/include",
      +	"/usr/X11/include",
      +	"/usr/X/include",
      +	"/usr/include/X11"
      +  ) {
      +    -f "$d/$_" && return "$_";
      +  }
      +  return $_;
      +}
      +
      +sub keyword_ref {
      +  local($_, $s) = @_;
      +  local(@a) = ();
      +
      +  for (split(/\s*,\s*/)) {
      +    push(@a, "$_");
      +  }
      +  return join(", ", @a) . $s;
      +}
      +
      +sub html_quote {
      +  local($_) = @_;
      +  local(%QUOTE) = (
      +    '<', '<',
      +    '>', '>',
      +    '&', '&',
      +    '"', '"',
      +  );
      +  s/[<>&"]/$QUOTE{$&}/g;
      +  return $_;
      +}
      +
      +sub form_decode {
      +  local($_) = @_;
      +  s/\+/ /g;
      +  s/%([\da-f][\da-f])/pack('c', hex($1))/egi;
      +  return $_;
      +}
      +
      diff --git a/scripts/xface2xbm.in b/scripts/xface2xbm.in
      new file mode 100644
      index 0000000..e69de29
      diff --git a/scripts/xface2xpm.in b/scripts/xface2xpm.in
      new file mode 100644
      index 0000000..30253cb
      --- /dev/null
      +++ b/scripts/xface2xpm.in
      @@ -0,0 +1,94 @@
      +#!@PERL@
      +
      +$USAGE = "xface2xpm [-t] [-fg ] [-bg ] []";
      +
      +# compface/uncompface
      +#   ftp://metalab.unc.edu/pub/Linux/apps/graphics/convert/
      +$UNCOMPFACE = "uncompface";
      +
      +$T = "c";
      +$BG = "white";
      +$FG = "black";
      +while (@ARGV) {
      +	$_ = shift @ARGV;
      +	if (/^-h/) {
      +		&usage(0);
      +	} elsif (/^-t/) {
      +		$T = "s";
      +		$BG = "none";
      +	} elsif (/^-bg/) {
      +		@ARGV || &usage(1);
      +		$BG = shift @ARGV;
      +	} elsif (/^-fg/) {
      +		@ARGV || &usage(1);
      +		$FG = shift @ARGV;
      +	} elsif (/^-./) {
      +		&usage(1);
      +	} else {
      +		unshift(@ARGV, $_);
      +		last;
      +	}
      +}
      +
      +$xf = "";
      +while(<>) {
      +#	s/^X-Face://i if ($xf eq "");
      +	$xf .= $_;
      +}
      +
      +pipe(R, W2);
      +pipe(R2, W);
      +if (! fork()) {
      +	close(R);
      +	close(W);
      +	open(STDIN, "<&R2");
      +	open(STDOUT, ">&W2");
      +	exec $UNCOMPFACE;
      +	exit 1;
      +}
      +close(R2);
      +close(W2);
      +print W $xf;
      +close(W);
      +while() {
      +	while(s/0x(..)(..)//) {
      +		push(@bm, hex($1), hex($2));
      +	}
      +}
      +close(R);
      +@bm || exit 1;
      +
      +$W = 48;
      +$H = @bm * 8 / $W;	# must be 48
      +print <> (8-$i)) & 1) ? "." : " ");
      +		}
      +	}
      +	print (@bm ? "\",\n" : "\"\n");
      +}
      +print <
      Date: Wed, 4 May 2011 16:23:02 +0900
      Subject: Adding upstream version 0.5.2
      
      ---
       scripts/Makefile.in               |  1 +
       scripts/multipart/Makefile.in     |  1 +
       scripts/w3mhelp.cgi.in            |  3 ++-
       scripts/w3mmail.cgi.in            |  3 ++-
       scripts/w3mman/Makefile.in        |  1 +
       scripts/w3mman/w3mman.1.in        | 11 +++++++--
       scripts/w3mman/w3mman.in          |  5 +++++
       scripts/w3mman/w3mman2html.cgi.in | 47 ++++++++++++++++++++++++++-------------
       8 files changed, 53 insertions(+), 19 deletions(-)
      
      (limited to 'scripts')
      
      diff --git a/scripts/Makefile.in b/scripts/Makefile.in
      index c90ab2e..7efcb24 100644
      --- a/scripts/Makefile.in
      +++ b/scripts/Makefile.in
      @@ -8,6 +8,7 @@ top_srcdir=@top_srcdir@
       VPATH= $(srcdir):.
       prefix = @prefix@
       exec_prefix = @exec_prefix@
      +datarootdir = @datarootdir@
       bindir = @bindir@
       datadir = @datadir@
       libdir = @libdir@
      diff --git a/scripts/multipart/Makefile.in b/scripts/multipart/Makefile.in
      index ad472ee..20af165 100644
      --- a/scripts/multipart/Makefile.in
      +++ b/scripts/multipart/Makefile.in
      @@ -8,6 +8,7 @@ top_srcdir=@top_srcdir@
       VPATH= $(srcdir):.
       prefix = @prefix@
       exec_prefix = @exec_prefix@
      +datarootdir = @datarootdir@
       bindir = @bindir@
       datadir = @datadir@
       libdir = @libdir@
      diff --git a/scripts/w3mhelp.cgi.in b/scripts/w3mhelp.cgi.in
      index 135b835..b2fca8f 100644
      --- a/scripts/w3mhelp.cgi.in
      +++ b/scripts/w3mhelp.cgi.in
      @@ -1,11 +1,12 @@
       #!@PERL@
      -# $Id: w3mhelp.cgi.in,v 1.28 2004/03/22 17:03:13 ukai Exp $
      +# $Id: w3mhelp.cgi.in,v 1.29 2007/05/29 11:50:24 inu Exp $
       
       if ( $^O =~ /^(ms)?(dos|win(32|nt)?)/i ) {
         $CYGPATH = 1;
       }
       
       $prefix = "@prefix@";
      +$datarootdir = "@datarootdir@";
       $helpdir = "@HELP_DIR@";
       if ($CYGPATH) {
         $helpdir = &cygwin_pathconv($helpdir);
      diff --git a/scripts/w3mmail.cgi.in b/scripts/w3mmail.cgi.in
      index 670f26c..02fabd8 100755
      --- a/scripts/w3mmail.cgi.in
      +++ b/scripts/w3mmail.cgi.in
      @@ -1,6 +1,6 @@
       #!@PERL@
       
      -$rcsid = q$Id: w3mmail.cgi.in,v 1.13 2003/09/22 21:02:29 ukai Exp $;
      +$rcsid = q$Id: w3mmail.cgi.in,v 1.14 2004/08/30 16:32:24 ukai Exp $;
       ($id = $rcsid) =~ s/^.*,v ([\d\.]*).*/$1/;
       ($prog=$0) =~ s/.*\///;
       
      @@ -180,6 +180,7 @@ if ($query =~ s/^\w+://) {
       	    }
       	}
       	($cs,$cte,$body) = &lang_body($body, 1);
      +	$body =~ s/\r//g;
       	print MAIL "Mime-Version: 1.0\n";
       	if ($boundary) {
       	    print MAIL "Content-Type: multipart/form-data;\n";
      diff --git a/scripts/w3mman/Makefile.in b/scripts/w3mman/Makefile.in
      index ab941c5..6c567c7 100644
      --- a/scripts/w3mman/Makefile.in
      +++ b/scripts/w3mman/Makefile.in
      @@ -8,6 +8,7 @@ top_srcdir=@top_srcdir@
       VPATH= $(srcdir):.
       prefix = @prefix@
       exec_prefix = @exec_prefix@
      +datarootdir = @datarootdir@
       bindir = @bindir@
       datadir = @datadir@
       libdir = @libdir@
      diff --git a/scripts/w3mman/w3mman.1.in b/scripts/w3mman/w3mman.1.in
      index eb30237..1c0361d 100644
      --- a/scripts/w3mman/w3mman.1.in
      +++ b/scripts/w3mman/w3mman.1.in
      @@ -1,4 +1,4 @@
      -.TH W3MMAN 1 "Mar 14, 2002"
      +.TH W3MMAN 1 "Nov 5, 2005"
       .\" Please adjust this date whenever revising the manpage.
       .\"
       .\" Some roff macros, for reference:
      @@ -19,6 +19,9 @@ w3mman \- an interface to the on-line reference manuals by w3m(1)
       .br
       .B w3mman
       .RI "[-M " path "] -k " keyword
      +.br
      +.B w3mman
      +.RI -l " file
       .SH DESCRIPTION
       .B w3mman
       is the system's manual pager by 
      @@ -31,9 +34,13 @@ Specify
       .I path
       as MANPATH.
       .TP
      -.B \-k " keyword"
      +.BI \-k " keyword"
       Specify 
       .I keyword.
      +.TP
      +.BI \-l " file"
      +Specify a  
      +.I file.
       .SH ENVIRONMENT
       .TP
       .B W3MMAN_W3M
      diff --git a/scripts/w3mman/w3mman.in b/scripts/w3mman/w3mman.in
      index 6c6f65d..6a27e70 100644
      --- a/scripts/w3mman/w3mman.in
      +++ b/scripts/w3mman/w3mman.in
      @@ -8,6 +8,7 @@ sub usage {
         ($_ = $0) =~ s@.*/@@;
         print STDERR "$_ [-M ] [[
      ] ]\n"; print STDERR "$_ [-M ] [-k ]\n"; + print STDERR "$_ [-l ]\n"; exit 1; } @@ -20,6 +21,10 @@ while (@ARGV) { } elsif (/^-k$/) { @ARGV || &usage(); $query = "?keyword=" . &form_encode(shift @ARGV); + } elsif (/^-l$/) { + @ARGV || &usage(); + $query = "?quit=ok&local=" . &form_encode(shift @ARGV); + $query .= "&pwd=" . &form_encode($ENV{'PWD'}); } elsif (/^-/) { &usage(); } elsif (/^\d/ || $_ eq 'n') { diff --git a/scripts/w3mman/w3mman2html.cgi.in b/scripts/w3mman/w3mman2html.cgi.in index f41d487..3cb105d 100644 --- a/scripts/w3mman/w3mman2html.cgi.in +++ b/scripts/w3mman/w3mman2html.cgi.in @@ -19,7 +19,7 @@ if ($QUERY =~ /\=/) { $query{"man"} = &form_decode($QUERY); } -if (! $query{"man"}) { +if ((! $query{"man"}) && (! $query{"local"})) { if ($query{"keyword"}) { $keyword = $query{"keyword"}; $k = &html_quote($keyword); @@ -71,21 +71,29 @@ EOF exit; } -$man = $query{"man"}; -if ($man =~ s/\((\w+)\)$//) { - $section = $1; - $man_section = "$man($1)"; -} elsif ($query{"section"}) { - $section = $query{"section"}; - $man_section = "$man($section)"; +if ($query{"local"}) { + $file = $query{"local"}; + if (! ($file =~ /^\//)) { + $file = $query{"pwd"} . '/' . $file; + } + open(F, "$MAN -l $file 2> /dev/null |"); } else { - $section = ""; - $man_section = "$man"; -} + $man = $query{"man"}; + if ($man =~ s/\((\w+)\)$//) { + $section = $1; + $man_section = "$man($1)"; + } elsif ($query{"section"}) { + $section = $query{"section"}; + $man_section = "$man($section)"; + } else { + $section = ""; + $man_section = "$man"; + } -$section =~ s:([^-\w\200-\377.,])::g; -$man =~ s:([^-\w\200-\377.,])::g; -open(F, "$MAN $section $man 2> /dev/null |"); + $section =~ s:([^-\w\200-\377.,])::g; + $man =~ s:([^-\w\200-\377.,])::g; + open(F, "$MAN $section $man 2> /dev/null |"); +} $ok = 0; undef $header; $blank = -1; @@ -176,6 +184,11 @@ if ($prev) { close(F); if (! $ok) { if ($query{'quit'}) { + if ($query{'local'}) { + print STDERR "File $file not found.\n"; + } else { + print STDERR "No manual entry for $man_section.\n"; + } print STDERR "No manual entry for $man_section.\n"; print <
       EOF
      -  print "No manual entry for $man_section.\n";
      +  if ($query{'local'}) {
      +    print "File $file not found.\n";
      +  } else {
      +    print "No manual entry for $man_section.\n";
      +  }
       }
       print <
      -- 
      cgit v1.2.3
      
      
      From 5397d09e585a1938fb64bc9c5cd5daed1959eb90 Mon Sep 17 00:00:00 2001
      From: Tatsuya Kinoshita 
      Date: Wed, 4 May 2011 16:41:45 +0900
      Subject: Adding upstream version 0.5.3
      
      ---
       scripts/CVS/Entries               | 13 +++++++++++++
       scripts/CVS/Repository            |  1 +
       scripts/CVS/Root                  |  1 +
       scripts/Makefile.in               |  1 -
       scripts/bm2menu/CVS/Entries       |  3 +++
       scripts/bm2menu/CVS/Repository    |  1 +
       scripts/bm2menu/CVS/Root          |  1 +
       scripts/multipart/CVS/Entries     |  6 ++++++
       scripts/multipart/CVS/Repository  |  1 +
       scripts/multipart/CVS/Root        |  1 +
       scripts/multipart/Makefile.in     |  1 -
       scripts/w3mman/CVS/Entries        |  8 ++++++++
       scripts/w3mman/CVS/Repository     |  1 +
       scripts/w3mman/CVS/Root           |  1 +
       scripts/w3mman/Makefile.in        |  1 -
       scripts/w3mman/w3mman2html.cgi.in |  4 ++--
       16 files changed, 40 insertions(+), 5 deletions(-)
       create mode 100644 scripts/CVS/Entries
       create mode 100644 scripts/CVS/Repository
       create mode 100644 scripts/CVS/Root
       create mode 100644 scripts/bm2menu/CVS/Entries
       create mode 100644 scripts/bm2menu/CVS/Repository
       create mode 100644 scripts/bm2menu/CVS/Root
       create mode 100644 scripts/multipart/CVS/Entries
       create mode 100644 scripts/multipart/CVS/Repository
       create mode 100644 scripts/multipart/CVS/Root
       create mode 100644 scripts/w3mman/CVS/Entries
       create mode 100644 scripts/w3mman/CVS/Repository
       create mode 100644 scripts/w3mman/CVS/Root
      
      (limited to 'scripts')
      
      diff --git a/scripts/CVS/Entries b/scripts/CVS/Entries
      new file mode 100644
      index 0000000..2d1a4e5
      --- /dev/null
      +++ b/scripts/CVS/Entries
      @@ -0,0 +1,13 @@
      +/.cvsignore/1.10/Mon Sep 22 22:53:53 2003//
      +/dirlist.cgi.in/1.7/Fri Feb  7 15:06:17 2003//
      +/w3mhelp-funcdesc.en.pl.in/1.4/Mon Mar 22 17:03:13 2004//
      +/w3mhelp-funcdesc.ja.pl.in/1.4/Mon Mar 22 17:03:13 2004//
      +/w3mhelp-funcname.pl.in/1.3/Mon Apr  7 15:19:43 2003//
      +/w3mmail.cgi.in/1.14/Mon Aug 30 16:32:24 2004//
      +/xface2xbm.in/1.3/Mon Nov 18 17:33:01 2002//
      +/xface2xpm.in/1.1/Tue Apr  9 14:45:58 2002//
      +D/bm2menu////
      +D/multipart////
      +D/w3mman////
      +/Makefile.in/1.11/Tue Jan  4 09:22:28 2011//
      +/w3mhelp.cgi.in/1.29/Tue Jan  4 09:22:28 2011//
      diff --git a/scripts/CVS/Repository b/scripts/CVS/Repository
      new file mode 100644
      index 0000000..578c817
      --- /dev/null
      +++ b/scripts/CVS/Repository
      @@ -0,0 +1 @@
      +w3m/scripts
      diff --git a/scripts/CVS/Root b/scripts/CVS/Root
      new file mode 100644
      index 0000000..121fa06
      --- /dev/null
      +++ b/scripts/CVS/Root
      @@ -0,0 +1 @@
      +:ext:inu@w3m.cvs.sourceforge.net:/cvsroot/w3m
      diff --git a/scripts/Makefile.in b/scripts/Makefile.in
      index 7efcb24..4da9ce5 100644
      --- a/scripts/Makefile.in
      +++ b/scripts/Makefile.in
      @@ -24,7 +24,6 @@ srcdir = @srcdir@
       sysconfdir = @sysconfdir@
       top_srcdir = @top_srcdir@
       VPATH = $(srcdir):.
      -DESTDIR = 
       
       CGIBIN_DIR = $(libexecdir)/$(PACKAGE)/cgi-bin
       AUXBIN_DIR = $(libexecdir)/$(PACKAGE)
      diff --git a/scripts/bm2menu/CVS/Entries b/scripts/bm2menu/CVS/Entries
      new file mode 100644
      index 0000000..448ac0a
      --- /dev/null
      +++ b/scripts/bm2menu/CVS/Entries
      @@ -0,0 +1,3 @@
      +/README/1.1/Thu Nov 15 00:32:14 2001//
      +/bm2menu.pl/1.1/Thu Nov 15 00:32:14 2001//
      +D
      diff --git a/scripts/bm2menu/CVS/Repository b/scripts/bm2menu/CVS/Repository
      new file mode 100644
      index 0000000..c3eaf83
      --- /dev/null
      +++ b/scripts/bm2menu/CVS/Repository
      @@ -0,0 +1 @@
      +w3m/scripts/bm2menu
      diff --git a/scripts/bm2menu/CVS/Root b/scripts/bm2menu/CVS/Root
      new file mode 100644
      index 0000000..121fa06
      --- /dev/null
      +++ b/scripts/bm2menu/CVS/Root
      @@ -0,0 +1 @@
      +:ext:inu@w3m.cvs.sourceforge.net:/cvsroot/w3m
      diff --git a/scripts/multipart/CVS/Entries b/scripts/multipart/CVS/Entries
      new file mode 100644
      index 0000000..b503f2a
      --- /dev/null
      +++ b/scripts/multipart/CVS/Entries
      @@ -0,0 +1,6 @@
      +/.cvsignore/1.2/Mon Sep 22 22:53:53 2003//
      +/README/1.2/Wed Nov 21 09:21:59 2001//
      +/mailcap/1.1/Thu Nov 15 00:32:14 2001//
      +/multipart.cgi.in/1.11/Tue Feb 18 15:26:39 2003//
      +/Makefile.in/1.6/Tue Jan  4 09:22:28 2011//
      +D
      diff --git a/scripts/multipart/CVS/Repository b/scripts/multipart/CVS/Repository
      new file mode 100644
      index 0000000..cb383c6
      --- /dev/null
      +++ b/scripts/multipart/CVS/Repository
      @@ -0,0 +1 @@
      +w3m/scripts/multipart
      diff --git a/scripts/multipart/CVS/Root b/scripts/multipart/CVS/Root
      new file mode 100644
      index 0000000..121fa06
      --- /dev/null
      +++ b/scripts/multipart/CVS/Root
      @@ -0,0 +1 @@
      +:ext:inu@w3m.cvs.sourceforge.net:/cvsroot/w3m
      diff --git a/scripts/multipart/Makefile.in b/scripts/multipart/Makefile.in
      index 20af165..6c7ec6f 100644
      --- a/scripts/multipart/Makefile.in
      +++ b/scripts/multipart/Makefile.in
      @@ -24,7 +24,6 @@ srcdir = @srcdir@
       sysconfdir = @sysconfdir@
       top_srcdir = @top_srcdir@
       VPATH = $(top_srcdir):.
      -DESTDIR = 
       
       CGIBIN_DIR = $(libexecdir)/$(PACKAGE)/cgi-bin
       AUXBIN_DIR = $(libexecdir)/$(PACKAGE)
      diff --git a/scripts/w3mman/CVS/Entries b/scripts/w3mman/CVS/Entries
      new file mode 100644
      index 0000000..2cc31ff
      --- /dev/null
      +++ b/scripts/w3mman/CVS/Entries
      @@ -0,0 +1,8 @@
      +/.cvsignore/1.3/Mon Sep 22 22:53:53 2003//
      +/README/1.3/Wed Dec 18 16:48:02 2002//
      +/hlink.cgi/1.1/Thu Nov 15 00:32:14 2001//
      +/w3mman.1.in/1.6/Fri Apr  7 15:33:56 2006//
      +/w3mman.in/1.5/Fri Apr  7 15:33:56 2006//
      +/Makefile.in/1.5/Tue Jan  4 09:22:28 2011//
      +/w3mman2html.cgi.in/1.9/Tue Jan  4 09:22:28 2011//
      +D
      diff --git a/scripts/w3mman/CVS/Repository b/scripts/w3mman/CVS/Repository
      new file mode 100644
      index 0000000..430e75e
      --- /dev/null
      +++ b/scripts/w3mman/CVS/Repository
      @@ -0,0 +1 @@
      +w3m/scripts/w3mman
      diff --git a/scripts/w3mman/CVS/Root b/scripts/w3mman/CVS/Root
      new file mode 100644
      index 0000000..121fa06
      --- /dev/null
      +++ b/scripts/w3mman/CVS/Root
      @@ -0,0 +1 @@
      +:ext:inu@w3m.cvs.sourceforge.net:/cvsroot/w3m
      diff --git a/scripts/w3mman/Makefile.in b/scripts/w3mman/Makefile.in
      index 6c567c7..569e2fc 100644
      --- a/scripts/w3mman/Makefile.in
      +++ b/scripts/w3mman/Makefile.in
      @@ -24,7 +24,6 @@ srcdir = @srcdir@
       sysconfdir = @sysconfdir@
       top_srcdir = @top_srcdir@
       VPATH = $(top_srcdir):.
      -DESTDIR = 
       
       CGIBIN_DIR = $(libexecdir)/$(PACKAGE)/cgi-bin
       AUXBIN_DIR = $(libexecdir)/$(PACKAGE)
      diff --git a/scripts/w3mman/w3mman2html.cgi.in b/scripts/w3mman/w3mman2html.cgi.in
      index 3cb105d..f430307 100644
      --- a/scripts/w3mman/w3mman2html.cgi.in
      +++ b/scripts/w3mman/w3mman2html.cgi.in
      @@ -76,7 +76,7 @@ if ($query{"local"}) {
         if (! ($file =~ /^\//)) {
           $file = $query{"pwd"} . '/' . $file;
         }
      -  open(F, "$MAN -l $file 2> /dev/null |");
      +  open(F, "MAN_KEEP_FORMATTING=1 $MAN -l $file 2> /dev/null |");
       } else {
         $man = $query{"man"};
         if ($man =~ s/\((\w+)\)$//) {
      @@ -92,7 +92,7 @@ if ($query{"local"}) {
       
         $section =~ s:([^-\w\200-\377.,])::g;
         $man =~ s:([^-\w\200-\377.,])::g;
      -  open(F, "$MAN $section $man 2> /dev/null |");
      +  open(F, "MAN_KEEP_FORMATTING=1 $MAN $section $man 2> /dev/null |");
       }
       $ok = 0;
       undef $header;
      -- 
      cgit v1.2.3
      
      
      From 620796f8d750bc58e1cf1327ff54aed32e302c73 Mon Sep 17 00:00:00 2001
      From: Tatsuya Kinoshita 
      Date: Tue, 22 May 2012 23:06:58 +0900
      Subject: Remove garbage files
      
      ---
       scripts/CVS/Entries              | 13 -------------
       scripts/CVS/Repository           |  1 -
       scripts/CVS/Root                 |  1 -
       scripts/bm2menu/CVS/Entries      |  3 ---
       scripts/bm2menu/CVS/Repository   |  1 -
       scripts/bm2menu/CVS/Root         |  1 -
       scripts/multipart/CVS/Entries    |  6 ------
       scripts/multipart/CVS/Repository |  1 -
       scripts/multipart/CVS/Root       |  1 -
       scripts/w3mman/CVS/Entries       |  8 --------
       scripts/w3mman/CVS/Repository    |  1 -
       scripts/w3mman/CVS/Root          |  1 -
       12 files changed, 38 deletions(-)
       delete mode 100644 scripts/CVS/Entries
       delete mode 100644 scripts/CVS/Repository
       delete mode 100644 scripts/CVS/Root
       delete mode 100644 scripts/bm2menu/CVS/Entries
       delete mode 100644 scripts/bm2menu/CVS/Repository
       delete mode 100644 scripts/bm2menu/CVS/Root
       delete mode 100644 scripts/multipart/CVS/Entries
       delete mode 100644 scripts/multipart/CVS/Repository
       delete mode 100644 scripts/multipart/CVS/Root
       delete mode 100644 scripts/w3mman/CVS/Entries
       delete mode 100644 scripts/w3mman/CVS/Repository
       delete mode 100644 scripts/w3mman/CVS/Root
      
      (limited to 'scripts')
      
      diff --git a/scripts/CVS/Entries b/scripts/CVS/Entries
      deleted file mode 100644
      index 2d1a4e5..0000000
      --- a/scripts/CVS/Entries
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -/.cvsignore/1.10/Mon Sep 22 22:53:53 2003//
      -/dirlist.cgi.in/1.7/Fri Feb  7 15:06:17 2003//
      -/w3mhelp-funcdesc.en.pl.in/1.4/Mon Mar 22 17:03:13 2004//
      -/w3mhelp-funcdesc.ja.pl.in/1.4/Mon Mar 22 17:03:13 2004//
      -/w3mhelp-funcname.pl.in/1.3/Mon Apr  7 15:19:43 2003//
      -/w3mmail.cgi.in/1.14/Mon Aug 30 16:32:24 2004//
      -/xface2xbm.in/1.3/Mon Nov 18 17:33:01 2002//
      -/xface2xpm.in/1.1/Tue Apr  9 14:45:58 2002//
      -D/bm2menu////
      -D/multipart////
      -D/w3mman////
      -/Makefile.in/1.11/Tue Jan  4 09:22:28 2011//
      -/w3mhelp.cgi.in/1.29/Tue Jan  4 09:22:28 2011//
      diff --git a/scripts/CVS/Repository b/scripts/CVS/Repository
      deleted file mode 100644
      index 578c817..0000000
      --- a/scripts/CVS/Repository
      +++ /dev/null
      @@ -1 +0,0 @@
      -w3m/scripts
      diff --git a/scripts/CVS/Root b/scripts/CVS/Root
      deleted file mode 100644
      index 121fa06..0000000
      --- a/scripts/CVS/Root
      +++ /dev/null
      @@ -1 +0,0 @@
      -:ext:inu@w3m.cvs.sourceforge.net:/cvsroot/w3m
      diff --git a/scripts/bm2menu/CVS/Entries b/scripts/bm2menu/CVS/Entries
      deleted file mode 100644
      index 448ac0a..0000000
      --- a/scripts/bm2menu/CVS/Entries
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -/README/1.1/Thu Nov 15 00:32:14 2001//
      -/bm2menu.pl/1.1/Thu Nov 15 00:32:14 2001//
      -D
      diff --git a/scripts/bm2menu/CVS/Repository b/scripts/bm2menu/CVS/Repository
      deleted file mode 100644
      index c3eaf83..0000000
      --- a/scripts/bm2menu/CVS/Repository
      +++ /dev/null
      @@ -1 +0,0 @@
      -w3m/scripts/bm2menu
      diff --git a/scripts/bm2menu/CVS/Root b/scripts/bm2menu/CVS/Root
      deleted file mode 100644
      index 121fa06..0000000
      --- a/scripts/bm2menu/CVS/Root
      +++ /dev/null
      @@ -1 +0,0 @@
      -:ext:inu@w3m.cvs.sourceforge.net:/cvsroot/w3m
      diff --git a/scripts/multipart/CVS/Entries b/scripts/multipart/CVS/Entries
      deleted file mode 100644
      index b503f2a..0000000
      --- a/scripts/multipart/CVS/Entries
      +++ /dev/null
      @@ -1,6 +0,0 @@
      -/.cvsignore/1.2/Mon Sep 22 22:53:53 2003//
      -/README/1.2/Wed Nov 21 09:21:59 2001//
      -/mailcap/1.1/Thu Nov 15 00:32:14 2001//
      -/multipart.cgi.in/1.11/Tue Feb 18 15:26:39 2003//
      -/Makefile.in/1.6/Tue Jan  4 09:22:28 2011//
      -D
      diff --git a/scripts/multipart/CVS/Repository b/scripts/multipart/CVS/Repository
      deleted file mode 100644
      index cb383c6..0000000
      --- a/scripts/multipart/CVS/Repository
      +++ /dev/null
      @@ -1 +0,0 @@
      -w3m/scripts/multipart
      diff --git a/scripts/multipart/CVS/Root b/scripts/multipart/CVS/Root
      deleted file mode 100644
      index 121fa06..0000000
      --- a/scripts/multipart/CVS/Root
      +++ /dev/null
      @@ -1 +0,0 @@
      -:ext:inu@w3m.cvs.sourceforge.net:/cvsroot/w3m
      diff --git a/scripts/w3mman/CVS/Entries b/scripts/w3mman/CVS/Entries
      deleted file mode 100644
      index 2cc31ff..0000000
      --- a/scripts/w3mman/CVS/Entries
      +++ /dev/null
      @@ -1,8 +0,0 @@
      -/.cvsignore/1.3/Mon Sep 22 22:53:53 2003//
      -/README/1.3/Wed Dec 18 16:48:02 2002//
      -/hlink.cgi/1.1/Thu Nov 15 00:32:14 2001//
      -/w3mman.1.in/1.6/Fri Apr  7 15:33:56 2006//
      -/w3mman.in/1.5/Fri Apr  7 15:33:56 2006//
      -/Makefile.in/1.5/Tue Jan  4 09:22:28 2011//
      -/w3mman2html.cgi.in/1.9/Tue Jan  4 09:22:28 2011//
      -D
      diff --git a/scripts/w3mman/CVS/Repository b/scripts/w3mman/CVS/Repository
      deleted file mode 100644
      index 430e75e..0000000
      --- a/scripts/w3mman/CVS/Repository
      +++ /dev/null
      @@ -1 +0,0 @@
      -w3m/scripts/w3mman
      diff --git a/scripts/w3mman/CVS/Root b/scripts/w3mman/CVS/Root
      deleted file mode 100644
      index 121fa06..0000000
      --- a/scripts/w3mman/CVS/Root
      +++ /dev/null
      @@ -1 +0,0 @@
      -:ext:inu@w3m.cvs.sourceforge.net:/cvsroot/w3m
      -- 
      cgit v1.2.3
      
      
      From 1d0ba25a660483da1272a31dd077ed94441e3d9f Mon Sep 17 00:00:00 2001
      From: Tatsuya Kinoshita 
      Date: Sat, 2 Jan 2021 09:20:37 +0900
      Subject: New upstream version 0.5.3+git20210102
      
      ---
       scripts/.cvsignore                |  9 ----
       scripts/Makefile.in               |  6 +--
       scripts/bm2menu/README            | 16 +++----
       scripts/multipart/.cvsignore      |  2 -
       scripts/multipart/README          | 28 +++++------
       scripts/w3mdict.cgi               | 56 ++++++++++++++++++++++
       scripts/w3mhelp-funcdesc.de.pl.in | 66 ++++++++++++++++++++++++++
       scripts/w3mhelp-funcdesc.en.pl.in | 46 +++++++++---------
       scripts/w3mhelp-funcdesc.ja.pl.in | 98 +++++++++++++++++++--------------------
       scripts/w3mhelp.cgi.in            | 69 ++++++++++++++-------------
       scripts/w3mman/.cvsignore         |  5 --
       scripts/w3mman/Makefile.in        | 18 ++++++-
       scripts/w3mman/README             | 34 +++++++-------
       scripts/w3mman/w3mman.1.in        | 46 ++++++++++++------
       scripts/w3mman/w3mman.de.1.in     | 71 ++++++++++++++++++++++++++++
       scripts/w3mman/w3mman.in          | 22 +++++----
       scripts/w3mman/w3mman2html.cgi.in | 35 ++++++++------
       17 files changed, 425 insertions(+), 202 deletions(-)
       delete mode 100644 scripts/.cvsignore
       delete mode 100644 scripts/multipart/.cvsignore
       create mode 100755 scripts/w3mdict.cgi
       create mode 100644 scripts/w3mhelp-funcdesc.de.pl.in
       delete mode 100644 scripts/w3mman/.cvsignore
       create mode 100644 scripts/w3mman/w3mman.de.1.in
      
      (limited to 'scripts')
      
      diff --git a/scripts/.cvsignore b/scripts/.cvsignore
      deleted file mode 100644
      index 67b6dc8..0000000
      --- a/scripts/.cvsignore
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -dirlist.cgi
      -w3mhelp.cgi
      -w3mmail.cgi
      -w3mhelp-funcdesc.en.pl
      -w3mhelp-funcdesc.ja.pl
      -w3mhelp-funcname.pl
      -w3mhelp-funcdesc-stamp
      -xface2xpm
      -Makefile
      diff --git a/scripts/Makefile.in b/scripts/Makefile.in
      index 4da9ce5..5beb9b0 100644
      --- a/scripts/Makefile.in
      +++ b/scripts/Makefile.in
      @@ -60,7 +60,7 @@ w3mhelp-funcname.pl: w3mhelp-funcname.pl.in ../funcname.tab $(top_srcdir)/doc/ke
       	@cat $(srcdir)/w3mhelp-funcname.pl.in >> w3mhelp-funcname.pl
       	@echo "done"
       
      -w3mhelp-funcdesc-stamp: $(top_srcdir)/doc/README.func $(top_srcdir)/doc-jp/README.func w3mhelp-funcdesc.en.pl.in w3mhelp-funcdesc.ja.pl.in
      +w3mhelp-funcdesc-stamp: $(top_srcdir)/doc/README.func $(top_srcdir)/doc-jp/README.func $(top_srcdir)/doc-de/README.func w3mhelp-funcdesc.en.pl.in w3mhelp-funcdesc.ja.pl.in w3mhelp-funcdesc.de.pl.in
       	@echo "generating w3mhelp-funcdesc*.pl..."
       	@for dirlang in $(DOCDIRS); do \
       	  dir=`expr "$$dirlang" : "\(.*\):.*"`; \
      @@ -87,7 +87,7 @@ install: $(LIB_TARGETS) $(HELP_TARGETS)
       	do      \
       		$(INSTALL_SCRIPT) $$file $(DESTDIR)$(AUXBIN_DIR);  \
       	done
      -	for file in $(LIB_TARGETS);     \
      +	for file in w3mdict.cgi $(LIB_TARGETS);     \
       	do      \
       		$(INSTALL_SCRIPT) $$file $(DESTDIR)$(CGIBIN_DIR);  \
       	done
      @@ -105,7 +105,7 @@ uninstall:
       	do      \
       		rm -f $(AUXBIN_DIR)/$$file; \
       	done
      -	-for file in $(LIB_TARGETS); \
      +	-for file in w3mdict.cgi $(LIB_TARGETS); \
       	do      \
       		rm -f $(LIB_DIR)/$$file; \
       	done
      diff --git a/scripts/bm2menu/README b/scripts/bm2menu/README
      index b44f144..cc1f89b 100644
      --- a/scripts/bm2menu/README
      +++ b/scripts/bm2menu/README
      @@ -1,21 +1,21 @@
       
       bm2menu.pl
       
      -  ブックマークファイル ~/.w3m/bookmark.html を変換して w3m の
      -  ブックマークメニューとして使える様にする。
      +  若<ゃ ~/.w3m/bookmark.html 紊 w3m 
      +  若<ャ若篏帥罕
       
      -使用法
      +篏睡羈
        
      -  ~/.w3m/bookmark.html を変換して ~/.w3m/menu に追加。 
      +  ~/.w3m/bookmark.html 紊 ~/.w3m/menu 菴遵 
       
           perl bm2menu.pl ~/.w3m/bookmark.html >> ~/.w3m/menu
       
      -  次に、~/.w3m/keymap に
      +  罨<~/.w3m/keymap 
       
           keymap  x  MENU  Bookmarks
       
      -  の様にキーの割り当てを追加します。
      +  罕若蚊綵菴遵障
       
      -  これで、キー `x' でブックマークメニューが開きます。
      -  メニューの操作は doc-jp/README.menu を読んでください。
      +  с `x' с若<ャ若障
      +  <ャ若篏 doc-jp/README.menu 茯с
           
      diff --git a/scripts/multipart/.cvsignore b/scripts/multipart/.cvsignore
      deleted file mode 100644
      index db1dff2..0000000
      --- a/scripts/multipart/.cvsignore
      +++ /dev/null
      @@ -1,2 +0,0 @@
      -multipart.cgi
      -Makefile
      diff --git a/scripts/multipart/README b/scripts/multipart/README
      index b82f585..ed1f73d 100644
      --- a/scripts/multipart/README
      +++ b/scripts/multipart/README
      @@ -1,24 +1,24 @@
       
      -Content-Type: multipart/* を扱う local-CGI
      +Content-Type: multipart/* 宴 local-CGI
       
      -  Content-Type: multipart/* なファイルを扱うための local-CGI です。
      -  主に mailx などでメールを PAGER="w3m -m" で読む場合を想定しています。
      +  Content-Type: multipart/* <ゃ宴 local-CGI с
      +  筝祉 mailx с<若 PAGER="w3m -m" ц翫喝障
       
      -インストール
      +ゃ潟鴻若
       
         * make install
      -    必要なら PERL, NKF, LIBDIR を設定してください。
      +    綽荀 PERL, NKF, LIBDIR 荐絎
       
      -  * mailcap を ~/.w3m/mailcap にマージ
      -    multipart.cgi のパスに注意
      +  * mailcap  ~/.w3m/mailcap 若
      +    multipart.cgi 鴻羈
       
      -  * w3m の Option Setting Panel で、
      -   『保存時に Content-Transfer-Encoding をデコードする』を ON
      -    添付ファイルの保存時に便利です。
      +  * w3m  Option Setting Panel с
      +   篆絖 Content-Transfer-Encoding 潟若 ON
      +    羞私<ゃ篆絖箴水с
       
      -必要なもの
      +綽荀
       
      -  * NKF モジュールまたは nkf
      -    文字コード変換や MIME ヘッダのデコードにを使ってます。
      -    気にいらなければ変えてください。
      +  * NKF ≪吾ャ若障 nkf
      +    絖潟若紊 MIME 潟若篏帥c障
      +    羂医
       
      diff --git a/scripts/w3mdict.cgi b/scripts/w3mdict.cgi
      new file mode 100755
      index 0000000..6b0e62e
      --- /dev/null
      +++ b/scripts/w3mdict.cgi
      @@ -0,0 +1,56 @@
      +#!/bin/sh
      +# w3mdict.cgi - A dictd dictionary query cgi for w3m
      +#
      +# REQUIREMENTS:
      +# + dict client software
      +# + an address of a dict server, for variable ${DICT_SERVER}
      +# + a name of a favorite database on that server, for variable
      +#   ${FAVORITE_DATABASE}
      +# OPTIONALLY:
      +# + locally install a dict server (eg. dictd) and a collection
      +#   of dict databases (eg. wordnet, aka "wn")
      +
      +DICT_SERVER="localhost"
      +FAVORITE_DATABASE="wn"
      +RETURN_MESSAGE="\n\nPress 'B' to return to the previous page."
      +printf "Content-type: text/plain\n"
      +type dict \
      +|| {
      +  # Originally, we inconsiderately failed silently ...
      +  #     printf "W3m-control: BACK\n\n"
      +  printf "\n\nERROR: dict client software not found${RETURN_MESSAGE}"
      +  exit
      +  }
      +# First, we check only our best and favorite database. This is most
      +# likely to give us a best defintion, and avoids displaying a long and
      +# cluttered page with entries from many databases.
      +dict --host "${DICT_SERVER}" \
      +     --database "${FAVORITE_DATABASE}" \
      +     "${QUERY_STRING}" 2>&1 \
      +&& {
      +  printf "${RETURN_MESSAGE}"
      +  } \
      +|| {
      +  # The initial attempt failed, so let's search ALL databases
      +  # available on the server.
      +  dict --host "${DICT_SERVER}" \
      +       "${QUERY_STRING}" 2>&1 \
      +  && {
      +    printf "${RETURN_MESSAGE}"
      +    } \
      +  || {
      +    # No defintions were found in any of the server's databases, so
      +    # let's return to the favorite database in order to retrieve its
      +    # guess of what we meant to type. Originally, for this case, we
      +    # pushed the user's default action to be entering another word for
      +    # a dict defintion, so the print command was:
      +    #     printf "W3m-control: DICT_WORD\n\n"
      +    # Now, we need only print a blank line to separate the cgi header
      +    # from the page content.
      +    printf "\n"
      +    dict --host "${DICT_SERVER}" \
      +         --database "${FAVORITE_DATABASE}" \
      +         "${QUERY_STRING}" 2>&1
      +    printf "${RETURN_MESSAGE}"
      +    }
      +  }
      diff --git a/scripts/w3mhelp-funcdesc.de.pl.in b/scripts/w3mhelp-funcdesc.de.pl.in
      new file mode 100644
      index 0000000..11539d1
      --- /dev/null
      +++ b/scripts/w3mhelp-funcdesc.de.pl.in
      @@ -0,0 +1,66 @@
      +# charset
      +$charset = 'UTF-8';
      +
      +# Buffer selection mode
      +
      +%buf_funcdesc = (
      + 'BUF:PREV', 'Gehe zum vorherigen Punkt',
      + 'BUF:NEXT', 'Gehe zum n辰chsten Punkt',
      + 'BUF:DELETE', 'L旦sche den ausgew辰hlten Eintrag',
      + 'BUF:GO', 'Gehe zum ausgew辰hlten Eintrag',
      +);
      +
      +%lineedit_funcdesc = (
      + 'LINEEDIT:FORWARD', 'Bewege Cursor vorw辰rts',
      + 'LINEEDIT:BACK', 'Bewege Cursor r端ckw辰rts',
      + 'LINEEDIT:BS',  'Vorheriges Zeichen l旦schen',
      + 'LINEEDIT:DEL', 'Aktuelles Zeichen l旦schen',
      + 'LINEEDIT:KILL_AFTER', 'L旦sche alles nach dem Cursor',
      + 'LINEEDIT:KILL_BEFORE', 'L旦sche alles vor dem Cursor',
      + 'LINEEDIT:TOP', 'Gehe zum Zeilenanfang',
      + 'LINEEDIT:BOTTOM', 'Gehe zum Zeilenende',
      + 'LINEEDIT:PREV', 'Hole den vorherigen Chronik-Eintrag',
      + 'LINEEDIT:NEXT', 'Hole den n辰chsten Chronik-Eintrag',
      + 'LINEEDIT:EDITOR', 'Bearbeite mit externem Editor',
      + 'LINEEDIT:COMPLETE', 'Versuche, den Dateinamen zu komplettieren',
      + 'LINEEDIT:ACCEPT', 'Eingabezeile annehmen',
      +);
      +
      +%menu_funcdesc = (
      + 'MENU:SELECT', 'W辰hle Eintrag aus',
      + 'MENU:CLOSE', 'Schliee Men端',
      + 'MENU:CANCEL', 'Einen Auswahlschritt zur端ck',
      + 'MENU:DOWN', 'Gehe zum n辰chsten Punkt',
      + 'MENU:UP', 'Gehe zum vorherigen Punkt',
      + 'MENU:LINE_UP', 'Scrolle einen Punkt aufw辰rts',
      + 'MENU:LINE_DOWN', 'Scrolle einen Punkt abw辰rts',
      + 'MENU:TOP', 'Gehe zum ersten Punkt',
      + 'MENU:LAST', 'Gehe zum letzten Punkt',
      + 'MENU:NEXT', 'Gehe zur n辰chsten Seite',
      + 'MENU:PREV', 'Gehe zur vorherigen Seite',
      + 'MENU:SEARCH_FORE', 'Suche vorw辰rts',
      + 'MENU:SEARCH_BACK', 'Suche r端ckw辰rts',
      + 'MENU:SEARCH_NEXT', 'Suche weitere bereinstimmung',
      + 'MENU:SEARCH_PREV', 'Suche fr端here bereinstimmung',
      + 'MENU:SUSPEND', 'Zur端ckstellen',
      +);
      +
      +%title = (
      + "Current keymap file", 'Aktuelle Datei mit Tastaturbefehlszuordnung',
      + "In-page Navigation", 'Navigation auf der Seite',
      + "Hyperlink Operations", 'Umgang mit Hyperlinks',
      + "File/Stream Operations", 'Umgang mit Dateien und Datenstr旦men',
      + "Buffer Operations", 'Umgang mit Puffern',
      + "Tab Operations", 'Umgang mit Reitern',
      + "Buffer and Tab Selection Mode", 'Puffer/Reiter-Auswahl-Modus',
      + "Bookmark Management", 'Lesezeichenverwaltung',
      + "Searches", 'Suchen',
      + "Dictionary Lookup", 'Abgleich mit W旦rterbuch',
      + "Mark Operations", 'Umgang mit Textmarken',
      + "Miscellaneous", 'Verschiedenes',
      + "User-defined key bindings", 'Benutzerdefinierte Tastaturbefehle',
      + "Input Line Editing Mode", 'Bearbeitung der Eingabezeile',
      + "Popup Menu Mode", 'Navigation in Men端s',
      +);
      +
      +1;
      diff --git a/scripts/w3mhelp-funcdesc.en.pl.in b/scripts/w3mhelp-funcdesc.en.pl.in
      index d854b59..b9f4ed8 100644
      --- a/scripts/w3mhelp-funcdesc.en.pl.in
      +++ b/scripts/w3mhelp-funcdesc.en.pl.in
      @@ -4,44 +4,44 @@ $charset = 'US-ASCII';
       # Buffer selection mode
       
       %buf_funcdesc = (
      - 'BUF:PREV', 'Select previous buffer',
      - 'BUF:NEXT', 'Select next buffer',
      - 'BUF:DELETE', 'Delete current buffer',
      - 'BUF:GO', 'Go to the selected buffer',
      + 'BUF:PREV', 'Previous item',
      + 'BUF:NEXT', 'Next item',
      + 'BUF:DELETE', 'Delete item',
      + 'BUF:GO', 'Select item',
       );
       
       %lineedit_funcdesc = (
      - 'LINEEDIT:FORWARD', 'Move cursor forward',
      - 'LINEEDIT:BACK', 'Move cursor backward',
      + 'LINEEDIT:FORWARD', 'Cursor forward',
      + 'LINEEDIT:BACK', 'Cursor backward',
        'LINEEDIT:BS',  'Delete previous character',
      - 'LINEEDIT:DEL', 'Delete current character',
      - 'LINEEDIT:KILL_AFTER', 'Kill everything after cursor',
      - 'LINEEDIT:KILL_BEFORE', 'Kill everything before cursor',
      - 'LINEEDIT:TOP', 'Move to the top of line',
      - 'LINEEDIT:BOTTOM', 'Move to the bottom of line',
      + 'LINEEDIT:DEL', 'Delete character',
      + 'LINEEDIT:KILL_AFTER', 'Delete everything after cursor',
      + 'LINEEDIT:KILL_BEFORE', 'Delete everything before cursor',
      + 'LINEEDIT:TOP', 'Cursor to the beginning of the line',
      + 'LINEEDIT:BOTTOM', 'Cursor to the end of the line',
        'LINEEDIT:PREV', 'Fetch the previous string from the history list',
        'LINEEDIT:NEXT', 'Fetch the next string from the history list',
        'LINEEDIT:EDITOR', 'Edit with external editor',
      - 'LINEEDIT:COMPLETE', 'Complete filename',
      - 'LINEEDIT:ACCEPT', 'Accept',
      + 'LINEEDIT:COMPLETE', 'Try to complete filename',
      + 'LINEEDIT:ACCEPT', 'Accept input line',
       );
       
       %menu_funcdesc = (
        'MENU:SELECT', 'Select item',
        'MENU:CLOSE', 'Close menu',
      - 'MENU:CANCEL', 'Back',
      - 'MENU:DOWN', 'Move to next item',
      - 'MENU:UP', 'Move to previous item',
      + 'MENU:CANCEL', 'One selection step backward',
      + 'MENU:DOWN', 'Move to the next item',
      + 'MENU:UP', 'Move to the previous item',
        'MENU:LINE_UP', 'Scroll up one item',
        'MENU:LINE_DOWN', 'Scroll down one item',
      - 'MENU:TOP', 'Go to top item',
      - 'MENU:LAST', 'Go to last item',
      - 'MENU:NEXT', 'Go to next page',
      - 'MENU:PREV', 'Go to previous page',
      - 'MENU:SEARCH_FORE', 'Search foreward',
      + 'MENU:TOP', 'Move to the first item',
      + 'MENU:LAST', 'Move to the final item',
      + 'MENU:NEXT', 'Go to the next page',
      + 'MENU:PREV', 'Go to the previous page',
      + 'MENU:SEARCH_FORE', 'Search forward',
        'MENU:SEARCH_BACK', 'Search backward',
      - 'MENU:SEARCH_NEXT', 'Search next regexp',
      - 'MENU:SEARCH_PREV', 'Search previous regexp',
      + 'MENU:SEARCH_NEXT', 'Search for the next match',
      + 'MENU:SEARCH_PREV', 'Search for the previous match',
        'MENU:SUSPEND', 'Suspend',
       );
       
      diff --git a/scripts/w3mhelp-funcdesc.ja.pl.in b/scripts/w3mhelp-funcdesc.ja.pl.in
      index 051c888..d3b0b6f 100644
      --- a/scripts/w3mhelp-funcdesc.ja.pl.in
      +++ b/scripts/w3mhelp-funcdesc.ja.pl.in
      @@ -1,66 +1,66 @@
       # charset
      -$charset = 'EUC-JP';
      +$charset = 'UTF-8';
       
       # Buffer selection mode
       
       %buf_funcdesc = (
      - 'BUF:PREV', '一つ上のバッファを選択',
      - 'BUF:NEXT', '一つ下のバッファを選択',
      - 'BUF:DELETE', '現在選択しているバッファを削除',
      - 'BUF:GO', '現在選択しているバッファを表示',
      + 'BUF:PREV', '筝や<御',
      + 'BUF:NEXT', '筝や<御',
      + 'BUF:DELETE', '憜御<',
      + 'BUF:GO', '憜御<茵腓',
       );
       
       %lineedit_funcdesc = (
      - 'LINEEDIT:FORWARD', 'カーソルを右へ移動',
      - 'LINEEDIT:BACK', 'カーソルを左へ移動',
      - 'LINEEDIT:BS',  '前の文字を削除',
      - 'LINEEDIT:DEL', 'カーソル位置の文字を削除',
      - 'LINEEDIT:KILL_AFTER', 'カーソルの後方を全て削除',
      - 'LINEEDIT:KILL_BEFORE', 'カーソルの前までを全て削除',
      - 'LINEEDIT:TOP', '行頭に移動',
      - 'LINEEDIT:BOTTOM', '行末へ移動',
      - 'LINEEDIT:PREV', 'ヒストリから一つ前の文字列を取り出す',
      - 'LINEEDIT:NEXT', 'ヒストリから次の文字列を取り出す',
      - 'LINEEDIT:EDITOR', '外部エディタで編集',
      - 'LINEEDIT:COMPLETE', 'ファイル名の補完',
      - 'LINEEDIT:ACCEPT', '入力終了',
      + 'LINEEDIT:FORWARD', '若純劻悟Щ',
      + 'LINEEDIT:BACK', '若純綏悟Щ',
      + 'LINEEDIT:BS',  '絖',
      + 'LINEEDIT:DEL', '若純篏臀絖',
      + 'LINEEDIT:KILL_AFTER', '若純緇鴻',
      + 'LINEEDIT:KILL_BEFORE', '若純障с',
      + 'LINEEDIT:TOP', '茵腱糸',
      + 'LINEEDIT:BOTTOM', '茵悟Щ',
      + 'LINEEDIT:PREV', '鴻筝ゅ絖冴',
      + 'LINEEDIT:NEXT', '鴻罨<絖冴',
      + 'LINEEDIT:EDITOR', '紊c帥х隈',
      + 'LINEEDIT:COMPLETE', '<ゃ茖絎',
      + 'LINEEDIT:ACCEPT', 'ュ腟篋',
       );
       
       %menu_funcdesc = (
      - 'MENU:SELECT', '項目を選択',
      - 'MENU:CLOSE', 'メニューを閉じる',
      - 'MENU:CANCEL', '戻る',
      - 'MENU:DOWN', '一つ下の項目へ',
      - 'MENU:UP', '一つ上の項目へ',
      - 'MENU:LINE_UP', '項目を下にスクロール',
      - 'MENU:LINE_DOWN', '項目を上にスクロール',
      - 'MENU:TOP', '先頭の項目へ',
      - 'MENU:LAST', '最後の項目へ',
      - 'MENU:NEXT', '次ページの項目へ',
      - 'MENU:PREV', '前ページの項目へ',
      - 'MENU:SEARCH_FORE', '項目を下に向かって検索',
      - 'MENU:SEARCH_BACK', '項目を上に向かって検索',
      - 'MENU:SEARCH_NEXT', '次の項目を検索',
      - 'MENU:SEARCH_PREV', '前の項目を検索',
      - 'MENU:SUSPEND', 'サスペンド',
      + 'MENU:SELECT', '御',
      + 'MENU:CLOSE', '<ャ若',
      + 'MENU:CANCEL', '祉',
      + 'MENU:DOWN', '筝や',
      + 'MENU:UP', '筝や',
      + 'MENU:LINE_UP', '筝鴻若',
      + 'MENU:LINE_DOWN', '筝鴻若',
      + 'MENU:TOP', '',
      + 'MENU:LAST', '緇',
      + 'MENU:NEXT', '罨<若吾',
      + 'MENU:PREV', '若吾',
      + 'MENU:SEARCH_FORE', '筝c罎膣',
      + 'MENU:SEARCH_BACK', '筝c罎膣',
      + 'MENU:SEARCH_NEXT', '罨<罎膣',
      + 'MENU:SEARCH_PREV', '罎膣',
      + 'MENU:SUSPEND', '泣鴻潟',
       );
       
       %title = (
      - "Show keymap file", 'keymap ファイルを見る',
      - "Page/Cursor motion", 'ページ/カーソル移動',
      - "Hyperlink operation", 'ハイパーリンク操作',
      - "File/Stream operation", 'ファイル/ストリーム操作',
      - "Buffer operation", 'バッファ操作',
      - "Tab operation", 'タブ操作',
      - "Buffer selection mode", 'バッファ選択モード',
      - "Bookmark operation", 'ブックマーク操作',
      - "Search", '検索',
      - "Dictionary look-up", '辞書検索',
      - "Mark operation", 'マーク操作',
      - "Miscellany", 'その他',
      - "User defined keymaps", 'ユーザ定義',
      - "Line-edit mode", '行編集モード',
      - "Popup menu", 'メニュー',
      + "Current keymap file", 'keymap <ゃ荀',
      + "In-page Navigation", '若/若純腱糸',
      + "Hyperlink Operations", 'ゃ若潟篏',
      + "File/Stream Operations", '<ゃ/鴻若篏',
      + "Buffer Operations", '≧篏',
      + "Tab Operations", '帥篏',
      + "Buffer and Tab Selection Mode", '♂御≪若',
      + "Bookmark Management", '若篏',
      + "Searches", '罎膣',
      + "Dictionary Lookup", '莨御膣',
      + "Mark Operations", '若篏',
      + "Miscellaneous", '篁',
      + "User-defined key bindings", '若九臂',
      + "Input Line Editing Mode", '茵膩≪若',
      + "Popup Menu Mode", '<ャ',
       );
       
       1;
      diff --git a/scripts/w3mhelp.cgi.in b/scripts/w3mhelp.cgi.in
      index b2fca8f..55358f8 100644
      --- a/scripts/w3mhelp.cgi.in
      +++ b/scripts/w3mhelp.cgi.in
      @@ -48,7 +48,7 @@ if (defined($ENV{'QUERY_STRING'})) {
       	}
       	# print "tlang=$tlang\n";
       	eval {require "w3mhelp-funcdesc.$tlang.pl";};
      -	if (defined(%funcdesc)) {
      +	if (%funcdesc) {
       	    $lang = $tlang;
       	}
           }
      @@ -72,22 +72,26 @@ local (%funckeydesc, $key, $fname, $desc);
       %funcname = (%funcname, %buf_funcname, %lineedit_funcname, %menu_funcname);
       
       %funcdesc = (%funcdesc, %buf_funcdesc, %lineedit_funcdesc, %menu_funcdesc);
      -while (($fname, $desc) = each %funcdesc) {
      -    $funckeydesc{$funcname{$fname}} = "$fname\n$desc\n";
      +# sort for consistent order each time this is run
      +foreach my $fname (sort keys %funcdesc) {
      +    $funckeydesc{$funcname{$fname}} = "$fname\n$funcdesc{$fname}\n";
       }
       
      -while (($key, $fname) = each %keyfunc) {
      +foreach $key (sort keys %keyfunc) {
           $keydata{$key} && next;
      -    $funckeydesc{$funcname{$fname}} .= "$key,";
      +    $funckeydesc{$funcname{$keyfunc{$key}}} .= "$key,";
       }
      -while (($key, $fname) = each %buf_keyfunc) {
      -    $funckeydesc{$funcname{$fname}} .= "$key,";
      +foreach $key (sort keys %buf_keyfunc) {
      +    $keydata{$key} && next;
      +    $funckeydesc{$funcname{$buf_keyfunc{$key}}} .= "$key,";
       }
      -while (($key, $fname) = each %lineedit_keyfunc) {
      -    $funckeydesc{$funcname{$fname}} .= "$key,";
      +foreach $key (sort keys %lineedit_keyfunc) {
      +    $keydata{$key} && next;
      +    $funckeydesc{$funcname{$lineedit_keyfunc{$key}}} .= "$key,";
       }
      -while (($key, $fname) = each %menu_keyfunc) {
      -    $funckeydesc{$funcname{$fname}} .= "$key,";
      +foreach $key (sort keys %menu_keyfunc) {
      +    $keydata{$key} && next;
      +    $funckeydesc{$funcname{$menu_keyfunc{$key}}} .= "$key,";
       }
       
       print <w3m
        (WWW-wo-Miru)  Version $version by 
      -A.ITO ********
      - ***** Key assign table ***** +A.ITO ******** HEADING @@ -112,77 +115,77 @@ $q_version = $version; $q_version =~ s/[^A-Za-z0-9_\$\.\-]/sprintf('%%%02X', ord($&))/ge; $script = "$d[2] version\n"; + print $script, $d[1], "\">[$d[2]]\n"; } } $keymap =~ s/[<>&]/$htmlesc{$&}/ge; -$head = "Show keymap file"; +$head = 'Current keymap file'; if (defined($title{$head})) { $head = $title{$head}; $head =~ s/[<>&]/$htmlesc{$&}/ge; } print "

      $head\n"; -&show_keymap("Page/Cursor motion", +&show_keymap('In-page Navigation', split(" ", "pgFore pgBack movR movL movD movU movR1 movL1 movD1 movU1 ldown1 lup1 shiftl shiftr col1L col1R linbeg linend ctrCsrH ctrCsrV goLine goLineF goLineL movRW movLW topA lastA nextA prevA movlistMn nextR nextL nextD nextU nextRD nextLU - undoPos redoPos")); + undoPos redoPos cursorTop cursorMiddle cursorBottom")); -&show_keymap("Hyperlink operation", +&show_keymap('Hyperlink Operations', split(" ", "followA tabA svA followI svI submitForm curURL peekURL peekIMG pginfo curlno chkURL chkWORD chkNMID rFrame extbrz linkbrz linkLst listMn linkMn accessKey")); -&show_keymap("File/Stream operation", +&show_keymap('File/Stream Operations', split(" ", "goURL gorURL tabURL tabrURL ldfile readsh pipesh pipeBuf")); -&show_keymap("Buffer operation", - split(" ", "backBf nextBf prevBf selMn selBuf vwSrc svSrc svBuf - editBf editScr reload reshape rdrwSc dispI stopI")); +&show_keymap('Buffer Operations', + split(" ", "backBf nextBf prevBf goHome selMn selBuf vwSrc svSrc + svBuf editBf editScr reload reshape rdrwSc dispI stopI")); -&show_keymap("Tab operation", +&show_keymap('Tab Operations', split(" ", "newT closeT nextT prevT tabMn tabR tabL")); -&show_keymap("Bookmark operation", +&show_keymap('Bookmark Management', split(" ", "ldBmark adBmark")); -&show_keymap("Search", +&show_keymap('Searches', split(" ", "srchfor srchbak srchnxt srchprv isrchfor isrchbak")); -&show_keymap("Dictionary look-up", +&show_keymap('Dictionary Lookup', split(" ", "dictword dictwordat")); -&show_keymap("Mark operation", +&show_keymap('Mark Operations', split(" ", "_mark nextMk prevMk reMark")); -&show_keymap("Miscellany", +&show_keymap('Miscellaneous', split(" ", "mainMn ldhelp ldOpt dispVer cooLst ldHist ldDL docCSet defCSet msgs msToggle wrapToggle execCmd setAlarm setOpt setEnv defKey reinit execsh susp qquitfm quitfm")); -&show_keymap_data("User defined keymaps"); +&show_keymap_data('User-defined key bindings'); print "
      \n


      \n"; -&show_keymap("Buffer selection mode", +&show_keymap('Buffer and Tab Selection Mode', split(" ", "buffer_next buffer_prev buffer_delete buffer_go")); print "
      \n
      \n"; -&show_keymap("Line-edit mode", +&show_keymap('Input Line Editing Mode', split(" ", "lineedit_forward lineedit_back lineedit_backspace lineedit_delete lineedit_kill_after lineedit_kill_before lineedit_top lineedit_bottom lineedit_prev lineedit_next @@ -190,7 +193,7 @@ print "
      \n
      \n"; print "
      \n
      \n"; -&show_keymap("Popup menu", +&show_keymap('Popup Menu Mode', split(" ", "menu_select menu_close menu_cancel menu_down menu_up menu_line_up menu_line_down menu_top menu_last menu_next menu_prev menu_search_fore menu_search_back menu_search_next diff --git a/scripts/w3mman/.cvsignore b/scripts/w3mman/.cvsignore deleted file mode 100644 index e867c6e..0000000 --- a/scripts/w3mman/.cvsignore +++ /dev/null @@ -1,5 +0,0 @@ -w3mman -w3mman2html.cgi -w3mman.1 - -Makefile diff --git a/scripts/w3mman/Makefile.in b/scripts/w3mman/Makefile.in index 569e2fc..ad1cffe 100644 --- a/scripts/w3mman/Makefile.in +++ b/scripts/w3mman/Makefile.in @@ -33,11 +33,13 @@ ETC_DIR = $(sysconfdir) CONF_DIR = $(sysconfdir)/$(PACKAGE) BIN_DIR = $(bindir) MAN1_DIR = $(mandir)/man1 +MAN1_DE_DIR = $(mandir)/de/man1 TARGETS = w3mman CGIBIN_TARGETS = w3mman2html.cgi MAN1_TARGETS = w3mman.1 -MAN_TARGETS = $(MAN1_TARGETS) +MAN1_DE_TARGETS = w3mman.de.1 +MAN_TARGETS = $(MAN1_TARGETS) $(MAN1_DE_TARGETS) MKDIR = mkdir -p INSTALL = @INSTALL@ @@ -53,6 +55,7 @@ install: $(TARGETS) $(CGIBIN_TARGETS) $(MAN_TARGETS) -$(MKDIR) $(DESTDIR)$(BIN_DIR) -$(MKDIR) $(DESTDIR)$(CGIBIN_DIR) -$(MKDIR) $(DESTDIR)$(MAN1_DIR) + -$(MKDIR) $(DESTDIR)$(MAN1_DE_DIR) for file in $(TARGETS); \ do \ $(INSTALL_SCRIPT) $$file $(DESTDIR)$(BIN_DIR); \ @@ -65,6 +68,12 @@ install: $(TARGETS) $(CGIBIN_TARGETS) $(MAN_TARGETS) do \ $(INSTALL_MAN) $$file $(DESTDIR)$(MAN1_DIR); \ done + for file in $(MAN1_DE_TARGETS); \ + do \ + $(INSTALL_MAN) $$file $(DESTDIR)$(MAN1_DE_DIR); \ + f=`echo "$$file" | sed -e 's/\.de\././'`; \ + mv $(DESTDIR)$(MAN1_DE_DIR)/$$file $(DESTDIR)$(MAN1_DE_DIR)/$$f; \ + done uninstall: -for file in $(TARGETS); \ @@ -79,6 +88,11 @@ uninstall: do \ rm -f $(MAN1_DIR)/$$file; \ done + -for file in $(MAN1_DE_TARGETS); \ + do \ + f=`echo "$$file" | sed -e 's/\.de\././'`; \ + rm -f $(MAN1_DE_DIR)/$$f; \ + done clean: @@ -89,7 +103,7 @@ distclean: dist: all @-rm -fr $(distdir)/w3mman -$(MKDIR) $(distdir)/w3mman - cp Makefile README w3mman.in w3mman2html.cgi.in hlink.cgi w3mman.1.in $(distdir)/w3mman + cp Makefile README w3mman.in w3mman2html.cgi.in hlink.cgi w3mman.1.in w3mman.de.1.in $(distdir)/w3mman ( cd $(distdir); tar -cf - w3mman | GZIP='' gzip ) \ > $(distdir)/w3mman.tar.gz -rm -fr $(distdir)/w3mman diff --git a/scripts/w3mman/README b/scripts/w3mman/README index 3bcbb3b..189e9ac 100644 --- a/scripts/w3mman/README +++ b/scripts/w3mman/README @@ -1,54 +1,54 @@ w3mman - 他のマニュアルやヘッダファイルにリンクをはることができる - man コマンドの代替コマンドです。 + 篁ャ≪<ゃ潟с + man 潟潟篁f帥潟潟с -使用法 +篏睡羈 w3mman w3mman [(
      )] w3mman [
      ] w3mman -k -環境変数 +医紊 W3MMAN_W3M - 使用する w3m コマンドを指定します(デフォルトは w3m) + 篏睡 w3m 潟潟絎障( w3m) W3MMAN_MAN - 使用する man コマンドを指定します(デフォルトは man) + 篏睡 man 潟潟絎障( man) -インストール +ゃ潟鴻若 make install - 必要なら PERL, MAN, LIBDIR を設定してください。 - w3mman2html.cgi もインストールされます。 + 綽荀 PERL, MAN, LIBDIR 荐絎 + w3mman2html.cgi ゃ潟鴻若障 ================ w3mman2html.cgi -使用法 +篏睡羈 w3m file:///$LIB/w3mman2html.cgi w3m file:///$LIB/w3mman2html.cgi?[(
      )] w3m file:///$LIB/w3mman2html.cgi?man=[§ion=
      ] w3m file:///$LIB/w3mman2html.cgi?keyword= -インストール +ゃ潟鴻若 make install - 必要なら PERL, MAN, LIBDIR を設定してください。 - w3mman もインストールされます。 + 綽荀 PERL, MAN, LIBDIR 荐絎 + w3mman ゃ潟鴻若障 ================ hlink.cgi - ヘッダファイルなどにリンクを張る + <ゃ潟綣泣 -インストール +ゃ潟鴻若 - /$LIB/ にコピー - w3mman2html.cgi で使用するならば $CGI2 に設定してください。 + /$LIB/ 潟 + w3mman2html.cgi т戎 $CGI2 荐絎 diff --git a/scripts/w3mman/w3mman.1.in b/scripts/w3mman/w3mman.1.in index 1c0361d..68e3afc 100644 --- a/scripts/w3mman/w3mman.1.in +++ b/scripts/w3mman/w3mman.1.in @@ -1,4 +1,4 @@ -.TH W3MMAN 1 "Nov 5, 2005" +.TH W3MMAN 1 "2016-07-13" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -12,36 +12,54 @@ .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME -w3mman \- an interface to the on-line reference manuals by w3m(1) +w3mman \- an interface to the on-line reference manuals via w3m(1) .SH SYNOPSIS +.\" mh 2016-07-04: "page" is an optional argument. +.\" Started without it, w3mman displays a form that allows selection +.\" of a manual page according to section, name and keyword. +.\" Therefore square brackets introduced .B w3mman -.RI "[-M " path ] " " [ section ] " page" +[ +.BI \-M " path" +] [ [ +.I section +] +.I page +] .br .B w3mman -.RI "[-M " path "] -k " keyword +[ +.BI \-M " path" +] [ +.I section +] +.BI \-k " keyword" .br .B w3mman -.RI -l " file +.BI \-l " file" +.br .SH DESCRIPTION +.\" mh 2016-07-04 text edited. This section shall deliver +.\" more information than section NAME .B w3mman -is the system's manual pager by -.BR w3m (1). +is a Perl script that uses +.BR w3m (1) +to serve as a pager for on-line reference manuals. .SH OPTIONS A summary of options is included below. .TP .BI \-M " path" -Specify +Specify .I path -as MANPATH. +as alternative MANPATH to use. .TP .BI \-k " keyword" -Specify -.I keyword. +Specify \fIkeyword\fP. .TP .BI \-l " file" -Specify a -.I file. +Specify a \fIfile\fP. .SH ENVIRONMENT +Two variables are available for debugging. .TP .B W3MMAN_W3M If W3MMAN_W3M is set, its value is used instead of @W3M@. @@ -51,7 +69,7 @@ If W3MMAN_MAN is set, its value is used instead of @MAN@. .SH FILES .TP .I @libexecdir@/@PACKAGE@/cgi-bin/w3mman2html.cgi -convert manual page to html. +manual page to HTML converter. .SH SEE ALSO .BR man (1), .BR w3m (1). diff --git a/scripts/w3mman/w3mman.de.1.in b/scripts/w3mman/w3mman.de.1.in new file mode 100644 index 0000000..d6c5a44 --- /dev/null +++ b/scripts/w3mman/w3mman.de.1.in @@ -0,0 +1,71 @@ +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH W3MMAN 1 2016\-07\-13 +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +w3mman \- eine Schnittstelle zur Anzeige von Online\-Referenzhandb端chern durch +w3m(1) +.SH SYNOPSIS +.\" mh 2016-07-04: "page" is an optional argument. +.\" Started without it, w3mman displays a form that allows selection +.\" of a manual page according to section, name and keyword. +.\" Therefore square brackets introduced +\fBw3mman\fP [ \fB\-M\fP \fIPfad\fP ] [ \fIAbschnitt\fP ] [ \fISeite\fP ] +.br +\fBw3mman\fP [\fB\-M\fP \fIPfad\fP] \fB\-k\fP \fIStichwort\fP +.br +\fBw3mman\fP \fB\-l\fP \fIDatei\fP +.br +.SH BESCHREIBUNG +.\" mh 2016-07-04 text edited. This section shall deliver +.\" more information than section NAME +\fBw3mman\fP ist ein Perl\-Skript, welches auf \fBw3m\fP(1) zur端ckgreift, um als +Betrachter f端r Online\-Referenzhandb端cher zu dienen. +.SH OPTIONEN +Es folgt eine Zusammenfassung der Optionen. +.TP +\fB\-M\fP\fI Pfad\fP +Suchpfad f端r Handbuchseiten auf \fIPfad\fP setzen +.TP +\fB\-k\fP \fIStichwort\fP +zum \fIStichwort\fP passende Handbuchseiten anzeigen +.TP +\fB\-l\fP \fIDatei\fP +die Handbuchseiten\-Datei \fIDatei\fP anzeigen +.SH UMGEBUNGSVARIABLEN +Zur Fehleranalyse stehen zwei Variablen zur Verf端gung. +.TP +\fBW3MMAN_W3M\fP +Ist W3MMAN_W3M gesetzt, wird ihr Wert anstelle von @W3M@ verwendet. +.TP +\fBW3MMAN_MAN\fP +Ist W3MMAN_MAN gesetzt, wird ihr Wert anstelle von @MAN@ verwendet. +.SH DATEIEN +.TP +\fI@libexecdir@/@PACKAGE@/cgi\-bin/w3mman2html.cgi\fP +Skript, welches Handbuchseiten in HTML konvertiert +.SH "SIEHE AUCH" +\fBman\fP(1), \fBw3m\fP(1). +.SH AUTOR +Diese Handbuchseite wurde von Fumitoshi UKAI f端r +Debian GNU / Linux geschrieben, sie kann aber auch auf anderen Systemen +verwendet werden. +Die deutsche bersetzung wurde 2016 von +.UR markus.hiereth@freenet.de +Markus Hiereth +.UE +erstellt. diff --git a/scripts/w3mman/w3mman.in b/scripts/w3mman/w3mman.in index 6a27e70..061cb1f 100644 --- a/scripts/w3mman/w3mman.in +++ b/scripts/w3mman/w3mman.in @@ -7,7 +7,7 @@ $SCRIPT = 'file:///$LIB/w3mman2html.cgi'; sub usage { ($_ = $0) =~ s@.*/@@; print STDERR "$_ [-M ] [[
      ] ]\n"; - print STDERR "$_ [-M ] [-k ]\n"; + print STDERR "$_ [-M ] [
      ] [-k ]\n"; print STDERR "$_ [-l ]\n"; exit 1; } @@ -20,19 +20,23 @@ while (@ARGV) { $ENV{'MANPATH'} = shift @ARGV; } elsif (/^-k$/) { @ARGV || &usage(); - $query = "?keyword=" . &form_encode(shift @ARGV); - } elsif (/^-l$/) { - @ARGV || &usage(); - $query = "?quit=ok&local=" . &form_encode(shift @ARGV); + if ( $query eq "" ) { $query = "?quit=ok"; } + $query .= "&keyword=" . &form_encode(shift @ARGV); + } elsif (/^-l$/ || /\//) { + if (/^-l$/) { + @ARGV || &usage(); + $_ = shift @ARGV; + } + $query = "?quit=ok&local=" . &form_encode($_); $query .= "&pwd=" . &form_encode($ENV{'PWD'}); } elsif (/^-/) { &usage(); - } elsif (/^\d/ || $_ eq 'n') { - @ARGV || &usage(); - $query = "?quit=ok&man=" . &form_encode(shift @ARGV); + } elsif (/^\d/ || $_ eq 'n' || $_ eq 'l') { + if ( $query eq "" ) { $query = "?quit=ok"; } $query .= "§ion=" . &form_encode($_); } else { - $query = "?quit=ok&man=" . &form_encode($_); + if ( $query eq "" ) { $query = "?quit=ok"; } + $query .= "&man=" . &form_encode($_); } } diff --git a/scripts/w3mman/w3mman2html.cgi.in b/scripts/w3mman/w3mman2html.cgi.in index f430307..2d326a9 100644 --- a/scripts/w3mman/w3mman2html.cgi.in +++ b/scripts/w3mman/w3mman2html.cgi.in @@ -23,18 +23,23 @@ if ((! $query{"man"}) && (! $query{"local"})) { if ($query{"keyword"}) { $keyword = $query{"keyword"}; $k = &html_quote($keyword); + if ($query{"section"}) { + $section = $query{"section"}; + $sectionopt = "-s $section "; + } else { + $sectionopt = ""; + } print < -man -k $k +man $sectionopt-k $k -

      man -k $k

      +

      man $sectionopt-k $k

        EOF $keyword =~ s:([^-\w\200-\377.,])::g; - open(F, "$MAN -k $keyword 2> /dev/null |"); - @line = (); + open(F, "$MAN $sectionopt -k $keyword 2> /dev/null |"); while() { chop; $_ = &html_quote($_); @@ -59,10 +64,10 @@ Content-Type: text/html
        -
        Manual: -
        Section: -
        Keyword: -
        +
        Manual: +
        Section: +
        Keyword: +
        @@ -76,7 +81,7 @@ if ($query{"local"}) { if (! ($file =~ /^\//)) { $file = $query{"pwd"} . '/' . $file; } - open(F, "MAN_KEEP_FORMATTING=1 $MAN -l $file 2> /dev/null |"); + open(F, "MAN_KEEP_FORMATTING=1 $MAN $file 2> /dev/null |"); } else { $man = $query{"man"}; if ($man =~ s/\((\w+)\)$//) { @@ -126,12 +131,14 @@ while() { s/\&/\&/g; s/\/\>/g; + # non ASCII UTF-8 codepoint + my $utf8="[\300-\337][\200-\277]|[\340-\357][\200-\277]{2}|[\360-\367][\200-\277]{3}|[\370-\373][\200-\277]{4}|[\374\375][\200-\277]{5}"; - s@([\200-\377].)(\010{1,2}\1)+@$1@g; + s@($utf8)(\010\1)+@$1@g; s@(\&\w+;|.)(\010\1)+@$1@g; - s@__\010{1,2}((\)?[\200-\377].(\)?)@$1@g; + s@_\010((\)?($utf8)(\)?)@$1@g; s@_\010((\)?(\&\w+\;|.)(\)?)@$1@g; - s@((\)?[\200-\377].(\)?)\010{1,2}__@$1@g; + s@((\)?($utf8)(\)?)\010_@$1@g; s@((\)?(\&\w+\;|.)(\)?)\010_@$1@g; s@.\010(.)@$1@g; @@ -156,7 +163,7 @@ EOF } s@(http|ftp)://[\w.\-/~]+[\w/]@$&@g; - s@(\W)(mailto:)?(\w[\w.\-]*\@\w[\w.\-]*\.[\w.\-]*\w)@$1$2$3@g; + s@\b(mailto:|)(\w[\w.\-]*\@\w[\w.\-]*\.[\w.\-]*\w)@$1$2@g; s@(\W)(\~?/[\w.][\w.\-/~]*)@$1 . &file_ref($2)@ge; s@(include(<\/?[bu]\>|\s)*\<)([\w.\-/]+)@$1 . &include_ref($3)@ge; if ($prev && m@^\s*(\<[bu]\>)*(\w[\w.\-]*)(\)*(\([\dm]\w*\))@) { @@ -220,7 +227,7 @@ sub is_command { local($p); (! -d && -x) || return 0; - if (! defined(%PATH)) { + if (! %PATH) { for $p (split(":", $ENV{'PATH'})) { $p =~ s@/+$@@; $PATH{$p} = 1; -- cgit v1.2.3