Namazu-devel-ja(旧)


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(mknmz.in) check prototype



>                                            千葉市中央区長洲
>                                                    藤原  誠
こういう変更をしてもいいですよね。
---
(藤原)
http://www.ki.nu/software/namazu/tutorial

===File /tmp/diff===========================================
--- scripts/mknmz.in-cvs	Sat Jul 26 14:58:34 2003
+++ scripts/mknmz.in	Sat Jul 26 22:12:43 2003
@@ -71,7 +71,7 @@
 STDOUT->autoflush(1);
 STDERR->autoflush(1);
 main();
-sub main {
+sub main () {
     my $start_time = time;
 
     init();
@@ -169,7 +169,7 @@
 #
 # FIXME: Very complicated.
 #
-sub process_file ($$$$$$) {
+sub process_file ($$$$$$$) {
     my ($cfile, $docid_count, $docid_base, $file_count, 
 	$field_indices, $fh_errorsfile, $total_files_num) = @_;
 
@@ -548,7 +548,7 @@
 }
 
 
-sub get_field_index_base (\%) {
+sub get_field_index_base ($) {
     my ($field_indices) = @_;
 
     my @keys = split('\|', $conf::SEARCH_FIELD);
@@ -566,7 +566,7 @@
     }
 }
 
-sub complete_field_info (\%$$\$\$\$) {
+sub complete_field_info ($$$$$$) {
     my ($fields, $cfile, $uri, $headings, $contref, $wsref) = @_;
 
     unless (defined($fields->{'title'})) {
@@ -647,7 +647,7 @@
 
 
 # output the field infomation into NMZ.fields.* files
-sub put_field_index (\%$) {
+sub put_field_index ($$) {
     my ($fields, $field_indices) = @_;
 
     my $aliases_regex = 
@@ -717,7 +717,7 @@
 
 
 # load a document file
-sub load_document ($$$$\%) {
+sub load_document ($$$$$) {
     my ($orig_cfile, $contref, $weighted_str, $headings, $fields)
       = @_;
     my $cfile = $$orig_cfile;
@@ -842,7 +842,7 @@
     $$textref =~ s/\r/\n/g;
 }
 
-sub prep () {
+sub prep (@) {
     my $docid_base = 0;
     my $output_dir = shift @_ ;
     my @targets = @_ ;
@@ -873,7 +873,7 @@
     return ($docid_base, $total_files_num);
 }
 
-sub save_flist(@) {
+sub save_flist (@) {
     my @flist = @_;
     return if (@flist == 0);
 
@@ -881,7 +881,7 @@
     print $fh_flist join("\n", @flist), "\n";
 }
 
-sub require_modules() {
+sub require_modules () {
     if (util::islang("ja") && $conf::NKF =~ /^module_nkf/) {
 	require NKF || die "unable to require \"NKF\"\n";
         util::dprint(_("code conversion: using NKF module\n"));
@@ -970,7 +970,7 @@
     unlink $var::NMZ{'_flist'};
 }
 
-sub make_headfoot_pages($$) {
+sub make_headfoot_pages ($$) {
     my ($docid_count, $key_count) = @_;
 
     for my $file (glob "$TEMPLATEDIR/NMZ.head*") {
@@ -986,8 +986,7 @@
 }
 
 # Parse command line options.
-sub parse_options
-{
+sub parse_options () {
     if (@ARGV == 0) {
 	show_mini_usage();
 	exit 1;
@@ -1241,7 +1240,7 @@
 }
 
 # convert a relative path into an absolute path
-sub absolute_path($$) {
+sub absolute_path ($$) {
     my ($cwd, $path) = @_;
 
     $path =~ s!^\.$!\./!;
@@ -1348,7 +1347,7 @@
     return @flist;
 }
 
-sub add_target ($\@\%) {
+sub add_target ($$$$) {
     my ($target, $flists_ref, $counts_ref) = @_;
 
     if ($target =~ /[\n\r\t]/) {
@@ -1507,7 +1506,7 @@
 #
 # Write NMZ.version file.
 #
-sub write_version() {
+sub write_version () {
     unless (-f $var::NMZ{'version'}) {
 	my $fh = util::efopen(">$var::NMZ{'version'}");
 	print $fh "Namazu-Index-Version: $NAMAZU_INDEX_VERSION\n";
@@ -1598,7 +1597,7 @@
 #
 # Concatenate $CURRENTDIR to the head of each file.
 #
-sub change_filenames ($) {
+sub change_filenames () {
     my $dir = $var::OUTPUT_DIR;
 
     for my $key (sort keys %var::NMZ) {
@@ -1658,7 +1657,7 @@
 #
 # Set target files to @flist and return with the number of regiested files.
 #
-sub set_target_files() {
+sub set_target_files (@) {
     my %rdocs;    # 'rdocs' means 'registered documents'
     my @found_files = @_;
 
@@ -1742,7 +1741,7 @@
     return (scalar @{$rdocs{'name'}}, @flist);
 }
 
-sub preupdate_registry(@) {
+sub preupdate_registry (@) {
     my (@list) = @_;
 
     my $fh_registry = util::efopen(">$var::NMZ{'_r'}");
@@ -1751,7 +1750,7 @@
     print $fh_registry &_("## deleted: ") . util::rfc822time(time()) . "\n\n";
 }
 
-sub preupdate_dateindex(@) {
+sub preupdate_dateindex (@) {
     my @mtimes = @_;
 
     # Since rewriting the entire file, it is not efficient, 
@@ -1802,7 +1801,7 @@
     }
 }
 
-sub pickup_updated_documents (\%) {
+sub pickup_updated_documents ($) {
     my ($rdocs_ref) = @_;
     my @updated_documents = ();
 
@@ -1836,7 +1835,7 @@
     return @updated_documents
 }
 
-sub load_dateindex() {
+sub load_dateindex () {
     my $fh_dateindex = util::efopen($var::NMZ{'t'});
 
     my $size = -s $var::NMZ{'t'};
@@ -1881,19 +1880,19 @@
     return [ @list ];
 }
 
-sub get_total_keys() {
+sub get_total_keys () {
     my $keys = get_status("keys");
     $keys = 0 unless defined $keys;
     return $keys;
 }
 
-sub get_total_files() {
+sub get_total_files () {
     my $files = get_status("files");
     $files = 0 unless defined $files;
     return $files;
 }
 
-sub get_status($) {
+sub get_status ($) {
     my ($key) = @_;
 
     my $fh = util::fopen($var::NMZ{'status'});
@@ -1909,19 +1908,19 @@
     return undef;
 }
 
-sub put_total_files($) {
+sub put_total_files ($) {
     my ($number) = @_;
     $number =~ tr/,//d;
     put_status("files", $number);
 }
 
-sub put_total_keys($) {
+sub put_total_keys ($) {
     my ($number) = @_;
     $number =~ tr/,//d;
     put_status("keys", $number);
 }
 
-sub put_status($$) {
+sub put_status ($$) {
     my ($key, $value) = @_;
 
     # remove NMZ.status file if the file has a previous value.
@@ -2012,7 +2011,7 @@
     print $fh_logfile $logmsg;
 }
 
-sub get_year() {
+sub get_year () {
     my $year = (localtime)[5] + 1900;
 
     return $year;
@@ -2232,7 +2231,7 @@
 #
 # Count words and do score weighting
 #
-sub wordcount_sub ($$\%) {
+sub wordcount_sub ($$$) {
     my ($text, $weight, $word_count) = @_;
 
     # Count frequencies of words in a current document.
@@ -2459,7 +2458,7 @@
     exit(1);
 }
 
-sub dump_record($$) {
+sub dump_record ($$) {
     my ($recref, $step) = @_;
     my (@data) = unpack 'w*', $$recref;
     print STDERR "dump record data to NMZ.bug.info (step: $step)...";
@@ -2472,7 +2471,7 @@
     return;
 }
 
-sub trapintr {
+sub trapintr () {
     my ($signame) = @_;
     print STDERR "Warning: signal $signame occured.\n";
 }
@@ -2494,4 +2493,3 @@
      );
 
 sub muda {}
-
============================================================