/[suikacvs]/www/tinytools/cneg.pl
Suika

Diff of /www/tinytools/cneg.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by wakaba, Mon Feb 11 12:08:19 2002 UTC revision 1.2 by wakaba, Thu Sep 4 02:09:58 2003 UTC
# Line 15  close DIR; Line 15  close DIR;
15    
16  my %type = (  my %type = (
17    txt   => {mediatype => 'text/plain',  description => 'plain-text'},    txt   => {mediatype => 'text/plain',  description => 'plain-text'},
18    '822' => {mediatype => 'message/rfc822',      description => 'IETF RFC 822'},    '822' => {mediatype => 'message/rfc822',      description => 'IETF RFC 822 Message'},
19    htm   => {mediatype => 'text/html',   description => 'HTML'},    htm   => {mediatype => 'text/html',   description => 'HTML'},
20    html  => {mediatype => 'text/html',   description => 'HTML'},    html  => {mediatype => 'text/html',   description => 'HTML'},
21    xml   => {mediatype => 'application/xml',     description => 'XML'},    xml   => {mediatype => 'application/xml',     description => 'XML'},
# Line 23  my %type = ( Line 23  my %type = (
23    pdf   => {mediatype => 'application/pdf',     description => 'PDF'},    pdf   => {mediatype => 'application/pdf',     description => 'PDF'},
24    doc   => {mediatype => 'application/msword',  description => 'Microsoft Word'},    doc   => {mediatype => 'application/msword',  description => 'Microsoft Word'},
25    xls   => {mediatype => 'application/vnd.ms-excel',    description => 'Microsoft Excel'},    xls   => {mediatype => 'application/vnd.ms-excel',    description => 'Microsoft Excel'},
26    ppt   => {mediatype => 'application/vnd-ms-powerpoint',       description => 'Microsoft PowerPoint'},    ppt   => {mediatype => 'application/vnd.ms-powerpoint',       description => 'Microsoft PowerPoint'},
27    bmp   => {mediatype => 'image/x-windows-bitmap',      description => 'Windows Bitmap'},    dvi   => {mediatype => 'application/x-dvi',   description => 'DVI'},
28    ico   => {mediatype => 'image/x-windows-icon',        description => 'Windows Icon'},    tex   => {mediatype => 'application/x-tex',   description => 'TeX'},
29      bmp   => {mediatype => 'image/x-bmp', description => 'Windows Bitmap'},
30      ico   => {mediatype => 'image/x-icon',        description => 'Windows Icon'},
31    png   => {mediatype => 'image/png',   description => 'PNG'},    png   => {mediatype => 'image/png',   description => 'PNG'},
32    mng   => {mediatype => 'video/x-mng', description => 'MNG'},    mng   => {mediatype => 'video/x-mng', description => 'MNG'},
33    jpg   => {mediatype => 'image/jpeg',  description => 'JPEG(JFIF)'},    jpg   => {mediatype => 'image/jpeg',  description => 'JPEG(JFIF)'},
# Line 33  my %type = ( Line 35  my %type = (
35    mpg   => {mediatype => 'video/mpeg',  description => 'MPEG'},    mpg   => {mediatype => 'video/mpeg',  description => 'MPEG'},
36    mpeg  => {mediatype => 'video/mpeg',  description => 'MPEG'},    mpeg  => {mediatype => 'video/mpeg',  description => 'MPEG'},
37    cwj   => {mediatype => 'application/x-claris-works',  description => 'Claris Works 4.0 (Macintosh)'},    cwj   => {mediatype => 'application/x-claris-works',  description => 'Claris Works 4.0 (Macintosh)'},
38    wav   => {mediatype => 'audio/x-wav', description => 'WAV audio'},    wav   => {mediatype => 'audio/x-wav', description => 'WAVE audio'},
39    mp3   => {mediatype => 'audio/mpeg',  description => 'MP3'},    mp3   => {mediatype => 'audio/mpeg',  description => 'MP3'},
40    pl    => {mediatype => 'application/x-perl',  description => 'Perl Script'},    pl    => {mediatype => 'application/x-perl',  description => 'Perl Script'},
41    pm    => {mediatype => 'application/x-perl',  description => 'Perl Module'},    pm    => {mediatype => 'application/x-perl',  description => 'Perl Module'},
42      rdf   => {mediatype => 'application/rdf+xml', description => 'RDF/XML'},
43      rss   => {mediatype => 'application/rdf+xml', description => 'RSS'},
44  );  );
45    
46  my %encode = (  my %encode = (
47    gz    => {description => 'GNU zip'},    gz    => {description => 'GNU zip'},
48    lzh   => {description => 'LHA'},    lzh   => {description => 'LHA'},
49    lzh   => {description => 'ZIP'},    zip   => {description => 'ZIP'},
50    sj3   => {charset => 'shift_jisx0213',        description => 'Shift_JISX0213'},    
51    sjis  => {charset => 'shift_jis',     description => 'Shift_JIS'},    sj3   => {charset => 'shift_jisx0213',description => 'Shift_JISX0213'},
52    euc   => {charset => 'euc-jp',        description => 'EUC-JP'},    sjis  => {charset => 'shift_jis',     description => 'Shift_JIS'},
53      euc   => {charset => 'euc-jp',        description => 'EUC-JP'},
54    ej3   => {charset => 'euc-jisx0213',  description => 'EUC-JISX0213'},    ej3   => {charset => 'euc-jisx0213',  description => 'EUC-JISX0213'},
55    u8    => {charset => 'utf-8', description => 'UTF-8'},    jis   => {charset => '',              description => '7bit ISO/IEC 2022'},
56      u8    => {charset => 'utf-8',         description => 'UTF-8'},
57  );  );
58    
59  my %lang = (  my %lang = (
# Line 85  for my $filea (@items) { Line 91  for my $filea (@items) {
91      $ret .= $$filea{size}.'octet'.($$filea{size} != 1? 's':'');      $ret .= $$filea{size}.'octet'.($$filea{size} != 1? 's':'');
92    } elsif ($$filea{size} < (1024*1024)) {    } elsif ($$filea{size} < (1024*1024)) {
93      my $d = sprintf('%.2f', $$filea{size}/1024);      my $d = sprintf('%.2f', $$filea{size}/1024);
94      $ret .= $d.'kilooctet'.($d != 1? 's':'');      $ret .= $d.'ko'.($d != 1? 's':'');
95    } elsif ($$filea{size} < (1024*1024*1024)) {    } elsif ($$filea{size} < (1024*1024*1024)) {
96      my $d = sprintf('%.2f', ($$filea{size}/1024)/1024);      my $d = sprintf('%.2f', ($$filea{size}/1024)/1024);
97      $ret .= $d.'Moctet'.($d != 1? 's':'');      $ret .= $d.'Mo'.($d != 1? 's':'');
98    }    }
99    $ret .= '; ';    $ret .= '; ';
100  }  }
# Line 135  cneg.pl copies to clipboard the string: Line 141  cneg.pl copies to clipboard the string:
141    
142  =head1 LICENSE  =head1 LICENSE
143    
144  Copyright 2001,2002 wakaba <wakaba@suika.fam.cx>.  Copyright 2001-2003 Wakaba <w@suika.fam.cx>.
   
     This program is free software; you can redistribute it and/or modify  
     it under the terms of the GNU General Public License as published by  
     the Free Software Foundation; either version 2 of the License, or  
     (at your option) any later version.  
   
     This program is distributed in the hope that it will be useful,  
     but WITHOUT ANY WARRANTY; without even the implied warranty of  
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
     GNU General Public License for more details.  
   
     You should have received a copy of the GNU General Public License  
     along with this program; see the file COPYING.  If not, write to  
     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,  
     Boston, MA 02111-1307, USA.  
   
 =head1 CHANGE  
145    
146  See ChangeLog.  This program is free software; you can redistribute it and/or modify
147    it under the terms of the GNU General Public License as published by
148    the Free Software Foundation; either version 2 of the License, or
149    (at your option) any later version.
150    
151    This program is distributed in the hope that it will be useful,
152    but WITHOUT ANY WARRANTY; without even the implied warranty of
153    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
154    GNU General Public License for more details.
155    
156    You should have received a copy of the GNU General Public License
157    along with this program; see the file COPYING.  If not, write to
158    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
159    Boston, MA 02111-1307, USA.
160    
161  =cut  =cut

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24