freepwing-1.5.orig/0000755000175000017500000000000011022640523013615 5ustar mhattamhattafreepwing-1.5.orig/fpwutils/0000755000175000017500000000000011022640523015472 5ustar mhattamhattafreepwing-1.5.orig/fpwutils/fpwfullchar.in0000644000175000017500000000574711022404342020351 0ustar mhattamhatta#! @PERL@ # -*- Perl -*- # Copyright (c) 2000 Motoyuki Kasahara # # 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, 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. # require 5.005; use English; use FreePWING::FullUserChar; use FreePWING::FPWUtils::FPWUtils; use Getopt::Long; # # コマンド行を解析する。 # if (!GetOptions('workdir=s' => \$work_directory)) { exit 1; } # # fpwutils を初期化する。 # initialize_fpwutils(); # # これから出力するファイルがすでにあれば、削除する。 # unlink($full_char_name_file_name); unlink($full_char_bitmap_16_file_name); unlink($full_char_bitmap_24_file_name); unlink($full_char_bitmap_30_file_name); unlink($full_char_bitmap_48_file_name); $full = FreePWING::FullUserChar->new(); foreach $file_name (@ARGV) { # # 外字の定義ファイルを開く。 # $handle = FileHandle->new(); if (!$handle->open($file_name, 'r')) { die "$PROGRAM_NAME: failed to open the file, $ERRNO: $file_name\n"; } for (;;) { # # 一行読み込む。 # $line = $handle->getline(); if (!defined($line)) { last; } $line =~ s/\r?\n?$//; # # 空行とコメント行 (`#' が先頭に来ている行) は無視する。 # next if ($line =~ /^\#/ || $line =~ /^$/); # # 読み込んだ行を引数に分解する。 # 最低 2 個 (名前と 16ドッと外字) ないとエラー。 # @line_arguments = split(/[ \t]+/, $line); if (@line_arguments <= 1) { die "$PROGRAM_NAME: malformed line, at line $NR in $file_name\n"; } # # 最初の外字エントリが来た時点で、外字の生成側ファイルを開く。 # if ($full->character_count() == 0) { # # 生成側ファイルを開く。 # @full_char_bitmap_file_names = (); push(@full_char_bitmap_file_names, $full_char_bitmap_16_file_name) if (2 <= @line_arguments); push(@full_char_bitmap_file_names, $full_char_bitmap_24_file_name) if (3 <= @line_arguments); push(@full_char_bitmap_file_names, $full_char_bitmap_30_file_name) if (4 <= @line_arguments); push(@full_char_bitmap_file_names, $full_char_bitmap_48_file_name) if (5 <= @line_arguments); if (!$full->open($full_char_name_file_name, @full_char_bitmap_file_names)) { die "$PROGRAM_NAME: " . $full->error_message() . "\n"; } } # # 読み込んだ行に記された外字を追加する。 # if (!$full->add_character(@line_arguments)) { die "$PROGRAM_NAME: " . $full->error_message() . "\n"; } } # # 外字の定義を記述したファイルを開く。 # $handle->close(); } # # 外字の生成側ファイルを閉じる。 # if (!$full->close()) { die "$PROGRAM_NAME: " . $full->error_message() . "\n"; } # # fpwutils の後始末をする。 # finalize_fpwutils(); exit 0; freepwing-1.5.orig/fpwutils/KeyWord.pm0000644000175000017500000000354311022404342017416 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 2000 Motoyuki Kasahara # # 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, 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. # # # 条件検索クラス # package FreePWING::FPWUtils::KeyWord; require 5.005; use English; use FreePWING::KeyWord; use FreePWING::FPWUtils::FPWUtils; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(FreePWING::KeyWord); # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; return $type->SUPER::new(); } # # 書式: # open() # メソッドの区分: # public インスタンスメソッド。 # 説明: # 書き込み用の見出しファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; return $self->SUPER::open($keyword_file_name); } # # 書式: # add_entry(word) # word # 単語 # heading_position # 見出しの位置 # text_position # 本文の位置 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 単語ファイルに単語を一つ追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_entry { my $self = shift; my ($word, $heading_position, $text_position) = @ARG; return $self->SUPER::add_entry($word, $heading_position, $heading_file_name, $text_position, $text_file_name); } 1; freepwing-1.5.orig/fpwutils/Copyright.pm0000644000175000017500000000337611022404342020006 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 2000 Motoyuki Kasahara # # 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, 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. # # # 本文中の著作権表示を生成するためのクラス。 # package FreePWING::FPWUtils::Copyright; require 5.005; use English; use FreePWING::Text; use FreePWING::FPWUtils::FPWUtils; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(FreePWING::Text); # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; return $type->SUPER::new(); } # # 書式: # open() # メソッドの区分: # public インスタンスメソッド。 # 説明: # 書き込み用の見出しファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; if (!$self->SUPER::open($copyright_file_name, $copyright_ref_file_name, $copyright_tag_file_name)) { return 0; } # # 外字の定義ファイルを読み込む。 # if (-f $half_char_name_file_name && !$self->set_half_user_characters_in_file($half_char_name_file_name)) { return 0; } if (-f $full_char_name_file_name && !$self->set_full_user_characters_in_file($full_char_name_file_name)) { return 0; } return 1; } 1; freepwing-1.5.orig/fpwutils/Menu.pm0000644000175000017500000000361211022404342016733 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 2000 Motoyuki Kasahara # # 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, 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. # # # 本文中のメニューを生成するためのクラス。 # package FreePWING::FPWUtils::Menu; require 5.005; use English; use FreePWING::Text; use FreePWING::FPWUtils::FPWUtils; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(FreePWING::Text); # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; return $type->SUPER::new(); } # # 書式: # open() # メソッドの区分: # public インスタンスメソッド。 # 説明: # 書き込み用の見出しファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; if (!$self->SUPER::open($menu_file_name, $menu_ref_file_name, $menu_tag_file_name)) { return 1; } # # 外字の定義ファイルを読み込む。 # if (-f $half_char_name_file_name && !$self->set_half_user_characters_in_file($half_char_name_file_name)) { return 0; } if (-f $full_char_name_file_name && !$self->set_full_user_characters_in_file($full_char_name_file_name)) { return 0; } # # 音声形式ファイルを読み込む。(satomii) # if (-f $sound_fmt_file_name && !$self->set_sounds_in_file($sound_fmt_file_name)) { return 0; } return 1; } 1; freepwing-1.5.orig/fpwutils/fpwlink.in0000644000175000017500000000666111022404342017502 0ustar mhattamhatta#! @PERL@ # -*- Perl -*- # Copyright (c) 1999, 2000 Motoyuki Kasahara # # 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, 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. # require 5.005; use English; use FreePWING::Link; use FreePWING::FPWUtils::FPWUtils; use Getopt::Long; # # コマンド行を解析する。 # if (!GetOptions('workdir=s' => \$work_directory)) { exit 1; } # # fpwutils を初期化する。 # initialize_fpwutils(); # # これから出力するファイルがすでにあれば、削除する。 # unlink($honmon_file_name); # # リンクファイルを開く。 # $link = FreePWING::Link->new(); if (!$link->open($honmon_file_name)) { die "$PROGRAM_NAME: " . $link->error_message() . "\n"; } # # 書籍管理情報エントリを追加する。 # if (-f $control_file_name && !$link->add_file($control_file_name, $control_ref_file_name)) { die "$PROGRAM_NAME: " . $link->error_message() . "\n"; } # # 本文データエントリを追加する。 # if (-f $text_file_name && !$link->add_file($text_file_name, $text_ref_file_name, $text_tag_file_name)) { die "$PROGRAM_NAME: " . $link->error_message() . "\n"; } # # メニューを追加する。 # if (-f $menu_file_name && !$link->add_file($menu_file_name, $menu_ref_file_name, $menu_tag_file_name)) { die "$PROGRAM_NAME: " . $link->error_message() . "\n"; } # # 著作権表示を追加する。 # if (-f $copyright_file_name && !$link->add_file($copyright_file_name, $copyright_ref_file_name, $copyright_tag_file_name)) { die "$PROGRAM_NAME: " . $link->error_message() . "\n"; } # # 見出しを追加する。 # if (-f $heading_file_name && !$link->add_file($heading_file_name)) { die "$PROGRAM_NAME: " . $link->error_message() . "\n"; } # # 前方一致インデックスを追加する。 # $i = 0; while (-f "$index_file_name$i") { $i++; } $i--; while (0 <= $i) { if (!$link->add_file("$index_file_name$i", "$index_ref_file_name$i")) { die "$PROGRAM_NAME: " . $link->error_message() . "\n"; } $i--; } # # 後方一致インデックスを追加する。 # $i = 0; while (-f "$endindex_file_name$i") { $i++; } $i--; while (0 <= $i) { if (!$link->add_file("$endindex_file_name$i", "$endindex_ref_file_name$i")) { die "$PROGRAM_NAME: " . $link->error_message() . "\n"; } $i--; } # # 条件検索インデックスを追加する。 # $i = 0; while (-f "$keyindex_file_name$i") { $i++; } $i--; while (0 <= $i) { if (!$link->add_file("$keyindex_file_name$i", "$keyindex_ref_file_name$i")) { die "$PROGRAM_NAME: " . $link->error_message() . "\n"; } $i--; } # # カラー図版を追加する。 # if (-f $color_graphic_file_name && !$link->add_file($color_graphic_file_name, '', $color_graphic_tag_file_name)) { die "$PROGRAM_NAME: " . $link->error_message() . "\n"; } # # 音声を追加する。 # if (-f $sound_file_name && !$link->add_file($sound_file_name, '', $sound_tag_file_name)) { die "$PROGRAM_NAME: " . $link->error_message() . "\n"; } # # リンクファイルを閉じる。 # if (!$link->close()) { die "$PROGRAM_NAME: " . $link->error_message() . "\n"; } # # fpwutils の後始末をする。 # finalize_fpwutils(); exit 0; freepwing-1.5.orig/fpwutils/FPWParser.pm0000644000175000017500000000773311022404342017650 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 1999, 2000 Motoyuki Kasahara # # 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, 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. # require 5.005; use Getopt::Long; use FreePWING::FPWUtils::Word2; use FreePWING::FPWUtils::KeyWord; use FreePWING::FPWUtils::Text; use FreePWING::FPWUtils::Menu; use FreePWING::FPWUtils::Copyright; use FreePWING::FPWUtils::Heading; use FreePWING::FPWUtils::FPWUtils; # # コマンド行を解析する。 # Getopt::Long::Configure("pass_through"); if (!GetOptions('workdir=s' => \$work_directory)) { exit 1; } # # fpwutils を初期化する。 # initialize_fpwutils(); # # これから出力するファイルがすでにあれば、削除する。 # unlink($text_file_name); unlink($text_ref_file_name); unlink($text_tag_file_name); unlink($menu_file_name); unlink($menu_ref_file_name); unlink($menu_tag_file_name); unlink($copyright_file_name); unlink($copyright_ref_file_name); unlink($copyright_tag_file_name); unlink($heading_file_name); unlink($word_file_name); unlink($endword_file_name); unlink($keyword_file_name); # # 各出力ファイルを開く。 # sub initialize_fpwparser { my %arg = @_; # # 本文 # if (defined($arg{'text'})) { ${$arg{'text'}} = FreePWING::FPWUtils::Text->new(); if (!${$arg{'text'}}->open()) { die "$0: " . ${$arg{'text'}}->error_message() . "\n"; } } # # メニュー # if (defined($arg{'menu'})) { ${$arg{'menu'}} = FreePWING::FPWUtils::Menu->new(); if (!${$arg{'menu'}}->open()) { die "$0: " . ${$arg{'menu'}}->error_message() . "\n"; } } # # 著作権表示 # if (defined($arg{'copyright'})) { ${$arg{'copyright'}} = FreePWING::FPWUtils::Copyright->new(); if (!${$arg{'copyright'}}->open()) { die "$0: " . ${arg{'copyright'}}->error_message() . "\n"; } } # # 見出し # if (defined($arg{'heading'})) { ${$arg{'heading'}} = FreePWING::FPWUtils::Heading->new(); if (!${$arg{'heading'}}->open()) { die "$0: " . ${$arg{'heading'}}->error_message() . "\n"; } } # # 単語一覧 # if (defined($arg{'word2'})) { ${$arg{'word2'}} = FreePWING::FPWUtils::Word2->new(); if (!${$arg{'word2'}}->open()) { die "$0: " . ${$arg{'word2'}}->error_message() . "\n"; } } # # 条件検索単語一覧 # if (defined($arg{'keyword'})) { ${$arg{'keyword'}} = FreePWING::FPWUtils::KeyWord->new(); if (!${$arg{'keyword'}}->open()) { die "$0: " . ${$arg{'keyword'}}->error_message() . "\n"; } } } # # 各出力ファイルを閉じる。 # sub finalize_fpwparser { my %arg = @_; # # 本文 # if (defined($arg{'text'}) && !${$arg{'text'}}->close()) { die "$0: " . ${$arg{'text'}}->error_message() . "\n"; } # # メニュー # if (defined($arg{'menu'}) && !${$arg{'menu'}}->close()) { die "$0: " . ${$arg{'menu'}}->error_message() . "\n"; } # # 著作権表示 # if (defined($arg{'copyright'}) && !${$arg{'copyright'}}->close()) { die "$0: " . ${$arg{'copyright'}}->error_message() . "\n"; } # # 見出し # if (defined($arg{'heading'}) && !${$arg{'heading'}}->close()) { die "$0: " . ${$arg{'heading'}}->error_message() . "\n"; } # # 単語一覧 # if (defined($arg{'word2'})) { if (!${$arg{'word2'}}->close()) { die "$0: " . ${$arg{'word2'}}->error_message() . "\n"; } } # # 条件検索単語一覧 # if (defined($arg{'keyword'})) { if (!${$arg{'keyword'}}->close()) { die "$0: " . ${$arg{'keyword'}}->error_message() . "\n"; } } } # # fpwutils の後始末をする。 # finalize_fpwutils(); 1; freepwing-1.5.orig/fpwutils/cphier.in0000644000175000017500000000254311022404342017275 0ustar mhattamhatta#! /bin/sh # -*- sh -*- # Copyright (c) 2000 Motoyuki Kasahara # # 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, 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. # MKDIRHIER="@pkglibexecdir@/mkdirhier" if [ $# -lt 2 ] ; then echo "$0: too few argument" 1>&2 exit 1 fi if [ $# -gt 2 ] ; then echo "$0: too many arguments" 1>&2 exit 1 fi SRCARG="`echo X$1 | sed -e 's/^X//' -e 's,//*,/,g'`" DESTARG="`echo X$2 | sed -e 's/^X//' -e 's,//*,/,g'`" if [ -f "${SRCARG}" ] ; then DESTDIR="`echo X${DESTARG} | sed -e 's/^X//' -e 's,/[^/][^/]*$,,g'`" ${MKDIRHIER} ${DESTDIR} || exit 1 cp -p ${SRCARG} ${DESTARG} || exit 1 else if [ -d "${SRCARG}" ] ; then DESTDIR="`echo X${DESTARG} | sed -e 's/^X//' -e 's,/[^/]*$,,g'`" ${MKDIRHIER} ${DESTDIR} || exit 1 tar cf - ${SRCARG} | (cd ${DESTDIR} && tar xfp -) || exit 1 else echo "$0: no such file or directory: $SRCARG" 1>&2 exit 1 fi fi exit 0 freepwing-1.5.orig/fpwutils/ColorGraphic.pm0000644000175000017500000000265611022404342020412 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 2001 Motoyuki Kasahara # # 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, 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. # # # カラー図版を生成するためのクラス。 # package FreePWING::FPWUtils::ColorGraphic; require 5.005; use English; use FreePWING::ColorGraphic; use FreePWING::FPWUtils::FPWUtils; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(FreePWING::ColorGraphic); # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; return $type->SUPER::new(); } # # 書式: # open() # メソッドの区分: # public インスタンスメソッド。 # 説明: # 書き込み用の見出しファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; if (!$self->SUPER::open($color_graphic_file_name, $color_graphic_tag_file_name)) { return 0; } return 1; } 1; freepwing-1.5.orig/fpwutils/Makefile.am0000644000175000017500000000503211022404342017523 0ustar mhattamhattapkglibexecdir = ${libexecdir}/freepwing pkgperllibdir = ${perllibdir}/FreePWING fpwperllibdir = ${pkgperllibdir}/FPWUtils bin_SCRIPTS = fpwmake pkglibexec_SCRIPTS = fpwcgraph fpwcontrol fpwfullchar fpwhalfchar fpwindex \ fpwlink fpwsort fpwsound cphier mkdirhier perl.sh pkgdata_DATA = fpwutils.mk fpwperllib_DATA = ColorGraphic.pm Copyright.pm FPWParser.pm FPWUtils.pm \ KeyWord.pm Heading.pm Menu.pm Sound.pm Text.pm Word2.pm EXTRA_DIST = $(fpwperllib_DATA) fpwmake.in fpwcgraph.in fpwcontrol.in \ fpwfullchar.in fpwhalfchar.in fpwindex.in fpwlink.in fpwsort.in \ fpwsound.in mkdirhier fpwutils.mk.in cphier.in perl.sh.in CLEANFILES = fpwmake fpwcgraph fpwcontrol fpwfullchar fpwhalfchar fpwindex \ fpwlink fpwsort fpwsound cphier perl.sh fpwutils.mk fpwmake: fpwmake.in Makefile rm -f $@ sed -e 's;\@GNUMAKE\@;$(GNUMAKE);' \ -e 's;\@pkgdatadir\@;$(pkgdatadir);' \ $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp fpwcgraph: fpwcgraph.in Makefile rm -f $@ sed -e 's;\@PERL\@;$(PERL);' $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp fpwcontrol: fpwcontrol.in Makefile rm -f $@ sed -e 's;\@PERL\@;$(PERL);' $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp fpwfullchar: fpwfullchar.in Makefile rm -f $@ sed -e 's;\@PERL\@;$(PERL);' $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp fpwhalfchar: fpwhalfchar.in Makefile rm -f $@ sed -e 's;\@PERL\@;$(PERL);' $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp fpwindex: fpwindex.in Makefile rm -f $@ sed -e 's;\@PERL\@;$(PERL);' $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp fpwlink: fpwlink.in Makefile rm -f $@ sed -e 's;\@PERL\@;$(PERL);' $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp fpwsort: fpwsort.in Makefile rm -f $@ sed -e 's;\@PERL\@;$(PERL);' $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp fpwsound: fpwsound.in Makefile rm -f $@ sed -e 's;\@PERL\@;$(PERL);' $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp fpwutils.mk: fpwutils.mk.in Makefile rm -f $@ sed -e 's;\@pkglibexecdir\@;$(pkglibexecdir);' \ -e 's;\@datadir\@;$(datadir);' \ $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 644 $@ rm -f $@.tmp cphier: cphier.in Makefile rm -f $@ sed -e 's;\@pkglibexecdir\@;$(pkglibexecdir);' \ $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp perl.sh: perl.sh.in Makefile rm -f $@ sed -e 's;\@PERL\@;$(PERL);' \ $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp freepwing-1.5.orig/fpwutils/Makefile.in0000644000175000017500000003373511022411535017551 0ustar mhattamhatta# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = fpwutils DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkglibexecdir)" \ "$(DESTDIR)$(fpwperllibdir)" "$(DESTDIR)$(pkgdatadir)" binSCRIPT_INSTALL = $(INSTALL_SCRIPT) pkglibexecSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(bin_SCRIPTS) $(pkglibexec_SCRIPTS) SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; fpwperllibDATA_INSTALL = $(INSTALL_DATA) pkgdataDATA_INSTALL = $(INSTALL_DATA) DATA = $(fpwperllib_DATA) $(pkgdata_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GNUMAKE = @GNUMAKE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SORT = @SORT@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ perllibdir = @perllibdir@ pkgdocdir = @pkgdocdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkglibexecdir = ${libexecdir}/freepwing pkgperllibdir = ${perllibdir}/FreePWING fpwperllibdir = ${pkgperllibdir}/FPWUtils bin_SCRIPTS = fpwmake pkglibexec_SCRIPTS = fpwcgraph fpwcontrol fpwfullchar fpwhalfchar fpwindex \ fpwlink fpwsort fpwsound cphier mkdirhier perl.sh pkgdata_DATA = fpwutils.mk fpwperllib_DATA = ColorGraphic.pm Copyright.pm FPWParser.pm FPWUtils.pm \ KeyWord.pm Heading.pm Menu.pm Sound.pm Text.pm Word2.pm EXTRA_DIST = $(fpwperllib_DATA) fpwmake.in fpwcgraph.in fpwcontrol.in \ fpwfullchar.in fpwhalfchar.in fpwindex.in fpwlink.in fpwsort.in \ fpwsound.in mkdirhier fpwutils.mk.in cphier.in perl.sh.in CLEANFILES = fpwmake fpwcgraph fpwcontrol fpwfullchar fpwhalfchar fpwindex \ fpwlink fpwsort fpwsound cphier perl.sh fpwutils.mk all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu fpwutils/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu fpwutils/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done install-pkglibexecSCRIPTS: $(pkglibexec_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(pkglibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibexecdir)" @list='$(pkglibexec_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(pkglibexecSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(pkglibexecdir)/$$f'"; \ $(pkglibexecSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(pkglibexecdir)/$$f"; \ else :; fi; \ done uninstall-pkglibexecSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkglibexec_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(pkglibexecdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkglibexecdir)/$$f"; \ done install-fpwperllibDATA: $(fpwperllib_DATA) @$(NORMAL_INSTALL) test -z "$(fpwperllibdir)" || $(MKDIR_P) "$(DESTDIR)$(fpwperllibdir)" @list='$(fpwperllib_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(fpwperllibDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(fpwperllibdir)/$$f'"; \ $(fpwperllibDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(fpwperllibdir)/$$f"; \ done uninstall-fpwperllibDATA: @$(NORMAL_UNINSTALL) @list='$(fpwperllib_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(fpwperllibdir)/$$f'"; \ rm -f "$(DESTDIR)$(fpwperllibdir)/$$f"; \ done install-pkgdataDATA: $(pkgdata_DATA) @$(NORMAL_INSTALL) test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" @list='$(pkgdata_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \ $(pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \ done uninstall-pkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(pkgdata_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(fpwperllibdir)" "$(DESTDIR)$(pkgdatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-fpwperllibDATA install-pkgdataDATA install-dvi: install-dvi-am install-exec-am: install-binSCRIPTS install-pkglibexecSCRIPTS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-fpwperllibDATA \ uninstall-pkgdataDATA uninstall-pkglibexecSCRIPTS .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-fpwperllibDATA install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkgdataDATA \ install-pkglibexecSCRIPTS install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-binSCRIPTS uninstall-fpwperllibDATA \ uninstall-pkgdataDATA uninstall-pkglibexecSCRIPTS fpwmake: fpwmake.in Makefile rm -f $@ sed -e 's;\@GNUMAKE\@;$(GNUMAKE);' \ -e 's;\@pkgdatadir\@;$(pkgdatadir);' \ $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp fpwcgraph: fpwcgraph.in Makefile rm -f $@ sed -e 's;\@PERL\@;$(PERL);' $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp fpwcontrol: fpwcontrol.in Makefile rm -f $@ sed -e 's;\@PERL\@;$(PERL);' $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp fpwfullchar: fpwfullchar.in Makefile rm -f $@ sed -e 's;\@PERL\@;$(PERL);' $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp fpwhalfchar: fpwhalfchar.in Makefile rm -f $@ sed -e 's;\@PERL\@;$(PERL);' $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp fpwindex: fpwindex.in Makefile rm -f $@ sed -e 's;\@PERL\@;$(PERL);' $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp fpwlink: fpwlink.in Makefile rm -f $@ sed -e 's;\@PERL\@;$(PERL);' $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp fpwsort: fpwsort.in Makefile rm -f $@ sed -e 's;\@PERL\@;$(PERL);' $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp fpwsound: fpwsound.in Makefile rm -f $@ sed -e 's;\@PERL\@;$(PERL);' $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp fpwutils.mk: fpwutils.mk.in Makefile rm -f $@ sed -e 's;\@pkglibexecdir\@;$(pkglibexecdir);' \ -e 's;\@datadir\@;$(datadir);' \ $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 644 $@ rm -f $@.tmp cphier: cphier.in Makefile rm -f $@ sed -e 's;\@pkglibexecdir\@;$(pkglibexecdir);' \ $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp perl.sh: perl.sh.in Makefile rm -f $@ sed -e 's;\@PERL\@;$(PERL);' \ $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: freepwing-1.5.orig/fpwutils/Word2.pm0000644000175000017500000000435111022404342017025 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 2000 Motoyuki Kasahara # # 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, 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. # # # 前方一致単語クラス (FreePWING::Word)、後方一致単語クラス # (FreePWING::EndWord) を同時に操作するクラス # package FreePWING::FPWUtils::Word2; require 5.005; use English; use FreePWING::Word2; use FreePWING::FPWUtils::FPWUtils; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(FreePWING::Word2); # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; return $type->SUPER::new(); } # # 書式: # open() # メソッドの区分: # public インスタンスメソッド。 # 説明: # 書き込み用の見出しファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; return $self->SUPER::open($word_file_name, $endword_file_name); } # # 書式: # add_entry(word) # word # 単語 # heading_position # 見出しの位置 # text_position # 本文の位置 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 単語ファイルに単語を一つ追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # 備考: # FreePWING 1.1 までは、このメソッドの呼び出し方は # add_entry(word, heading_position, heading_file_name, # text_position, text_file_name) # だったので、そのための互換性を残してある。 # sub add_entry { my $self = shift; my ($word, $heading_position, $text_position) = @ARG; if (@ARG == 5) { $heading_position = $ARG[1]; $text_position = $ARG[3]; } return $self->SUPER::add_entry($word, $heading_position, $heading_file_name, $text_position, $text_file_name); } 1; freepwing-1.5.orig/fpwutils/fpwsort.in0000644000175000017500000000456311022404342017533 0ustar mhattamhatta#! @PERL@ # -*- Perl -*- # Copyright (c) 1999, 2000 Motoyuki Kasahara # # 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, 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. # require 5.005; use English; use FreePWING::Sort; use FreePWING::FPWUtils::FPWUtils; use Getopt::Long; # # コマンド行を解析する。 # if (!GetOptions('workdir=s' => \$work_directory)) { exit 1; } # # 環境変数 TMPDIR を設定する。 # $ENV{'TMPDIR'} = $work_directory; # # fpwutils を初期化する。 # initialize_fpwutils(); # # これから出力するファイルがすでにあれば、削除する。 # unlink($sort_file_name); unlink($endsort_file_name); unlink($keysort_file_name); # # sort コマンドでソートを行う。 # if (-f $word_file_name) { $sort = FreePWING::Sort->new(); if (!$sort->open($sort_file_name)) { die "$PROGRAM_NAME: " . $sort->error_message() . "\n"; } if (!$sort->add_entries_in_file($word_file_name)) { die "$PROGRAM_NAME: " . $sort->error_message() . "\n"; } if (!$sort->close()) { die "$PROGRAM_NAME: " . $sort->error_message() . "\n"; } } if (-f $endword_file_name) { $endsort = FreePWING::Sort->new(); if (!$endsort->open($endsort_file_name)) { die "$PROGRAM_NAME: " . $endsort->error_message() . "\n"; } if (!$endsort->add_entries_in_file($endword_file_name)) { die "$PROGRAM_NAME: " . $endsort->error_message() . "\n"; } if (!$endsort->close()) { die "$PROGRAM_NAME: " . $endsort->error_message() . "\n"; } } if (-f $keyword_file_name) { $keysort = FreePWING::Sort->new(); if (!$keysort->open($keysort_file_name)) { die "$PROGRAM_NAME: " . $keysort->error_message() . "\n"; } if (!$keysort->add_entries_in_file($keyword_file_name)) { die "$PROGRAM_NAME: " . $keysort->error_message() . "\n"; } if (!$keysort->close()) { die "$PROGRAM_NAME: " . $keysort->error_message() . "\n"; } } # # fpwutils の後始末をする。 # finalize_fpwutils(); exit 0; freepwing-1.5.orig/fpwutils/Text.pm0000644000175000017500000000362511022404342016757 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 2000 Motoyuki Kasahara # # 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, 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. # # # 本文を収めたファイルを生成するためのクラス。 # package FreePWING::FPWUtils::Text; require 5.005; use English; use FreePWING::Text; use FreePWING::FPWUtils::FPWUtils; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(FreePWING::Text); # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; return $type->SUPER::new(); } # # 書式: # open() # メソッドの区分: # public インスタンスメソッド。 # 説明: # 書き込み用の見出しファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; if (!$self->SUPER::open($text_file_name, $text_ref_file_name, $text_tag_file_name)) { return 0; } # # 外字の定義ファイルを読み込む。 # if (-f $half_char_name_file_name && !$self->set_half_user_characters_in_file($half_char_name_file_name)) { return 0; } if (-f $full_char_name_file_name && !$self->set_full_user_characters_in_file($full_char_name_file_name)) { return 0; } # # 音声形式ファイルを読み込む。(satomii) # if (-f $sound_fmt_file_name && !$self->set_sounds_in_file($sound_fmt_file_name)) { return 0; } return 1; } 1; freepwing-1.5.orig/fpwutils/fpwhalfchar.in0000644000175000017500000000574711022404342020321 0ustar mhattamhatta#! @PERL@ # -*- Perl -*- # Copyright (c) 2000 Motoyuki Kasahara # # 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, 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. # require 5.005; use English; use FreePWING::HalfUserChar; use FreePWING::FPWUtils::FPWUtils; use Getopt::Long; # # コマンド行を解析する。 # if (!GetOptions('workdir=s' => \$work_directory)) { exit 1; } # # fpwutils を初期化する。 # initialize_fpwutils(); # # これから出力するファイルがすでにあれば、削除する。 # unlink($half_char_name_file_name); unlink($half_char_bitmap_16_file_name); unlink($half_char_bitmap_24_file_name); unlink($half_char_bitmap_30_file_name); unlink($half_char_bitmap_48_file_name); $half = FreePWING::HalfUserChar->new(); foreach $file_name (@ARGV) { # # 外字の定義ファイルを開く。 # $handle = FileHandle->new(); if (!$handle->open($file_name, 'r')) { die "$PROGRAM_NAME: failed to open the file, $ERRNO: $file_name\n"; } for (;;) { # # 一行読み込む。 # $line = $handle->getline(); if (!defined($line)) { last; } $line =~ s/\r?\n?$//; # # 空行とコメント行 (`#' が先頭に来ている行) は無視する。 # next if ($line =~ /^\#/ || $line =~ /^$/); # # 読み込んだ行を引数に分解する。 # 最低 2 個 (名前と 16ドッと外字) ないとエラー。 # @line_arguments = split(/[ \t]+/, $line); if (@line_arguments <= 1) { die "$PROGRAM_NAME: malformed line, at line $NR in $file_name\n"; } # # 最初の外字エントリが来た時点で、外字の生成側ファイルを開く。 # if ($half->character_count() == 0) { # # 生成側ファイルを開く。 # @half_char_bitmap_file_names = (); push(@half_char_bitmap_file_names, $half_char_bitmap_16_file_name) if (2 <= @line_arguments); push(@half_char_bitmap_file_names, $half_char_bitmap_24_file_name) if (3 <= @line_arguments); push(@half_char_bitmap_file_names, $half_char_bitmap_30_file_name) if (4 <= @line_arguments); push(@half_char_bitmap_file_names, $half_char_bitmap_48_file_name) if (5 <= @line_arguments); if (!$half->open($half_char_name_file_name, @half_char_bitmap_file_names)) { die "$PROGRAM_NAME: " . $half->error_message() . "\n"; } } # # 読み込んだ行に記された外字を追加する。 # if (!$half->add_character(@line_arguments)) { die "$PROGRAM_NAME: " . $half->error_message() . "\n"; } } # # 外字の定義を記述したファイルを開く。 # $handle->close(); } # # 外字の生成側ファイルを閉じる。 # if (!$half->close()) { die "$PROGRAM_NAME: " . $half->error_message() . "\n"; } # # fpwutils の後始末をする。 # finalize_fpwutils(); exit 0; freepwing-1.5.orig/fpwutils/perl.sh.in0000644000175000017500000000003511022404342017370 0ustar mhattamhatta#! /bin/sh @PERL@ ${1+"$@"} freepwing-1.5.orig/fpwutils/mkdirhier0000755000175000017500000000204711022514360017400 0ustar mhattamhatta#!/bin/sh # $XConsortium: mkdirhier.sh,v 1.7 94/03/24 15:46:34 gildea Exp $ # Courtesy of Paul Eggert newline=' ' IFS=$newline case ${1--} in -*) echo >&2 "mkdirhier: usage: mkdirhier directory ..."; exit 1 esac status= for directory do case $directory in '') echo >&2 "mkdirhier: empty directory name" status=1 continue;; *"$newline"*) echo >&2 "mkdirhier: directory name contains a newline: \`\`$directory''" status=1 continue;; ///*) prefix=/;; # See Posix 2.3 "path". //*) prefix=//;; /*) prefix=/;; -*) prefix=./;; *) prefix= esac IFS=/ set x $directory case $2 in */*) # IFS parsing is broken IFS=' ' set x `echo $directory | tr / ' '` ;; esac IFS=$newline shift while [ "$1" = "" ]; do shift done for filename do path=$prefix$filename prefix=$path/ shift test -d "$path" || { paths=$path for filename do if [ "$filename" != "." ]; then path=$path/$filename paths=$paths$newline$path fi done mkdir $paths || status=$? break } done done exit $status freepwing-1.5.orig/fpwutils/fpwindex.in0000644000175000017500000000512611022404342017647 0ustar mhattamhatta#! @PERL@ # -*- Perl -*- # Copyright (c) 1999, 2000 Motoyuki Kasahara # # 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, 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. # require 5.005; use English; use FreePWING::Index; use FreePWING::FPWUtils::FPWUtils; use Getopt::Long; # # コマンド行を解析する。 # if (!GetOptions('workdir=s' => \$work_directory)) { exit 1; } # # fpwutils を初期化する。 # initialize_fpwutils(); # # これから出力するファイルがすでにあれば、削除する。 # unlink(glob("$index_file_name*")); unlink(glob("$endindex_file_name*")); unlink(glob("$keyindex_file_name*")); unlink(glob("$index_ref_file_name*")); unlink(glob("$endindex_ref_file_name*")); unlink(glob("$keyindex_ref_file_name*")); # # 前方一致インデックスファイルを生成する。 # if (-f $sort_file_name) { $index = FreePWING::Index->new(); if (!$index->open($index_file_name, $index_ref_file_name)) { die "$PROGRAM_NAME: " . $index->error_message() . "\n"; } if (!$index->add_entries_in_file($sort_file_name)) { die "$PROGRAM_NAME: " . $index->error_message() . "\n"; } if (!$index->close()) { die "$PROGRAM_NAME: " . $index->error_message() . "\n"; } } # # 後方一致インデックスファイルを生成する。 # if (-f $endsort_file_name) { $endindex = FreePWING::Index->new(); if (!$endindex->open($endindex_file_name, $endindex_ref_file_name)) { die "$PROGRAM_NAME: " . $endindex->error_message() . "\n"; } if (!$endindex->add_entries_in_file($endsort_file_name)) { die "$PROGRAM_NAME: " . $endindex->error_message() . "\n"; } if (!$endindex->close()) { die "$PROGRAM_NAME: " . $endindex->error_message() . "\n"; } } # # 条件検索インデックスファイルを生成する。 # if (-f $keysort_file_name) { $keyindex = FreePWING::Index->new(); if (!$keyindex->open($keyindex_file_name, $keyindex_ref_file_name)) { die "$PROGRAM_NAME: " . $keyindex->error_message() . "\n"; } if (!$keyindex->add_entries_in_file($keysort_file_name)) { die "$PROGRAM_NAME: " . $keyindex->error_message() . "\n"; } if (!$keyindex->close()) { die "$PROGRAM_NAME: " . $keyindex->error_message() . "\n"; } } # # fpwutils の後始末をする。 # finalize_fpwutils(); exit 0; freepwing-1.5.orig/fpwutils/fpwcgraph.in0000644000175000017500000000453511022404342020007 0ustar mhattamhatta#! @PERL@ # -*- Perl -*- # Copyright (c) 2001 Motoyuki Kasahara # # 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, 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. # require 5.005; use English; use FreePWING::ColorGraphic; use FreePWING::FPWUtils::FPWUtils; use Getopt::Long; # # コマンド行を解析する。 # if (!GetOptions('workdir=s' => \$work_directory)) { exit 1; } # # fpwutils を初期化する。 # initialize_fpwutils(); # # これから出力するファイルがすでにあれば、削除する。 # unlink($color_graphic_file_name); unlink($color_graphic_tag_file_name); $graphic = FreePWING::ColorGraphic->new(); # # 生成側ファイルを開く。 # if (!$graphic->open($color_graphic_file_name, $color_graphic_tag_file_name)) { die "$PROGRAM_NAME: " . $graphic->error_message() . "\n"; } foreach $file_name (@ARGV) { # # カラー図版の一覧を定義したファイルを開く。 # $handle = FileHandle->new(); if (!$handle->open($file_name, 'r')) { die "$PROGRAM_NAME: failed to open the file, $ERRNO: $file_name\n"; } for (;;) { # # 一行読み込む。 # $line = $handle->getline(); if (!defined($line)) { last; } $line =~ s/\r?\n?$//; # # 空行とコメント行 (`#' が先頭に来ている行) は無視する。 # next if ($line =~ /^\#/ || $line =~ /^$/); # # 読み込んだ行を引数に分解する。 # ちょうど 2 個 (ファイル名前とタグ名) ないとエラー。 # @line_arguments = split(/[ \t]+/, $line); if (@line_arguments != 2) { die "$PROGRAM_NAME: malformed line, at line $NR in $file_name\n"; } # # 読み込んだ行に記されたカラー図版データを追加する。 # if (!$graphic->add_data(@line_arguments)) { die "$PROGRAM_NAME: " . $graphic->error_message() . "\n"; } } # # カラー図版の一覧を記述したファイルを開く。 # $handle->close(); } # # カラー図版の生成側ファイルを閉じる。 # if (!$graphic->close()) { die "$PROGRAM_NAME: " . $graphic->error_message() . "\n"; } # # fpwutils の後始末をする。 # finalize_fpwutils(); exit 0; freepwing-1.5.orig/fpwutils/fpwsound.in0000644000175000017500000000451211022404342017666 0ustar mhattamhatta#! @PERL@ # -*- Perl -*- # Copyright (c) 2000 Motoyuki Kasahara # # 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, 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. # require 5.005; use English; use FreePWING::Sound; use FreePWING::FPWUtils::FPWUtils; use Getopt::Long; # # コマンド行を解析する。 # if (!GetOptions('workdir=s' => \$work_directory)) { exit 1; } # # fpwutils を初期化する。 # initialize_fpwutils(); # # これから出力するファイルがすでにあれば、削除する。 # unlink($sound_file_name); unlink($sound_tag_file_name); unlink($sound_fmt_file_name); $sound = FreePWING::Sound->new(); # # 生成側ファイルを開く。 # if (!$sound->open($sound_file_name, $sound_tag_file_name, $sound_fmt_file_name)) { die "$PROGRAM_NAME: " . $sound->error_message() . "\n"; } foreach $file_name (@ARGV) { # # 音声の一覧を定義したファイルを開く。 # $handle = FileHandle->new(); if (!$handle->open($file_name, 'r')) { die "$PROGRAM_NAME: failed to open the file, $ERRNO: $file_name\n"; } for (;;) { # # 一行読み込む。 # $line = $handle->getline(); if (!defined($line)) { last; } $line =~ s/\r?\n?$//; # # 空行とコメント行 (`#' が先頭に来ている行) は無視する。 # next if ($line =~ /^\#/ || $line =~ /^$/); # # 読み込んだ行を引数に分解する。 # ちょうど 2 個 (ファイル名前とタグ名) ないとエラー。 # @line_arguments = split(/[ \t]+/, $line); if (@line_arguments != 2) { die "$PROGRAM_NAME: malformed line, at line $NR in $file_name\n"; } # # 読み込んだ行に記された音声データを追加する。 # if (!$sound->add_data(@line_arguments)) { die "$PROGRAM_NAME: " . $sound->error_message() . "\n"; } } # # 音声の一覧を記述したファイルを開く。 # $handle->close(); } # # 音声の生成側ファイルを閉じる。 # if (!$sound->close()) { die "$PROGRAM_NAME: " . $sound->error_message() . "\n"; } # # fpwutils の後始末をする。 # finalize_fpwutils(); exit 0; freepwing-1.5.orig/fpwutils/FPWUtils.pm0000644000175000017500000001504011022404342017502 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 1999, 2000 Motoyuki Kasahara # # 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, 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. # package FreePWING::FPWUtils::FPWUtils; require 5.005; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK $work_directory $text_file_name $text_ref_file_name $text_tag_file_name $menu_file_name $menu_ref_file_name $menu_tag_file_name $copyright_file_name $copyright_ref_file_name $copyright_tag_file_name $heading_file_name $word_file_name $endword_file_name $keyword_file_name $sort_file_name $endsort_file_name $keysort_file_name $index_file_name $endindex_file_name $keyindex_file_name $index_ref_file_name $endindex_ref_file_name $keyindex_ref_file_name $control_file_name $control_ref_file_name $color_graphic_file_name $color_graphic_tag_file_name $sound_file_name $sound_tag_file_name $sound_fmt_file_name $honmon_file_name $half_char_name_file_name $full_char_name_file_name $half_char_bitmap_16_file_name $half_char_bitmap_24_file_name $half_char_bitmap_30_file_name $half_char_bitmap_48_file_name $full_char_bitmap_16_file_name $full_char_bitmap_24_file_name $full_char_bitmap_30_file_name $full_char_bitmap_48_file_name $sort_command); @ISA = qw(Exporter); @EXPORT = qw($work_directory $text_file_name $text_ref_file_name $text_tag_file_name $menu_file_name $menu_ref_file_name $menu_tag_file_name $copyright_file_name $copyright_ref_file_name $copyright_tag_file_name $heading_file_name $word_file_name $endword_file_name $keyword_file_name $sort_file_name $endsort_file_name $keysort_file_name $index_file_name $endindex_file_name $keyindex_file_name $index_ref_file_name $endindex_ref_file_name $keyindex_ref_file_name $control_file_name $control_ref_file_name $color_graphic_file_name $color_graphic_tag_file_name $sound_file_name $sound_tag_file_name $sound_fmt_file_name $honmon_file_name $half_char_name_file_name $full_char_name_file_name $half_char_bitmap_16_file_name $half_char_bitmap_24_file_name $half_char_bitmap_30_file_name $half_char_bitmap_48_file_name $full_char_bitmap_16_file_name $full_char_bitmap_24_file_name $full_char_bitmap_30_file_name $full_char_bitmap_48_file_name $sort_command initialize_fpwutils finalize_fpwutils); # 作業ファイルを書き込むディレクトリ $work_directory = '.'; # # 設定用の変数の初期化を行う。 # sub initialize_fpwutils { # 本文ファイル名 $text_file_name = "$work_directory/text"; # 本文の参照情報ファイル名 $text_ref_file_name = "$work_directory/textref"; # 本文のタグファイル名 $text_tag_file_name = "$work_directory/texttag"; # メニューファイル名 $menu_file_name = "$work_directory/menu"; # メニューの参照情報ファイル名 $menu_ref_file_name = "$work_directory/menuref"; # メニューのタグファイル名 $menu_tag_file_name = "$work_directory/menutag"; # 著作権表示ファイル名 $copyright_file_name = "$work_directory/copy"; # 著作権表示の参照情報ファイル名 $copyright_ref_file_name = "$work_directory/copyref"; # 著作権表示のタグファイル名 $copyright_tag_file_name = "$work_directory/copytag"; # 見出しファイル名 $heading_file_name = "$work_directory/head"; # 前方一致用の未整列単語一覧ファイル名 $word_file_name = "$work_directory/word"; # 後方一致用の未整列単語一覧ファイル名 $endword_file_name = "$work_directory/eword"; # 条件検索用の未整列単語一覧ファイル名 $keyword_file_name = "$work_directory/kword"; # 前方一致用の整列済み単語一覧ファイル名 $sort_file_name = "$work_directory/sort"; # 後方一致用の整列済み単語一覧ファイル名 $endsort_file_name = "$work_directory/esort"; # 条件検索用の整列済み単語一覧ファイル名 $keysort_file_name = "$work_directory/ksort"; # 前方一致インデックスの参照情報ファイル名 $index_file_name = "$work_directory/idx"; # 後方一致インデックスファイル名 $endindex_file_name = "$work_directory/eidx"; # 条件検索インデックスファイル名 $keyindex_file_name = "$work_directory/kidx"; # 前方一致インデックスファイル名 $index_ref_file_name = "$work_directory/idxref"; # 後方一致インデックスの参照情報ファイル名 $endindex_ref_file_name = "$work_directory/eidxref"; # 条件検索インデックスの参照情報ファイル名 $keyindex_ref_file_name = "$work_directory/kidxref"; # 書籍管理情報ファイル名 $control_file_name = "$work_directory/ctrl"; # 書籍管理情報の参照情報ファイル名 $control_ref_file_name = "$work_directory/ctrlref"; # カラー図版ファイル名 $color_graphic_file_name = "$work_directory/cgr"; # カラー図版タグファイル名 $color_graphic_tag_file_name = "$work_directory/cgrtag"; # 音声ファイル名 $sound_file_name = "$work_directory/snd"; # 音声タグファイル名 $sound_tag_file_name = "$work_directory/sndtag"; # 音声形式ファイル名 (satomii) $sound_fmt_file_name = "$work_directory/sndfmt"; # HONMON ファイル名 $honmon_file_name = "honmon"; # 半角外字名前ファイル $half_char_name_file_name = "$work_directory/halfchar"; # 全角外字名前ファイル $full_char_name_file_name = "$work_directory/fullchar"; # 半角外字ビットマップファイル名 $half_char_bitmap_16_file_name = "gai16h"; $half_char_bitmap_24_file_name = "gai24h"; $half_char_bitmap_30_file_name = "gai30h"; $half_char_bitmap_48_file_name = "gai48h"; # 全角外字ビットマップファイル名 $full_char_bitmap_16_file_name = "gai16f"; $full_char_bitmap_24_file_name = "gai24f"; $full_char_bitmap_30_file_name = "gai30f"; $full_char_bitmap_48_file_name = "gai48f"; } # # 設定用の変数の後始末を行う。 # sub finalize_fpwutils { } 1; freepwing-1.5.orig/fpwutils/fpwutils.mk.in0000644000175000017500000003246111022410443020307 0ustar mhattamhatta# -*- Makefile -*- # Copyright (c) 1999, 2000 Motoyuki Kasahara # # 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, 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. # # # 注意: この Makefile の断片は、GNU make でないと正しく扱えません。 # ###################################################################### # 変数の定義 ###################################################################### # Bourne 互換シェル SHELL = /bin/sh # Makefile 中で起動されるスクリプト群が置かれているディレクトリ ifndef FPWLIBEXECDIR FPWLIBEXECDIR = @pkglibexecdir@ endif # 作業ファイルを書き込むディレクトリ ifndef WORKDIR WORKDIR = work endif # perl コマンド ifndef PERL PERL = ${FPWLIBEXECDIR}/perl.sh endif # perl コマンドに渡す *.pm ファイルの検索オプション ifndef PERLINCFLAGS PERLINCFLAGS = endif # perl コマンドに渡す引数 ifndef PERLFLAGS PERLFLAGS = endif # fpwhalfchar コマンド ifndef FPWHALFCHAR FPWHALFCHAR = ${FPWLIBEXECDIR}/fpwhalfchar endif # fpwhalfchar コマンドに渡す外字定義ファイル ifndef HALFCHARS HALFCHARS = endif # fpwfullchar コマンド ifndef FPWFULLCHAR FPWFULLCHAR = ${FPWLIBEXECDIR}/fpwfullchar endif # fpwhalfchar コマンドに渡す外字定義ファイル ifndef FULLCHARS FULLCHARS = endif # fpwcgraph コマンド ifndef FPWCGRAPH FPWCGRAPH = ${FPWLIBEXECDIR}/fpwcgraph endif # fpwcgraph コマンドに渡すカラー図版ファイル ifndef CGRAPHS CGRAPHS = endif # fpwsound コマンド ifndef FPWSOUND FPWSOUND = ${FPWLIBEXECDIR}/fpwsound endif # fpwsound コマンドに渡すWAVEファイル ifndef SOUNDS SOUNDS = endif # パーサコマンド # (通常、ユーザ側の Makefile で上書きされる。) ifndef FPWPARSER FPWPARSER = ${FPWLIBEXECDIR}/fpwparser endif # パーサコマンドに渡す引数 # (通常、ユーザ側の Makefile で上書きされる。) ifndef FPWPARSERFLAGS FPWPARSERFLAGS = endif # fpwsort サブコマンド ifndef FPWSORT FPWSORT = ${FPWLIBEXECDIR}/fpwsort endif # fpwindex サブコマンド ifndef FPWINDEX FPWINDEX = ${FPWLIBEXECDIR}/fpwindex endif # fpwcontrol サブコマンド ifndef FPWCONTROL FPWCONTROL = ${FPWLIBEXECDIR}/fpwcontrol endif # fpwlink サブコマンド ifndef FPWLINK FPWLINK = ${FPWLIBEXECDIR}/fpwlink endif # mkdirhier コマンド ifndef MKDIRHIER MKDIRHIER = ${FPWLIBEXECDIR}/mkdirhier endif # cphier コマンド ifndef CPHIER CPHIER = ${FPWLIBEXECDIR}/cphier endif # make の進行を記録するファイル群 ifndef USERCHAR_DEP USERCHAR_DEP = ${WORKDIR}/userchar.dep endif ifndef CGRAPH_DEP CGRAPH_DEP = ${WORKDIR}/cgraph.dep endif ifndef SOUND_DEP SOUND_DEP = ${WORKDIR}/sound.dep endif ifndef PARSE_DEP PARSE_DEP = ${WORKDIR}/parse.dep endif ifndef SORT_DEP SORT_DEP = ${WORKDIR}/sort.dep endif ifndef INDEX_DEP INDEX_DEP = ${WORKDIR}/index.dep endif ifndef CONTROL_DEP CONTROL_DEP = ${WORKDIR}/control.dep endif ifndef LINK_DEP LINK_DEP = ${WORKDIR}/link.dep endif # gzip コマンド ifndef GZIPCMD GZIPCMD = gzip endif # zip コマンド ifndef ZIP ZIP = zip endif # bzip2 コマンド ifndef BZIP2 BZIP2 = bzip2 endif # catdump コマンド ifndef CATDUMP CATDUMP = ${FPWLIBEXECDIR}/catdump endif # catdump コマンドに渡す引数 ifndef CATDUMPFLAGS CATDUMPFLAGS = endif # 入力データファイル群 # (通常、ユーザ側の Makefile で設定される。) ifndef SOURCES SOURCES = endif # honmon を作成する際 (fpwmake all) に、依存するファイル # (通常、ユーザ側の Makefile で設定される。) ifndef ALLDEPS ALLDEPS = endif # パッケージの名前 # (通常、ユーザ側の Makefile で設定される。) ifndef PACKAGE PACKAGE = package endif # 書籍のディレクトリ名 # (通常、ユーザ側の Makefile で設定される。) ifndef DIR DIR = subdir endif # バイナリパッケージに添付するファイル # (通常、ユーザ側の Makefile で設定される。) ifndef PACKAGEEXTRA PACKAGEEXTRA = endif # バイナリパッケージを作成する際 (fpwmake package) に、依存するファイル # (通常、ユーザ側の Makefile で設定される。) ifndef PACKAGEDEPS PACKAGEDEPS = endif # ソースアーカイブに添付するファイル # (通常、ユーザ側の Makefile で設定される。) ifndef ARCHIVEEXTRA ARCHIVEEXTRA = endif # clean 実行時に一緒に削除されるファイル # (通常、ユーザ側の Makefile で設定される。) ifndef CLEANEXTRA CLEANEXTRA = endif # インストール先のディレクトリ ifndef INSTALLDIR INSTALLDIR = @datadir@/dict endif ###################################################################### # 生成ルール ###################################################################### # # all (デフォルトターゲット) # .PHONY: all all: ${ALLDEPS} link # # 外字の作成 # .PHONY: userchar userchar-recursive ifneq ($(strip ${SUBDIRS}),) userchar: userchar-recursive else userchar: ${USERCHAR_DEP} endif userchar-recursive: for subdir in ${SUBDIRS} ; do \ ${MAKE} -C $$subdir userchar ; \ done ${USERCHAR_DEP}: ${HALFCHARS} ${FULLCHARS} @rm -f ${USERCHAR_DEP} test -d ${WORKDIR} || ${MKDIRHIER} ${WORKDIR} ${PERL} ${PERLINCFLAGS} ${PERLFLAGS} ${FPWHALFCHAR} \ -workdir ${WORKDIR} ${HALFCHARS} ${PERL} ${PERLINCFLAGS} ${PERLFLAGS} ${FPWFULLCHAR} \ -workdir ${WORKDIR} ${FULLCHARS} @echo timestamp > ${USERCHAR_DEP} # # カラー図版の作成 # .PHONY: cgraph cgraph-recursive ifneq ($(strip ${SUBDIRS}),) cgraph: cgraph-recursive else cgraph: ${CGRAPH_DEP} endif cgraph-recursive: for subdir in ${SUBDIRS} ; do \ ${MAKE} -C $$subdir cgraph ; \ done ${CGRAPH_DEP}: ${CGRAPHS} @rm -f ${CGRAPH_DEP} ifneq ($(strip ${CGRAPHS}),) test -d ${WORKDIR} || ${MKDIRHIER} ${WORKDIR} ${PERL} ${PERLINCFLAGS} ${PERLFLAGS} ${FPWCGRAPH} \ -workdir ${WORKDIR} ${CGRAPHS} endif @echo timestamp > ${CGRAPH_DEP} # # 音声データの作成 # .PHONY: sound sound-recursive ifneq ($(strip ${SUBDIRS}),) sound: sound-recursive else sound: ${SOUND_DEP} endif sound-recursive: for subdir in ${SUBDIRS} ; do \ ${MAKE} -C $$subdir sound ; \ done ${SOUND_DEP}: ${SOUNDS} @rm -f ${SOUND_DEP} ifneq ($(strip ${SOUNDS}),) test -d ${WORKDIR} || ${MKDIRHIER} ${WORKDIR} ${PERL} ${PERLINCFLAGS} ${PERLFLAGS} ${FPWSOUND} \ -workdir ${WORKDIR} ${SOUNDS} endif @echo timestamp > ${SOUND_DEP} # # ユーザが用意した解析プログラムの実行 # .PHONY: parse parse-recursive ifneq ($(strip ${SUBDIRS}),) parse: parse-recursive else parse: ${PARSE_DEP} endif parse-recursive: for subdir in ${SUBDIRS} ; do \ ${MAKE} -C $$subdir parse ; \ done ${PARSE_DEP}: ${USERCHAR_DEP} ${CGRAPH_DEP} ${SOUND_DEP} ${SOURCES} @rm -f ${PARSE_DEP} ${PERL} ${PERLINCFLAGS} ${PERLFLAGS} ${FPWPARSER} \ -workdir ${WORKDIR} ${FPWPARSERFLAGS} @echo timestamp > ${PARSE_DEP} # # 単語一覧のソート # .PHONY: sort sort-recursive ifneq ($(strip ${SUBDIRS}),) sort: sort-recursive else sort: ${SORT_DEP} endif sort-recursive: for subdir in ${SUBDIRS} ; do \ ${MAKE} -C $$subdir sort ; \ done ${SORT_DEP}: ${PARSE_DEP} @rm -f ${SORT_DEP} ${PERL} ${PERLINCFLAGS} ${PERLFLAGS} ${FPWSORT} -workdir ${WORKDIR} @echo timestamp > ${SORT_DEP} # # インデックスの作成 # .PHONY: index index-recursive ifneq ($(strip ${SUBDIRS}),) index: index-recursive else index: ${INDEX_DEP} endif index-recursive: for subdir in ${SUBDIRS} ; do \ ${MAKE} -C $$subdir index ; \ done ${INDEX_DEP}: ${SORT_DEP} @rm -f ${INDEX_DEP} ${PERL} ${PERLINCFLAGS} ${PERLFLAGS} ${FPWINDEX} -workdir ${WORKDIR} @echo timestamp > ${INDEX_DEP} # # 書籍管理情報の作成 # .PHONY: control control-recursive ifneq ($(strip ${SUBDIRS}),) control: control-recursive else control: ${CONTROL_DEP} endif control-recursive: for subdir in ${SUBDIRS} ; do \ ${MAKE} -C $$subdir control ; \ done ${CONTROL_DEP}: ${INDEX_DEP} @rm -f ${CONTROL_DEP} ${PERL} ${PERLINCFLAGS} ${PERLFLAGS} ${FPWCONTROL} -workdir ${WORKDIR} @echo timestamp > ${CONTROL_DEP} # # 各データを結合して honmon の作成 # .PHONY: link link-recursive ifneq ($(strip ${SUBDIRS}),) link: link-recursive else link: ${LINK_DEP} endif link-recursive: for subdir in ${SUBDIRS} ; do \ ${MAKE} -C $$subdir link ; \ done ${LINK_DEP}: ${CONTROL_DEP} @rm -f ${LINK_DEP} ${PERL} ${PERLINCFLAGS} ${PERLFLAGS} ${FPWLINK} -workdir ${WORKDIR} @echo timestamp > ${LINK_DEP} # # catalogs の作成 # ifneq ($(strip ${SUBDIRS}),) catalogs.txt: $(addsuffix /catalogs.txt,${SUBDIRS}) rm -f $@ echo "[Catalog]" > $@ echo "FileName = catalogs" >> $@ echo "Type = EPWING5" >> $@ ${PERL} -e 'printf "Books\t\t= %d\n", scalar(@ARGV)' ${SUBDIRS} >> $@ for subdir in ${SUBDIRS} ; do \ echo "[Book]" >> $@ ; \ sed -n -e '/^Title[ ]*=/p' $$subdir/$@ >> $@ ; \ sed -n -e '/^BookType[ ]*=/p' $$subdir/$@ >> $@ ; \ sed -n -e '/^HanGaiji[ ]*=/p' $$subdir/$@ >> $@ ; \ sed -n -e '/^ZenGaiji[ ]*=/p' $$subdir/$@ >> $@ ; \ echo "Directory = \"$$subdir\"" >> $@ ; \ done endif catalogs: catalogs.txt rm -f $@ ${CATDUMP} ${CATDUMPFLAGS} -u catalogs.txt $@ # # 生成したファイルの削除 # .PHONY: clean clean-recursive clean-directory ifneq ($(strip ${SUBDIRS}),) clean: clean-recursive clean-directory else clean: clean-directory endif clean-recursive: for subdir in ${SUBDIRS} ; do \ ${MAKE} -C $$subdir clean ; \ done rm -f catalogs.txt clean-directory: rm -rf ${WORKDIR} rm -rf ${PACKAGE} rm -f catalogs honmon ${CLEANEXTRA} rm -f ${PACKAGE}.zip ${PACKAGE}.tar.gz ${PACKAGE}.tar.bz2 rm -f ${PACKAGE}-src.tar.gz # # パッケージの作成 (*.zip 版) # package package-zip: rm -rf ${DIR} rm -f ${PACKAGE}.zip ${MAKE} INSTALLDIR="." DIR="${DIR}" install chmod 777 ${DIR} ifneq ($(strip ${SUBDIRS}),) for subdir in ${SUBDIRS} ; do \ chmod 777 ${DIR}/$${subdir}/data ; \ done else chmod 777 ${DIR}/${DIR}/data endif ${ZIP} -9rkq ${PACKAGE}.zip ${DIR} rm -rf ${DIR} # # パッケージの作成 (*.tar.gz 版) # .PHONY: package package-zip package-tar-gz package-tar-bz2 package-tar-gz: rm -rf ${DIR} rm -f ${PACKAGE}.tar.gz ${MAKE} INSTALLDIR="." DIR="${DIR}" install chmod 777 ${DIR} ifneq ($(strip ${SUBDIRS}),) for subdir in ${SUBDIRS} ; do \ chmod 777 ${DIR}/$${subdir}/data ; \ done else chmod 777 ${DIR}/${DIR}/data endif tar cf - ${DIR} | ${GZIPCMD} -9 > ${PACKAGE}.tar.gz rm -rf ${DIR} # # パッケージの作成 (*.tar.bz2 版) # package-tar-bz2: rm -rf ${DIR} rm -f ${PACKAGE}.tar.bz2 ${MAKE} INSTALLDIR="." DIR="${DIR}" install chmod 777 ${DIR} ifneq ($(strip ${SUBDIRS}),) for subdir in ${SUBDIRS} ; do \ chmod 777 ${DIR}/$${subdir}/data ; \ done else chmod 777 ${DIR}/${DIR}/data endif tar cf - ${DIR} | ${BZIP2} -9 > ${PACKAGE}.tar.bz2 rm -rf ${DIR} # # インストール # .PHONY: install install-directory install: all catalogs ${PACKAGEDEPS} ${MKDIRHIER} ${INSTALLDIR}/${DIR} for file in catalogs ; do \ ${CPHIER} $$file ${INSTALLDIR}/${DIR}/$$file ; \ chmod 0644 ${INSTALLDIR}/${DIR}/$$file ; \ done ifneq ($(strip ${SUBDIRS}),) for subdir in ${SUBDIRS} ; do \ case ${INSTALLDIR} in \ /*) ${MAKE} -C $$subdir \ INSTALLDIR="${INSTALLDIR}/${DIR}/$$subdir" \ install-directory ;; \ *) ${MAKE} -C $$subdir \ INSTALLDIR="../${INSTALLDIR}/${DIR}/$$subdir" \ install-directory ;; \ esac ; \ done else ${MAKE} INSTALLDIR="${INSTALLDIR}/${DIR}/${DIR}" install-directory endif packageextra='${PACKAGEEXTRA}' ; \ for file in $$packageextra ; do \ case $$file in \ *=*) srcfile="`echo $$file | sed 's/=.*//'`" ; \ dstfile="`echo $$file | sed 's/.*=//'`" ; \ ${CPHIER} $$srcfile ${INSTALLDIR}/${DIR}/$$dstfile ; \ if [ -f ${INSTALLDIR}/${DIR}/$$dstfile ] ; then \ chmod 0644 ${INSTALLDIR}/${DIR}/$$dstfile ; \ fi ;; \ *) ${CPHIER} $$file ${INSTALLDIR}/${DIR}/$$file ; \ if [ -f ${INSTALLDIR}/${DIR}/$$file ] ; then \ chmod 0644 ${INSTALLDIR}/${DIR}/$$file ; \ fi ;; \ esac ; \ done install-directory: ${MKDIRHIER} ${INSTALLDIR}/data for file in honmon ; do \ ${CPHIER} $$file ${INSTALLDIR}/data/$$file ; \ chmod 0644 ${INSTALLDIR}/data/$$file ; \ done ${MKDIRHIER} ${INSTALLDIR}/gaiji for file in gai16h gai24h gai30h gai48h gai16f gai24f gai30f gai48f ; do \ if test -f $$file ; then \ ${CPHIER} $$file ${INSTALLDIR}/gaiji/$$file ; \ chmod 0644 ${INSTALLDIR}/gaiji/$$file ; \ fi ; \ done # # 変換スクリプトのアーカイブを作成 # .PHONY: archive archive-directory archive: rm -rf ${PACKAGE} rm -f ${PACKAGE}-src.tar.gz ${MKDIRHIER} ${PACKAGE} chmod 777 ${PACKAGE} ifneq ($(strip ${SUBDIRS}),) for subdir in ${SUBDIRS} ; do \ ${MAKE} -C $$subdir ARCHIVEDIR="../${PACKAGE}/$$subdir" \ archive-directory ; \ chmod 777 ${PACKAGE}/$${subdir} ; \ done endif ${MAKE} ARCHIVEDIR="${PACKAGE}" archive-directory tar cf - ${PACKAGE} | ${GZIPCMD} -9 > ${PACKAGE}-src.tar.gz rm -rf ${PACKAGE} archive-directory: for file in README Makefile catalogs.txt ${FPWPARSER} \ ${CGRAPHS} ${SOUNDS} ${HALFCHARS} ${FULLCHARS} ; do \ if test -f $$file ; then \ ${CPHIER} $$file ${ARCHIVEDIR}/$$file ; \ fi ; \ done archiveextra='${ARCHIVEEXTRA}' ; \ for file in $$archiveextra ; do \ case $$file in \ *=*) srcfile="`echo $$file | sed 's/=.*//'`" ; \ dstfile="`echo $$file | sed 's/.*=//'`" ; \ ${CPHIER} $$srcfile ${ARCHIVEDIR}/$$dstfile ;; \ *) ${CPHIER} $$file ${ARCHIVEDIR}/$$file ;; \ esac ; \ done .SUFFIXES: # # バージョン [3.59, 3.63) の GNU make に対して、すべての変数を export # しないように指示する。そうしないと、システム (少なくとも SysV) の # 制限値を越えてしまう。 # .NOEXPORT: freepwing-1.5.orig/fpwutils/Heading.pm0000644000175000017500000000331111022404342017362 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 2000 Motoyuki Kasahara # # 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, 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. # # # 見出しを収めたファイルを生成するためのクラス。 # package FreePWING::FPWUtils::Heading; require 5.005; use English; use FreePWING::Heading; use FreePWING::FPWUtils::FPWUtils; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(FreePWING::Heading); # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; return $type->SUPER::new(); } # # 書式: # open() # メソッドの区分: # public インスタンスメソッド。 # 説明: # 書き込み用の見出しファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; if (!$self->SUPER::open($heading_file_name)) { return 0; } # # 外字の定義ファイルを読み込む。 # if (-f $half_char_name_file_name && !$self->set_half_user_characters_in_file($half_char_name_file_name)) { return 0; } if (-f $full_char_name_file_name && !$self->set_full_user_characters_in_file($full_char_name_file_name)) { return 0; } return 1; } 1; freepwing-1.5.orig/fpwutils/Sound.pm0000644000175000017500000000264611022404342017125 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 2001 Motoyuki Kasahara # # 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, 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. # # # カラー図版を生成するためのクラス。 # package FreePWING::FPWUtils::Sound; require 5.005; use English; use FreePWING::Sound; use FreePWING::FPWUtils::FPWUtils; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(FreePWING::Sound); # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; return $type->SUPER::new(); } # # 書式: # open() # メソッドの区分: # public インスタンスメソッド。 # 説明: # 書き込み用の見出しファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; if (!$self->SUPER::open($sound_file_name, $sound_tag_file_name, $sound_fmt_file_name)) { return 0; } return 1; } 1; freepwing-1.5.orig/fpwutils/fpwcontrol.in0000644000175000017500000000650111022404342020216 0ustar mhattamhatta#! @PERL@ # -*- Perl -*- # Copyright (c) 1999, 2000 Motoyuki Kasahara # # 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, 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. # require 5.005; use English; use FreePWING::Control; use FreePWING::FPWUtils::FPWUtils; use Getopt::Long; # # コマンド行を解析する。 # if (!GetOptions('workdir=s' => \$work_directory)) { exit 1; } # # fpwutils を初期化する。 # initialize_fpwutils(); # # これから出力するファイルがすでにあれば、削除する。 # unlink($control_file_name); unlink($control_ref_file_name); # # 書籍管理情報ファイルを開く。 # $control = FreePWING::Control->new(); if (!$control->open($control_file_name, $control_ref_file_name)) { die "$PROGRAM_NAME: " . $control->error_message() . "\n"; } # # 本文データエントリを追加する。 # if (-f $text_file_name && !$control->add_text_entry($text_file_name)) { die "$PROGRAM_NAME: " . $control->error_message() . "\n"; } # # 見出しエントリを追加する。 # if (-f $heading_file_name && !$control->add_heading_entry($heading_file_name)) { die "$PROGRAM_NAME: " . $control->error_message() . "\n"; } # # 前方一致インデックスエントリを追加する。 # $i = 0; @file_names = (); while (-f "$index_file_name$i") { unshift(@file_names, "$index_file_name$i"); $i++; } if (0 < $i && !$control->add_index_entry(@file_names)) { die "$PROGRAM_NAME: " . $control->error_message() . "\n"; } # # 後方一致インデックスエントリを追加する。 # $i = 0; @file_names = (); while (-f "$endindex_file_name$i") { unshift(@file_names, "$endindex_file_name$i"); $i++; } if (0 < $i && !$control->add_endindex_entry(@file_names)) { die "$PROGRAM_NAME: " . $control->error_message() . "\n"; } # # 条件検索インデックスエントリを追加する。 # $i = 0; @file_names = (); while (-f "$keyindex_file_name$i") { unshift(@file_names, "$keyindex_file_name$i"); $i++; } if (0 < $i && !$control->add_keyindex_entry(@file_names)) { die "$PROGRAM_NAME: " . $control->error_message() . "\n"; } # # メニュー表示用データエントリを追加する。 # if (-f $menu_file_name && !$control->add_menu_entry($menu_file_name)) { die "$PROGRAM_NAME: " . $control->error_message() . "\n"; } # # 著作権表示データエントリを追加する。 # if (-f $copyright_file_name && !$control->add_copyright_entry($copyright_file_name)) { die "$PROGRAM_NAME: " . $control->error_message() . "\n"; } # # カラー図版エントリを追加する。 # if (-f $color_graphic_file_name && !$control->add_color_graphic_entry($color_graphic_file_name)) { die "$PROGRAM_NAME: " . $control->error_message() . "\n"; } # # 音声エントリを追加する。 # if (-f $sound_file_name && !$control->add_sound_entry($sound_file_name)) { die "$PROGRAM_NAME: " . $control->error_message() . "\n"; } # # 書籍管理情報ファイルを閉じる。 # if (!$control->close()) { die "$PROGRAM_NAME: " . $control->error_message() . "\n"; } # # fpwutils の後始末をする。 # finalize_fpwutils(); exit 0; freepwing-1.5.orig/fpwutils/fpwmake.in0000644000175000017500000000006411022404342017451 0ustar mhattamhatta#! /bin/sh exec @GNUMAKE@ -I@pkgdatadir@ ${1+"$@"} freepwing-1.5.orig/src/0000755000175000017500000000000011022640523014404 5ustar mhattamhattafreepwing-1.5.orig/src/BaseWord.pm0000644000175000017500000001677411022404342016464 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 1999, 2000 Motoyuki Kasahara # # 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, 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. # # # 単語一覧を収めたファイルを生成するクラス (FreePWING::Word, # FreePWING::EndWord) のための基底仮想クラス。 # package FreePWING::BaseWord; require 5.005; require Exporter; use FileHandle; use English; use FreePWING::CharConv; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK $max_word_length $word_direction $endword_direction); @ISA = qw(Exporter); # # 単語の最大長。 # $max_word_length = 254; # # 単語の書き込み方向 # $word_direction = 1; $endword_direction = -1; # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; my $new = { # 単語ファイルのハンドラ 'handle' => FileHandle->new(), # 単語ファイル名 'file_name' => '', # これまでに書き込んだエントリ数 'entry_count' => 0, # 単語の書き込み方向 ($word_direction か $endword_direction) 'direction' => $word_direction, # エラーメッセージ 'error_message' => '', }; return bless($new, $type); } # # 書式: # open(file_name) # file_name # 開く単語ファイルの名前。 # メソッドの区分: # public インスタンスメソッド # 説明: # 書き込み用に単語ファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; my ($file_name) = @ARG; # # 単語ファイルを開く。 # $self->{'file_name'} = $file_name; if (!$self->{'handle'}->open($self->{'file_name'}, 'w')) { $self->{'error_message'} = "failed to open the file, $ERRNO: " . $self->{'file_name'}; $self->close_internal(); return 0; } return 1; } # # 書式: # close() # メソッドの区分: # public インスタンスメソッド。 # 説明: # 単語ファイルを閉じる。開いていなければ、何もしない。 # 戻り値: # 常に 1 を返す。 # sub close { my $self = shift; $self->close_internal(); return 1; } # # 書式: # close_internal() # メソッドの区分: # private インスタンスメソッド。 # 説明: # close() の内部処理用メソッド。 # sub close_internal { my $self = shift; if ($self->{'handle'}->fileno()) { $self->{'handle'}->close(); } } # # 書式: # add_entry(word, heading_position, heading_file_name, # text_position, text_file_name) # word # 単語 # heading_position # 見出しの位置 # heading_file_name # 見出しのファイル名 # text_position # 本文の位置 # text_file_name # 本文のファイル名 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 単語ファイルに単語を一つ追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_entry { my $self = shift; my ($word, $heading_position, $heading_file_name, $text_position, $text_file_name) = @ARG; # # 単語を正規化する。 # my @unpacked_word = unpack('C*', $word); my $fixed_word = ''; my $i = 0; while ($i < scalar(@unpacked_word)) { my $c0 = $unpacked_word[$i]; if ($c0 == 0x20 || $c0 == 0x27 || $c0 == 0x2d) { # # ` ', `\'', `-' は削除。 # $i++; } elsif (0x21 <= $c0 && $c0 <= 0x7e) { # # US-ASCII は JIS X 0208 に変換して記録。 # さらに、英小文字は大文字に変換して記録。 # if (0x61 <= $c0 && $c0 <= 0x7a) { $c0 -= 0x20; } $fixed_word .= $ascii_to_jisx0208_table->[$c0 - 0x20]; $i++; } elsif (0xa1 <= $c0 && $c0 <= 0xfe) { # # JIS X 0208 文字... # my $c1 = $unpacked_word[$i + 1]; if (!defined($c1) || $c1 < 0xa1 || 0xfe < $c1) { $self->{'error_message'} = sprintf("invalid character: \\x%02x", $c0); $self->close_internal(); return 0; } if ($c0 == 0xa3 && 0xc1 <= $c1 && $c1 <= 0xda) { # # 英小文字は大文字に変換して記録。 # $fixed_word .= pack("CC", $c0 & 0x7f, ($c1 - 0x20) & 0x7f); } elsif ($c0 == 0xa1 && ($c1 == 0xa1 || $c1 == 0xc7 || $c1 == 0xdd || $c1 == 0xa6 || $c1 == 0xbe)) { # # ` ', `’', `−', `・', `‐' は削除。 # } else { # # それ以外はそのまま記録。 # $fixed_word .= pack("CC", $c0 & 0x7f, $c1 & 0x7f); } $i += 2; } elsif ($c0 == 0x8e) { # # SS2 を用いた JIS X 0201 カナは JIS X 0208 カナに変換して記録。 # my $c1 = $unpacked_word[$i + 1]; if (!defined($c1) || $c1 < 0xa1 || 0xfe < $c1) { $self->{'error_message'} = sprintf("invalid character: \\x%02x", $c0); $self->close_internal(); return 0; } $fixed_word .= $jisx0201_to_jisx0208_table->[$c1 - 0xa0]; $i += 2; } else { $self->{'error_message'} = sprintf("invalid character: \\x%02x", $c0); $self->close_internal(); return 0; } } # # 正規化した単語の長さをチェックする。 # if (length($fixed_word) == 0) { $self->{'error_message'} = "word is empty"; $self->close_internal(); return 0; } # # インデックスの方向が負だったら、単語の前後をひっくり返す。 # if ($self->{'direction'} == $endword_direction) { $fixed_word = pack("n*", reverse(unpack("n*", $fixed_word))); } # # 単語が長すぎる場合は切り詰める。 # if ($max_word_length < length($fixed_word)) { $fixed_word = substr($fixed_word, 0, $max_word_length); } # # 単語エントリをファイルへ書き込む。 # if (!$self->{'handle'} ->printf("%s\t%08x\t%s\t%08x\t%s\n", $fixed_word, $heading_position, $heading_file_name, $text_position, $text_file_name)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; $self->close_internal(); return 0; } $self->{'entry_count'}++; # # 単語にカタカナが含まれている場合は、ひらがなに直す。 # my @unpacked_fixed_word = unpack('C*', $fixed_word); my $katakana_flag = 0; my $i = 0; while ($i < scalar(@unpacked_fixed_word)) { if ($unpacked_fixed_word[$i] == 0x25) { $unpacked_fixed_word[$i] = 0x24; $katakana_flag = 1; } $i += 2; } # # 単語に含まれていたカタカナをひらがなに直した場合は、直したエン # トリも合わせて書き込む。 # if ($katakana_flag) { $fixed_word = pack("C*", @unpacked_fixed_word); if (!$self->{'handle'} ->printf("%s\t%08x\t%s\t%08x\t%s\n", $fixed_word, $heading_position, $heading_file_name, $text_position, $text_file_name)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; $self->close_internal(); return 0; } $self->{'entry_count'}++; } return 1; } ###################################################################### # <インスタンス変数の値を返すメソッド群> # # 書式: # インスタンス変数名() # メソッドの区分: # public インスタンスメソッド。 # 戻り値: # インスタンス変数の値を返す。 # sub file_name { my $self = shift; return $self->{'file_name'}; } sub entry_count { my $self = shift; return $self->{'entry_count'}; } sub error_message { my $self = shift; return $self->{'error_message'}; } 1; freepwing-1.5.orig/src/KeyWord.pm0000644000175000017500000000220311022404342016320 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 2000 Motoyuki Kasahara # # 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, 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. # # # 条件検索用の単語一覧を収めたファイルを生成するためのクラス。 # package FreePWING::KeyWord; require 5.005; use FreePWING::BaseWord; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(FreePWING::BaseWord); # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; my $new = $type->SUPER::new(); $new->{'direction'} = $FreePWING::BaseWord::word_direction; return $new; } 1; freepwing-1.5.orig/src/Sort.pm.in0000644000175000017500000001467611022404342016311 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 1999, 2000 Motoyuki Kasahara # # 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, 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. # # # 単語一覧を収めたファイルを整列するためのクラス。 # package FreePWING::Sort; require 5.005; require Exporter; use FileHandle; use English; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK $sort); @ISA = qw(Exporter); # sort コマンド $sort = '@SORT@'; # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; my $new = { # 単語整列ファイルのハンドラ 'handle' => FileHandle->new(), # 単語整列ファイル名 'file_name' => '', # これまでに書き込んだエントリ数 'entry_count' => 0, # エラーメッセージ 'error_message' => '', }; return bless($new, $type); } # # 書式: # open(file_name) # file_name # 開く単語整列ファイルの名前。 # メソッドの区分: # public インスタンスメソッド # 説明: # 書き込み用に単語整列ファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; my ($file_name) = @ARG; my ($lc_all, $lc_ctype, $lc_collate, $lc_time, $lc_numeric, $lc_monetary, $lc_message); # # 現在のロケール環境変数を保存する。 # $lc_all = $ENV{'LC_ALL'}; $lc_collate = $ENV{'LC_COLLATE'}; $lc_ctype = $ENV{'LC_CTYPE'}; $lc_time = $ENV{'LC_TIME'}; $lc_numeric = $ENV{'LC_NUMERIC'}; $lc_monetary = $ENV{'LC_MONETARY'}; $lc_message = $ENV{'LC_MESSAGE'}; # # ロケール環境変数を修正する。 # if (defined($lc_all)) { $ENV{'LC_TIME'} = $lc_all; $ENV{'LC_NUMERIC'} = $lc_all; $ENV{'LC_MONETARY'} = $lc_all; $ENV{'LC_MESSAGE'} = $lc_all; delete($ENV{'LC_ALL'}); } $ENV{'LC_CTYPE'} = 'C'; $ENV{'LC_COLLATE'} = 'C'; # # 単語整列ファイルを開く。 # $self->{'file_name'} = $file_name; if (!$self->{'handle'}->open("| $sort > $file_name")) { $self->{'error_message'} = "failed to open the file, $ERRNO: " . $self->{'file_name'}; $self->close_internal(); return 0; } # # ロケール環境変数を元に戻す。 # defined($lc_all) ? ($ENV{'LC_ALL'} = $lc_all) : delete($ENV{'LC_ALL'}); defined($lc_collate) ? ($ENV{'LC_COLLATE'} = $lc_collate) : delete($ENV{'LC_COLLATE'}); defined($lc_ctype) ? ($ENV{'LC_CTYPE'} = $lc_ctype) : delete($ENV{'LC_CTYPE'}); defined($lc_time) ? ($ENV{'LC_TIME'} = $lc_time) : delete($ENV{'LC_TIME'}); defined($lc_numeric) ? ($ENV{'LC_NUMERIC'} = $lc_numeric) : delete($ENV{'LC_NUMERIC'}); defined($lc_monetary) ? ($ENV{'LC_MONETARY'} = $lc_monetary) : delete($ENV{'LC_MONETARY'}); defined($lc_message) ? ($ENV{'LC_MESSAGE'} = $lc_message) : delete($ENV{'LC_MESSAGE'}); return 1; } # # 書式: # close() # メソッドの区分: # public インスタンスメソッド。 # 説明: # 単語整列ファイルを閉じる。開いていなければ、何もしない。 # 戻り値: # 常に 1 を返す。 # sub close { my $self = shift; return $self->close_internal(); } # # 書式: # close_internal() # メソッドの区分: # private インスタンスメソッド。 # 説明: # close() の内部処理用メソッド。 # sub close_internal { my $self = shift; if ($self->{'handle'}->fileno()) { $self->{'handle'}->close(); if (($CHILD_ERROR & 255) != 0) { if ($self->{'error_message'} eq '') { $self->{'error_message'} = "failed to close the file: " . $self->{'file_name'}; } return 0; } } return 1; } # # 書式: # add_entries_in_file(file_name) # file_name # インデックスのエントリが記されたファイル。 # メソッドの区分: # public インスタンスメソッド。 # 説明: # file_name の中に記されている全エントリを、インデックスファイル # 群に対して追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_entries_in_file { my $self = shift; my ($file_name) = @ARG; # # $file_name を開く。 # my $handle = FileHandle->new(); if (!$handle->open($file_name, 'r')) { $self->{'error_message'} = "failed to open the file, $ERRNO: $file_name"; $self->close_internal(); return 0; } # # $file_name を読み、各行に記されているエントリを $self に追加 # する。 # my $line; for (;;) { $line = $handle->getline(); if (!defined($line)) { last; } if (!$self->{'handle'}->print($line)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; $self->close_internal(); return 0; } $self->{'entry_count'}++; } # # $file_name のハンドルを閉じる。 # $handle->close(); return 1; } # # 書式: # add_entry(word, heading_position, heading_file_name, # text_position, text_file_name) # word # 単語 (正規化されたもの) # heading_position # 見出しの位置 # heading_file_name # 見出しのファイル名 # text_position # 本文の位置 # text_file_name # 本文のファイル名 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 単語ファイルに単語を一つ追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_entry { my $self = shift; my ($word, $heading_position, $heading_file_name, $text_position, $text_file_name) = @ARG; if (!$self->{'handle'} ->printf("%s\t%08x\t%s\t%08x\t%s\n", $word, $heading_position, $heading_file_name, $text_position, $text_file_name)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; $self->close_internal(); return 0; } $self->{'entry_count'}++; return 1; } ###################################################################### # <インスタンス変数の値を返すメソッド群> # # 書式: # インスタンス変数名() # メソッドの区分: # public インスタンスメソッド。 # 戻り値: # インスタンス変数の値を返す。 # sub file_name { my $self = shift; return $self->{'file_name'}; } sub entry_count { my $self = shift; return $self->{'entry_count'}; } sub error_message { my $self = shift; return $self->{'error_message'}; } 1; freepwing-1.5.orig/src/RefUserChar.pm0000644000175000017500000000547111022404342017117 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 2000 Motoyuki Kasahara # # 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, 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. # # # 外字名前ファイルを参照する。 # package FreePWING::RefUserChar; require 5.005; require Exporter; use English; use FileHandle; use FreePWING::Reference; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(Exporter); # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; my $new = { # 外字テーブル 'characters' => {}, # エラーメッセージ 'error_message' => '', }; return bless($new, $type); } # # 書式: # add_characters_in_file(file_name) # file_name # 読み込む外字名前ファイルの名前 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 外字名前ファイルに登録されている名前を読み込む。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_characters_in_file { my $self = shift; my ($file_name) = @ARG; # # 外字名前ファイルを開く。 # my $handle = FileHandle->new(); if (!$handle->open($file_name, 'r')) { $self->{'error_message'} = "failed to open the file, $ERRNO: $file_name"; return 0; } # # 外字名前ファイルの各行を読み込む。 # my $line; my @line_fields; for (;;) { $line = $handle->getline(); if (!defined($line)) { last; } chomp $line; @line_fields = split(/\t/, $line); if (defined($self->{'characters'}->{$line_fields[0]})) { $self->{'error_message'} = "redefined character name, $line_fields[0]: " . "line $NR, $file_name"; $handle->close(); return 0; } $self->{'characters'}->{$line_fields[0]} = hex($line_fields[1]); } # # 外字名前ファイルを閉じる。 # $handle->close(); return 1; } ###################################################################### # <インスタンス変数の値を返すメソッド群> # # 書式: # インスタンス変数名() # メソッドの区分: # public インスタンスメソッド。 # 戻り値: # インスタンス変数の値を返す。 # sub character { my $self = shift; my ($name) = @ARG; return $self->{'characters'}->{$name}; } sub character_count { my $self = shift; return scalar(%{$self->{'characters'}}) + 0; } sub error_message { my $self = shift; return $self->{'error_message'}; } 1; freepwing-1.5.orig/src/ColorGraphic.pm0000644000175000017500000002002411022404342017311 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 2001 Motoyuki Kasahara # # 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, 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. # # # BMP カラー画像を収めたファイルを生成するクラス # package FreePWING::ColorGraphic; require 5.005; require Exporter; use English; use FileHandle; use FreePWING::Tag; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK $block_length $tag_prefix); @ISA = qw(Exporter); # # ブロックの長さ (バイト数) # $block_length = 2048; # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; my $new = { # バイナリファイルのハンドラ 'handle' => FileHandle->new(), # バイナリファイル名 'file_name' => '', # 書き込んだエントリ数 'entry_count' => 0, # バイナリファイルのオフセット (これまでに書き込んだバイト数) 'position' => 0, # タグ 'tag' => FreePWING::Tag->new(), # エラーメッセージ 'error_message' => '', }; return bless($new, $type); } # # 書式: # open(file_name, [tag_file_name]) # file_name # テキストファイルの名前。 # tag_file_name # タグファイルの名前。 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 書き込み用のテキストファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; my ($file_name, $tag_file_name) = @ARG; # # ファイルを開く。 # $self->{'file_name'} = $file_name; if (!$self->{'handle'}->open($self->{'file_name'}, 'w')) { $self->{'error_message'} = "failed to open the file, $ERRNO: " . $self->{'file_name'}; $self->close_internal(); return 0; } binmode($self->{'handle'}); # # タグファイルを開く。 # if (defined($tag_file_name) && !$self->{'tag'}->open($tag_file_name)) { $self->{'error_message'} = $self->{'tag'}->error_message(); $self->close_internal(); return 0; } return 1; } # # 書式: # close() # メソッドの区分: # public インスタンスメソッド。 # 説明: # オブジェクトが開いているテキストファイル群を閉じる。 # テキストファイルを開いていない場合は、何もしない。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub close { my $self = shift; if (!$self->{'handle'}->fileno()) { return 1; } # # 半端なブロックの後方を "\0" で埋める。 # my $pad_length = $block_length - $self->{'handle'}->tell() % $block_length; if ($pad_length < $block_length && !$self->{'handle'}->print("\0" x $pad_length)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; return 0; } # # ファイルを閉じる。 # $self->close_internal(); return 1; } # # 書式: # close_internal() # メソッドの区分: # private インスタンスメソッド。 # 説明: # close() の内部処理用メソッド。 # sub close_internal { my $self = shift; if ($self->{'handle'}->fileno()) { $self->{'handle'}->close(); } $self->{'tag'}->close_internal(); } # # 書式: # add_data(tag, file_name) # tag # タグ名 # file_name # 追加するバイナリファイル名 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 与えられたファイルの内容を、データとして追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_data { my $self = shift; my ($tag, $file_name) = @ARG; my ($start_position) = $self->{'position'}; # # タグを登録する。 # if (!$self->{'tag'}->add_entry('cgraph:' . $tag, $start_position)) { $self->{'error_message'} = $self->{'tag'}->error_message(); $self->close_internal(); return 0; } # # ヘッダを書き込む。 # my $file_size = -s $file_name; my $header = pack('a4V', 'data', $file_size); if (!$self->{'handle'}->print($header)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; $self->close_internal(); return 0; } $self->{'position'} += length($header); # # 指定されたファイルを開く。 # my $handle = FileHandle->new(); if (!$handle->open($file_name, 'r')) { $self->{'error_message'} = "failed to open the file, $ERRNO: " . $file_name; $self->close_internal(); return 0; } binmode($handle); # # 指定されたファイルを読み込んで、バイナリファイルに書き込む。 # my ($data, $data_length); for (;;) { $data_length = $handle->read($data, $block_length); if (!defined($data_length)) { $self->{'error_message'} = "failed to read the file, $ERRNO: " . $file_name; $self->close_internal(); return 0; } elsif ($data_length == 0) { last; } if (!$self->{'handle'}->print($data)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; $self->close_internal(); return 0; } $self->{'position'} += $data_length; } # # 指定されたファイルを閉じる。 # $handle->close(); $self->{'entry_count'}++; # # 終了タグを登録する。 # if (defined($self->{'end_tag_prefix'})) { my ($end_tag) = $self->{'end_tag_prefix'} . ':' . $tag; my ($end_position) = $self-{'position'} - 1; if ($end_position < $start_position) { $end_position = $start_position; } if (!$self->{'tag'}->add_entry($end_tag, $end_position)) { $self->{'error_message'} = $self->{'tag'}->error_message(); $self->close_internal(); return 0; } } return 1; } # # 書式: # add_binary(tag, binary) # tag # タグ名 # binary # 追加するバイナリデータ # メソッドの区分: # public インスタンスメソッド。 # 説明: # 与えられたバイナリデータの内容を、データとして追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_binary { my $self = shift; my ($tag, $binary) = @ARG; my ($start_position) = $self->{'position'}; # # タグを登録する。 # if (!$self->{'tag'}->add_entry('cgraph:' . $tag, $start_position)) { $self->{'error_message'} = $self->{'tag'}->error_message(); $self->close_internal(); return 0; } # # ヘッダを書き込む。 # my $file_size = length($binary); my $header = pack('a4V', 'data', $file_size); if (!$self->{'handle'}->print($header)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; $self->close_internal(); return 0; } $self->{'position'} += length($header); # # バイナリデータを書き込む。 # if (!$self->{'handle'}->print($binary)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; $self->close_internal(); return 0; } $self->{'position'} += $file_size; # # # $self->{'entry_count'}++; # # 終了タグを登録する。 # if (defined($self->{'end_tag_prefix'})) { my ($end_tag) = $self->{'end_tag_prefix'} . ':' . $tag; my ($end_position) = $self-{'position'} - 1; if ($end_position < $start_position) { $end_position = $start_position; } if (!$self->{'tag'}->add_entry($end_tag, $end_position)) { $self->{'error_message'} = $self->{'tag'}->error_message(); $self->close_internal(); return 0; } } return 1; } ###################################################################### # <インスタンス変数の値を返すメソッド群> # # 書式: # インスタンス変数名() # メソッドの区分: # public インスタンスメソッド。 # 戻り値: # インスタンス変数の値を返す。 # sub file_name { my $self = shift; return $self->{'file_name'}; } sub tag_file_name { my $self = shift; return $self->{'tag'}->file_name(); } sub entry_count { my $self = shift; return $self->{'entry_count'}; } sub error_message { my $self = shift; return $self->{'error_message'}; } 1; freepwing-1.5.orig/src/Makefile.am0000644000175000017500000000135611022404342016442 0ustar mhattamhattapkgperllibdir = ${perllibdir}/FreePWING pkgperllib_DATA = BaseText.pm BaseUserChar.pm BaseWord.pm CharConv.pm \ ColorGraphic.pm Control.pm EndWord.pm FullUserChar.pm \ HalfUserChar.pm Heading.pm Index.pm KeyWord.pm Link.pm RefSound.pm \ RefUserChar.pm Reference.pm Sort.pm Sound.pm Tag.pm Text.pm \ Word.pm Word2.pm EXTRA_DIST = BaseText.pm BaseUserChar.pm BaseWord.pm CharConv.pm \ ColorGraphic.pm Control.pm EndWord.pm FullUserChar.pm \ HalfUserChar.pm Heading.pm Index.pm KeyWord.pm Link.pm RefSound.pm \ RefUserChar.pm Reference.pm Sort.pm.in Sound.pm Tag.pm Text.pm \ Word.pm Word2.pm CLEANFILES = Sort.pm Sort.pm: Sort.pm.in rm -f $@ sed -e 's;\@SORT\@;$(SORT);' $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 644 $@ rm -f $@.tmp freepwing-1.5.orig/src/Reference.pm0000644000175000017500000001215611022404342016642 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 1999, 2000 Motoyuki Kasahara # # 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, 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. # # # 参照情報ファイルを生成するためのクラス。 # package FreePWING::Reference; require 5.005; require Exporter; use FileHandle; use English; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(Exporter); # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; my $new = { # 参照情報ファイルのハンドラ 'handle' => FileHandle->new(), # 参照情報ファイル名 'file_name' => '', # これまでに書き込んだエントリ数 'entry_count' => 0, # エラーメッセージ 'error_message' => '', }; return bless($new, $type); } # # 書式: # open(file_name) # file_name # 開く参照情報ファイルの名前。 # メソッドの区分: # public インスタンスメソッド # 説明: # 書き込み用に参照情報ファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; my ($file_name) = @ARG; # # 参照情報ファイルを開く。 # $self->{'file_name'} = $file_name; if (!$self->{'handle'}->open($self->{'file_name'}, 'w')) { $self->{'error_message'} = "failed to open the file, $ERRNO: " . $self->{'file_name'}; return 0; } return 1; } # # 書式: # close() # メソッドの区分: # public インスタンスメソッド。 # 説明: # 参照情報ファイルを閉じる。開いていなければ、何もしない。 # 戻り値: # 常に 1 を返す。 # sub close { my $self = shift; $self->close_internal(); return 1; } # # 書式: # close_internal() # メソッドの区分: # private インスタンスメソッド。 # 説明: # close() の内部処理用メソッド。 # sub close_internal { my $self = shift; if ($self->{'handle'}->fileno()) { $self->{'handle'}->close(); } } # # 書式: # add_block_entry(source_position, target_position, target_file_name) # source_position # 参照元の位置 # target_position # 参照先の位置 # target_file_name # 参照先のファイル名 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 参照情報ファイルにブロック参照エントリを一つ追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_block_entry { my $self = shift; my ($source_position, $target_position, $target_file_name) = @ARG; if (!$self->{'handle'}->printf("block\t%08x\t%08x\t%s\n", $source_position, $target_position, $target_file_name)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; return 0; } $self->{'entry_count'}++; return 1; } # # 書式: # add_position_entry(source_position, target_position, # target_file_name) # source_position # 参照元の位置 # target_position # 参照先の位置 (0 以上の整数値) # target_file_name # 参照先のファイル名 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 参照情報ファイルに位置参照エントリを一つ追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_position_entry { my $self = shift; my ($source_position, $target_position, $target_file_name) = @ARG; if (!$self->{'handle'}->printf("position\t%08x\t%08x\t%s\n", $source_position, $target_position, $target_file_name)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; return 0; } $self->{'entry_count'}++; return 1; } # # 書式: # add_tag_entry(source_position, target_tag) # source_position # 参照元の位置 # target_tag # 参照先の位置 (タグ名) # メソッドの区分: # public インスタンスメソッド。 # 説明: # 参照情報ファイルにタグ参照エントリを一つ追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_tag_entry { my $self = shift; my ($source_position, $target_tag) = @ARG; if (!$self->{'handle'}->printf("tag\t%08x\t%s\n", $source_position, $target_tag)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; return 0; } $self->{'entry_count'}++; return 1; } ###################################################################### # <インスタンス変数の値を返すメソッド群> # # 書式: # インスタンス変数名() # メソッドの区分: # public インスタンスメソッド。 # 戻り値: # インスタンス変数の値を返す。 # sub file_name { my $self = shift; return $self->{'file_name'}; } sub reference_file_name { my $self = shift; return $self->{'reference_file_name'}; } sub entry_count { my $self = shift; return $self->{'entry_count'}; } sub error_message { my $self = shift; return $self->{'error_message'}; } 1; freepwing-1.5.orig/src/Makefile.in0000644000175000017500000002277211022411535016462 0ustar mhattamhatta# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(pkgperllibdir)" pkgperllibDATA_INSTALL = $(INSTALL_DATA) DATA = $(pkgperllib_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GNUMAKE = @GNUMAKE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SORT = @SORT@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ perllibdir = @perllibdir@ pkgdocdir = @pkgdocdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkgperllibdir = ${perllibdir}/FreePWING pkgperllib_DATA = BaseText.pm BaseUserChar.pm BaseWord.pm CharConv.pm \ ColorGraphic.pm Control.pm EndWord.pm FullUserChar.pm \ HalfUserChar.pm Heading.pm Index.pm KeyWord.pm Link.pm RefSound.pm \ RefUserChar.pm Reference.pm Sort.pm Sound.pm Tag.pm Text.pm \ Word.pm Word2.pm EXTRA_DIST = BaseText.pm BaseUserChar.pm BaseWord.pm CharConv.pm \ ColorGraphic.pm Control.pm EndWord.pm FullUserChar.pm \ HalfUserChar.pm Heading.pm Index.pm KeyWord.pm Link.pm RefSound.pm \ RefUserChar.pm Reference.pm Sort.pm.in Sound.pm Tag.pm Text.pm \ Word.pm Word2.pm CLEANFILES = Sort.pm all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-pkgperllibDATA: $(pkgperllib_DATA) @$(NORMAL_INSTALL) test -z "$(pkgperllibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgperllibdir)" @list='$(pkgperllib_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgperllibDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgperllibdir)/$$f'"; \ $(pkgperllibDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgperllibdir)/$$f"; \ done uninstall-pkgperllibDATA: @$(NORMAL_UNINSTALL) @list='$(pkgperllib_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgperllibdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgperllibdir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(pkgperllibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-pkgperllibDATA install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkgperllibDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkgperllibDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-pkgperllibDATA Sort.pm: Sort.pm.in rm -f $@ sed -e 's;\@SORT\@;$(SORT);' $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 644 $@ rm -f $@.tmp # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: freepwing-1.5.orig/src/Word2.pm0000644000175000017500000000776711022404342015755 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 1999, 2000 Motoyuki Kasahara # # 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, 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. # # # 前方一致単語クラス (FreePWING::Word)、後方一致単語クラス # (FreePWING::EndWord) を同時に操作するクラス # package FreePWING::Word2; require 5.005; require Exporter; use English; use FreePWING::Word; use FreePWING::EndWord; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(Exporter); # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; my $new = { # 前方一致単語 'word' => FreePWING::Word->new(), # 後方一致単語 'endword' => FreePWING::EndWord->new(), # 前方一致単語ファイル名 'word_file_name' => '', # 後方一致単語ファイル名 'endword_file_name' => '', # これまでに書き込んだエントリ数 'entry_count' => 0, # エラーメッセージ 'error_message' => '', }; return bless($new, $type); } # # 書式: # open(word_file_name, endword_file_name) # word_file_name # 開く前方一致単語ファイルの名前。 # endword_file_name # 開く後方一致単語ファイルの名前。 # メソッドの区分: # public インスタンスメソッド # 説明: # 書き込み用に単語ファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; my ($word_file_name, $endword_file_name) = @ARG; # # 単語ファイルを開く。 # $self->{'word_file_name'} = $word_file_name; $self->{'endword_file_name'} = $endword_file_name; if (!$self->{'word'}->open($word_file_name)) { $self->{'error_message'} = $self->{'word'}->error_message(); return 0; } if (!$self->{'endword'}->open($endword_file_name)) { $self->{'error_message'} = $self->{'endword'}->error_message(); $self->{'word'}->close(); return 0; } return 1; } # # 書式: # close() # メソッドの区分: # public インスタンスメソッド。 # 説明: # 単語ファイルを閉じる。開いていなければ、何もしない。 # 戻り値: # 常に 1 を返す。 # sub close { my $self = shift; $self->{'word'}->close(); $self->{'endword'}->close(); return 1; } # # 書式: # add_entry(word, heading_position, heading_file_name, # text_position, text_file_name) # word # 単語 # heading_position # 見出しの位置 # heading_file_name # 見出しのファイル名 # text_position # 本文の位置 # text_file_name # 本文のファイル名 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 単語ファイルに単語を一つ追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_entry { my $self = shift; if (!$self->{'word'}->add_entry(@ARG)) { $self->{'error_message'} = $self->{'word'}->error_message(); $self->{'endword'}->close(); return 0; } if (!$self->{'endword'}->add_entry(@ARG)) { $self->{'error_message'} = $self->{'endword'}->error_message(); $self->{'word'}->close(); return 0; } $self->{'entry_count'}++; return 1; } ###################################################################### # <インスタンス変数の値を返すメソッド群> # # 書式: # インスタンス変数名() # メソッドの区分: # public インスタンスメソッド。 # 戻り値: # インスタンス変数の値を返す。 # sub word_file_name { my $self = shift; return $self->{'word_file_name'}; } sub endword_file_name { my $self = shift; return $self->{'endword_file_name'}; } sub entry_count { my $self = shift; return $self->{'entry_count'}; } sub error_message { my $self = shift; return $self->{'error_message'}; } 1; freepwing-1.5.orig/src/BaseText.pm0000644000175000017500000006366211022404342016473 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 1999, 2000, 2001 Motoyuki Kasahara # # 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, 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. # # # テキストを収めたファイルを生成するクラス (FreePWING::Text, # FreePWING::Heading) のための基底仮想クラス。 # package FreePWING::BaseText; require 5.005; require Exporter; use English; use FileHandle; use FreePWING::Reference; use FreePWING::Tag; use FreePWING::RefUserChar; use FreePWING::RefSound; use FreePWING::CharConv; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK $block_length $max_indent_level); @ISA = qw(Exporter); # # ブロックの長さ (バイト数) # $block_length = 2048; # # 最大字下げレベル # $max_indent_level = 6; # # 最大バッファサイズ # my $max_buffer_size = 64 * 1024; # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; my $new = { # 本文ファイルのハンドラ 'handle' => FileHandle->new(), # 本文ファイル名 'file_name' => '', # 出力バッファ 'buffer' => '', # コンテキスト数 'context_count' => 0, # new_context() を無視するかどうか 'new_context_skip_flag' => 1, # 現在のコンテキストに対して書き込んだエントリ数 'entry_count' => 0, # これまでに書き込んだエントリ数 'total_entry_count' => 0, # new_entry() を無視するかどうか 'new_entry_skip_flag' => 1, # 現在のファイルのオフセット (これまでに書き込んだバイト数) 'position' => 0, # 現在のコンテキストの開始位置のオフセット 'context_position' => 0, # 現在のエントリの開始位置のオフセット 'entry_position' => 0, # 参照情報 'reference' => FreePWING::Reference->new(), # タグ 'tag' => FreePWING::Tag->new(), # 現在のエントリの修飾制御記述子の入れ子状態 'modifier_stack' => [], # 半角外字の定義情報 'half_user_characters' => FreePWING::RefUserChar->new(), # 全角外字の定義情報 'full_user_characters' => FreePWING::RefUserChar->new(), # 音声形式情報 (satomii) 'sounds' => FreePWING::RefSound->new(), # エラーメッセージ 'error_message' => '', }; return bless($new, $type); } # # 書式: # open(file_name, [reference_file_name, [tag_file_name]]) # file_name # テキストファイルの名前。 # reference_file_name # 参照情報ファイルの名前。 # tag_file_name # タグファイルの名前。 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 書き込み用のテキストファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; my ($file_name, $reference_file_name, $tag_file_name) = @ARG; # # テキストファイルを開く。 # $self->{'file_name'} = $file_name; if (!$self->{'handle'}->open($self->{'file_name'}, 'w')) { $self->{'error_message'} = "failed to open the file, $ERRNO: " . $self->{'file_name'}; $self->close_internal(); return 0; } binmode($self->{'handle'}); # # 参照情報ファイルを開く。 # if (defined($reference_file_name) && !$self->{'reference'}->open($reference_file_name)) { $self->{'error_message'} = $self->{'reference'}->error_message(); $self->close_internal(); return 0; } # # タグファイルを開く。 # if (defined($tag_file_name) && !$self->{'tag'}->open($tag_file_name)) { $self->{'error_message'} = $self->{'tag'}->error_message(); $self->close_internal(); return 0; } # # あらかじめ新しいコンテキストを開始しておく。 # if (!$self->new_context_internal()) { return 0; } return 1; } # # 書式: # close() # メソッドの区分: # public インスタンスメソッド。 # 説明: # オブジェクトが開いているテキストファイル群を閉じる。 # テキストファイルを開いていない場合は、何もしない。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub close { my $self = shift; if (!$self->{'handle'}->fileno()) { return 1; } # # 直前のエントリとコンテキストを終端する。 # if (!$self->add_entry_end()) { return 0; } if (!$self->add_context_end()) { return 0; } # # 半端なブロックの後方を "\0" で埋める。 # my $pad_length = $block_length - $self->{'handle'}->tell() % $block_length; if ($pad_length < $block_length && !$self->write_data("\0" x $pad_length)) { return 0; } # # バッファの内容をファイルに書きだす。 # if (!$self->flush_buffer()) { return 0; } # # ファイルを閉じる。 # $self->close_internal(); return 1; } # # 書式: # close_internal() # メソッドの区分: # private インスタンスメソッド。 # 説明: # close() の内部処理用メソッド。 # sub close_internal { my $self = shift; if ($self->{'handle'}->fileno()) { $self->{'handle'}->close(); } $self->{'reference'}->close_internal(); $self->{'tag'}->close_internal(); } # # 書式: # set_half_user_characters_in_file(file_name) # file_name # 全角外字定義ファイルの名前。 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 半角外字の定義ファイルを読み込む。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub set_half_user_characters_in_file { my $self = shift; my ($file_name) = @ARG; if (!$self->{'half_user_characters'} ->add_characters_in_file($file_name)) { $self->{'error_message'} = $self->{'half_user_characters'}->error_message(); $self->close_internal(); return 0; } return 1; } # # 書式: # set_full_user_characters_in_file(file_name) # file_name # 全角外字定義ファイルの名前。 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 半角外字の定義ファイルを読み込む。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub set_full_user_characters_in_file { my $self = shift; my ($file_name) = @ARG; if (!$self->{'full_user_characters'} ->add_characters_in_file($file_name)) { $self->{'error_message'} = $self->{'full_user_characters'}->error_message(); $self->close_internal(); return 0; } return 1; } # # 書式: # set_sounds_in_file(file_name) # file_name # 音声形式ファイルの名前。 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 音声形式ファイルを読み込む。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # # (satomii) # sub set_sounds_in_file { my $self = shift; my ($file_name) = @ARG; if (!$self->{'sounds'}->add_sounds_in_file($file_name)) { $self->{'error_message'} = $self->{'sounds'}->error_message(); $self->close_internal(); return 0; } return 1; } # # 書式: # write_data(data) # data # 書き込むデータ (文字列)。 # メソッドの区分: # private インスタンスメソッド。 # 説明: # 与えられたデータを実際にファイルに書き込む。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub write_data { my $self = shift; my ($data) = @ARG; $self->{'buffer'} .= $data; if ((length($self->{'buffer'}) > $max_buffer_size) && !$self->flush_buffer()) { return 0; } $self->{'position'} += length($data); return 1; } # # 書式: # flush_buffer() # メソッドの区分: # private インスタンスメソッド。 # 説明: # バッファの内容をファイルに書き込み、バッファをを空にします。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub flush_buffer { my $self = shift; if (!length($self->{'buffer'})) { return 1; } if (!$self->{'handle'}->print($self->{'buffer'})) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; $self->{'buffer'} = ''; $self->close_internal(); return 0; } $self->{'buffer'} = ''; return 1; } # # 書式: # new_context() # メソッドの区分: # public インスタンスメソッド。 # 説明: # 新たなコンテキストの開始を指示する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub new_context { my $self = shift; # # 最初のコンテキストに対して、明示的に new_context() を呼んだ # ときはすぐに返る。 # if (!$self->{'new_entry_skip_flag'}) { $self->{'new_context_skip_flag'} = 0; } if ($self->{'new_context_skip_flag'}) { $self->{'new_context_skip_flag'} = 0; return 1; } if (!$self->new_context_internal()) { return 0; } return 1; } # # 書式: # new_context_internal() # メソッドの区分: # private インスタンスメソッド。 # 説明: # 新たなエントリの開始を指示する。 # new_context() の実体。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub new_context_internal { my $self = shift; # # 直前のエントリとコンテキストの終端記号を書き込む。 # if (0 < $self->{'entry_count'} && !$self->add_entry_end()) { return 0; } if (0 < $self->{'context_count'} && !$self->add_context_end()) { return 0; } $self->{'entry_count'} = 0; $self->{'new_entry_count'} = 0; $self->{'new_entry_skip_flag'} = 1; $self->{'context_count'}++; # # 新たなコンテキストの開始記号を書き込み、あらかじめ新しいエントリ # を開始しておく。 # if (!$self->add_context_start()) { return 0; } $self->{'context_position'} = $self->{'position'}; if (!$self->new_entry_internal()) { return 0; } return 1; } # # 書式: # add_context_start() # メソッドの区分: # protected インスタンスメソッド。 # 説明: # 新たなコンテキストの開始を示す制御記述子を追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_context_start { my $self = shift; if (!$self->write_data(pack('n', 0x1f02))) { return 0; } return 1; } # # 書式: # add_context_end() # メソッドの区分: # protected インスタンスメソッド。 # 説明: # 現在のコンテキストの終端を示す制御記述子を追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_context_end { my $self = shift; if ($self->{'modifier_stack'}->[-1] eq 'half-width' && !$self->add_half_width_end()) { return 0; } if (!$self->write_data(pack('n', 0x1f03))) { return 0; } return 1; } # # 書式: # new_entry() # メソッドの区分: # public インスタンスメソッド。 # 説明: # 新たなエントリの開始を指示する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub new_entry { my $self = shift; # # 最初のエントリに対して、明示的に new_entry() を呼んだときは # すぐに返る。 # if ($self->{'new_entry_skip_flag'}) { $self->{'new_entry_skip_flag'} = 0; return 1; } if (!$self->new_entry_internal()) { return 0; } return 1; } # # 書式: # new_entry_internal() # メソッドの区分: # private インスタンスメソッド。 # 説明: # 新たなエントリの開始を指示する。 # new_entry() の実体。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub new_entry_internal { my $self = shift; # # 直前のエントリの終端記号を書き込む。 # if (0 < $self->{'entry_count'} && !$self->add_entry_end()) { return 0; } $self->{'entry_position'} = $self->{'position'}; # # エントリの開始記号を書き込む。 # if (!$self->add_entry_start()) { return 0; } $self->{'entry_count'}++; $self->{'total_entry_count'}++; return 1; } # # 書式: # add_entry_start() # メソッドの区分: # protected インスタンスメソッド。 # 説明: # 新たなエントリの開始を示す制御記述子を追加する。 # (継承したクラスで上書きするためのメソッド) # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_entry_start { return 1; } # # 書式: # add_entry_end() # メソッドの区分: # protected インスタンスメソッド。 # 説明: # 現在のエントリの終端を示す制御記述子を追加する。 # (継承したクラスで上書きするためのメソッド) # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_entry_end { my $self = shift; if ($self->{'modifier_stack'}->[-1] eq 'half-width' && !$self->add_half_width_end()) { return 0; } if (0 < @{$self->{'modifier_stack'}}) { $self->{'error_message'} = "modifier not teminated before end of entry"; $self->close_internal(); return 0; } return 1; } # # 書式: # add_text(text) # text # テキストの文字列。 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 与えられたデータをテキストファイルに追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_text { my $self = shift; my ($text) = @ARG; # # 改行 ("\r", "\n") は無視。 # $text =~ s/[\r\n]//g; # # 水平タブ ("\t") は、まず空白に変換。 # $text =~ s/\t/ /g; my $word; for (;;) { if ($text =~ s/^([\x20-\x7f]+)//) { # # US-ASCII は半角扱い。 # $word = $1; if ($self->{'modifier_stack'}->[-1] ne 'half-width' && !$self->add_half_width_start()) { return 0; } $word =~ s/(.)/$ascii_to_jisx0208_table->[unpack("C",$1)-0x20]/g; if (!$self->write_data($word)) { return 0; } } elsif ($text =~ s/^(([\xa1-\xfe]{2})+)//) { # # JIS X 0208 文字はそのまま記録。 # $word = $1; if ($self->{'modifier_stack'}->[-1] eq 'half-width' && !$self->add_half_width_end()) { return 0; } $word =~ tr/\xa1-\xfe/\x21-\x7e/; if (!$self->write_data($word)) { return 0; } } elsif ($text =~ s/^((\x8e[\xa1-\xfe])+)//) { # # SS2 を用いた JIS X 0201 カナは JIS X 0208 カナに変換。 # $word = $1; if ($self->{'modifier_stack'}->[-1] eq 'half-width' && !$self->add_half_width_end()) { return 0; } $word =~ s/\x8e(.)/$jisx0201_to_jisx0208_table->[unpack("C",$1)-0xa0]/g; if (!$self->write_data($word)) { return 0; } } else { if(length($text)) { $self->{'error_message'} = sprintf("invalid character: \\x%02x", unpack("C", $text)); $self->close_internal(); return 0; } else { $self->{'new_entry_skip_flag'} = 0; return 1; } } } } # # 書式: # add_half_user_character(character_name) # character_name # 外字の名前 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 与えられた半角外字をテキストファイルに追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_half_user_character { my $self = shift; my ($character_name) = @ARG; # # 外字名から文字番号を引く。外字名が登録されていなければエラー。 # my $character_number; $character_number = $self->{'half_user_characters'}->character($character_name); if (!defined($character_number)) { $self->{'error_message'} = $self->{'half_user_characters'}->error_message(); $self->close_internal(); return 0; } # # 必要に応じて半角開始指定子を書き込む。 # if ($self->{'modifier_stack'}->[-1] ne 'half-width' && !$self->add_half_width_start()) { return 0; } # # 外字の文字番号を書き込む。 # if (!$self->write_data(pack('n', $character_number))) { return 0; } return 1; } # # 書式: # add_full_user_character(character_name) # character_name # 外字の名前 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 与えられた全角外字をテキストファイルに追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_full_user_character { my $self = shift; my ($character_name) = @ARG; # # 外字名から文字番号を引く。外字名が登録されていなければエラー。 # my $character_number; $character_number = $self->{'full_user_characters'}->character($character_name); if (!defined($character_number)) { $self->{'error_message'} = $self->{'full_user_characters'}->error_message(); $self->close_internal(); return 0; } # # 必要に応じて半角終了指定子を書き込む。 # if ($self->{'modifier_stack'}->[-1] eq 'half-width' && !$self->add_half_width_end()) { return 0; } # # 外字の文字番号を書き込む。 # if (!$self->write_data(pack('n', $character_number))) { return 0; } return 1; } # # 書式: # add_entry_tag(tag) # tag # タグ名 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 現在のエントリの開始位置にタグを追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_entry_tag { my $self = shift; my ($tag) = @ARG; $tag =~ s/^/text:/; return $self->{'tag'}->add_entry($tag, $self->{'entry_position'}); } # # 書式: # add_tag(tag) # tag # タグ名 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 現在のテキスト位置にタグを追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_tag { my $self = shift; my ($tag) = @ARG; $tag =~ s/^/text:/; return $self->{'tag'}->add_entry($tag, $self->{'position'}); } ###################################################################### # <制御記述子を追加するメソッド群> # # 書式: # メソッド名(argument) # argument # 制御記述子の引数。詳しくはメソッド毎に説明。とくに # 記載がないメソッドは引数を取らない。 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 制御記述子をテキストに追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # # # すべての制御開始指定子に共通の処理 # sub add_modifier_start { my $self = shift; my ($modifier, $data) = @ARG; if ($modifier ne 'half-width' && $self->{'modifier_stack'}->[-1] eq 'half-width' && !$self->add_half_width_end()) { return 0; } if (grep($_ eq $modifier, @{$self->{'modifier_stack'}}) != 0) { $self->{'error_message'} = "duplicate $modifier modifier"; $self->close_internal(); return 0; } if (!$self->write_data($data)) { return 0; } $self->{'new_entry_skip_flag'} = 0; push(@{$self->{'modifier_stack'}}, $modifier); return 1; } # # すべての制御終了指定子に共通の処理 # sub add_modifier_end { my $self = shift; my ($modifier, $data) = @ARG; if ($modifier ne 'half-width' && $self->{'modifier_stack'}->[-1] eq 'half-width' && !$self->add_half_width_end()) { return 0; } if ($self->{'modifier_stack'}->[-1] ne $modifier) { $self->{'error_message'} = "unexpected the end of $modifier modifier"; $self->close_internal(); return 0; } if (!$self->write_data($data)) { return 0; } $self->{'new_entry_skip_flag'} = 0; pop(@{$self->{'modifier_stack'}}); return 1; } # # 検索キー # sub add_keyword_start { my $self = shift; if (!$self->add_modifier_start('keyword', pack('nn', 0x1f41, 0x0100))) { return 0; } return 1; } # # 検索キー終了 # sub add_keyword_end { my $self = shift; if (!$self->add_modifier_end('keyword', pack('n', 0x1f61))) { return 0; } return 1; } # # 別項目参照 # sub add_reference_start { my $self = shift; if (!$self->add_modifier_start('reference', pack('n', 0x1f42))) { return 0; } return 1; } # # 項目参照終了 # 参照先の位置を示すタグ名を引数で指定。 # sub add_reference_end { my $self = shift; my ($target_position) = @ARG; $target_position =~ s/^/text:/; if (!$self->add_modifier_end('reference', pack('nNn', 0x1f62, 0, 0))) { return 0; } if (!$self->{'reference'} ->add_tag_entry($self->{'position'} - 6, $target_position)) { $self->{'error_message'} = $self->{'reference'}->error_message(); $self->close_internal(); return 0; } return 1; } # # カラー図版参照 (BMP 版) # カラー図版名を引数で指定。 # sub add_color_graphic_start { my $self = shift; my ($picture_name) = @ARG; $picture_name =~ s/^/cgraph:/; if (!$self->add_modifier_start('color-graphic', pack('n3N3n', 0x1f4d, 0x0009, 0x0001, 0, 0, 0, 0))) { return 0; } if (!$self->{'reference'} ->add_tag_entry($self->{'position'} - 6, $picture_name)) { $self->{'error_message'} = $self->{'reference'}->error_message(); $self->close_internal(); return 0; } return 1; } # # カラー図版参照 (JPG 版) # カラー図版名を引数で指定。 # sub add_jpeg_graphic_start { my $self = shift; my ($picture_name) = @ARG; $picture_name =~ s/^/cgraph:/; if (!$self->add_modifier_start('color-graphic', pack('n3N3n', 0x1f4d, 0x1209, 0x0001, 0, 0, 0, 0))) { return 0; } if (!$self->{'reference'} ->add_tag_entry($self->{'position'} - 6, $picture_name)) { $self->{'error_message'} = $self->{'reference'}->error_message(); $self->close_internal(); return 0; } return 1; } # # カラー図版参照終了 (BMP 版) # sub add_color_graphic_end { my $self = shift; if (!$self->add_modifier_end('color-graphic', pack('n', 0x1f6d))) { return 0; } return 1; } # # カラー図版参照終了 (JPG 版) # sub add_jpeg_graphic_end { my $self = shift; if (!$self->add_modifier_end('color-graphic', pack('n', 0x1f6d))) { return 0; } return 1; } # # 音声参照 # 音声データの名前を引数で指定。 # sub add_sound_start { my $self = shift; my ($sound_name) = @ARG; # 音声形式は FreePWING::RefSound 経由で取得する。(satomii) if (!$self->add_modifier_start( 'sound', pack('nC2nNnNn', 0x1f4a, 0, $self->{'sounds'}->sound_type($sound_name), $self->{'sounds'}->sound_format($sound_name), 0, 0, 0, 0))) { return 0; } # if (!$self->add_modifier_start('sound', # pack('n3N3', 0x1f4a, 0, 0x0012, 0, 0, 0))) { # return 0; # } if (!$self->{'reference'} ->add_tag_entry($self->{'position'} - 12, "sound:$sound_name")) { $self->{'error_message'} = $self->{'reference'}->error_message(); $self->close_internal(); return 0; } if (!$self->{'reference'} ->add_tag_entry($self->{'position'} - 6, "sound-end:$sound_name")) { $self->{'error_message'} = $self->{'reference'}->error_message(); $self->close_internal(); return 0; } return 1; } # # 音声参照終了 # 参照先の位置を示すタグ名を引数で指定。 # sub add_sound_end { my $self = shift; if (!$self->add_modifier_end('sound', pack('n', 0x1f6a))) { return 0; } return 1; } # # 半角開始指定 # sub add_half_width_start { my $self = shift; if (!$self->add_modifier_start('half-width', pack('n', 0x1f04))) { return 0; } return 1; } # # 半角終了指定 # sub add_half_width_end { my $self = shift; if (!$self->add_modifier_end('half-width', pack('n', 0x1f05))) { return 0; } return 1; } # # 下添え字開始指定 # sub add_subscript_start { my $self = shift; if (!$self->add_modifier_start('subscript', pack('n', 0x1f06))) { return 0; } return 1; } # # 下添え字終了指定 # sub add_subscript_end { my $self = shift; if (!$self->add_modifier_end('subscript', pack('n', 0x1f07))) { return 0; } return 1; } # # 字下げ指定 # 字下げ量 (2 〜 $max_indent_level) を引数で指定。 # sub add_indent_level { my $self = shift; my ($level) = @ARG; if ($level < 2 || $max_indent_level < $level) { $self->{'error_message'} = "invalid indent level: $level"; $self->close_internal(); return 0; } if (!$self->write_data(pack('nn', 0x1f09, $level))) { return 0; } $self->{'new_entry_skip_flag'} = 0; return 1; } # # 改行 # sub add_newline { my $self = shift; if ($self->{'modifier_stack'}->[-1] eq 'half-width' && !$self->add_half_width_end()) { return 0; } if (0 < @{$self->{'modifier_stack'}}) { $self->{'error_message'} = "modifier not teminated before newline"; $self->close_internal(); return 0; } if (!$self->write_data(pack('n', 0x1f0a))) { return 0; } $self->{'new_entry_skip_flag'} = 0; return 1; } # # 上添え字開始指定 # sub add_superscript_start { my $self = shift; if (!$self->add_modifier_start('superscript', pack('n', 0x1f0e))) { return 0; } return 1; } # # 上添え字終了指定 # sub add_superscript_end { my $self = shift; if (!$self->add_modifier_end('superscript', pack('n', 0x1f0f))) { return 0; } return 1; } # # 分割禁止開始指定 # sub add_nowrap_start { my $self = shift; if (!$self->add_modifier_start('nowrap', pack('n', 0x1f10))) { return 0; } return 1; } # # 分割禁止終了指定 # sub add_nowrap_end { my $self = shift; if (!$self->add_modifier_end('nowrap', pack('n', 0x1f11))) { return 0; } return 1; } # # 強調開始指定 # sub add_emphasis_start { my $self = shift; if (!$self->add_modifier_start('emphasis', pack('n', 0x1f12))) { return 0; } return 1; } # # 強調終了指定 # sub add_emphasis_end { my $self = shift; if (!$self->add_modifier_end('emphasis', pack('n', 0x1f13))) { return 0; } return 1; } # # 別フォント開始指定 # sub add_font_start { my $self = shift; my ($font_name) = @ARG; my $parameter; if ($font_name eq 'italic') { $parameter = 1; } elsif ($font_name eq 'bold') { $parameter = 3; } else { $self->{'error_message'} = "unknown font name $font_name"; $self->close_internal(); return 0; } if (!$self->add_modifier_start('font', pack('nn', 0x1fe0, $parameter))) { return 0; } return 1; } # # 別フォント終了指定 # sub add_font_end { my $self = shift; if (!$self->add_modifier_end('font', pack('n', 0x1fe1))) { return 0; } return 1; } ###################################################################### # <インスタンス変数の値を返すメソッド群> # # 書式: # インスタンス変数名() # メソッドの区分: # public インスタンスメソッド。 # 戻り値: # インスタンス変数の値を返す。 # sub file_name { my $self = shift; return $self->{'file_name'}; } sub reference_file_name { my $self = shift; return $self->{'reference'}->file_name(); } sub tag_file_name { my $self = shift; return $self->{'tag'}->file_name(); } sub half_user_character { my $self = shift; my ($name) = @ARG; return $self->{'half_user_characters'}->character($name); } sub full_user_character { my $self = shift; my ($name) = @ARG; return $self->{'full_user_characters'}->character($name); } sub context_position { my $self = shift; return $self->{'context_position'}; } sub entry_position { my $self = shift; return $self->{'entry_position'}; } sub context_count { my $self = shift; return $self->{'context_count'}; } sub entry_count { my $self = shift; return $self->{'entry_count'}; } sub total_entry_count { my $self = shift; return $self->{'total_entry_count'}; } sub error_message { my $self = shift; return $self->{'error_message'}; } 1; freepwing-1.5.orig/src/Index.pm0000644000175000017500000004255311022404342016017 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 1999, 2000 Motoyuki Kasahara # # 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, 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. # # # インデックスを収めたファイルを生成するクラス。 # package FreePWING::Index; require 5.005; require Exporter; use English; use FileHandle; use FreePWING::Reference; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK $suffix $block_length $max_depth $header_length); @ISA = qw(Exporter); # # ブロックの長さ (バイト数) # $block_length = 2048; # # ブロックの長さ (バイト数) # $block_length = 2048; # # インデックスファイルの最大の深さ。 # $max_depth = 10; # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; my $new = { # インデックスファイル名 (の基本名) 'file_name' => '', # 参照ファイル名 (の基本名) 'reference_file_name' => '', # ファイル名の生成方法 'godparent' => sub {return $ARG[0] . $ARG[1]}, # インデックスの各層 'layers' => [], # インデックスの層の数 'depth' => 0, # これまでに書き込んだエントリ数 'entry_count' => 0, # エラーメッセージ 'error_message' => '', }; return bless($new, $type); } # # 書式: # open(file_name, reference_file_name, [godparent]) # file_name # 開くインデックスファイル名 (の基本名)。 # reference_file_name # 開く参照情報ファイル名 (の基本名)。 # godparent # ファイル名の基本名から正式名を生成するルーチンへの # リファレンス。 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 指定されたインデックスファイル群を開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; my ($file_name, $reference_file_name, $godparent) = @ARG; $self->{'file_name'} = $file_name; $self->{'reference_file_name'} = $reference_file_name; if (defined($godparent)) { $self->{'godparent'} = $godparent; } # # 最初の階層のインデックスを開く。 # if (!$self->open_upper_layer()) { return 0; } return 1; } # # 書式: # open_upper_layer() # メソッドの区分: # private インスタンスメソッド。 # 説明: # 次の階層のインデックスファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open_upper_layer { my $self = shift; # # $self->{'layers'} に階層を追加。 # my $layer = { # この層の深さ 'level' => $self->{'depth'}, # インデックスファイルのハンドル 'handle' => FileHandle->new(), # インデックスファイル名 'file_name' => &{$self->{'godparent'}}($self->{'file_name'}, $self->{'depth'}), # 参照情報 'reference' => FreePWING::Reference->new(), # これまでに書き込んだブロック数 'block_count' => 1, # 書き込みを保留しているエントリのキュー 'entry_queue' => [], # そのブロックの固定単語長 (= 単語の最大長) # (上位インデックスでのみ使用) 'block_word_length' => 0, # 現在のブロックに書き込んだバイト数 # (下位インデックスでのみ使用) 'block_length' => 4, }; # # 本階層用の参照情報ファイルを開く。 # my $reference_file_name = &{$self->{'godparent'}}($self->{'reference_file_name'}, $self->{'depth'}); if (!$layer->{'reference'}->open($reference_file_name)) { $self->close_internal(); return 0; } # # 本階層用のインデックスファイルを開く。 # if (!$layer->{'handle'}->open($layer->{'file_name'}, 'w')) { $self->{'error_message'} = "$PROGRAM_NAME: failed to open the file, $ERRNO: " . $layer->{'file_name'}; $self->{'reference'}->close(); $self->close_internal(); return 0; } binmode($layer->{'handle'}); push(@{$self->{'layers'}}, $layer); $self->{'depth'}++; return 1; } # # 書式: # close() # メソッドの区分: # public インスタンスメソッド。 # 説明: # オブジェクトが開いているインデックスファイル群を閉じる。 # インデックスファイルを開いていない場合は、何もしない。 # 戻り値: # 常に 1 を返す。 # sub close { my $self = shift; # # インデックスファイルを開いていなければ、メソッドを抜ける。 # if (!$self->{'layers'}->[0]->{'handle'}->fileno()) { return 1; } # # 最後の単語を上位インデックスに登録する。 # my $last_word = $self->{'layers'}->[0]->{'entry_queue'}->[-1]->[0]; my $i; for ($i = 1; $i < $self->{'depth'}; $i++) { my $last_position = ($self->{'layers'}->[$i - 1]->{'block_count'} - 1) * $block_length; if (!$self->add_medium_layer_entry($i, $last_word, $last_position)) { return 0; } } # # 下位インデックスファイルを閉じる。 # if (!$self->write_leaf_layer_block(1)) { return 0; } # # 上位インデックスファイルを閉じる。 # my $i; for ($i = 1; $i < $self->{'depth'}; $i++) { if (!$self->write_medium_layer_block($i, 1)) { return 0; } } $self->close_internal(); return 1; } # # 書式: # close_internal() # メソッドの区分: # private インスタンスメソッド。 # 説明: # 他のメソッド処理中に異常が起きた場合の処理を行う。 # sub close_internal { my $self = shift; my $i; my $current_layer; my $i; for ($i = 0; $i < $self->{'depth'}; $i++) { if ($self->{'layers'}->[$i]->{'handle'}->fileno()) { $self->{'layers'}->[$i]->{'handle'}->close(); } $self->{'layers'}->[$i]->{'reference'}->close(); } return 1; } # # 書式: # error_message() # メソッドの区分: # public インスタンスメソッド。 # 説明: # 最後に発生したエラーのメッセージを返す。 # sub error_message { my $self = shift; return $self->{'error_message'}; } # # 書式: # add_entries_in_file(file_name) # file_name # インデックスのエントリが記されたファイル。 # メソッドの区分: # public インスタンスメソッド。 # 説明: # file_name の中に記されている全エントリを、インデックスファイル # 群に対して追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_entries_in_file { my $self = shift; my ($file_name) = @ARG; # # $file_name を開く。 # my $handle = FileHandle->new(); if (!$handle->open($file_name, 'r')) { $self->{'error_message'} = "failed to open the file, $ERRNO: $file_name"; $self->close_internal(); return 0; } # # $file_name を読み、各行に記されているエントリを $self に追加 # する。 # my $line; my @line_fields; for (;;) { $line = $handle->getline(); if (!defined($line)) { last; } chomp $line; @line_fields = split(/\t/, $line); my $word = $line_fields[0]; my $heading_position = hex($line_fields[1]); my $heading_file_name = $line_fields[2]; my $text_position = hex($line_fields[3]); my $text_file_name = $line_fields[4]; if (!$self->add_entry($word, $heading_position, $heading_file_name, $text_position, $text_file_name)) { $self->close_internal(); return 0; } } # # $file_name のハンドルを閉じる。 # $handle->close(); return 1; } # # 書式: # add_entry(word, heading_position, heading_file, text_position, # text_file) # word # インデックスへ登録する単語。正規化されていること。 # heading_position # heading_file_name # エントリの見出しを載せているファイル名とファイル内の位置。 # text_position # text_file_name # エントリの本文を載せているファイルとファイル内の位置。 # メソッドの区分: # public インスタンスメソッド。 # 説明: # インデックスファイル群にエントリを一つ追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_entry { my $self = shift; return $self->add_leaf_layer_entry(@ARG); } # # add_entry() の実体 # sub add_leaf_layer_entry { my $self = shift; my ($word, $heading_position, $heading_file_name, $text_position, $text_file_name) = @ARG; my $leaf_layer = $self->{'layers'}->[0]; # # 改ページの必要性が生じたら、エントリキューの内容を 1 つのブロック # にして書き出して、次のページへ進む。 # if ($block_length < $leaf_layer->{'block_length'} + length($word) + 13) { if (!$self->write_leaf_layer_block()) { return 0; } # # 最後のエントリを上位エントリに追加する。 # if ($self->{'depth'} == 1 && !$self->open_upper_layer()) { return 0; } my $medium_word = $leaf_layer->{'entry_queue'}->[-1]->[0]; my $medium_position = ($leaf_layer->{'block_count'} - 1) * $block_length; if (!$self->add_medium_layer_entry(1, $medium_word, $medium_position)) { return 0; } # # エントリキューをリセットする。 # @{$self->{'layers'}->[0]->{'entry_queue'}} = (); $self->{'layers'}->[0]->{'block_length'} = 4; $leaf_layer->{'block_count'}++; } # # エントリキューに、今回のエントリを足す。 # push(@{$self->{'layers'}->[0]->{'entry_queue'}}, [$word, $heading_position, $heading_file_name, $text_position, $text_file_name]); $self->{'layers'}->[0]->{'block_length'} += length($word) + 13; return 1; } # # 書式: # write_leaf_layer_block(close_flag) # close_flag # インデックスを閉じるために呼ぶときは、true がセッ # トされなければならない。 # メソッドの区分: # private インスタンスメソッド。 # 説明: # 下位インデックスの現在のエントリキューをまとめて 1 ブロックに # して書き出す。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub write_leaf_layer_block { my $self = shift; my ($close_flag) = @ARG; my $leaf_layer = $self->{'layers'}->[0]; # # エントリキューが空なら、メソッドを抜ける。 # if (@{$leaf_layer->{'entry_queue'}} == 0) { return 1; } # # ブロックのヘッダを書き込む。 # my $block_id = 0x80; if ($leaf_layer->{'block_count'} == 1) { $block_id |= 0x40; } if ($close_flag) { $block_id |= 0x20; } if (!$leaf_layer->{'handle'}-> print(pack("CCn", $block_id, 0, scalar(@{$leaf_layer->{'entry_queue'}})))) { $self->close_internal(); return 0; } # # エントリキューの各エントリを書き込む。 # my $source_position = ($leaf_layer->{'block_count'} - 1) * $block_length + 4; my $i; for ($i = 0; $i < scalar(@{$leaf_layer->{'entry_queue'}}); $i++) { my $entry = $leaf_layer->{'entry_queue'}->[$i]; my $word = $entry->[0]; my $word_length = length($word); my $heading_position = $entry->[1]; my $heading_file_name = $entry->[2]; my $text_position = $entry->[3]; my $text_file_name = $entry->[4]; # # エントリを書き込む。 # if (!$leaf_layer->{'handle'} ->print(pack("Ca*NnNn", $word_length, $word, 0, 0, 0, 0))) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $leaf_layer->{'file_name'}; $self->close_internal(); return 0; } # # テキストと見出しの参照情報を書き込む。 # if (!$leaf_layer->{'reference'} ->add_position_entry($source_position + $word_length + 7, $heading_position, $heading_file_name)) { $self->{'error_message'} = $self->{'reference'}->error_message(); $self->position_internal(); return 0; } if (!$leaf_layer->{'reference'} ->add_position_entry($source_position + $word_length + 1, $text_position, $text_file_name)) { $self->{'error_message'} = $self->{'reference'}->error_message(); $self->close_internal(); return 0; } $source_position += $word_length + 13; } # # 半端なブロックの後方を "\0" で埋める。 # my $pad_length = $block_length - $leaf_layer->{'block_length'}; if (0 < $pad_length && !$leaf_layer->{'handle'}->print("\0" x $pad_length)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $leaf_layer->{'file_name'}; $self->close_internal(); return 0; } return 1; } # # 書式: # add_medium_layer_entry(level, word, position) # level # word # インデックスへ登録する単語。正規化されていること。 # position # 一つ下の層のインデックスの位置。 # メソッドの区分: # private インスタンスメソッド。 # 説明: # インデックスファイル群にエントリを一つ追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_medium_layer_entry { my $self = shift; my ($level, $word, $position) = @ARG; my $current_layer = $self->{'layers'}->[$level]; # # 改ページの必要性が生じたら、エントリキューの内容を 1 つのブロック # にして書き出して、次のページへ進む。 # my $word_length = length($word); my $overflow = 0; if ($current_layer->{'block_word_length'} < $word_length) { if ($block_length < (scalar(@{$current_layer->{'entry_queue'}}) + 2) * ($word_length + 4) + 4) { $overflow = 1; } } else { if ($block_length < (scalar(@{$current_layer->{'entry_queue'}}) + 2) * ($current_layer->{'block_word_length'} + 4) + 4) { $overflow = 1; } } if ($overflow) { if (!$self->write_medium_layer_block($level)) { return 0; } # # 最後のエントリを上位エントリに追加する。 # if ($self->{'depth'} == $level + 1 && !$self->open_upper_layer()) { return 0; } my $upper_word = $current_layer->{'entry_queue'}->[-1]->[0]; my $upper_position = ($current_layer->{'block_count'} - 1) * $block_length; if (!$self->add_medium_layer_entry($level + 1, $upper_word, $upper_position)) { return 0; } # # エントリキューをリセット。 # @{$current_layer->{'entry_queue'}} = (); $current_layer->{'block_word_length'} = 0; $current_layer->{'block_count'}++; } # # エントリキューに、今回のエントリを足す。 # push(@{$current_layer->{'entry_queue'}}, [$word, $position]); if ($current_layer->{'block_word_length'} < $word_length) { $current_layer->{'block_word_length'} = $word_length; } return 1; } # # 書式: # write_medium_layer_block(level, close_flag) # level # インデックスの階層レベル。 # close_flag # インデックスを閉じるために呼ぶときは、true がセッ # トされなければならない。 # メソッドの区分: # private インスタンスメソッド。 # 説明: # level で指定された上位インデックスの現在のエントリキューを # まとめて 1 ブロックにして書き出す。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub write_medium_layer_block { my $self = shift; my ($level, $close_flag) = @ARG; my $current_layer = $self->{'layers'}->[$level]; # # エントリキューが空なら、メソッドを抜ける。 # if (@{$current_layer->{'entry_queue'}} == 0) { return 1; } # # ダミーのエントリ "\xff\xff...." をキューの末尾に追加する。 # if ($close_flag) { push(@{$current_layer->{'entry_queue'}}, ["\xff" x $current_layer->{'block_word_length'}, $current_layer->{'entry_queue'}->[-1]->[1]]); } # # ブロックのヘッダを書き込む。 # my $block_id = 0x00; if ($current_layer->{'block_count'} == 1) { $block_id |= 0x40; } if ($close_flag) { $block_id |= 0x20; } if (!$current_layer->{'handle'}-> print(pack("CCn", $block_id, $current_layer->{'block_word_length'}, scalar(@{$current_layer->{'entry_queue'}})))) { $self->close_internal(); return 0; } # # エントリキューの各エントリを書き込む。 # my $lower_layer_filename = $self->{'layers'}->[$level - 1]->{'file_name'}; my $source_position = ($current_layer->{'block_count'} - 1) * $block_length + 4; my $i; for ($i = 0; $i < scalar(@{$current_layer->{'entry_queue'}}); $i++) { my $word = $current_layer->{'entry_queue'}->[$i]->[0]; my $lower_layer_position = $current_layer->{'entry_queue'}->[$i]->[1]; # # エントリを書き込む。 # $word .= "\0" x ($current_layer->{'block_word_length'} - length($word)); if (!$current_layer->{'handle'}->print(pack("a*N", $word, 0))) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $current_layer->{'file_name'}; $self->close_internal(); return 0; } # # 一レベル下位のインデックスへの参照情報を書き込む。 # if (!$current_layer->{'reference'} ->add_block_entry($source_position + $current_layer->{'block_word_length'}, $lower_layer_position, $lower_layer_filename)) { $self->{'error_message'} = $self->{'reference'}->error_message(); $self->position_internal(); return 0; } $source_position += $current_layer->{'block_word_length'} + 4; } # # 半端なブロックの後方を "\0" で埋める。 # my $pad_length = $block_length - scalar(@{$current_layer->{'entry_queue'}}) * ($current_layer->{'block_word_length'} + 4) - 4; if (0 < $pad_length && !$current_layer->{'handle'}->print("\0" x $pad_length)) { $self->close_internal(); return 0; } # # 追加したダミーのエントリ "\xff\xff...." をキューから削除する。 # if ($close_flag) { pop(@{$current_layer->{'entry_queue'}}); } return 1; } ###################################################################### # <インスタンス変数の値を返すメソッド群> # # 書式: # インスタンス変数名() # メソッドの区分: # public インスタンスメソッド。 # 戻り値: # インスタンス変数の値を返す。 # sub file_name { my $self = shift; return $self->{'file_name'}; } sub reference_file_name { my $self = shift; return $self->{'reference_file_name'}; } sub depth { my $self = shift; return $self->{'depth'}; } sub entry_count { my $self = shift; return $self->{'entry_count'}; } sub error_message { my $self = shift; return $self->{'error_message'}; } 1; freepwing-1.5.orig/src/RefSound.pm0000644000175000017500000000537411022411754016502 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 2000 Motoyuki Kasahara # Copyright (c) 2005 Satomi I. # # 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, 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. # # # 音声形式ファイルを参照する。 # package FreePWING::RefSound; require 5.005; require Exporter; use English; use FileHandle; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(Exporter); # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; my $new = { 'format' => {}, 'error_message' => '', }; return bless($new, $type); } # # 書式: # add_sounds_in_file(file_name) # file_name # 読み込む音声形式ファイルの名前。 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 音声形式ファイルを読み込む。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_sounds_in_file { my $self = shift; my ($file_name) = @ARG; # # ファイルを開く。 # my $handle = FileHandle->new(); if (!$handle->open($file_name, 'r')) { $self->{'error_message'} = "failed to open the file, $ERRNO: $file_name"; return 0; } # # 各行を読み込んでハッシュに格納する。 # my ($line, @fields); while (1) { $line = $handle->getline(); last if (!defined($line)); chomp($line); @fields = split(/\t/, $line); if (defined($self->{'sounds'}->{$fields[0]})) { $self->{'error_message'} = "redefined sound name, $fields[0]: line $NR, $file_name"; $self->close(); return 0; } $self->{'sounds'}->{$fields[0]} = [ map(hex, splice(@fields, 1)) ]; } # # ファイルを閉じる。 # $handle->close(); 1; } ###################################################################### # <インスタンス変数の値を返すメソッド群> # # 書式: # インスタンス変数名() # メソッドの区分: # public インスタンスメソッド。 # 戻り値: # インスタンス変数の値を返す。 # sub sound_type { my $self = shift; my ($tag) = @ARG; if (defined($self->{'sounds'}->{$tag})) { $self->{'sounds'}->{$tag}[0]; } } sub sound_format { my $self = shift; my ($tag) = @ARG; if (defined($self->{'sounds'}->{$tag})) { $self->{'sounds'}->{$tag}[1]; } } sub error_message { my $self = shift; $self->{'error_message'}; } 1; freepwing-1.5.orig/src/Link.pm0000644000175000017500000003206211022404342015637 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 1999, 2000 Motoyuki Kasahara # # 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, 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. # # # 複数のファイルを連結するためのクラス。 # package FreePWING::Link; require 5.005; require Exporter; use English; use FileHandle; use FreePWING::Reference; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK $block_length $block_reference $position_reference $tag_reference); @ISA = qw(Exporter); # # ブロックの長さ (バイト数) # $block_length = 2048; # # 参照情報の種別 # $block_reference = 0; $position_reference = 1; $tag_reference = 2; # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; my $new = { # 出力ファイルのハンドラ 'output_handle' => FileHandle->new(), # 出力ファイル名 'output_file_name' => '', # 連結する各ファイルのオフセット 'offset_table' => {}, # 入力ファイルの 3 つ組 # (入力ファイル、参照情報ファイル、タグファイル) 'input_file_trios' => [], # エラーメッセージ 'error_message' => '', }; return bless($new, $type); } # # 書式: # open(output_file_name) # output_file_name # 出力ファイルの名前。 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 書き込み用に、結合ファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; my ($output_file_name) = @ARG; # # 結合ファイルを開く。 # $self->{'output_file_name'} = $output_file_name; if (!$self->{'output_handle'}->open($self->{'output_file_name'}, 'w+')) { $self->{'error_message'} = "failed to open the file, $ERRNO: " . $self->{'output_file_name'}; $self->close_internal(); return 0; } binmode($self->{'output_handle'}); return 1; } # # 書式: # close() # メソッドの区分: # public インスタンスメソッド。 # 説明: # 参照情報、タグに従って結合ファイルを書き換えてから、結合ファ # イルを閉じる。結合ファイルを開いていなければ、何もしない。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub close { my $self = shift; # # 結合ファイルを開いていなければ、メソッドを抜ける。 # if (!$self->{'output_handle'}->fileno()) { return 1; } # # 結合ファイルの現在のサイズを得る。 # my $output_file_length = $self->{'output_handle'}->tell(); # # input_file_trios に登録された個々のタグファイルを処理する。 # my $tag_table = {}; my $file_trio; foreach $file_trio (@{$self->{'input_file_trios'}}) { my ($file_name, $reference_file_name, $tag_file_name) = @{$file_trio}; if (!defined($tag_file_name) || $tag_file_name eq '') { next; } # # タグファイルを開く。 # my $handle = FileHandle->new(); if (!$handle->open($tag_file_name, 'r')) { $self->{'error_message'} = "failed to open the file, $ERRNO: $tag_file_name"; $self->close_internal(); return 0; } # # 参照情報の各行を読む。 # my $line; my @line_fields; for (;;) { $line = $handle->getline(); if (!defined($line)) { last; } chomp $line; @line_fields = split(/\t/, $line); if (defined($tag_table->{$line_fields[0]})) { $self->{'error_message'} = "redefined tag, $line_fields[0]: line $NR, $tag_file_name"; $self->close_internal(); return 0; } $tag_table->{$line_fields[0]} = [hex($line_fields[1]), $file_name]; } # # タグファイルを閉じる。 # $handle->close(); } # # input_file_trios に登録された参照情報ファイル毎に処理する。 # my $file_trio; foreach $file_trio (@{$self->{'input_file_trios'}}) { my ($file_name, $reference_file_name, $tag_file_name) = @{$file_trio}; if (!defined($reference_file_name) || $reference_file_name eq '') { next; } # # 参照情報ファイルを開く。 # my $handle = FileHandle->new(); if (!$handle->open($reference_file_name, 'r')) { $self->{'error_message'} = "failed to open the file, $ERRNO: $reference_file_name"; $self->close_internal(); return 0; } # # 参照情報の各行を読む。 # my $line; my @line_fields; my $buffer = ''; my $max_buffer_size = $block_length * 32; my $buffer_position = 0; my $position_size; for (;;) { $line = $handle->getline(); if (!defined($line)) { last; } chomp $line; @line_fields = split(/\t/, $line); # # 行の内容を確認。 # my ($reference_type, $source_position, $target_position, $target_file_name); if ($line_fields[0] eq 'block') { $reference_type = $block_reference; $source_position = hex($line_fields[1]); $target_position = hex($line_fields[2]); $target_file_name = $line_fields[3]; } elsif ($line_fields[0] eq 'position') { $reference_type = $position_reference; $source_position = hex($line_fields[1]); $target_position = hex($line_fields[2]); $target_file_name = $line_fields[3]; } elsif ($line_fields[0] eq 'tag') { if (!defined($tag_table->{$line_fields[2]})) { $self->{'error_message'} = "unknown tag name, $line_fields[2]: line $NR, $reference_file_name"; $self->close_internal(); return 0; } $reference_type = $tag_reference; $source_position = hex($line_fields[1]); $target_position = $tag_table->{$line_fields[2]}->[0]; $target_file_name = $tag_table->{$line_fields[2]}->[1]; } else { $self->{'error_message'} = "invalid line: line $NR, $reference_file_name"; $self->close_internal(); return 0; } $position_size = ($reference_type == $block_reference) ? 4 : 6; # # 参照元と参照先の位置を算出する。 # if (!defined($self->{'offset_table'}->{$target_file_name})) { $self->{'error_message'} = "unknown target file name, $target_file_name: line $NR, $reference_file_name"; next; } $source_position += $self->{'offset_table'}->{$file_name}; $target_position += $self->{'offset_table'}->{$target_file_name}; # # 結合ファイルの参照位置を書き換え。 # if (($buffer_position + length($buffer) < $source_position) || ($buffer_position > $source_position)) { # # 書き込み位置に連続性がない場合はバッファを掃き出す。 # if (length($buffer)) { if (!$self->{'output_handle'} ->seek($buffer_position, FileHandle->SEEK_SET) || !$self->{'output_handle'}->print($buffer)) { $self->{'error_message'} = "failed to seek or write the file, $ERRNO: " . $self->{'output_file_name'}; $handle->close(); $self->close_internal(); return 0; } # $buffer_position += length($buffer); $buffer = ''; } $buffer_position = $source_position; } if ($buffer_position + length($buffer) < $source_position + $position_size) { # # バッファへの読み込み。 # my $tmp_buffer; if (!$self->{'output_handle'} ->seek($buffer_position + length($buffer), FileHandle->SEEK_SET) || !$self->{'output_handle'} ->read($tmp_buffer, $block_length)) { $self->{'error_message'} = "failed to seek or read the file, $ERRNO: " . $self->{'output_file_name'}; $handle->close(); $self->close_internal(); return 0; } $buffer .= $tmp_buffer; } # # 念の為エラーチェック。 # if ($buffer_position + length($buffer) < $source_position + $position_size) { $self->{'error_message'} = "unexpected position.: $reference_file_name"; $handle->close(); $self->close_internal(); return 0; } if ($reference_type == $block_reference) { substr($buffer, $source_position - $buffer_position, 4) = pack('N', $target_position / $block_length + 1); } elsif ($reference_type == $position_reference) { substr($buffer, $source_position - $buffer_position, 6) = pack('Nn', $target_position / $block_length + 1, $target_position % $block_length); } else { my $target_block = bcd($target_position / $block_length + 1); my $target_offset = bcd($target_position % $block_length); substr($buffer, $source_position - $buffer_position, 6) = pack('Nn', $target_block, $target_offset); } if ($source_position + $position_size - $buffer_position > $max_buffer_size) { # # 大きくなったバッファの掃き出し。 # if (!$self->{'output_handle'} ->seek($buffer_position, FileHandle->SEEK_SET) || !$self->{'output_handle'} ->print(substr($buffer, 0, $max_buffer_size))) { $self->{'error_message'} = "failed to seek or write the file, $ERRNO: " . $self->{'output_file_name'}; $handle->close(); $self->close_internal(); return 0; } $buffer_position += $max_buffer_size; substr($buffer, 0, $max_buffer_size) = ''; } } if (length($buffer)) { # # 終了処理としてバッファの掃き出し。 # if (!$self->{'output_handle'} ->seek($buffer_position, FileHandle->SEEK_SET) || !$self->{'output_handle'} ->print($buffer)) { $self->{'error_message'} = "failed to seek or write the file, $ERRNO: " . $self->{'output_file_name'}; $handle->close(); $self->close_internal(); return 0; } } # # 参照情報ファイルを閉じる。 # $handle->close(); } # # 結合ファイルを閉じる。 # $self->close_internal(); return 1; } # # $position の bcd 値を計算する。 # sub bcd { my ($position) = shift; my $bcd = 0; $bcd += (($position) % 10); $bcd += (($position / 10) % 10) << 4; $bcd += (($position / 100) % 10) << 8; $bcd += (($position / 1000) % 10) << 12; $bcd += (($position / 10000) % 10) << 16; $bcd += (($position / 100000) % 10) << 20; $bcd += (($position / 1000000) % 10) << 24; $bcd += (($position / 10000000) % 10) << 28; $bcd += (($position / 100000000) % 10) << 32; return $bcd; } # # 書式: # close_internal() # メソッドの区分: # private インスタンスメソッド。 # 説明: # close() の内部処理用メソッド。 # sub close_internal { my $self = shift; if ($self->{'output_handle'}->fileno()) { $self->{'output_handle'}->close(); } } # # 書式: # add_file(file_name, [[reference_file_name, tag_file_name]]) # file_name # リンクするファイルの名前。 # reference_file_name # リンクするファイルに対応する参照情報ファイルの名前。 # reference_file_name # リンクするファイルに対応するタグファイルの名前。 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 結合ファイルにファイルを一つ繋げる。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_file { my $self = shift; my ($file_name, $reference_file_name, $tag_file_name) = @ARG; # # $file_name, $reference_file_name を input_file_trios に登録。 # $self->{'offset_table'}->{$file_name} = $self->{'output_handle'}->tell(); push(@{$self->{'input_file_trios'}}, [$file_name, $reference_file_name, $tag_file_name]); # # $file_name を開く。 # my $handle = FileHandle->new(); if (!$handle->open($file_name, 'r')) { $self->{'error_message'} = "failed to open the file, $ERRNO: $file_name"; $self->close_internal(); return 0; } binmode($handle); # # $file_name を $self->{'output_file_name'} に追加。 # my ($buffer, $input_bytes); for (;;) { $input_bytes = $handle->read($buffer, $block_length); if (!defined($input_bytes)) { $self->{'error_message'} = "failed to read the file, $ERRNO: $file_name"; $handle->close(); $self->close_internal(); return 0; } if ($input_bytes == 0) { last; } if (!$self->{'output_handle'}->print($buffer)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'output_file_name'}; $handle->close(); $self->close_internal(); return 0; } } # # $file_name を閉じる。 # $handle->close(); # # $self->{'output_file_name'} の、半端なブロックの後方を "\0" で # 埋める。 # my $pad_length = $block_length - $self->{'output_handle'}->tell() % $block_length; if ($pad_length < $block_length && !$self->{'output_handle'}->print("\0" x $pad_length)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'output_file_name'}; $self->close_internal(); return 0; } return 1; } ###################################################################### # <インスタンス変数の値を返すメソッド群> # # 書式: # インスタンス変数名() # メソッドの区分: # public インスタンスメソッド。 # 戻り値: # インスタンス変数の値を返す。 # sub file_name { my $self = shift; return $self->{'output_file_name'}; } sub output_file_name { my $self = shift; return $self->{'output_file_name'}; } sub error_message { my $self = shift; return $self->{'error_message'}; } 1; freepwing-1.5.orig/src/Text.pm0000644000175000017500000000363211022404342015667 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 1999, 2000 Motoyuki Kasahara # # 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, 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. # # # 本文を収めたファイルを生成するためのクラス。 # package FreePWING::Text; require 5.005; use English; use FreePWING::BaseText; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(FreePWING::BaseText); # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; return $type->SUPER::new(); } # # 書式: # open(file_name, reference_file_name, tag_file_name) # file_name # 本文ファイルの名前。 # reference_file_name # 参照情報ファイルの名前。 # tag_file_name # タグファイルの名前。 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 書き込み用の本文ファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; my ($file_name, $reference_file_name, $tag_file_name) = @ARG; return $self->SUPER::open($file_name, $reference_file_name, $tag_file_name); } # # 書式: # add_entry_start() # メソッドの区分: # protected インスタンスメソッド。 # 説明: # 新たなエントリの開始を示す制御記述子を追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_entry_start { my $self = shift; return $self->write_data(pack('nn', 0x1f09, 0x0001)); } 1; freepwing-1.5.orig/src/EndWord.pm0000644000175000017500000000222011022404342016275 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 1999, 2000 Motoyuki Kasahara # # 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, 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. # # # 後方一致検索用の単語一覧を収めたファイルを生成するためのクラス。 # package FreePWING::EndWord; require 5.005; use FreePWING::BaseWord; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(FreePWING::BaseWord); # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; my $new = $type->SUPER::new(); $new->{'direction'} = $FreePWING::BaseWord::endword_direction; return $new; } 1; freepwing-1.5.orig/src/HalfUserChar.pm0000644000175000017500000000406311022404342017251 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 2000 Motoyuki Kasahara # # 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, 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. # # # 半角外字を納めたファイルを生成するクラス # package FreePWING::HalfUserChar; require 5.005; use FreePWING::BaseUserChar; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(FreePWING::BaseUserChar); # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; my $new = $type->SUPER::new(); # # 外字 (高さ 16 〜 48 ドット) の幅を設定。 # $new->{'bitmap_widths'}->[0] = 8; $new->{'bitmap_widths'}->[1] = 16; $new->{'bitmap_widths'}->[2] = 16; $new->{'bitmap_widths'}->[3] = 24; # # 外字 (高さ 16 〜 48 ドット) のビットマップの消費サイズを設定。 # $new->{'bitmap_sizes'}->[0] = 16; $new->{'bitmap_sizes'}->[1] = 48; $new->{'bitmap_sizes'}->[2] = 60; $new->{'bitmap_sizes'}->[3] = 144; # # 外字 (高さ 16 〜 48 ドット) が 1024 バイト内に収まる個数を設定。 # $new->{'bitmap_pad_cycles'}->[0] = 64; $new->{'bitmap_pad_cycles'}->[1] = 21; $new->{'bitmap_pad_cycles'}->[2] = 17; $new->{'bitmap_pad_cycles'}->[3] = 7; # # 外字 (高さ 16 〜 48 ドット) を書き込むときに、詰め物をして次の # ブロックに移る場合における詰め物のサイズを設定。 # $new->{'bitmap_pad_lengths'}->[0] = 0; $new->{'bitmap_pad_lengths'}->[1] = 16; $new->{'bitmap_pad_lengths'}->[2] = 4; $new->{'bitmap_pad_lengths'}->[3] = 16; return $new; } 1; freepwing-1.5.orig/src/Tag.pm0000644000175000017500000000711311022404342015454 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 1999, 2000 Motoyuki Kasahara # # 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, 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. # # # タグファイルを生成するためのクラス。 # package FreePWING::Tag; require 5.005; require Exporter; use FileHandle; use English; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(Exporter); # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; my $new = { # タグファイルのハンドラ 'handle' => FileHandle->new(), # タグファイル名 'file_name' => '', # これまでに書き込んだエントリ数 'entry_count' => 0, # エラーメッセージ 'error_message' => '', }; return bless($new, $type); } # # 書式: # open(file_name) # file_name # 開くタグファイルの名前。 # メソッドの区分: # public インスタンスメソッド # 説明: # 書き込み用にタグファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; my ($file_name) = @ARG; # # タグファイルを開く。 # $self->{'file_name'} = $file_name; if (!$self->{'handle'}->open($self->{'file_name'}, 'w')) { $self->{'error_message'} = "failed to open the file, $ERRNO: " . $self->{'file_name'}; $self->close_internal(); return 0; } return 1; } # # 書式: # close() # メソッドの区分: # public インスタンスメソッド。 # 説明: # タグファイルを閉じる。開いていなければ、何もしない。 # 戻り値: # 常に 1 を返す。 # sub close { my $self = shift; $self->close_internal(); return 1; } # # 書式: # close_internal() # メソッドの区分: # private インスタンスメソッド。 # 説明: # close() の内部処理用メソッド。 # sub close_internal { my $self = shift; if ($self->{'handle'}->fileno()) { $self->{'handle'}->close(); } } # # 書式: # add_entry(tag_name, target_position) # tag_name # タグ名 # position # 位置 # メソッドの区分: # public インスタンスメソッド。 # 説明: # タグファイルにタグを一つ追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_entry { my $self = shift; my ($tag_name, $position) = @ARG; if ($tag_name !~ /^[0-9A-Za-z_\:\-]*$/) { $self->{'error_message'} = "invalid tag name: $tag_name"; $self->close_internal(); return 0; } if (!$self->{'handle'}->printf("\%s\t%08x\n", $tag_name, $position)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; $self->close_internal(); return 0; } $self->{'entry_count'}++; return 1; } ###################################################################### # <インスタンス変数の値を返すメソッド群> # # 書式: # インスタンス変数名() # メソッドの区分: # public インスタンスメソッド。 # 戻り値: # インスタンス変数の値を返す。 # sub file_name { my $self = shift; return $self->{'file_name'}; } sub tag_file_name { my $self = shift; return $self->{'tag_file_name'}; } sub entry_count { my $self = shift; return $self->{'entry_count'}; } sub error_message { my $self = shift; return $self->{'error_message'}; } 1; freepwing-1.5.orig/src/Control.pm0000644000175000017500000001732411022404342016366 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 1999, 2000 Motoyuki Kasahara # # 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, 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. # # # 書籍管理情報を収めたファイルを生成するためのクラス。 # package FreePWING::Control; require 5.005; require Exporter; use English; use FileHandle; use FreePWING::Reference; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK $block_length); @ISA = qw(Exporter); # # ブロックの長さ (バイト数) # $block_length = 2048; # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; my $new = { 'handle' => FileHandle->new(), 'file_name' => '', 'entry_count' => 0, 'reference' => FreePWING::Reference->new(), 'error_message' => '', }; return bless($new, $type); } # # 書式: # open(file_name, reference_file_name) # file_name # 書籍管理情報ファイルの名前。 # reference_file_name # 参照情報ファイルの名前。 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 書き込み用に書籍管理情報ファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; my ($file_name, $reference_file_name) = @ARG; # # 書籍管理情報ファイルを開く。 # $self->{'file_name'} = $file_name; if (!$self->{'handle'}->open($self->{'file_name'}, 'w')) { $self->{'error_message'} = "failed to open the file, $ERRNO: " . $self->{'file_name'}; return 0; } binmode($self->{'handle'}); # # 参照情報ファイルを開く。 # if (!$self->{'reference'}->open($reference_file_name)) { $self->{'error_message'} = $self->{'reference'}->error_message(); $self->{'handle'}->close(); return 0; } # # 先頭 16 バイト (書籍構成要素数〜予備領域 2) を 0x00 で埋める。 # if (!$self->{'handle'}->print("\0" x 16)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; return 0; } return 1; } # # 書式: # close() # メソッドの区分: # public インスタンスメソッド。 # 説明: # 書籍管理情報ファイルを閉じる。開いていなければ、何もしない。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub close { my $self = shift; if (!$self->{'handle'}->fileno()) { return 1; } # # 半端なブロックの後方を "\0" で埋める。 # my $pad_length = $block_length - $self->{'handle'}->tell() % $block_length; if ($pad_length < $block_length && !$self->{'handle'}->print("\0" x $pad_length)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; return 0; } # # 書籍構成要素数を書き込む。 # if (!$self->{'handle'}->seek(0, FileHandle->SEEK_SET)) { $self->{'error_message'} = "failed to seek the file, $ERRNO: " . $self->{'file_name'}; return 0; } if (!$self->{'handle'}->print(pack('n', $self->{'entry_count'}))) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; return 0; } # # ファイルを閉じる。 # $self->close_internal(); return 1; } # # 書式: # close_internal() # メソッドの区分: # private インスタンスメソッド。 # 説明: # 他のメソッド処理中に異常が起きた場合の処理を行う。 # sub close_internal { my $self = shift; if ($self->{'handle'}->fileno()) { $self->{'handle'}->close(); } $self->{'reference'}->close_internal(); } # # 書式: # add_entry(id, parameter, file_name...) # id # 書籍構成要素の ID 値 (例: メニューなら 0x20) # parameter # 書籍構成要素のパラメタ # file_name # ファイル名 # メソッドの区分: # private インスタンスメソッド。 # 説明: # 書籍管理情報ファイルにエントリを一つ追加する。引数の最初 # のファイル名の先頭位置がエントリの先頭アドレスになり、引 # 数の全ファイルのサイズの合計がエントリの領域サイズになる。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_entry { my $self = shift; my ($id, $parameter, @file_names) = @ARG; my $length = 0; # # $file_name のサイズ (ブロック数) を得る。 # my $f; foreach $f (@file_names) { my $size = -s $f; if (!defined($size)) { $self->{'error_message'} = "failed to stat the file, $ERRNO: $f"; $self->close_internal(); return 0; } $length += ($size + $block_length - 1) / $block_length; } # # エントリ (16 バイト) を書き込む。 # if (!$self->{'handle'}->print(pack('CCNNNn', $id, "\0", 0, $length, $parameter, 0))) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; $self->close_internal(); return 0; } # # 先頭アドレス (先ほどの pack の最初の 'N' の位置) に参照情報を # 書き込む。 # my $position = $self->{'handle'}->tell() - 14; if (!$self->{'reference'}->add_block_entry($position, 0, $file_names[0])) { $self->{'error_message'} = $self->{'reference'}->error_message(); $self->close_internal(); return 0; } $self->{'entry_count'}++; return 1; } ###################################################################### # <書籍構成要素を追加するメソッド群> # # 書式: # メソッド名(file_name...) # file_name # ファイル名 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 書籍管理情報ファイルに特定の書籍構成要素を追加し、ファイル名 # と結び付ける。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # # # 本文データ # sub add_text_entry { my $self = shift; my ($file_name) = @ARG; return $self->add_entry(0x00, 0x02000000, $file_name); } # # 見出し # sub add_heading_entry { my $self = shift; my ($file_name) = @ARG; return $self->add_entry(0x05, 0x02000000, $file_name) && $self->add_entry(0x07, 0x02000000, $file_name); } # # メニュー表示用データ # sub add_menu_entry { my $self = shift; my ($file_name) = @ARG; return $self->add_entry(0x01, 0x02000000, $file_name); } # # 著作権表示データ # sub add_copyright_entry { my $self = shift; my ($file_name) = @ARG; return $self->add_entry(0x02, 0x02000000, $file_name); } # # 後方一致インデックス # sub add_endindex_entry { my $self = shift; my (@file_names) = @ARG; return $self->add_entry(0x71, 0x02415554, @file_names); } # # 条件検索インデックス # sub add_keyindex_entry { my $self = shift; my (@file_names) = @ARG; return $self->add_entry(0x80, 0x02415554, @file_names); } # # 前方一致インデックス # sub add_index_entry { my $self = shift; my (@file_names) = @ARG; return $self->add_entry(0x91, 0x02415554, @file_names); } # # カラー図版 # sub add_color_graphic_entry { my $self = shift; my (@file_names) = @ARG; return $self->add_entry(0xd2, 0x00000000, @file_names); } # # 音声 # sub add_sound_entry { my $self = shift; my (@file_names) = @ARG; return $self->add_entry(0xd8, 0x00000000, @file_names); } ###################################################################### # <インスタンス変数の値を返すメソッド群> # # 書式: # インスタンス変数名() # メソッドの区分: # public インスタンスメソッド。 # 戻り値: # インスタンス変数の値を返す。 # sub file_name { my $self = shift; return $self->{'file_name'}; } sub entry_count { my $self = shift; return $self->{'entry_count'}; } sub error_message { my $self = shift; return $self->{'error_message'}; } 1; freepwing-1.5.orig/src/Word.pm0000644000175000017500000000221111022404342015646 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 1999, 2000 Motoyuki Kasahara # # 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, 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. # # # 前方一致検索用の単語一覧を収めたファイルを生成するためのクラス。 # package FreePWING::Word; require 5.005; use FreePWING::BaseWord; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(FreePWING::BaseWord); # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; my $new = $type->SUPER::new(); $new->{'direction'} = $FreePWING::BaseWord::word_direction; return $new; } 1; freepwing-1.5.orig/src/Heading.pm0000644000175000017500000000403711022404342016302 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 1999, 2000 Motoyuki Kasahara # # 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, 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. # # # 見出しを収めたファイルを生成するためのクラス。 # package FreePWING::Heading; require 5.005; use English; use FreePWING::BaseText; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(FreePWING::BaseText); # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; return $type->SUPER::new(); } # # 書式: # open(file_name) # file_name # 見出しファイルの名前。 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 書き込み用の見出しファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; my ($file_name) = @ARG; return $self->SUPER::open($file_name); } # # 書式: # add_entry_end() # メソッドの区分: # protected インスタンスメソッド。 # 説明: # 現在のエントリの終端を示す制御記述子を追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_entry_end { my $self = shift; if (!$self->SUPER::add_entry_end()) { return 0; } if (!$self->write_data(pack('n', 0x1f0a))) { return 0; } return 1; } # # FreePWING::BaseText で定義されている制御記述子追加メソッドをいくつ # か取り消す。 # undef &new_context; undef &add_tag; undef &add_keyword_start; undef &add_keyword_end; undef &add_reference_start; undef &add_reference_end; undef &add_newline; undef &add_indent_level; 1; freepwing-1.5.orig/src/Sound.pm0000644000175000017500000003451311022404342016035 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 2001 Motoyuki Kasahara # # 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, 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. # # # 音声 (WAVE) を収めたファイルを生成するクラス # package FreePWING::Sound; require 5.005; require Exporter; use English; use FileHandle; use FreePWING::Tag; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK $block_length $tag_prefix); @ISA = qw(Exporter); # # ブロックの長さ (バイト数) # $block_length = 2048; # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; my $new = { # バイナリファイルのハンドラ 'handle' => FileHandle->new(), # バイナリファイル名 'file_name' => '', # 書き込んだエントリ数 'entry_count' => 0, # バイナリファイルのオフセット (これまでに書き込んだバイト数) 'position' => 0, # タグ 'tag' => FreePWING::Tag->new(), # 終了タグ (satomii) 'end_tag_prefix' => 'sound-end', # 音声形式ファイル (satomii) 'fmt_file_name' => '', 'fmt_handle' => FileHandle->new(), # エラーメッセージ 'error_message' => '', }; return bless($new, $type); } # # 書式: # open(file_name, [tag_file_name, [fmt_file_name]]) # file_name # テキストファイルの名前。 # tag_file_name # タグファイルの名前。 # fmt_file_name # 音声形式ファイルの名前。 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 書き込み用のテキストファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; my ($file_name, $tag_file_name, $fmt_file_name) = @ARG; # # ファイルを開く。 # $self->{'file_name'} = $file_name; if (!$self->{'handle'}->open($self->{'file_name'}, 'w')) { $self->{'error_message'} = "failed to open the file, $ERRNO: " . $self->{'file_name'}; $self->close_internal(); return 0; } binmode($self->{'handle'}); # # タグファイルを開く。 # if (defined($tag_file_name) && !$self->{'tag'}->open($tag_file_name)) { $self->{'error_message'} = $self->{'tag'}->error_message(); $self->close_internal(); return 0; } # # 音声形式ファイルを開く。(satomii) # if (defined($fmt_file_name)) { $self->{'fmt_file_name'} = $fmt_file_name; if (!$self->{'fmt_handle'}->open($fmt_file_name, 'w')) { $self->{'error_message'} = "failed to open the file, $ERRNO: $fmt_file_name"; $self->close_internal(); return 0; } } return 1; } # # 書式: # close() # メソッドの区分: # public インスタンスメソッド。 # 説明: # オブジェクトが開いているテキストファイル群を閉じる。 # テキストファイルを開いていない場合は、何もしない。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub close { my $self = shift; if (!$self->{'handle'}->fileno()) { return 1; } # # 半端なブロックの後方を "\0" で埋める。 # my $pad_length = $block_length - $self->{'handle'}->tell() % $block_length; if ($pad_length < $block_length && !$self->{'handle'}->print("\0" x $pad_length)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; return 0; } # # ファイルを閉じる。 # $self->close_internal(); return 1; } # # 書式: # close_internal() # メソッドの区分: # private インスタンスメソッド。 # 説明: # close() の内部処理用メソッド。 # sub close_internal { my $self = shift; if ($self->{'handle'}->fileno()) { $self->{'handle'}->close(); } $self->{'tag'}->close_internal(); # # 音声形式ファイルが開かれていれば閉じる。(satomii) # if ($self->{'fmt_handle'}->fileno()) { $self->{'fmt_handle'}->close(); } } # # 書式: # add_data(tag, file_name) # tag # タグ名 # file_name # 追加するバイナリファイル名 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 与えられた WAVE ファイルの内容を、データとして追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_data { my $self = shift; my ($tag, $file_name) = @ARG; # # タグを登録する。 # if (!$self->{'tag'}->add_entry('sound:' . $tag, $self->{'position'})) { $self->{'error_message'} = $self->{'tag'}->error_message(); $self->close_internal(); return 0; } # # 指定されたファイルを開く。 # my $handle = FileHandle->new(); if (!$handle->open($file_name, 'r')) { $self->{'error_message'} = "failed to open the file, $ERRNO: " . $file_name; $self->close_internal(); return 0; } binmode($handle); # # 指定されたファイルの形式を調べて work/sndfmt に記録する。(satomii) # my ($data, $data_length); $data_length = $handle->read($data, 8); if ($data_length != 8) { $self->{'error_message'} = (!defined($data_length)) ? "failed to read the file, $ERRNO: $file_name" : "unknown sound format: $file_name"; $self->close_internal(); return 0; } if (substr($data, 0, 4) eq 'RIFF') { # # WAVE ファイル # $data_length = $handle->read($data, 4); if ($data_length != 4) { $self->{'error_message'} = (!defined($data_length)) ? "failed to read the file, $ERRNO: $file_name" : "invalid RIFF data: $file_name"; $self->close_internal(); return 0; } elsif ($data ne 'WAVE') { $self->{'error_message'} = "unknown RIFF type, $data: $file_name"; $self->close_internal(); return 0; } if ($self->{'fmt_handle'}->fileno()) { my $header_position = $handle->tell(); my ($chunk_code, $chunk_length); # # fmt チャンクを探す。 # while (1) { $data_length = $handle->read($data, 8); if ($data_length != 8) { $self->{'error_message'} = do { if (!defined($data_length)) { "failed to read the file, $ERRNO: $file_name"; } elsif ($data_length == 0) { "unexpected end of file: $file_name"; } else { "invalid WAVE data: $file_name"; } }; $self->close_internal(); return 0; } $chunk_code = substr($data, 0, 4); $chunk_length = unpack('L', substr($data, 4)); $data_length = $handle->read($data, $chunk_length); if ($data_length != $chunk_length) { $self->{'error_message'} = (!defined($data_length)) ? "failed to read the file, $ERRNO: $file_name" : "failed to read the $chunk_code chunk: $file_name"; $self->close_internal(); return 0; } if ($chunk_code ne 'fmt ') { next; } elsif ($chunk_length < 16) { $self->{'error_message'} = "invalid fmt chunk: $file_name"; $self->close_internal(); return 0; } # # チャンネル数、サンプリング周波数、ビット長を取得する。 # my @fmt = unpack('S2L2S2', $data); if (!$self->{'fmt_handle'}->printf( "%s\t01\t%d0%d%d\n", $tag, ($fmt[1] == 2) ? 1 : 0, ($fmt[5] == 16) ? 0 : 1, ($fmt[2] == 441000) ? 0 : ($fmt[2] == 220500) ? 1 : 2)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'fmt_file_name'}; $self->close_internal(); return 0; } last; } # # 読み出し位置を最初のサブチャンクの先頭に戻す。 # if (!$handle->seek($header_position, 0)) { $self->{'error_message'} = "failed to seek the file, $ERRNO: $file_name"; $self->close_internal(); return 0; } } } elsif ($data eq "MThd\x00\x00\x00\x06") { # # MIDI ファイル (SMF) # if ($self->{'fmt_handle'}->fileno()) { if (!$self->{'fmt_handle'}->print("$tag\t02\t0000\n")) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'fmt_file_name'}; $self->close_internal(); return 0; } } # # 読み出し位置を先頭に戻す。 # または最初のトラックチャンクの先頭にするべき? MIDI に対応したソフトが # ないためテストできず。JIS X 4081 の仕様書をお持ちの方、適当に修正して # ください。 # if (!$handle->seek(0, 0)) { $self->{'error_message'} = "failed to seek the file, $ERRNO: $file_name"; $self->close_internal(); return 0; } } else { $self->{'error_message'} = "unknown sound format: $file_name"; $self->close_internal(); return 0; } # # 音声データを読み込んでバイナリファイルに書き込む。 # my $start_position = $self->{'position'}; for (;;) { $data_length = $handle->read($data, $block_length); if (!defined($data_length)) { $self->{'error_message'} = "failed to read the file, $ERRNO: $file_name"; $self->close_internal(); return 0; } elsif ($data_length == 0) { last; } if (!$self->{'handle'}->print($data)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; $self->close_internal(); return 0; } $self->{'position'} += $data_length; } # # 指定されたファイルを閉じる。 # $handle->close(); $self->{'entry_count'}++; # # 終了タグを登録する。 # if (defined($self->{'end_tag_prefix'})) { my ($end_tag) = $self->{'end_tag_prefix'} . ':' . $tag; my ($end_position) = $self->{'position'} - 1; if ($end_position < $start_position) { $end_position = $start_position; } if (!$self->{'tag'}->add_entry($end_tag, $end_position)) { $self->{'error_message'} = $self->{'tag'}->error_message(); $self->close_internal(); return 0; } } return 1; } # # 書式: # add_binary(tag, binary) # tag # タグ名 # binary # 追加するバイナリ # メソッドの区分: # public インスタンスメソッド。 # 説明: # 与えられたバイナリの内容を、データとして追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_binary { my $self = shift; my ($tag, $binary) = @ARG; my $pos = 0; # # タグを登録する。 # if (!$self->{'tag'}->add_entry('sound:' . $tag, $self->{'position'})) { $self->{'error_message'} = $self->{'tag'}->error_message(); $self->close_internal(); return 0; } # # 指定されたファイルの形式を調べて work/sndfmt に記録する。(satomii) # my ($data, $data_length); $data = substr ($binary, 0, 8); if (length($data) != 8) { $self->{'error_message'} = "unknown sound format"; $self->close_internal(); return 0; } if (substr($data, 0, 4) eq 'RIFF') { # # WAVE ファイル # $data = substr($binary, 8, 4); $pos = 12; if (length($data) != 4) { $self->{'error_message'} = "invalid RIFF data"; $self->close_internal(); return 0; } elsif ($data ne 'WAVE') { $self->{'error_message'} = "unknown RIFF type, $data"; $self->close_internal(); return 0; } if ($self->{'fmt_handle'}->fileno()) { my $header_position = $pos; my ($chunk_code, $chunk_length); # # fmt チャンクを探す。 # while (1) { $data = substr($binary, $pos, 8); $data_length = length($data); $pos += 8; if ($data_length != 8) { $self->{'error_message'} = do { if ($data_length == 0) { "unexpected end of data"; } else { "invalid WAVE data"; } }; $self->close_internal(); return 0; } $chunk_code = substr($data, 0, 4); $chunk_length = unpack('L', substr($data, 4)); $data = substr($binary, $pos, $chunk_length); $pos += $chunk_length; if (length($data) != $chunk_length) { $self->{'error_message'} = "failed to read the $chunk_code chunk"; $self->close_internal(); return 0; } if ($chunk_code ne 'fmt ') { next; } elsif ($chunk_length < 16) { $self->{'error_message'} = "invalid fmt chunk"; $self->close_internal(); return 0; } # # チャンネル数、サンプリング周波数、ビット長を取得する。 # my @fmt = unpack('S2L2S2', $data); if (!$self->{'fmt_handle'}->printf( "%s\t01\t%d0%d%d\n", $tag, ($fmt[1] == 2) ? 1 : 0, ($fmt[5] == 16) ? 0 : 1, ($fmt[2] == 441000) ? 0 : ($fmt[2] == 220500) ? 1 : 2)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'fmt_file_name'}; $self->close_internal(); return 0; } last; } # # 読み出し位置を最初のサブチャンクの先頭に戻す。 # $pos = $header_position; } } elsif ($data eq "MThd\x00\x00\x00\x06") { # # MIDI ファイル (SMF) # if ($self->{'fmt_handle'}->fileno()) { if (!$self->{'fmt_handle'}->print("$tag\t02\t0000\n")) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'fmt_file_name'}; $self->close_internal(); return 0; } } # # 読み出し位置を先頭に戻す。 # または最初のトラックチャンクの先頭にするべき? MIDI に対応したソフトが # ないためテストできず。JIS X 4081 の仕様書をお持ちの方、適当に修正して # ください。 # $pos = 0; } else { $self->{'error_message'} = "unknown sound format"; $self->close_internal(); return 0; } # # 音声データを読み込んでバイナリファイルに書き込む。 # my $start_position = $self->{'position'}; $data = substr($binary, $pos); if (!$self->{'handle'}->print($data)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'file_name'}; $self->close_internal(); return 0; } $self->{'position'} += length($data); # # # $self->{'entry_count'}++; # # 終了タグを登録する。 # if (defined($self->{'end_tag_prefix'})) { my ($end_tag) = $self->{'end_tag_prefix'} . ':' . $tag; my ($end_position) = $self->{'position'} - 1; if ($end_position < $start_position) { $end_position = $start_position; } if (!$self->{'tag'}->add_entry($end_tag, $end_position)) { $self->{'error_message'} = $self->{'tag'}->error_message(); $self->close_internal(); return 0; } } return 1; } ###################################################################### # <インスタンス変数の値を返すメソッド群> # # 書式: # インスタンス変数名() # メソッドの区分: # public インスタンスメソッド。 # 戻り値: # インスタンス変数の値を返す。 # sub file_name { my $self = shift; return $self->{'file_name'}; } sub tag_file_name { my $self = shift; return $self->{'tag'}->file_name(); } sub entry_count { my $self = shift; return $self->{'entry_count'}; } sub error_message { my $self = shift; return $self->{'error_message'}; } 1; freepwing-1.5.orig/src/BaseUserChar.pm0000644000175000017500000003336011022404342017253 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 2000 Motoyuki Kasahara # # 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, 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. # # # 外字を納めたファイルを生成するクラスのための基底クラス # package FreePWING::BaseUserChar; require 5.005; require Exporter; use FileHandle; use English; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK $block_length $start_character_number $max_character_count); @ISA = qw(Exporter); # # ブロックの長さ (バイト数) # $block_length = 2048; # # 最初に割り当てる文字番号 # $start_character_number = 0xa121; # # 最初に割り当てる文字番号 # $max_character_count = 8192; # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; my $new = { # 外字の定義名ファイルのハンドラ 'name_handle' => FileHandle->new(), # 外字定義ファイル名 'name_file_name' => '', # 外字の高さ (16 〜 48 ドット) 'bitmap_heights' => [16, 24, 30, 48], # 外字 (高さ 16 〜 48 ドット) の幅 'bitmap_widths' => [0, 0, 0, 0], # 外字 (高さ 16 〜 48 ドット) のビットマップの消費サイズ # # 計算式: (width + 7) / 8 * height # 'bitmap_sizes' => [0, 0, 0, 0], # 外字 (高さ 16 〜 48 ドット) ファイルのハンドラ 'bitmap_handles' => [FileHandle->new(), FileHandle->new(), FileHandle->new(), FileHandle->new()], # 外字 (高さ 16 〜 48 ドット) ファイル名 'bitmap_file_names' => ['', '', '', ''], # 外字のビットマップの高さ別の種類 'bitmap_height_count' => 0, # # 外字 (高さ 16 〜 48 ドット) が 1 チャンク (1024 バイト) 内 # に収まる個数 (= 外字を書き込む際に、詰め物をして次のブロッ # クに移らないといけない周期) # # 計算式: 1024 / ((width + 7) / 8 * height) # 'bitmap_pad_cycles' => [0, 0, 0, 0], # # 外字 (高さ 16 〜 48 ドット) を書き込むときに、詰め物をし # て次のチャンクに移る場合における詰め物のサイズ # # 計算式: 1024 % ((width + 7) / 8 * height) # 'bitmap_pad_lengths' => [0, 0, 0, 0], # これまでに書き込んだエントリ数 'character_count' => 0, # 次に定義要求が来たときに、文字に割り当てる文字番号 'character_number' => $start_character_number, # 定義した外字の名前 'names' => {}, # エラーメッセージ 'error_message' => '', }; return bless($new, $type); } # # 書式: # open(name_file_name, bitmap_16_file_name, # [bitmap_24_file_name, bitmap_30_file_name, bitmap_48_file_name]) # name_file_name # 外字名前ファイル名 # bitmap_16_file_name # 外字 (高さ 16 ドット) のビットマップファイル名 # bitmap_24_file_name # 外字 (高さ 24 ドット) のビットマップファイル名 # bitmap_30_file_name # 外字 (高さ 30 ドット) のビットマップファイル名 # bitmap_48_file_name # 外字 (高さ 48 ドット) のビットマップファイル名 # メソッドの区分: # public インスタンスメソッド # 説明: # 書き込み用に参照情報ファイルを開く。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub open { my $self = shift; my ($name_file_name, @bitmap_file_names) = @ARG; my $i; # # 外字の名前ファイルを開く。 # $self->{'name_file_name'} = $name_file_name; if (!$self->{'name_handle'} ->open($self->{'name_file_name'}, 'w')) { $self->{'error_message'} = "failed to open the file, $ERRNO: " . $self->{'name_file_name'}; $self->close_internal(); return 0; } $self->{'bitmap_height_count'} = @bitmap_file_names; for ($i = 0; $i < $self->{'bitmap_height_count'}; $i++) { # # 外字のビットマップファイルを開く。 # $self->{'bitmap_file_names'}->[$i] = $bitmap_file_names[$i]; if (!$self->{'bitmap_handles'}->[$i] ->open($self->{'bitmap_file_names'}->[$i], 'w')) { $self->{'error_message'} = "failed to open the file, $ERRNO: " . $self->{'bitmap_file_names'}->[$i]; $self->close_internal(); return 0; } binmode($self->{'bitmap_handles'}->[$i]); # # 外字のビットマップファイルの最初のブロックを `\0' で埋める。 # if (!$self->{'bitmap_handles'}->[$i] ->print("\0" x $block_length)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'bitmap_file_name'}->[$i]; $self->close_internal(); return 0; } } return 1; } # # 書式: # close() # メソッドの区分: # public インスタンスメソッド。 # 説明: # 参照情報ファイルを閉じる。開いていなければ、何もしない。 # 戻り値: # 常に 1 を返す。 # sub close { my $self = shift; my $data; my $i; my $block_pad; for ($i = 0; $i < $self->{'bitmap_height_count'}; $i++) { # # ブロックの末尾まで "\0" を書き込む。 # $block_pad = $block_length - $self->{'bitmap_handles'}->[$i]->tell() % $block_length; if ($block_pad < $block_length && !$self->{'bitmap_handles'}->[$i]->print("\0" x $block_pad)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'bitmap_file_names'}->[$i]; $self->close_internal(); return 0; } # # 外字のビットマップファイルの先頭に定義内容の情報を書き込む。 # if (!$self->{'bitmap_handles'}->[$i]->seek(0, FileHandle->SEEK_SET)) { $self->{'error_message'} = "failed to seek the file, $ERRNO: " . $self->{'bitmap_file_names'}->[$i]; } $data = pack("C8 CC n n C2", 1, 0, 0, 0, 0, 0, 0, 0, $self->{'bitmap_widths'}->[$i], $self->{'bitmap_heights'}->[$i], $start_character_number, $self->{'character_count'}, 0, 0); if (!$self->{'bitmap_handles'}->[$i]->print($data)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'bitmap_file_names'}->[$i]; $self->close_internal(); return 0; } } # # 外字のビットマップファイルを閉じる。 # $self->close_internal(); return 1; } # # 書式: # close_internal() # メソッドの区分: # private インスタンスメソッド。 # 説明: # close() の内部処理用メソッド。 # sub close_internal { my $self = shift; my $i; # # 外字の名前ファイルを閉じる。 # if ($self->{'name_handle'}->fileno()) { $self->{'name_handle'}->close(); } # # 外字のビットマップファイルを閉じる。 # for ($i = 0; $i < $self->{'bitmap_height_count'}; $i++) { $self->{'bitmap_handles'}->[$i]->close(); } } # # 書式: # add_character(name, [xbm_16_file_name, xbm_24_file_name, # xbm_30_file_name, xbm_48_file_name]) # name # 外字の名前 # xbm_16_file_name # 外字 (高さ 16 ドット) の XBM ビットマップファイル名 # xbm_24_file_name # 外字 (高さ 24 ドット) の XBM ビットマップファイル名 # xbm_30_file_name # 外字 (高さ 30 ドット) の XBM ビットマップファイル名 # xbm_48_file_name # 外字 (高さ 48 ドット) の XBM ビットマップファイル名 # メソッドの区分: # public インスタンスメソッド。 # 説明: # 参照情報ファイルにブロック参照エントリを一つ追加する。 # 戻り値: # 成功すれば 1 を返す。失敗すれば 0 を返す。 # sub add_character { my $self = shift; my ($name, @xbm_file_names) = @ARG; my ($width, $height, $bitmap); my $i; # # 外字の登録文字数を確認する。 # if ($max_character_count <= $self->{'character_count'}) { $self->{'error_message'} = "define too many characters"; $self->close_internal(); return 0; } # # 既にこの名前を持つ外字が登録されているか調べる。 # if (defined($self->{'name'}->{$name})) { $self->{'error_message'} = "character name has already been defined: " . $name; $self->close_internal(); return 0; } # # 名前ファイルにこの外字の定義を書き込む。 # if (!$self->{'name_handle'} ->printf("%s\t%04x\n", $name, $self->{'character_number'})) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'name_file_name'}; $self->close_internal(); return 0; } for ($i = 0; $i < $self->{'bitmap_height_count'}; $i++) { if (!defined($xbm_file_names[$i])) { $self->{'error_message'} = sprintf("bitmap file (height=%s) not specified", $self->{'bitmap_heights'}->[$i]); $self->close_internal(); return 0; } # # 外字の XBM ファイルを読み込む。 # ($width, $height, $bitmap) = $self->read_xbm_file($xbm_file_names[$i]); if (!defined($bitmap)) { $self->close_internal(); return 0; } if ($width != $self->{'bitmap_widths'}->[$i] || $height != $self->{'bitmap_heights'}->[$i]) { $self->{'error_message'} = "XBM file has incorrect size: " . $xbm_file_names[$i]; $self->close_internal(); return 0; } # # 外字のビットマップを書き込む。 # if (!$self->{'bitmap_handles'}->[$i]->print($bitmap)) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'bitmap_file_names'}->[$i]; $self->close_internal(); return 0; } # # ブロックの末尾付近に来ている場合は、残りを "\0" で埋めて次の # ブロックに移る。 # if (($self->{'character_count'} + 1) % $self->{'bitmap_pad_cycles'}->[$i] == 0) { if (!$self->{'bitmap_handles'}->[$i] ->print("\0" x $self->{'bitmap_pad_lengths'}->[$i])) { $self->{'error_message'} = "failed to write the file, $ERRNO: " . $self->{'bitmap_file_names'}->[$i]; $self->close_internal(); return 0; } } } $self->{'name'}->{$name} = 1; $self->{'character_count'}++; if (($self->{'character_number'} & 0x7f) == 0x7e) { $self->{'character_number'} += 0xa3; } else { $self->{'character_number'}++; } return 1; } # # 書式: # read_xbm_file(file_name) # file_name # 読み込む XBM ファイル名 # メソッドの区分: # private インスタンスメソッド。 # 説明: # XBM ファイルを読み込む。 # 戻り値: # 成功したときは、次の 3 つの要素をこの順序で並べたリストを返す。 # 1. ビットマップデータの幅のドット数 # 2. ビットマップデータの高さのドット数 # 3. ビットマップデータ。pack("C*") で各バイトを詰めたもの。 # 失敗したときは、undef を返す。 # 備考: # X11R6.3 の Xmu/RdBitF.c の XmuReadBitmapData() を参考にした。 # sub read_xbm_file { my $self = shift; my ($file_name) = @ARG; # # XBM ファイルを開く。 # my $handle = FileHandle->new(); if (!$handle->open($file_name, 'r')) { $self->{'error_message'} = "failed to open the file, $ERRNO: $file_name"; return; } # # XBM 定義ファイルを行単位で読み込む。 # "bits[] = {" の行に出会うまで繰り返す。 # my $line; my ($name, $value); my ($width, $height) = (0, 0); for (;;) { $line = $handle->getline(); if (!defined($line)) { $handle->close(); $self->{'error_message'} = "broken XBM file: $file_name"; return; } if ($line =~ /^\#define[ \t]+(\S+)[ \t]+([0-9]+)/) { # # "#define ...." で始まる行。 # $name = $1; $value = $2; if ($name eq 'width' || $name =~ /_width$/) { $width = $value; } elsif ($name eq 'height' || $name =~ /_height$/) { $height = $value; } } elsif ($line =~ /static[ \t]+char[ \t]+(\S+)[ \t]+=[ \t]+\{/) { # # "static char ...." で始まる行。 # $name = $1; if ($name eq 'bits[]' || $name =~ /_bits\[\]$/) { last; } } elsif ($line =~ /static unsigned char (\S+) = \{/) { # # "static unsigned char ...." で始まる行。 # $name = $1; if ($name eq 'bits[]' || $name =~ /_bits\[\]$/) { last; } } } # # width, height の定義がなければエラー。 # if ($width == 0 || $height == 0) { $handle->close(); $self->{'error_message'} = "broken XBM file: $file_name"; return; } # # ビットマップの 16 進数部分を 1 文字単位で読み込む。 # my @values = (); my $current_value = 0; my $size = ($width + 7) / 8 * $height; my $gotone = 0; my $i = 0; my $c; while ($i < $size) { $c = $handle->getc(); if ($c eq '') { # # 予期していない EOF # $handle->close(); $self->{'error_message'} = "broken XBM file: $file_name"; return; } elsif ($c =~ /^[0-9A-Fa-f]$/) { # # 16 進数字。 # $current_value = ($current_value << 4) + hex($c); $gotone++; } elsif ($c =~ /^[ ,\}\t\n]$/ && $gotone) { # # 16 進数字を 1 字以上読み込んだ後の区切り文字。 # 16 進数字列を数値に変換し、ビットの並びを左右 (MSB → LSB) # を逆転させてから @values に記録する。 # $values[$i] = 0; $values[$i] |= 0x80 if (($current_value & 0x01) != 0); $values[$i] |= 0x40 if (($current_value & 0x02) != 0); $values[$i] |= 0x20 if (($current_value & 0x04) != 0); $values[$i] |= 0x10 if (($current_value & 0x08) != 0); $values[$i] |= 0x08 if (($current_value & 0x10) != 0); $values[$i] |= 0x04 if (($current_value & 0x20) != 0); $values[$i] |= 0x02 if (($current_value & 0x40) != 0); $values[$i] |= 0x01 if (($current_value & 0x80) != 0); $current_value = 0; $gotone = 0; $i++; } } # # XBM ファイルを閉じる。 # $handle->close(); return ($width, $height, pack("C*", @values)); } ###################################################################### # <インスタンス変数の値を返すメソッド群> # # 書式: # インスタンス変数名() # メソッドの区分: # public インスタンスメソッド。 # 戻り値: # インスタンス変数の値を返す。 # sub name_file_name { my $self = shift; return $self->{'name_file_name'}; } sub bitmap_file_name { my $self = shift; my ($height) = @ARG; return $self->{'bitmap_file_name'}->{$height}; } sub character_count { my $self = shift; return $self->{'character_count'}; } sub character_number { my $self = shift; return $self->{'character_number'}; } sub error_message { my $self = shift; return $self->{'error_message'}; } 1; freepwing-1.5.orig/src/FullUserChar.pm0000644000175000017500000000406611022404342017304 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 2000 Motoyuki Kasahara # # 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, 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. # # # 全角外字を納めたファイルを生成するクラス # package FreePWING::FullUserChar; require 5.005; use FreePWING::BaseUserChar; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(FreePWING::BaseUserChar); # # 書式: # new() # メソッドの区分: # public クラスメソッド。 # 説明: # 新しいオブジェクトを作る。 # 戻り値: # 作成したオブジェクトへのリファレンスを返す。 # sub new { my $type = shift; my $new = $type->SUPER::new(); # # 外字 (高さ 16 〜 48 ドット) の幅を設定。 # $new->{'bitmap_widths'}->[0] = 16; $new->{'bitmap_widths'}->[1] = 24; $new->{'bitmap_widths'}->[2] = 32; $new->{'bitmap_widths'}->[3] = 48; # # 外字 (高さ 16 〜 48 ドット) のビットマップの消費サイズを設定。 # $new->{'bitmap_sizes'}->[0] = 32; $new->{'bitmap_sizes'}->[1] = 72; $new->{'bitmap_sizes'}->[2] = 120; $new->{'bitmap_sizes'}->[3] = 288; # # 外字 (高さ 16 〜 48 ドット) が 1024 バイト内に収まる個数を設定。 # $new->{'bitmap_pad_cycles'}->[0] = 32; $new->{'bitmap_pad_cycles'}->[1] = 14; $new->{'bitmap_pad_cycles'}->[2] = 8; $new->{'bitmap_pad_cycles'}->[3] = 3; # # 外字 (高さ 16 〜 48 ドット) を書き込むときに、詰め物をして次の # ブロックに移る場合における詰め物のサイズを設定。 # $new->{'bitmap_pad_lengths'}->[0] = 0; $new->{'bitmap_pad_lengths'}->[1] = 16; $new->{'bitmap_pad_lengths'}->[2] = 64; $new->{'bitmap_pad_lengths'}->[3] = 160; return $new; } 1; freepwing-1.5.orig/src/CharConv.pm0000644000175000017500000000636711022404342016456 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 1999, 2000 Motoyuki Kasahara # # 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, 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. # # # 文字の変換テーブル用の配列を export するためのパッケージ。 # package FreePWING::CharConv; require 5.005; require Exporter; use strict; use integer; use vars qw(@ISA @EXPORT @EXPORT_OK $ascii_to_jisx0208_table $jisx0201_to_jisx0208_table); @ISA = qw(Exporter); @EXPORT = qw($ascii_to_jisx0208_table $jisx0201_to_jisx0208_table); # # ASCII (2/0 〜 7/14) を JIS X 0208 に変換 # $ascii_to_jisx0208_table = [# ! ” # $ % & ’ '!!', '!*', '!I', '!t', '!p', '!s', '!u', '!G', #( ) * + , − . / '!J', '!K', '!v', "!\\",'!$', '!]', '!%', '!?', #0 1 2 3 4 5 6 7 '#0', '#1', '#2', '#3', '#4', '#5', '#6', '#7', #8 9 : ; < = > ? '#8', '#9', "!'", '!(', '!c', '!a', '!d', '!)', #@ A B C D E F G '!w', '#A', '#B', '#C', '#D', '#E', '#F', '#G', #H I J K L M N O '#H', '#I', '#J', '#K', '#L', '#M', '#N', '#O', #P Q R S T U V W '#P', '#Q', '#R', '#S', '#T', '#U', '#V', '#W', #X Y Z [ \ ] ^ _ '#X', '#Y', '#Z', '!N', '!@', '!O', '!0', '!2', #‘ a b c d e f g '!F', '#a', '#b', '#c', '#d', '#e', '#f', '#g', #h i j k l m n o '#h', '#i', '#j', '#k', '#l', '#m', '#n', '#o', #p q r s t u v w '#p', '#q', '#r', '#s', '#t', '#u', '#v', '#w', #x y z { | }  ̄ '#x', '#y', '#z', '!P', '!C', '!Q', '!1', ]; # # JIS X 0201 カナ (2/15 〜 5/15) を JIS X 0208 に変換 # $jisx0201_to_jisx0208_table = [# 。 「 」 、 ・ ヲ ァ '', '!#', '!V', '!W', '!"', '!&', '%r', '%!', #ィ ゥ ェ ォ ャ ュ ョ ッ '%#', '%%', "\%'",'%)', '%c', '%e', '%g', '%C', #ー ア イ ウ エ オ カ キ '!<', '%"', '%$', '%&', '%(', '%*', '%+', '%-', #ク ケ コ サ シ ス セ ソ '%/', '%1', '%3', '%5', '%7', '%9', '%;', '%=', #タ チ ツ テ ト ナ ニ ヌ '%?', '%A', '%D', '%F', '%H', '%J', '%K', '%L', #ネ ノ ハ ヒ フ ヘ ホ マ '%M', '%N', '%O', '%R', '%U', '%X', '%[', '%^', #ミ ム メ モ ヤ ユ ヨ ラ '%_', '%`', '%a', '%b', '%d', '%f', '%h', '%i', #リ ル レ ロ ワ ン ゛ ゜ '%j', '%k', '%l', '%m', '%o', '%s', '!+', '!,', ]; 1; freepwing-1.5.orig/Makefile.am0000644000175000017500000000004411022404342015644 0ustar mhattamhattaSUBDIRS = src fpwutils doc catdump freepwing-1.5.orig/configure0000755000175000017500000027120111022411534015525 0ustar mhattamhatta#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for freepwing 1.5. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='freepwing' PACKAGE_TARNAME='freepwing' PACKAGE_VERSION='1.5' PACKAGE_STRING='freepwing 1.5' PACKAGE_BUGREPORT='' ac_unique_file="src/BaseText.pm" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA am__isrc CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar pkgdocdir PERL perllibdir SORT GNUMAKE LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures freepwing 1.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/freepwing] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of freepwing 1.5:";; esac cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pkgdocdir=DIR HTML documents in DIR [default=DATADIR/freepwing/doc] --with-perllibdir=DIR Perl5 modules in DIR _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF freepwing configure 1.5 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by freepwing $as_me 1.5, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.10' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm -f conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { echo "$as_me:$LINENO: result: $MKDIR_P" >&5 echo "${ECHO_T}$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='freepwing' VERSION='1.5' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' # Check whether --with-pkgdocdir was given. if test "${with_pkgdocdir+set}" = set; then withval=$with_pkgdocdir; pkgdocdir="${withval}" else pkgdocdir='${datadir}/freepwing/doc' fi for ac_prog in perl5 perl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PERL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then { echo "$as_me:$LINENO: result: $PERL" >&5 echo "${ECHO_T}$PERL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$PERL" && break done test -n "$PERL" || PERL="no" if test "$PERL" = no ; then { { echo "$as_me:$LINENO: error: perl5 not found" >&5 echo "$as_me: error: perl5 not found" >&2;} { (exit 1); exit 1; }; } fi $PERL -e 'close(STDERR); require 5.005' if test $? -ne 0 ; then { { echo "$as_me:$LINENO: error: $PERL is older than version 5.005" >&5 echo "$as_me: error: $PERL is older than version 5.005" >&2;} { (exit 1); exit 1; }; } fi # Check whether --with-perllibdir was given. if test "${with_perllibdir+set}" = set; then withval=$with_perllibdir; perllibdir="${withval}" else perllibdir="`$PERL -e 'for(@INC){print,exit if m|/site_perl|}print $INC[0]'`" fi { echo "$as_me:$LINENO: checking for Perl5 module directory" >&5 echo $ECHO_N "checking for Perl5 module directory... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $perllibdir" >&5 echo "${ECHO_T}$perllibdir" >&6; } for ac_prog in sort do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_SORT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SORT in [\\/]* | ?:[\\/]*) ac_cv_path_SORT="$SORT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SORT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi SORT=$ac_cv_path_SORT if test -n "$SORT"; then { echo "$as_me:$LINENO: result: $SORT" >&5 echo "${ECHO_T}$SORT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$SORT" && break done test -n "$SORT" || SORT="no" if test "$SORT" = no ; then { { echo "$as_me:$LINENO: error: sort not found" >&5 echo "$as_me: error: sort not found" >&2;} { (exit 1); exit 1; }; } fi for ac_prog in gnumake gmake make do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_GNUMAKE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GNUMAKE in [\\/]* | ?:[\\/]*) ac_cv_path_GNUMAKE="$GNUMAKE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GNUMAKE="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GNUMAKE=$ac_cv_path_GNUMAKE if test -n "$GNUMAKE"; then { echo "$as_me:$LINENO: result: $GNUMAKE" >&5 echo "${ECHO_T}$GNUMAKE" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$GNUMAKE" && break done test -n "$GNUMAKE" || GNUMAKE="no" if test "$GNUMAKE" = no ; then { { echo "$as_me:$LINENO: error: GNU make not found" >&5 echo "$as_me: error: GNU make not found" >&2;} { (exit 1); exit 1; }; } fi $GNUMAKE --help > /dev/null if test $? -ne 0 ; then { { echo "$as_me:$LINENO: error: $GNUMAKE is not GNU make" >&5 echo "$as_me: error: $GNUMAKE is not GNU make" >&2;} { (exit 1); exit 1; }; } fi ac_config_files="$ac_config_files Makefile src/Makefile fpwutils/Makefile doc/Makefile catdump/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by freepwing $as_me 1.5, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ freepwing config.status 1.5 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "fpwutils/Makefile") CONFIG_FILES="$CONFIG_FILES fpwutils/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "catdump/Makefile") CONFIG_FILES="$CONFIG_FILES catdump/Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim am__isrc!$am__isrc$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim ACLOCAL!$ACLOCAL$ac_delim AUTOCONF!$AUTOCONF$ac_delim AUTOMAKE!$AUTOMAKE$ac_delim AUTOHEADER!$AUTOHEADER$ac_delim MAKEINFO!$MAKEINFO$ac_delim install_sh!$install_sh$ac_delim STRIP!$STRIP$ac_delim INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim mkdir_p!$mkdir_p$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim am__leading_dot!$am__leading_dot$ac_delim AMTAR!$AMTAR$ac_delim am__tar!$am__tar$ac_delim am__untar!$am__untar$ac_delim pkgdocdir!$pkgdocdir$ac_delim PERL!$PERL$ac_delim perllibdir!$perllibdir$ac_delim SORT!$SORT$ac_delim GNUMAKE!$GNUMAKE$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 66; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi freepwing-1.5.orig/Makefile.in0000644000175000017500000004266111022411535015672 0ustar mhattamhatta# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ ChangeLog INSTALL NEWS install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GNUMAKE = @GNUMAKE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SORT = @SORT@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ perllibdir = @perllibdir@ pkgdocdir = @pkgdocdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src fpwutils doc catdump all: all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ cd $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d $(distdir) || mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-generic distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ tags-recursive uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: freepwing-1.5.orig/catdump/0000755000175000017500000000000011022640523015252 5ustar mhattamhattafreepwing-1.5.orig/catdump/Makefile.am0000644000175000017500000000065211022404342017306 0ustar mhattamhattapkglibexecdir = ${libexecdir}/freepwing catalogsdir = ${pkgdatadir}/catalogs pkgdoc_DATA = catdump.txt pkglibexec_SCRIPTS = catdump catalogs_DATA = catalogs catalogs.txt EXTRA_DIST = catdump.in catdump.txt catalogs catalogs.txt CLEANFILES = catdump catdump: catdump.in Makefile rm -f $@ sed -e 's;\@PERL\@;$(PERL);' -e 's;\@VERSION\@;$(VERSION);' \ $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp freepwing-1.5.orig/catdump/Makefile.in0000644000175000017500000002570111022411535017323 0ustar mhattamhatta# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = catdump DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(pkglibexecdir)" \ "$(DESTDIR)$(catalogsdir)" "$(DESTDIR)$(pkgdocdir)" pkglibexecSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(pkglibexec_SCRIPTS) SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; catalogsDATA_INSTALL = $(INSTALL_DATA) pkgdocDATA_INSTALL = $(INSTALL_DATA) DATA = $(catalogs_DATA) $(pkgdoc_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GNUMAKE = @GNUMAKE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SORT = @SORT@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ perllibdir = @perllibdir@ pkgdocdir = @pkgdocdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkglibexecdir = ${libexecdir}/freepwing catalogsdir = ${pkgdatadir}/catalogs pkgdoc_DATA = catdump.txt pkglibexec_SCRIPTS = catdump catalogs_DATA = catalogs catalogs.txt EXTRA_DIST = catdump.in catdump.txt catalogs catalogs.txt CLEANFILES = catdump all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu catdump/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu catdump/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-pkglibexecSCRIPTS: $(pkglibexec_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(pkglibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibexecdir)" @list='$(pkglibexec_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(pkglibexecSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(pkglibexecdir)/$$f'"; \ $(pkglibexecSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(pkglibexecdir)/$$f"; \ else :; fi; \ done uninstall-pkglibexecSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkglibexec_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(pkglibexecdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkglibexecdir)/$$f"; \ done install-catalogsDATA: $(catalogs_DATA) @$(NORMAL_INSTALL) test -z "$(catalogsdir)" || $(MKDIR_P) "$(DESTDIR)$(catalogsdir)" @list='$(catalogs_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(catalogsDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(catalogsdir)/$$f'"; \ $(catalogsDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(catalogsdir)/$$f"; \ done uninstall-catalogsDATA: @$(NORMAL_UNINSTALL) @list='$(catalogs_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(catalogsdir)/$$f'"; \ rm -f "$(DESTDIR)$(catalogsdir)/$$f"; \ done install-pkgdocDATA: $(pkgdoc_DATA) @$(NORMAL_INSTALL) test -z "$(pkgdocdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdocdir)" @list='$(pkgdoc_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgdocDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdocdir)/$$f'"; \ $(pkgdocDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdocdir)/$$f"; \ done uninstall-pkgdocDATA: @$(NORMAL_UNINSTALL) @list='$(pkgdoc_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgdocdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgdocdir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(catalogsdir)" "$(DESTDIR)$(pkgdocdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-catalogsDATA install-pkgdocDATA install-dvi: install-dvi-am install-exec-am: install-pkglibexecSCRIPTS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-catalogsDATA uninstall-pkgdocDATA \ uninstall-pkglibexecSCRIPTS .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-catalogsDATA install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkgdocDATA install-pkglibexecSCRIPTS install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-catalogsDATA uninstall-pkgdocDATA \ uninstall-pkglibexecSCRIPTS catdump: catdump.in Makefile rm -f $@ sed -e 's;\@PERL\@;$(PERL);' -e 's;\@VERSION\@;$(VERSION);' \ $(srcdir)/$@.in > $@.tmp cp $@.tmp $@ chmod 755 $@ rm -f $@.tmp # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: freepwing-1.5.orig/catdump/catdump.txt0000644000175000017500000002346711022404342017461 0ustar mhattamhatta名称 catdump - 電子ブック/EPWINGのカタログをダンプ/アンダンプする バージョン 1.1 - 2000/04/11 形式 catdump [-g] [-d] <カタログファイル> catdump [-g] -u <テキストファイル> <カタログファイル> オプション -g: EBG 専用モードで起動する。 -d: <カタログファイル>の内容をテキストに変換して標準出力に書き出 す(標準) -u: <テキストファイル>の内容をカタログ形式に変換して<カタログフ ァイル>に書き出す <カタログファイル> 電子ブック/EPWINGのカタログファイル(catalogまたはcatalogs) <テキストファイル> catdumpで出力した形式のテキストファイル 使用例 DドライブのEPWING CD-ROMにあるカタログをテキストに変換してcatalog.txt に書き出す(MS-DOS) C> catdump d:\catalogs > catlogs.txt catalogs.txtの内容をカタログ形式に変換してc:\dic\catalogsに書き出す (MS-DOS) C> catdump -u catalogs.txt c:\dic\catalogs 説明 電子ブックやEPWINGのCD-ROMのトップディレクトリーには、CD-ROMにどんな 書籍が含まれているかを示すカタログファイルが置かれている。カタログフ ァイルは電子ブックではcatalog、EPWINGではcatalogsという名前になって いる。catdumpはこのカタログファイルの内容をテキストデータに変換した り、テキストデータからカタログファイルを生成したりする。 catdumpを使うと、カタログファイルから不要な書籍を削除したり、複数の カタログファイルを統合したりすることが可能だ。catdumpはEBXAのロゴの ある電子ブック(1994年以降のもの)とEPWING V1〜V4に対応している。V5に ついては動作確認を行っていない。 catdumpで電子ブック版広辞苑のカタログファイルをダンプした結果が次の 出力だ。 C> catdump d:\catalog ; 電子ブック/EPWING カタログ内容 (generated by catdump v1.0) [Catalog] FileName = d:\catalog Type = EB Books = 2 [Book] Title = "広辞苑 第四版 電子ブック版" BookType = 0100 Directory = "KOUJIEN" [Book] Title = "付属資料" BookType = 0200 Directory = "FUROKU" 先頭の[Catalog]というブロックには、カタログのヘッダー情報が含まれる。 ここではカタログ形式が電子ブック(EB)であること、カタログに含まれる書 籍数が2であることが示されている。 それ以降には[Book]というブロックが書籍数だけ続いている。ここには各書 籍のタイトル、書籍種別、書籍本体(電子ブックの場合はstartというファイ ル)が置かれているディレクトリー名の情報がある。書籍種別のところには、 電子ブックの場合は書籍の順序番号が書かれているようだが、詳しいことは わからない。 以下はEPWING版広辞苑のカタログファイルをダンプした結果だ。 C> catdump d:\catalogs ; 電子ブック/EPWING カタログ内容 (generated by catdump v1.0) [Catalog] FileName = d:\catalogs Type = EPWING2 Books = 4 BookSelect = 4 [Book] BookType = 0002 (00:国語辞典, 02:EPWING2) Title = "広辞苑 第四版" Directory = "KOUJIEN" InfoBlock = 0001 ZenGaiji = "GA16FULLGA24FULLGA30FULLGA48FULL" HanGaiji = "GA16HALFGA24HALFGA30HALFGA48HALF" BookFile = "HONMON" Reserved1 = 000B0000 [Book] BookType = 0001 (00:国語辞典, 01:EPWING1) Title = "付属資料" Directory = "FUROKU" InfoBlock = 0001 ZenGaiji = "GA16FULLGA24FULLGA30FULLGA48FULL" HanGaiji = "GA16HALFGA24HALFGA30HALFGA48HALF" [Book] BookType = F002 (F0:ストリーム, 02:EPWING2) Title = "「広辞苑」紹介" Directory = "GUIDE" StreamFile = "PLAY" Reserved1 = 00100000 [Book] BookType = F002 (F0:ストリーム, 02:EPWING2) Title = "書籍選択画面" Directory = "BKSLCT" StreamFile = "SELECT" Reserved1 = 00100000 [Catalog]の情報からは、カタログの形式がEPWING V2(EPWING2)であること、 書籍数が4であること、EPWING V2対応の検索ソフトで使われる書籍選択画面 が4番めの書籍であることがわかる。 先頭の書籍に対応する[Book]項目からは、タイトル、EPWING書籍種別(種別 は国語辞典、形式はEPWING2)、書籍本体(EPWINGの場合はhonmonなど)が置か れたディレクトリー(KOUJIEN)、書籍本体の書籍情報ブロック番号、各種外 字(gaijiディレクトリーにある)のファイル名、書籍本体のファイル名、そ の他の情報がわかる。 [Catalog]項目のタグ名とその意味は次の通りだ。括弧でEPWINGのバージョ ンが書かれているものは、EPWINGのそのバージョン以降でしか使われない。 FileName カタログファイルのパス名 Books カタログに含まれる書籍数 Type カタログ形式(電子ブックまたはEPWING) BookSelect 書籍選択画面の書籍番号(EPWING V2) Reserved 不明(EPWING V4以降ではハードディスクインストールや ネットワークインストールの可否が含まれる) [Book]項目には次のようなタグがある。 BookType 書籍種別(電子ブックの場合は詳細不明) Title 書籍名称(電子ブックは15文字、EPWINGは40文字まで) Directory 書籍本体の置かれたディレクトリー DirPos ディレクトリー位置(詳細は不明だが、ハードディスクに インストールした書籍の場合は無関係のようだ) 以下はEPWINGでのみ使われる[Book]のタグだ。 InfoBlock 書籍本体にある書籍情報のブロック番号 AppDef アプリケーション定義の情報(詳細不明) ZenGaiji 16/24/30/48ドットの全角外字ファイル名(8バイト×4) HanGaiji 16/24/30/48ドットの半角外字ファイル名(8バイト×4) 以下はEPWING V2以降で使われる[Book]のタグだ。 Reserved1 詳細不明(EPWING V4以降の圧縮フラグなど?) BookFile 書籍ファイル名(通常はHONMON。HONMON2ならEPWING V4以 降の圧縮ファイルのようだ) Padding1 詳細不明(おそらく空白) StreamFile ストリーム(動画・音声)書籍ファイル名 Padding2 詳細不明(おそらく空白) Reserved2 詳細不明 Padding3 詳細不明(おそらく空白) カタログファイルをダンプ/アンダンプして新しいカタログファイルを作る 場合の指針を以下に示す。 カタログファイルからある書籍を削除するには、その書籍に対応する[Book] 項目全体を削除し、[Catalog]にある書籍数(Books)と書籍選択画面の書籍番 号(BookSelect)の値を適当に調整してから、catdump -uで新しいカタログフ ァイルを作ればよい。 複数のカタログファイルを統合するには、それらの[Book]項目を適当に並べ、 それに合わせて[Catalog]項目を調整してから、catdump -uで新しいカタロ グファイルを作ればよい。異なるバージョンのEPWINGカタログを統合するこ とも可能であり、その場合は最も高いバージョンを[Catalog]に指定してお く。電子ブックとEPWINGのカタログを統合することはできない。 [Book]項目にある情報のうちあるものは変更してかまわない。Titleを変更 すれば、検索ソフトの書籍名表示が変わる。ただし、Titleには(空白を含め て)2バイト文字しか指定できない。文字数の上限は、電子ブックの場合は15 文字、EPWINGの場合は40文字になっている。Directoryを変更すれば、複数 のカタログを統合するときにディレクトリー名の衝突を避けられるかもしれ ない。EPWINGでは、ZenGaijiとHanGaijiを変更すれば使われる外字ファイル を減らすことができる。たとえばEPWING版広辞苑の外字ファイルは ZenGaiji = "GA16FULLGA24FULLGA30FULLGA48FULL" HanGaiji = "GA16HALFGA24HALFGA30HALFGA48HALF" となっているが、これを ZenGaiji = "GA16FULLGA24FULL" HanGaiji = "GA16HALFGA24HALF" に変更すれば、30ドットと48ドットの外字ファイルは参照されない。 検索ソフトとしてEPWING V1対応のものを利用する場合、[Book]項目にある 情報のうち、EPWING V2以降でのみ必要とされるものは削除してかまわない。 EPWING V2以降の書籍のうちEPWING V1対応の検索ソフトでも読めるものにつ いては、ここには標準的な値しか書かれていない。 エラーメッセージ ダンプ時のエラー <カタログファイル名> の情報が取得できません <カタログファイル名> がオープンできません 指定したパス名のカタログファイルが存在しない。 カタログサイズが異常です カタログファイルのサイズが2048バイト以下でも4096バイトでもない。 誤ったファイルを指定している可能性がある。 ファイルの読み込みに失敗しました ファイルの読み込み時に何らかのエラーが発生した。 アンダンプ時のエラー <テキストファイル名>がオープンできません 存在しないテキストファイルを指定している。 <カタログファイル名> が作成できません 指定されたパス名のカタログファイルが新規作成できない。 書き込みに失敗しました ファイルの書き込み時に何らかのエラーが発生した。 ERR: 項目 [Catalog] がありません カタログ定義の始まりを示す[Catalog]がファイル中にない。 ERR: line <行番号>: 構文に誤りがあります タグと値を区切る「=」がない。 ERR: line <行番号>: Type の値に誤りがあります(<値>) Typeタグの値が次のいずれでもない。 EB, EPWING1, EPWING2, EPWING3, EPWING4, EPWING5 ERR: line <行番号>: BookSelect の値に誤りがあります(<値>) BookSelectタグの値が正の整数でない。 ERR: line <行番号>: 不明のタグです(<タグ名>) タグ名が[Catalog]や[Book]に対して定義されているものでない。 ERR: line <行番号>: タグが二重定義されています(<タグ名>) 1つの項目中で同一のタグが複数回現れた。 ERR: line <行番号>: 値が不正です(<値>) 以下のいずれかに該当した。 ・16進数タグの値が期待した長さでない。 ・16進数タグの値に0〜9、A〜F、a〜f以外の文字が含まれている。 ・文字列タグの値が「"」で囲まれていない。 ・文字列タグの値の長さが上限を超えている。 ・ASCII文字列タグの値にASCII文字、「\0」、「\x??」(2桁の16進数) 以外の文字が含まれている。 ・JIS文字列タグの値にJIS漢字以外の文字が含まれている。 ERR: line <行番号>: Type が見つかりませんでした <行番号>の直前にある[Catalog]項目にType指定がない。 ERR: line <行番号>: 不明な項目です(<項目名>) [Catalog]、[Book]以外の項目名が指定されている。 ERR: line <行番号>: 項目 [Book] の個数が多すぎます 1つのカタログで定義可能な書籍数(電子ブックでは50、EPWINGでは12) を超えている。 ERR: line <行番号>: Directory の値が重複しています(<値>) 異なる書籍に同じDirectoryの値が指定されている。 ERR: line <行番号>: このタグはEPWING専用です(<タグ名>) 電子ブックの書籍に以下のタグが指定されている。 DirPos, InfoBlock, AppDef, ZenGaiji, HanGaiji ERR: line <行番号>: このタグはEPWING2以降専用です(<タグ名>) 電子ブックまたはEPWING1の書籍に以下のタグが指定されている。 BookFile, StreamFile, Reserved1, Reserved2, Padding1, Padding2, Padding3 ERR: line <行番号>: BookType が見つかりませんでした <行番号>の直前にある[Book]項目にBookType指定がない。 ERR: line <行番号>: Title が見つかりませんでした <行番号>の直前にある[Book]項目にTitle指定がない。 ERR: line <行番号>: Directory が見つかりませんでした <行番号>の直前にある[Book]項目にDirectory指定がない。 ERR: BookSelect の値が書籍数を超えています BookSelectに1〜書籍数の範囲外の数値を指定した。 freepwing-1.5.orig/catdump/catdump.in0000755000175000017500000007466011022404342017254 0ustar mhattamhatta#! @PERL@ # # catdump - 電子ブック/EPWING カタログ/テキスト変換 # # Written by Junn Ohta (ohta@src.ricoh.co.jp). Public Domain. # Modified by yamagata@nwgpc.kek.jp on 2000/04/13 # Re-Written with Perl by Motoyuki Kasahara (m-kasahr@sra.co.jp) # use FileHandle; $progname = 'catdump'; $version = '@VERSION@'; $author = 'Junn Ohta (ohta@src.ricoh.co.jp)'; $author2 = 'Motoyuki Kasahara (m-kasahr@sra.co.jp)'; # # 文字コード # $EUC = 0; # EUC-JP $SJIS = 1; # シフトJIS # # 処理内容 # $DUMP = 0; # カタログ → テキスト $UNDUMP = 1; # テキスト → カタログ # # 書籍種別 # $EB = 0; # 電子ブック $EPWING = 1; # EPWING1 = 1 $EPWING2 = 2; # EPWING2 $EPWING3 = 3; # EPWING3 $EPWING4 = 4; # EPWING4 $EPWING5 = 5; # EPWING5 $EPWING6 = 6; # EPWING6 # # 書籍ブロックサイズ(= カタログファイルサイズ) # $BLKSIZ = 2048; # # 最大登録書籍数 # (EBで最大50、EPWINGで最大12) # $MAXENT_EB = 50; $MAXENT_EPW = 12; # # カタログファイルの構造 # $C_LEN = 16; # C_ 領域の合計サイズ $C_BOOKSLEN = 2; # 登録書籍数 $C_CDTYPELEN = 2; # 書籍種別 $C_SELECTLEN = 2; # 書籍選択画面の有無、書籍番号 $C_RSVLEN = 10; # 将来拡張用 $B_LEN_EB = 40; # B_ 領域のサイズ (電子ブック) $B_LEN_EPW = 164; # B_ 領域のサイズ (EPWING) # (以下登録書籍数だけくり返し) $B_BKTYPELEN = 2; # 書籍情報 $B_TTLLEN_EB = 30; # 書籍名称(電子ブック) $B_TTLLEN_EPW = 80; # 書籍名称(EPWING) $B_DIRLEN = 8; # 書籍ディレクトリー名 $B_DPOSLEN_EPW = 4; # ディレクトリー位置(EPWING) $B_INFBLEN_EPW = 2; # 管理情報記録位置(EPWING) $B_APPLEN_EPW = 4; # 実装定義(EPWING) $B_ZGAILEN_EPW = 32; # 全角外字ファイル名(EPWING) $B_HGAILEN_EPW = 32; # 半角外字ファイル名(EPWING) $B2_LEN = 164; # B2_ 領域のサイズ # (EPWING2以降、以下書籍数だけくり返し) $B2_RSV1LEN = 4; # 不明 $B2_BKFILELEN = 8; # 本文ファイル名称 $B2_PAD1LEN = 16; # 不明 $B2_STFILELEN = 8; # ストリームファイル名称 $B2_PAD2LEN = 16; # 不明 $B2_RSV2LEN = 4; # 不明 $B2_PAD3LEN = 108; # 不明 # # カタログヘッダー # sub hdr_t (;$) { my ($arg) = @_; my ($new, $offset); if (@_ == 0) { $new = {'books' => "\0" x $C_BOOKSLEN, 'cdtype' => "\0" x $C_CDTYPELEN, 'select' => "\0" x $C_SELECTLEN, 'reserved' => "\0" x $C_RSVLEN}; } else { $new = {}; $offset = 0; $new->{'books'} = substr($arg, $offset, $C_BOOKSLEN); $offset += $C_BOOKSLEN; $new->{'cdtype'} = substr($arg, $offset, $C_CDTYPELEN); $offset += $C_CDTYPELEN; $new->{'select'} = substr($arg, $offset, $C_SELECTLEN); $offset += $C_SELECTLEN; $new->{'reserved'} = substr($arg, $offset, $C_RSVLEN); $offset += $C_RSVLEN; } return $new; } # # カタログ内容(電子ブック) # sub eb_t (;$) { my ($arg) = @_; my ($new, $offset); if (@_ == 0) { $new = {'booktype' => "\0" x $B_BKTYPELEN, 'title' => "\0" x $B_TTLLEN_EB, 'directory' => "\0" x $B_DIRLEN}; } else { $new = {}; $offset = 0; $new->{'booktype'} = substr($arg, $offset, $B_BKTYPELEN); $offset += $B_BKTYPELEN; $new->{'title'} = substr($arg, $offset, $B_TTLLEN_EB); $offset += $B_TTLLEN_EB; $new->{'directory'} = substr($arg, $offset, $B_DIRLEN); $offset += $B_DIRLEN; } return $new; } # # カタログ内容(EPWING) # sub epw_t (;$) { my ($arg) = @_; my ($new, $offset); if (@_ == 0) { $new = {'booktype' => "\0" x $B_BKTYPELEN, 'title' => "\0" x $B_TTLLEN_EPW, 'directory' => "\0" x $B_DIRLEN, 'dirpos' => "\0" x $B_DPOSLEN_EPW, 'infoblock' => "\0" x $B_INFBLEN_EPW, 'appdef' => "\0" x $B_APPLEN_EPW, 'zgaijifile' => "\0" x $B_ZGAILEN_EPW, 'hgaijifile' => "\0" x $B_HGAILEN_EPW}; } else { $new = {}; $offset = 0; $new->{'booktype'} = substr($arg, $offset, $B_BKTYPELEN); $offset += $B_BKTYPELEN; $new->{'title'} = substr($arg, $offset, $B_TTLLEN_EPW); $offset += $B_TTLLEN_EPW; $new->{'directory'} = substr($arg, $offset, $B_DIRLEN); $offset += $B_DIRLEN; $new->{'dirpos'} = substr($arg, $offset, $B_DPOSLEN_EPW); $offset += $B_DPOSLEN_EPW; $new->{'infoblock'} = substr($arg, $offset, $B_INFBLEN_EPW); $offset += $B_INFBLEN_EPW; $new->{'appdef'} = substr($arg, $offset, $B_APPLEN_EPW); $offset += $B_APPLEN_EPW; $new->{'zgaijifile'} = substr($arg, $offset, $B_ZGAILEN_EPW); $offset += $B_ZGAILEN_EPW; $new->{'hgaijifile'} = substr($arg, $offset, $B_HGAILEN_EPW); $offset += $B_HGAILEN_EPW; } return $new; } # # カタログ内容(EPWING2以降) # sub epw2_t (;$) { my ($arg) = @_; my ($new, $offset); if (@_ == 0) { $new = {'reserved1' => "\0" x $B2_RSV1LEN, 'bookfile' => "HONMON\0\0", 'pad1' => "\0" x $B2_PAD1LEN, 'streamfile' => "\0" x $B2_STFILELEN, 'pad2' => "\0" x $B2_PAD2LEN, 'reserved2' => "\0" x $B2_RSV2LEN, 'pad3' => "\0" x $B2_PAD3LEN}; } else { $new = {}; $offset = 0; $new->{'reserved1'} = substr($arg, $offset, $B2_RSV1LEN); $offset += $B2_RSV1LEN; $new->{'bookfile'} = substr($arg, $offset, $B2_BKFILELEN); $offset += $B2_BKFILELEN; $new->{'pad1'} = substr($arg, $offset, $B2_PAD1LEN); $offset += $B2_PAD1LEN; $new->{'streamfile'} = substr($arg, $offset, $B2_STFILELEN); $offset += $B2_STFILELEN; $new->{'pad2'} = substr($arg, $offset, $B2_PAD2LEN); $offset += $B2_PAD2LEN; $new->{'reserved2'} = substr($arg, $offset, $B2_RSV2LEN); $offset += $B2_RSV2LEN; $new->{'pad3'} = substr($arg, $offset, $B2_PAD3LEN); $offset += $B2_PAD3LEN; } return $new; } # # テキストファイルのタグ # $EB_ID = 'EB'; $EPW_ID = 'EPWING'; $CAT_ENTRY = '[Catalog]'; $CTAG_FILENAME = 'FileName'; $CTAG_BOOKS = 'Books'; $CTAG_CDTYPE = 'Type'; $CTAG_SELECT = 'BookSelect'; $CTAG_RESERVED = 'Reserved'; $BOOK_ENTRY = '[Book]'; $BTAG_BOOKTYPE = 'BookType'; $BTAG_TITLE = 'Title'; $BTAG_DIRECTORY = 'Directory'; $BTAG_DIRPOS = 'DirPos'; $BTAG_INFOBLOCK = 'InfoBlock'; $BTAG_APPDEF = 'AppDef'; $BTAG_ZGAIJIFILE = 'ZenGaiji'; $BTAG_HGAIJIFILE = 'HanGaiji'; $B2TAG_RSV1 = 'Reserved1'; $B2TAG_BKFILE = 'BookFile'; $B2TAG_PAD1 = 'Padding1'; $B2TAG_STFILE = 'StreamFile'; $B2TAG_PAD2 = 'Padding2'; $B2TAG_RSV2 = 'Reserved2'; $B2TAG_PAD3 = 'Padding3'; # # 処理済みマスク # $M_FILENAME = 0x00000001; $M_BOOKS = 0x00000002; $M_CDTYPE = 0x00000004; # 必須 $M_SELECT = 0x00000008; $M_RESERVED = 0x00000010; $M_BOOKTYPE = 0x00000020; # 必須 $M_TITLE = 0x00000040; # 必須 $M_DIRECTORY = 0x00000080; # 必須 $M_DIRPOS = 0x00000100; $M_INFOBLOCK = 0x00000200; $M_APPDEF = 0x00000400; $M_ZGAIJIFILE = 0x00000800; $M_HGAIJIFILE = 0x00001000; $M_RESERVED1 = 0x00002000; $M_BOOKFILE = 0x00004000; $M_PADDING1 = 0x00008000; $M_STREAMFILE = 0x00010000; $M_PADDING2 = 0x00020000; $M_RESERVED2 = 0x00040000; $M_PADDING3 = 0x00080000; # # getstr()の処理方法 # $F_NUL = 0; # 余りを0x00で埋める $F_SPACE = 1; # 余りをスペースで埋める $proctype = $DUMP; $type = 0; $line = 0; $catalog = ''; $txtfile = ''; $buf = ''; $EBGmode = 0; $encoding = $EUC if ("燹" eq "\xe0\xa1"); $encoding = $SJIS if ("爍" eq "\xe0\xa1"); sub main { my(@av) = 0; my($ac) = int(@ARGV); my($ret); while ($ac > 0 && $ARGV[$av] =~ /^-/) { if ($ARGV[$av] eq '-g' || $ARGV[$av] eq '-G') { $EBGmode = 1; } elsif ($ARGV[$av] eq '-d' || $ARGV[$av] eq '-D') { $proctype = $DUMP; } elsif ($ARGV[$av] eq '-u' || $ARGV[$av] eq '-U') { $proctype = $UNDUMP; $ac--, $av++; if ($ac <= 0) { usage(); } $txtfile = $ARGV[$av]; } elsif ($ARGV[$av] eq '-e' || $ARGV[$av] eq '-E') { $ac--, $av++; if ($ac <= 0) { usage(); } if ($ARGV[$av] eq 'EUC' || $ARGV[$av] eq 'euc') { $encoding = $EUC; } elsif ($ARGV[$av] eq 'SJIS' || $ARGV[$av] eq 'sjis') { $encoding = $SJIS; } else { usage(); } } else { usage(); } $ac--, $av++; } if ($ac != 1) { usage(); } $catalog = $ARGV[$av]; if ($proctype == $DUMP) { $ret = &dump($catalog); } else { $ret = &undump($txtfile, $catalog); break; } if (!defined($ret)) { exit(1); } exit(0); } sub usage { printf(STDERR "電子ブック/EPWING カタログ/テキスト変換 %s/Perl Ver.%s\n", $progname, $version); printf(STDERR "Written by %s.\n", $author); printf(STDERR "Rewritten with Perl by %s.\n\n", $author2); printf(STDERR "使用法: %s", $progname); printf(STDERR " [オプション...] <カタログファイル>\n\n"); printf(STDERR "オプション:\n"); printf(STDERR " -g EBG 専用モードにする\n"); printf(STDERR " -d カタログファイルを標準出力にダンプする\n"); printf(STDERR " -u <テキストファイル>\n"); printf(STDERR " テキストファイルをカタログファイルに変換する\n"); printf(STDERR " -e \n"); printf(STDERR " 文字コードを設定する\n"); exit(1); } sub dump ($) { my($catalog) = @_; my($fp, $i, $num); my($t); my($hdr); my($eb); my($epw); my($epw2); if (! -f $catalog) { printf(STDERR "%s の情報が取得できません\n", $catalog); return undef; } $size = -s $catalog; if ($size > $BLKSIZ * 2) { printf(STDERR "カタログサイズが異常です\n"); return undef; } $fp = FileHandle->new($catalog, 'r'); if (!defined($fp)) { printf(STDERR "%s がオープンできません\n", $catalog); return undef; } binmode($fp); if ($fp->read($buf, $size) != $size) { printf(STDERR "ファイルの読み込みに失敗しました\n"); $fp->close(); return undef; } $fp->close(); $hdr = hdr_t($buf); $num = unpack('n', $hdr->{'books'}); $type = unpack('xC', $hdr->{'cdtype'}); printf("; 電子ブック/EPWING カタログ内容"); printf(" (generated by %s/Perl v%s)\n\n", $progname, $version); printf("%s\n", $CAT_ENTRY); printf("%-11s= %s\n", $CTAG_FILENAME, $catalog); if ($type == $EB) { printf("%-11s= %s\n", $CTAG_CDTYPE, $EB_ID); } else { printf("%-11s= %s%d\n", $CTAG_CDTYPE, $EPW_ID, $type); } printf("%-11s= %d\n", $CTAG_BOOKS, $num); $t = unpack('n', $hdr->{'select'}); if ((($t >> 8) & 0xff) == 0x01) { printf("%-11s= %d\n", $CTAG_SELECT, (($t >> 4) & 0x0f) * 10 + ($t & 0x0f)); } if ($type >= $EPWING4 || nonzero($hdr->{'reserved'}, $C_RSVLEN)) { printf("%-11s= ", $CTAG_RESERVED); outhex($hdr->{'reserved'}, $C_RSVLEN); if ($type >= $EPWING4) { $t = unpack('xxC', $hdr->{'reserved'}); printf(" (HD利用:%s, NETWORK利用:%s)", ($t & 0x10)? "許可": "禁止", ($t & 0x01)? "許可": "禁止"); } print("\n"); } print("\n"); if ($type == $EB) { for ($i = 0; $i < $num; $i++) { $eb = eb_t(substr($buf, $C_LEN + $B_LEN_EB * $i)); printf("%s\n", $BOOK_ENTRY); printf("%-11s= ", $BTAG_BOOKTYPE); outhex($eb->{'booktype'}, $B_BKTYPELEN); printf("\n"); printf("%-11s= \"", $BTAG_TITLE); if (!$EBGmode) { outjstr($eb->{'title'}, $B_TTLLEN_EB); } else { outstr($eb->{'title'}, $B_TTLLEN_EB); } printf("\"\n"); printf("%-11s= \"", $BTAG_DIRECTORY); outstr($eb->{'directory'}, $B_DIRLEN); printf("\"\n"); printf("\n"); } } else { for ($i = 0; $i < $num; $i++) { $epw = epw_t(substr($buf, $C_LEN + $B_LEN_EPW * $i)); $epw2 = epw2_t(substr($buf, $C_LEN + $B_LEN_EPW * $num + $B2_LEN * $i)); printf("%s\n", $BOOK_ENTRY); printf("%-11s= ", $BTAG_BOOKTYPE); outhex($epw->{'booktype'}, $B_BKTYPELEN); $t = unpack('n', $epw->{'booktype'}); printf(" (%02X:%s, %02X:EPWING%d)\n", ($t >> 8) & 0xff, bookkind(($t >> 8) & 0xff), $t & 0xff, $t & 0xff); printf("%-11s= \"", $BTAG_TITLE); if (!$EBGmode) { outjstr($epw->{'title'}, $B_TTLLEN_EPW); } else { outstr($epw->{'title'}, $B_TTLLEN_EPW); } printf("\"\n"); printf("%-11s= \"", $BTAG_DIRECTORY); outstr($epw->{'directory'}, $B_DIRLEN); printf("\"\n"); if (nonzero($epw->{'dirpos'}, $B_DPOSLEN_EPW)) { printf("%-11s= ", $BTAG_DIRPOS); outhex($epw->{'dirpos'}, $B_DPOSLEN_EPW); printf("\n"); } if (nonzero($epw->{'infoblock'}, $B_INFBLEN_EPW)) { printf("%-11s= ", $BTAG_INFOBLOCK); outhex($epw->{'infoblock'}, $B_INFBLEN_EPW); printf("\n"); } if (nonzero($epw->{'appdef'}, $B_APPLEN_EPW)) { printf("%-11s= ", $BTAG_APPDEF); outhex($epw->{'appdef'}, $B_APPLEN_EPW); printf("\n"); } if (nonzero($epw->{'zgaijifile'}, $B_ZGAILEN_EPW)) { printf("%-11s= \"", $BTAG_ZGAIJIFILE); outstr($epw->{'zgaijifile'}, $B_ZGAILEN_EPW); printf("\"\n"); } if (nonzero($epw->{'hgaijifile'}, $B_HGAILEN_EPW)) { printf("%-11s= \"", $BTAG_HGAIJIFILE); outstr($epw->{'hgaijifile'}, $B_HGAILEN_EPW); printf("\"\n"); } if ($type >= EPWING2) { if (nonzero($epw2->{'bookfile'}, $B2_BKFILELEN)) { printf("%-11s= \"", $B2TAG_BKFILE); outstr($epw2->{'bookfile'}, $B2_BKFILELEN); printf("\"\n"); } if (nonzero($epw2->{'streamfile'}, $B2_STFILELEN)) { printf("%-11s= \"", $B2TAG_STFILE); outstr($epw2->{'streamfile'}, $B2_STFILELEN); printf("\"\n"); } if (nonzero($epw2->{'reserved1'}, $B2_RSV1LEN)) { printf("%-11s= ", $B2TAG_RSV1); outhex($epw2->{'reserved1'}, $B2_RSV1LEN); printf("\n"); } if (nonzero($epw2->{'reserved2'}, $B2_RSV2LEN)) { printf("%-11s= ", $B2TAG_RSV2); outhex($epw2->{'reserved2'}, $B2_RSV2LEN); printf("\n"); } if (nonzero($epw2->{'pad1'}, $B2_PAD1LEN)) { printf("%-11s= ", $B2TAG_PAD1); outhex($epw2->{'pad1'}, $B2_PAD1LEN); printf("\n"); } if (nonzero($epw2->{'pad2'}, $B2_PAD2LEN)) { printf("%-11s= ", $B2TAG_PAD2); outhex($epw2->{'pad2'}, $B2_PAD2LEN); printf("\n"); } if (nonzero($epw2->{'pad3'}, $B2_PAD3LEN)) { printf("%-11s= ", $B2TAG_PAD3); outhex($epw2->{'pad3'}, $B2_PAD3LEN); printf("\n"); } } printf("\n"); } } return OK; } sub bookkind ($) { my($t) = @_; if ($t == 0x00) { return "国語辞典"; } elsif ($t == 0x10) { return "漢和辞典"; } elsif ($t == 0x20) { return "英和辞典"; } elsif ($t == 0x30) { return "和英辞典"; } elsif ($t == 0x40) { return "現代用語辞典"; } elsif ($t == 0x50) { return "百科事典"; } elsif ($t == 0x60) { return "一般書物"; } elsif ($t == 0x70) { return "類語辞典"; } elsif ($t == 0xf0) { return "ストリーム"; } else { return "不明"; } } sub nonzero ($$) { my($p, $len) = @_; return ($p ne "\0" x $len); } sub outhex ($$) { my($p, $len) = @_; while ($len--) { printf("%02X", ord($p)); $p = substr($p, 1); } } sub outstr ($$) { my($p, $len) = @_; $p =~ s/[ \x00]+$//; while ($p ne '') { if (ord($p) >= 0x20 && ord($p) <= 0x7f) { printf("%c", ord($p)); } elsif (ord($p) == ord("\"") || ord($p) == ord("\\")) { printf("\\%c", ord($p)); } elsif (ord($p) == 0x00) { printf("\\0"); } else { printf("\\x%02X", ord($p)); } $p = substr($p, 1); } } sub outjstr ($$) { my($p, $len) = @_; my($c1, $c2); $p =~ s/(\x00\x00|\x21\x21)+$//; if ($encoding == $EUC) { $p =~ tr/\x00-\x7f/\x80-\xff/; print $p; } if ($encoding == $SJIS) { while ($p ne '') { $c1 = ord($p); $p = substr($p, 1); $c2 = ord($p); $p = substr($p, 1); if ($c1 & 0x01) { $c2 += 0x1f; if ($c2 > 0x7e) { $c2++; } } else { $c2 += 0x7e; } $c1 = ($c1 + 0xe1) >> 1; if ($c1 > 0x9f) { $c1 += 0x40; } printf('%c%c', $c1, $c2); } } } sub undump ($$) { my($txtfile, $catalog) = @_; my($fp, $i, $st, $num, $len, $hex, $err); my($mask); my($name, $value); my(@dirs) = (); my($t); my($hdr) = hdr_t; my($eb) = []; my($epw) = []; my($epw2) = []; $fp = FileHandle->new($txtfile, 'r'); if (!defined($fp)) { printf(STDERR "%s がオープンできません\n", $txtfile); return undef; } $err = 0; $line = 0; $buf = getline($fp); if (!defined($buf) || substr($buf, 0, length($CAT_ENTRY)) ne $CAT_ENTRY) { printf(STDERR "ERR: 項目 %s がありません\n", $CAT_ENTRY); $fp->close(); return undef; } $type = $EB; $st = 0; $mask = 0; for (;;) { $buf = getline($fp); if (!defined($buf) || $buf =~ /^\[/) { last; } ($name, $value) = getvalue($buf); if (!defined($name)) { printf(STDERR "ERR: line %d: 構文に誤りがあります\n", $line); $err++; next; } if ($name eq $CTAG_FILENAME) { if (($mask & $M_FILENAME) != 0) { goto ctag_dup; } # # ファイル名の情報は使わないので読み飛ばす # $mask |= $M_FILENAME; } elsif ($name eq $CTAG_BOOKS) { if (($mask & $M_BOOKS) != 0) { goto ctag_dup; } # # 書籍数の情報は使わないので読み飛ばす # $mask |= $M_BOOKS; } elsif ($name eq $CTAG_CDTYPE) { $len = length($EPW_ID); if (($mask & $M_BOOKTYPE) != 0) { goto ctag_dup; } if ($value eq $EB_ID) { $type = $EB; } elsif (substr($value, 0, $len) eq $EPW_ID && substr($value, $len, 1) =~ /^\d$/) { $type = substr($value, $len, 1); } else { printf(STDERR "ERR: line %d: %s の値に誤りがあります(%s)\n", $line, $CTAG_CDTYPE, $value); $fp->close(); return undef; } $hdr->{'cdtype'} = pack('C2', 0, $type); $mask |= $M_BOOKTYPE; } elsif ($name eq $CTAG_SELECT) { if (($mask & $M_SELECT) != 0) { goto ctag_dup; } $st = 0; while ($value =~ /^\d/) { $st = $st * 10 + ord($value) - ord('0'); $value = substr($value, 1); } if ($value eq '') { $hdr->{'select'} = pack('C2', 0x01, (($st / 10) << 4) + ($st % 10)); } else { printf(STDERR "ERR: line %d: %s の値に誤りがあります(%s)\n", $line, $CTAG_SELECT, $value); $fp->close(); return undef; } $mask |= $M_SELECT; } elsif ($name eq $CTAG_RESERVED) { if (($mask & $M_RESERVED) != 0) { goto ctag_dup; } $mask |= $M_RESERVED; $hex = gethex($value, $C_RSVLEN); if (!defined($hex)) { goto ctag_invalid; } $hdr->{'reserved'} = $hex; } else { printf(STDERR "ERR: line %d: 不明のタグです(%s)\n", $line, $name); $err++; next; } next; ctag_dup: printf(STDERR "ERR: line %d: タグが二重定義されています(%s)\n", $line, $name); $err++; next; ctag_invalid: printf(STDERR "ERR: line %d: 値が不正です(%s)\n", $line, $value); $err++; next; } if (($mask & $M_BOOKTYPE) == 0) { printf(STDERR "ERR: line %d: %s が見つかりませんでした\n", $line, $CTAG_CDTYPE); $err++; } $num = 0; while ($buf =~ /^\[/) { if (substr($buf, 0, length($BOOK_ENTRY)) ne $BOOK_ENTRY) { printf(STDERR "ERR: line %d: 不明な項目です(%s)\n", $line, $name); $err++; for (;;) { $buf = getline($fp); if (!defined($buf) || $buf !~ /^\[/) { last; } } if (!defined($buf)) { last; } next; } if (($type == $EB && $MAXENT_EB <= $num) || ($type > $EB && $MAXENT_EPW <= $num)) { printf(STDERR "ERR: line %d: 項目 %s の個数が多すぎます\n", $line, $BOOK_ENTRY); $err++; last; } $mask = 0; if ($type == $EB) { push(@{$eb}, eb_t); } elsif ($type == $EPWING) { push(@{$epw}, epw_t); } else { push(@{$epw}, epw_t); push(@{$epw2}, epw2_t); } for (;;) { $buf = getline($fp); if (!defined($buf) || $buf =~ /^\[/) { last; } ($name, $value) = getvalue($buf); if (!defined($name)) { printf(STDERR "ERR: line %d: 構文に誤りがあります\n", $line); $err++; next; } if ($name eq $BTAG_BOOKTYPE) { if (($mask & $M_BOOKTYPE) != 0) { goto btag_dup; } $mask |= $M_BOOKTYPE; $t = gethex($value, $B_BKTYPELEN); if (!defined($t)) { goto btag_invalid; } if ($type == $EB) { $eb->[$num]->{'booktype'} = $t; } else { $epw->[$num]->{'booktype'} = $t; } } elsif ($name eq $BTAG_TITLE) { if (($mask & $M_TITLE) != 0) { goto btag_dup; } $mask |= $M_TITLE; if (!$EBGmode) { if ($type == $EB) { $t = getjstr($value, $B_TTLLEN_EB); } else { $t = getjstr($value, $B_TTLLEN_EPW); } } else { if ($type == $EB) { $t = getstr($value, $B_TTLLEN_EB); } else { $t = getstr($value, $B_TTLLEN_EPW); } } if (!defined($t)) { goto btag_invalid; } if ($type == $EB) { $eb->[$num]->{'title'} = $t; } else { $epw->[$num]->{'title'} = $t; } } elsif ($name eq $BTAG_DIRECTORY) { if (($mask & $M_DIRECTORY) != 0) { goto btag_dup; } $mask |= $M_DIRECTORY; $t = getstr($value, $B_DIRLEN, $F_SPACE); if (!defined($t)) { goto btag_invalid; } if ($type == $EB) { $eb->[$num]->{'directory'} = $t; } else { $epw->[$num]->{'directory'} = $t; } if ((grep {$_ eq $t} @dirs) != 0) { printf(STDERR "ERR: line %d: %s の値が重複しています(%s)\n", $line, $buf, value); $err++; next; } push(@dirs, $t); } elsif ($name eq $BTAG_DIRPOS) { if ($type < $EPWING) { goto btag_epwonly; } if (($mask & $M_DIRPOS) != 0) { goto btag_dup; } $mask |= $M_DIRPOS; $t = gethex($value, $B_DPOSLEN_EPW); if (!defined($t)) { goto btag_invalid; } $epw->[$num]->{'dirpos'} = $t; } elsif ($name eq $BTAG_INFOBLOCK) { if ($type < $EPWING) { goto btag_epwonly; } if (($mask & $M_INFOBLOCK) != 0) { goto btag_dup; } $mask |= $M_INFOBLOCK; $t = gethex($value, $B_INFBLEN_EPW); if (!defined($t)) { goto btag_invalid; } $epw->[$num]->{'infoblock'} = $t; } elsif ($name eq $BTAG_APPDEF) { if ($type < $EPWING) { goto btag_epwonly; } if (($mask & $M_APPDEF) != 0) { goto btag_dup; } $mask |= $M_APPDEF; $t = gethex($value, $B_APPLEN_EPW); if (!defined($t)) { goto btag_invalid; } $epw->[$num]->{'appdef'} = $t; } elsif ($name eq $BTAG_ZGAIJIFILE) { if ($type < $EPWING) { goto btag_epwonly; } if (($mask & $M_ZGAIJIFILE) != 0) { goto btag_dup; } $mask |= $M_ZGAIJIFILE; $t = getstr($value, $B_ZGAILEN_EPW, $F_NUL); if (!defined($t)) { goto btag_invalid; } $epw->[$num]->{'zgaijifile'} = $t; } elsif ($name eq $BTAG_HGAIJIFILE) { if ($type < $EPWING) { goto btag_epwonly; } if (($mask & $M_HGAIJIFILE) != 0) { goto btag_dup; } $mask |= $M_HGAIJIFILE; $t = getstr($value, $B_HGAILEN_EPW, $F_NUL); if (!defined($t)) { goto btag_invalid; } $epw->[$num]->{'hgaijifile'} = $t; } elsif ($name eq $B2TAG_RSV1) { if ($type < $EPWING2) { goto btag_epw2only; } if (($mask & $M_RESERVED1) != 0) { goto btag_dup; } $mask |= $M_RESERVED1; $t = gethex($value, $B2_RSV1LEN); if (!defined($t)) { goto btag_invalid; } $epw2->[$num]->{'reserved1'} = $t; } elsif ($name eq $B2TAG_BKFILE) { if ($type < $EPWING2) { goto btag_epw2only; } if (($mask & $M_BOOKFILE) != 0) { goto btag_dup; } $mask |= $M_BOOKFILE; $t = getstr($value, $B2_BKFILELEN, $F_SPACE); if (!defined($t)) { goto btag_invalid; } $epw2->[$num]->{'bookfile'} = $t; } elsif ($name eq $B2TAG_PAD1) { if ($type < $EPWING2) { goto btag_epw2only; } if (($mask & $M_PADDING1) != 0) { goto btag_dup; } $mask |= $M_PADDING1; $t = gethex($value, $B2_PAD1LEN); if (!defined($t)) { goto btag_invalid; } $epw2->[$num]->{'padding1'} = $t; } elsif ($name eq $B2TAG_STFILE) { if ($type < $EPWING2) { goto btag_epw2only; } if (($mask & $M_STREAMFILE) != 0) { goto btag_dup; } $mask |= $M_STREAMFILE; $t = getstr($value, $B2_STFILELEN, $F_SPACE); if (!defined($t)) { goto btag_invalid; } $epw2->[$num]->{'streamfile'} = $t; } elsif ($name eq $B2TAG_PAD2) { if ($type < $EPWING2) { goto btag_epw2only; } if (($mask & $M_PADDING2) != 0) { goto btag_dup; } $mask |= $M_PADDING2; $t = gethex($value, $B2_PAD2LEN); if (!defined($t)) { goto btag_invalid; } $epw2->[$num]->{'pad2'} = $t; } elsif ($name eq $B2TAG_RSV2) { if ($type < $EPWING2) { goto btag_epw2only; } if (($mask & $M_RESERVED2) != 0) { goto btag_dup; } $mask |= $M_RESERVED2; $t = gethex($value, $B2_RSV2LEN); if (!defined($t)) { goto btag_invalid; } $epw2->[$num]->{'reserved2'} = $t; } elsif ($name eq $B2TAG_PAD3) { if ($type < $EPWING2) { goto btag_epw2only; } if (($mask & $M_PADDING3) != 0) { goto btag_dup; } $mask |= $M_PADDING3; $t = gethex($value, $B2_PAD3LEN); if (!defined($t)) { goto btag_invalid; } $epw2->[$num]->{'pad3'} = $t; } else { printf(STDERR "ERR: line %d: 不明のタグです(%s)\n", $line, $name); $err++; next; } next; btag_epwonly: printf(STDERR "ERR: line %d: このタグはEPWING専用です(%s)\n", $line, $buf); $err++; next; btag_epw2only: printf(STDERR "ERR: line %d: このタグはEPWING2以降専用です(%s)\n", $line, $buf); $err++; next; btag_dup: printf(STDERR "ERR: line %d: タグが二重定義されています(%s)\n", $line, $buf); $err++; next; btag_invalid: printf(STDERR "ERR: line %d: 値が不正です(%s)\n", $line, $value); $err++; next; } if ($type >= EPWING && ($mask & $M_BOOKTYPE) == 0) { printf(STDERR "ERR: line %d: %s が見つかりませんでした\n", $line, $BTAG_BOOKTYPE); $err++; } if (($mask & $M_TITLE) == 0) { printf(STDERR "ERR: line %d: %s が見つかりませんでした\n", $line, $BTAG_TITLE); $err++; } if (($mask & $M_DIRECTORY) == 0) { printf(STDERR "ERR: line %d: %s が見つかりませんでした\n", $line, $BTAG_DIRECTORY); $err++; } if ($type >= EPWING && ($mask & $M_INFOBLOCK) == 0) { if ($epw->[$num]->{'booktype'} !~ /^\xf0/) { # # ストリーム書籍以外なら # 書籍管理情報ブロックは # 第1ブロックと仮定する # $epw->[$num]->{'infoblock'} =~ s/(.)./$1\x01/; } } $num++; } $hdr->{'books'} = pack('C2', ($num >> 8) & 0xff, $num & 0xff); if ($st > $num) { printf(STDERR "ERR: %s の値が書籍数を超えています\n", $CTAG_SELECT); $err++; } $fp->close(); if ($err) { return undef; } $fp = FileHandle->new($catalog, 'w'); if (!defined($fp)) { printf(STDERR "%s が作成できません\n", $catalog); return undef; } binmode($fp); $buf = ''; $buf .= $hdr->{'books'}; $buf .= $hdr->{'cdtype'}; $buf .= $hdr->{'select'}; $buf .= $hdr->{'reserved'}; if (!$fp->print($buf)) { printf(STDERR "書き込みに失敗しました\n"); $fp->close(); return undef; } for ($i = 0; $i < $num; $i++) { $buf = ''; if ($type == $EB) { $buf .= $eb->[$i]->{'booktype'}; $buf .= $eb->[$i]->{'title'}; $buf .= $eb->[$i]->{'directory'}; } elsif ($type == $EPWING || $type > $EPWING) { $buf .= $epw->[$i]->{'booktype'}; $buf .= $epw->[$i]->{'title'}; $buf .= $epw->[$i]->{'directory'}; $buf .= $epw->[$i]->{'dirpos'}; $buf .= $epw->[$i]->{'infoblock'}; $buf .= $epw->[$i]->{'appdef'}; $buf .= $epw->[$i]->{'zgaijifile'}; $buf .= $epw->[$i]->{'hgaijifile'}; } if (!$fp->print($buf)) { printf(STDERR "書き込みに失敗しました\n"); $fp->close(); return undef; } } if ($type > $EPWING) { for ($i = 0; $i < $num; $i++) { $buf = ''; $buf .= $epw2->[$i]->{'reserved1'}; $buf .= $epw2->[$i]->{'bookfile'}; $buf .= $epw2->[$i]->{'pad1'}; $buf .= $epw2->[$i]->{'streamfile'}; $buf .= $epw2->[$i]->{'pad2'}; $buf .= $epw2->[$i]->{'reserved2'}; $buf .= $epw2->[$i]->{'pad3'}; } if (!$fp->print($buf)) { printf(STDERR "書き込みに失敗しました\n"); $fp->close(); return undef; } } if ($fp->tell() % $BLKSIZ != 0) { $buf = "\0" x ($BLKSIZ - $fp->tell() % $BLKSIZ); if (!$fp->print($buf)) { printf(STDERR "書き込みに失敗しました\n"); $fp->close(); return undef; } } $fp->close(); return 1; } sub getline ($) { my($fp) = @_; my($buf); for (;;) { $buf = $fp->getline(); $line++; if (!defined($buf)) { return undef; } $buf =~ s/\r?\n?$//; if ($buf !~ /^$/ && $buf !~ /^;/) { last; } } return $buf; } sub getvalue ($) { my($buf) = @_; my($name, $value); if ($buf !~ /^([^=]+)=(.*)$/) { return undef; } ($name, $value) = ($1, $2); $name =~ s/^[ \t]+//; $name =~ s/[ \t]+$//; $value =~ s/^[ \t]+//; $value =~ s/[ \t]+$//; if ($value =~ /^\"/) { if ($value !~ /\"$/) { return undef; } } else { $value =~ s/ .*$//; } return ($name, $value); } sub gethex ($$) { my($str, $len) = @_; my($buf) = ''; while ($len-- > 0) { if ($str !~ /^[0-9A-Fa-f]/) { last; } $buf .= pack('C', hex(substr($str, 0, 2))); $str = substr($str, 2); } if ($str ne '') { return undef; } while ($len-- > 0) { $buf .= "\0"; } return $buf; } sub getstr($$$) { my($str, $len, $type) = @_; my($buf) = ''; my($hex); if ($str !~ /^\"/) { return undef; } $str = substr($str, 1); while ($len > 0) { if ($str eq '') { return undef; } if ($str =~ /^\"/) { last; } if ($str !~ /^\\/) { $buf .= substr($str, 0, 1); $str = substr($str, 1); $len--; next; } $str = substr($str, 1); if ($str eq '') { next; } elsif ($str =~ /^[xX]/) { $str = substr($str, 1); $hex = gethex($str, 1); if (!defined($hex)) { return undef; } $buf .= $hex; $str = substr($str, 2); } else { $buf .= substr($str, 0, 1); } } if ($str !~ /^\"/) { return undef; } if ($type == $F_NUL) { while ($len-- > 0) { $buf .= "\0"; } } else { while ($len-- > 0) { $buf .= ' '; } } return $buf; } sub getjstr($$) { my($str, $len) = @_; my($buf) = ''; my($c1, $c2); if ($str !~ /^\"/) { return undef; } $str = substr($str, 1); if ($encoding == $EUC) { while ($len > 0) { if ($str eq '') { return undef; } if ($str =~ /^\"/) { last; } if ($str =~ /^[\x00-\xa0\xff]/ || $str =~ /^.[\x00-\xa0\xff]/) { return undef; } $buf .= pack('C', ord($str) & 0x7f); $str = substr($str, 1); $buf .= pack('C', ord($str) & 0x7f); $str = substr($str, 1); $len -= 2; } } if ($encoding == $SJIS) { while ($len > 0) { if ($str eq '') { return undef; } if ($str =~ /^\"/) { last; } $c1 = ord($str); $str = substr($str, 1); $c2 = ord($str); $str = substr($str, 1); if ($c1 < 0x81 || $c1 > 0x9f && $c1 < 0xe0 || $c1 > 0xef) { return undef; } if ($c1 > 0x9f) { $c1 -= 0x40; } $c1 += $c1; if ($c2 <= 0x9e) { $c1 -= 0xe1; if ($c2 >= 0x80) { $c2 -= 1; } $c2 -= 0x1f; } else { $c1 -= 0xe0; $c2 -= 0x7e; } $buf .= pack('C', $c1); $buf .= pack('C', $c2); $len -= 2; } } if ($str !~ /^\"/) { return undef; } while ($len-- > 0) { $buf .= "\0"; } return $buf; } main; freepwing-1.5.orig/catdump/catalogs.txt0000644000175000017500000000034211022404342017604 0ustar mhattamhatta[Catalog] FileName = catalogs Type = EPWING1 Books = 2 [Book] Title = "辞書サンプル1" BookType = 6001 Directory = "SAMPLE1" [Book] Title = "辞書サンプル2" BookType = 6001 Directory = "SAMPLE2" freepwing-1.5.orig/catdump/catalogs0000644000175000017500000000400011022404342016761 0ustar mhattamhatta`<-=q%5%s%W%k#1SAMPLE1 `<-=q%5%s%W%k#2SAMPLE2 freepwing-1.5.orig/README0000644000175000017500000000457211022404342014502 0ustar mhattamhatta FreePWING Free JIS X 4081 Formatter FreePWING $B$O(B JIS X 4081 $B7A<0$N=q@R%G!<%?$r@8@.$r9T$&%=%U%H%&%'%"$G$9!#(B JIS X 4081 $B$O(B EPWING V1 $B$N%5%V%;%C%H$G$9$N$G!"(BFreePWING $B$K$h$C$F@8@.$7(B $B$?(B JIS X 4081 $B7A<0$N=q@R%G!<%?$O!"86M}>e(B EPWING $B$N8!:w%=%U%H%&%'%"$G8!(B $B:w$r9T$&$3$H$,2DG=$G$9!#(B $B$?$@$7!"(BFreePWING $B$G:n@.$7$?(B JIS X4081 $B7A<0$N=q@R%G!<%?$,!"$*;}$A$N(B EPWING $B8!:w%=%U%H%&%'%"$G@5$7$/07$($J$+$C$?$H$7$F$b!"8!:w%=%U%H%&%'%"(B $B$NH/Gd85$d:ne$K$"$k$H(B $B8!:w$G$-$J$$$h$&$K$J$C$F$$$k$b$N$b$"$j$^$9!#(B) FreePWING $B$N$[$H$s$I$NItJ,$O(B Perl 5 ($B%P!<%8%g%s(B 5.005 $B0J>e$,I,MW(B) $B$G=q(B $B$+$l$F$$$^$9$,!"8=>u$G$O(B UNIX $B7O(B OS $B$*$h$S(B Cygwin $B$N$h$&$J(B UNIX $B8_49$N(B $B3+H/4D6-$r%$%s%9%H!<%k$7$F$"$k%7%9%F%`>e$G$J$$$HF0:n$7$^$;$s!#@8@.$7$?(B $B=q@R%G!<%?$O%7%9%F%`$K$h$i$:6&DL$J$N$G!"(BUNIX $B0J30$G$b;H$($^$9!#(B FreePWING $B$O%U%j!<%=%U%H%&%'%"$G$9!#$"$J$?$O!"(BFree Software Foundation $B$,8xI=$7$?(B GNU General Public License (GNU $B0lHL8xM-;HMQ5vBz(B) $B%P!<%8%g%s(B 2 $B$"$k$$$O$=$l0J9_$N3F%P!<%8%g%s$NCf$+$i$$$:$l$+$rA*Br$7!"$=$N%P!<%8%g(B $B%s$,Dj$a$k>r9`$K=>$C$FK\%W%m%0%i%`$r:FHRI[$^$?$OJQ99$9$k$3$H$,$G$-$^$9!#(B FreePWING $B$OM-MQ$H$O;W$$$^$9$,!"HRI[$K$"$?$C$F$O!";T>l@-5Z$SFCDjL\E*E,(B $B9g@-$K$D$$$F$N0EL[$NJ]>Z$r4^$a$F!"$$$+$J$kJ]>Z$b9T$$$^$;$s!#>\:Y$K$D$$(B $B$F$O(B GNU General Public License $B$r$*FI$_2<$5$$!#(B FreePWING $B$G@8@.$7$?(B JIS X 4081 $B7A<0$N%G!<%?$K4X$7$F$O!";HMQ5vBz$*$h$S(B $B$=$NB>$N8"Mx$K$D$$$F!"(BFreePWING $B$NCx:ne=R$N(B GNU General Public License $B$K=>$$!"$"$J$?$N:n@.$7$?%G!<%?(B $B$KBP$7$F!"(BFreePWING $B$O$$$+$J$kJ]>Z$b9T$$$^$;$s!#(B $B$3$N%P!<%8%g%s$N%j%j!<%9$K$*$1$k!"pJs$O freepwing-1.5.orig/missing0000755000175000017500000002466611022404342015227 0ustar mhattamhatta#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2003-09-02.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # 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, 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; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: freepwing-1.5.orig/doc/0000755000175000017500000000000011022640523014362 5ustar mhattamhattafreepwing-1.5.orig/doc/html-include0000755000175000017500000001306711022404341016700 0ustar mhattamhatta#! /usr/bin/perl # # Copyright (c) 2004 Motoyuki Kasahara # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. Neither the name of the project nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # # html-include -- tiny file inclusion processoor for HTML. # # Usage: # html-include [-o output-file] [input-file] # # `html-include' extracts file inclusion directives in HTML, and output # the result. The following is file inclusion directive line that # `html-include' recognizes: # # # # Note that "[ \t]*$|) { # # This is file inclusion directive line. # if (++$i >= $max_nest_level) { die "$0: too deep inclusion\n"; } $in_files[$i] = {'handle' => new FileHandle, 'name' => search_file($1), 'lineno' => 0}; if (!$in_files[$i]->{handle}->open('<' . $in_files[$i]->{name})) { die "$0: failed to open the file, $!: " . $in_files[$i]->{name} . "\n"; } if ($comment_mode) { print $out_file->{handle}->printf("\n", $in_files[$i]->{name}, $in_files[$i]->{lineno} + 1); } } else { $out_file->{handle}->print($_, "\n"); } $out_file->{lineno}++; } $in_files[$i]->{handle}->close(); last if (--$i < 0); if ($comment_mode) { $out_file->{handle}->printf("\n", $in_files[$i]->{name}, $in_files[$i]->{lineno} + 1); } } sub search_file ($) { my ($file) = @_; foreach my $dir (@search_paths) { return "$dir/$file" if (-r "$dir/$file"); } return $file; } freepwing-1.5.orig/doc/Makefile.am0000644000175000017500000000204011022404341016406 0ustar mhattamhattapkgdoc_DATA = freepwing.html freepwing.css EXTRA_DIST = freepwing.html.in freepwing.css html-include html-split html-toc CLEANFILES = *.html install-data-hook: for i in $(pkgdoc_DATA); do \ base="`echo $$i | sed -e 's/\.html//'`"; \ for j in $$base-[0-9][0-9].html; do \ test -r $$j || continue; \ echo " $(INSTALL_DATA) '$$j' '$(DESTDIR)$(pkgdocdir)/$$j'"; \ $(INSTALL_DATA) "$$j" "$(DESTDIR)$(pkgdocdir)/$$j"; \ done; \ done uninstall-hook: for i in $(pkgdoc_DATA); do \ base="`echo $$i | sed -e 's/\.html//'`"; \ rm -f "$(DESTDIR)$(pkgdocdir)"/$$base-*.html; \ done version.html: rm -f $@ echo $(VERSION) > version.html freepwing.html: freepwing-cat.html rm -f $@ $(PERL) $(srcdir)/html-split -p freepwing -l h1 -Z -w 2 \ freepwing-cat.html freepwing-cat.html: $(srcdir)/freepwing.html.in version.html toc.html rm -f $@ $(PERL) $(srcdir)/html-include -o $@ $(srcdir)/freepwing.html.in toc.html: $(srcdir)/freepwing.html.in rm -f $@ $(PERL) $(srcdir)/html-toc -M h3 $(srcdir)/freepwing.html.in > $@ freepwing-1.5.orig/doc/Makefile.in0000644000175000017500000002362411022411535016435 0ustar mhattamhatta# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = doc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(pkgdocdir)" pkgdocDATA_INSTALL = $(INSTALL_DATA) DATA = $(pkgdoc_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GNUMAKE = @GNUMAKE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SORT = @SORT@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ perllibdir = @perllibdir@ pkgdocdir = @pkgdocdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkgdoc_DATA = freepwing.html freepwing.css EXTRA_DIST = freepwing.html.in freepwing.css html-include html-split html-toc CLEANFILES = *.html all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-pkgdocDATA: $(pkgdoc_DATA) @$(NORMAL_INSTALL) test -z "$(pkgdocdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdocdir)" @list='$(pkgdoc_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgdocDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdocdir)/$$f'"; \ $(pkgdocDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdocdir)/$$f"; \ done uninstall-pkgdocDATA: @$(NORMAL_UNINSTALL) @list='$(pkgdoc_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgdocdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgdocdir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(pkgdocdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-pkgdocDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkgdocDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: install-am install-data-am install-strip uninstall-am .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-hook install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkgdocDATA install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am uninstall-hook \ uninstall-pkgdocDATA install-data-hook: for i in $(pkgdoc_DATA); do \ base="`echo $$i | sed -e 's/\.html//'`"; \ for j in $$base-[0-9][0-9].html; do \ test -r $$j || continue; \ echo " $(INSTALL_DATA) '$$j' '$(DESTDIR)$(pkgdocdir)/$$j'"; \ $(INSTALL_DATA) "$$j" "$(DESTDIR)$(pkgdocdir)/$$j"; \ done; \ done uninstall-hook: for i in $(pkgdoc_DATA); do \ base="`echo $$i | sed -e 's/\.html//'`"; \ rm -f "$(DESTDIR)$(pkgdocdir)"/$$base-*.html; \ done version.html: rm -f $@ echo $(VERSION) > version.html freepwing.html: freepwing-cat.html rm -f $@ $(PERL) $(srcdir)/html-split -p freepwing -l h1 -Z -w 2 \ freepwing-cat.html freepwing-cat.html: $(srcdir)/freepwing.html.in version.html toc.html rm -f $@ $(PERL) $(srcdir)/html-include -o $@ $(srcdir)/freepwing.html.in toc.html: $(srcdir)/freepwing.html.in rm -f $@ $(PERL) $(srcdir)/html-toc -M h3 $(srcdir)/freepwing.html.in > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: freepwing-1.5.orig/doc/html-toc0000755000175000017500000001056111022404341016036 0ustar mhattamhatta#! /usr/bin/perl # # Copyright (c) 2004 Motoyuki Kasahara # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. Neither the name of the project nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # # html-toc -- make `table of contents' of HTML files. # # Usage: # html-index [option...] input-file... # # `html-toc' reads HTML files, and generates `table of contents' (TOC) # of the HTML files. The TOC is created from

...

tags and # tag in the HTML files. Since `html-toc' doesn't parse # HTML precisely, the tags must be the following form: # # heading # # where `?' is 1..6. Note that and above must be in the same # line. # # `html-toc' outputs TOC to standard out by default. # # Options: # -o file specify output file. # -h do not output file name in . # -m level minimum target heading level # (default: h1) # -M level maximum target heading level # (default: h6) require 5.005; use Getopt::Std; # # Usage # my $usage = "Usage: $0 [option...] input-file...\n"; # # Variables # my $out_file = '-'; my @preamble = (); my $fragment_only = 0; my $min_level = 1; my $max_level = 6; # # Parse command line arguments. # my %options; getopts('o:hm:M:', \%options) or die $usage; die $usage if (@ARGV == 0); $fragment_only = 1 if (defined($options{h}) || @ARGV == 1); $out_file = $options{o} if (defined($options{o})); if (defined($options{m})) { $options{m} =~ s/^h//; $min_level = $options{m}; } if (defined($options{M})) { $options{M} =~ s/^h//; $max_level = $options{M}; } # # Read an HTML file. # $current_level = $min_level; if ($out_file eq '-') { $out_file = 'stdout'; open(OUT_FILE, ">& STDOUT"); } else { if (!open(OUT_FILE, "> $out_file")) { die "$0: failed to open the file, $!: $out_file\n"; } } print OUT_FILE "\n"; } while ($current_level < $level) { print OUT_FILE ' ' x ($current_level - $min_level + 1); print OUT_FILE "
    \n"; $current_level++; } print OUT_FILE ' ' x ($current_level - $min_level + 1); if ($fragment_only) { print OUT_FILE sprintf("
  • %s\n", $tag, $heading); } else { print OUT_FILE sprintf("
  • %s\n", $in_file, $tag, $heading); } } } close(IN_FILE); } while ($current_level > $min_level) { $current_level--; print OUT_FILE ' ' x ($current_level - $min_level + 1); print OUT_FILE "
\n"; } print OUT_FILE "\n"; close(OUT_FILE); freepwing-1.5.orig/doc/html-split0000755000175000017500000001357111022404341016410 0ustar mhattamhatta#! /usr/bin/perl # # Copyright (c) 2004 Motoyuki Kasahara # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. Neither the name of the project nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # # html-split -- split an HTML file. # # Usage: # html-split [option...] input-file # # `html-split' splits an HTML file with heading tags (

...

). # Suppose that `input-file' is `foo.html', HTML files splitted by # `html-split' are `foo-0.html', `foo-1.html', and so on. # # Options: # -Z do not add `-0' to the first split. # -l LEVEL split with this heading level # (default: h2) # -p PREFIX prefix of splitted HTML files. # -s SUFFIX suffix of splitted HTML files. # (default: html) # -w WIDTH minimum width of split number. # (default: 1) # -t TOC fragment name of `Table of Contents'. # (default: toc) # require 5.005; use Getopt::Std; use File::Basename; # # Usage # my $usage = "Usage: $0 [option...] input-file\n"; # # Variables # my $in_file; my $out_prefix; my $out_suffix; my $counter_width = 1; my $split_level = 2; my $toc_tag = 'toc'; my $supress_zero_flag = 0; my @toc = (); my @indice = (); my @preamble = (); my $toc_page = 0; # # Parse command line arguments. # my %options; getopts('Zl:w:p:s:t:', \%options) or die $usage; die $usage if (@ARGV != 1); $in_file = $ARGV[0]; if (defined($options{l})) { $options{l} =~ s/^h//; $split_level = $options{l}; } $counter_width = $options{w} if (defined($options{w})); $supress_zero_flag = defined($options{Z}); $toc_tag = $options{t} if (defined($options{t})); if (defined($options{p})) { $out_prefix = $options{p}; } else { $out_prefix = basename($in_file, '.htm', '.html'); } if (defined($options{s})) { $out_suffix = $options{s}; } elsif ($in_file =~ m|\.htm$|) { $out_suffix = 'htm'; } else { $out_suffix = 'html'; } # # Read an HTML file. # if (!open(IN_FILE, "< $in_file")) { die "$0: failed to open the file, $!: $in_file\n"; } my $toc_found = 0; my $page = 0; while () { last if (m|^|); push(@preamble, $_); } while () { chomp; last if (m|^|); if (m|^| && $1 <= $split_level) { $page++ if (@toc > 0); push(@toc, $_); } if (m||) { my $tag = $1; if ($tag eq $toc_tag) { $toc_page = $page; $toc_found = 1; } push(@indice, {'tag' => $tag, 'page' => $page}); } } close(IN_FILE); if (!$toc_found) { die "$0: not found\n"; } # # Generate splitted HTML files. # if (!open(IN_FILE, "< $in_file")) { die "$0: failed to open the file, $!: $in_file\n"; } while () { last if (m|^|); } for (my $page = 0; $page < @toc; $page++) { my $bar = ''; if ($page > 0) { $bar .= sprintf("[前へ] ", splitted_file_name($page - 1)); } if ($page + 1 < @toc) { $bar .= sprintf("[次へ] ", splitted_file_name($page + 1)); } $bar .= sprintf("[目次] ", splitted_file_name($toc_page), $toc_tag); my $out_file = splitted_file_name($page); if (!open(OUT_FILE, "> $out_file")) { die "$0: failed to open the file, $!: $out_file\n"; } foreach my $j (@preamble) { print OUT_FILE $j; } print OUT_FILE "\n"; print OUT_FILE "

\n", $bar, "\n

\n
\n"; print OUT_FILE $toc[$page], "\n"; for (;;) { $_ = ; chomp; if (!defined($_) || m|^|) { 1 while (); last; } elsif (m|^| && $1 <= $split_level) { next if ($page == 0 && $_ eq $toc[$page]); last; } 1 while (s||&rewrite_href($1)|e); print OUT_FILE $_, "\n"; } print OUT_FILE "
\n

\n", $bar, "\n

\n"; print OUT_FILE "\n"; print OUT_FILE "\n"; close(OUT_FILE); } close(IN_FILE); # # Return n'th splitted file name. # sub splitted_file_name ($) { my ($n) = @_; if ($n == 0 && $supress_zero_flag) { return sprintf("%s.%s", $out_prefix, $out_suffix); } else { return sprintf("%s-%0${counter_width}d.%s", $out_prefix, $n, $out_suffix); } } # # Rewrite
. # sub rewrite_href ($) { my ($tag) = @_; for (my $i = 0; $i < @indice; $i++) { if ($indice[$i]->{tag} eq $tag) { return sprintf("", splitted_file_name($indice[$i]->{page}), $tag); } } warn "$0: unknown tag \`$tag'\n"; return ""; } freepwing-1.5.orig/doc/freepwing.css0000644000175000017500000000117411022404341017061 0ustar mhattamhattabody { color: #000000; background-color: #ffffff; } td { border-style: solid; border-width: 1px; } table { border-style: solid; border-width: 2px; } h1 { font-size: x-large; background-color: #00cfcf; padding: 3px; border-style: solid; border-width: 1px; } h2 { font-size: large; background-color: #00cfcf; padding: 3px; border-style: solid; border-width: 1px; } h3 { font-size: medium; background-color: #cfcfcf; padding: 3px; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; } freepwing-1.5.orig/doc/freepwing.html.in0000644000175000017500000026467611022514717017675 0ustar mhattamhatta FreePWING プログラミングドキュメント

FreePWING プログラミングドキュメント

この文書は、FreePWING バージョン に対応しています。

Copyright (c) 1999-2005 Motoyuki Kasahara

はじめに

FreePWING は JIS X 4081 形式の書籍データを生成を行うソフトウェアです。 JIS X 4081 は EPWING V1 のサブセットですので、FreePWING によって生成 した JIS X 4081 形式の書籍データは、原理上 EPWING の検索ソフトウェアで検索 を行うことが可能です。

ただし、FreePWING で作成した JIS X4081 形式の書籍データが、お持ちの EPWING 検索ソフトウェアで正しく扱えなかったとしても、検索ソフトウェア の発売元や作者に対して問い合わせることはご遠慮下さい。 (Windows 向けの EPWING 検索ソフトウェアには、書籍データが CD-ROM 以外 の媒体上にあると検索できないようになっているものもあります。)

FreePWING のほとんどの部分は Perl 5 (バージョン 5.005 以上が必要) で 書かれていますが、現状では UNIX 系 OS および Cygwin のような UNIX 互換 の開発環境をインストールしてあるシステム上でないと動作しません。 生成した書籍データはシステムによらず共通なので、UNIX 以外でも使えます。

FreePWING はフリーソフトウェアです。 あなたは、Free Software Foundation が公表した GNU General Public License (GNU 一般公有使用許諾) バージョン 2 あるいはそれ以降の 各バージョンの中からいずれかを選択し、そのバージョンが定める条項に 従って本プログラムを再頒布または変更することができます。

FreePWING は有用とは思いますが、頒布にあたっては、市場性及び 特定目的適合性についての暗黙の保証を含めて、いかなる保証も行いません。 詳細については GNU General Public License をお読み下さい。

FreePWING で生成した JIS X 4081 形式のデータに関しては、使用許諾および その他の権利について、FreePWING の著作者は一切の主張をいたしません。 ただし、上述の GNU General Public License に従い、あなたの作成した データに対して、FreePWING はいかなる保証も行いません。

最新の FreePWING は ftp://ftp.sra.co.jp/pub/misc/freepwing/ から入手できます。

FreePWING に関する情報は http://www.sra.co.jp/people/m-kasahr/freepwing/ から得ることができます。

コメントやバグの報告は m-kasahr@sra.co.jp 宛にお送り下さい。

FreePWING の概要

あなたが既に FreePWING で変換してみたい書籍データをお持ちなら、その 辞書は JIS X 4081 以外の形式、たとえば、HTML、Texinfo、PDIC といった 形式で書かれていると思います。 しかしながら、FreePWING にはこうした特定のテキスト形式を解釈する機能は ありません。 もし、書籍データが HTML で書かれているとしたら、データを HTML として 解釈する処理プログラムはあなたが用意しなくてはなりません。

たとえば、HTML で書かれた書籍データに一節があったとします。

FreePWING では<EM>できません</EM>!!!

HTML では <EM> と </EM> はそのまま文章として 扱われるのではなく、その間の文字列を強調するという意味を持ちます。 したがって、HTML を JIS X 4081 形式に変換するためには、<EM> や </EM> が特殊な意味を持つことを認識して、他の普通の文字列とは 分けて処理しなくてはなりません。

けれども、繰り返しになりますが、FreePWING には HTML を解釈する機能は 用意されていません。 JIS X 4081 形式に変換するには、HTML を解釈するための HTML パーサ (構文解析器) と、解釈したデータを FreePWING に渡すための橋渡し的な プログラムを用意する必要があります。

「<EM>できません</EM>」の部分を JIS X 4081 形式に変換する FreePWING プログラムを敢えて書くなら、次のようになります。

## $text は FreePWING::FPWUtils::Text クラスのオブジェクトで、
## 既に出力ファイルをオープンしているものとします。
$text->add_emphasis_start();
$text->add_text("できません");
$text->add_emphasis_end();

このように、FreePWING を扱うには、プログラミング、特に Perl 5 での プログラミングが常に付いて回ります。 FreePWING の実体は、「Perl 5 用のライブラリ」と言っても良いでしょう。

この文書は、FreePWING のプログラミングの仕方について解説します。 なお、あなたが既に Perl 5 のプログラミングの基本知識を身に付けている ものとしますので、あらためてこの文書の中で説明することは致しません。 ご了承下さい。

FreePWING が生成できるデータ要素

FreePWING が変換した書籍データには、次の機能を与えることができます。

本文データ
書籍の本文です。
メニュー表示用データ
階層構造になった、特殊な本文です。 詳しくは メニュー の節をご覧下さい。
著作権表示データ
書籍の著作権表示です。
前方一致検索
ユーザが入力した単語に対して、その先頭部分が一致する単語を検索します。 たとえば `ques' という単語を検索すると、先頭が `ques' で始まる語 (`quest', `question' など) を見つけられます。 主に、辞書タイプの書籍で使います。
後方一致検索
ユーザが入力した単語に対して、その末尾部分が一致する単語を検索します。 たとえば `lism' という単語を検索すると、末尾が `lism' で始まる語 (`realism', `nationalism' など) を見つけられます。 これも、主に辞書タイプの書籍で使います。
条件一致検索
前方一致や完全一致検索とは異なり、複数の単語すべてにマッチする エントリを探し出すための検索方法として、条件検索 (keyword search) が あります。 たとえば、英語辞典で入力した英単語すべてを用いた例文を探す機能を実現 するときなどに使用することができます。
外字
書籍固有の字を定義して、使うこととができます。

なお、この一覧には「完全一致検索」(ユーザが入力した単語に対して、完全 に一致する単語の検索) はありません。 これは、FreePWING が対応していないからではなく、完全一致検索は 前方一致検索用のデータを使って行うからです。 したがって、書籍に前方一致検索の機能を持たせれば、完全一致検索も扱う ことができまるようになります。

FreePWING プログラムの作成例

ここからは、FreePWING の実際のプログラミングについて解説します。 JIS X 4081 は、辞典検索を得意とするデータ形式になっていますので、本章 でも辞典を対象にして、JIS X 4081 形式のデータを生成するまでの過程を 記すことにします。

例題「国語辞典」の仕様

すでに JIS X 4081 形式になった国語辞典があるとしましょう。 EPWING の検索ソフトウェアを用いて、この辞典で「たいさく」という語を 引いてみると、おそらく「大作」「対策」という語が見つかり、以下のような 感じで見出しが表示されると思います。

たいさく 【大作】
たいさく 【対策】

次に、このうちの「対策」の方を選ぶと、「対策」という語についての本文が 表示されます。

たいさく 【対策】
状況に応じてとる手段や策略。

通常、紙の辞典では、この本文の部分が「対策」という語に関する全データに なるでしょう。 それに対して、JIS X 4081 形式の辞典では、本文というデータに加えて、 「たいさく」が「対策」の検索語であるという情報や、検索したときに表示 する見出しをデータとして保持しています。 つまり、JIS X 4081 形式の辞書データでは、「検索語」、「見出し」、 「本文」の三つの成分に分けて保持するのです。

検索語
たいさく、対策
見出し
たいさく 【対策】
全文
たいさく 【対策】
状況に応じてとる手段や策略。

(JIS X 4081 形式は漢字を含んだ語も検索できますので、「たいさく」に 加えて「対策」も検索語として挙げています。 つまり、見出し、本文は一つであるのに対し、検索語は複数個用意することが できます。)

あなたが紙の辞典と似た書式の辞典データを JIS X 4081 形式に変換しようと 思ったら、このようにデータを検索語、見出し、本文に分類する処理を行う ことになります。 逆に分類さえ行えば、残る JIS X 4081 形式への変換処理の殆んどは FreePWING が自動的に行います。

プログラムの全容

では、前節の国語辞典のようなデータを JIS X 4081 形式に変換する FreePWING のプログラムを実際に作ることにしましょう。 今回の辞典では簡略化のため、前方一致、後方一致検索だけを用意すること にします。 条件検索や外字は使いません。

まず、変換前の辞典データの形式について若干補足しておきます。 辞典データの形式は、次のように見出しと説明が一行ごとに交互に現れる という単純なものであるとします。

たいさく 【大作】              (← 見出し)
大掛かりな作品。               (← 説明)
たいさく 【対策】              (← 見出し)
状況に応じてとる手段や策略。   (← 説明)

見出し部分の正確な書式は、次のいずれかの形式であるものとします。

形式 1:  <かな検索語>
形式 2:  <かな検索語> <空白> "【" <漢字を含んだ検索語> "】"

さらに、元のデータは EUC-JP で書かれているもとします。 これは、FreePWING の取り扱う文字コードが EUC-JP だからです。 別のコードで書かれている場合は、jcode.plJcode.pm などで、EUC-JP に変換してから処理する必要が あります。

この国語辞典データを処理する FreePWING プログラム例は、以下の通りです。 プログラムの細部の説明は、次節以降で行います。 なお、データと同様に、本プログラムも EUC-JP で書かれているものとします。

use FreePWING::FPWUtils::FPWParser;

## インスタンスを生成する。
$fpwword2   = FreePWING::FPWUtils::Word2->new();
$fpwheading = FreePWING::FPWUtils::Heading->new();
$fpwtext    = FreePWING::FPWUtils::Text->new();

## 書き込み用の作業ファイルを開く。
$fpwword2->open()   || die $fpwword2->error_message() . "\n";
$fpwheading->open() || die $fpwheading->error_message() . "\n";
$fpwtext->open()    || die $fpwtext->error_message() . "\n";

for (;;) {
   ## 次の一行 (見出し) を読み込む。
   last if (!defined($_ = <>));
   chomp;

   ## 本文と見出しを新しいエントリに切り替える。
   $fpwtext->new_entry()
      || die $fpwtext->error_message() . "\n";
   $fpwheading->new_entry()
      || die $fpwheading->error_message() . "\n";

   ## 見出しを書き込む。
   $fpwheading->add_text($_)
      || die $fpwheading->error_message() . "\n";

   ## 本文を書き込む。
   if (!$fpwtext->add_keyword_start()
      || !$fpwtext->add_text($_)
      || !$fpwtext->add_keyword_end()
      || !$fpwtext->add_newline()) {
      die $fpwtext->error_message() . "\n";
   }

   ## かなの検索語を登録する。
   ($kanaword = $_) =~ s/ 【.*$//;
   $heading_position = $fpwheading->entry_position();
   $text_position = $fpwtext->entry_position();
   if (!$fpwword2->add_entry($kanaword, $heading_position, 'head',
       $text_position, 'text')) {
      die $fpwword2->error_message() . "\n";
   }

   ## 漢字の検索語があれば、それも登録する。
   if (/ 【(.*)】$/) {
      $kanjiword = $1;
      if (!$fpwword2->add_entry($kanjiword, $heading_position, 'head',
          $text_position, 'text')) {
         die $fpwword2->error_message() . "\n";
      }
   }

   ## 次の一行 (説明) を読み込む。
   last if (!defined($_ = <>));

   ## 本文を書き込む。
   if (!$fpwtext->add_text($_)
      || !$fpwtext->add_newline()) {
      die $fpwtext->error_message() . "\n";
   }
}

## 書き込み用の作業ファイルを閉じる。
$fpwword2->close()   || die $fpwword2->error_message() . "\n";
$fpwheading->close() || die $fpwheading->error_message() . "\n";
$fpwtext->close()    || die $fpwtext->error_message() . "\n";

インスタンスの初期化

本節から数節に分けて、前節に示した FreePWING プログラムの解説を 行います。

今回の国語辞典データの例では、FreePWING が用意している以下の 3 つの クラスを使います。

FreePWING::FPWUtils::Word2
前方一致、後方一致検索のための検索語の登録
(`Word2' の `2' は、前方一致、後方一致を同時に扱えることからこの名前が 付いています。)
FreePWING::FPWUtils::Heading
見出しデータの登録
FreePWING::FPWUtils::Text
本文データの登録

これらのクラスを使うには、モジュールを直接読み込むのではなく、 FreePWING::FPWUtils::FPWParser というモジュールを 読み込みます。 このモジュールが、上記の 3 つのクラスと同名のモジュールを読み込みます。

use FreePWING::FPWUtils::FPWParser;

次に各クラスのインスタンスを一つずつ生成します。

## インスタンスを生成する。
$fpwword2   = FreePWING::FPWUtils::Word2->new();
$fpwheading = FreePWING::FPWUtils::Heading->new();
$fpwtext    = FreePWING::FPWUtils::Text->new();

さらに、それぞれのオブジェクトに対して open() メソッドを 呼び出して、作業用ファイルを開いておきます。 ファイル名は、あらかじめモジュール内部で決めてあるものが使用されます。

## 書き込み用の作業ファイルを開く。
$fpwword2->open()   || die $fpwword2->error_message() . "\n";
$fpwheading->open() || die $fpwheading->error_message() . "\n";
$fpwtext->open()    || die $fpwtext->error_message() . "\n";

国語辞典データの読み込み

これより後はしばらく、for 文を用いた無限の繰り返しに なっています。 この for ブロックが処理の中心部分です。

元の国語辞典データの読み込み方は自由ですが、今回は Perl の ファイルハンドル <> から読み込むことにしました。 for ブロックの中で見出しと説明を一行ずつ交互に 読んでいます。 ファイルの終端まで呼んだら for ループから抜けます。 処理の概要を記すと、次のようになります。

for (;;) {
   ## 次の一行 (見出し) を読み込む。
   last if (!defined($_ = <>));

   (読み込んだ見出しの処理...)

   ## 次の一行 (説明) を読み込む。
   last if (!defined($_ = <>));

   (読み込んだ説明の処理...)
}

読み込んだ見出しの処理

続いて、for ブロックの中の処理について見ていきます。 見出し分のデータを一行読み込んだら、まず本文と見出しオブジェクトに 対してそれぞれ new_entry() を呼び、次に新しい 「エントリ (entry)」に切り替える処理を行ってから、本文 ($fpwtext)、見出し($fpwheading) に 書き込みます。

   ## 次の一行 (見出し) を読み込む。
   last if (!defined($_ = <>));
   chomp;

   ## 本文と見出しを新しいエントリに切り替える。
   $fpwtext->new_entry()
      || die $fpwtext->error_message() . "\n";
   $fpwheading->new_entry()
      || die $fpwheading->error_message() . "\n";

   ## 読み込んだ見出しを「本文部」に書き込む。
   if (!$fpwtext->add_keyword_start()
      || !$fpwtext->add_text($_)
      || !$fpwtext->add_keyword_end()
      || !$fpwtext->add_newline()) {
      die $fpwtext->error_message() . "\n";
   }

   ## 読み込んだ見出しを「見出し部」に書き込む。
   $fpwheading->add_text($_)
      || die $fpwheading->error_message() . "\n";

本文と見出しのエントリの切り替えとは、現在の検索語の見出し、本文の 終端を宣言し、新たな検索語に切り替えることを意味します。 たとえば、「大作」という検索語に対する書き込みが終わったら、そこで エントリを切り替え、次に「対策」という検索語に対する書き込みを行う、 といった手順で処理を行います。

辞書の元データの見出し分の行は、JIS X 4081 の見出し部と本文部の両方に 書き込んでいますが、これは辞書のデータの分類の仕方を思い出してみれば、 理解できると思います。

検索語
たいさく、対策
見出し
たいさく 【対策】   (←この部分)
全文
たいさく 【対策】   (←この部分)
状況に応じてとる手段や策略。

ただし、本文部では add_keyword_start()add_keyword_end() で囲っいることに注意して下さい。 これによって、囲った部分が「検索キー」であることを記す印が 埋め込まれます。 EPWING の検索ソフトウェアによっては、この印を本文の切れ目を意味する印 として扱っているものもありますので、必ず埋め込むようにして下さい

また、見出しは必ず一行で完結するものなので、改行の書き込み (add_newline() の呼び出し) は行いませんが、本文に対しては 明示的に書き込む必要があります。 読み込んだデータ側に含まれている改行文字 ("\r""\n") は add_text() に渡しても無視されます ので、本文中で改行を行う には必ず add_newline() を呼び出す必要があります。

プログラムでは、次に検索語を登録しています。

   ## かなの検索語を登録する。
   ($kanaword = $_) =~ s/ 【.*$//;
   $heading_position = $fpwheading->entry_position();
   $text_position = $fpwtext->entry_position();
   if (!$fpwword2->add_entry($kanaword, $heading_position,
       $text_position)) {
      die $fpwword2->error_message() . "\n";
   }

検索語の登録は、検索用のオブジェクト ($fpwword2) に対して add_entry() メソッドを呼び出すことによって行います。 本文、見出しとは異なり、検索語の登録前に new_entry() を 呼ぶ必要はありません。 add_entry() には、次の 3 つの引数が必要です。

  • 登録する検索語自身
    (例:「たいさく」)
  • その検索語の見出しの開始位置
    ($fpwheading->entry_position() で得られる位置)
  • その検索語の本文の開始位置
    ($fpwtext->entry_position() で得られる位置)

漢字の検索語の登録処理は、かなの検索語と変わりませんので、説明は 省略します。

読み込んだ本文の処理

ループ内の最後の部分です。 説明分の行を一行読み、それを本文として書き込みます。

   ## 次の一行 (説明) を読み込む。
   last if (!defined($_ = <>));
   chomp;

   ## 本文を書き込む。
   if (!$fpwtext->add_text($_)
      || !$fpwtext->add_newline()) {
      die $fpwtext->error_message() . "\n";
   }

インスタンスの最終処理

ループを抜けた後の部分の処理です。 生成したインスタンスの最終処理として、それぞれのインスタンスで開いて いた書き込み用の作業ファイルを閉じます。 これには、close() メソッドを用います。

## 書き込み用の作業ファイルを閉じる。
$fpwword2->close()   || die $fpwword2->error_message() . "\n";
$fpwheading->close() || die $fpwheading->error_message() . "\n";
$fpwtext->close()    || die $fpwtext->error_message() . "\n";

以上でプログラムは終りです。

FreePWING プログラムの実行

では、この FreePWING プログラムを実行して、JIS X 4081 形式のデータを 生成してみます。 プログラム名が fpwkokugo、データファイル名が kokugo.dat だとすると、次のように実行します。

% perl fpwkokugo kokugo.dat

処理が正常に終了すると、カレントディレクトリには wordewordheadtexttextreftexttag というファイルが生成 されます。 これらのファイルは JIS X 4081 形式のデータファイルではなく、 中間生成ファイルです。 JIS X 4081 形式のデータファイルを作成するには、さらに次のコマンドを 実行する必要があります。

% perl /usr/local/libexec/freepwing/fpwsort
% perl /usr/local/libexec/freepwing/fpwindex
% perl /usr/local/libexec/freepwing/fpwcontrol
% perl /usr/local/libexec/freepwing/fpwlink

(ここでは FreePWING を /usr/local 以下にインストールし、 libexecdir の位置を変更していないものとします。 他の場所にインストールしているときは、適宜読み替えて下さい。)

これらの処理をすべて行うと、カレントディレクトリにはさらにいくつかの 中間生成ファイルに加えて、honmon というファイルが生成 される筈です。この honmon というのが、JIS X 4081 形式の ファイルになります。

しかし、毎回これらのコマンドを一つ一つ手で実行するのは大変ですので、 自動化を考えましょう。 それにはもちろん、コマンド行を書き並べた sh スクリプトを作って実行する ようにしても良いのですが、FreePWING では make に対応するための仕掛けを 用意しています。 これを使えば、データファイルの最終修正時刻が honmon よりも後の場合だけ honmon を生成し直すといったことが できます。

Makefile の作成

fpwmake 用の Makefile の記し方を説明していきます。

まず、この Makefile の文法は、必ず GNU make 向けのもので なければならないので注意して下さい。 つまり、make は必ず GNU make を用いる必要があります。 今回のプログラム用の Makefile は次のようになります。

FPWPARSER = fpwkokugo
FPWPARSERFLAGS = kokugo.txt

include fpwutils.mk

変数 FPWPARSER には作成した FreePWING プログラム名を、 変数 FPWPARSERFLAGS には FreePWING プログラムに渡す コマンド行引数を設定します。 Makefile の末尾では include コマンドを用いて fpwutils.mk というファイルを読み込みます。 (このファイルの中に生成規則が書かれています。 また、GNU make を用いる必要があるのは、このファイルが GNU make 用に 書かれているからに他なりません。)

fpwmake

Makefile が準備できたら、make を実行します。 これには、専用の sh スクリプト fpwmake コマンドを使うと便利です。 fpwmake は GNU make に適切なオプションを与えて呼び出します。

カレントディレクトリを fpwkokugo のあるディレクトリに移して、 次のようにして fpwmake を実行します。

% fpwmake

fpwmake を実行すると、カレントディレクトリには work というディレクトリができ、その下にいくつかのファイルが生成されます。

% ls
control.dep     eidxref1        idxref0         sort.dep
ctrl            esort           idxref1         text
ctrlref         eword           index.dep       textref
eidx0           head            link.dep        texttag
eidx1           idx0            parse.dep       word
eidxref0        idx1            sort

正常に終了すれば、カレントディレクトリに honmon ファイル が生成されます。

作業ファイルの削除

fpwmake を実行すると、カレントディレクトリには work というディレクトリができ、その下にいくつかの中間ファイルが生成されます。 無事に honmon ファイルを生成し終り、中間ファイルおよび honmon ファイルが必要なくなった場合は、fpwmake clean を 実行すると、fpwmake 時に生成されたファイルがすべて消去されます。

% fpwmake clean

くれぐれも消去する前に honmon ファイルを別の場所に移す ことを忘れないで下さい。 そうしないと honmon も消えてしまい、もう一度 fpwmake で 生成し直す羽目になってしまいます。

ALLDEPSCLEANEXTRAターゲット

もし fpwmake を実行するにあたって前処理を行いことがあるときは、 ALLDEPS 変数を利用します。 いま、変換スクリプトを読み込むべき辞書データが、もとは roff の ms マクロを使用して書かれたファイル kokugo.ms であると しましょう。 そして、nroff コマンドを使って平文ファイル kokugo.txt を 生成し、変換スクリプトは平文のほうを読み込んで処理をするとしたら、次の ように書いておきます。

FPWPARSER = fpwkokugo
FPWPARSERFLAGS = kokugo.txt
ALLDEPS = kokugo.txt
CLEANEXTRA   = kokugo.txt

kokugo.txt: kokugo.ms
      rm -f $@
      tbl kokugo.ms | nroff -ms | col -b > kokugo.txt

include fpwutils.mk

ただし、ALLDEPS の仕組みを使って生成したファイル (ここ では kokugo.txt) は fpwmake clean を実行しても消去 されません。 そこで、CLEANEXTRA という変数に fpwmake clean 実行時に 消して欲しいファイルを書いておきます。

ちょっとだけ改良

以上で作業は完了なのですが、ここで再びプログラムの記述に焦点を戻します。

変換プログラムの先頭では、必ず次のようにインスタンスの生成と書き込み用 の作業ファイルを開く処理を行います。 これはどの変換プログラムでも同じです。

## インスタンスを生成する。
$fpwword2   = FreePWING::FPWUtils::Word2->new();
$fpwheading = FreePWING::FPWUtils::Heading->new();
$fpwtext    = FreePWING::FPWUtils::Text->new();

## 書き込み用の作業ファイルを開く。
$fpwword2->open()   || die $fpwword2->error_message() . "\n";
$fpwheading->open() || die $fpwheading->error_message() . "\n";
$fpwtext->open()    || die $fpwtext->error_message() . "\n";

実は、FreePWING にはこの部分と等価な処理をもう少し簡単に書くために、 initialize_fpwparser() というサブルーチンが FreePWING::FPWUtils::FPWParser パッケージに用意されてい ます。 initialize_fpwparser() を使うと、上のプログラムは次のよう に簡略化できます。

initialize_fpwparser('text'    => \$fpwtext,
                     'heading' => \$fpwheading,
                     'word2'   => \$fpwword2);

ファイルを閉じる部分についても同様です。 これまでは、各オブジェクトに対して close() メソッドを呼び 出していました。

## 書き込み用の作業ファイルを閉じる。
$fpwword2->close()   || die $fpwword2->error_message() . "\n";
$fpwheading->close() || die $fpwheading->error_message() . "\n";
$fpwtext->close()    || die $fpwtext->error_message() . "\n";

この部分は、次のように finalize_fpwparser() メソッドで置き 換えることができます。

finalize_fpwparser('text'    => \$fpwtext,
                   'heading' => \$fpwheading,
                   'word2'   => \$fpwword2);

修正版プログラムの全容

前節に記した修正事項を反映すると、プログラムは次のようになります。 これで、本章で扱った変換プログラムは完成です。

use FreePWING::FPWUtils::FPWParser;

## インスタンスを生成する。
initialize_fpwparser('text'    => \$fpwtext,
                     'heading' => \$fpwheading,
                     'word2'    => \$fpwword2);

for (;;) {
   ## 次の一行 (見出し) を読み込む。
   last if (!defined($_ = <>));
   chomp;

   ## 本文と見出しを新しいエントリに切り替える。
   $fpwtext->new_entry()
      || die $fpwtext->error_message() . "\n";
   $fpwheading->new_entry()
      || die $fpwheading->error_message() . "\n";

   ## 見出しを書き込む。
   $fpwheading->add_text($_)
      || die $fpwheading->error_message() . "\n";

   ## 本文を書き込む。
   if (!$fpwtext->add_keyword_start()
      || !$fpwtext->add_text($_)
      || !$fpwtext->add_keyword_end()
      || !$fpwtext->add_newline()) {
      die $fpwtext->error_message() . "\n";
   }

   ## かなの検索語を登録する。
   ($kanaword = $_) =~ s/ 【.*$//;
   $heading_position = $fpwheading->entry_position();
   $text_position = $fpwtext->entry_position();
   if (!$fpwword2->add_entry($kanaword,
       $heading_position, $text_position)) {
      die $fpwword2->error_message() . "\n";
   }

   ## 漢字の検索語があれば、それも登録する。
   if (/ 【(.*)】$/) {
      $kanjiword = $1;
      if (!$fpwword2->add_entry($kanjiword,
          $heading_position, $text_position)) {
         die $fpwword2->error_message() . "\n";
      }
   }

   ## 次の一行 (説明) を読み込む。
   last if (!defined($_ = <>));

   ## 本文を書き込む。
   if (!$fpwtext->add_text($_)
      || !$fpwtext->add_newline()) {
      die $fpwtext->error_message() . "\n";
   }
}

## 書き込み用の作業ファイルを閉じる。
finalize_fpwparser('text'    => \$fpwtext,
                   'heading' => \$fpwheading,
                   'word2'   => \$fpwword2);

諸々の細かな注意点

ここでは、前章で触れなかった諸々の細かな注意点をいくつか記しておきます。

文字コードに関する注意点

FreePWING では、文字コードに EUC-JP を使用していますが、正確には honmon ファイルの中では JIS X 0208 の文字 (全角文字) しか 使用できません。 このため、JIS X 0201 のカタカナ (半角カタカナ) および ASCII の文字 (半角英数字) が与えられると、FreePWING 側で対応する JIS X 0208 の文字 に置き換えられます。

また、JIS X 0212 の文字 (補助漢字) は使用することができず、与えると エラーになります。

検索語に関する注意点

検索語に関する注意点は、次の通りです。

  • 検索語の長さは最長 255 バイトまでとなります。
    検索語内の文字はすべて JIS X 0208 の文字 (全角文字) に変換されてから 登録されますので、どの文字も一律 2 バイト消費することになります。 したがって、最長で 127 文字ということになります。
  • 逆に、検索語は最低でも 1 バイト (1 文字) ないといけません。
    空の文字列は登録できないので注意して下さい。
  • 検索語に「 」「’」「−」「・」「‐」という文字が入っていると、 それらは削除した上で登録されます。
    これらの文字だけからなる語は空文字列になってしまいますので、登録 できません。
  • 検索語内の英小文字は、大文字に変換してから登録されます。
    また、検索ソフトウェアが検索する際は大文字と小文字は区別しません。 したがって、変換スクリプトでは小文字大文字の区別を意識する必要は ありません。
  • 検索語内にカタカナが含まれていた場合、ひらがなに変換した検索語も一緒に 登録されます。
    したがって、カタカナを含んだ語はひらがなでも引けるようになります。 ただし、反対にひらがなをカタカナに変換した検索語は登録されません。
  • 同じ検索語は何度でも登録できます。
    逆に間違って重複して登録してしまうと、検索したときに同じエントリが 何個も見つかることになってしまいます。 気をつけましょう。

本文に関する注意点

本文の各エントリの冒頭では、以下のように add_keyword_start()add_keyword_end() で囲い、囲った部分が検索キーであると いう印を付けるようにすることは既に記しました。

   ## 読み込んだ見出しを「本文部」に書き込む。
   if (!$fpwtext->add_keyword_start()
      || !$fpwtext->add_text($_)
      || !$fpwtext->add_keyword_end()
      || !$fpwtext->add_newline()) {
      die $fpwtext->error_message() . "\n";
   }

EPWING の検索ソフトウェアによっては、この検索キーのを本文の切れ目を 意味する印として扱っているものもあります。 こうした検索ソフトウェアでは、2 度目の検索キー開始指定子が出現すると、 そこが次のエントリの開始位置であり、今のエントリが終了したのだと判断 して、そこで本文の表示、出力を止めるようになっています。 したがって、このような検索ソフトウェアで正しく書籍の本文が表示、出力 されるように考慮して、検索キーの指定をエントリの冒頭で入れることが推奨 されます。 さもないと、次のエントリ、次の次のエントリ、とどこまでも本文を表示、 出力してしまいます。

逆に、必要があればエントリの途中で検索キーを置いても構いませんが、 むやみに置いてしまうと、エントリの本文の出力がそこで途切れてしまうこと になります。 検索キーの配置は慎重に行って下さい。

パッケージ化

ここまでの説明で honmon ファイルは生成できるように なりましたが、これだけでは JIS X 4081 形式の書籍として完全なものでは ありません。 この章では、JIS X 4081 形式の書籍としてパッケージ化する方法などに ついて説明します。

catalogs

JIS X 4081 形式の書籍では、これまでに生成した honmon ファイルの他に、catalogs というファイルが必ず必要です。 FreePWING には catalogs ファイルを生成する仕掛けが用意 として、EPWUTIL というソフトウェアに付属している catdump コマンドと互換の Perl スクリプトが用意されています。

catdump を使って catalogs ファイルを生成する には、まず次のような catalogs.txt ファイルを用意します。

[Catalog]
FileName   = catalogs
Type       = EPWING1
Books      = 1

[Book]
Title      = "国語辞典"
BookType   = 6001
Directory  = "KOKUGO"

用意ができたら、実際に catalogs ファイルを生成します。 catdump を直接起動する代わりに、次のようにします。

% fpwmake catalogs

catalogs.txt ファイルの書式の詳細については、 EPWUTIL 付属の catdump のマニュアル をご覧ください。

なお、/usr/local/share/freepwing/catalogs ディレクトリに catdump 用の catalogs.txt のサンプルファイルと、 catdump で生成した catalogs ファイルがインストールされます (ただし、FreePWING を /usr/local 以下にインストールして datadir を変更していない場合)。 こちらを参考にすると良いでしょう。

パッケージ化のための Makefile の改良

用意した Makefile にいくつかの変数を追加することで、 パッケージ化を容易にすることができます。 以下に記述例を記します。

PACKAGE = kokugo-fpw1.0
PACKAGEEXTRA = README.pkg=README TODO VERSION
PACKAGEDEPS  = VERSION
ARCHIVEEXTRA = README.pkg TODO
CLEANEXTRA   = VERSION
DIR = kokugo

VERSION:
      rm -f $@
      date +'version %Y-%m-%d' > VERSION

各パラメタの意味は、次の通りです。

PACKAGE
このパッケージの名前です。 変換プログラム一式を、tar+gzip および zip 形式でアーカイブする際の トップディレクトリおよびファイル名の接頭辞に使われます。 上記の例ではトップディレクトリは kokugo-fpw1.0、ファイル 名は kokugo-fpw1.0-src.tar.gz になります。 また、JIS X 4081 形式に変換した書籍データ一式をパッケージ化して tar+gzip 形式や zip 形式でアーカイブする際のファイル名にも使われます。 上記の例では kokugo-fpw1.0.tar.gzkokugo-fpw1.0.zip になります。
PACKAGEEXTRA
JIS X 4081 形式に変換した書籍データ一式 (catalogshonmon および外字ファイル) を収めたアーカイブを作る際に、 書籍データ以外に一緒に入れるファイルを書き並べます。 `ファイル名=ファイル名' という形で指定した場合は、左辺のファイルを右辺 のファイル名に改名してパッケージに入れることを意味します。
PACKAGEDEPS
変換プログラム一式のアーカイブを作成する際に、ここに書かれたターゲット が前もって実行されます。 PACKAGEEXTRA で指定したファイルの中に、最初から用意されて いるファイルではなく、何らかの処理をして生成しなくてはならないファイル があった場合は、この PACKAGEDEPS に書き、生成方法を Makefile の中に記しておくと良いでしょう。
ARCHIVEEXTRA
変換プログラム一式のアーカイブを作る際に、READMEMakefile、catdump 用の catalogs.txt 以外に 一緒に入れるファイルを書き並べます。 `ファイル名=ファイル名' という形で指定した場合は、左辺のファイルを右辺 のファイル名に改名してパッケージに入れることを意味します。
DIR
honmon および外字ファイルを収めるサブディレクトリの名前 です。 catalogs.txt の中で Directory パラメタに 書いた値を小文字化したものを指定する必要があります。 また、この DIR の値は、変換した書籍データ一式を パッケージ化する際のトップディレクトリにも使われます。

インストール

前節で説明した改良を Makefile に施したら、fpwmake を実行 してみます。 まず、JIS X 4081 形式に変換した書籍データ一式をインストールしてみます。 これには、install ターゲットを使います。

% fpwmake install

FreePWING を /usr/local 以下にインストールし、 datadir の位置を変更していなければ、 /usr/local/share/dict にインストールされます。 前節の例を使った場合、ディレクトリ以下は次のようになります。

kokugo/README
kokugo/TODO
kokugo/catalogs
kokugo/kokugo/data/honmon

別の場所にインストールしたい場合は、INSTALLDIR で指定 します。

% fpwmake install installdir=/some/where

変換した書籍データのアーカイブ

次に、JIS X 4081 形式に変換した書籍データ一式をパッケージ化して tar+gzip 形式および zip 形式でアーカイブしてみます。 (インストールを実行しなくても、アーカイブの作成は可能です。) これには、package ターゲットを使います。

% fpwmake package

先にも記しましたが、今回の例では、できあがるファイル名は kokugo-fpw1.0.tar.gzkokugo-fpw1.0.zip に なります。 これらのファイルに収められるファイルは、次の通りです。 基本的に、インストールのときの構成と同じです。ただし、zip 形式では ファイル名およびディレクトリ名は大文字になります。

kokugo/README
kokugo/TODO
kokugo/catalogs
kokugo/kokugo/data/honmon

変換スクリプトのアーカイブ

最後に、変換プログラム一式をパッケージ化して tar+gzip 形式でアーカイブ してみます。 (honmon を作成していなくても、アーカイブの作成は可能です。) これには、archive ターゲットを使います。

% fpwmake archive

今回の例では、できあがるファイル名は kokugo-fpw1.0-src.tar.gz になります。 これらのファイルに収められるファイルは、次の通りです。

kokugo-fpw1.0/README
kokugo-fpw1.0/catalogs.txt
kokugo-fpw1.0/Makefile
kokugo-fpw1.0/README.pkg
kokugo-fpw1.0/TODO

応用機能

前章で JIS X 4081 形式のファイル生成における FreePWING の基本的な 使用方法を一通り紹介しましたので、これ以降の章では、応用的な機能について 説明します。

修飾指定子

本文および見出しには、文字に強調を施したり、ある区間内で折り返しを禁止 したりといった修飾の指定を挿入することができます。 ただし、これらの指示が JIS X 4081 検索ソフトウェア上でどのように表示 されるかは、それぞれのソフトウェアによって異なります。

FreePWING で扱える修飾には、次のような種類があります。

下添え字開始指定と終了指定
開始から終了までの間の区間の文字列を下添え字表示にします。
上添え字開始指定と終了指定
開始から終了までの間の区間の文字列を上添え字表示にします。
分割禁止開始指定と終了指定
開始から終了までの間の区間の文字列を折り返し禁止にします。
強調開始指定と終了指定
開始から終了までの間の区間の文字列を強調表示にします。
別フォント開始指定と終了指定
開始から終了までの間の区間の文字列を別のフォントで表示します。

開始指定と終了指定は入れ子にすることで、複数の修飾を同時に行うことも 可能です。 たとえば、分割禁止と強調の両方の修飾を行いたい場合は、

[分割禁止開始] ... [強調開始] ... [強調終了] ... [分割禁止終了]

という順序で指定子を挿入します。 強調開始と強調終了の間は、分割禁止と強調と両方が有効になります。 修飾の指定子は入れ子になっていれば良いので、次のように強調を外側、 分割禁止を内側にしても構いません。

[強調開始] ... [分割禁止開始] ... [分割禁止終了] ... [強調終了]

しかし、次のような用法は入れ子になっていないので、誤りです。

[分割禁止開始] ... [強調開始] ... [分割禁止終了] ... [強調終了]

開始指定子を指定したら、それと対になる終了指定子を必ずエントリの末尾 までに呼ばなくてはなりません。 エントリ終端時点で終了指定子が呼ばれていない修飾があると、エラーに なります。

また、入れ子の中で外側と同じ修飾を再度かけることはできません。 これも行おうとするとエラーになります。

相互参照

よく辞書では、本文中に別の箇所への参照情報を入れていることがあります。 JIS X 4081 形式のデータでは紙の辞書と違って、参照先の位置情報を 入れますので、(ちょうど HTML のリンクのように) 参照先に飛んでそこの 本文を表示することも可能です。

FreePWING でこのような参照を行うには、次の操作が必要になります。

  • 参照先にタグを割り当てる。
  • 参照元に、割り当てたタグへの参照情報を挿入する。

タグ (tag) というのは、本文の特定の位置に対して名前を付けるものです。 たとえば、「エンジン」という語のエントリの開始位置に engine という名前 のタグを割り当てることができます。 タグの名前は必ず本文内で一意でなくてはなりません。 タグに使える文字は、アルファベット (A..Z, a..z)、数字 (0..9)、下線 (_)、およびハイフン (-) です。

FreePWING で、エントリの先頭に対してタグを割り当てるには、 FreePWING::FPWUtils::Text クラスのオブジェクトに対して add_entry_tag() を呼び出します。

$fpwtext->add_entry_tag("engine");

タグを割り当てたら、そのタグの参照元では参照情報を埋め込みます。 参照情報は語句に対して付加するので、開始指定と終了指定があります。 たとえば、先ほど割り当てた engine という名前のタグへの参照を

(参考: →「エンジン」も参照のこと)

という表現で行い、このうち『→「エンジン」』の部分だけに参照情報を 入れる場合は、次のような処理を行うことになります。

$fpwtext->add_text("(参考: ");
$fpwtext->add_reference_start();
$fpwtext->add_text("→「エンジン」");
$fpwtext->add_reference_end("engine");
$fpwtext->add_text("も参照のこと)");

add_reference_start() が参照の開始指定、 add_reference_end() が終了指定になります。 終了指定時に参照先のタグを一緒に指定します。 (正確に言えば、参照情報は 修飾指定子 の一種になりますので、修飾指定子に関する規則がそのまますべて 当てはまります。)

なお、参照情報を入れる時点でまだ定義されていないタグ名を指定することも 可能です。 (そうでないと、本文の後方への参照が行えないからです。) ただし、本文が終了したのにもかかわらずそのタグが未定義だった場合は、 エラーが発生します。

複数の本文

紙の辞書で言うところの「本文」を複数個をまとめて JIS X 4081 の一個の honmon ファイルの中に入れてしまうことができます。 たとえば、EPWING の辞書には英和辞典と和英辞典を本文を一つにまとめて いるものがあります。 もちろん、英和辞典、和英辞典に対して一つずつ honmon を 用意しても良いのですが、一緒にしておくと辞書を切り替えずに英和、和英の 両方が検索できるという利点があります。

FreePWING でも、複数個の本文を入れるための仕掛けが用意されています。 FreePWING では FreePWING::FPWUtils::Text クラスの オブジェクトを介して本文データを書き込みますが、 FreePWING::FPWUtils::Text クラスの new_context() メソッドを使うと、そこで新しい「本文」に切り替わります。 (FreePWING では、本文一個を「コンテキスト (context)」と 呼んでいます。)

$fpwtext->new_context();

英和辞典と和英辞典を一体化させるなら、まず英和辞典の本文データを一通り 書き込み、new_context() で「本文」を切り替えた後に 和英辞典の本文データを書き込む、という手順になります。

なお、相互参照 用のタグは、本文を 切り替えても共有されますので、タグ名は必ず honmon 全体で 一意でなくてはなりません。 逆にこのことは、複数の本文の間で相互参照が可能であることを意味します。

メニュー

JIS X 4081 形式のファイル honmon には、本文以外にも、 メニューという特殊な文章データを組み込むことができます。

メニューは主に、辞書の付録、序文、使い方をいった部分を収録するときに 用います。 通常、メニューは以下のような階層構造にします。

* 序文
* この辞書の使い方
  - 検索方法
  - 表記について
  - 発音について
* 付録
  - 不規則変化動詞一覧表

この辞書のトップメニューは次のようになります。 検索ソフトウェアはこのメニューを表示する際に、メニューの各項目、つまり 「序文」や「この辞書の使い方」「付録」にそれぞれ参照先があることが ユーザに分かるように表示するでしょう。

* 序文
* この辞書の使い方
* 付録

ユーザが「序文」を選べば序文の内容が表示され、「この辞書の使い方」を 選べば「検索方法」「表記について」「発音について」といった項目が並んだ サブメニューが表示されます。

FreePWING でこのようなメニューを扱うには、次のように FreePWING::FPWUtils::Menu クラスのオブジェクトを用意する 必要があります。

## インスタンスを生成する。
$fpmenu = FreePWING::FPWUtils::Menu->new();

## 書き込み用の作業ファイルを開く。
$fpmenu->open() || die $fpwmenu->error_message() . "\n";

initialize_fpwparser() を使う場合は、次のように 'menu' という項目を足します。

initialize_fpwparser('text'    => \$fpwtext,
                     'heading' => \$fpwheading,
                     'word2'   => \$fpwword2,
                     'menu'    => \$fpwmenu);    # ←追加

finalize_fpwparser() の呼び出しでも同様の操作を行います。

FreePWING::FPWUtils::Menu クラスは、本文書き込み用の クラスである FreePWING::FPWUtils::Text とまったく同じ メソッド群を持ちます。 異なるのは、どの中間ファイルに書き出すかという点だけです。 つまり、FreePWING::FPWUtils::Text クラスで用意されて いるのと同名の書き込み用のメソッドを呼び出すことで、メニューに書き込み を行うことができます。

メニューの中の、トップメニュー、サブメニューおよび「序文」等の文章は それぞれ、独立した コンテキスト にします。 したがって、メニューでは参照情報の付加、タグの設定、コンテキストの 切り替えといった操作を多用することになります。 なお、メニューから本文への参照やその逆の参照を行うことも可能です。 ただし、タグ名はメニューと本文とで共有されますので、衝突しないように して下さい。

著作権表示

JIS X 4081 形式のファイル honmon には、 メニュー の他にもう一つ、著作権表示という特殊な文章データがあります。 これは、その名の通り書籍の著作権表示を文章化したものです。

FreePWING で著作権表示を扱うには、 FreePWING::FPWUtils::Copyright クラスのオブジェクトを 用意する必要があります。

## インスタンスを生成する。
$fpwcopyright = FreePWING::FPWUtils::Copyright->new();

## 書き込み用の作業ファイルを開く。
$fpwcopyright->open() || die $fpwcopyright->error_message() . "\n";

initialize_fpwparser() を使う場合は、次のように 'copyright' という項目を足します。

initialize_fpwparser('text'      => \$fpwtext,
                     'heading'   => \$fpwheading,
                     'word2'     => \$fpwword2,
                     'menu'      => \$fpwmenu,
                     'copyright' => \$fpwcopyright);    # ←追加

finalize_fpwparser() の呼び出しでも同様の操作を行います。

メニューもそうでしたが、著作権表示のクラスである FreePWING::FPWUtils::Copyright クラスもまた、 本文書き込み用のクラスである FreePWING::FPWUtils::Text と完全に同じメソッド群を持ちます。 異なるのは、どの中間ファイルに書き出すかという点だけです。 FreePWING::FPWUtils::Text クラスで用意されているのと同名 の書き込み用のメソッドを呼び出すことで、著作権表示に書き込みを行う ことができます。

条件検索

条件検索を扱うには、 FreePWING::FPWUtils::KeyWord クラスのオブジェクトを用意 する必要があります。

## インスタンスを生成する。
$fpwkeyword = FreePWING::FPWUtils::KeyWord->new();

## 書き込み用の作業ファイルを開く。
$fpwkeyword->open() || die $fpwkeyword->error_message() . "\n";

initialize_fpwparser() を使う場合は、次のように 'keyword' という項目を足します。

initialize_fpwparser('text'      => \$fpwtext,
                     'heading'   => \$fpwheading,
                     'word2'     => \$fpwword2,
                     'keyword'   => \$fpwkeyword);    # ←追加

finalize_fpwparser() の呼び出しでも同様の操作を行います。

使い方は FreePWING::FPWUtils::Word2 クラスのオブジェクト とまったくと同じで、エントリの追加は add_entry メソッドを 用います。

   ## かなの検索語を登録する。
   if (!$fpwkeyword->add_entry($kanaword, $heading_position,
       $text_position)) {
      die $fpwkeyword->error_message() . "\n";
   }

外字

FreePWING では、辞書に固有の字を外字として定義して利用することも できます。 ただし、外字を利用するには、外字定義ファイルと、各文字の ビットマップデータ (フォントデータ) を用意する必要があります。 以下、この章では外字を使用する方法を詳しく見ていきます。

外字の基礎知識

外字を定義する際は、各字のビットマップデータを用意しなくてはなりません。 ビットマップデータは、小さな長方形の点を縦横に何個も敷き詰めたもので 構成されます。 また、マップ自体はモノクロのデータで、色情報は持ちません。 ちょうど、XBM (X BitMap) 形式の画像データと同じです。

次は音楽のト音記号の外字ビットマップデータの例です。 (■が前景色の点、□が背景色の点です。)

□□□□□■■■
□□□□■□■□
□□□■□■□□
□□□■□■□□
□□□■■□□□
□□■□■□□□
□□■□■■■□
□■□■□■□■
□■□■□■□■
□■□□□■□■
□□■□□■■□
□□□■■■□□
□□□□■□□□
■■□□■□□□
■■□■□□□□
□■■□□□□□

JIS X 4081 では、「全角」「半角」という 2 種類の外字を定義しています。 全角外字はビットマップの縦と横の点の数がほぼ同じ外字で、それに対して 半角外字では横方向の点の数が縦の半分になります。 上のト音記号は、半角外字 (横 8、縦 16) です。

半角外字と全角外字はまったく独立しています。 辞書は、全角あるいは半角のどちらか一方の外字だけ定義することも できますし、両方とも定義することも可能です。 両方定義する場合でも、ある字を半角、全角の一方にだけ登録することも 可能です。

ビットマップデータは、全角、半角それぞれの外字に対して、以下のように 4 つずつサイズの違うものを用意することが可能です。

外字の種類 \ 高さ 高さ 16 高さ 24 高さ 30 高さ 48
半角外字 (横×縦) 8×16 16×24 16×30 24×48
全角外字 (横×縦) 16×16 24×24 32×30 48×48

このうち、縦方向の点が 16 個のビットマップ (半角の 8x16, 全角の 16x16) は必須です。 他のサイズは、大きなサイズのビットマップから順に省略することができます。 これはたとえば、縦の点の数が 48 と 30 の外字を省略して 16 と 24 だけ 定義することは可能ですが、48 と 24 を省略して 16 と 30 だけ定義する ことはできない、ということです。

また、ビットマップは、それぞれの外字について利用可能なすべてのサイズの 分を用意しなければなりません。 たとえば、あなたが 16, 24, のサイズのビットマップを用意すると決めたら、 定義した外字すべてに対して、必ず 16 と 24 のサイズのビットマップを それぞれ用意しなければなりません。 ある外字は 16 と 24 のサイズのビットマップを用意するけれども、別の外字 には 16 だけしか用意しないということはできません。

ビットマップデータの用意

FreePWING では、外字のビットマップデータには XBM 形式のファイルを 用います。 登録したい外字一字毎、サイズ毎に一つの XBM ファイルを用意します。 XBM ファイルは、UNIX の X の環境であれば bitmap コマンド等で作成 できます。 ビットマップエディタが XBM 形式を扱えるものでなければ、描画した後で 画像形式の変換ツールを使って XBM に変換して下さい。

外字定義ファイルの用意

ビットマップが用意できたら、次に外字定義ファイルを作成します。 半角外字、全角外字を両方とも定義する場合は、定義ファイルも 2 つに 分けて用意します。

外字定義ファイルには、次のような形式で 1 行に 1 つの外字を定義します。

外字名  XBMファイル名  XBMファイル名  XBMファイル名  XBMファイル名

以下は記述例です。

g-clef    g-clef16.xbm  g-clef24.xbm  g-clef30.xbm  g-clef48.xbm
f-clef    f-clef16.xbm  f-clef24.xbm  f-clef30.xbm  f-clef48.xbm

各パラメタは 1 個以上の空白かタブで区切ります。

「外字名」とは、その外字を利用するときに参照する名前です。 全外字で一意であれば、好きな名前を付けることができます。 ただし、外字名には空白やタブ、改行文字は使用することができません 外字名は半角と全角で独立していますので、同じ名前のものを定義しても、 衝突することはありません。 半角外字内、全角外字内で複数回同じ外字名を定義すると、エラーになります。

「XBMファイル名」は、外字のビットマップファイル名です。 左から順に高さが 16, 24, 30, 48 のものを並べます。 一部のサイズのビットマップを用意しない場合は、そのパラメタは指定 しないで下さい。 ですから、実際は XBM ファイル名は 1 〜 4個の範囲で指定されることに なります。 ただし、指定するファイル名の個数は、ファイル内で一定でなければ なりません。 途中で変化するとエラーになります。

なお、ファイル名はカレントディレクトリからの相対パス指定になります。 次のように、ディレクトリの区切りを入れることも可能です。

g-clef        bitmap/g-clef16.xbm  bitmap/g-clef24.xbm
f-clef        bitmap/f-clef16.xbm  bitmap/f-clef24.xbm

指定した XBM の画像サイズは、その外字のサイズと同一のものでなくては なりません。 異なったサイズだと、エラーが発生します。

外字データの生成

前節までに書かれたことの準備ができたら、実際に外字データを生成します。 半角外字用には fpwhalfchar コマンド、全角外字用には fpwfullchar コマンドを実行します。 両方定義しているときは、両方実行します。 順番はどちらが先でも構いません。

たとえば、半角外字の外字定義ファイル名が halfchar.txt、 全角外字の外字定義ファイル名が fullchar.txt だとすると、 次のようなコマンド行を入力して下さい。

% perl /usr/local/share/FreePWING/fpwutils/fpwhalfchar halfchar.txt
% perl /usr/local/share/FreePWING/fpwutils/fpwfullchar fullchar.txt

(ここでは FreePWING を /usr/local 以下にインストールし、 libexecdir の位置を変更していないものとします。 他の場所にインストールしているときは、適宜読み替えて下さい。)

正常に終了すれば、次のビットマップデータファイルができ上がります。 ただし、用意しなかったサイズの分は作成されません。

外字の種類 \ 高さ 高さ 16 高さ 24 高さ 30 高さ 48
半角外字 gai16h gai24h gai30h gai48h
全角外字 gai16f gai24f gai30f gai48f

これらのファイルは honmon と同じく、最終的に 辞書データパッケージの一部として使われます。 それ以外に中間ファイルも生成されますが、これらは本文の中で外字を 参照するときに使用されます。

fpwmake による外字データの生成

fpwhalfchar, fpwfullchar を直接実行する代わりに fpwmake を使って外字 データを生成することもできます。 通常は、こちらのほうが楽で良いでしょう。

前節と同様に、半角外字の外字定義ファイル名が halfchar.txt、 全角外字の外字定義ファイル名が fullchar.txt だと仮定する と、Makefile に以下の記述を追加します。

HALFCHARS = halfchar.txt
FULLCHARS = fullchar.txt

半角外字、全角外字の一方だけを生成する場合は、HALFCHARSFULLCHARS の一方だけを定義して下さい。 なお、複数個のファイルを指定することも可能です。

変換した書籍データのアーカイブ を作る際 に、HALFCHARSFULLCHARS で指定した 外字定義ファイルは自動的にアーカイブに収録されますが、ファイル中に指定 されている XBM ファイルは、収録されません。 XBM ファイルをアーカイブに収録するには、ARCHIVEEXTRA で 明示的に指定する必要があります。

ARCHIVEEXTRA = g-clef16.xbm g-clef24.xbm g-clef30.xbm g-clef48.xbm \
    f-clef16.xbm  f-clef24.xbm  f-clef30.xbm  f-clef48.xbm

XBM ファイルの数が多いときは、外字ファイルをサブディレクトリに置き、 ARCHIVEEXTRA にはそのディレクトリ名を指定すると 良いでしょう。

ARCHIVEEXTRA = gaiji

本文への外字の書き込み

外字を本文中で使用するには、あらかじめ fpwhalfcharfpwfullchar コマンドを実行して、定義された外字の 参照ファイルを用意しておかなければなりません。 つまり、fpwhalfcharfpwfullchar は 変換プログラムよりも前に実行する必要があります。 (fpwmake を使用するのであれば、自動的に正しい順番で実行されますので、 実行順序を気にする必要はないでしょう。)

半角外字を本文中に書き込むには、本文書き込み用のクラス FreePWING::FPWUtils::Text のオブジェクトに対して add_half_user_character() を呼び出します。

if (!$fpwtext-$gt;add_half_user_character('g-clef')) {
    die $fpwtext->error_message() . "\n";
}

この例では、"g-clef" という名前の半角外字を書き込んでいます。 この外字名は、半角外字の外字定義ファイルに登録されているもので なければなりません。 未登録の外字を使用すると、エラーになります。

全角外字については、代わりに add_full_user_character() メソッドを呼び出す点が異なる だけで、呼び出し方などはすべて同じです。

カラー図版

FreePWING では、BMP および JPEG 形式の画像をカラー図版として収録する ことができます。 (モノクロ図版用の画像形式が別途存在しますので、ここでは便宜上 BMP および JPEG 形式の画像のことを「カラー図版」と呼ぶことにします。 モノクロの BMP 画像であっても、区分上はカラー図版になります。)

なお、FreePWING はモノクロ図版には対応していません。 カラー図版のデータは、honmon ファイルの中に格納されます。

カラー図版定義ファイルの用意

カラー図版を利用するには、カラー図版定義ファイルを用意する必要が あります。 カラー図版定義ファイルでは、1 行に 1 つのカラー図版を定義することが できます。 行の記述形式は、次の通りです。

図版名  画像ファイル名

以下は記述例です。

palmyra       palmyra.bmp
persepolis    persepolis.bmp
petra         petra.jpg

カラー図版名に使える文字はタグ名と同じく、アルファベット (A..Z, a..z)、 数字 (0..9)、下線 (_)、およびハイフン (-) です。

カラー図版定義ファイルを用意したら、このファイルを MakefileCGRAPHS 変数に指定します。 たとえば、ファイル名を cgraphs.txt としたとすると、次の ように記述します。

CGRAPHS = cgraphs.txt

この例では一つしかファイルを指定していませんが、複数指定することも可能 です。

CGRAPHS 変数に指定したファイルは、 変換スクリプトのアーカイブ を作る際に自動的にアーカイブに収録されますが、ファイル中に 記されている画像ファイルは収録されないので注意して下さい。 画像ファイルを収録するには、MakefileARCHIVEEXTRA 変数で指定する必要があります。

ARCHIVEEXTRA = palmyra.bmp persepolis.bmp petra.jpg

ファイルの数が多いときは、画像ファイルをサブディレクトリに置き、 ARCHIVEEXTRA にはそのディレクトリ名を指定すると良い でしょう。

ARCHIVEEXTRA = images

本文からカラー図版の参照

BMP 形式のカラー図版を本文中から参照するには、本文書き込み用のクラス FreePWING::FPWUtils::Text のオブジェクトに対して、 add_color_graphic_start() メソッドと add_color_graphic_end() メソッドを呼び出します。 これらのメソッドは 修飾指定子 の 一種ですので、修飾指定子に関する規則がすべて適用されます。

$fpwtext->add_color_graphic_start("prtruska");
$fpwtext->add_text("→図版");    # キャプション
$fpwtext->add_color_graphic_end();

add_color_graphic_start() を呼び出す際に、参照したい カラー図版名を指定します。 カラー図版の参照は、相互参照 とよく 似ています。 ただし、相互参照では _end メソッドで参照先の情報を 書き込むのに対して、 カラー図版の参照では _start メソッドで書き込むという違い がある点に注意して下さい。

JPEG 形式のカラー図版を本文中から参照する場合、BMP とはメソッドが 異なり、add_jpeg_graphic_start() メソッドと add_jpeg_graphic_end() メソッドを使います。 使い方は、BMP 用のメソッドと変わりません。

$fpwtext->add_jpeg_graphic_start("persepolis");
$fpwtext->add_text("→図版");    # キャプション
$fpwtext->add_jpeg_graphic_end();

音声データ

FreePWING では、WAVE (PCM) 形式の音声データを収録することができます。 音声データの収録は、カラー図版 の要領とほぼ同じです。

音声データ定義ファイルの用意

音声データを収録するには、音声データ定義ファイルを用意する必要があります。 音声データ定義ファイルでは、1 行に 1 つの音声データを定義することが できます。 行の記述形式は、次の通りです。

音声データ名  WAVEファイル名

以下は記述例です。

swift       swift.wav
macaw       macaw.wav
crane       crane.wav

音声データ名に使える文字はタグ名と同じく、アルファベット (A..Z, a..z)、 数字 (0..9)、下線 (_)、およびハイフン (-) です。

WAVEファイルを用意したら、このファイルを MakefileSOUNDS 変数に指定します。 たとえば、ファイル名を sounds.txt としたとすると、次の ように記述します。

SOUNDS = sounds.txt

この例では一つしかファイルを指定していませんが、複数指定することも可能 です。

SOUNDS 変数に指定したファイルは、 変換スクリプトのアーカイブ を作る際に自動的にアーカイブに収録されますが、ファイル中に 記されている WAVE ファイルは収録されないので注意して下さい。 WAVE ファイルを収録するには、MakefileARCHIVEEXTRA 変数で指定する必要があります。

ARCHIVEEXTRA = swift.wav macaw.wav crane.wav

ファイルの数が多いときは、WAVE ファイルをサブディレクトリに置き、 ARCHIVEEXTRA にはそのディレクトリ名を指定すると良い でしょう。

ARCHIVEEXTRA = sounds

本文から音声データの参照

音声データを本文中から参照するには、本文書き込み用のクラス FreePWING::FPWUtils::Text のオブジェクトに対して、 add_sound_start() メソッドと add_sound_end() メソッドを呼び出します。 これらのメソッドは 修飾指定子 の 一種ですので、修飾指定子に関する規則がすべて適用されます。

$fpwtext->add_sound_start("macaw");
$fpwtext->add_text("→鳴き声");    # キャプション
$fpwtext->add_sound_end();

add_sound_start() を呼び出す際に、参照したい音声データ 名を指定します。

リファレンスマニュアル

FreePWING::FPWUtils::Word2 クラス

FreePWING::FPWUtils::Word2 は、前方一致および後方一致検索 用の検索語一覧を同時に生成するためのクラスです。 以下のメソッドを持っています。

new()
FreePWING::FPWUtils::Word2 クラスのオブジェクトを生成して、 そのリファレンスを返すクラスメソッドです。
open()
書き込み用に検索語ファイルを開きます。 ファイル名は、あらかじめモジュール内で指定されたものが使用されます。 成功すれば 1 を、失敗すれば 0 を返します。
close()
開いていた検索語ファイルを閉じます。 開いていなければ何もしません。 このメソッドは常に 1 を返します。
add_entry($word, $heading_position, $text_position)
検索語ファイルに検索語を一つ追加します。 $word が追加する検索語、 $heading_position が見出しの位置、 $text_position が本文の位置です。 見出しと本文の位置は、FreePWING::FPWUtils::Heading および FreePWING::FPWUtils::Text クラスのオブジェクトが持っている entry_position() メソッドを使って取得します。 このメソッドは成功すれば 1 を、失敗すれば 0 を返します。 追加する検索語の最大長は 255 バイトです。
file_name()
検索語ファイルを開いたときに指定したファイル名を返します。
entry_count()
現在までに書き込んだエントリ数を返します。
error_message()
このクラスのメソッドを呼び出して、処理結果が失敗に終わった場合 (0 を 返してきた場合)、エラーメッセージを返します。 エラーが発生していなければ、空の文字列が返ります。

FreePWING::FPWUtils::KeyWord クラス

FreePWING::FPWUtils::KeyWord は、条件検索用の検索語一覧を 同時に生成するためのクラスです。 このクラスのオブジェクトが有するメソッドは、 FreePWING::FPWUtils::Word2クラス とまったく同じですので、そちらを参照して下さい。

FreePWING::FPWUtils::Text クラス

FreePWING::FPWUtils::Text は、本文を生成するためのクラス です。 以下のメソッドを持っています。

new()
FreePWING::FPWUtils::Text クラスのオブジェクトを生成して、 そのリファレンスを返すクラスメソッドです。 通常は直接このメソッドを呼び出さずに、fpwutils が提供する initialize_fpwparser() サブルーチンを用います。
open()
書き込み用に本文ファイルを開きます。 ファイル名は、あらかじめモジュール内で指定されたものが使用されます。 成功すれば 1 を、失敗すれば 0 を返します。 通常は直接このメソッドを呼び出さずに、fpwutils が提供する initialize_fpwparser() サブルーチンを用います。
close()
open() メソッドで開いたファイルをすべて閉じます。 成功すれば 1 を、失敗すれば 0 を返します。 開いていなければ何もせず、1 を返します。 通常は直接このメソッドを呼び出さずに、fpwutils が提供する finalize_fpwparser() サブルーチンを用います。
new_context()
現在のエントリおよびコンテキストを終端させ、新たなコンテキストを開始 します。 成功すれば 1 を、失敗すれば 0 を返します。 このメソッドを呼び出すには、あらかじめ本文ファイルを開いていなければ なりません。 本文ファイル開いた直後の一文字もデータを書き込んでいない状態で、この メソッドを呼んでも、新たなコンテキストを開始することはしません。 これにより、最初のコンテキストに対しては、明示的にこのメソッドを 呼んでも呼ばなくてもどちらでも良いようになっています。
new_entry()
現在のエントリを終端させ、新たなエントリを開始します。 成功すれば 1 を、失敗すれば 0 を返します。 このメソッドを呼び出すには、あらかじめ本文ファイルを開いていなければ なりません。 ファイル開いた直後および new_context() で新たな コンテキストを開始した直後の一文字もデータを書き込んでいない状態で、 このメソッドを呼んでも、さらに新たなエントリを開始することはしません。 これにより、先頭のエントリに対しては、明示的にこのメソッドを呼んでも 呼ばなくてもどちらでも良いようになっています。
add_text($text)
引数 $text で指定した文字列を本文に追加します。 文字列は、EUC-JP で書かれていなくてはなりません。 ただし、$text 中に出現する改行文字 (CR および LF) は無視 されます。 このメソッドを呼び出すには、あらかじめ本文ファイルを開いていなければ なりません。 成功すれば 1 を、失敗すれば 0 を返します。
add_half_user_character($character_name)
add_full_user_character($character_name)
add_half_user_character() は引数 $character_name で指定した半角外字を本文に追加します。 同様に add_full_user_character() は、全角外字を追加します。 $character_name は、外字定義ファイルの中で定義されている 外字名でなければなりません。 成功すれば 1 を、失敗すれば 0 を返します。
add_entry_tag($tag)
add_entry_tag($tag) は本文の現在のエントリの先頭位置に 対して、それぞれ $tag という名前のタグを設定します。 これらのメソッドを呼び出すには、あらかじめ本文ファイルと 参照情報ファイル、タグファイルを開いていなければなりません。 タグ名は本文、メニュー、著作権表示データ内で一意のものでなくては なりません。 このメソッドは成功すれば 1 を、失敗すれば 0 を返します。
add_keyword_start()
add_keyword_end()
add_keyword_start() は検索キー開始指定子を、 add_keyword_end() は検索キー終了指定子を、それぞれ 呼ばれた時点での本文の現在位置に挿入します。 メソッドを呼び出すには、あらかじめ本文ファイルを開いていなければ なりません。 いずれのメソッドも成功すれば 1 を、失敗すれば 0 を返します。 使用方法に関しては、 読み込んだ見出しの処理本文に関する注意点修飾指定子 の節もあわせてご覧下さい。
add_reference_start()
add_reference_end($position)
add_reference_start() は参照開始指定子を、 add_reference_end() は参照終了指定子を、それぞれ呼ばれた 時点での本文の現在位置に挿入します。 参照先の位置は $position で指定します。 メソッドを呼び出すには、あらかじめ本文ファイルを開いていなければ なりません。 成功すれば 1 を、失敗すれば 0 を返します。 使用方法に関しては、 相互参照 の節もあわせてご覧下さい。
add_subscript_start()
add_subscript_end()
add_subscript_start() は下添え字開始指定子を、 add_subscript_end() は下添え字終了指定子を、それぞれ 呼ばれた時点での本文の現在位置に挿入します。 メソッドを呼び出すには、あらかじめ本文ファイルを開いていなければ なりません。 成功すれば 1 を、失敗すれば 0 を返します。 使用方法に関しては、 修飾指定子 の節もあわせてご覧下さい。
add_indent_level($level)
本文の行頭の字下げ量を $level に設定します。 指定できるのは、2 から 6 までの整数です。 また、各エントリ開始時に自動的に 1 に設定されます。 メソッドを呼び出すには、あらかじめ本文ファイルを開いていなければ なりません。 成功すれば 1 を、失敗すれば 0 を返します。
add_newline()
本文の現在位置に改行を挿入します。 メソッドを呼び出すには、あらかじめ本文ファイルを開いていなければなりま せん。 成功すれば 1 を、失敗すれば 0 を返します。
add_superscript_start()
add_superscript_end()
add_superscript_start() は上添え字開始指定子を、 add_superscript_end() は上添え字終了指定子を、それぞれ 呼ばれた時点での本文の現在位置に挿入します。 メソッドを呼び出すには、あらかじめ本文ファイルを開いていなければ なりません。 成功すれば 1 を、失敗すれば 0 を返します。 使用方法に関しては、 修飾指定子 の節もあわせてご覧下さい。
add_nowrap_start()
add_nowrap_end()
add_nowrap_start() は分割禁止開始指定子を、 add_nowrap_end() は分割禁止終了指定子を、それぞれ呼ばれた 時点での本文の現在位置に挿入します。 メソッドを呼び出すには、あらかじめ本文ファイルを開いていなければ なりません。 成功すれば 1 を、失敗すれば 0 を返します。 使用方法に関しては、 修飾指定子 の節もあわせてご覧下さい。
add_emphasis_start()
add_emphasis_end()
add_emphasis_start() は強調開始指定子を、 add_emphasis_end() は強調終了指定子を、それぞれ呼ばれた 時点での本文の現在位置に挿入します。 メソッドを呼び出すには、あらかじめ本文ファイルを開いていなければ なりません。 成功すれば 1 を、失敗すれば 0 を返します。 使用方法に関しては、 修飾指定子 の節もあわせてご覧下さい。
add_font_start($font_name)
add_font_end()
add_font_start() は別フォント開始指定子を、 add_font_end() は同終了指定子を、それぞれ呼ばれた時点での 本文の現在位置に挿入します。 引数の $font_name として有効な値は、'italic' (イタリック体を指定) および 'bold' (ボールド体を指定) の 2 種類です。 メソッドを呼び出すには、あらかじめ本文ファイルを開いていなければ なりません。 成功すれば 1 を、失敗すれば 0 を返します。 使用方法に関しては、 修飾指定子 の節もあわせてご覧下さい。
add_color_graphic_start($graphic_name)
add_color_graphic_end()
add_color_graphic_start() は BMP 形式の カラー図版参照開始指定子を、add_color_graphic_end() は参照終了指定子を、それぞれ呼ばれた時点での本文の現在位置に挿入 します。 参照先のカラー図版名は $graphic_name で指定します。 メソッドを呼び出すには、あらかじめ本文ファイルを開いていなければ なりません。 成功すれば 1 を、失敗すれば 0 を返します。 使用方法に関しては、 カラー図版 の節もあわせてご覧下さい。
add_jpeg_graphic_start($graphic_name)
add_jpeg_graphic_end()
add_jpeg_graphic_start() および add_jpeg_graphic_end() は、 add_color_graphic_start() および add_color_graphic_end() と基本的に同じですが、 カラー図版のデータ形式が BMP ではなく、JEPG となります。
add_sound_start($sound_name)
add_sound_end()
add_sound_start() は音声データ参照開始指定子を、 add_sound_end() は参照終了指定子を、それぞれ 呼ばれた時点での本文の現在位置に挿入します。 参照先の音声データ名は $sound_name で指定します。 メソッドを呼び出すには、あらかじめ本文ファイルを開いていなければ なりません。 成功すれば 1 を、失敗すれば 0 を返します。 使用方法に関しては、 音声データ の節もあわせてご覧下さい。
file_name()
現在開いている本文のファイル名を返します。 本文のファイルを開いていなければ、空の文字列を返します。
reference_file_name()
現在開いている参照情報ファイル名を返します。 参照情報ファイルを開いていなければ、空の文字列を返します。
tag_file_name()
現在開いているタグファイル名を返します。 タグファイルを開いていなければ、空の文字列を返します。
context_position()
現在のコンテキストの先頭位置を返します。 ただし、本文のファイルを開いていない場合は 0 を返します。
entry_position()
現在のエントリの先頭位置を返します。 ただし、本文のファイルを開いていない場合は 0 を返します。
context_count()
現在のコンテキストが、何番目のコンテキストなのかを返します。
entry_count()
現在のエントリが、現在のコンテキストの中で何番目のコンテキストなのかを 返します。
total_entry_count()
現在のエントリが、本文ファイル全体の中で何番目のコンテキストなのかを返 します。
error_message()
このクラスのメソッドを呼び出して、処理結果が失敗に終わった場合 (0 を返してきた場合)、エラーメッセージを返します。 エラーが発生していなければ、空の文字列が返ります。

FreePWING::FPWUtils::Heading クラス

FreePWING::FPWUtils::Heading は、見出しを生成するための クラスです。 FreePWING::FPWUtils::Text クラスとだいたい同じメソッドを 持っていますが、次のメソッドは使用できなくなっています。

  • new_context()
  • add_tag()
  • add_keyword_start()
  • add_keyword_end()
  • add_reference_start()
  • add_reference_end()
  • add_newline()
  • add_indent_level()

その他のメソッドの使用方法については、 FreePWING::FPWUtils::Text クラス を参照して下さい。

FreePWING::FPWUtils::Menu クラス

FreePWING::FPWUtils::Menu は、メニューを生成するための クラスです。 FreePWING::FPWUtils::Text とまったく同じメソッド群を 持っています。

FreePWING::FPWUtils::Copyright クラス

FreePWING::FPWUtils::Copyright は、著作権表示を生成する ためのクラスです。 FreePWING::FPWUtils::Text とまったく同じメソッド群を 持っています。

FreePWING::FPWUtils::FPWParser モジュール

他の FreePWING 付属の Perl モジュールとは異なり、 FreePWING::FPWUTils::FPWParser モジュールではクラスを定義 しません。 代わりに、main パッケージに対してサブルーチンや変数を定義 し、コマンド行のオプションの解析処理を行います。

サブルーチン

FreePWING::FPWUTils::FPWParser モジュールが定義する サブルーチンには initialize_fpwparser()finalize_fpwparser() があります。

initialize_fpwparser() は FreePWING 関係のクラスの オブジェクトを初期化するためのサブルーチンで、次のように 2 つの要素を 組にして並べたものを引数にとります。

initialize_fpwparser('word2' => \$w, 'text' => \$t);

要素の組はそれぞれ、1 番目の引数には 'word', 'endword' のような名前を示す文字列をとり、2 番目の引数 には変数へのリファレンスを取るようにします。 1 番目のパラメタとして認識される文字列とその用途は、次の通りです。

word2
前方一致、後方一致検索ための検索語の登録用に FreePWING::FPWUtils::Word2 クラスのオブジェクトを生成し、 初期化します。
heading
見出しデータ登録用に FreePWING::FPWUtils::Heading クラス のオブジェクトを生成し、初期化します。
text
本文データ登録用に FreePWING::FPWUtils::Text クラスの オブジェクトを生成し、初期化します。
menu
メニューのデータ登録用に FreePWING::FPWUtils::Text クラス のオブジェクトを生成し、初期化します。
copyright
著作権表示データ登録用に FreePWING::FPWUtils::Text クラス のオブジェクトを生成し、初期化します。

生成して初期化されたオブジェクトは、要素の各組の 2 番目の引数に 参照先としてセットされます。 このサブルーチンは、処理に成功すると 1 を、失敗すると 0 を返します。

finalize_fpwparser()initialize_fpwparser() で生成したオブジェクトを 使い終わったときに呼び出すサブルーチンで、各オブジェクトに対して 後処理を行います。 引数の書式は initialize_fpwparser() とまったく同じです。 このサブルーチンも、処理に成功すると 1 を、失敗すると 0 を返します。

initialize_fpwparser(), finalize_fpwparser() の具体的な使用例については fpwutils 対応 をご覧下さい。

変数

FreePWING::FPWUtils::FPWParser モジュールによって定義 される変数には以下のものがあります。

$work_directory
作業ディレクトリ名
(コマンド行オプションの解析 を参照 のこと)
$text_file_name
本文を記録するファイル名
(値: "$work_directory/text")
通常、FreePWING::FPWUtils::Word2::add_entry() を呼び出す 際に、第 2 引数として渡します。
$text_ref_file_name
本文用の参照情報ファイルを記録するファイル名
(値: "$work_directory/textref")
$text_tag_file_name
本文用のタグファイルを記録するファイル名
(値: "$work_directory/texttag")
$menu_file_name
メニューを記録するファイル名
(値: "$work_directory/menu")
$menu_ref_file_name
メニュー用の参照情報ファイルを記録するファイル名
(値: "$work_directory/menuref")
$menu_tag_file_name
メニュー用のタグファイルを記録するファイル名
(値: "$work_directory/menutag")
$copyright_file_name
著作権表示を記録するファイル名
(値: "$work_directory/copy")
$copyright_ref_file_name
著作権表示用の参照情報ファイルを記録するファイル名
(値: "$work_directory/copyref")
$copyright_tag_file_name
著作権表示用のタグファイルを記録するファイル名
(値: "$work_directory/copytag")
$heading_file_name
見出しを記録するファイル名
(値: "$work_directory/head")
通常、FreePWING::Word2::add_entry() を呼び出す際に、 第 3 引数として渡します。
$word_file_name
前方一致検索用の検索語一覧を記録するファイル名
(値: "$work_directory/word")
$endword_file_name
後方一致検索用の検索語一覧を記録するファイル名
(値: "$work_directory/eword")
$sort_file_name
前方一致検索用のソート済み検索語一覧を記録するファイル名
(値: "$work_directory/sort")
$endsort_file_name
後方一致検索用のソート済み検索語一覧を記録するファイル名
(値: "$work_directory/esort")
$index_file_name
前方一致検索インデックスを記録するファイル名の接頭辞
(値: "$work_directory/idx")
$index_ref_file_name
前方一致検索インデックス用の参照情報を記録するファイル名の接頭辞
(値: "$work_directory/idxref")
$endindex_file_name
後方一致検索インデックスを記録するファイル名
(値: "$work_directory/eidx")
$endindex_ref_file_name
後方一致検索インデックス用の参照情報を記録するファイル名
(値: "$work_directory/eidxref")
$control_file_name
書籍管理情報を記録するファイル名
(値: "$work_directory/ctrl")
$control_ref_file_name
書籍管理情報用の参照情報を記録するファイル名
(値: "$work_directory/ctrlref")
$honmon_file_name
JIS X 4081 形式の最終生成ファイル名
(値: "honmon")
$half_char_name_file_name
半角外字の名前と文字番号の割り当ての対応表を記録するファイル名
(値: "$work_directory/halfchar")
$full_char_name_file_name
全角外字の名前と文字番号の割り当ての対応表を記録するファイル名
(値: "$work_directory/fullchar")
$half_char_bitmap_16_file_name
$half_char_bitmap_24_file_name
$half_char_bitmap_30_file_name
$half_char_bitmap_48_file_name
半角外字のビットマップファイル名
(値: "gai16h""gai24h""gai30h""gai48h")
$full_char_bitmap_16_file_name
$full_char_bitmap_24_file_name
$full_char_bitmap_30_file_name
$full_char_bitmap_48_file_name
全角外字のビットマップファイル名
(値: "gai16f""gai24f""gai30f""gai48f")

コマンド行オプションの解析

FreePWING::FPWUTils::FPWParserGetopt::Long モジュールを用いてコマンド行オプションの解析 を行います。 この解析処理は、モジュールを読み込みさえすれば自動的に行われますので、 ユーザ側で明示的にサブルーチンを呼ぶ必要はありません。 今のところ、コマンド行オプションには次のものが定義されています。

-workdir directory
作業ディレクトリの位置を指定します。 指定しなければ 'work' が使われます。 プログラム内では、変数$work_directory で参照できます。

解析後、指定されたオプションは @ARGV から取り除かれます。 残りの引数をどう解釈するかは、ユーザの処理プログラムに任されます。 未知のオプションが指定された場合はエラーとなり、その時点でプログラムを 強制的に終了します。

古い作業ファイルの削除

FreePWING::FPWUtils::FPWParser は古い作業ファイルが 作業ディレクトリに残っていると、それを削除します。 削除に失敗しても、エラーとして報告することはしません。

fpwmake コマンド

fpwmake コマンドの実体は sh スクリプトで、中で GNU make を呼び出します。

たとえば、GNU make のコマンド名が /usr/local/bin/gmakefpwutils.mk ファイルがインストールされているディレクトリ が /usr/local/share/freepwing だとすると、

% fpwmake 引数...

という呼び出しは、実際には

% /usr/local/bin/gmake -I/usr/local/share/freepwing 引数...

という処理を手動で実行するのとまったく同じことです。

GNU make について詳しく知りたい方は、GNU make のドキュメントをお読み 下さい。

fpwutils.mk ファイル

fpwutils.mk ファイルの中で、いくつかの変数、生成規則を 定義していますが、詳細については fpwutils.mk ファイルを 直接ご覧になって下さい。

freepwing-1.5.orig/ChangeLog0000644000175000017500000006242111022640455015400 0ustar mhattamhatta2008-06-07 Kazuhiro Ito * $B%P!<%8%g%s(B 1.5. * fpwutils/mkdirhier (status): Fix making incorrect directories. 2008-06-03 Kazuhiro Ito * fpwutils/mkdirhier (status): Fix trying to make directories containing leading double slashes when argument is an absolute path. 2008-05-29 Kazuhiro Ito * src/Link.pm (close): Use buffer to decrease file I/O. 2008-05-28 Kazuhiro Ito * src/BaseText.pm (flush_buffer): New private method. (write_data, close): Use it. (max_buffer_size): New variable. (new): New key 'buffer' is added. 2008-05-27 Kazuhiro Ito * src/BaseText.pm (add_text): Fix bug induced at 2008-05-26. 2008-05-26 Kazuhiro Ito * src/BaseText.pm (add_text): Partially rewritten for speed. 2007-12-26 Kazuhiro Ito * src/Sound.pm (add_binary): New method. 2007-12-25 Kazuhiro Ito * src/BaseText.pm (add_jpeg_graphic_start, add_jpeg_graphic_end): New methods. * fpwutils/fpwutils.mk.in (catalogs.txt): Create catalogs file for EPWING5. * src/ColorGraphic.pm (add_binary): New method. 2007-12-22 Kazuhiro Ito * fpwutils/fpwutils.mk (catalogs.txt): Fix creating incorrect catalogs.txt when SUBDIRS is defined. 2007-12-22 Kazuhiro Ito Apply sound patch. 2007-02-16 Kazuhiro Ito * src/BaseWord.pm (add_entry): $BD9$$8!:w8l$rM?$($i$l$?>l9g$O!"@Z$j5M(B $B$a$F%$%s%G%C%/%9$KEPO?$9$k$h$&$K$7$?!#(B 2005-01-08 Motoyuki Kasahara * $B%P!<%8%g%s(B 1.4.4. * (fpwutils/FPWParser.pm): $BITL@$J%*%W%7%g%s$O=hM}$7$J$$$h$&$K$7$?!#(B * doc/Makefile.am: mkindex $B$N;HMQ$r;_$a!"Be$o$j$K(B html-include, html-toc, html-split $B$r;H$C$F!"L\ * catdump/catdump.in (undump): $BH>3Q30;z%U%!%$%k$N07$$$KIT6q9g$,(B $B$"$C$?$N$G!"=$@5$7$?!#(B 2002-09-26 Motoyuki Kasahara * configure.ac (AC_INIT, AM_INIT_AUTOMAKE): $B%Q%C%1!<%8L>$H%P!<%8%g%s(B $B$O!"(BAM_INIT_AUTOMAKE $B$G$O$J$/(B AC_INIT $B$G%;%C%H$9$k$h$&$K$7$?!#(B 2002-09-14 Motoyuki Kasahara * $B%P!<%8%g%s(B 1.4.3. * catdump/catdump.in (getline): DOS, Mac $B7A<0$N2~9T%3!<%I(B (CR LF, CR) $B$b07$($k$h$&$K$7$?!#(B 2002-04-19 Motoyuki Kasahara * $B%P!<%8%g%s(B 1.4.2. * src/Index.pm (close, write_medium_layer_block): $B:G8e$KEPO?$7$?(B $BC18l$,!">e0L%$%s%G%C%/%9$KEPO?$5$l$J$$$H$$$&%P%0$rD>$7$?!#(B 2002-01-27 Motoyuki Kasahara * $B%P!<%8%g%s(B 1.4.1. * configure.ac (AM_INIT_AUTOMAKE): 1.4.1 $B$K99?7$7$?!#(B * catdump/catdump.in (undump): $B%G%#%l%/%H%jL>$,(B 8 $BJ8;z$KK~$?$J$$(B $B$H$-!"%J%kJ8;z(B (0x00) $B$G$O$J$/6uGr(B (0x20) $B$G8e$m$rKd$a$k$h$&$K$7$?!#(B * mkinstalldirs, missing: Automake 1.5b $B$N$b$N$K99?7$7$?!#(B 2001-11-08 Motoyuki Kasahara * configure.ac: Autoconf $B%P!<%8%g%s(B 2.52 $B8~$1$K99?7$7$?!#(B 2001-09-15 Motoyuki Kasahara * $B%P!<%8%g%s(B 1.4. * configure.ac (AM_INIT_AUTOMAKE): 1.4 $B$K99?7$7$?!#(B 2001-08-28 Motoyuki Kasahara * catdump/catdump.in (epw2_t): 'bookfile' $B$N=i4|CM$r(B "HONMON\0\0" $B$KJQ99$7$?!#(B 2001-08-21 Motoyuki Kasahara * $B%P!<%8%g%s(B 1.4beta3. * src/BaseBinary.pm: $B:o=|$7$?!#(B * src/Sound.pm, src/ColorGraphic.pm: BaseBinary.pm $B$r7Q>5$7$J$$$h$&(B $B$K$7$F!"=q$-D>$7$?!#(B * src/Makefile.am (pkgperllib_DATA, EXTRA_DIST): BaseBinary.pm $B$r(B $B:o=|$7$?!#(B * fpwutils/fpwutils.mk.in (archive-directory): ${CGRAPHS} ${SOUNDS} ${HALFCHARS} ${FULLCHARS} $B$r<+F0E*$K%"!<%+(B $B%$%V$K4^$a$k$h$&$K$7$?!#(B * catdump/catdump.in (main): $B@5>o=*N;;~$K(B exit(1) $B$7$F$$$?$N$r(B $B=$@5$7$?!#(B * src/BaseText.pm (add_color_graphic_start): BMP $BMQ$N%(%9%1!<%W%7!<(B $B%1%s%9$r=PNO$9$k$h$&$K$7$?!#(B 2001-08-19 Motoyuki Kasahara >>>>>>> 1.19 * catalogs: $B%G%#%l%/%H%j$r(B `catdump' $B$K2~L>$7$?!#(B * Makefile.am (SUBDIRS): $BF1>e!#(B * configure.ac (ACCONFIG_FILES): $BF1>e!#(B * catdump/Makefile.am (pkglibexecdir): $B?7$?$J(B make $BJQ?t!#(B * catdump/Makefile.am (pkglibexec_SCRIPTS, CLEANFILES): catdump $B$rDI2C$7$?!#(B * catdump/Makefile.am (EXTRA_DIST): catdump $B$rDI2C$7$?!#(B * catdump/Makefile.am (catdump): $B?7$?$J%?!<%2%C%H!#(B * catdump/catdump.in: $B?7$?$J%U%!%$%k!#(B * fpwutils/fpwutils.mk.in (CATDUMP): $(FPWLIBEXECDIR)/catdump $B$r(B $B%G%U%)%k%H$G;HMQ$9$k$h$&$KJQ99$7$?!#(B * fpwutils/fpwutils.mk.in (CATDUMPFLAGS): $B?7$?$J(B make $BJQ?t!#(B * catdump/Makefile.am (pkgdoc_DATA, EXTRA_DIST): catdump.txt $B$r(B $BDI2C$7$?!#(B * catdump/catdump.txt: $B?7$?$J%U%!%$%k!#(B 2001-08-18 Motoyuki Kasahara * $B%P!<%8%g%s(B 1.4beta2. * src/BaseBinary.pm (add_data): $B2hA|MQ$N%X%C%@$r=q$-9~$_K:$l$F$$$?(B $B$N$rD>$7$?!#(B * configure.ac (AM_INIT_AUTOMAKE): 1.4beta2 $B$K99?7$7$?!#(B 2001-08-16 Motoyuki Kasahara * $B%P!<%8%g%s(B 1.4beta1. * src/BaseText.pm (add_reference_end): $B%?%0$K@\F,<-(B `text:' $B$rIU$1(B $BK:$l$F$$$?$N$G=$@5$7$?!#(B($B$5$H$_$5$s$+$i$N$4;XE&(B) * src/BaseBinary.pm (add_data): $B0z?t$N=g=x(B ($tag, $file_name) $B$,(B $BH?BP$K$J$C$F$$$?$N$G=$@5$7$?!#(B($B$5$H$_$5$s$+$i$N$4;XE&(B) * fpwutils/fpwutils.mk.in (${SOUND_DEP}, ${CGRAPH_DEP}): $B2;@<%G!<%?(B $B$d?^HG%G!<%?Dj5A%U%!%$%k$,EPO?$5$l$F$$$J$$$H$-$O!"(Bfpwsound, fpwcgraph $B$r5/F0$7$J$$!#(B 2001-08-14 Motoyuki Kasahara * configure.ac (AM_INIT_AUTOMAKE): 4.1beta1 $B$K99?7$7$?!#(B * configure.ac (AC_PREREQ): 2.49 $B$KJQ99$7$?!#(B * configure.ac (AC_ARG_ENABLE, AC_ARG_WITH): AC_HELP_STRING $B$r;HMQ(B $B$9$k$h$&$K$7$?!#(B * configure.ac (AC_OUTPUT): $B@_Dj%U%!%$%k$N%j%9%H$O(B AC_CONFIG_FILES $B$G;XDj$9$k$h$&$K$7$F!"(BAC_OUTPUT $B$O0z?t$J$7$G8F$V$h$&$K$7$?!#(B 2001-08-13 Motoyuki Kasahara * $B%P!<%8%g%s(B 1.4beta0 * doc/mkindex: $B%?%0$K(B lang="ja" $B$r;XDj$9$k$h$&$K$7$?!#(B 2001-08-06 Motoyuki Kasahara * missing: Automake 1.4j $B$N$b$N$rF3F~!#(B 2001-06-29 Motoyuki Kasahara * src/Tag.pm (add_entry): $B?t;z$G;O$^$k%?%0L>$r5v$9$h$&$K$7$?!#(B `:' $B$d(B `-' $B$b%?%0L>$N0lIt$K;H$($k$h$&$K$7$?!#(B * src/BaseText.pm (add_color_graphic_start, add_color_graphic_end): modifier $B$NL>>N$r(B `reference' $B$+$i(B `color-graphic' $B$KJQ99$7$?!#(B * src/BaseText.pm (add_sound_start, add_sound_end): modifier $B$NL>>N$r(B `reference' $B$+$i(B `sound' $B$KJQ99$7$?!#(B 2001-06-28 Motoyuki Kasahara * src/BaseBinary.pm, src/ColorGraphic.pm, src/Sound.pm, fpwutils/ColorGraphic.pm, fpwutils/Sound.pm fpwutils/fpwcgraph.in, fpwutils/fpwsound.in: $B?7$7$$%U%!%$%k(B * src/Makefile.am (pkgperllib_DATA, EXTRA_DIST): BaseBinary.pm, ColorGraphic.pm, Sound.pm $B$rDI2C$7$?!#(B * fpwutils/Makefile.am (fpwperllib_DATA, EXTRA_DIST): ColorGraphic.pm, Sound.pm $B$rDI2C$7$?!#(B * fpwutils/Makefile.am (pkglibexec_SCRIPTS, CLEANFILES): fpwcgraph, fpwsound $B$rDI2C$7$?!#(B * fpwutils/Makefile.am (EXTRA_DIST): fpwcgraph.in, fpwsound.in $B$rDI2C$7$?!#(B * fpwutils/Makefile.am (fpwcgraph, fpwsound): $B?7$7$$%?!<%2%C%H!#(B * src/BaseText.pm (add_color_graphic_start, add_color_graphic_end, add_sound_start, add_sound_end): $B?7$7$$%a%=%C%I!#(B * src/BaseText.pm (add_entry_tag, add_tag): $BM?$($i$l$?%?%0L>$K@\(B $BF,<-(B `text:' $B$rDI2C$7$F$+$i!"%?%0$rEPO?$9$k$h$&$K$7$?!#(B * src/Control.pm (add_color_graphic_entry, add_sound_entry): $B%a%=%C%I$rDI2C$7$?!#(B * fpwutils/FPWUtils.pm (vars, @EXPORT): $color_graphic_file_name, $color_graphic_tag_file_nam, $sound_file_name, $sound_tag_file_name $B$rDI2C$7$?!#(B * fpwutils/fpwlink.in: $B%+%i! * doc/freepwing.css: $B?7$7$$%U%!%$%k!#(B * doc/Makefile.am (pkgdoc_DATA, EXTRA_DIST): freepwing.css $B$r(B $BDI2C$7$?!#(B * doc/mkindex: $B%9%?%$%k%7!<%H$H$7$F!"(Bfreepwing.css $B$rFI$_9~$`(B HTMl $B$r@8@.$9$k$h$&$K$7$?!#(B 2000-11-06 Motoyuki Kasahara * $B%P!<%8%g%s(B 1.3.1 * src/BaseText.pm (add_entry_tag): $B?7@_$N%a%=%C%I!#(B 2000-10-17 Motoyuki Kasahara * $B%P!<%8%g%s(B 1.3 2000-09-05 Motoyuki Kasahara * fpwutils/fpwutils.mk.in (clean): tar+gzip $B7A<0!"(Btar+bzip2 $B7A<0(B $B$N%Q%C%1!<%8$b>C$9$h$&$K$7$?!#(B * fpwutils/fpwutils.mk.in (package-zip, package-tar-gz, package-tar-bz2): $B?7@_$N%?!<%2%C%H!#(B * fpwutils/fpwutils.mk.in (package): package-zip $B$r8F$V$h$&$K$7$?!#(B * fpwutils/fpwutils.mk.in (catalogs.txt): $B?7@_$N%?!<%2%C%H!#(B * fpwutils/fpwutils.mk.in (clean-recursive): catalogs.txt $B$b>C$9(B $B$h$&$K$7$?!#(B * fpwutils/fpwutils.mk.in: $B3F%?!<%2%C%H$, * $B%P!<%8%g%s(B 1.3beta0 * configure.in (AC_ARG_WITH): `--with-pkgdocdir' $B%*%W%7%g%s$r?7@_(B $B$7$?!#(B * doc/Makefile.am (docdir): $B%^%/%m$NDj5A$r:o=|$7$?!#(B * fpwutils/fpwutils.mk.in (package): tar+gzip $B7A<0$N%Q%C%1!<%8(B $B$O:n$i$J$$$h$&$K$7$?!#(B * fpwutils/fpwutils.mk.in (clean): tar+gzip $B7A<0$N%Q%C%1!<%8(B $B$O>C$5$J$$$h$&$K$7$?!#(B 2000-08-29 Motoyuki Kasahara * Copyright.pm.in, Heading.pm.in, Menu.pm.in, Text.pm.in, Word2.pm.in: $B%Q%C%1!<%8$N=*$j$K(B `1;' $B$rCV$/$h$&$K$7$?!#(B * fpwutils/FPWUtils.pm.in (use vars, @EXPORT): $keyword_file_name $B$rDI2C$7$?!#(B * fpwutils/FPWUtils.pm.in (initialize_fpwutils): $keyword_file_name $B$r=i4|2=$9$k$h$&$K$7$?!#(B * src/BaseText.pm.in ($VERSION): $BJQ?t$r:o=|$7$?!#(B src/BaseUserChar.pm.in ($VERSION): $BF1>e(B src/BaseWord.pm.in ($VERSION): $BF1>e(B src/CharConv.pm.in ($VERSION): $BF1>e(B src/Control.pm.in ($VERSION): $BF1>e(B src/EndWord.pm.in ($VERSION): $BF1>e(B src/FullUserChar.pm.in ($VERSION): $BF1>e(B src/HalfUserChar.pm.in ($VERSION): $BF1>e(B src/Heading.pm.in ($VERSION): $BF1>e(B src/Index.pm.in ($VERSION): $BF1>e(B src/Link.pm.in ($VERSION): $BF1>e(B src/RefUserChar.pm.in ($VERSION): $BF1>e(B src/Reference.pm.in ($VERSION): $BF1>e(B src/Sort.pm.in ($VERSION): $BF1>e(B src/Tag.pm.in ($VERSION): $BF1>e(B src/Text.pm.in ($VERSION): $BF1>e(B src/Word.pm.in ($VERSION): $BF1>e(B src/Word2.pm.in ($VERSION): $BF1>e(B * src/BaseText.pm.in: BaseText.pm $B$K2~L>$7$?!#(B src/BaseUserChar.pm.in: BaseUserChar.pm $B$K2~L>$7$?!#(B src/BaseWord.pm.in: BaseWord.pm $B$K2~L>$7$?!#(B src/CharConv.pm.in: CharConv.pm $B$K2~L>$7$?!#(B src/Control.pm.in: Control.pm $B$K2~L>$7$?!#(B src/EndWord.pm.in: EndWord.pm $B$K2~L>$7$?!#(B src/FullUserChar.pm.in: FullUserChar.pm $B$K2~L>$7$?!#(B src/HalfUserChar.pm.in: HalfUserChar.pm $B$K2~L>$7$?!#(B src/Heading.pm.in: Heading.pm $B$K2~L>$7$?!#(B src/Index.pm.in: Index.pm $B$K2~L>$7$?!#(B src/Link.pm.in: Link.pm $B$K2~L>$7$?!#(B src/RefUserChar.pm.in: RefUserChar.pm $B$K2~L>$7$?!#(B src/Reference.pm.in: Reference.pm $B$K2~L>$7$?!#(B src/Sort.pm.in: Sort.pm $B$K2~L>$7$?!#(B src/Tag.pm.in: Tag.pm $B$K2~L>$7$?!#(B src/Text.pm.in: Text.pm $B$K2~L>$7$?!#(B src/Word.pm.in: Word.pm $B$K2~L>$7$?!#(B src/Word2.pm.in: Word2.pm $B$K2~L>$7$?!#(B * src/Makefile.am (CLEANFILES): Sort.pm $B0J30$O:o=|$7$?!#(B * src/Makefile.am (EXTRA_DIST): Sort.pm $B$r=|$/(B $(pkgperllib_DATA) $B$*$h$S(B Sort.pm.in $B$rNs5s$7$?!#(B * src/Makefile.am (BaseText.pm, BaseUserChar.pm, BaseWord.pm, CharConv.pm, Control.pm, EndWord.pm, FullUserChar.pm, HalfUserChar.pm, Heading.pm, Index.pm, Link.pm, RefUserChar.pm, Reference.pm, Sort.pm, Tag.pm, Text.pm, Word.pm, Word2.pm): $B%?!<%2%C%H$r:o=|$7$?!#(B * fpwutils/Copyright.pm.in ($VERSION): $BJQ?t$r:o=|$7$?!#(B fpwutils/FPWParser.pm.in ($VERSION): $BF1>e(B fpwutils/FPWUtils.pm.in ($VERSION): $BF1>e(B fpwutils/Heading.pm.in ($VERSION): $BF1>e(B fpwutils/Menu.pm.in ($VERSION): $BF1>e(B * fpwutils/Copyright.pm.in: Copyright.pm $B$K2~L>$7$?!#(B fpwutils/FPWParser.pm.in: FPWParser.pm $B$K2~L>$7$?!#(B fpwutils/FPWUtils.pm.in: FPWUtils.pm $B$K2~L>$7$?!#(B fpwutils/Heading.pm.in: Heading.pm $B$K2~L>$7$?!#(B fpwutils/Menu.pm.in: Menu.pm $B$K2~L>$7$?!#(B * fpwutils/Makfile.am (EXTRA_DIST): FPWParser.pm.in, FPWUtils.pm.in, Heading.pm.in, Menu.pm.in, Text.pm.in, Word2.pm.in $B$r:o=|$7!"(B $(fpwperllib_DATA) $B$rDI2C$7$?!#(B * fpwutils/Makfile.am (CLEANFILES): FPWParser.pm FPWUtils.pm $B$r:o=|(B $B$7$?!#(B * fpwutils/Makfile.am (FPWParser.pm, FPWUtils.pm, Heading.pm, Menu.pm, Text.pm, Word2.pm): $B%?!<%2%C%H$r:o=|$7$?!#(B * fpwutils/Makfile.am (fpwutils.mk): @LIB_VERSION@ $B$rCV49(B $B$7$J$$$h$&$K$7$?!#(B * fpwutils/fpwutils.mk.in (FPWUTILS_MK_VERSION) $B:o=|$7$?!#(B * fpwutils/FPWUtils.pm ($fpwutils_pm_version): $BJQ?t$r:o=|$7$?!#(B * configure.in (LIB_VERSION): $B:o=|$7$?!#(B * src/Makefile.am (pkgperllib_DATA): KeyWord.pm $B$rDI2C$7$?!#(B * src/KeyWord.pm: $B?7$7$$%U%!%$%k!#(B * fpwutils/Makefile.am (fpwperllib_DATA): KeyWord.pm $B$rDI2C$7$?!#(B * fpwutils/KeyWord.pm: $B?7$7$$%U%!%$%k!#(B * fpwutils/FPWUtils.pm ($keyword_file_name, $keyindex_file_name, $keyword_file_name): $BJQ?t$NDj5A$rDI2C$7$?!#(B * fpwutils/FPWParser.pm: $keyword_file_name $B$r:o=|$9$k$h$&$K$7$?!#(B * fpwutils/FPWParser.pm: use FreePWING::FPWUtils::KeyWord. * fpwutils/FPWParser.pm (initialize_fpwparser, finalize_fpwparser): `keyword' $B%Q%i%a%?$G;XDj$5$l$?(B KeyWord $B%*%V%8%'%/%H$rA`:n$9$k$h$&(B $B$K$7$?!#(B * fpwutils/fpwsort.in: $keysort_file_name $B$r@8@.$7D>$9$h$&$K$7$?!#(B * fpwutils/fpwindex.in: $B>r7o8!:w%$%s%G%C%/%9%U%!%$%k$r@8@.$7D>$9(B $B$h$&$K$7$?!#(B * fpwutils/fpwcontrol.in: $B>r7o8!:w%$%s%G%C%/%9%(%s%H%j$rDI2C$9$k(B $B$K$7$?!#(B * fpwutils/fpwlink.in: $B>r7o8!:w%$%s%G%C%/%9$,$"$l$PDI2C$9$k$h$&(B $B$K$7$?!#(B * src/Control.pm (add_keyindex_entry): $B>r7o8!:w%$%s%G%C%/%9MQ$N(B $B%a%=%C%I$rDI2C$7$?!#(B 2000-07-06 Motoyuki Kasahara * $B%P!<%8%g%s(B 1.2.1 * fpwutils/fpwutils.mk.in (ALLDEPS): $B?7$?$J%^%/%m!#(B * fpwutils/fpwutils.mk.in (all): ${ALLDEPS} $B$K0MB8$9$k$h$&$K$7$?!#(B 2000-06-17 Motoyuki Kasahara * configure.in: perl $B$N%P!<%8%g%s$NH=DjJ}K!$rJQ$($?!#(B * src/ASCIItoX.pm.in: src/CharConv.pm.in $B$K2~L>$7$?!#(B * src/BaseWord.pm.in: $B%a%=%C%I(B add_font_start, add_font_end $B$r(B $BDI2C$7$?!#(B * fpwutils.mk.in (install): $B%$%s%9%H!<%k$7$?%U%!%$%k$N%b!<%I$r(B 0644 $B$K$9$k$h$&$K$7$?!#(B * fpwutils.mk.in (install): ${PACKAGEEXTRA} $B$N(B make $B$r9T$o$J$$(B $B$h$&$K$7$?!#(B * fpwutils.mk.in (PACKAGEDEPS): $B?7$?$J%^%/%m!#(B * fpwutils.mk.in (install): PACKAGEDEPS $B$K0MB8$9$k$h$&$K$7$?!#(B 2000-03-30 Motoyuki Kasahara * $B%P!<%8%g%s(B 1.2 * src/BaseText.pm.in (open): $B=PNO%U%!%$%k%O%s%I%k$KBP$7$F(B `binmode' $B$r8F$V$h$&$K$7$?H&$,!"8F$s$G$$$J$+$C$?$N$G=$@5$7$?!#(B * src/BaseWord.pm.in (open): $B=PNO%U%!%$%k%O%s%I%k$KBP$7$F(B `binmode' $B$r8F$P$J$$$h$&$K$7$?!#(B 2000-03-03 Motoyuki Kasahara * $B%P!<%8%g%s(B 1.2beta2 * doc/Makefile.am (index.html): `mkindex' $B$O(B `$(srcdir)/mkindex' $B$K!"(Bfreepwing.html $B$O(B `$(srcdir)/freepwing.html' $B$H5-$9$h$&$K$7$?!#(B * src/Sort.pm.in: $sort $B$NCM$r(B `@SORT@' $B$K$7$?!#(B * src/Makefile.am (Sort.pm): `@SORT@' $B$b(B sed $B$GCV49$9$k$h$&$K$7$?!#(B * fpwutils/Makefile.am (Copyright.pm, FPWParser.pm, FPWUtils.pm, Heading.pm, Menu.pm, Text.pm, Word2.pm): `@SORT@' $B$O(B send $B$GCV49(B $B$7$J$$$h$&$K$7$?!#(B * fpwutils/FPWUtils.pm.in (vars): $sort_command $B$r:o=|(B * fpwutils/FPWUtils.pm.in (@EXPORRT): $BF1>e(B * fpwutils/FPWUtils.pm.in (initialize_fpwutils): $BF1>e(B * src/Sort.pm.in (open): sort $B%3%^%s%I$X$N%Q%$%W$r3+$/4V!"(BLC_COLLATE, LC_CTYPE $B$O(B `C' $B$K@_Dj$7$F$*$/$h$&$K$7$?!#(B 2000-03-02 Motoyuki Kasahara * fpwutils/cphier.in: $B?7$?$J%U%!%$%k(B * fpwutils/Makefile.am (EXTRA_DIST): cphier.in $B$rDI2C$7$?!#(B * fpwutils/Makefile.am (pkglibexec_SCRIPTS): cphier $B$rDI2C$7$?!#(B * fpwutils/Makefile.am (CLEANFILES): cphier $B$rDI2C$7$?!#(B * fpwutils/Makefile.am (cphier): $B%?!<%2%C%H$rDI2C$7$?!#(B * fpwutils/fpwutils.mk.in (archive-directory, install-directory, install): cp $B$NBe$o$j$K(B cphier $B$r;H$&$h$&$K$7$?!#(B * fpwutils/fpwutils.mk.in (CPHIER): $B?7$?$J%^%/%m(B * fpwutils/fpwutils.mk.in (archive-directory): ARCHIVEEXTRA $B$,(B "source=destination" $B7A<0$N0z?t$r=hM}$G$-$J$+$C$?$N$G!"(B $B$G$-$k$h$&$K$7$?!#(B 2000-02-26 Motoyuki Kasahara * $B%P!<%8%g%s(B 1.2beta1 * src/Sort.pm.in (close_internal): sort $B$N=*N;%3!<%I$r%A%'%C%/(B $B$9$k$h$&$7!"La$jCM(B 0 $B$+(B 1 $B$rJV$9$h$&$K$7$?!#(B * src/Sort.pm.in (close): close_internal $B$NLa$jCM$r!"$3$N%a%=%C(B $B%I$NLa$jCM$H$9$k$h$&$K$7$?!#(B * fpwutils/fpwsort.in: FreePWING::Sort::close $B$rM[$K8F$V$h$&(B $B$K$7$?!#(B * fpwutils/fpwsort.in: $B4D6-JQ?t(B TMPDIR $B$r@_Dj$9$k$h$&$K$7$?!#(B 2000-02-23 Motoyuki Kasahara * src/BaseText.pm.in (add_text): JIS X 0201 $B%+%J$,@5$7$/(B JIS X 0208 $B%+%J$KJQ49$5$l$F$$$J$+$C$?%P%0$r=$@5$7$?!#(B 2000-02-21 Motoyuki Kasahara * src/BaseUserChar.pm.in (open): $B=PNO%U%!%$%k%O%s%I%k$KBP$7$F(B `binmode' $B$r8F$V$h$&$K$7$?!#(B * $B%P!<%8%g%s(B 1.2beta0 * doc/mkindex: $BL\ $B$,@5$7$$8D?tJ,$@$1=PNO$5$l$F(B $B$$$J$+$C$?%P%0$r=$@5$7$?!#(B 2000-02-20 Motoyuki Kasahara * fpwutils/fpwhalfchar.in, fpwutils/fpwfullchar.in, fpwutils/fpwindex.in, fpwutils/fpwsort.in, fpwutils/fpwcontrol.in, fpwutils/fpwlink.in, fpwutils/FPWParser.pm.in: initialize_fpwutils(), finalize_fpwutils() $B$r8F$V$h$&$K$7$?!#(B $B%*%W%7%g%s$N2r@O$r9T$&$h$&$K$9$k!#(B * fpwutils/FPWUtils.pm.in: $B%*%W%7%g%s$N2r@O$O9T$o$J$$$h$&$K$7$?!#(B * fpwutils/FPWUtils.pm.in: $B%Q%C%1!<%8$r(B FreePWING::FPWUtils::FPWUtils $B$K@_Dj$9$k!#(B * fpwutils/FPWUtils.pm.in (initialize_fpwutils): $B?7$7$$%5%V%k!<%A%s!#(B $BJQ?t$N@_Dj$O$3$N%5%V%k!<%A%s$NCf$G9T$&!#(B * fpwutils/FPWUtils.pm.in: strict, integer $B%W%i%0%^$r;H$&!#(B * fpwutils/FPWUtils.pm.in ($VERSION): $BJQ?t(B $VERSION $B$r@_Dj$9$k!#(B * fpwutils/FPWUtils.pm.in (vars): $B@_DjMQ$NJQ?t$r$9$Y$FDI2C$7$?!#(B * fpwutils/FPWUtils.pm.in (@EXPORT): $B@_DjMQ$NJQ?t$9$Y$F!"$*$h$S(B initialize_fpwutils(), finalize_fpwutils() $B$rDI2C$7$?!#(B * fpwutils/Word2.pm.in: $B?7$?$J%U%!%$%k!#(B * fpwutils/Text.pm.in: $B?7$?$J%U%!%$%k!#(B * fpwutils/Menu.pm.in: $B?7$?$J%U%!%$%k!#(B * fpwutils/Copyright.pm.in: $B?7$?$J%U%!%$%k!#(B * fpwutils/Heading.pm.in: $B?7$?$J%U%!%$%k!#(B * fpwutils/FPWParser.pm.in (initialize_fpwparser): $B;EMM$rJQ99$7$?!#(B 'word2' $B$O(B FreePWING::Word2 $B$G$O$J$/!"(BFreePWING::FPWUtils::Word2 $B$N%*%V%8%'%/%H$N%O!<%I%j%U%!%l%s%9$rJV$9!#(B 'text' $B$O(B FreePWING::Text $B$G$O$J$/!"(BFreePWING::FPWUtils::Text $B$N%*%V%8%'%/%H$N%O!<%I%j%U%!%l%s%9$rJV$9!#(B 'menu' $B$O(B FreePWING::Text $B$G$O$J$/!"(BFreePWING::FPWUtils::Menu $B$N%*%V%8%'%/%H$N%O!<%I%j%U%!%l%s%9$rJV$9!#(B 'copyright' $B$O(B FreePWING::Text $B$G$O$J$/!"(BFreePWING::FPWUtils::Copyright $B$N%*%V%8%'%/%H$N%O!<%I%j%U%!%l%s%9$rJV$9!#(B 'heading' $B$O(B FreePWING::Heading $B$G$O$J$/!"(BFreePWING::FPWUtils::Heading $B$N%*%V%8%'%/%H$N%O!<%I%j%U%!%l%s%9$rJV$9!#(B * fpwutils/Word2.pm.in: $B?7$?$J%U%!%$%k!#(B * fpwutils/Text.pm.in: $B?7$?$J%U%!%$%k!#(B * fpwutils/Menu.pm.in: $B?7$?$J%U%!%$%k!#(B * fpwutils/Copyright.pm.in: $B?7$?$J%U%!%$%k!#(B * fpwutils/Makefile.am (): `fpwhalfchar', `fpwfullchar' $B$rDI2C$7$?!#(B * src/Makefile.am (EXTRA_DIST): Wod2.pm.in, Text.pm.in, Menu.pm.in, Copyright.pm.in $B$rDI2C$7$?!#(B * src/Makefile.am (Wod2.pm.in, Text.pm.in, Menu.pm.in, Copyright.pm.in): $B?7$?$J%?!<%2%C%H!#(B 2000-02-19 Motoyuki Kasahara * fpwutils/FPWParser.pm.in: `FreePWING::Word', `FreePWING::EndWord' $B$OFI$_9~$^$J$$!#(B * fpwutils/fpwutils.mk.in (userchar, recursive): $B?7$?$J%?!<%2%C%H!#(B * fpwutils/fpwutils.mk.in (userchar): $B?7$?$J%?!<%2%C%H!#(B * fpwutils/fpwutils.mk.in (USERCHAR_DEP, FPWHALFCHAR, FPWFULLCHAR, HALFCHARS, FULLCHARS): $B?7$?$J%^%/%m!#(B * fpwutils/fpwutils.mk.in (${USERCHAR_DEP}): $B?7$?$J%?!<%2%C%H!#(B * fpwutils/fpwutils.mk.in (RARSE_DEP): ${USERCHAR_DEP} $B$X0MB8$9$k(B $B$h$&$K$7!"(B${WORKDIR} $B$O:n@.$7$J$$$h$&$K$7$?!#(B 2000-02-13 Motoyuki Kasahara * fpwutils/fpwhalfchar.in: $B?7$?$J%U%!%$%k!#(B * fpwutils/fpwfullchar.in: $B?7$?$J%U%!%$%k!#(B * fpwutils/Makefile.am (pkglibexec_SCRIPTS): `fpwhalfchar', `fpwfullchar' $B$rDI2C$7$?!#(B * src/Makefile.am (EXTRA_DIST): `fpwhalfchar.in', `fpwfullchar.in' $B$rDI2C$7$?!#(B * src/Makefile.am (fpwhalfchar, fpwfullchar): $B?7$?$J%?!<%2%C%H!#(B * src/BaseUserChar.pm.in: $B?7$?$J%U%!%$%k!#(B * src/FullUserChar.pm.in: $B?7$?$J%U%!%$%k!#(B * src/HalfUserChar.pm.in: $B?7$?$J%U%!%$%k!#(B * src/RefUserChar.pm.in: $B?7$?$J%U%!%$%k!#(B * src/Makefile.am (pkgperllib_DATA): BaseUserChar.pm, FullUserChar.pm, HalfUserChar.pm, RefUserChar.pm $B$rDI2C$7$?!#(B * src/Makefile.am (EXTRA_DIST): BaseUserChar.pm.in, FullUserChar.pm.in, HalfUserChar.pm.in RefUserChar.pm.in $B$rDI2C$7$?!#(B * src/Makefile.am (BaseUserChar.pm, FullUserChar.pm, HalfUserChar.pm, RefUserChar.pm): $B?7$?$J%?!<%2%C%H!#(B * src/BaseText.pm.in (new): $B%a%s%P(B `half_user_characters', `full_user_characters' $B$rDI2C$7$?!#(B * src/BaseText.pm.in (set_half_user_characters_in_file, set_full_user_characters_in_file, add_half_user_character, add_full_user_character, half_user_character, full_user_character): $B?7$?$J%a%=%C%I(B 2000-02-12 Motoyuki Kasahara * fpwutils/Makefile.am (CLEANFILES): Don't specify file names. Use *_SCRIPTS and *_DATA macros. 2000-01-28 Motoyuki Kasahara * $B%P!<%8%g%s(B 1.1.1 * fpwutils/fpwutils.mk.in (install): $B?7$?$J%?!<%2%C%H(B * fpwutils/fpwutils.mk.in (package): `install' $B$r;HMQ$9$k$h$&$K(B $B$7$?!#(B * fpwutils/fpwutils.mk.in (package-directory): `install-directory' $B$K2~L>$7$?!#(B * src/BaseText.pm.in (open): $B=PNO%U%!%$%k%O%s%I%k$KBP$7$F(B `binmode' $B$r8F$V$h$&$K$7$?!#(B * src/BaseWord.pm.in (open): $BF1>e!#(B * src/Control.pm.in (open): $BF1>e!#(B * src/Index.pm.in (open_upper_layer): $BF1>e!#(B * src/Link.pm.in (open): $BF1>e!#(B 1999-12-03 Motoyuki Kasahara * $B%P!<%8%g%s(B 1.1a 1999-11-09 Motoyuki Kasahara * $B%P!<%8%g%s(B 1.1 * fpwutils/fpwutils.mk.in (package, package-directory, archive): $B$^$:(B ln $B$r;H$$!"$=$l$,<:GT$K=*$o$C$?$i!"(Bcp -p $B$r(B $B;H$&$h$&$K$9$k!#(B 1999-11-06 Motoyuki Kasahara * fpwutils/perl.sh.in: $B%U%!%$%k$rDI2C$7$?!#(B * fpwutils/Makefile.am (EXTRA_DIST): perl.sh.in $B$rB-$7$?!#(B * fpwutils/Makefile.am (libexec_SCRIPTS): perl.sh $B$rB-$7$?!#(B * fpwutils/Makefile.am (CLEANFILES): perl.sh $B$rB-$7$?!#(B * fpwutils/Makefile.am (perl.sh): $B@8@.5,B'$rDI2C$7$?!#(B 1999-11-03 Motoyuki Kasahara * src/ASCIItoX.pm.in, src/BaseText.pm.in, src/BaseWord.pm.in, src/Control.pm.in, src/EndWord.pm.in, src/Heading.pm.in, src/Index.pm.in, src/Link.pm.in, src/Reference.pm.in, src/Sort.pm.in, src/Tag.pm.in, src/Text.pm.in, src/Word.pm.in, src/Word2.pm.in: `integer' $B%W%i%0%^$r;HMQ$9$k$h$&$K$7$?!#(B * src/Control.pm.in (add_entry, add_index_entry, add_endindex_entry): $BJ#?t8D$N%U%!%$%kL>$r0z?t$K;XDj$G$-$k$h$&(B $B$KJQ99$7$?!#(B * fpwutils/fpwcontrol.in: $BA43,AX$NA0J}%$%s%G%C%/%9%U%!%$%kL>$r(B add_index_entry() $B$KEO$9$h$&$K$7$?!#F1MM$K!"A43,AX$N8eJ}%$%s%G%C(B $B%/%9$K%U%!%$%kL>$r(B add_endindex_entry() $B$KEO$9$h$&$K$7$?!#(B 1999-09-02 Motoyuki Kasahara * $B%P!<%8%g%s(B 1.0.1 * src/Index.pm.in (add_medium_layer_entry): $upper_position $B$N7W;;$,4V0c$C$F$$$?$N$G=$@5$7$?!#(B freepwing-1.5.orig/COPYING0000644000175000017500000004310511022404342014650 0ustar mhattamhatta GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy 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; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. freepwing-1.5.orig/NEWS0000644000175000017500000001216111022514303014311 0ustar mhattamhatta1.5 $B$G$Nr7o8!:w%$%s%G%C%/%9$O8!:w8l$NKvHx$r@Z$j5M$a!"(B $B8eJ}0lCW%$%s%G%C%/%9$O@hF,$r@Z$j5M$a$FEPO?$9$k$h$&$K$7$?!#(B * JPEG$B2hA|$KBP1~$7$?!#(B FreePWING::BaseText$B%/%i%9$K(Badd_jpeg_graphic_start $B$*$h$S(B add_jpeg_graphic_end $B%a%=%C%I$r?7@_$7$?!#(B * $B2;@<%G!<%?$KBP1~$7$?!#(B ($B$5$H$_$5$s:n$N2;@<%G!<%?BP1~%Q%C%A$rl9g!"IT@5$J(Bcatalogs.txt$B$r@8@.$7$F$7$^$&IT6q9g$r(B $B=$@5$7$?!#(B * Cygwin$B$G(Bfpwmake install$B$,DL$i$J$$IT6q9g$r=$@5$7$?!#(B 1.4.4 $B$G$N3Q30;z%U%!%$%kL>$,@5$7$/=hM}$G$-$J$+$C$?IT6q9g$r=$@5$7$?!#(B * $B%I%-%e%a%s%H$rJ,3d$9$k$h$&$K$7$?!#(B 1.4.3 $B$G$Ne0L%$%s%G%C%/%9$KEPO?$5$l$:0z$1$J$/$J$k%P%0(B $B$rD>$7$?!#(B 1.4.1 $B$G$Nr7o8!:w$X$NBP1~!#(B * --with-pkgdocdir $B%*%W%7%g%s$r?7@_$7$?!#(B 1.2.1 $B$G$N$r=q$$$F(B $B$b@5$7$/F0:n$9$k$h$&$K$7$?!#(B * $B:Y$+$J%P%0$r=$@5$7$?!#(B 1.2beta1 $B$G$NO$rDI2C$7$?!#(B Makefile $B$K$h$k%Q%C%1!<%82=$N>O$rDI2C$7$?!#(B 1.1.1 $B$G$NpJs$K$*$1$k!"A0J}0lCW%$%s%G%C%/%9!"8eJ}0lCW%$%s%G%C%/%9$N(B $B!VNN0h%5%$%:!W$,4V0c$C$?CM$K$J$C$F$$$?$H$$$&IT6q9g$r=$@5$7$?!#(B (Macintosh $B$N(B Jamming $B$H(B CeDar $B$GFI$a$k$h$&$9$k$?$a!#(B) * fpwutils.mk $B$K(B perl $B$N%Q%9$,Kd$a9~$^$l$F$*$j!"FbMF$,5!/perl.sh $B$rDI2C$7!"(Bfpwutils.mk $B$G$O$3$l$r;HMQ$9$k$h$&$K$7$?!#(B 1.0.1 $B$G$Ne$K$J$C$?>l9g!"@5$7$$%$%s%G%C%/%9$,@8@.(B $B$5$l$J$$$H$$$&IT6q9g$r=$@5$7$?!#(B freepwing-1.5.orig/configure.ac0000644000175000017500000000272211022404342016103 0ustar mhattamhattadnl * dnl * Process this file with autoconf to produce a configure script. dnl * AC_INIT(freepwing, 1.5) AC_CONFIG_SRCDIR(src/BaseText.pm) AC_PREREQ(2.54) AM_INIT_AUTOMAKE dnl * dnl * --with-pkgdocdir option. dnl * AC_ARG_WITH(pkgdocdir, AC_HELP_STRING([--with-pkgdocdir=DIR], [HTML documents in DIR [[default=DATADIR/freepwing/doc]]]), [pkgdocdir="${withval}"],[pkgdocdir='${datadir}/freepwing/doc']) AC_SUBST(pkgdocdir) dnl * dnl * Perl5 command. dnl * AC_PATH_PROGS(PERL, perl5 perl, no) if test "$PERL" = no ; then AC_MSG_ERROR(perl5 not found) fi $PERL -e 'close(STDERR); require 5.005' if test $? -ne 0 ; then AC_MSG_ERROR($PERL is older than version 5.005) fi AC_ARG_WITH(perllibdir, AC_HELP_STRING([--with-perllibdir=DIR], [Perl5 modules in DIR]), [perllibdir="${withval}"], [perllibdir="`$PERL -e 'for(@INC){print,exit if m|/site_perl|}print $INC[[0]]'`"]) AC_MSG_CHECKING(for Perl5 module directory) AC_MSG_RESULT($perllibdir) AC_SUBST(perllibdir) dnl * dnl * sort command. dnl * AC_PATH_PROGS(SORT, sort, no) if test "$SORT" = no ; then AC_MSG_ERROR(sort not found) fi dnl * dnl * GNU make command. dnl * AC_PATH_PROGS(GNUMAKE, gnumake gmake make, no) if test "$GNUMAKE" = no ; then AC_MSG_ERROR(GNU make not found) fi $GNUMAKE --help > /dev/null if test $? -ne 0 ; then AC_MSG_ERROR($GNUMAKE is not GNU make) fi dnl * dnl * Output Files. dnl * AC_CONFIG_FILES([Makefile src/Makefile fpwutils/Makefile doc/Makefile catdump/Makefile]) AC_OUTPUT freepwing-1.5.orig/aclocal.m40000644000175000017500000004734511022411533015467 0ustar mhattamhatta# generated automatically by aclocal 1.10 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_if(m4_PACKAGE_VERSION, [2.61],, [m4_fatal([this file was generated for autoconf 2.61. You have another version of autoconf. If you want to use that, you should regenerate the build system entirely.], [63])]) # Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.10], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10])dnl _AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR freepwing-1.5.orig/install-sh0000755000175000017500000002244111022404342015621 0ustar mhattamhatta#!/bin/sh # install - install a program, script, or datafile scriptversion=2004-04-01.17 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename= transform_arg= instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= usage="Usage: $0 [OPTION]... SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 -d DIRECTORIES... In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default. In the second, create the directory path DIR. Options: -b=TRANSFORMBASENAME -c copy source (using $cpprog) instead of moving (using $mvprog). -d create directories instead of installing files. -g GROUP $chgrp installed files to GROUP. -m MODE $chmod installed files to MODE. -o USER $chown installed files to USER. -s strip installed files (using $stripprog). -t=TRANSFORM --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; -c) instcmd=$cpprog shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit 0;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; --version) echo "$0 $scriptversion"; exit 0;; *) # When -d is used, all remaining arguments are directories to create. test -n "$dir_arg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then instcmd=: chmodcmd= else instcmd=$mkdirprog fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" || lasterr=$? # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test ! -d "$pathcomp" && { (exit ${lasterr-1}); exit; } fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $instcmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else # If we're going to rename the final executable, determine the name now. if test -z "$transformarg"; then dstfile=`basename "$dst"` else dstfile=`basename "$dst" $transformbasename \ | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename. test -z "$dstfile" && dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 trap '(exit $?); exit' 1 2 13 15 # Move or copy the file name to the temp name $doit $instcmd "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: