commit 85f73f180fac3ba520a5ea38687496e931b942fe Author: Valeriano A.R Date: Wed Apr 11 00:00:00 2007 +0200 (2007-04-11) Kable-distro diff --git a/FHS-lfs-20060531.tar.bz2 b/FHS-lfs-20060531.tar.bz2 new file mode 100644 index 0000000..b667f07 Binary files /dev/null and b/FHS-lfs-20060531.tar.bz2 differ diff --git a/base-pkgs/XML_Parser-2.34.tar.bz2 b/base-pkgs/XML_Parser-2.34.tar.bz2 new file mode 100644 index 0000000..5c19fe1 Binary files /dev/null and b/base-pkgs/XML_Parser-2.34.tar.bz2 differ diff --git a/base-pkgs/alsa-lib-1.0.11.tar.bz2 b/base-pkgs/alsa-lib-1.0.11.tar.bz2 new file mode 100644 index 0000000..73e0959 Binary files /dev/null and b/base-pkgs/alsa-lib-1.0.11.tar.bz2 differ diff --git a/base-pkgs/alsa-oss-1.0.11.tar.bz2 b/base-pkgs/alsa-oss-1.0.11.tar.bz2 new file mode 100644 index 0000000..fdf3286 Binary files /dev/null and b/base-pkgs/alsa-oss-1.0.11.tar.bz2 differ diff --git a/base-pkgs/alsa-plugins-1.0.11.tar.bz2 b/base-pkgs/alsa-plugins-1.0.11.tar.bz2 new file mode 100644 index 0000000..2b950d0 Binary files /dev/null and b/base-pkgs/alsa-plugins-1.0.11.tar.bz2 differ diff --git a/base-pkgs/alsa-utils-1.0.11.tar.bz2 b/base-pkgs/alsa-utils-1.0.11.tar.bz2 new file mode 100644 index 0000000..da80baf Binary files /dev/null and b/base-pkgs/alsa-utils-1.0.11.tar.bz2 differ diff --git a/base-pkgs/autoconf-2.59.tar.bz2 b/base-pkgs/autoconf-2.59.tar.bz2 new file mode 100644 index 0000000..832788a Binary files /dev/null and b/base-pkgs/autoconf-2.59.tar.bz2 differ diff --git a/base-pkgs/automake-1.9.6.tar.bz2 b/base-pkgs/automake-1.9.6.tar.bz2 new file mode 100644 index 0000000..b5aa20c Binary files /dev/null and b/base-pkgs/automake-1.9.6.tar.bz2 differ diff --git a/base-pkgs/bash-3.1.tar.bz2 b/base-pkgs/bash-3.1.tar.bz2 new file mode 100644 index 0000000..21dfda0 Binary files /dev/null and b/base-pkgs/bash-3.1.tar.bz2 differ diff --git a/base-pkgs/bind-utils-9.3.2.tar.bz2 b/base-pkgs/bind-utils-9.3.2.tar.bz2 new file mode 100644 index 0000000..764c208 Binary files /dev/null and b/base-pkgs/bind-utils-9.3.2.tar.bz2 differ diff --git a/base-pkgs/binutils-2.17.tar.bz2 b/base-pkgs/binutils-2.17.tar.bz2 new file mode 100644 index 0000000..e4ba0be Binary files /dev/null and b/base-pkgs/binutils-2.17.tar.bz2 differ diff --git a/base-pkgs/bison-2.2.tar.bz2 b/base-pkgs/bison-2.2.tar.bz2 new file mode 100644 index 0000000..974cef1 Binary files /dev/null and b/base-pkgs/bison-2.2.tar.bz2 differ diff --git a/base-pkgs/bzip2-1.0.3.tar.bz2 b/base-pkgs/bzip2-1.0.3.tar.bz2 new file mode 100644 index 0000000..a975fce Binary files /dev/null and b/base-pkgs/bzip2-1.0.3.tar.bz2 differ diff --git a/base-pkgs/coreutils-5.96.tar.bz2 b/base-pkgs/coreutils-5.96.tar.bz2 new file mode 100644 index 0000000..b302fdb Binary files /dev/null and b/base-pkgs/coreutils-5.96.tar.bz2 differ diff --git a/base-pkgs/cvs-1.11.21.tar.bz2 b/base-pkgs/cvs-1.11.21.tar.bz2 new file mode 100644 index 0000000..a4b1112 Binary files /dev/null and b/base-pkgs/cvs-1.11.21.tar.bz2 differ diff --git a/base-pkgs/db-4.4.20.tar.bz2 b/base-pkgs/db-4.4.20.tar.bz2 new file mode 100644 index 0000000..8f51a2c Binary files /dev/null and b/base-pkgs/db-4.4.20.tar.bz2 differ diff --git a/base-pkgs/diffutils-2.8.1.tar.bz2 b/base-pkgs/diffutils-2.8.1.tar.bz2 new file mode 100644 index 0000000..adbd84f Binary files /dev/null and b/base-pkgs/diffutils-2.8.1.tar.bz2 differ diff --git a/base-pkgs/e2fsprogs-1.38.tar.bz2 b/base-pkgs/e2fsprogs-1.38.tar.bz2 new file mode 100644 index 0000000..f848136 Binary files /dev/null and b/base-pkgs/e2fsprogs-1.38.tar.bz2 differ diff --git a/base-pkgs/expat-2.0.0.tar.bz2 b/base-pkgs/expat-2.0.0.tar.bz2 new file mode 100644 index 0000000..a8efa03 Binary files /dev/null and b/base-pkgs/expat-2.0.0.tar.bz2 differ diff --git a/base-pkgs/file-4.17.tar.bz2 b/base-pkgs/file-4.17.tar.bz2 new file mode 100644 index 0000000..b2a3846 Binary files /dev/null and b/base-pkgs/file-4.17.tar.bz2 differ diff --git a/base-pkgs/findutils-4.2.27.tar.bz2 b/base-pkgs/findutils-4.2.27.tar.bz2 new file mode 100644 index 0000000..9501143 Binary files /dev/null and b/base-pkgs/findutils-4.2.27.tar.bz2 differ diff --git a/base-pkgs/flex-2.5.33.tar.bz2 b/base-pkgs/flex-2.5.33.tar.bz2 new file mode 100644 index 0000000..57aa474 Binary files /dev/null and b/base-pkgs/flex-2.5.33.tar.bz2 differ diff --git a/base-pkgs/fuse-2.5.3.tar.bz2 b/base-pkgs/fuse-2.5.3.tar.bz2 new file mode 100644 index 0000000..b1cbe73 Binary files /dev/null and b/base-pkgs/fuse-2.5.3.tar.bz2 differ diff --git a/base-pkgs/gawk-3.1.5.tar.bz2 b/base-pkgs/gawk-3.1.5.tar.bz2 new file mode 100644 index 0000000..ce49ddf Binary files /dev/null and b/base-pkgs/gawk-3.1.5.tar.bz2 differ diff --git a/base-pkgs/gcc-3.3.6-opt.tar.bz2 b/base-pkgs/gcc-3.3.6-opt.tar.bz2 new file mode 100644 index 0000000..c7b7352 Binary files /dev/null and b/base-pkgs/gcc-3.3.6-opt.tar.bz2 differ diff --git a/base-pkgs/gcc-4.0.3.tar.bz2 b/base-pkgs/gcc-4.0.3.tar.bz2 new file mode 100644 index 0000000..08bdd5b Binary files /dev/null and b/base-pkgs/gcc-4.0.3.tar.bz2 differ diff --git a/base-pkgs/gdb-6.4.tar.bz2 b/base-pkgs/gdb-6.4.tar.bz2 new file mode 100644 index 0000000..33bbf42 Binary files /dev/null and b/base-pkgs/gdb-6.4.tar.bz2 differ diff --git a/base-pkgs/gettext-0.14.5.tar.bz2 b/base-pkgs/gettext-0.14.5.tar.bz2 new file mode 100644 index 0000000..ebd9a96 Binary files /dev/null and b/base-pkgs/gettext-0.14.5.tar.bz2 differ diff --git a/base-pkgs/git-1.4.2.tar.bz2 b/base-pkgs/git-1.4.2.tar.bz2 new file mode 100644 index 0000000..18cdf8f Binary files /dev/null and b/base-pkgs/git-1.4.2.tar.bz2 differ diff --git a/base-pkgs/glibc-2.3.6.tar.bz2 b/base-pkgs/glibc-2.3.6.tar.bz2 new file mode 100644 index 0000000..9779b4a Binary files /dev/null and b/base-pkgs/glibc-2.3.6.tar.bz2 differ diff --git a/base-pkgs/gpm-1.20.1.tar.bz2 b/base-pkgs/gpm-1.20.1.tar.bz2 new file mode 100644 index 0000000..e4a0f7d Binary files /dev/null and b/base-pkgs/gpm-1.20.1.tar.bz2 differ diff --git a/base-pkgs/grep-2.5.1a.tar.bz2 b/base-pkgs/grep-2.5.1a.tar.bz2 new file mode 100644 index 0000000..40d56a3 Binary files /dev/null and b/base-pkgs/grep-2.5.1a.tar.bz2 differ diff --git a/base-pkgs/groff-1.18.1.1.tar.bz2 b/base-pkgs/groff-1.18.1.1.tar.bz2 new file mode 100644 index 0000000..11fbe41 Binary files /dev/null and b/base-pkgs/groff-1.18.1.1.tar.bz2 differ diff --git a/base-pkgs/grub-0.97.tar.bz2 b/base-pkgs/grub-0.97.tar.bz2 new file mode 100644 index 0000000..8842e98 Binary files /dev/null and b/base-pkgs/grub-0.97.tar.bz2 differ diff --git a/base-pkgs/gzip-1.3.5.tar.bz2 b/base-pkgs/gzip-1.3.5.tar.bz2 new file mode 100644 index 0000000..b77470a Binary files /dev/null and b/base-pkgs/gzip-1.3.5.tar.bz2 differ diff --git a/base-pkgs/hdparm-6.6.tar.bz2 b/base-pkgs/hdparm-6.6.tar.bz2 new file mode 100644 index 0000000..316daf2 Binary files /dev/null and b/base-pkgs/hdparm-6.6.tar.bz2 differ diff --git a/base-pkgs/iana-etc-2.10.tar.bz2 b/base-pkgs/iana-etc-2.10.tar.bz2 new file mode 100644 index 0000000..eabb0b0 Binary files /dev/null and b/base-pkgs/iana-etc-2.10.tar.bz2 differ diff --git a/base-pkgs/inetutils-1.4.2.tar.bz2 b/base-pkgs/inetutils-1.4.2.tar.bz2 new file mode 100644 index 0000000..10b938f Binary files /dev/null and b/base-pkgs/inetutils-1.4.2.tar.bz2 differ diff --git a/base-pkgs/iproute2-2.6.16-060323.tar.bz2 b/base-pkgs/iproute2-2.6.16-060323.tar.bz2 new file mode 100644 index 0000000..705ce31 Binary files /dev/null and b/base-pkgs/iproute2-2.6.16-060323.tar.bz2 differ diff --git a/base-pkgs/kbd-1.12.tar.bz2 b/base-pkgs/kbd-1.12.tar.bz2 new file mode 100644 index 0000000..69fab77 Binary files /dev/null and b/base-pkgs/kbd-1.12.tar.bz2 differ diff --git a/base-pkgs/less-394.tar.bz2 b/base-pkgs/less-394.tar.bz2 new file mode 100644 index 0000000..01dbffd Binary files /dev/null and b/base-pkgs/less-394.tar.bz2 differ diff --git a/base-pkgs/libpcap-0.9.5.tar.bz2 b/base-pkgs/libpcap-0.9.5.tar.bz2 new file mode 100644 index 0000000..f156a56 Binary files /dev/null and b/base-pkgs/libpcap-0.9.5.tar.bz2 differ diff --git a/base-pkgs/libtool-1.5.22.tar.bz2 b/base-pkgs/libtool-1.5.22.tar.bz2 new file mode 100644 index 0000000..83a2a9f Binary files /dev/null and b/base-pkgs/libtool-1.5.22.tar.bz2 differ diff --git a/base-pkgs/libusb-0.1.12.tar.bz2 b/base-pkgs/libusb-0.1.12.tar.bz2 new file mode 100644 index 0000000..4b1b817 Binary files /dev/null and b/base-pkgs/libusb-0.1.12.tar.bz2 differ diff --git a/base-pkgs/linux-libc-headers-2.6.12.0.tar.bz2 b/base-pkgs/linux-libc-headers-2.6.12.0.tar.bz2 new file mode 100644 index 0000000..9e7779e Binary files /dev/null and b/base-pkgs/linux-libc-headers-2.6.12.0.tar.bz2 differ diff --git a/base-pkgs/lsof-4.77.tar.bz2 b/base-pkgs/lsof-4.77.tar.bz2 new file mode 100644 index 0000000..de5fd73 Binary files /dev/null and b/base-pkgs/lsof-4.77.tar.bz2 differ diff --git a/base-pkgs/m4-1.4.4.tar.bz2 b/base-pkgs/m4-1.4.4.tar.bz2 new file mode 100644 index 0000000..777b7d1 Binary files /dev/null and b/base-pkgs/m4-1.4.4.tar.bz2 differ diff --git a/base-pkgs/make-3.80.tar.bz2 b/base-pkgs/make-3.80.tar.bz2 new file mode 100644 index 0000000..8b539d7 Binary files /dev/null and b/base-pkgs/make-3.80.tar.bz2 differ diff --git a/base-pkgs/man-db-2.4.3.tar.bz2 b/base-pkgs/man-db-2.4.3.tar.bz2 new file mode 100644 index 0000000..b7ce005 Binary files /dev/null and b/base-pkgs/man-db-2.4.3.tar.bz2 differ diff --git a/base-pkgs/man-pages-2.33.tar.bz2 b/base-pkgs/man-pages-2.33.tar.bz2 new file mode 100644 index 0000000..bf4bfbc Binary files /dev/null and b/base-pkgs/man-pages-2.33.tar.bz2 differ diff --git a/base-pkgs/mkdosfstools-2.11.tar.bz2 b/base-pkgs/mkdosfstools-2.11.tar.bz2 new file mode 100644 index 0000000..b286e22 Binary files /dev/null and b/base-pkgs/mkdosfstools-2.11.tar.bz2 differ diff --git a/base-pkgs/mktemp-1.5.tar.bz2 b/base-pkgs/mktemp-1.5.tar.bz2 new file mode 100644 index 0000000..3f9b3f5 Binary files /dev/null and b/base-pkgs/mktemp-1.5.tar.bz2 differ diff --git a/base-pkgs/module-init-tools-3.2.2.tar.bz2 b/base-pkgs/module-init-tools-3.2.2.tar.bz2 new file mode 100644 index 0000000..7c0a8ca Binary files /dev/null and b/base-pkgs/module-init-tools-3.2.2.tar.bz2 differ diff --git a/base-pkgs/nasm-0.98.39.tar.bz2 b/base-pkgs/nasm-0.98.39.tar.bz2 new file mode 100644 index 0000000..556d534 Binary files /dev/null and b/base-pkgs/nasm-0.98.39.tar.bz2 differ diff --git a/base-pkgs/ncurses-5.5.tar.bz2 b/base-pkgs/ncurses-5.5.tar.bz2 new file mode 100644 index 0000000..6c06a98 Binary files /dev/null and b/base-pkgs/ncurses-5.5.tar.bz2 differ diff --git a/base-pkgs/net-tools-1.60.tar.bz2 b/base-pkgs/net-tools-1.60.tar.bz2 new file mode 100644 index 0000000..6c34060 Binary files /dev/null and b/base-pkgs/net-tools-1.60.tar.bz2 differ diff --git a/base-pkgs/netcat-0.7.1.tar.bz2 b/base-pkgs/netcat-0.7.1.tar.bz2 new file mode 100644 index 0000000..2af1e53 Binary files /dev/null and b/base-pkgs/netcat-0.7.1.tar.bz2 differ diff --git a/base-pkgs/nmap-4.11.tar.bz2 b/base-pkgs/nmap-4.11.tar.bz2 new file mode 100644 index 0000000..26824f7 Binary files /dev/null and b/base-pkgs/nmap-4.11.tar.bz2 differ diff --git a/base-pkgs/ntfs-3g-20070714-BETA.tar.bz2 b/base-pkgs/ntfs-3g-20070714-BETA.tar.bz2 new file mode 100644 index 0000000..7ea817e Binary files /dev/null and b/base-pkgs/ntfs-3g-20070714-BETA.tar.bz2 differ diff --git a/base-pkgs/openssh-4.3p2.tar.bz2 b/base-pkgs/openssh-4.3p2.tar.bz2 new file mode 100644 index 0000000..3f424c7 Binary files /dev/null and b/base-pkgs/openssh-4.3p2.tar.bz2 differ diff --git a/base-pkgs/openssl-0.9.8b.tar.bz2 b/base-pkgs/openssl-0.9.8b.tar.bz2 new file mode 100644 index 0000000..9e22368 Binary files /dev/null and b/base-pkgs/openssl-0.9.8b.tar.bz2 differ diff --git a/base-pkgs/patch-2.5.4.tar.bz2 b/base-pkgs/patch-2.5.4.tar.bz2 new file mode 100644 index 0000000..ea2b811 Binary files /dev/null and b/base-pkgs/patch-2.5.4.tar.bz2 differ diff --git a/base-pkgs/pciutils-2.2.3.tar.bz2 b/base-pkgs/pciutils-2.2.3.tar.bz2 new file mode 100644 index 0000000..0abb80c Binary files /dev/null and b/base-pkgs/pciutils-2.2.3.tar.bz2 differ diff --git a/base-pkgs/perl-5.8.8.tar.bz2 b/base-pkgs/perl-5.8.8.tar.bz2 new file mode 100644 index 0000000..0522701 Binary files /dev/null and b/base-pkgs/perl-5.8.8.tar.bz2 differ diff --git a/base-pkgs/pkg-config-0.20.tar.bz2 b/base-pkgs/pkg-config-0.20.tar.bz2 new file mode 100644 index 0000000..7f2bace Binary files /dev/null and b/base-pkgs/pkg-config-0.20.tar.bz2 differ diff --git a/base-pkgs/procps-3.2.6.tar.bz2 b/base-pkgs/procps-3.2.6.tar.bz2 new file mode 100644 index 0000000..455b796 Binary files /dev/null and b/base-pkgs/procps-3.2.6.tar.bz2 differ diff --git a/base-pkgs/proftpd-1.3.0.tar.bz2 b/base-pkgs/proftpd-1.3.0.tar.bz2 new file mode 100644 index 0000000..3b08354 Binary files /dev/null and b/base-pkgs/proftpd-1.3.0.tar.bz2 differ diff --git a/base-pkgs/psmisc-22.2.tar.bz2 b/base-pkgs/psmisc-22.2.tar.bz2 new file mode 100644 index 0000000..065246f Binary files /dev/null and b/base-pkgs/psmisc-22.2.tar.bz2 differ diff --git a/base-pkgs/python-2.4.3.tar.bz2 b/base-pkgs/python-2.4.3.tar.bz2 new file mode 100644 index 0000000..c0b701c Binary files /dev/null and b/base-pkgs/python-2.4.3.tar.bz2 differ diff --git a/base-pkgs/readline-5.1.tar.bz2 b/base-pkgs/readline-5.1.tar.bz2 new file mode 100644 index 0000000..f3f8148 Binary files /dev/null and b/base-pkgs/readline-5.1.tar.bz2 differ diff --git a/base-pkgs/sed-4.1.5.tar.bz2 b/base-pkgs/sed-4.1.5.tar.bz2 new file mode 100644 index 0000000..2a31e3b Binary files /dev/null and b/base-pkgs/sed-4.1.5.tar.bz2 differ diff --git a/base-pkgs/setserial-2.17.tar.bz2 b/base-pkgs/setserial-2.17.tar.bz2 new file mode 100644 index 0000000..ea064aa Binary files /dev/null and b/base-pkgs/setserial-2.17.tar.bz2 differ diff --git a/base-pkgs/shadow-4.0.15.tar.bz2 b/base-pkgs/shadow-4.0.15.tar.bz2 new file mode 100644 index 0000000..4645ff0 Binary files /dev/null and b/base-pkgs/shadow-4.0.15.tar.bz2 differ diff --git a/base-pkgs/sshfs-fuse-1.6.tar.bz2 b/base-pkgs/sshfs-fuse-1.6.tar.bz2 new file mode 100644 index 0000000..a809e3c Binary files /dev/null and b/base-pkgs/sshfs-fuse-1.6.tar.bz2 differ diff --git a/base-pkgs/subversion-1.3.2.tar.bz2 b/base-pkgs/subversion-1.3.2.tar.bz2 new file mode 100644 index 0000000..56ab83e Binary files /dev/null and b/base-pkgs/subversion-1.3.2.tar.bz2 differ diff --git a/base-pkgs/sysklogd-1.4.1.tar.bz2 b/base-pkgs/sysklogd-1.4.1.tar.bz2 new file mode 100644 index 0000000..0c38b79 Binary files /dev/null and b/base-pkgs/sysklogd-1.4.1.tar.bz2 differ diff --git a/base-pkgs/sysvinit-2.86.tar.bz2 b/base-pkgs/sysvinit-2.86.tar.bz2 new file mode 100644 index 0000000..20ccf90 Binary files /dev/null and b/base-pkgs/sysvinit-2.86.tar.bz2 differ diff --git a/base-pkgs/tar-1.15.1.tar.bz2 b/base-pkgs/tar-1.15.1.tar.bz2 new file mode 100644 index 0000000..861bfe6 Binary files /dev/null and b/base-pkgs/tar-1.15.1.tar.bz2 differ diff --git a/base-pkgs/tcpdump-3.9.5.tar.bz2 b/base-pkgs/tcpdump-3.9.5.tar.bz2 new file mode 100644 index 0000000..2255f90 Binary files /dev/null and b/base-pkgs/tcpdump-3.9.5.tar.bz2 differ diff --git a/base-pkgs/texinfo-4.8.tar.bz2 b/base-pkgs/texinfo-4.8.tar.bz2 new file mode 100644 index 0000000..74b2bc0 Binary files /dev/null and b/base-pkgs/texinfo-4.8.tar.bz2 differ diff --git a/base-pkgs/traceroute-1.4a12.tar.bz2 b/base-pkgs/traceroute-1.4a12.tar.bz2 new file mode 100644 index 0000000..98fcd9a Binary files /dev/null and b/base-pkgs/traceroute-1.4a12.tar.bz2 differ diff --git a/base-pkgs/udev-092.tar.bz2 b/base-pkgs/udev-092.tar.bz2 new file mode 100644 index 0000000..8a83b70 Binary files /dev/null and b/base-pkgs/udev-092.tar.bz2 differ diff --git a/base-pkgs/unzip-5.52.tar.bz2 b/base-pkgs/unzip-5.52.tar.bz2 new file mode 100644 index 0000000..c8f5937 Binary files /dev/null and b/base-pkgs/unzip-5.52.tar.bz2 differ diff --git a/base-pkgs/usbutils-0.72.tar.bz2 b/base-pkgs/usbutils-0.72.tar.bz2 new file mode 100644 index 0000000..79803c5 Binary files /dev/null and b/base-pkgs/usbutils-0.72.tar.bz2 differ diff --git a/base-pkgs/util-linux-2.12r.tar.bz2 b/base-pkgs/util-linux-2.12r.tar.bz2 new file mode 100644 index 0000000..154659d Binary files /dev/null and b/base-pkgs/util-linux-2.12r.tar.bz2 differ diff --git a/base-pkgs/vim-7.0.tar.bz2 b/base-pkgs/vim-7.0.tar.bz2 new file mode 100644 index 0000000..02db191 Binary files /dev/null and b/base-pkgs/vim-7.0.tar.bz2 differ diff --git a/base-pkgs/wget-1.10.2.tar.bz2 b/base-pkgs/wget-1.10.2.tar.bz2 new file mode 100644 index 0000000..5370192 Binary files /dev/null and b/base-pkgs/wget-1.10.2.tar.bz2 differ diff --git a/base-pkgs/whois-4.7.14.tar.bz2 b/base-pkgs/whois-4.7.14.tar.bz2 new file mode 100644 index 0000000..0d45c52 Binary files /dev/null and b/base-pkgs/whois-4.7.14.tar.bz2 differ diff --git a/base-pkgs/wireless_tools.28.tar.bz2 b/base-pkgs/wireless_tools.28.tar.bz2 new file mode 100644 index 0000000..873a0f2 Binary files /dev/null and b/base-pkgs/wireless_tools.28.tar.bz2 differ diff --git a/base-pkgs/zip-2.31.tar.bz2 b/base-pkgs/zip-2.31.tar.bz2 new file mode 100644 index 0000000..b6318bc Binary files /dev/null and b/base-pkgs/zip-2.31.tar.bz2 differ diff --git a/base-pkgs/zlib-1.2.3.tar.bz2 b/base-pkgs/zlib-1.2.3.tar.bz2 new file mode 100644 index 0000000..5710835 Binary files /dev/null and b/base-pkgs/zlib-1.2.3.tar.bz2 differ diff --git a/base-source/Python-2.4.3.tar.bz2 b/base-source/Python-2.4.3.tar.bz2 new file mode 100644 index 0000000..542394a Binary files /dev/null and b/base-source/Python-2.4.3.tar.bz2 differ diff --git a/base-source/XML-Parser-2.34.tar.gz b/base-source/XML-Parser-2.34.tar.gz new file mode 100644 index 0000000..107066b Binary files /dev/null and b/base-source/XML-Parser-2.34.tar.gz differ diff --git a/base-source/alsa-lib-1.0.11.tar.bz2 b/base-source/alsa-lib-1.0.11.tar.bz2 new file mode 100644 index 0000000..4f9cdaf Binary files /dev/null and b/base-source/alsa-lib-1.0.11.tar.bz2 differ diff --git a/base-source/alsa-oss-1.0.11.tar.bz2 b/base-source/alsa-oss-1.0.11.tar.bz2 new file mode 100644 index 0000000..19c5d50 Binary files /dev/null and b/base-source/alsa-oss-1.0.11.tar.bz2 differ diff --git a/base-source/alsa-plugins-1.0.11.tar.bz2 b/base-source/alsa-plugins-1.0.11.tar.bz2 new file mode 100644 index 0000000..f2c0b24 Binary files /dev/null and b/base-source/alsa-plugins-1.0.11.tar.bz2 differ diff --git a/base-source/alsa-utils-1.0.11.tar.bz2 b/base-source/alsa-utils-1.0.11.tar.bz2 new file mode 100644 index 0000000..df82e31 Binary files /dev/null and b/base-source/alsa-utils-1.0.11.tar.bz2 differ diff --git a/base-source/autoconf-2.59.tar.bz2 b/base-source/autoconf-2.59.tar.bz2 new file mode 100644 index 0000000..5959749 Binary files /dev/null and b/base-source/autoconf-2.59.tar.bz2 differ diff --git a/base-source/automake-1.9.6.tar.bz2 b/base-source/automake-1.9.6.tar.bz2 new file mode 100644 index 0000000..d0608f6 Binary files /dev/null and b/base-source/automake-1.9.6.tar.bz2 differ diff --git a/base-source/bash-3.1-fixes-8.patch b/base-source/bash-3.1-fixes-8.patch new file mode 100644 index 0000000..449f076 --- /dev/null +++ b/base-source/bash-3.1-fixes-8.patch @@ -0,0 +1,723 @@ +Submitted By: Jeremy Huntwork (jhuntwork at linuxfromscratch dot org) +Date: 2006-04-11 +Initial Package Version: 3.1 +Origin: http://ftp.gnu.org/gnu/bash/bash-3.1-patches/ +Upstream Status: From Upstream +Description: Contains patches 001-017 from upstream + +diff -Naur bash-3.1.orig/arrayfunc.c bash-3.1/arrayfunc.c +--- bash-3.1.orig/arrayfunc.c 2005-07-04 17:25:58.000000000 -0700 ++++ bash-3.1/arrayfunc.c 2006-04-19 15:59:29.000000000 -0700 +@@ -592,11 +592,7 @@ + exp = (char *)xmalloc (len); + strncpy (exp, s, len - 1); + exp[len - 1] = '\0'; +-#if 0 +- t = expand_string_to_string (exp, 0); +-#else +- t = expand_string_to_string (exp, Q_DOUBLE_QUOTES); +-#endif ++ t = expand_arith_string (exp, 0); + this_command_name = (char *)NULL; + val = evalexp (t, &expok); + free (t); +diff -Naur bash-3.1.orig/doc/bash.1 bash-3.1/doc/bash.1 +--- bash-3.1.orig/doc/bash.1 2005-10-12 08:40:52.000000000 -0700 ++++ bash-3.1/doc/bash.1 2006-04-19 15:58:34.000000000 -0700 +@@ -6,12 +6,12 @@ + .\" Case Western Reserve University + .\" chet@po.cwru.edu + .\" +-.\" Last Change: Sat Aug 27 13:28:44 EDT 2005 ++.\" Last Change: Wed Dec 28 19:58:45 EST 2005 + .\" + .\" bash_builtins, strip all but Built-Ins section + .if \n(zZ=1 .ig zZ + .if \n(zY=1 .ig zY +-.TH BASH 1 "2005 Aug 27" "GNU Bash-3.1-beta1" ++.TH BASH 1 "2005 Dec 28" "GNU Bash-3.1" + .\" + .\" There's some problem with having a `@' + .\" in a tagged paragraph with the BSD man macros. +@@ -677,8 +677,8 @@ + .B nocasematch + is enabled, the match is performed without regard to the case + of alphabetic characters. +-The return value is 0 if the string matches or does not match +-the pattern, respectively, and 1 otherwise. ++The return value is 0 if the string matches (\fB==\fP) or does not match ++(\fB!=\fP) the pattern, and 1 otherwise. + Any part of the pattern may be quoted to force it to be matched as a + string. + .if t .sp 0.5 +@@ -807,6 +807,12 @@ + as for pathname expansion (see + .B Pathname Expansion + below). ++The \fIword\fP is expanded using tilde ++expansion, parameter and variable expansion, arithmetic substituion, ++command substitution, process substitution and quote removal. ++Each \fIpattern\fP examined is expanded using tilde ++expansion, parameter and variable expansion, arithmetic substituion, ++command substitution, and process substitution. + If the shell option + .B nocasematch + is enabled, the match is performed without regard to the case +@@ -8484,7 +8490,7 @@ + returns true if any of the arguments are found, false if + none are found. + .TP +-\fBulimit\fP [\fB\-SHacdflmnpstuv\fP [\fIlimit\fP]] ++\fBulimit\fP [\fB\-SHacdfilmnpqstuvx\fP [\fIlimit\fP]] + Provides control over the resources available to the shell and to + processes started by it, on systems that allow such control. + The \fB\-H\fP and \fB\-S\fP options specify that the hard or soft limit is +@@ -8523,6 +8529,9 @@ + .B \-f + The maximum size of files created by the shell + .TP ++.B \-i ++The maximum number of pending signals ++.TP + .B \-l + The maximum size that may be locked into memory + .TP +@@ -8536,6 +8545,9 @@ + .B \-p + The pipe size in 512-byte blocks (this may not be set) + .TP ++.B \-q ++The maximum number of bytes in POSIX message queues ++.TP + .B \-s + The maximum stack size + .TP +@@ -8547,6 +8559,9 @@ + .TP + .B \-v + The maximum amount of virtual memory available to the shell ++.TP ++.B \-x ++The maximum number of file locks + .PD + .PP + If +diff -Naur bash-3.1.orig/doc/bashref.texi bash-3.1/doc/bashref.texi +--- bash-3.1.orig/doc/bashref.texi 2005-10-03 12:07:21.000000000 -0700 ++++ bash-3.1/doc/bashref.texi 2006-04-19 15:58:34.000000000 -0700 +@@ -961,8 +961,8 @@ + (see the description of @code{shopt} in @ref{Bash Builtins}) + is enabled, the match is performed without regard to the case + of alphabetic characters. +-The return value is 0 if the string matches or does not match +-the pattern, respectively, and 1 otherwise. ++The return value is 0 if the string matches (@samp{==}) or does not ++match (@samp{!=})the pattern, and 1 otherwise. + Any part of the pattern may be quoted to force it to be matched as a + string. + +@@ -2598,7 +2598,7 @@ + Builtin commands are necessary to implement functionality impossible + or inconvenient to obtain with separate utilities. + +-This section briefly the builtins which Bash inherits from ++This section briefly describes the builtins which Bash inherits from + the Bourne Shell, as well as the builtin commands which are unique + to or have been extended in Bash. + +@@ -3833,7 +3833,7 @@ + @item ulimit + @btindex ulimit + @example +-ulimit [-acdflmnpstuvSH] [@var{limit}] ++ulimit [-acdfilmnpqstuvxSH] [@var{limit}] + @end example + @code{ulimit} provides control over the resources available to processes + started by the shell, on systems that allow such control. If an +@@ -3857,6 +3857,9 @@ + @item -f + The maximum size of files created by the shell. + ++@item -i ++The maximum number of pending signals. ++ + @item -l + The maximum size that may be locked into memory. + +@@ -3869,6 +3872,9 @@ + @item -p + The pipe buffer size. + ++@item -q ++The maximum number of bytes in POSIX message queues. ++ + @item -s + The maximum stack size. + +@@ -3881,6 +3887,9 @@ + @item -v + The maximum amount of virtual memory available to the process. + ++@item -x ++The maximum number of file locks. ++ + @end table + + If @var{limit} is given, it is the new value of the specified resource; +@@ -4089,8 +4098,8 @@ + Print shell input lines as they are read. + + @item -x +-Print a trace of simple commands, \fBfor\fP commands, \fBcase\fP +-commands, \fBselect\fP commands, and arithmetic \fBfor\fP commands ++Print a trace of simple commands, @code{for} commands, @code{case} ++commands, @code{select} commands, and arithmetic @code{for} commands + and their arguments or associated word lists after they are + expanded and before they are executed. The value of the @env{PS4} + variable is expanded and the resultant value is printed before +diff -Naur bash-3.1.orig/doc/version.texi bash-3.1/doc/version.texi +--- bash-3.1.orig/doc/version.texi 2005-09-20 11:52:56.000000000 -0700 ++++ bash-3.1/doc/version.texi 2006-04-19 15:58:34.000000000 -0700 +@@ -2,9 +2,9 @@ + Copyright (C) 1988-2005 Free Software Foundation, Inc. + @end ignore + +-@set LASTCHANGE Mon Sep 5 11:47:04 EDT 2005 ++@set LASTCHANGE Fri Dec 30 10:50:51 EST 2005 + +-@set EDITION 3.1-beta1 +-@set VERSION 3.1-beta1 +-@set UPDATED 5 September 2005 +-@set UPDATED-MONTH September 2005 ++@set EDITION 3.1 ++@set VERSION 3.1 ++@set UPDATED 30 December 2005 ++@set UPDATED-MONTH December 2005 +diff -Naur bash-3.1.orig/jobs.c bash-3.1/jobs.c +--- bash-3.1.orig/jobs.c 2005-11-11 20:13:27.000000000 -0800 ++++ bash-3.1/jobs.c 2006-04-19 15:58:34.000000000 -0700 +@@ -619,8 +619,11 @@ + * once in the parent and once in each child. This is where + * the parent gives it away. + * ++ * Don't give the terminal away if this shell is an asynchronous ++ * subshell. ++ * + */ +- if (job_control && newjob->pgrp) ++ if (job_control && newjob->pgrp && (subshell_environment&SUBSHELL_ASYNC) == 0) + give_terminal_to (newjob->pgrp, 0); + } + } +@@ -844,9 +847,10 @@ + realloc_jobs_list () + { + sigset_t set, oset; +- int nsize, i, j; ++ int nsize, i, j, ncur, nprev; + JOB **nlist; + ++ ncur = nprev = NO_JOB; + nsize = ((js.j_njobs + JOB_SLOTS - 1) / JOB_SLOTS); + nsize *= JOB_SLOTS; + i = js.j_njobs % JOB_SLOTS; +@@ -854,17 +858,51 @@ + nsize += JOB_SLOTS; + + BLOCK_CHILD (set, oset); +- nlist = (JOB **) xmalloc (nsize * sizeof (JOB *)); ++ nlist = (js.j_jobslots == nsize) ? jobs : (JOB **) xmalloc (nsize * sizeof (JOB *)); ++ + for (i = j = 0; i < js.j_jobslots; i++) + if (jobs[i]) +- nlist[j++] = jobs[i]; ++ { ++ if (i == js.j_current) ++ ncur = j; ++ if (i == js.j_previous) ++ nprev = j; ++ nlist[j++] = jobs[i]; ++ } ++ ++#if defined (DEBUG) ++ itrace ("realloc_jobs_list: resize jobs list from %d to %d", js.j_jobslots, nsize); ++ itrace ("realloc_jobs_list: j_lastj changed from %d to %d", js.j_lastj, (j > 0) ? j - 1 : 0); ++ itrace ("realloc_jobs_list: j_njobs changed from %d to %d", js.j_njobs, (j > 0) ? j - 1 : 0); ++#endif + + js.j_firstj = 0; +- js.j_lastj = (j > 0) ? j - 1: 0; ++ js.j_lastj = (j > 0) ? j - 1 : 0; ++ js.j_njobs = j; + js.j_jobslots = nsize; + +- free (jobs); +- jobs = nlist; ++ /* Zero out remaining slots in new jobs list */ ++ for ( ; j < nsize; j++) ++ nlist[j] = (JOB *)NULL; ++ ++ if (jobs != nlist) ++ { ++ free (jobs); ++ jobs = nlist; ++ } ++ ++ if (ncur != NO_JOB) ++ js.j_current = ncur; ++ if (nprev != NO_JOB) ++ js.j_previous = nprev; ++ ++ /* Need to reset these */ ++ if (js.j_current == NO_JOB || js.j_previous == NO_JOB || js.j_current > js.j_lastj || js.j_previous > js.j_lastj) ++ reset_current (); ++ ++#ifdef DEBUG ++ itrace ("realloc_jobs_list: reset js.j_current (%d) and js.j_previous (%d)", js.j_current, js.j_previous); ++#endif + + UNBLOCK_CHILD (oset); + } +@@ -1655,7 +1693,7 @@ + In this case, we don't want to give the terminal to the + shell's process group (we could be in the middle of a + pipeline, for example). */ +- if (async_p == 0 && pipeline_pgrp != shell_pgrp) ++ if (async_p == 0 && pipeline_pgrp != shell_pgrp && ((subshell_environment&SUBSHELL_ASYNC) == 0)) + give_terminal_to (pipeline_pgrp, 0); + + #if defined (PGRP_PIPE) +@@ -2198,7 +2236,11 @@ + /* This is possibly a race condition -- should it go in stop_pipeline? */ + wait_sigint_received = 0; + if (job_control == 0) +- old_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler); ++ { ++ old_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler); ++ if (old_sigint_handler == SIG_IGN) ++ set_signal_handler (SIGINT, old_sigint_handler); ++ } + + termination_state = last_command_exit_value; + +diff -Naur bash-3.1.orig/lib/glob/glob.c bash-3.1/lib/glob/glob.c +--- bash-3.1.orig/lib/glob/glob.c 2005-03-24 09:42:27.000000000 -0800 ++++ bash-3.1/lib/glob/glob.c 2006-04-19 15:58:34.000000000 -0700 +@@ -360,6 +360,7 @@ + count = lose = skip = 0; + + firstmalloc = 0; ++ nalloca = 0; + + /* If PAT is empty, skip the loop, but return one (empty) filename. */ + if (pat == 0 || *pat == '\0') +@@ -546,6 +547,8 @@ + firstmalloc = 0; + tmplink = lastlink; + } ++ else ++ tmplink = 0; + free (lastlink->name); + lastlink = lastlink->next; + FREE (tmplink); +diff -Naur bash-3.1.orig/lib/glob/sm_loop.c bash-3.1/lib/glob/sm_loop.c +--- bash-3.1.orig/lib/glob/sm_loop.c 2005-10-16 18:21:04.000000000 -0700 ++++ bash-3.1/lib/glob/sm_loop.c 2006-04-19 15:58:34.000000000 -0700 +@@ -638,12 +638,13 @@ + CHAR *psub; /* pointer to sub-pattern */ + CHAR *pnext; /* pointer to next sub-pattern */ + CHAR *srest; /* pointer to rest of string */ +- int m1, m2; ++ int m1, m2, xflags; /* xflags = flags passed to recursive matches */ + + #if DEBUG_MATCHING + fprintf(stderr, "extmatch: xc = %c\n", xc); + fprintf(stderr, "extmatch: s = %s; se = %s\n", s, se); + fprintf(stderr, "extmatch: p = %s; pe = %s\n", p, pe); ++fprintf(stderr, "extmatch: flags = %d\n", flags); + #endif + + prest = PATSCAN (p + (*p == L('(')), pe, 0); /* ) */ +@@ -677,8 +678,12 @@ + string matches the rest of the pattern. Also handle + multiple matches of the pattern. */ + if (m1) +- m2 = (GMATCH (srest, se, prest, pe, flags) == 0) || +- (s != srest && GMATCH (srest, se, p - 1, pe, flags) == 0); ++ { ++ /* if srest > s, we are not at start of string */ ++ xflags = (srest > s) ? (flags & ~FNM_PERIOD) : flags; ++ m2 = (GMATCH (srest, se, prest, pe, xflags) == 0) || ++ (s != srest && GMATCH (srest, se, p - 1, pe, xflags) == 0); ++ } + if (m1 && m2) + return (0); + } +@@ -704,8 +709,10 @@ + srest = (prest == pe) ? se : s; + for ( ; srest <= se; srest++) + { ++ /* if srest > s, we are not at start of string */ ++ xflags = (srest > s) ? (flags & ~FNM_PERIOD) : flags; + if (GMATCH (s, srest, psub, pnext - 1, flags) == 0 && +- GMATCH (srest, se, prest, pe, flags) == 0) ++ GMATCH (srest, se, prest, pe, xflags) == 0) + return (0); + } + if (pnext == prest) +@@ -726,7 +733,9 @@ + if (pnext == prest) + break; + } +- if (m1 == 0 && GMATCH (srest, se, prest, pe, flags) == 0) ++ /* if srest > s, we are not at start of string */ ++ xflags = (srest > s) ? (flags & ~FNM_PERIOD) : flags; ++ if (m1 == 0 && GMATCH (srest, se, prest, pe, xflags) == 0) + return (0); + } + return (FNM_NOMATCH); +diff -Naur bash-3.1.orig/lib/readline/display.c bash-3.1/lib/readline/display.c +--- bash-3.1.orig/lib/readline/display.c 2005-11-30 11:05:02.000000000 -0800 ++++ bash-3.1/lib/readline/display.c 2006-04-19 15:58:34.000000000 -0700 +@@ -1983,11 +1983,15 @@ + int pchar; + { + int len; +- char *pmt; ++ char *pmt, *p; + + rl_save_prompt (); + +- if (saved_local_prompt == 0) ++ /* We've saved the prompt, and can do anything with the various prompt ++ strings we need before they're restored. We want the unexpanded ++ portion of the prompt string after any final newline. */ ++ p = rl_prompt ? strrchr (rl_prompt, '\n') : 0; ++ if (p == 0) + { + len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0; + pmt = (char *)xmalloc (len + 2); +@@ -1998,19 +2002,17 @@ + } + else + { +- len = *saved_local_prompt ? strlen (saved_local_prompt) : 0; ++ p++; ++ len = strlen (p); + pmt = (char *)xmalloc (len + 2); + if (len) +- strcpy (pmt, saved_local_prompt); ++ strcpy (pmt, p); + pmt[len] = pchar; + pmt[len+1] = '\0'; +- local_prompt = savestring (pmt); +- prompt_last_invisible = saved_last_invisible; +- prompt_visible_length = saved_visible_length + 1; +- } ++ } + ++ /* will be overwritten by expand_prompt, called from rl_message */ + prompt_physical_chars = saved_physical_chars + 1; +- + return pmt; + } + +diff -Naur bash-3.1.orig/lib/readline/readline.c bash-3.1/lib/readline/readline.c +--- bash-3.1.orig/lib/readline/readline.c 2005-07-04 19:29:35.000000000 -0700 ++++ bash-3.1/lib/readline/readline.c 2006-04-19 15:58:34.000000000 -0700 +@@ -282,6 +282,7 @@ + { + FREE (rl_prompt); + rl_prompt = prompt ? savestring (prompt) : (char *)NULL; ++ rl_display_prompt = rl_prompt ? rl_prompt : ""; + + rl_visible_prompt_length = rl_expand_prompt (rl_prompt); + return 0; +diff -Naur bash-3.1.orig/lib/readline/terminal.c bash-3.1/lib/readline/terminal.c +--- bash-3.1.orig/lib/readline/terminal.c 2005-11-12 17:46:54.000000000 -0800 ++++ bash-3.1/lib/readline/terminal.c 2006-04-19 15:58:34.000000000 -0700 +@@ -122,7 +122,7 @@ + static char *_rl_visible_bell; + + /* Non-zero means the terminal can auto-wrap lines. */ +-int _rl_term_autowrap; ++int _rl_term_autowrap = -1; + + /* Non-zero means that this terminal has a meta key. */ + static int term_has_meta; +@@ -274,6 +274,9 @@ + _rl_set_screen_size (rows, cols) + int rows, cols; + { ++ if (_rl_term_autowrap == -1) ++ _rl_init_terminal_io (rl_terminal_name); ++ + if (rows > 0) + _rl_screenheight = rows; + if (cols > 0) +diff -Naur bash-3.1.orig/parse.y bash-3.1/parse.y +--- bash-3.1.orig/parse.y 2005-11-11 20:14:18.000000000 -0800 ++++ bash-3.1/parse.y 2006-04-19 15:58:34.000000000 -0700 +@@ -2716,6 +2716,7 @@ + #define P_ALLOWESC 0x02 + #define P_DQUOTE 0x04 + #define P_COMMAND 0x08 /* parsing a command, so look for comments */ ++#define P_BACKQUOTE 0x10 /* parsing a backquoted command substitution */ + + static char matched_pair_error; + static char * +@@ -2725,12 +2726,12 @@ + int *lenp, flags; + { + int count, ch, was_dollar, in_comment, check_comment; +- int pass_next_character, nestlen, ttranslen, start_lineno; ++ int pass_next_character, backq_backslash, nestlen, ttranslen, start_lineno; + char *ret, *nestret, *ttrans; + int retind, retsize, rflags; + + count = 1; +- pass_next_character = was_dollar = in_comment = 0; ++ pass_next_character = backq_backslash = was_dollar = in_comment = 0; + check_comment = (flags & P_COMMAND) && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ +@@ -2742,11 +2743,8 @@ + start_lineno = line_number; + while (count) + { +-#if 0 +- ch = shell_getc ((qc != '\'' || (flags & P_ALLOWESC)) && pass_next_character == 0); +-#else +- ch = shell_getc (qc != '\'' && pass_next_character == 0); +-#endif ++ ch = shell_getc (qc != '\'' && pass_next_character == 0 && backq_backslash == 0); ++ + if (ch == EOF) + { + free (ret); +@@ -2771,9 +2769,16 @@ + continue; + } + /* Not exactly right yet */ +- else if (check_comment && in_comment == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || whitespace (ret[retind -1]))) ++ else if MBTEST(check_comment && in_comment == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || whitespace (ret[retind - 1]))) + in_comment = 1; + ++ /* last char was backslash inside backquoted command substitution */ ++ if (backq_backslash) ++ { ++ backq_backslash = 0; ++ /* Placeholder for adding special characters */ ++ } ++ + if (pass_next_character) /* last char was backslash */ + { + pass_next_character = 0; +@@ -2814,6 +2819,8 @@ + { + if MBTEST((flags & P_ALLOWESC) && ch == '\\') + pass_next_character++; ++ else if MBTEST((flags & P_BACKQUOTE) && ch == '\\') ++ backq_backslash++; + continue; + } + +@@ -2898,7 +2905,11 @@ + } + else if MBTEST(qc == '`' && (ch == '"' || ch == '\'') && in_comment == 0) + { +- nestret = parse_matched_pair (0, ch, ch, &nestlen, rflags); ++ /* Add P_BACKQUOTE so backslash quotes the next character and ++ shell_getc does the right thing with \. We do this for ++ a measure of backwards compatibility -- it's not strictly the ++ right POSIX thing. */ ++ nestret = parse_matched_pair (0, ch, ch, &nestlen, rflags|P_BACKQUOTE); + goto add_nestret; + } + else if MBTEST(was_dollar && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ +@@ -2907,7 +2918,7 @@ + if (open == ch) /* undo previous increment */ + count--; + if (ch == '(') /* ) */ +- nestret = parse_matched_pair (0, '(', ')', &nestlen, rflags); ++ nestret = parse_matched_pair (0, '(', ')', &nestlen, rflags & ~P_DQUOTE); + else if (ch == '{') /* } */ + nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|rflags); + else if (ch == '[') /* ] */ +@@ -3578,7 +3589,7 @@ + FREE (ttok); + all_digit_token = 0; + compound_assignment = 1; +-#if 0 ++#if 1 + goto next_character; + #else + goto got_token; /* ksh93 seems to do this */ +@@ -3695,7 +3706,9 @@ + struct builtin *b; + b = builtin_address_internal (token, 0); + if (b && (b->flags & ASSIGNMENT_BUILTIN)) +- parser_state |= PST_ASSIGNOK; ++ parser_state |= PST_ASSIGNOK; ++ else if (STREQ (token, "eval") || STREQ (token, "let")) ++ parser_state |= PST_ASSIGNOK; + } + + yylval.word = the_word; +@@ -4686,18 +4699,21 @@ + int *retlenp; + { + WORD_LIST *wl, *rl; +- int tok, orig_line_number, orig_token_size; ++ int tok, orig_line_number, orig_token_size, orig_last_token, assignok; + char *saved_token, *ret; + + saved_token = token; + orig_token_size = token_buffer_size; + orig_line_number = line_number; ++ orig_last_token = last_read_token; + + last_read_token = WORD; /* WORD to allow reserved words here */ + + token = (char *)NULL; + token_buffer_size = 0; + ++ assignok = parser_state&PST_ASSIGNOK; /* XXX */ ++ + wl = (WORD_LIST *)NULL; /* ( */ + parser_state |= PST_COMPASSIGN; + +@@ -4740,7 +4756,7 @@ + jump_to_top_level (DISCARD); + } + +- last_read_token = WORD; ++ last_read_token = orig_last_token; /* XXX - was WORD? */ + if (wl) + { + rl = REVERSE_LIST (wl, WORD_LIST *); +@@ -4752,6 +4768,10 @@ + + if (retlenp) + *retlenp = (ret && *ret) ? strlen (ret) : 0; ++ ++ if (assignok) ++ parser_state |= PST_ASSIGNOK; ++ + return ret; + } + +diff -Naur bash-3.1.orig/patchlevel.h bash-3.1/patchlevel.h +--- bash-3.1.orig/patchlevel.h 2005-07-20 10:58:20.000000000 -0700 ++++ bash-3.1/patchlevel.h 2006-04-19 15:59:29.000000000 -0700 +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 0 ++#define PATCHLEVEL 17 + + #endif /* _PATCHLEVEL_H_ */ +diff -Naur bash-3.1.orig/subst.c bash-3.1/subst.c +--- bash-3.1.orig/subst.c 2005-10-24 06:51:13.000000000 -0700 ++++ bash-3.1/subst.c 2006-04-19 15:59:29.000000000 -0700 +@@ -2187,7 +2187,7 @@ + if (mklocal && variable_context) + { + v = find_variable (name); +- if (v == 0 || array_p (v) == 0) ++ if (v == 0 || array_p (v) == 0 || v->context != variable_context) + v = make_local_array_variable (name); + v = assign_array_var_from_string (v, value, flags); + } +@@ -2575,6 +2575,13 @@ + return (expand_string_to_string_internal (string, quoted, expand_string_assignment)); + } + ++char * ++expand_arith_string (string, quoted) ++ char *string; ++{ ++ return (expand_string_if_necessary (string, quoted, expand_string)); ++} ++ + #if defined (COND_COMMAND) + /* Just remove backslashes in STRING. Returns a new string. */ + char * +@@ -5248,7 +5255,7 @@ + else + t = (char *)0; + +- temp1 = expand_string_if_necessary (substr, Q_DOUBLE_QUOTES, expand_string); ++ temp1 = expand_arith_string (substr, Q_DOUBLE_QUOTES); + *e1p = evalexp (temp1, &expok); + free (temp1); + if (expok == 0) +@@ -5293,7 +5300,7 @@ + { + t++; + temp2 = savestring (t); +- temp1 = expand_string_if_necessary (temp2, Q_DOUBLE_QUOTES, expand_string); ++ temp1 = expand_arith_string (temp2, Q_DOUBLE_QUOTES); + free (temp2); + t[-1] = ':'; + *e2p = evalexp (temp1, &expok); +@@ -6435,7 +6442,7 @@ + temp2[t_index] = '\0'; + + /* Expand variables found inside the expression. */ +- temp1 = expand_string_if_necessary (temp2, Q_DOUBLE_QUOTES, expand_string); ++ temp1 = expand_arith_string (temp2, Q_DOUBLE_QUOTES); + free (temp2); + + arithsub: +@@ -6477,7 +6484,7 @@ + zindex = t_index; + + /* Do initial variable expansion. */ +- temp1 = expand_string_if_necessary (temp, Q_DOUBLE_QUOTES, expand_string); ++ temp1 = expand_arith_string (temp, Q_DOUBLE_QUOTES); + + goto arithsub; + +@@ -6795,6 +6802,12 @@ + if (temp && *temp && t_index > 0) + { + temp1 = bash_tilde_expand (temp, tflag); ++ if (temp1 && *temp1 == '~' && STREQ (temp, temp1)) ++ { ++ FREE (temp); ++ FREE (temp1); ++ goto add_character; /* tilde expansion failed */ ++ } + free (temp); + temp = temp1; + sindex += t_index; +diff -Naur bash-3.1.orig/subst.h bash-3.1/subst.h +--- bash-3.1.orig/subst.h 2004-11-07 12:12:28.000000000 -0800 ++++ bash-3.1/subst.h 2006-04-19 15:59:29.000000000 -0700 +@@ -151,6 +151,9 @@ + extern char *expand_string_unsplit_to_string __P((char *, int)); + extern char *expand_assignment_string_to_string __P((char *, int)); + ++/* Expand an arithmetic expression string */ ++extern char *expand_arith_string __P((char *, int)); ++ + /* De-quoted quoted characters in STRING. */ + extern char *dequote_string __P((char *)); + +diff -Naur bash-3.1.orig/variables.c bash-3.1/variables.c +--- bash-3.1.orig/variables.c 2005-11-12 18:22:37.000000000 -0800 ++++ bash-3.1/variables.c 2006-04-19 15:58:34.000000000 -0700 +@@ -860,9 +860,11 @@ + { + char val[INT_STRLEN_BOUND(int) + 1], *v; + ++#if defined (READLINE) + /* If we are currently assigning to LINES or COLUMNS, don't do anything. */ + if (winsize_assignment) + return; ++#endif + + v = inttostr (lines, val, sizeof (val)); + bind_variable ("LINES", v, 0); diff --git a/base-source/bash-3.1.tar.gz b/base-source/bash-3.1.tar.gz new file mode 100644 index 0000000..c560163 Binary files /dev/null and b/base-source/bash-3.1.tar.gz differ diff --git a/base-source/bash-doc-3.1.tar.gz b/base-source/bash-doc-3.1.tar.gz new file mode 100644 index 0000000..a04b8a6 Binary files /dev/null and b/base-source/bash-doc-3.1.tar.gz differ diff --git a/base-source/bind-9.3.2.tar.gz b/base-source/bind-9.3.2.tar.gz new file mode 100644 index 0000000..bbd054b Binary files /dev/null and b/base-source/bind-9.3.2.tar.gz differ diff --git a/base-source/binutils-2.17.tar.bz2 b/base-source/binutils-2.17.tar.bz2 new file mode 100644 index 0000000..7bf6e57 Binary files /dev/null and b/base-source/binutils-2.17.tar.bz2 differ diff --git a/base-source/bison-2.2.tar.bz2 b/base-source/bison-2.2.tar.bz2 new file mode 100644 index 0000000..838d669 Binary files /dev/null and b/base-source/bison-2.2.tar.bz2 differ diff --git a/base-source/bzip2-1.0.3-bzgrep_security-1.patch b/base-source/bzip2-1.0.3-bzgrep_security-1.patch new file mode 100644 index 0000000..dab627d --- /dev/null +++ b/base-source/bzip2-1.0.3-bzgrep_security-1.patch @@ -0,0 +1,35 @@ +Submitted By: Ken Moffat +Date: 2005-08-09 +Initial Package Version: 1.0.3 +Upstream Status: Unknown. +Origin: Jyri Ryska (RedHat) for fedora3 +Description: Fixes filename sanitisation in bzgrep. + This fixes CAN-2005-0758 (if a user can be tricked into running +bzgrep in an untrusted directory containing files with carefully +crafted filenames, arbitrary commands could be executed as the user +running bzgrep). Risk is reported as low. I've modified it to force +the interpreter to be bash, some of the other shells in use won't +like the bash syntax. + +diff -Naur bzip2-1.0.3/bzgrep bzip2-1.0.3-new/bzgrep +--- bzip2-1.0.3/bzgrep 2004-10-09 12:29:32.000000000 +0100 ++++ bzip2-1.0.3-new/bzgrep 2005-08-09 21:36:37.000000000 +0100 +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + # Bzgrep wrapped for bzip2, + # adapted from zgrep by Philippe Troin for Debian GNU/Linux. +@@ -63,7 +63,11 @@ + bzip2 -cdfq "$i" | $grep $opt "$pat" + r=$? + else +- bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${i}:|" ++ j=${i//\\/\\\\} ++ j=${j//|/\\|} ++ j=${j//&/\\&} ++ j=`printf "%s" "$j" | tr '\n' ' '` ++ bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|" + r=$? + fi + test "$r" -ne 0 && res="$r" diff --git a/base-source/bzip2-1.0.3-install_docs-1.patch b/base-source/bzip2-1.0.3-install_docs-1.patch new file mode 100644 index 0000000..08a8a1d --- /dev/null +++ b/base-source/bzip2-1.0.3-install_docs-1.patch @@ -0,0 +1,41 @@ +Submitted By: Matthew Burgess +Date: 2005-08-03 +Initial Package Version: 1.0.3 +Upstream Status: Not submitted +Origin: Randy McMurchy & Steve Crosby +Description: Installs pre-formatted documentation + +diff -Naur bzip2-1.0.3.orig/Makefile bzip2-1.0.3/Makefile +--- bzip2-1.0.3.orig/Makefile 2005-02-17 11:28:24.000000000 +0000 ++++ bzip2-1.0.3/Makefile 2005-08-14 13:08:25.626703640 +0000 +@@ -12,6 +12,7 @@ + + # Where you want it installed when you do 'make install' + PREFIX=/usr ++DOCDIR=share/doc/$(DISTNAME) + + + OBJS= blocksort.o \ +@@ -61,6 +62,7 @@ + if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi + if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi + if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi ++ if ( test ! -d $(PREFIX)/$(DOCDIR) ) ; then mkdir -p $(PREFIX)/$(DOCDIR); fi + if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi + cp -f bzip2 $(PREFIX)/bin/bzip2 + cp -f bzip2 $(PREFIX)/bin/bunzip2 +@@ -94,6 +96,14 @@ + echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzfgrep.1 + echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1 + echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1 ++ cp -f manual.html $(PREFIX)/$(DOCDIR) ++ cp -f manual.pdf $(PREFIX)/$(DOCDIR) ++ cp -f manual.ps $(PREFIX)/$(DOCDIR) ++ cp -f bzip2.txt $(PREFIX)/$(DOCDIR) ++ chmod a+r $(PREFIX)/$(DOCDIR)/manual.html ++ chmod a+r $(PREFIX)/$(DOCDIR)/manual.pdf ++ chmod a+r $(PREFIX)/$(DOCDIR)/manual.ps ++ chmod a+r $(PREFIX)/$(DOCDIR)/bzip2.txt + + clean: + rm -f *.o libbz2.a bzip2 bzip2recover \ diff --git a/base-source/bzip2-1.0.3.tar.gz b/base-source/bzip2-1.0.3.tar.gz new file mode 100644 index 0000000..03dd33c Binary files /dev/null and b/base-source/bzip2-1.0.3.tar.gz differ diff --git a/base-source/coreutils-5.96-i18n-1.patch b/base-source/coreutils-5.96-i18n-1.patch new file mode 100644 index 0000000..d1c8cf0 --- /dev/null +++ b/base-source/coreutils-5.96-i18n-1.patch @@ -0,0 +1,4052 @@ +Submitted by: Alexander E. Patrakov +Date: 2005-11-12 +Initial Package Version: 5.93 +Upstream Status: Not accepted, but planned for 6.0 +Origin: RedHat CVS, see below how to regenerate +http://cvs.fedora.redhat.com/viewcvs/*checkout*/devel/coreutils/coreutils-i18n.patch?rev=1.14 +Description: This patch fixes various problems with multibyte character support. +LSB >= 2.0 tests for features added by this patch, but only Coreutils-5.2.1 plus +http://www.linuxfromscratch.org/~alexander/patches/coreutils-5.2.1-i18n_fixes-1.patch +actually pass the Li18nux2000-level1 testsuite. + +To regenerate: +Get http://cvs.fedora.redhat.com/viewcvs/*checkout*/devel/coreutils/coreutils-i18n.patch?rev=1.14 +Replace the coreutils-5.93/tests/sort/Makefile.in hunk with that from rev 1.13 +Add this header. + +--- coreutils-5.93/lib/linebuffer.h.i18n 2005-05-14 08:58:06.000000000 +0100 ++++ coreutils-5.93/lib/linebuffer.h 2005-12-23 08:53:01.000000000 +0000 +@@ -22,6 +22,11 @@ + + # include + ++/* Get mbstate_t. */ ++# if HAVE_WCHAR_H ++# include ++# endif ++ + /* A `struct linebuffer' holds a line of text. */ + + struct linebuffer +@@ -29,6 +34,9 @@ + size_t size; /* Allocated. */ + size_t length; /* Used. */ + char *buffer; ++# if HAVE_WCHAR_H ++ mbstate_t state; ++# endif + }; + + /* Initialize linebuffer LINEBUFFER for use. */ +--- coreutils-5.93/src/cut.c.i18n 2005-08-12 08:16:25.000000000 +0100 ++++ coreutils-5.93/src/cut.c 2005-12-23 08:53:01.000000000 +0000 +@@ -29,6 +29,11 @@ + #include + #include + #include ++ ++/* Get mbstate_t, mbrtowc(). */ ++#if HAVE_WCHAR_H ++# include ++#endif + #include "system.h" + + #include "error.h" +@@ -37,6 +42,18 @@ + #include "quote.h" + #include "xstrndup.h" + ++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC ++ installation; work around this configuration error. */ ++#if !defined MB_LEN_MAX || MB_LEN_MAX < 2 ++# undef MB_LEN_MAX ++# define MB_LEN_MAX 16 ++#endif ++ ++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */ ++#if HAVE_MBRTOWC && defined mbstate_t ++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) ++#endif ++ + /* The official name of this program (e.g., no `g' prefix). */ + #define PROGRAM_NAME "cut" + +@@ -67,6 +84,52 @@ + } \ + while (0) + ++/* Refill the buffer BUF to get a multibyte character. */ ++#define REFILL_BUFFER(BUF, BUFPOS, BUFLEN, STREAM) \ ++ do \ ++ { \ ++ if (BUFLEN < MB_LEN_MAX && !feof (STREAM) && !ferror (STREAM)) \ ++ { \ ++ memmove (BUF, BUFPOS, BUFLEN); \ ++ BUFLEN += fread (BUF + BUFLEN, sizeof(char), BUFSIZ, STREAM); \ ++ BUFPOS = BUF; \ ++ } \ ++ } \ ++ while (0) ++ ++/* Get wide character on BUFPOS. BUFPOS is not included after that. ++ If byte sequence is not valid as a character, CONVFAIL is 1. Otherwise 0. */ ++#define GET_NEXT_WC_FROM_BUFFER(WC, BUFPOS, BUFLEN, MBLENGTH, STATE, CONVFAIL) \ ++ do \ ++ { \ ++ mbstate_t state_bak; \ ++ \ ++ if (BUFLEN < 1) \ ++ { \ ++ WC = WEOF; \ ++ break; \ ++ } \ ++ \ ++ /* Get a wide character. */ \ ++ CONVFAIL = 0; \ ++ state_bak = STATE; \ ++ MBLENGTH = mbrtowc ((wchar_t *)&WC, BUFPOS, BUFLEN, &STATE); \ ++ \ ++ switch (MBLENGTH) \ ++ { \ ++ case (size_t)-1: \ ++ case (size_t)-2: \ ++ CONVFAIL++; \ ++ STATE = state_bak; \ ++ /* Fall througn. */ \ ++ \ ++ case 0: \ ++ MBLENGTH = 1; \ ++ break; \ ++ } \ ++ } \ ++ while (0) ++ + struct range_pair + { + size_t lo; +@@ -85,7 +148,7 @@ + /* The number of bytes allocated for FIELD_1_BUFFER. */ + static size_t field_1_bufsize; + +-/* The largest field or byte index used as an endpoint of a closed ++/* The largest byte, character or field index used as an endpoint of a closed + or degenerate range specification; this doesn't include the starting + index of right-open-ended ranges. For example, with either range spec + `2-5,9-', `2-3,5,9-' this variable would be set to 5. */ +@@ -97,10 +160,11 @@ + + /* This is a bit vector. + In byte mode, which bytes to output. ++ In character mode, which characters to output. + In field mode, which DELIM-separated fields to output. +- Both bytes and fields are numbered starting with 1, ++ Bytes, characters and fields are numbered starting with 1, + so the zeroth bit of this array is unused. +- A field or byte K has been selected if ++ A byte, character or field K has been selected if + (K <= MAX_RANGE_ENDPOINT and is_printable_field(K)) + || (EOL_RANGE_START > 0 && K >= EOL_RANGE_START). */ + static unsigned char *printable_field; +@@ -109,9 +173,12 @@ + { + undefined_mode, + +- /* Output characters that are in the given bytes. */ ++ /* Output bytes that are at the given positions. */ + byte_mode, + ++ /* Output characters that are at the given positions. */ ++ character_mode, ++ + /* Output the given delimeter-separated fields. */ + field_mode + }; +@@ -121,6 +188,13 @@ + + static enum operating_mode operating_mode; + ++/* If nonzero, when in byte mode, don't split multibyte characters. */ ++static int byte_mode_character_aware; ++ ++/* If nonzero, the function for single byte locale is work ++ if this program runs on multibyte locale. */ ++static int force_singlebyte_mode; ++ + /* If true do not output lines containing no delimeter characters. + Otherwise, all such lines are printed. This option is valid only + with field mode. */ +@@ -132,6 +206,9 @@ + + /* The delimeter character for field mode. */ + static unsigned char delim; ++#if HAVE_WCHAR_H ++static wchar_t wcdelim; ++#endif + + /* True if the --output-delimiter=STRING option was specified. */ + static bool output_delimiter_specified; +@@ -205,7 +282,7 @@ + -f, --fields=LIST select only these fields; also print any line\n\ + that contains no delimiter character, unless\n\ + the -s option is specified\n\ +- -n (ignored)\n\ ++ -n with -b: don't split multibyte characters\n\ + "), stdout); + fputs (_("\ + --complement complement the set of selected bytes, characters\n\ +@@ -360,7 +437,7 @@ + in_digits = false; + /* Starting a range. */ + if (dash_found) +- FATAL_ERROR (_("invalid byte or field list")); ++ FATAL_ERROR (_("invalid byte, character or field list")); + dash_found = true; + fieldstr++; + +@@ -385,14 +462,16 @@ + if (value == 0) + { + /* `n-'. From `initial' to end of line. */ +- eol_range_start = initial; ++ if (eol_range_start == 0 || ++ (eol_range_start != 0 && eol_range_start > initial)) ++ eol_range_start = initial; + field_found = true; + } + else + { + /* `m-n' or `-n' (1-n). */ + if (value < initial) +- FATAL_ERROR (_("invalid byte or field list")); ++ FATAL_ERROR (_("invalid byte, character or field list")); + + /* Is there already a range going to end of line? */ + if (eol_range_start != 0) +@@ -465,6 +544,9 @@ + if (operating_mode == byte_mode) + error (0, 0, + _("byte offset %s is too large"), quote (bad_num)); ++ else if (operating_mode == character_mode) ++ error (0, 0, ++ _("character offset %s is too large"), quote (bad_num)); + else + error (0, 0, + _("field number %s is too large"), quote (bad_num)); +@@ -475,7 +557,7 @@ + fieldstr++; + } + else +- FATAL_ERROR (_("invalid byte or field list")); ++ FATAL_ERROR (_("invalid byte, character or field list")); + } + + max_range_endpoint = 0; +@@ -568,6 +650,63 @@ + } + } + ++#if HAVE_MBRTOWC ++/* This function is in use for the following case. ++ ++ 1. Read from the stream STREAM, printing to standard output any selected ++ characters. ++ ++ 2. Read from stream STREAM, printing to standard output any selected bytes, ++ without splitting multibyte characters. */ ++ ++static void ++cut_characters_or_cut_bytes_no_split (FILE *stream) ++{ ++ int idx; /* number of bytes or characters in the line so far. */ ++ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */ ++ char *bufpos; /* Next read position of BUF. */ ++ size_t buflen; /* The length of the byte sequence in buf. */ ++ wint_t wc; /* A gotten wide character. */ ++ size_t mblength; /* The byte size of a multibyte character which shows ++ as same character as WC. */ ++ mbstate_t state; /* State of the stream. */ ++ int convfail; /* 1, when conversion is failed. Otherwise 0. */ ++ ++ idx = 0; ++ buflen = 0; ++ bufpos = buf; ++ memset (&state, '\0', sizeof(mbstate_t)); ++ ++ while (1) ++ { ++ REFILL_BUFFER (buf, bufpos, buflen, stream); ++ ++ GET_NEXT_WC_FROM_BUFFER (wc, bufpos, buflen, mblength, state, convfail); ++ ++ if (wc == WEOF) ++ { ++ if (idx > 0) ++ putchar ('\n'); ++ break; ++ } ++ else if (wc == L'\n') ++ { ++ putchar ('\n'); ++ idx = 0; ++ } ++ else ++ { ++ idx += (operating_mode == byte_mode) ? mblength : 1; ++ if (print_kth (idx, NULL)) ++ fwrite (bufpos, mblength, sizeof(char), stdout); ++ } ++ ++ buflen -= mblength; ++ bufpos += mblength; ++ } ++} ++#endif ++ + /* Read from stream STREAM, printing to standard output any selected fields. */ + + static void +@@ -689,13 +828,192 @@ + } + } + ++#if HAVE_MBRTOWC ++static void ++cut_fields_mb (FILE *stream) ++{ ++ int c; ++ unsigned int field_idx; ++ int found_any_selected_field; ++ int buffer_first_field; ++ int empty_input; ++ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */ ++ char *bufpos; /* Next read position of BUF. */ ++ size_t buflen; /* The length of the byte sequence in buf. */ ++ wint_t wc = 0; /* A gotten wide character. */ ++ size_t mblength; /* The byte size of a multibyte character which shows ++ as same character as WC. */ ++ mbstate_t state; /* State of the stream. */ ++ int convfail; /* 1, when conversion is failed. Otherwise 0. */ ++ ++ found_any_selected_field = 0; ++ field_idx = 1; ++ bufpos = buf; ++ buflen = 0; ++ memset (&state, '\0', sizeof(mbstate_t)); ++ ++ c = getc (stream); ++ empty_input = (c == EOF); ++ if (c != EOF) ++ ungetc (c, stream); ++ else ++ wc = WEOF; ++ ++ /* To support the semantics of the -s flag, we may have to buffer ++ all of the first field to determine whether it is `delimited.' ++ But that is unnecessary if all non-delimited lines must be printed ++ and the first field has been selected, or if non-delimited lines ++ must be suppressed and the first field has *not* been selected. ++ That is because a non-delimited line has exactly one field. */ ++ buffer_first_field = (suppress_non_delimited ^ !print_kth (1, NULL)); ++ ++ while (1) ++ { ++ if (field_idx == 1 && buffer_first_field) ++ { ++ int len = 0; ++ ++ while (1) ++ { ++ REFILL_BUFFER (buf, bufpos, buflen, stream); ++ ++ GET_NEXT_WC_FROM_BUFFER ++ (wc, bufpos, buflen, mblength, state, convfail); ++ ++ if (wc == WEOF) ++ break; ++ ++ field_1_buffer = xrealloc (field_1_buffer, len + mblength); ++ memcpy (field_1_buffer + len, bufpos, mblength); ++ len += mblength; ++ buflen -= mblength; ++ bufpos += mblength; ++ ++ if (!convfail && (wc == L'\n' || wc == wcdelim)) ++ break; ++ } ++ ++ if (wc == WEOF) ++ break; ++ ++ /* If the first field extends to the end of line (it is not ++ delimited) and we are printing all non-delimited lines, ++ print this one. */ ++ if (convfail || (!convfail && wc != wcdelim)) ++ { ++ if (suppress_non_delimited) ++ { ++ /* Empty. */ ++ } ++ else ++ { ++ fwrite (field_1_buffer, sizeof (char), len, stdout); ++ /* Make sure the output line is newline terminated. */ ++ if (convfail || (!convfail && wc != L'\n')) ++ putchar ('\n'); ++ } ++ continue; ++ } ++ ++ if (print_kth (1, NULL)) ++ { ++ /* Print the field, but not the trailing delimiter. */ ++ fwrite (field_1_buffer, sizeof (char), len - 1, stdout); ++ found_any_selected_field = 1; ++ } ++ ++field_idx; ++ } ++ ++ if (wc != WEOF) ++ { ++ if (print_kth (field_idx, NULL)) ++ { ++ if (found_any_selected_field) ++ { ++ fwrite (output_delimiter_string, sizeof (char), ++ output_delimiter_length, stdout); ++ } ++ found_any_selected_field = 1; ++ } ++ ++ while (1) ++ { ++ REFILL_BUFFER (buf, bufpos, buflen, stream); ++ ++ GET_NEXT_WC_FROM_BUFFER ++ (wc, bufpos, buflen, mblength, state, convfail); ++ ++ if (wc == WEOF) ++ break; ++ else if (!convfail && (wc == wcdelim || wc == L'\n')) ++ { ++ buflen -= mblength; ++ bufpos += mblength; ++ break; ++ } ++ ++ if (print_kth (field_idx, NULL)) ++ fwrite (bufpos, mblength, sizeof(char), stdout); ++ ++ buflen -= mblength; ++ bufpos += mblength; ++ } ++ } ++ ++ if ((!convfail || wc == L'\n') && buflen < 1) ++ wc = WEOF; ++ ++ if (!convfail && wc == wcdelim) ++ ++field_idx; ++ else if (wc == WEOF || (!convfail && wc == L'\n')) ++ { ++ if (found_any_selected_field ++ || (!empty_input && !(suppress_non_delimited && field_idx == 1))) ++ putchar ('\n'); ++ if (wc == WEOF) ++ break; ++ field_idx = 1; ++ found_any_selected_field = 0; ++ } ++ } ++} ++#endif ++ + static void + cut_stream (FILE *stream) + { +- if (operating_mode == byte_mode) +- cut_bytes (stream); ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1 && !force_singlebyte_mode) ++ { ++ switch (operating_mode) ++ { ++ case byte_mode: ++ if (byte_mode_character_aware) ++ cut_characters_or_cut_bytes_no_split (stream); ++ else ++ cut_bytes (stream); ++ break; ++ ++ case character_mode: ++ cut_characters_or_cut_bytes_no_split (stream); ++ break; ++ ++ case field_mode: ++ cut_fields_mb (stream); ++ break; ++ ++ default: ++ abort (); ++ } ++ } + else +- cut_fields (stream); ++#endif ++ { ++ if (operating_mode == field_mode) ++ cut_fields (stream); ++ else ++ cut_bytes (stream); ++ } + } + + /* Process file FILE to standard output. +@@ -745,6 +1063,8 @@ + bool ok; + bool delim_specified = false; + char *spec_list_string IF_LINT(= NULL); ++ char mbdelim[MB_LEN_MAX + 1]; ++ size_t delimlen = 0; + + initialize_main (&argc, &argv); + program_name = argv[0]; +@@ -767,7 +1087,6 @@ + switch (optc) + { + case 'b': +- case 'c': + /* Build the byte list. */ + if (operating_mode != undefined_mode) + FATAL_ERROR (_("only one type of list may be specified")); +@@ -775,6 +1094,14 @@ + spec_list_string = optarg; + break; + ++ case 'c': ++ /* Build the character list. */ ++ if (operating_mode != undefined_mode) ++ FATAL_ERROR (_("only one type of list may be specified")); ++ operating_mode = character_mode; ++ spec_list_string = optarg; ++ break; ++ + case 'f': + /* Build the field list. */ + if (operating_mode != undefined_mode) +@@ -786,10 +1113,35 @@ + case 'd': + /* New delimiter. */ + /* Interpret -d '' to mean `use the NUL byte as the delimiter.' */ +- if (optarg[0] != '\0' && optarg[1] != '\0') +- FATAL_ERROR (_("the delimiter must be a single character")); +- delim = optarg[0]; +- delim_specified = true; ++#if HAVE_MBRTOWC ++ { ++ if(MB_CUR_MAX > 1) ++ { ++ mbstate_t state; ++ ++ memset (&state, '\0', sizeof(mbstate_t)); ++ delimlen = mbrtowc (&wcdelim, optarg, strnlen(optarg, MB_LEN_MAX), &state); ++ ++ if (delimlen == (size_t)-1 || delimlen == (size_t)-2) ++ ++force_singlebyte_mode; ++ else ++ { ++ delimlen = (delimlen < 1) ? 1 : delimlen; ++ if (wcdelim != L'\0' && *(optarg + delimlen) != '\0') ++ FATAL_ERROR (_("the delimiter must be a single character")); ++ memcpy (mbdelim, optarg, delimlen); ++ } ++ } ++ ++ if (MB_CUR_MAX <= 1 || force_singlebyte_mode) ++#endif ++ { ++ if (optarg[0] != '\0' && optarg[1] != '\0') ++ FATAL_ERROR (_("the delimiter must be a single character")); ++ delim = (unsigned char) optarg[0]; ++ } ++ delim_specified = true; ++ } + break; + + case OUTPUT_DELIMITER_OPTION: +@@ -802,6 +1154,7 @@ + break; + + case 'n': ++ byte_mode_character_aware = 1; + break; + + case 's': +@@ -824,7 +1177,7 @@ + if (operating_mode == undefined_mode) + FATAL_ERROR (_("you must specify a list of bytes, characters, or fields")); + +- if (delim != '\0' && operating_mode != field_mode) ++ if (delim_specified && operating_mode != field_mode) + FATAL_ERROR (_("an input delimiter may be specified only\ + when operating on fields")); + +@@ -851,15 +1204,34 @@ + } + + if (!delim_specified) +- delim = '\t'; ++ { ++ delim = '\t'; ++#ifdef HAVE_MBRTOWC ++ wcdelim = L'\t'; ++ mbdelim[0] = '\t'; ++ mbdelim[1] = '\0'; ++ delimlen = 1; ++#endif ++ } + + if (output_delimiter_string == NULL) + { +- static char dummy[2]; +- dummy[0] = delim; +- dummy[1] = '\0'; +- output_delimiter_string = dummy; +- output_delimiter_length = 1; ++#ifdef HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1 && !force_singlebyte_mode) ++ { ++ output_delimiter_string = xstrdup(mbdelim); ++ output_delimiter_length = delimlen; ++ } ++ ++ if (MB_CUR_MAX <= 1 || force_singlebyte_mode) ++#endif ++ { ++ static char dummy[2]; ++ dummy[0] = delim; ++ dummy[1] = '\0'; ++ output_delimiter_string = dummy; ++ output_delimiter_length = 1; ++ } + } + + if (optind == argc) +--- coreutils-5.93/src/pr.c.i18n 2005-09-16 08:50:33.000000000 +0100 ++++ coreutils-5.93/src/pr.c 2005-12-23 08:53:01.000000000 +0000 +@@ -313,6 +313,32 @@ + + #include + #include ++ ++/* Get MB_LEN_MAX. */ ++#include ++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC ++ installation; work around this configuration error. */ ++#if !defined MB_LEN_MAX || MB_LEN_MAX == 1 ++# define MB_LEN_MAX 16 ++#endif ++ ++/* Get MB_CUR_MAX. */ ++#include ++ ++/* Solaris 2.5 has a bug: must be included before . */ ++/* Get mbstate_t, mbrtowc(), wcwidth(). */ ++#if HAVE_WCHAR_H ++# include ++#endif ++ ++/* Get iswprint(). -- for wcwidth(). */ ++#if HAVE_WCTYPE_H ++# include ++#endif ++#if !defined iswprint && !HAVE_ISWPRINT ++# define iswprint(wc) 1 ++#endif ++ + #include "system.h" + #include "error.h" + #include "hard-locale.h" +@@ -324,6 +350,18 @@ + #include "strftime.h" + #include "xstrtol.h" + ++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */ ++#if HAVE_MBRTOWC && defined mbstate_t ++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) ++#endif ++ ++#ifndef HAVE_DECL_WCWIDTH ++"this configure-time declaration test was not run" ++#endif ++#if !HAVE_DECL_WCWIDTH ++extern int wcwidth (); ++#endif ++ + /* The official name of this program (e.g., no `g' prefix). */ + #define PROGRAM_NAME "pr" + +@@ -416,7 +454,20 @@ + + #define NULLCOL (COLUMN *)0 + +-static int char_to_clump (char c); ++/* Funtion pointers to switch functions for single byte locale or for ++ multibyte locale. If multibyte functions do not exist in your sysytem, ++ these pointers always point the function for single byte locale. */ ++static void (*print_char) (char c); ++static int (*char_to_clump) (char c); ++ ++/* Functions for single byte locale. */ ++static void print_char_single (char c); ++static int char_to_clump_single (char c); ++ ++/* Functions for multibyte locale. */ ++static void print_char_multi (char c); ++static int char_to_clump_multi (char c); ++ + static bool read_line (COLUMN *p); + static bool print_page (void); + static bool print_stored (COLUMN *p); +@@ -426,6 +477,7 @@ + static void pad_across_to (int position); + static void add_line_number (COLUMN *p); + static void getoptarg (char *arg, char switch_char, char *character, ++ int *character_length, int *character_width, + int *number); + void usage (int status); + static void print_files (int number_of_files, char **av); +@@ -440,7 +492,6 @@ + static void pad_down (int lines); + static void read_rest_of_line (COLUMN *p); + static void skip_read (COLUMN *p, int column_number); +-static void print_char (char c); + static void cleanup (void); + static void print_sep_string (void); + static void separator_string (const char *optarg_S); +@@ -455,7 +506,7 @@ + we store the leftmost columns contiguously in buff. + To print a line from buff, get the index of the first character + from line_vector[i], and print up to line_vector[i + 1]. */ +-static char *buff; ++static unsigned char *buff; + + /* Index of the position in buff where the next character + will be stored. */ +@@ -559,7 +610,7 @@ + static bool untabify_input = false; + + /* (-e) The input tab character. */ +-static char input_tab_char = '\t'; ++static char input_tab_char[MB_LEN_MAX] = "\t"; + + /* (-e) Tabstops are at chars_per_tab, 2*chars_per_tab, 3*chars_per_tab, ... + where the leftmost column is 1. */ +@@ -569,7 +620,10 @@ + static bool tabify_output = false; + + /* (-i) The output tab character. */ +-static char output_tab_char = '\t'; ++static char output_tab_char[MB_LEN_MAX] = "\t"; ++ ++/* (-i) The byte length of output tab character. */ ++static int output_tab_char_length = 1; + + /* (-i) The width of the output tab. */ + static int chars_per_output_tab = 8; +@@ -643,7 +697,13 @@ + static bool numbered_lines = false; + + /* (-n) Character which follows each line number. */ +-static char number_separator = '\t'; ++static char number_separator[MB_LEN_MAX] = "\t"; ++ ++/* (-n) The byte length of the character which follows each line number. */ ++static int number_separator_length = 1; ++ ++/* (-n) The character width of the character which follows each line number. */ ++static int number_separator_width = 0; + + /* (-n) line counting starts with 1st line of input file (not with 1st + line of 1st page printed). */ +@@ -696,6 +756,7 @@ + -a|COLUMN|-m is a `space' and with the -J option a `tab'. */ + static char *col_sep_string = ""; + static int col_sep_length = 0; ++static int col_sep_width = 0; + static char *column_separator = " "; + static char *line_separator = "\t"; + +@@ -852,6 +913,13 @@ + col_sep_length = (int) strlen (optarg_S); + col_sep_string = xmalloc (col_sep_length + 1); + strcpy (col_sep_string, optarg_S); ++ ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ col_sep_width = mbswidth (col_sep_string, 0); ++ else ++#endif ++ col_sep_width = col_sep_length; + } + + int +@@ -877,6 +945,21 @@ + + atexit (close_stdout); + ++/* Define which functions are used, the ones for single byte locale or the ones ++ for multibyte locale. */ ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ { ++ print_char = print_char_multi; ++ char_to_clump = char_to_clump_multi; ++ } ++ else ++#endif ++ { ++ print_char = print_char_single; ++ char_to_clump = char_to_clump_single; ++ } ++ + n_files = 0; + file_names = (argc > 1 + ? xmalloc ((argc - 1) * sizeof (char *)) +@@ -949,8 +1032,12 @@ + break; + case 'e': + if (optarg) +- getoptarg (optarg, 'e', &input_tab_char, +- &chars_per_input_tab); ++ { ++ int dummy_length, dummy_width; ++ ++ getoptarg (optarg, 'e', input_tab_char, &dummy_length, ++ &dummy_width, &chars_per_input_tab); ++ } + /* Could check tab width > 0. */ + untabify_input = true; + break; +@@ -963,8 +1050,12 @@ + break; + case 'i': + if (optarg) +- getoptarg (optarg, 'i', &output_tab_char, +- &chars_per_output_tab); ++ { ++ int dummy_width; ++ ++ getoptarg (optarg, 'i', output_tab_char, &output_tab_char_length, ++ &dummy_width, &chars_per_output_tab); ++ } + /* Could check tab width > 0. */ + tabify_output = true; + break; +@@ -991,8 +1082,8 @@ + case 'n': + numbered_lines = true; + if (optarg) +- getoptarg (optarg, 'n', &number_separator, +- &chars_per_number); ++ getoptarg (optarg, 'n', number_separator, &number_separator_length, ++ &number_separator_width, &chars_per_number); + break; + case 'N': + skip_count = false; +@@ -1031,7 +1122,7 @@ + old_s = false; + /* Reset an additional input of -s, -S dominates -s */ + col_sep_string = ""; +- col_sep_length = 0; ++ col_sep_length = col_sep_width = 0; + use_col_separator = true; + if (optarg) + separator_string (optarg); +@@ -1188,10 +1279,45 @@ + a number. */ + + static void +-getoptarg (char *arg, char switch_char, char *character, int *number) ++getoptarg (char *arg, char switch_char, char *character, int *character_length, ++ int *character_width, int *number) + { + if (!ISDIGIT (*arg)) +- *character = *arg++; ++ { ++#ifdef HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) /* for multibyte locale. */ ++ { ++ wchar_t wc; ++ size_t mblength; ++ int width; ++ mbstate_t state = {'\0'}; ++ ++ mblength = mbrtowc (&wc, arg, strnlen(arg, MB_LEN_MAX), &state); ++ ++ if (mblength == (size_t)-1 || mblength == (size_t)-2) ++ { ++ *character_length = 1; ++ *character_width = 1; ++ } ++ else ++ { ++ *character_length = (mblength < 1) ? 1 : mblength; ++ width = wcwidth (wc); ++ *character_width = (width < 0) ? 0 : width; ++ } ++ ++ strncpy (character, arg, *character_length); ++ arg += *character_length; ++ } ++ else /* for single byte locale. */ ++#endif ++ { ++ *character = *arg++; ++ *character_length = 1; ++ *character_width = 1; ++ } ++ } ++ + if (*arg) + { + long int tmp_long; +@@ -1256,7 +1382,7 @@ + else + col_sep_string = column_separator; + +- col_sep_length = 1; ++ col_sep_length = col_sep_width = 1; + use_col_separator = true; + } + /* It's rather pointless to define a TAB separator with column +@@ -1288,11 +1414,11 @@ + TAB_WIDTH (chars_per_input_tab, chars_per_number); */ + + /* Estimate chars_per_text without any margin and keep it constant. */ +- if (number_separator == '\t') ++ if (number_separator[0] == '\t') + number_width = chars_per_number + + TAB_WIDTH (chars_per_default_tab, chars_per_number); + else +- number_width = chars_per_number + 1; ++ number_width = chars_per_number + number_separator_width; + + /* The number is part of the column width unless we are + printing files in parallel. */ +@@ -1307,7 +1433,7 @@ + } + + chars_per_column = (chars_per_line - chars_used_by_number - +- (columns - 1) * col_sep_length) / columns; ++ (columns - 1) * col_sep_width) / columns; + + if (chars_per_column < 1) + error (EXIT_FAILURE, 0, _("page width too narrow")); +@@ -1432,7 +1558,7 @@ + + /* Enlarge p->start_position of first column to use the same form of + padding_not_printed with all columns. */ +- h = h + col_sep_length; ++ h = h + col_sep_width; + + /* This loop takes care of all but the rightmost column. */ + +@@ -1466,7 +1592,7 @@ + } + else + { +- h = h_next + col_sep_length; ++ h = h_next + col_sep_width; + h_next = h + chars_per_column; + } + } +@@ -1756,9 +1882,9 @@ + align_column (COLUMN *p) + { + padding_not_printed = p->start_position; +- if (padding_not_printed - col_sep_length > 0) ++ if (padding_not_printed - col_sep_width > 0) + { +- pad_across_to (padding_not_printed - col_sep_length); ++ pad_across_to (padding_not_printed - col_sep_width); + padding_not_printed = ANYWHERE; + } + +@@ -2029,13 +2155,13 @@ + /* May be too generous. */ + buff = X2REALLOC (buff, &buff_allocated); + } +- buff[buff_current++] = c; ++ buff[buff_current++] = (unsigned char) c; + } + + static void + add_line_number (COLUMN *p) + { +- int i; ++ int i, j; + char *s; + int left_cut; + +@@ -2058,22 +2184,24 @@ + /* Tabification is assumed for multiple columns, also for n-separators, + but `default n-separator = TAB' hasn't been given priority over + equal column_width also specified by POSIX. */ +- if (number_separator == '\t') ++ if (number_separator[0] == '\t') + { + i = number_width - chars_per_number; + while (i-- > 0) + (p->char_func) (' '); + } + else +- (p->char_func) (number_separator); ++ for (j = 0; j < number_separator_length; j++) ++ (p->char_func) (number_separator[j]); + } + else + /* To comply with POSIX, we avoid any expansion of default TAB + separator with a single column output. No column_width requirement + has to be considered. */ + { +- (p->char_func) (number_separator); +- if (number_separator == '\t') ++ for (j = 0; j < number_separator_length; j++) ++ (p->char_func) (number_separator[j]); ++ if (number_separator[0] == '\t') + output_position = POS_AFTER_TAB (chars_per_output_tab, + output_position); + } +@@ -2234,7 +2362,7 @@ + while (goal - h_old > 1 + && (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal) + { +- putchar (output_tab_char); ++ fwrite (output_tab_char, sizeof(char), output_tab_char_length, stdout); + h_old = h_new; + } + while (++h_old <= goal) +@@ -2254,6 +2382,7 @@ + { + char *s; + int l = col_sep_length; ++ int not_space_flag; + + s = col_sep_string; + +@@ -2267,6 +2396,7 @@ + { + for (; separators_not_printed > 0; --separators_not_printed) + { ++ not_space_flag = 0; + while (l-- > 0) + { + /* 3 types of sep_strings: spaces only, spaces and chars, +@@ -2280,12 +2410,15 @@ + } + else + { ++ not_space_flag = 1; + if (spaces_not_printed > 0) + print_white_space (); + putchar (*s++); +- ++output_position; + } + } ++ if (not_space_flag) ++ output_position += col_sep_width; ++ + /* sep_string ends with some spaces */ + if (spaces_not_printed > 0) + print_white_space (); +@@ -2313,7 +2446,7 @@ + required number of tabs and spaces. */ + + static void +-print_char (char c) ++print_char_single (char c) + { + if (tabify_output) + { +@@ -2337,6 +2470,74 @@ + putchar (c); + } + ++#ifdef HAVE_MBRTOWC ++static void ++print_char_multi (char c) ++{ ++ static size_t mbc_pos = 0; ++ static unsigned char mbc[MB_LEN_MAX] = {'\0'}; ++ static mbstate_t state = {'\0'}; ++ mbstate_t state_bak; ++ wchar_t wc; ++ size_t mblength; ++ int width; ++ ++ if (tabify_output) ++ { ++ state_bak = state; ++ mbc[mbc_pos++] = (unsigned char)c; ++ mblength = mbrtowc (&wc, mbc, mbc_pos, &state); ++ ++ while (mbc_pos > 0) ++ { ++ switch (mblength) ++ { ++ case (size_t)-2: ++ state = state_bak; ++ return; ++ ++ case (size_t)-1: ++ state = state_bak; ++ ++output_position; ++ putchar (mbc[0]); ++ memmove (mbc, mbc + 1, MB_CUR_MAX - 1); ++ --mbc_pos; ++ break; ++ ++ case 0: ++ mblength = 1; ++ ++ default: ++ if (wc == L' ') ++ { ++ memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength); ++ --mbc_pos; ++ ++spaces_not_printed; ++ return; ++ } ++ else if (spaces_not_printed > 0) ++ print_white_space (); ++ ++ /* Nonprintables are assumed to have width 0, except L'\b'. */ ++ if ((width = wcwidth (wc)) < 1) ++ { ++ if (wc == L'\b') ++ --output_position; ++ } ++ else ++ output_position += width; ++ ++ fwrite (mbc, sizeof(char), mblength, stdout); ++ memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength); ++ mbc_pos -= mblength; ++ } ++ } ++ return; ++ } ++ putchar (c); ++} ++#endif ++ + /* Skip to page PAGE before printing. + PAGE may be larger than total number of pages. */ + +@@ -2517,9 +2718,9 @@ + align_empty_cols = false; + } + +- if (padding_not_printed - col_sep_length > 0) ++ if (padding_not_printed - col_sep_width > 0) + { +- pad_across_to (padding_not_printed - col_sep_length); ++ pad_across_to (padding_not_printed - col_sep_width); + padding_not_printed = ANYWHERE; + } + +@@ -2620,9 +2821,9 @@ + } + } + +- if (padding_not_printed - col_sep_length > 0) ++ if (padding_not_printed - col_sep_width > 0) + { +- pad_across_to (padding_not_printed - col_sep_length); ++ pad_across_to (padding_not_printed - col_sep_width); + padding_not_printed = ANYWHERE; + } + +@@ -2635,8 +2836,8 @@ + if (spaces_not_printed == 0) + { + output_position = p->start_position + end_vector[line]; +- if (p->start_position - col_sep_length == chars_per_margin) +- output_position -= col_sep_length; ++ if (p->start_position - col_sep_width == chars_per_margin) ++ output_position -= col_sep_width; + } + + return true; +@@ -2655,7 +2856,7 @@ + number of characters is 1.) */ + + static int +-char_to_clump (char c) ++char_to_clump_single (char c) + { + unsigned char uc = c; + char *s = clump_buff; +@@ -2665,10 +2866,10 @@ + int chars; + int chars_per_c = 8; + +- if (c == input_tab_char) ++ if (c == input_tab_char[0]) + chars_per_c = chars_per_input_tab; + +- if (c == input_tab_char || c == '\t') ++ if (c == input_tab_char[0] || c == '\t') + { + width = TAB_WIDTH (chars_per_c, input_position); + +@@ -2739,6 +2940,154 @@ + return chars; + } + ++#ifdef HAVE_MBRTOWC ++static int ++char_to_clump_multi (char c) ++{ ++ static size_t mbc_pos = 0; ++ static char mbc[MB_LEN_MAX] = {'\0'}; ++ static mbstate_t state = {'\0'}; ++ mbstate_t state_bak; ++ wchar_t wc; ++ size_t mblength; ++ int wc_width; ++ register int *s = clump_buff; ++ register int i, j; ++ char esc_buff[4]; ++ int width; ++ int chars; ++ int chars_per_c = 8; ++ ++ state_bak = state; ++ mbc[mbc_pos++] = c; ++ mblength = mbrtowc (&wc, mbc, mbc_pos, &state); ++ ++ width = 0; ++ chars = 0; ++ while (mbc_pos > 0) ++ { ++ switch (mblength) ++ { ++ case (size_t)-2: ++ state = state_bak; ++ return 0; ++ ++ case (size_t)-1: ++ state = state_bak; ++ mblength = 1; ++ ++ if (use_esc_sequence || use_cntrl_prefix) ++ { ++ width = +4; ++ chars = +4; ++ *s++ = '\\'; ++ sprintf (esc_buff, "%03o", mbc[0]); ++ for (i = 0; i <= 2; ++i) ++ *s++ = (int) esc_buff[i]; ++ } ++ else ++ { ++ width += 1; ++ chars += 1; ++ *s++ = mbc[0]; ++ } ++ break; ++ ++ case 0: ++ mblength = 1; ++ /* Fall through */ ++ ++ default: ++ if (memcmp (mbc, input_tab_char, mblength) == 0) ++ chars_per_c = chars_per_input_tab; ++ ++ if (memcmp (mbc, input_tab_char, mblength) == 0 || c == '\t') ++ { ++ int width_inc; ++ ++ width_inc = TAB_WIDTH (chars_per_c, input_position); ++ width += width_inc; ++ ++ if (untabify_input) ++ { ++ for (i = width_inc; i; --i) ++ *s++ = ' '; ++ chars += width_inc; ++ } ++ else ++ { ++ for (i = 0; i < mblength; i++) ++ *s++ = mbc[i]; ++ chars += mblength; ++ } ++ } ++ else if ((wc_width = wcwidth (wc)) < 1) ++ { ++ if (use_esc_sequence) ++ { ++ for (i = 0; i < mblength; i++) ++ { ++ width += 4; ++ chars += 4; ++ *s++ = '\\'; ++ sprintf (esc_buff, "%03o", c); ++ for (j = 0; j <= 2; ++j) ++ *s++ = (int) esc_buff[j]; ++ } ++ } ++ else if (use_cntrl_prefix) ++ { ++ if (wc < 0200) ++ { ++ width += 2; ++ chars += 2; ++ *s++ = '^'; ++ *s++ = wc ^ 0100; ++ } ++ else ++ { ++ for (i = 0; i < mblength; i++) ++ { ++ width += 4; ++ chars += 4; ++ *s++ = '\\'; ++ sprintf (esc_buff, "%03o", c); ++ for (j = 0; j <= 2; ++j) ++ *s++ = (int) esc_buff[j]; ++ } ++ } ++ } ++ else if (wc == L'\b') ++ { ++ width += -1; ++ chars += 1; ++ *s++ = c; ++ } ++ else ++ { ++ width += 0; ++ chars += mblength; ++ for (i = 0; i < mblength; i++) ++ *s++ = mbc[i]; ++ } ++ } ++ else ++ { ++ width += wc_width; ++ chars += mblength; ++ for (i = 0; i < mblength; i++) ++ *s++ = mbc[i]; ++ } ++ } ++ memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength); ++ mbc_pos -= mblength; ++ } ++ ++ input_position += width; ++ return chars; ++} ++#endif ++ + /* We've just printed some files and need to clean up things before + looking for more options and printing the next batch of files. + +--- coreutils-5.93/src/uniq.c.i18n 2005-07-05 07:32:54.000000000 +0100 ++++ coreutils-5.93/src/uniq.c 2005-12-23 08:53:01.000000000 +0000 +@@ -23,6 +23,16 @@ + #include + #include + ++/* Get mbstate_t, mbrtowc(). */ ++#if HAVE_WCHAR_H ++# include ++#endif ++ ++/* Get isw* functions. */ ++#if HAVE_WCTYPE_H ++# include ++#endif ++ + #include "system.h" + #include "argmatch.h" + #include "linebuffer.h" +@@ -32,7 +42,19 @@ + #include "quote.h" + #include "xmemcoll.h" + #include "xstrtol.h" +-#include "memcasecmp.h" ++#include "xmemcoll.h" ++ ++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC ++ installation; work around this configuration error. */ ++#if !defined MB_LEN_MAX || MB_LEN_MAX < 2 ++# define MB_LEN_MAX 16 ++#endif ++ ++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */ ++#if HAVE_MBRTOWC && defined mbstate_t ++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) ++#endif ++ + + /* The official name of this program (e.g., no `g' prefix). */ + #define PROGRAM_NAME "uniq" +@@ -109,6 +131,10 @@ + /* Select whether/how to delimit groups of duplicate lines. */ + static enum delimit_method delimit_groups; + ++/* Function pointers. */ ++static char * ++(*find_field) (struct linebuffer *line); ++ + static struct option const longopts[] = + { + {"count", no_argument, NULL, 'c'}, +@@ -189,7 +215,7 @@ + return a pointer to the beginning of the line's field to be compared. */ + + static char * +-find_field (const struct linebuffer *line) ++find_field_uni (struct linebuffer *line) + { + size_t count; + char *lp = line->buffer; +@@ -210,6 +236,83 @@ + return lp + i; + } + ++#if HAVE_MBRTOWC ++ ++# define MBCHAR_TO_WCHAR(WC, MBLENGTH, LP, POS, SIZE, STATEP, CONVFAIL) \ ++ do \ ++ { \ ++ mbstate_t state_bak; \ ++ \ ++ CONVFAIL = 0; \ ++ state_bak = *STATEP; \ ++ \ ++ MBLENGTH = mbrtowc (&WC, LP + POS, SIZE - POS, STATEP); \ ++ \ ++ switch (MBLENGTH) \ ++ { \ ++ case (size_t)-2: \ ++ case (size_t)-1: \ ++ *STATEP = state_bak; \ ++ CONVFAIL++; \ ++ /* Fall through */ \ ++ case 0: \ ++ MBLENGTH = 1; \ ++ } \ ++ } \ ++ while (0) ++ ++static char * ++find_field_multi (struct linebuffer *line) ++{ ++ size_t count; ++ char *lp = line->buffer; ++ size_t size = line->length - 1; ++ size_t pos; ++ size_t mblength; ++ wchar_t wc; ++ mbstate_t *statep; ++ int convfail; ++ ++ pos = 0; ++ statep = &(line->state); ++ ++ /* skip fields. */ ++ for (count = 0; count < skip_fields && pos < size; count++) ++ { ++ while (pos < size) ++ { ++ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail); ++ ++ if (convfail || !iswblank (wc)) ++ { ++ pos += mblength; ++ break; ++ } ++ pos += mblength; ++ } ++ ++ while (pos < size) ++ { ++ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail); ++ ++ if (!convfail && iswblank (wc)) ++ break; ++ ++ pos += mblength; ++ } ++ } ++ ++ /* skip fields. */ ++ for (count = 0; count < skip_chars && pos < size; count++) ++ { ++ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail); ++ pos += mblength; ++ } ++ ++ return lp + pos; ++} ++#endif ++ + /* Return false if two strings OLD and NEW match, true if not. + OLD and NEW point not to the beginnings of the lines + but rather to the beginnings of the fields to compare. +@@ -218,6 +321,8 @@ + static bool + different (char *old, char *new, size_t oldlen, size_t newlen) + { ++ char *copy_old, *copy_new; ++ + if (check_chars < oldlen) + oldlen = check_chars; + if (check_chars < newlen) +@@ -225,14 +330,92 @@ + + if (ignore_case) + { +- /* FIXME: This should invoke strcoll somehow. */ +- return oldlen != newlen || memcasecmp (old, new, oldlen); ++ size_t i; ++ ++ copy_old = alloca (oldlen + 1); ++ copy_new = alloca (oldlen + 1); ++ ++ for (i = 0; i < oldlen; i++) ++ { ++ copy_old[i] = toupper (old[i]); ++ copy_new[i] = toupper (new[i]); ++ } + } +- else if (hard_LC_COLLATE) +- return xmemcoll (old, oldlen, new, newlen) != 0; + else +- return oldlen != newlen || memcmp (old, new, oldlen); ++ { ++ copy_old = (char *)old; ++ copy_new = (char *)new; ++ } ++ ++ return xmemcoll (copy_old, oldlen, copy_new, newlen); ++} ++ ++#if HAVE_MBRTOWC ++static int ++different_multi (const char *old, const char *new, size_t oldlen, size_t newlen, mbstate_t oldstate, mbstate_t newstate) ++{ ++ size_t i, j, chars; ++ const char *str[2]; ++ char *copy[2]; ++ size_t len[2]; ++ mbstate_t state[2]; ++ size_t mblength; ++ wchar_t wc, uwc; ++ mbstate_t state_bak; ++ ++ str[0] = old; ++ str[1] = new; ++ len[0] = oldlen; ++ len[1] = newlen; ++ state[0] = oldstate; ++ state[1] = newstate; ++ ++ for (i = 0; i < 2; i++) ++ { ++ copy[i] = alloca (len[i] + 1); ++ ++ for (j = 0, chars = 0; j < len[i] && chars < check_chars; chars++) ++ { ++ state_bak = state[i]; ++ mblength = mbrtowc (&wc, str[i] + j, len[i] - j, &(state[i])); ++ ++ switch (mblength) ++ { ++ case (size_t)-1: ++ case (size_t)-2: ++ state[i] = state_bak; ++ /* Fall through */ ++ case 0: ++ mblength = 1; ++ break; ++ ++ default: ++ if (ignore_case) ++ { ++ uwc = towupper (wc); ++ ++ if (uwc != wc) ++ { ++ mbstate_t state_wc; ++ ++ memset (&state_wc, '\0', sizeof(mbstate_t)); ++ wcrtomb (copy[i] + j, uwc, &state_wc); ++ } ++ else ++ memcpy (copy[i] + j, str[i] + j, mblength); ++ } ++ else ++ memcpy (copy[i] + j, str[i] + j, mblength); ++ } ++ j += mblength; ++ } ++ copy[i][j] = '\0'; ++ len[i] = j; ++ } ++ ++ return xmemcoll (copy[0], len[0], copy[1], len[1]); + } ++#endif + + /* Output the line in linebuffer LINE to standard output + provided that the switches say it should be output. +@@ -286,15 +469,43 @@ + { + char *prevfield IF_LINT (= NULL); + size_t prevlen IF_LINT (= 0); ++#if HAVE_MBRTOWC ++ mbstate_t prevstate; ++ ++ memset (&prevstate, '\0', sizeof (mbstate_t)); ++#endif + + while (!feof (stdin)) + { + char *thisfield; + size_t thislen; ++#if HAVE_MBRTOWC ++ mbstate_t thisstate; ++#endif ++ + if (readlinebuffer (thisline, stdin) == 0) + break; + thisfield = find_field (thisline); + thislen = thisline->length - 1 - (thisfield - thisline->buffer); ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ { ++ thisstate = thisline->state; ++ ++ if (prevline->length == 0 || different_multi ++ (thisfield, prevfield, thislen, prevlen, thisstate, prevstate)) ++ { ++ fwrite (thisline->buffer, sizeof (char), ++ thisline->length, stdout); ++ ++ SWAP_LINES (prevline, thisline); ++ prevfield = thisfield; ++ prevlen = thislen; ++ prevstate = thisstate; ++ } ++ } ++ else ++#endif + if (prevline->length == 0 + || different (thisfield, prevfield, thislen, prevlen)) + { +@@ -313,17 +524,26 @@ + size_t prevlen; + uintmax_t match_count = 0; + bool first_delimiter = true; ++#if HAVE_MBRTOWC ++ mbstate_t prevstate; ++#endif + + if (readlinebuffer (prevline, stdin) == 0) + goto closefiles; + prevfield = find_field (prevline); + prevlen = prevline->length - 1 - (prevfield - prevline->buffer); ++#if HAVE_MBRTOWC ++ prevstate = prevline->state; ++#endif + + while (!feof (stdin)) + { + bool match; + char *thisfield; + size_t thislen; ++#if HAVE_MBRTOWC ++ mbstate_t thisstate; ++#endif + if (readlinebuffer (thisline, stdin) == 0) + { + if (ferror (stdin)) +@@ -332,6 +552,15 @@ + } + thisfield = find_field (thisline); + thislen = thisline->length - 1 - (thisfield - thisline->buffer); ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ { ++ thisstate = thisline->state; ++ match = !different_multi (thisfield, prevfield, ++ thislen, prevlen, thisstate, prevstate); ++ } ++ else ++#endif + match = !different (thisfield, prevfield, thislen, prevlen); + match_count += match; + +@@ -364,6 +593,9 @@ + SWAP_LINES (prevline, thisline); + prevfield = thisfield; + prevlen = thislen; ++#if HAVE_MBRTOWC ++ prevstate = thisstate; ++#endif + if (!match) + match_count = 0; + } +@@ -408,6 +640,19 @@ + + atexit (close_stdout); + ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ { ++ find_field = find_field_multi; ++ } ++ else ++#endif ++ { ++ find_field = find_field_uni; ++ } ++ ++ ++ + skip_chars = 0; + skip_fields = 0; + check_chars = SIZE_MAX; +--- coreutils-5.93/src/expand.c.i18n 2005-08-12 08:16:25.000000000 +0100 ++++ coreutils-5.93/src/expand.c 2005-12-23 08:53:01.000000000 +0000 +@@ -38,11 +38,28 @@ + #include + #include + #include ++ ++/* Get mbstate_t, mbrtowc(), wcwidth(). */ ++#if HAVE_WCHAR_H ++# include ++#endif ++ + #include "system.h" + #include "error.h" + #include "quote.h" + #include "xstrndup.h" + ++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC ++ installation; work around this configuration error. */ ++#if !defined MB_LEN_MAX || MB_LEN_MAX < 2 ++# define MB_LEN_MAX 16 ++#endif ++ ++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */ ++#if HAVE_MBRTOWC && defined mbstate_t ++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) ++#endif ++ + /* The official name of this program (e.g., no `g' prefix). */ + #define PROGRAM_NAME "expand" + +@@ -182,6 +199,7 @@ + stops = num_start + len - 1; + } + } ++ + else + { + error (0, 0, _("tab size contains invalid character(s): %s"), +@@ -364,6 +382,142 @@ + } + } + ++#if HAVE_MBRTOWC ++static void ++expand_multibyte (void) ++{ ++ FILE *fp; /* Input strem. */ ++ mbstate_t i_state; /* Current shift state of the input stream. */ ++ mbstate_t i_state_bak; /* Back up the I_STATE. */ ++ mbstate_t o_state; /* Current shift state of the output stream. */ ++ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */ ++ char *bufpos; /* Next read position of BUF. */ ++ size_t buflen = 0; /* The length of the byte sequence in buf. */ ++ wchar_t wc; /* A gotten wide character. */ ++ size_t mblength; /* The byte size of a multibyte character ++ which shows as same character as WC. */ ++ int tab_index = 0; /* Index in `tab_list' of next tabstop. */ ++ int column = 0; /* Column on screen of the next char. */ ++ int next_tab_column; /* Column the next tab stop is on. */ ++ int convert = 1; /* If nonzero, perform translations. */ ++ ++ fp = next_file ((FILE *) NULL); ++ if (fp == NULL) ++ return; ++ ++ memset (&o_state, '\0', sizeof(mbstate_t)); ++ memset (&i_state, '\0', sizeof(mbstate_t)); ++ ++ for (;;) ++ { ++ /* Refill the buffer BUF. */ ++ if (buflen < MB_LEN_MAX && !feof(fp) && !ferror(fp)) ++ { ++ memmove (buf, bufpos, buflen); ++ buflen += fread (buf + buflen, sizeof(char), BUFSIZ, fp); ++ bufpos = buf; ++ } ++ ++ /* No character is left in BUF. */ ++ if (buflen < 1) ++ { ++ fp = next_file (fp); ++ ++ if (fp == NULL) ++ break; /* No more files. */ ++ else ++ { ++ memset (&i_state, '\0', sizeof(mbstate_t)); ++ continue; ++ } ++ } ++ ++ /* Get a wide character. */ ++ i_state_bak = i_state; ++ mblength = mbrtowc (&wc, bufpos, buflen, &i_state); ++ ++ switch (mblength) ++ { ++ case (size_t)-1: /* illegal byte sequence. */ ++ case (size_t)-2: ++ mblength = 1; ++ i_state = i_state_bak; ++ if (convert) ++ { ++ ++column; ++ if (convert_entire_line == 0) ++ convert = 0; ++ } ++ putchar (*bufpos); ++ break; ++ ++ case 0: /* null. */ ++ mblength = 1; ++ if (convert && convert_entire_line == 0) ++ convert = 0; ++ putchar ('\0'); ++ break; ++ ++ default: ++ if (wc == L'\n') /* LF. */ ++ { ++ tab_index = 0; ++ column = 0; ++ convert = 1; ++ putchar ('\n'); ++ } ++ else if (wc == L'\t' && convert) /* Tab. */ ++ { ++ if (tab_size == 0) ++ { ++ /* Do not let tab_index == first_free_tab; ++ stop when it is 1 less. */ ++ while (tab_index < first_free_tab - 1 ++ && column >= tab_list[tab_index]) ++ tab_index++; ++ next_tab_column = tab_list[tab_index]; ++ if (tab_index < first_free_tab - 1) ++ tab_index++; ++ if (column >= next_tab_column) ++ next_tab_column = column + 1; ++ } ++ else ++ next_tab_column = column + tab_size - column % tab_size; ++ ++ while (column < next_tab_column) ++ { ++ putchar (' '); ++ ++column; ++ } ++ } ++ else /* Others. */ ++ { ++ if (convert) ++ { ++ if (wc == L'\b') ++ { ++ if (column > 0) ++ --column; ++ } ++ else ++ { ++ int width; /* The width of WC. */ ++ ++ width = wcwidth (wc); ++ column += (width > 0) ? width : 0; ++ if (convert_entire_line == 0) ++ convert = 0; ++ } ++ } ++ fwrite (bufpos, sizeof(char), mblength, stdout); ++ } ++ } ++ buflen -= mblength; ++ bufpos += mblength; ++ } ++} ++#endif ++ + int + main (int argc, char **argv) + { +@@ -428,7 +582,12 @@ + + file_list = (optind < argc ? &argv[optind] : stdin_argv); + +- expand (); ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ expand_multibyte (); ++ else ++#endif ++ expand (); + + if (have_read_stdin && fclose (stdin) != 0) + error (EXIT_FAILURE, errno, "-"); +--- coreutils-5.93/src/fold.c.i18n 2005-08-12 08:29:38.000000000 +0100 ++++ coreutils-5.93/src/fold.c 2005-12-23 08:53:01.000000000 +0000 +@@ -23,11 +23,33 @@ + #include + #include + ++/* Get mbstate_t, mbrtowc(), wcwidth(). */ ++#if HAVE_WCHAR_H ++# include ++#endif ++ ++/* Get iswprint(), iswblank(), wcwidth(). */ ++#if HAVE_WCTYPE_H ++# include ++#endif ++ + #include "system.h" + #include "error.h" + #include "quote.h" + #include "xstrtol.h" + ++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC ++ installation; work around this configuration error. */ ++#if !defined MB_LEN_MAX || MB_LEN_MAX < 2 ++# undef MB_LEN_MAX ++# define MB_LEN_MAX 16 ++#endif ++ ++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */ ++#if HAVE_MBRTOWC && defined mbstate_t ++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) ++#endif ++ + #define TAB_WIDTH 8 + + /* The official name of this program (e.g., no `g' prefix). */ +@@ -35,23 +57,44 @@ + + #define AUTHORS "David MacKenzie" + ++#define FATAL_ERROR(Message) \ ++ do \ ++ { \ ++ error (0, 0, (Message)); \ ++ usage (2); \ ++ } \ ++ while (0) ++ ++enum operating_mode ++{ ++ /* Fold texts by columns that are at the given positions. */ ++ column_mode, ++ ++ /* Fold texts by bytes that are at the given positions. */ ++ byte_mode, ++ ++ /* Fold texts by characters that are at the given positions. */ ++ character_mode, ++}; ++ + /* The name this program was run with. */ + char *program_name; + ++/* The argument shows current mode. (Default: column_mode) */ ++static enum operating_mode operating_mode; ++ + /* If nonzero, try to break on whitespace. */ + static bool break_spaces; + +-/* If nonzero, count bytes, not column positions. */ +-static bool count_bytes; +- + /* If nonzero, at least one of the files we read was standard input. */ + static bool have_read_stdin; + +-static char const shortopts[] = "bsw:0::1::2::3::4::5::6::7::8::9::"; ++static char const shortopts[] = "bcsw:0::1::2::3::4::5::6::7::8::9::"; + + static struct option const longopts[] = + { + {"bytes", no_argument, NULL, 'b'}, ++ {"characters", no_argument, NULL, 'c'}, + {"spaces", no_argument, NULL, 's'}, + {"width", required_argument, NULL, 'w'}, + {GETOPT_HELP_OPTION_DECL}, +@@ -81,6 +124,7 @@ + "), stdout); + fputs (_("\ + -b, --bytes count bytes rather than columns\n\ ++ -c, --characters count characters rather than columns\n\ + -s, --spaces break at spaces\n\ + -w, --width=WIDTH use WIDTH columns instead of 80\n\ + "), stdout); +@@ -98,7 +142,7 @@ + static size_t + adjust_column (size_t column, char c) + { +- if (!count_bytes) ++ if (operating_mode != byte_mode) + { + if (c == '\b') + { +@@ -117,35 +161,14 @@ + return column; + } + +-/* Fold file FILENAME, or standard input if FILENAME is "-", +- to stdout, with maximum line length WIDTH. +- Return true if successful. */ +- +-static bool +-fold_file (char *filename, size_t width) ++static void ++fold_text (FILE *istream, size_t width, int *saved_errno) + { +- FILE *istream; + int c; + size_t column = 0; /* Screen column where next char will go. */ + size_t offset_out = 0; /* Index in `line_out' for next char. */ + static char *line_out = NULL; + static size_t allocated_out = 0; +- int saved_errno; +- +- if (STREQ (filename, "-")) +- { +- istream = stdin; +- have_read_stdin = true; +- } +- else +- istream = fopen (filename, "r"); +- +- if (istream == NULL) +- { +- error (0, errno, "%s", filename); +- return false; +- } +- + while ((c = getc (istream)) != EOF) + { + if (offset_out + 1 >= allocated_out) +@@ -172,6 +195,15 @@ + bool found_blank = false; + size_t logical_end = offset_out; + ++ /* If LINE_OUT has no wide character, ++ put a new wide character in LINE_OUT ++ if column is bigger than width. */ ++ if (offset_out == 0) ++ { ++ line_out[offset_out++] = c; ++ continue; ++ } ++ + /* Look for the last blank. */ + while (logical_end) + { +@@ -218,11 +250,225 @@ + line_out[offset_out++] = c; + } + +- saved_errno = errno; ++ *saved_errno = errno; ++ ++ if (offset_out) ++ fwrite (line_out, sizeof (char), (size_t) offset_out, stdout); ++ ++ free(line_out); ++} ++ ++#if HAVE_MBRTOWC ++static void ++fold_multibyte_text (FILE *istream, int width, int *saved_errno) ++{ ++ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */ ++ size_t buflen = 0; /* The length of the byte sequence in buf. */ ++ char *bufpos; /* Next read position of BUF. */ ++ wint_t wc; /* A gotten wide character. */ ++ size_t mblength; /* The byte size of a multibyte character which shows ++ as same character as WC. */ ++ mbstate_t state, state_bak; /* State of the stream. */ ++ int convfail; /* 1, when conversion is failed. Otherwise 0. */ ++ ++ char *line_out = NULL; ++ size_t offset_out = 0; /* Index in `line_out' for next char. */ ++ size_t allocated_out = 0; ++ ++ int increment; ++ size_t column = 0; ++ ++ size_t last_blank_pos; ++ size_t last_blank_column; ++ int is_blank_seen; ++ int last_blank_increment; ++ int is_bs_following_last_blank; ++ size_t bs_following_last_blank_num; ++ int is_cr_after_last_blank; ++ ++#define CLEAR_FLAGS \ ++ do \ ++ { \ ++ last_blank_pos = 0; \ ++ last_blank_column = 0; \ ++ is_blank_seen = 0; \ ++ is_bs_following_last_blank = 0; \ ++ bs_following_last_blank_num = 0; \ ++ is_cr_after_last_blank = 0; \ ++ } \ ++ while (0) ++ ++#define START_NEW_LINE \ ++ do \ ++ { \ ++ putchar ('\n'); \ ++ column = 0; \ ++ offset_out = 0; \ ++ CLEAR_FLAGS; \ ++ } \ ++ while (0) ++ ++ CLEAR_FLAGS; ++ memset (&state, '\0', sizeof(mbstate_t)); ++ ++ for (;; bufpos += mblength, buflen -= mblength) ++ { ++ if (buflen < MB_LEN_MAX && !feof (istream) && !ferror (istream)) ++ { ++ memmove (buf, bufpos, buflen); ++ buflen += fread (buf + buflen, sizeof(char), BUFSIZ, istream); ++ bufpos = buf; ++ } ++ ++ if (buflen < 1) ++ break; ++ ++ /* Get a wide character. */ ++ convfail = 0; ++ state_bak = state; ++ mblength = mbrtowc ((wchar_t *)&wc, bufpos, buflen, &state); ++ ++ switch (mblength) ++ { ++ case (size_t)-1: ++ case (size_t)-2: ++ convfail++; ++ state = state_bak; ++ /* Fall through. */ ++ ++ case 0: ++ mblength = 1; ++ break; ++ } ++ ++rescan: ++ if (operating_mode == byte_mode) /* byte mode */ ++ increment = mblength; ++ else if (operating_mode == character_mode) /* character mode */ ++ increment = 1; ++ else /* column mode */ ++ { ++ if (convfail) ++ increment = 1; ++ else ++ { ++ switch (wc) ++ { ++ case L'\n': ++ fwrite (line_out, sizeof(char), offset_out, stdout); ++ START_NEW_LINE; ++ continue; ++ ++ case L'\b': ++ increment = (column > 0) ? -1 : 0; ++ break; ++ ++ case L'\r': ++ increment = -1 * column; ++ break; ++ ++ case L'\t': ++ increment = 8 - column % 8; ++ break; ++ ++ default: ++ increment = wcwidth (wc); ++ increment = (increment < 0) ? 0 : increment; ++ } ++ } ++ } ++ ++ if (column + increment > width && break_spaces && last_blank_pos) ++ { ++ fwrite (line_out, sizeof(char), last_blank_pos, stdout); ++ putchar ('\n'); ++ ++ offset_out = offset_out - last_blank_pos; ++ column = column - last_blank_column + ((is_cr_after_last_blank) ++ ? last_blank_increment : bs_following_last_blank_num); ++ memmove (line_out, line_out + last_blank_pos, offset_out); ++ CLEAR_FLAGS; ++ goto rescan; ++ } ++ ++ if (column + increment > width && column != 0) ++ { ++ fwrite (line_out, sizeof(char), offset_out, stdout); ++ START_NEW_LINE; ++ goto rescan; ++ } ++ ++ if (allocated_out < offset_out + mblength) ++ { ++ allocated_out += 1024; ++ line_out = xrealloc (line_out, allocated_out); ++ } ++ ++ memcpy (line_out + offset_out, bufpos, mblength); ++ offset_out += mblength; ++ column += increment; ++ ++ if (is_blank_seen && !convfail && wc == L'\r') ++ is_cr_after_last_blank = 1; ++ ++ if (is_bs_following_last_blank && !convfail && wc == L'\b') ++ ++bs_following_last_blank_num; ++ else ++ is_bs_following_last_blank = 0; ++ ++ if (break_spaces && !convfail && iswblank (wc)) ++ { ++ last_blank_pos = offset_out; ++ last_blank_column = column; ++ is_blank_seen = 1; ++ last_blank_increment = increment; ++ is_bs_following_last_blank = 1; ++ bs_following_last_blank_num = 0; ++ is_cr_after_last_blank = 0; ++ } ++ } ++ ++ *saved_errno = errno; + + if (offset_out) + fwrite (line_out, sizeof (char), (size_t) offset_out, stdout); + ++ free(line_out); ++} ++#endif ++ ++/* Fold file FILENAME, or standard input if FILENAME is "-", ++ to stdout, with maximum line length WIDTH. ++ Return 0 if successful, 1 if an error occurs. */ ++ ++static int ++fold_file (char *filename, int width) ++{ ++ FILE *istream; ++ int saved_errno; ++ ++ if (STREQ (filename, "-")) ++ { ++ istream = stdin; ++ have_read_stdin = 1; ++ } ++ else ++ istream = fopen (filename, "r"); ++ ++ if (istream == NULL) ++ { ++ error (0, errno, "%s", filename); ++ return 1; ++ } ++ ++ /* Define how ISTREAM is being folded. */ ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ fold_multibyte_text (istream, width, &saved_errno); ++ else ++#endif ++ fold_text (istream, width, &saved_errno); ++ + if (ferror (istream)) + { + error (0, saved_errno, "%s", filename); +@@ -255,7 +501,8 @@ + + atexit (close_stdout); + +- break_spaces = count_bytes = have_read_stdin = false; ++ operating_mode = column_mode; ++ break_spaces = have_read_stdin = false; + + while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1) + { +@@ -264,7 +511,15 @@ + switch (optc) + { + case 'b': /* Count bytes rather than columns. */ +- count_bytes = true; ++ if (operating_mode != column_mode) ++ FATAL_ERROR (_("only one way of folding may be specified")); ++ operating_mode = byte_mode; ++ break; ++ ++ case 'c': ++ if (operating_mode != column_mode) ++ FATAL_ERROR (_("only one way of folding may be specified")); ++ operating_mode = character_mode; + break; + + case 's': /* Break at word boundaries. */ +--- coreutils-5.93/src/join.c.i18n 2005-08-12 08:16:25.000000000 +0100 ++++ coreutils-5.93/src/join.c 2005-12-23 08:53:01.000000000 +0000 +@@ -23,16 +23,30 @@ + #include + #include + ++/* Get mbstate_t, mbrtowc(), mbrtowc(), wcwidth(). */ ++#if HAVE_WCHAR_H ++# include ++#endif ++ ++/* Get iswblank(), towupper. */ ++#if HAVE_WCTYPE_H ++# include ++#endif ++ + #include "system.h" + #include "error.h" + #include "hard-locale.h" + #include "linebuffer.h" +-#include "memcasecmp.h" + #include "quote.h" + #include "stdio--.h" + #include "xmemcoll.h" + #include "xstrtol.h" + ++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */ ++#if HAVE_MBRTOWC && defined mbstate_t ++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) ++#endif ++ + /* The official name of this program (e.g., no `g' prefix). */ + #define PROGRAM_NAME "join" + +@@ -104,10 +118,12 @@ + /* Last element in `outlist', where a new element can be added. */ + static struct outlist *outlist_end = &outlist_head; + +-/* Tab character separating fields. If negative, fields are separated +- by any nonempty string of blanks, otherwise by exactly one +- tab character whose value (when cast to unsigned char) equals TAB. */ +-static int tab = -1; ++/* Tab character separating fields. If NULL, fields are separated ++ by any nonempty string of blanks. */ ++static char *tab = NULL; ++ ++/* The number of bytes used for tab. */ ++static size_t tablen = 0; + + static struct option const longopts[] = + { +@@ -197,6 +213,8 @@ + + /* Fill in the `fields' structure in LINE. */ + ++/* Fill in the `fields' structure in LINE. */ ++ + static void + xfields (struct line *line) + { +@@ -206,10 +224,11 @@ + if (ptr == lim) + return; + +- if (0 <= tab) ++ if (tab != NULL) + { ++ unsigned char t = tab[0]; + char *sep; +- for (; (sep = memchr (ptr, tab, lim - ptr)) != NULL; ptr = sep + 1) ++ for (; (sep = memchr (ptr, t, lim - ptr)) != NULL; ptr = sep + 1) + extract_field (line, ptr, sep - ptr); + } + else +@@ -236,6 +255,148 @@ + extract_field (line, ptr, lim - ptr); + } + ++#if HAVE_MBRTOWC ++static void ++xfields_multibyte (struct line *line) ++{ ++ char *ptr = line->buf.buffer; ++ char const *lim = ptr + line->buf.length - 1; ++ wchar_t wc = 0; ++ size_t mblength = 1; ++ mbstate_t state, state_bak; ++ ++ memset (&state, 0, sizeof (mbstate_t)); ++ ++ if (ptr == lim) ++ return; ++ ++ if (tab != NULL) ++ { ++ unsigned char t = tab[0]; ++ char *sep = ptr; ++ for (; ptr < lim; ptr = sep + mblength) ++ { ++ sep = ptr; ++ while (sep < lim) ++ { ++ state_bak = state; ++ mblength = mbrtowc (&wc, sep, lim - sep + 1, &state); ++ ++ if (mblength == (size_t)-1 || mblength == (size_t)-2) ++ { ++ mblength = 1; ++ state = state_bak; ++ } ++ mblength = (mblength < 1) ? 1 : mblength; ++ ++ if (mblength == tablen && !memcmp (sep, tab, mblength)) ++ break; ++ else ++ { ++ sep += mblength; ++ continue; ++ } ++ } ++ ++ if (sep == lim) ++ break; ++ ++ extract_field (line, ptr, sep - ptr); ++ } ++ } ++ else ++ { ++ /* Skip leading blanks before the first field. */ ++ while(ptr < lim) ++ { ++ state_bak = state; ++ mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state); ++ ++ if (mblength == (size_t)-1 || mblength == (size_t)-2) ++ { ++ mblength = 1; ++ state = state_bak; ++ break; ++ } ++ mblength = (mblength < 1) ? 1 : mblength; ++ ++ if (!iswblank(wc)) ++ break; ++ ptr += mblength; ++ } ++ ++ do ++ { ++ char *sep; ++ state_bak = state; ++ mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state); ++ if (mblength == (size_t)-1 || mblength == (size_t)-2) ++ { ++ mblength = 1; ++ state = state_bak; ++ break; ++ } ++ mblength = (mblength < 1) ? 1 : mblength; ++ ++ sep = ptr + mblength; ++ while (sep != lim) ++ { ++ state_bak = state; ++ mblength = mbrtowc (&wc, sep, lim - sep + 1, &state); ++ if (mblength == (size_t)-1 || mblength == (size_t)-2) ++ { ++ mblength = 1; ++ state = state_bak; ++ break; ++ } ++ mblength = (mblength < 1) ? 1 : mblength; ++ ++ if (iswblank (wc)) ++ break; ++ ++ sep += mblength; ++ } ++ ++ extract_field (line, ptr, sep - ptr); ++ if (sep == lim) ++ return; ++ ++ state_bak = state; ++ mblength = mbrtowc (&wc, sep, lim - sep + 1, &state); ++ if (mblength == (size_t)-1 || mblength == (size_t)-2) ++ { ++ mblength = 1; ++ state = state_bak; ++ break; ++ } ++ mblength = (mblength < 1) ? 1 : mblength; ++ ++ ptr = sep + mblength; ++ while (ptr != lim) ++ { ++ state_bak = state; ++ mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state); ++ if (mblength == (size_t)-1 || mblength == (size_t)-2) ++ { ++ mblength = 1; ++ state = state_bak; ++ break; ++ } ++ mblength = (mblength < 1) ? 1 : mblength; ++ ++ if (!iswblank (wc)) ++ break; ++ ++ ptr += mblength; ++ } ++ } ++ while (ptr != lim); ++ } ++ ++ extract_field (line, ptr, lim - ptr); ++} ++#endif ++ + /* Read a line from FP into LINE and split it into fields. + Return true if successful. */ + +@@ -256,6 +417,11 @@ + line->nfields_allocated = 0; + line->nfields = 0; + line->fields = NULL; ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ xfields_multibyte (line); ++ else ++#endif + xfields (line); + return true; + } +@@ -310,56 +476,114 @@ + keycmp (struct line const *line1, struct line const *line2) + { + /* Start of field to compare in each file. */ +- char *beg1; +- char *beg2; +- +- size_t len1; +- size_t len2; /* Length of fields to compare. */ ++ char *beg[2]; ++ char *copy[2]; ++ size_t len[2]; /* Length of fields to compare. */ + int diff; ++ int i, j; + + if (join_field_1 < line1->nfields) + { +- beg1 = line1->fields[join_field_1].beg; +- len1 = line1->fields[join_field_1].len; ++ beg[0] = line1->fields[join_field_1].beg; ++ len[0] = line1->fields[join_field_1].len; + } + else + { +- beg1 = NULL; +- len1 = 0; ++ beg[0] = NULL; ++ len[0] = 0; + } + + if (join_field_2 < line2->nfields) + { +- beg2 = line2->fields[join_field_2].beg; +- len2 = line2->fields[join_field_2].len; ++ beg[1] = line2->fields[join_field_2].beg; ++ len[1] = line2->fields[join_field_2].len; + } + else + { +- beg2 = NULL; +- len2 = 0; ++ beg[1] = NULL; ++ len[1] = 0; + } + +- if (len1 == 0) +- return len2 == 0 ? 0 : -1; +- if (len2 == 0) ++ if (len[0] == 0) ++ return len[1] == 0 ? 0 : -1; ++ if (len[1] == 0) + return 1; + + if (ignore_case) + { +- /* FIXME: ignore_case does not work with NLS (in particular, +- with multibyte chars). */ +- diff = memcasecmp (beg1, beg2, MIN (len1, len2)); ++#ifdef HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ { ++ size_t mblength; ++ wchar_t wc, uwc; ++ mbstate_t state, state_bak; ++ ++ memset (&state, '\0', sizeof (mbstate_t)); ++ ++ for (i = 0; i < 2; i++) ++ { ++ copy[i] = alloca (len[i] + 1); ++ ++ for (j = 0; j < MIN (len[0], len[1]);) ++ { ++ state_bak = state; ++ mblength = mbrtowc (&wc, beg[i] + j, len[i] - j, &state); ++ ++ switch (mblength) ++ { ++ case (size_t) -1: ++ case (size_t) -2: ++ state = state_bak; ++ /* Fall through */ ++ case 0: ++ mblength = 1; ++ break; ++ ++ default: ++ uwc = towupper (wc); ++ ++ if (uwc != wc) ++ { ++ mbstate_t state_wc; ++ ++ memset (&state_wc, '\0', sizeof (mbstate_t)); ++ wcrtomb (copy[i] + j, uwc, &state_wc); ++ } ++ else ++ memcpy (copy[i] + j, beg[i] + j, mblength); ++ } ++ j += mblength; ++ } ++ copy[i][j] = '\0'; ++ } ++ } ++ else ++#endif ++ { ++ for (i = 0; i < 2; i++) ++ { ++ copy[i] = alloca (len[i] + 1); ++ ++ for (j = 0; j < MIN (len[0], len[1]); j++) ++ copy[i][j] = toupper (beg[i][j]); ++ ++ copy[i][j] = '\0'; ++ } ++ } + } + else + { +- if (hard_LC_COLLATE) +- return xmemcoll (beg1, len1, beg2, len2); +- diff = memcmp (beg1, beg2, MIN (len1, len2)); ++ copy[0] = (unsigned char *) beg[0]; ++ copy[1] = (unsigned char *) beg[1]; + } + ++ if (HAVE_SETLOCALE && hard_LC_COLLATE) ++ return xmemcoll ((char *) copy[0], len[0], (char *) copy[1], len[1]); ++ diff = memcmp (copy[0], copy[1], MIN (len[0], len[1])); ++ + if (diff) + return diff; +- return len1 < len2 ? -1 : len1 != len2; ++ return len[0] - len[1]; + } + + /* Print field N of LINE if it exists and is nonempty, otherwise +@@ -384,11 +608,18 @@ + + /* Print the join of LINE1 and LINE2. */ + ++#define PUT_TAB_CHAR \ ++ do \ ++ { \ ++ (tab != NULL) ? \ ++ fwrite(tab, sizeof(char), tablen, stdout) : putchar (' '); \ ++ } \ ++ while (0) ++ + static void + prjoin (struct line const *line1, struct line const *line2) + { + const struct outlist *outlist; +- char output_separator = tab < 0 ? ' ' : tab; + + outlist = outlist_head.next; + if (outlist) +@@ -404,12 +635,12 @@ + if (o->file == 0) + { + if (line1 == &uni_blank) +- { ++ { + line = line2; + field = join_field_2; + } + else +- { ++ { + line = line1; + field = join_field_1; + } +@@ -423,7 +654,7 @@ + o = o->next; + if (o == NULL) + break; +- putchar (output_separator); ++ PUT_TAB_CHAR; + } + putchar ('\n'); + } +@@ -441,23 +672,23 @@ + prfield (join_field_1, line1); + for (i = 0; i < join_field_1 && i < line1->nfields; ++i) + { +- putchar (output_separator); ++ PUT_TAB_CHAR; + prfield (i, line1); + } + for (i = join_field_1 + 1; i < line1->nfields; ++i) + { +- putchar (output_separator); ++ PUT_TAB_CHAR; + prfield (i, line1); + } + + for (i = 0; i < join_field_2 && i < line2->nfields; ++i) + { +- putchar (output_separator); ++ PUT_TAB_CHAR; + prfield (i, line2); + } + for (i = join_field_2 + 1; i < line2->nfields; ++i) + { +- putchar (output_separator); ++ PUT_TAB_CHAR; + prfield (i, line2); + } + putchar ('\n'); +@@ -869,20 +1100,41 @@ + + case 't': + { +- unsigned char newtab = optarg[0]; +- if (! newtab) ++ char *newtab; ++ size_t newtablen; ++ if (! optarg[0]) + error (EXIT_FAILURE, 0, _("empty tab")); +- if (optarg[1]) ++ newtab = xstrdup (optarg); ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ { ++ mbstate_t state; ++ ++ memset (&state, 0, sizeof (mbstate_t)); ++ newtablen = mbrtowc (NULL, newtab, ++ strnlen (newtab, MB_LEN_MAX), ++ &state); ++ if (newtablen == (size_t) 0 ++ || newtablen == (size_t) -1 ++ || newtablen == (size_t) -2) ++ newtablen = 1; ++ } ++ else ++#endif ++ newtablen = 1; ++ ++ if (newtablen == 1 && newtab[1]) ++ { ++ if (STREQ (newtab, "\\0")) ++ newtab[0] = '\0'; ++ } ++ if (tab != NULL && strcmp (tab, newtab)) + { +- if (STREQ (optarg, "\\0")) +- newtab = '\0'; +- else +- error (EXIT_FAILURE, 0, _("multi-character tab %s"), +- quote (optarg)); ++ free (newtab); ++ error (EXIT_FAILURE, 0, _("incompatible tabs")); + } +- if (0 <= tab && tab != newtab) +- error (EXIT_FAILURE, 0, _("incompatible tabs")); + tab = newtab; ++ tablen = newtablen; + } + break; + +--- coreutils-5.93/src/unexpand.c.i18n 2005-08-12 08:16:25.000000000 +0100 ++++ coreutils-5.93/src/unexpand.c 2005-12-23 08:53:01.000000000 +0000 +@@ -39,11 +39,28 @@ + #include + #include + #include ++ ++/* Get mbstate_t, mbrtowc(), wcwidth(). */ ++#if HAVE_WCHAR_H ++# include ++#endif ++ + #include "system.h" + #include "error.h" + #include "quote.h" + #include "xstrndup.h" + ++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC ++ installation; work around this configuration error. */ ++#if !defined MB_LEN_MAX || MB_LEN_MAX < 2 ++# define MB_LEN_MAX 16 ++#endif ++ ++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */ ++#if HAVE_MBRTOWC && defined mbstate_t ++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) ++#endif ++ + /* The official name of this program (e.g., no `g' prefix). */ + #define PROGRAM_NAME "unexpand" + +@@ -110,6 +127,208 @@ + {NULL, 0, NULL, 0} + }; + ++static FILE *next_file (FILE *fp); ++ ++#if HAVE_MBRTOWC ++static void ++unexpand_multibyte (void) ++{ ++ FILE *fp; /* Input stream. */ ++ mbstate_t i_state; /* Current shift state of the input stream. */ ++ mbstate_t i_state_bak; /* Back up the I_STATE. */ ++ mbstate_t o_state; /* Current shift state of the output stream. */ ++ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */ ++ char *bufpos; /* Next read position of BUF. */ ++ size_t buflen = 0; /* The length of the byte sequence in buf. */ ++ wint_t wc; /* A gotten wide character. */ ++ size_t mblength; /* The byte size of a multibyte character ++ which shows as same character as WC. */ ++ ++ /* Index in `tab_list' of next tabstop: */ ++ int tab_index = 0; /* For calculating width of pending tabs. */ ++ int print_tab_index = 0; /* For printing as many tabs as possible. */ ++ unsigned int column = 0; /* Column on screen of next char. */ ++ int next_tab_column; /* Column the next tab stop is on. */ ++ int convert = 1; /* If nonzero, perform translations. */ ++ unsigned int pending = 0; /* Pending columns of blanks. */ ++ ++ fp = next_file ((FILE *) NULL); ++ if (fp == NULL) ++ return; ++ ++ memset (&o_state, '\0', sizeof(mbstate_t)); ++ memset (&i_state, '\0', sizeof(mbstate_t)); ++ ++ for (;;) ++ { ++ if (buflen < MB_LEN_MAX && !feof(fp) && !ferror(fp)) ++ { ++ memmove (buf, bufpos, buflen); ++ buflen += fread (buf + buflen, sizeof(char), BUFSIZ, fp); ++ bufpos = buf; ++ } ++ ++ /* Get a wide character. */ ++ if (buflen < 1) ++ { ++ mblength = 1; ++ wc = WEOF; ++ } ++ else ++ { ++ i_state_bak = i_state; ++ mblength = mbrtowc ((wchar_t *)&wc, bufpos, buflen, &i_state); ++ } ++ ++ if (mblength == (size_t)-1 || mblength == (size_t)-2) ++ { ++ i_state = i_state_bak; ++ wc = L'\0'; ++ } ++ ++ if (wc == L' ' && convert && column < INT_MAX) ++ { ++ ++pending; ++ ++column; ++ } ++ else if (wc == L'\t' && convert) ++ { ++ if (tab_size == 0) ++ { ++ /* Do not let tab_index == first_free_tab; ++ stop when it is 1 less. */ ++ while (tab_index < first_free_tab - 1 ++ && column >= tab_list[tab_index]) ++ tab_index++; ++ next_tab_column = tab_list[tab_index]; ++ if (tab_index < first_free_tab - 1) ++ tab_index++; ++ if (column >= next_tab_column) ++ { ++ convert = 0; /* Ran out of tab stops. */ ++ goto flush_pend_mb; ++ } ++ } ++ else ++ { ++ next_tab_column = column + tab_size - column % tab_size; ++ } ++ pending += next_tab_column - column; ++ column = next_tab_column; ++ } ++ else ++ { ++flush_pend_mb: ++ /* Flush pending spaces. Print as many tabs as possible, ++ then print the rest as spaces. */ ++ if (pending == 1) ++ { ++ putchar (' '); ++ pending = 0; ++ } ++ column -= pending; ++ while (pending > 0) ++ { ++ if (tab_size == 0) ++ { ++ /* Do not let print_tab_index == first_free_tab; ++ stop when it is 1 less. */ ++ while (print_tab_index < first_free_tab - 1 ++ && column >= tab_list[print_tab_index]) ++ print_tab_index++; ++ next_tab_column = tab_list[print_tab_index]; ++ if (print_tab_index < first_free_tab - 1) ++ print_tab_index++; ++ } ++ else ++ { ++ next_tab_column = ++ column + tab_size - column % tab_size; ++ } ++ if (next_tab_column - column <= pending) ++ { ++ putchar ('\t'); ++ pending -= next_tab_column - column; ++ column = next_tab_column; ++ } ++ else ++ { ++ --print_tab_index; ++ column += pending; ++ while (pending != 0) ++ { ++ putchar (' '); ++ pending--; ++ } ++ } ++ } ++ ++ if (wc == WEOF) ++ { ++ fp = next_file (fp); ++ if (fp == NULL) ++ break; /* No more files. */ ++ else ++ { ++ memset (&i_state, '\0', sizeof(mbstate_t)); ++ continue; ++ } ++ } ++ ++ if (mblength == (size_t)-1 || mblength == (size_t)-2) ++ { ++ if (convert) ++ { ++ ++column; ++ if (convert_entire_line == 0) ++ convert = 0; ++ } ++ mblength = 1; ++ putchar (buf[0]); ++ } ++ else if (mblength == 0) ++ { ++ if (convert && convert_entire_line == 0) ++ convert = 0; ++ mblength = 1; ++ putchar ('\0'); ++ } ++ else ++ { ++ if (convert) ++ { ++ if (wc == L'\b') ++ { ++ if (column > 0) ++ --column; ++ } ++ else ++ { ++ int width; /* The width of WC. */ ++ ++ width = wcwidth (wc); ++ column += (width > 0) ? width : 0; ++ if (convert_entire_line == 0) ++ convert = 0; ++ } ++ } ++ ++ if (wc == L'\n') ++ { ++ tab_index = print_tab_index = 0; ++ column = pending = 0; ++ convert = 1; ++ } ++ fwrite (bufpos, sizeof(char), mblength, stdout); ++ } ++ } ++ buflen -= mblength; ++ bufpos += mblength; ++ } ++} ++#endif ++ ++ + void + usage (int status) + { +@@ -532,7 +751,12 @@ + + file_list = (optind < argc ? &argv[optind] : stdin_argv); + +- unexpand (); ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ unexpand_multibyte (); ++ else ++#endif ++ unexpand (); + + if (have_read_stdin && fclose (stdin) != 0) + error (EXIT_FAILURE, errno, "-"); +--- coreutils-5.93/src/sort.c.i18n 2005-10-07 19:48:28.000000000 +0100 ++++ coreutils-5.93/src/sort.c 2005-12-23 10:38:44.000000000 +0000 +@@ -23,9 +23,18 @@ + + #include + ++#include + #include + #include + #include ++#if HAVE_WCHAR_H ++# include ++#endif ++/* Get isw* functions. */ ++#if HAVE_WCTYPE_H ++# include ++#endif ++ + #include "system.h" + #include "error.h" + #include "hard-locale.h" +@@ -95,14 +104,38 @@ + /* Thousands separator; if -1, then there isn't one. */ + static int thousands_sep; + ++static int force_general_numcompare = 0; ++ + /* Nonzero if the corresponding locales are hard. */ + static bool hard_LC_COLLATE; +-#if HAVE_NL_LANGINFO ++#if HAVE_LANGINFO_CODESET + static bool hard_LC_TIME; + #endif + + #define NONZERO(x) ((x) != 0) + ++/* get a multibyte character's byte length. */ ++#define GET_BYTELEN_OF_CHAR(LIM, PTR, MBLENGTH, STATE) \ ++ do \ ++ { \ ++ wchar_t wc; \ ++ mbstate_t state_bak; \ ++ \ ++ state_bak = STATE; \ ++ mblength = mbrtowc (&wc, PTR, LIM - PTR, &STATE); \ ++ \ ++ switch (MBLENGTH) \ ++ { \ ++ case (size_t)-1: \ ++ case (size_t)-2: \ ++ STATE = state_bak; \ ++ /* Fall through. */ \ ++ case 0: \ ++ MBLENGTH = 1; \ ++ } \ ++ } \ ++ while (0) ++ + /* The kind of blanks for '-b' to skip in various options. */ + enum blanktype { bl_start, bl_end, bl_both }; + +@@ -239,13 +272,11 @@ + they were read if all keys compare equal. */ + static bool stable; + +-/* If TAB has this value, blanks separate fields. */ +-enum { TAB_DEFAULT = CHAR_MAX + 1 }; +- +-/* Tab character separating fields. If TAB_DEFAULT, then fields are ++/* Tab character separating fields. If tab_length is 0, then fields are + separated by the empty string between a non-blank character and a blank + character. */ +-static int tab = TAB_DEFAULT; ++static char tab[MB_LEN_MAX + 1]; ++static size_t tab_length = 0; + + /* Flag to remove consecutive duplicate lines from the output. + Only the last of a sequence of equal lines will be output. */ +@@ -392,6 +423,44 @@ + static struct tempnode *volatile temphead; + static struct tempnode *volatile *temptail = &temphead; + ++/* Function pointers. */ ++static void ++(*inittables) (void); ++static char * ++(*begfield) (const struct line*, const struct keyfield *); ++static char * ++(*limfield) (const struct line*, const struct keyfield *); ++static int ++(*getmonth) (char const *, size_t); ++static int ++(*keycompare) (const struct line *, const struct line *); ++static int ++(*numcompare) (const char *, const char *); ++ ++/* Test for white space multibyte character. ++ Set LENGTH the byte length of investigated multibyte character. */ ++#if HAVE_MBRTOWC ++static int ++ismbblank (const char *str, size_t len, size_t *length) ++{ ++ size_t mblength; ++ wchar_t wc; ++ mbstate_t state; ++ ++ memset (&state, '\0', sizeof(mbstate_t)); ++ mblength = mbrtowc (&wc, str, len, &state); ++ ++ if (mblength == (size_t)-1 || mblength == (size_t)-2) ++ { ++ *length = 1; ++ return 0; ++ } ++ ++ *length = (mblength < 1) ? 1 : mblength; ++ return iswblank (wc); ++} ++#endif ++ + /* Clean up any remaining temporary files. */ + + static void +@@ -545,7 +614,7 @@ + free (node); + } + +-#if HAVE_NL_LANGINFO ++#if HAVE_LANGINFO_CODESET + + static int + struct_month_cmp (const void *m1, const void *m2) +@@ -560,7 +629,7 @@ + /* Initialize the character class tables. */ + + static void +-inittables (void) ++inittables_uni (void) + { + size_t i; + +@@ -572,7 +641,7 @@ + fold_toupper[i] = (ISLOWER (i) ? toupper (i) : i); + } + +-#if HAVE_NL_LANGINFO ++#if HAVE_LANGINFO_CODESET + /* If we're not in the "C" locale, read different names for months. */ + if (hard_LC_TIME) + { +@@ -598,6 +667,64 @@ + #endif + } + ++#if HAVE_MBRTOWC ++static void ++inittables_mb (void) ++{ ++ int i, j, k, l; ++ char *name, *s; ++ size_t s_len, mblength; ++ char mbc[MB_LEN_MAX]; ++ wchar_t wc, pwc; ++ mbstate_t state_mb, state_wc; ++ ++ for (i = 0; i < MONTHS_PER_YEAR; i++) ++ { ++ s = (char *) nl_langinfo (ABMON_1 + i); ++ s_len = strlen (s); ++ monthtab[i].name = name = (char *) xmalloc (s_len + 1); ++ monthtab[i].val = i + 1; ++ ++ memset (&state_mb, '\0', sizeof (mbstate_t)); ++ memset (&state_wc, '\0', sizeof (mbstate_t)); ++ ++ for (j = 0; j < s_len;) ++ { ++ if (!ismbblank (s + j, s_len - j, &mblength)) ++ break; ++ j += mblength; ++ } ++ ++ for (k = 0; j < s_len;) ++ { ++ mblength = mbrtowc (&wc, (s + j), (s_len - j), &state_mb); ++ assert (mblength != (size_t)-1 && mblength != (size_t)-2); ++ if (mblength == 0) ++ break; ++ ++ pwc = towupper (wc); ++ if (pwc == wc) ++ { ++ memcpy (mbc, s + j, mblength); ++ j += mblength; ++ } ++ else ++ { ++ j += mblength; ++ mblength = wcrtomb (mbc, pwc, &state_wc); ++ assert (mblength != (size_t)0 && mblength != (size_t)-1); ++ } ++ ++ for (l = 0; l < mblength; l++) ++ name[k++] = mbc[l]; ++ } ++ name[k] = '\0'; ++ } ++ qsort ((void *) monthtab, MONTHS_PER_YEAR, ++ sizeof (struct month), struct_month_cmp); ++} ++#endif ++ + /* Specify the amount of main memory to use when sorting. */ + static void + specify_sort_size (char const *s) +@@ -808,7 +935,7 @@ + by KEY in LINE. */ + + static char * +-begfield (const struct line *line, const struct keyfield *key) ++begfield_uni (const struct line *line, const struct keyfield *key) + { + char *ptr = line->text, *lim = ptr + line->length - 1; + size_t sword = key->sword; +@@ -818,10 +945,10 @@ + /* The leading field separator itself is included in a field when -t + is absent. */ + +- if (tab != TAB_DEFAULT) ++ if (tab_length) + while (ptr < lim && sword--) + { +- while (ptr < lim && *ptr != tab) ++ while (ptr < lim && *ptr != tab[0]) + ++ptr; + if (ptr < lim) + ++ptr; +@@ -849,11 +976,70 @@ + return ptr; + } + ++#if HAVE_MBRTOWC ++static char * ++begfield_mb (const struct line *line, const struct keyfield *key) ++{ ++ int i; ++ char *ptr = line->text, *lim = ptr + line->length - 1; ++ size_t sword = key->sword; ++ size_t schar = key->schar; ++ size_t mblength; ++ mbstate_t state; ++ ++ memset (&state, '\0', sizeof(mbstate_t)); ++ ++ if (tab_length) ++ while (ptr < lim && sword--) ++ { ++ while (ptr < lim && memcmp (ptr, tab, tab_length) != 0) ++ { ++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state); ++ ptr += mblength; ++ } ++ if (ptr < lim) ++ { ++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state); ++ ptr += mblength; ++ } ++ } ++ else ++ while (ptr < lim && sword--) ++ { ++ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength)) ++ ptr += mblength; ++ if (ptr < lim) ++ { ++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state); ++ ptr += mblength; ++ } ++ while (ptr < lim && !ismbblank (ptr, lim - ptr, &mblength)) ++ ptr += mblength; ++ } ++ ++ if (key->skipsblanks) ++ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength)) ++ ptr += mblength; ++ ++ for (i = 0; i < schar; i++) ++ { ++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state); ++ ++ if (ptr + mblength > lim) ++ break; ++ else ++ ptr += mblength; ++ } ++ ++ return ptr; ++} ++#endif ++ + /* Return the limit of (a pointer to the first character after) the field + in LINE specified by KEY. */ + + static char * +-limfield (const struct line *line, const struct keyfield *key) ++limfield_uni (const struct line *line, const struct keyfield *key) + { + char *ptr = line->text, *lim = ptr + line->length - 1; + size_t eword = key->eword, echar = key->echar; +@@ -866,10 +1052,10 @@ + `beginning' is the first character following the delimiting TAB. + Otherwise, leave PTR pointing at the first `blank' character after + the preceding field. */ +- if (tab != TAB_DEFAULT) ++ if (tab_length) + while (ptr < lim && eword--) + { +- while (ptr < lim && *ptr != tab) ++ while (ptr < lim && *ptr != tab[0]) + ++ptr; + if (ptr < lim && (eword | echar)) + ++ptr; +@@ -915,10 +1101,10 @@ + */ + + /* Make LIM point to the end of (one byte past) the current field. */ +- if (tab != TAB_DEFAULT) ++ if (tab_length) + { + char *newlim; +- newlim = memchr (ptr, tab, lim - ptr); ++ newlim = memchr (ptr, tab[0], lim - ptr); + if (newlim) + lim = newlim; + } +@@ -951,6 +1137,107 @@ + return ptr; + } + ++#if HAVE_MBRTOWC ++static char * ++limfield_mb (const struct line *line, const struct keyfield *key) ++{ ++ char *ptr = line->text, *lim = ptr + line->length - 1; ++ size_t eword = key->eword, echar = key->echar; ++ int i; ++ size_t mblength; ++ mbstate_t state; ++ ++ memset (&state, '\0', sizeof(mbstate_t)); ++ ++ if (tab_length) ++ while (ptr < lim && eword--) ++ { ++ while (ptr < lim && memcmp (ptr, tab, tab_length) != 0) ++ { ++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state); ++ ptr += mblength; ++ } ++ if (ptr < lim && (eword | echar)) ++ { ++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state); ++ ptr += mblength; ++ } ++ } ++ else ++ while (ptr < lim && eword--) ++ { ++ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength)) ++ ptr += mblength; ++ if (ptr < lim) ++ { ++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state); ++ ptr += mblength; ++ } ++ while (ptr < lim && !ismbblank (ptr, lim - ptr, &mblength)) ++ ptr += mblength; ++ } ++ ++ ++# ifdef POSIX_UNSPECIFIED ++ /* Make LIM point to the end of (one byte past) the current field. */ ++ if (tab_length) ++ { ++ char *newlim, *p; ++ ++ newlim = NULL; ++ for (p = ptr; p < lim;) ++ { ++ if (memcmp (p, tab, tab_length) == 0) ++ { ++ newlim = p; ++ break; ++ } ++ ++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state); ++ p += mblength; ++ } ++ } ++ else ++ { ++ char *newlim; ++ newlim = ptr; ++ ++ while (newlim < lim && ismbblank (newlim, lim - newlim, &mblength)) ++ newlim += mblength; ++ if (ptr < lim) ++ { ++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state); ++ ptr += mblength; ++ } ++ while (newlim < lim && !ismbblank (newlim, lim - newlim, &mblength)) ++ newlim += mblength; ++ lim = newlim; ++ } ++# endif ++ ++ /* If we're skipping leading blanks, don't start counting characters ++ * until after skipping past any leading blanks. */ ++ if (key->skipsblanks) ++ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength)) ++ ptr += mblength; ++ ++ memset (&state, '\0', sizeof(mbstate_t)); ++ ++ /* Advance PTR by ECHAR (if possible), but no further than LIM. */ ++ for (i = 0; i < echar; i++) ++ { ++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state); ++ ++ if (ptr + mblength > lim) ++ break; ++ else ++ ptr += mblength; ++ } ++ ++ return ptr; ++} ++#endif ++ + /* Fill BUF reading from FP, moving buf->left bytes from the end + of buf->buf to the beginning first. If EOF is reached and the + file wasn't terminated by a newline, supply one. Set up BUF's line +@@ -1067,7 +1354,7 @@ + hideously fast. */ + + static int +-numcompare (const char *a, const char *b) ++numcompare_uni (const char *a, const char *b) + { + while (blanks[to_uchar (*a)]) + a++; +@@ -1077,6 +1364,25 @@ + return strnumcmp (a, b, decimal_point, thousands_sep); + } + ++#if HAVE_MBRTOWC ++static int ++numcompare_mb (const char *a, const char *b) ++{ ++ size_t mblength, len; ++ len = strlen (a); /* okay for UTF-8 */ ++ while (*a && ismbblank (a, len > MB_CUR_MAX ? MB_CUR_MAX : len, &mblength)) ++ { ++ a += mblength; ++ len -= mblength; ++ } ++ len = strlen (b); /* okay for UTF-8 */ ++ while (*b && ismbblank (b, len > MB_CUR_MAX ? MB_CUR_MAX : len, &mblength)) ++ b += mblength; ++ ++ return strnumcmp (a, b, decimal_point, thousands_sep); ++} ++#endif /* HAV_EMBRTOWC */ ++ + static int + general_numcompare (const char *sa, const char *sb) + { +@@ -1110,7 +1416,7 @@ + Return 0 if the name in S is not recognized. */ + + static int +-getmonth (char const *month, size_t len) ++getmonth_uni (char const *month, size_t len) + { + size_t lo = 0; + size_t hi = MONTHS_PER_YEAR; +@@ -1152,11 +1458,79 @@ + return 0; + } + ++#if HAVE_MBRTOWC ++static int ++getmonth_mb (const char *s, size_t len) ++{ ++ char *month; ++ register size_t i; ++ register int lo = 0, hi = MONTHS_PER_YEAR, result; ++ char *tmp; ++ size_t wclength, mblength; ++ const char **pp; ++ const wchar_t **wpp; ++ wchar_t *month_wcs; ++ mbstate_t state; ++ ++ while (len > 0 && ismbblank (s, len, &mblength)) ++ { ++ s += mblength; ++ len -= mblength; ++ } ++ ++ if (len == 0) ++ return 0; ++ ++ month = (char *) alloca (len + 1); ++ ++ tmp = (char *) alloca (len + 1); ++ memcpy (tmp, s, len); ++ tmp[len] = '\0'; ++ pp = (const char **)&tmp; ++ month_wcs = (wchar_t *) alloca ((len + 1) * sizeof (wchar_t)); ++ memset (&state, '\0', sizeof(mbstate_t)); ++ ++ wclength = mbsrtowcs (month_wcs, pp, len + 1, &state); ++ assert (wclength != (size_t)-1 && *pp == NULL); ++ ++ for (i = 0; i < wclength; i++) ++ { ++ month_wcs[i] = towupper(month_wcs[i]); ++ if (iswblank (month_wcs[i])) ++ { ++ month_wcs[i] = L'\0'; ++ break; ++ } ++ } ++ ++ wpp = (const wchar_t **)&month_wcs; ++ ++ mblength = wcsrtombs (month, wpp, len + 1, &state); ++ assert (mblength != (-1) && *wpp == NULL); ++ ++ do ++ { ++ int ix = (lo + hi) / 2; ++ ++ if (strncmp (month, monthtab[ix].name, strlen (monthtab[ix].name)) < 0) ++ hi = ix; ++ else ++ lo = ix; ++ } ++ while (hi - lo > 1); ++ ++ result = (!strncmp (month, monthtab[lo].name, strlen (monthtab[lo].name)) ++ ? monthtab[lo].val : 0); ++ ++ return result; ++} ++#endif ++ + /* Compare two lines A and B trying every key in sequence until there + are no more keys or a difference is found. */ + + static int +-keycompare (const struct line *a, const struct line *b) ++keycompare_uni (const struct line *a, const struct line *b) + { + struct keyfield const *key = keylist; + +@@ -1326,6 +1700,177 @@ + return key->reverse ? -diff : diff; + } + ++#if HAVE_MBRTOWC ++static int ++keycompare_mb (const struct line *a, const struct line *b) ++{ ++ struct keyfield *key = keylist; ++ ++ /* For the first iteration only, the key positions have been ++ precomputed for us. */ ++ char *texta = a->keybeg; ++ char *textb = b->keybeg; ++ char *lima = a->keylim; ++ char *limb = b->keylim; ++ ++ size_t mblength_a, mblength_b; ++ wchar_t wc_a, wc_b; ++ mbstate_t state_a, state_b; ++ ++ int diff; ++ ++ memset (&state_a, '\0', sizeof(mbstate_t)); ++ memset (&state_b, '\0', sizeof(mbstate_t)); ++ ++ for (;;) ++ { ++ unsigned char *translate = (unsigned char *) key->translate; ++ bool const *ignore = key->ignore; ++ ++ /* Find the lengths. */ ++ size_t lena = lima <= texta ? 0 : lima - texta; ++ size_t lenb = limb <= textb ? 0 : limb - textb; ++ ++ /* Actually compare the fields. */ ++ if (key->numeric | key->general_numeric) ++ { ++ char savea = *lima, saveb = *limb; ++ ++ *lima = *limb = '\0'; ++ if (force_general_numcompare) ++ diff = general_numcompare (texta, textb); ++ else ++ diff = ((key->numeric ? numcompare : general_numcompare) ++ (texta, textb)); ++ *lima = savea, *limb = saveb; ++ } ++ else if (key->month) ++ diff = getmonth (texta, lena) - getmonth (textb, lenb); ++ else ++ { ++ if (ignore || translate) ++ { ++ char *copy_a = (char *) alloca (lena + 1 + lenb + 1); ++ char *copy_b = copy_a + lena + 1; ++ size_t new_len_a, new_len_b; ++ size_t i, j; ++ ++ /* Ignore and/or translate chars before comparing. */ ++# define IGNORE_CHARS(NEW_LEN, LEN, TEXT, COPY, WC, MBLENGTH, STATE) \ ++ do \ ++ { \ ++ wchar_t uwc; \ ++ char mbc[MB_LEN_MAX]; \ ++ mbstate_t state_wc; \ ++ \ ++ for (NEW_LEN = i = 0; i < LEN;) \ ++ { \ ++ mbstate_t state_bak; \ ++ \ ++ state_bak = STATE; \ ++ MBLENGTH = mbrtowc (&WC, TEXT + i, LEN - i, &STATE); \ ++ \ ++ if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1 \ ++ || MBLENGTH == 0) \ ++ { \ ++ if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1) \ ++ STATE = state_bak; \ ++ if (!ignore) \ ++ COPY[NEW_LEN++] = TEXT[i++]; \ ++ continue; \ ++ } \ ++ \ ++ if (ignore) \ ++ { \ ++ if ((ignore == nonprinting && !iswprint (WC)) \ ++ || (ignore == nondictionary \ ++ && !iswalnum (WC) && !iswblank (WC))) \ ++ { \ ++ i += MBLENGTH; \ ++ continue; \ ++ } \ ++ } \ ++ \ ++ if (translate) \ ++ { \ ++ \ ++ uwc = towupper(WC); \ ++ if (WC == uwc) \ ++ { \ ++ memcpy (mbc, TEXT + i, MBLENGTH); \ ++ i += MBLENGTH; \ ++ } \ ++ else \ ++ { \ ++ i += MBLENGTH; \ ++ WC = uwc; \ ++ memset (&state_wc, '\0', sizeof (mbstate_t)); \ ++ \ ++ MBLENGTH = wcrtomb (mbc, WC, &state_wc); \ ++ assert (MBLENGTH != (size_t)-1 && MBLENGTH != 0); \ ++ } \ ++ \ ++ for (j = 0; j < MBLENGTH; j++) \ ++ COPY[NEW_LEN++] = mbc[j]; \ ++ } \ ++ else \ ++ for (j = 0; j < MBLENGTH; j++) \ ++ COPY[NEW_LEN++] = TEXT[i++]; \ ++ } \ ++ COPY[NEW_LEN] = '\0'; \ ++ } \ ++ while (0) ++ IGNORE_CHARS (new_len_a, lena, texta, copy_a, ++ wc_a, mblength_a, state_a); ++ IGNORE_CHARS (new_len_b, lenb, textb, copy_b, ++ wc_b, mblength_b, state_b); ++ diff = xmemcoll (copy_a, new_len_a, copy_b, new_len_b); ++ } ++ else if (lena == 0) ++ diff = - NONZERO (lenb); ++ else if (lenb == 0) ++ goto greater; ++ else ++ diff = xmemcoll (texta, lena, textb, lenb); ++ } ++ ++ if (diff) ++ goto not_equal; ++ ++ key = key->next; ++ if (! key) ++ break; ++ ++ /* Find the beginning and limit of the next field. */ ++ if (key->eword != -1) ++ lima = limfield (a, key), limb = limfield (b, key); ++ else ++ lima = a->text + a->length - 1, limb = b->text + b->length - 1; ++ ++ if (key->sword != -1) ++ texta = begfield (a, key), textb = begfield (b, key); ++ else ++ { ++ texta = a->text, textb = b->text; ++ if (key->skipsblanks) ++ { ++ while (texta < lima && ismbblank (texta, lima - texta, &mblength_a)) ++ texta += mblength_a; ++ while (textb < limb && ismbblank (textb, limb - textb, &mblength_b)) ++ textb += mblength_b; ++ } ++ } ++ } ++ ++ return 0; ++ ++greater: ++ diff = 1; ++not_equal: ++ return key->reverse ? -diff : diff; ++} ++#endif ++ + /* Compare two lines A and B, returning negative, zero, or positive + depending on whether A compares less than, equal to, or greater than B. */ + +@@ -2127,7 +2672,7 @@ + atexit (close_stdout); + + hard_LC_COLLATE = hard_locale (LC_COLLATE); +-#if HAVE_NL_LANGINFO ++#if HAVE_LANGINFO_CODESET + hard_LC_TIME = hard_locale (LC_TIME); + #endif + +@@ -2148,6 +2693,27 @@ + thousands_sep = -1; + } + ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ { ++ inittables = inittables_mb; ++ begfield = begfield_mb; ++ limfield = limfield_mb; ++ getmonth = getmonth_mb; ++ keycompare = keycompare_mb; ++ numcompare = numcompare_mb; ++ } ++ else ++#endif ++ { ++ inittables = inittables_uni; ++ begfield = begfield_uni; ++ limfield = limfield_uni; ++ getmonth = getmonth_uni; ++ keycompare = keycompare_uni; ++ numcompare = numcompare_uni; ++ } ++ + have_read_stdin = false; + inittables (); + +@@ -2349,13 +2915,35 @@ + + case 't': + { +- char newtab = optarg[0]; +- if (! newtab) ++ char newtab[MB_LEN_MAX + 1]; ++ size_t newtab_length = 1; ++ strncpy (newtab, optarg, MB_LEN_MAX); ++ if (! newtab[0]) + error (SORT_FAILURE, 0, _("empty tab")); +- if (optarg[1]) ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ { ++ wchar_t wc; ++ mbstate_t state; ++ size_t i; ++ ++ memset (&state, '\0', sizeof (mbstate_t)); ++ newtab_length = mbrtowc (&wc, newtab, strnlen (newtab, ++ MB_LEN_MAX), ++ &state); ++ switch (newtab_length) ++ { ++ case (size_t) -1: ++ case (size_t) -2: ++ case 0: ++ newtab_length = 1; ++ } ++ } ++#endif ++ if (newtab_length == 1 && optarg[1]) + { + if (STREQ (optarg, "\\0")) +- newtab = '\0'; ++ newtab[0] = '\0'; + else + { + /* Provoke with `sort -txx'. Complain about +@@ -2366,9 +2954,12 @@ + quote (optarg)); + } + } +- if (tab != TAB_DEFAULT && tab != newtab) ++ if (tab_length ++ && (tab_length != newtab_length ++ || memcmp (tab, newtab, tab_length) != 0)) + error (SORT_FAILURE, 0, _("incompatible tabs")); +- tab = newtab; ++ memcpy (tab, newtab, newtab_length); ++ tab_length = newtab_length; + } + break; + +--- /dev/null 2005-10-10 09:36:06.437701000 +0100 ++++ coreutils-5.93/tests/sort/sort-mb-tests 2005-12-23 08:53:01.000000000 +0000 +@@ -0,0 +1,58 @@ ++#! /bin/sh ++case $# in ++ 0) xx='../../src/sort';; ++ *) xx="$1";; ++esac ++test "$VERBOSE" && echo=echo || echo=: ++$echo testing program: $xx ++errors=0 ++test "$srcdir" || srcdir=. ++test "$VERBOSE" && $xx --version 2> /dev/null ++ ++export LC_ALL=en_US.UTF-8 ++locale -k LC_CTYPE 2>&1 | grep -q charmap.*UTF-8 || exit 77 ++errors=0 ++ ++$xx -t ï¼  -k2 -n mb1.I > mb1.O ++code=$? ++if test $code != 0; then ++ $echo "Test mb1 failed: $xx return code $code differs from expected value 0" 1>&2 ++ errors=`expr $errors + 1` ++else ++ cmp mb1.O $srcdir/mb1.X > /dev/null 2>&1 ++ case $? in ++ 0) if test "$VERBOSE"; then $echo "passed mb1"; fi;; ++ 1) $echo "Test mb1 failed: files mb1.O and $srcdir/mb1.X differ" 1>&2 ++ (diff -c mb1.O $srcdir/mb1.X) 2> /dev/null ++ errors=`expr $errors + 1`;; ++ 2) $echo "Test mb1 may have failed." 1>&2 ++ $echo The command "cmp mb1.O $srcdir/mb1.X" failed. 1>&2 ++ errors=`expr $errors + 1`;; ++ esac ++fi ++ ++$xx -t ï¼  -k4 -n mb2.I > mb2.O ++code=$? ++if test $code != 0; then ++ $echo "Test mb2 failed: $xx return code $code differs from expected value 0" 1>&2 ++ errors=`expr $errors + 1` ++else ++ cmp mb2.O $srcdir/mb2.X > /dev/null 2>&1 ++ case $? in ++ 0) if test "$VERBOSE"; then $echo "passed mb2"; fi;; ++ 1) $echo "Test mb2 failed: files mb2.O and $srcdir/mb2.X differ" 1>&2 ++ (diff -c mb2.O $srcdir/mb2.X) 2> /dev/null ++ errors=`expr $errors + 1`;; ++ 2) $echo "Test mb2 may have failed." 1>&2 ++ $echo The command "cmp mb2.O $srcdir/mb2.X" failed. 1>&2 ++ errors=`expr $errors + 1`;; ++ esac ++fi ++ ++if test $errors = 0; then ++ $echo Passed all 113 tests. 1>&2 ++else ++ $echo Failed $errors tests. 1>&2 ++fi ++test $errors = 0 || errors=1 ++exit $errors +--- /dev/null 2005-10-10 09:36:06.437701000 +0100 ++++ coreutils-5.93/tests/sort/mb1.I 2005-12-23 08:53:01.000000000 +0000 +@@ -0,0 +1,4 @@ ++Appleï¼ 10 ++Bananaï¼ 5 ++Citrusï¼ 20 ++Cherryï¼ 30 +--- /dev/null 2005-10-10 09:36:06.437701000 +0100 ++++ coreutils-5.93/tests/sort/mb2.I 2005-12-23 08:53:01.000000000 +0000 +@@ -0,0 +1,4 @@ ++Apple@AA10ï¼ ï¼ 20 ++Banana@AA5ï¼ ï¼ 30 ++Citrus@AA20ï¼ ï¼ 5 ++Cherry@AA30ï¼ ï¼ 10 +--- /dev/null 2005-10-10 09:36:06.437701000 +0100 ++++ coreutils-5.93/tests/sort/mb1.X 2005-12-23 08:53:01.000000000 +0000 +@@ -0,0 +1,4 @@ ++Bananaï¼ 5 ++Appleï¼ 10 ++Citrusï¼ 20 ++Cherryï¼ 30 +--- /dev/null 2005-10-10 09:36:06.437701000 +0100 ++++ coreutils-5.93/tests/sort/mb2.X 2005-12-23 08:53:01.000000000 +0000 +@@ -0,0 +1,4 @@ ++Citrus@AA20ï¼ ï¼ 5 ++Cherry@AA30ï¼ ï¼ 10 ++Apple@AA10ï¼ ï¼ 20 ++Banana@AA5ï¼ ï¼ 30 +--- coreutils-5.93/tests/sort/Makefile.am.i18n 2005-10-24 22:02:25.000000000 +0100 ++++ coreutils-5.93/tests/sort/Makefile.am 2005-12-23 08:53:01.000000000 +0000 +@@ -43,14 +43,16 @@ + nul-nls.E use-nl.O use-nl.E o2.O o2.E nul-tab.O nul-tab.E + ##test-files-end + +-EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen) +-noinst_SCRIPTS = $x-tests ++run_gen += mb1.O mb2.O ++ ++EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen) mb1.I mb1.X mb2.I mb2.X ++noinst_SCRIPTS = $x-tests # $x-mb-tests + TESTS_ENVIRONMENT = \ + PATH="`pwd`/../../src$(PATH_SEPARATOR)$$PATH" + + editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,$(srcdir),g' + +-TESTS = $x-tests ++TESTS = $x-tests $x-mb-tests + + mk_script = $(srcdir)/../mk-script + $(srcdir)/$x-tests: $(mk_script) Test.pm Makefile.am +--- coreutils-5.93/tests/sort/Makefile.in.i18n 2005-10-22 19:13:23.000000000 +0100 ++++ coreutils-5.93/tests/sort/Makefile.in 2005-10-26 22:17:04.000000000 +0100 +@@ -338,13 +338,15 @@ + o-no-file1.E create-empty.O create-empty.E neg-nls.O neg-nls.E nul-nls.O \ + nul-nls.E use-nl.O use-nl.E o2.O o2.E nul-tab.O nul-tab.E + +-EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen) +-noinst_SCRIPTS = $x-tests ++run_gen += mb1.O mb2.O ++ ++EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen) mb1.I mb1.X mb2.I mb2.X ++noinst_SCRIPTS = $x-tests # $x-mb-tests + TESTS_ENVIRONMENT = \ + PATH="`pwd`/../../src$(PATH_SEPARATOR)$$PATH" + + editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,$(srcdir),g' +-TESTS = $x-tests ++TESTS = $x-tests $x-mb-tests + mk_script = $(srcdir)/../mk-script + MAINTAINERCLEANFILES = $x-tests $(maint_gen) + CLEANFILES = $(run_gen) diff --git a/base-source/coreutils-5.96-suppress_uptime_kill_su-1.patch b/base-source/coreutils-5.96-suppress_uptime_kill_su-1.patch new file mode 100644 index 0000000..6a08909 --- /dev/null +++ b/base-source/coreutils-5.96-suppress_uptime_kill_su-1.patch @@ -0,0 +1,272 @@ +Submitted By: Matthew Burgess +Date: 2006-03-15 +Initial Package Version: 5.94 +Origin: original suppress_hotname_uptame_kill_su patch (Robert Connolly) +Upstream Status: N/A +Description: This patch supresses the building of uptime, and kill. The su +command is built so the testsuite can run, use './src/su', but it will not +be installed. Also see: + http://www.linuxfromscratch.org/patches/downloads/coreutils/ + coreutils-5.0-dupes-2.patch + +diff -Naur coreutils-5.94.orig/AUTHORS coreutils-5.94/AUTHORS +--- coreutils-5.94.orig/AUTHORS 2004-11-03 23:10:50.000000000 +0000 ++++ coreutils-5.94/AUTHORS 2006-03-15 22:20:49.000000000 +0000 +@@ -34,7 +34,6 @@ + hostname: Jim Meyering + id: Arnold Robbins, David MacKenzie + join: Mike Haertel +-kill: Paul Eggert + link: Michael Stone + ln: Mike Parker, David MacKenzie + logname: FIXME: unknown +@@ -83,7 +82,6 @@ + unexpand: David MacKenzie + uniq: Richard Stallman, David MacKenzie + unlink: Michael Stone +-uptime: Joseph Arceneaux, David MacKenzie, Kaveh Ghazi + users: Joseph Arceneaux, David MacKenzie + vdir: Richard Stallman, David MacKenzie + wc: Paul Rubin, David MacKenzie +diff -Naur coreutils-5.94.orig/Makefile.in coreutils-5.94/Makefile.in +--- coreutils-5.94.orig/Makefile.in 2006-02-13 12:52:03.000000000 +0000 ++++ coreutils-5.94/Makefile.in 2006-03-15 22:20:49.000000000 +0000 +@@ -148,7 +148,7 @@ + $(top_srcdir)/m4/ullong_max.m4 $(top_srcdir)/m4/ulonglong.m4 \ + $(top_srcdir)/m4/unicodeio.m4 $(top_srcdir)/m4/unistd-safer.m4 \ + $(top_srcdir)/m4/unlink-busy.m4 $(top_srcdir)/m4/unlinkdir.m4 \ +- $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/uptime.m4 \ ++ $(top_srcdir)/m4/unlocked-io.m4 \ + $(top_srcdir)/m4/userspec.m4 $(top_srcdir)/m4/utimbuf.m4 \ + $(top_srcdir)/m4/utime.m4 $(top_srcdir)/m4/utimecmp.m4 \ + $(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes-null.m4 \ +diff -Naur coreutils-5.94.orig/README coreutils-5.94/README +--- coreutils-5.94.orig/README 2005-09-28 18:34:26.000000000 +0000 ++++ coreutils-5.94/README 2006-03-15 22:20:49.000000000 +0000 +@@ -9,11 +9,11 @@ + + [ basename cat chgrp chmod chown chroot cksum comm cp csplit cut date dd + df dir dircolors dirname du echo env expand expr factor false fmt fold +- ginstall groups head hostid hostname id join kill link ln logname ls ++ ginstall groups head hostid hostname id join link ln logname ls + md5sum mkdir mkfifo mknod mv nice nl nohup od paste pathchk pinky pr + printenv printf ptx pwd readlink rm rmdir seq sha1sum shred sleep sort + split stat stty su sum sync tac tail tee test touch tr true tsort tty +- uname unexpand uniq unlink uptime users vdir wc who whoami yes ++ uname unexpand uniq unlink users vdir wc who whoami yes + + See the file NEWS for a list of major changes in the current release. + +diff -Naur coreutils-5.94.orig/configure coreutils-5.94/configure +--- coreutils-5.94.orig/configure 2006-02-13 12:52:04.000000000 +0000 ++++ coreutils-5.94/configure 2006-03-15 22:20:49.000000000 +0000 +@@ -50418,8 +50418,7 @@ + { echo "$as_me:$LINENO: result: $gnulib_cv_have_boot_time" >&5 + echo "${ECHO_T}$gnulib_cv_have_boot_time" >&6; } + if test $gnulib_cv_have_boot_time = yes; then +- OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uptime\$(EXEEXT)" +- MAN="$MAN uptime.1" ++echo "uptime is suppressed" + fi + + +diff -Naur coreutils-5.94.orig/man/Makefile.in coreutils-5.94/man/Makefile.in +--- coreutils-5.94.orig/man/Makefile.in 2006-02-13 12:51:58.000000000 +0000 ++++ coreutils-5.94/man/Makefile.in 2006-03-15 22:20:50.000000000 +0000 +@@ -142,7 +142,7 @@ + $(top_srcdir)/m4/ullong_max.m4 $(top_srcdir)/m4/ulonglong.m4 \ + $(top_srcdir)/m4/unicodeio.m4 $(top_srcdir)/m4/unistd-safer.m4 \ + $(top_srcdir)/m4/unlink-busy.m4 $(top_srcdir)/m4/unlinkdir.m4 \ +- $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/uptime.m4 \ ++ $(top_srcdir)/m4/unlocked-io.m4 \ + $(top_srcdir)/m4/userspec.m4 $(top_srcdir)/m4/utimbuf.m4 \ + $(top_srcdir)/m4/utime.m4 $(top_srcdir)/m4/utimecmp.m4 \ + $(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes-null.m4 \ +@@ -303,13 +303,13 @@ + basename.1 cat.1 chgrp.1 chmod.1 chown.1 chroot.1 cksum.1 comm.1 \ + cp.1 csplit.1 cut.1 date.1 dd.1 df.1 dir.1 dircolors.1 dirname.1 du.1 \ + echo.1 env.1 expand.1 expr.1 factor.1 false.1 fmt.1 fold.1 groups.1 \ +- head.1 hostid.1 hostname.1 id.1 install.1 join.1 kill.1 \ ++ head.1 hostid.1 hostname.1 id.1 install.1 join.1 \ + link.1 ln.1 logname.1 \ + ls.1 md5sum.1 mkdir.1 mkfifo.1 mknod.1 mv.1 nice.1 nl.1 nohup.1 od.1 \ + paste.1 pathchk.1 pinky.1 pr.1 printenv.1 printf.1 ptx.1 pwd.1 readlink.1 \ + rm.1 rmdir.1 seq.1 sha1sum.1 shred.1 sleep.1 sort.1 split.1 stat.1 stty.1 \ +- su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \ +- tty.1 uname.1 unexpand.1 uniq.1 unlink.1 uptime.1 users.1 vdir.1 wc.1 \ ++ sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \ ++ tty.1 uname.1 unexpand.1 uniq.1 unlink.1 users.1 vdir.1 wc.1 \ + who.1 whoami.1 yes.1 + + man_aux = $(dist_man_MANS:.1=.x) +@@ -575,7 +575,6 @@ + id.1: $(common_dep) $(srcdir)/id.x ../src/id.c + install.1: $(common_dep) $(srcdir)/install.x ../src/install.c + join.1: $(common_dep) $(srcdir)/join.x ../src/join.c +-kill.1: $(common_dep) $(srcdir)/kill.x ../src/kill.c + link.1: $(common_dep) $(srcdir)/link.x ../src/link.c + ln.1: $(common_dep) $(srcdir)/ln.x ../src/ln.c + logname.1: $(common_dep) $(srcdir)/logname.x ../src/logname.c +@@ -608,7 +607,6 @@ + split.1: $(common_dep) $(srcdir)/split.x ../src/split.c + stat.1: $(common_dep) $(srcdir)/stat.x ../src/stat.c + stty.1: $(common_dep) $(srcdir)/stty.x ../src/stty.c +-su.1: $(common_dep) $(srcdir)/su.x ../src/su.c + sum.1: $(common_dep) $(srcdir)/sum.x ../src/sum.c + sync.1: $(common_dep) $(srcdir)/sync.x ../src/sync.c + tac.1: $(common_dep) $(srcdir)/tac.x ../src/tac.c +@@ -624,7 +622,6 @@ + unexpand.1: $(common_dep) $(srcdir)/unexpand.x ../src/unexpand.c + uniq.1: $(common_dep) $(srcdir)/uniq.x ../src/uniq.c + unlink.1: $(common_dep) $(srcdir)/unlink.x ../src/unlink.c +-uptime.1: $(common_dep) $(srcdir)/uptime.x ../src/uptime.c + users.1: $(common_dep) $(srcdir)/users.x ../src/users.c + vdir.1: $(common_dep) $(srcdir)/vdir.x ../src/ls.c + wc.1: $(common_dep) $(srcdir)/wc.x ../src/wc.c +@@ -656,7 +653,7 @@ + check-x-vs-1: + PATH=../src$(PATH_SEPARATOR)$$PATH; export PATH; \ + t=ls-files.$$$$; \ +- (cd $(srcdir) && ls -1 *.x) | sed 's/\.x$$//' | $(ASSORT) > $$t;\ ++ (cd $(srcdir) && ls -1 *.x) | grep -v -e 'kill.x' -e 'su.x' -e 'uptime.x' | sed 's/\.x$$//' | $(ASSORT) > $$t;\ + echo $(dist_man_MANS) | tr -s ' ' '\n' | sed 's/\.1$$//' \ + | $(ASSORT) | diff - $$t || { rm $$t; exit 1; }; \ + rm $$t +diff -Naur coreutils-5.94.orig/src/Makefile.in coreutils-5.94/src/Makefile.in +--- coreutils-5.94.orig/src/Makefile.in 2006-02-13 13:08:11.000000000 +0000 ++++ coreutils-5.94/src/Makefile.in 2006-03-15 22:20:50.000000000 +0000 +@@ -39,7 +39,7 @@ + host_triplet = @host@ + EXTRA_PROGRAMS = chroot$(EXEEXT) df$(EXEEXT) hostid$(EXEEXT) \ + nice$(EXEEXT) pinky$(EXEEXT) stty$(EXEEXT) su$(EXEEXT) \ +- uname$(EXEEXT) uptime$(EXEEXT) users$(EXEEXT) who$(EXEEXT) ++ uname$(EXEEXT) users$(EXEEXT) who$(EXEEXT) + bin_PROGRAMS = [$(EXEEXT) chgrp$(EXEEXT) chown$(EXEEXT) chmod$(EXEEXT) \ + cp$(EXEEXT) dd$(EXEEXT) dircolors$(EXEEXT) du$(EXEEXT) \ + ginstall$(EXEEXT) link$(EXEEXT) ln$(EXEEXT) dir$(EXEEXT) \ +@@ -56,7 +56,7 @@ + uniq$(EXEEXT) wc$(EXEEXT) basename$(EXEEXT) date$(EXEEXT) \ + dirname$(EXEEXT) echo$(EXEEXT) env$(EXEEXT) expr$(EXEEXT) \ + factor$(EXEEXT) false$(EXEEXT) hostname$(EXEEXT) id$(EXEEXT) \ +- kill$(EXEEXT) logname$(EXEEXT) pathchk$(EXEEXT) \ ++ logname$(EXEEXT) pathchk$(EXEEXT) \ + printenv$(EXEEXT) printf$(EXEEXT) pwd$(EXEEXT) seq$(EXEEXT) \ + sleep$(EXEEXT) tee$(EXEEXT) test$(EXEEXT) true$(EXEEXT) \ + tty$(EXEEXT) whoami$(EXEEXT) yes$(EXEEXT) $(am__EXEEXT_1) \ +@@ -169,7 +169,7 @@ + $(top_srcdir)/m4/ullong_max.m4 $(top_srcdir)/m4/ulonglong.m4 \ + $(top_srcdir)/m4/unicodeio.m4 $(top_srcdir)/m4/unistd-safer.m4 \ + $(top_srcdir)/m4/unlink-busy.m4 $(top_srcdir)/m4/unlinkdir.m4 \ +- $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/uptime.m4 \ ++ $(top_srcdir)/m4/unlocked-io.m4 \ + $(top_srcdir)/m4/userspec.m4 $(top_srcdir)/m4/utimbuf.m4 \ + $(top_srcdir)/m4/utime.m4 $(top_srcdir)/m4/utimecmp.m4 \ + $(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes-null.m4 \ +@@ -350,11 +350,6 @@ + join_LDADD = $(LDADD) + join_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ + ../lib/libcoreutils.a +-kill_SOURCES = kill.c +-kill_OBJECTS = kill.$(OBJEXT) +-kill_LDADD = $(LDADD) +-kill_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ +- ../lib/libcoreutils.a + link_SOURCES = link.c + link_OBJECTS = link.$(OBJEXT) + link_LDADD = $(LDADD) +@@ -577,9 +572,6 @@ + unlink_LDADD = $(LDADD) + unlink_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ + ../lib/libcoreutils.a +-uptime_SOURCES = uptime.c +-uptime_OBJECTS = uptime.$(OBJEXT) +-uptime_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) + users_SOURCES = users.c + users_OBJECTS = users.$(OBJEXT) + users_LDADD = $(LDADD) +@@ -622,28 +614,28 @@ + csplit.c cut.c date.c dd.c df.c $(dir_SOURCES) dircolors.c \ + dirname.c du.c echo.c env.c expand.c expr.c factor.c false.c \ + fmt.c fold.c $(ginstall_SOURCES) head.c hostid.c hostname.c \ +- id.c join.c kill.c link.c ln.c logname.c $(ls_SOURCES) \ ++ id.c join.c link.c ln.c logname.c $(ls_SOURCES) \ + $(md5sum_SOURCES) mkdir.c mkfifo.c mknod.c $(mv_SOURCES) \ + nice.c nl.c nohup.c od.c paste.c pathchk.c pinky.c pr.c \ + printenv.c printf.c ptx.c pwd.c readlink.c $(rm_SOURCES) \ + rmdir.c seq.c setuidgid.c $(sha1sum_SOURCES) shred.c sleep.c \ + sort.c split.c stat.c stty.c su.c sum.c sync.c tac.c tail.c \ + tee.c test.c touch.c tr.c true.c tsort.c tty.c uname.c \ +- unexpand.c uniq.c unlink.c uptime.c users.c $(vdir_SOURCES) \ ++ unexpand.c uniq.c unlink.c users.c $(vdir_SOURCES) \ + wc.c who.c whoami.c yes.c + DIST_SOURCES = $(__SOURCES) basename.c cat.c $(chgrp_SOURCES) chmod.c \ + $(chown_SOURCES) chroot.c cksum.c comm.c $(cp_SOURCES) \ + csplit.c cut.c date.c dd.c df.c $(dir_SOURCES) dircolors.c \ + dirname.c du.c echo.c env.c expand.c expr.c factor.c false.c \ + fmt.c fold.c $(ginstall_SOURCES) head.c hostid.c hostname.c \ +- id.c join.c kill.c link.c ln.c logname.c $(ls_SOURCES) \ ++ id.c join.c link.c ln.c logname.c $(ls_SOURCES) \ + $(md5sum_SOURCES) mkdir.c mkfifo.c mknod.c $(mv_SOURCES) \ + nice.c nl.c nohup.c od.c paste.c pathchk.c pinky.c pr.c \ + printenv.c printf.c ptx.c pwd.c readlink.c $(rm_SOURCES) \ + rmdir.c seq.c setuidgid.c $(sha1sum_SOURCES) shred.c sleep.c \ + sort.c split.c stat.c stty.c su.c sum.c sync.c tac.c tail.c \ + tee.c test.c touch.c tr.c true.c tsort.c tty.c uname.c \ +- unexpand.c uniq.c unlink.c uptime.c users.c $(vdir_SOURCES) \ ++ unexpand.c uniq.c unlink.c users.c $(vdir_SOURCES) \ + wc.c who.c whoami.c yes.c + HEADERS = $(noinst_HEADERS) + ETAGS = etags +@@ -840,7 +832,6 @@ + nanosec_libs = $(LDADD) $(POW_LIB) $(LIB_NANOSLEEP) + sleep_LDADD = $(nanosec_libs) + tail_LDADD = $(nanosec_libs) +-uptime_LDADD = $(LDADD) $(GETLOADAVG_LIBS) + su_LDADD = $(LDADD) $(LIB_CRYPT) + SUFFIXES = .sh + installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'` +@@ -1076,9 +1067,6 @@ + join$(EXEEXT): $(join_OBJECTS) $(join_DEPENDENCIES) + @rm -f join$(EXEEXT) + $(LINK) $(join_LDFLAGS) $(join_OBJECTS) $(join_LDADD) $(LIBS) +-kill$(EXEEXT): $(kill_OBJECTS) $(kill_DEPENDENCIES) +- @rm -f kill$(EXEEXT) +- $(LINK) $(kill_LDFLAGS) $(kill_OBJECTS) $(kill_LDADD) $(LIBS) + link$(EXEEXT): $(link_OBJECTS) $(link_DEPENDENCIES) + @rm -f link$(EXEEXT) + $(LINK) $(link_LDFLAGS) $(link_OBJECTS) $(link_LDADD) $(LIBS) +@@ -1226,9 +1214,6 @@ + unlink$(EXEEXT): $(unlink_OBJECTS) $(unlink_DEPENDENCIES) + @rm -f unlink$(EXEEXT) + $(LINK) $(unlink_LDFLAGS) $(unlink_OBJECTS) $(unlink_LDADD) $(LIBS) +-uptime$(EXEEXT): $(uptime_OBJECTS) $(uptime_DEPENDENCIES) +- @rm -f uptime$(EXEEXT) +- $(LINK) $(uptime_LDFLAGS) $(uptime_OBJECTS) $(uptime_LDADD) $(LIBS) + users$(EXEEXT): $(users_OBJECTS) $(users_DEPENDENCIES) + @rm -f users$(EXEEXT) + $(LINK) $(users_LDFLAGS) $(users_OBJECTS) $(users_LDADD) $(LIBS) +@@ -1322,7 +1307,6 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/id.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/install.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/join.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kill.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbracket.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/link.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ln.Po@am__quote@ +@@ -1378,7 +1362,6 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unexpand.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uniq.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlink.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptime.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/users.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wc.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/who.Po@am__quote@ +@@ -1606,7 +1589,7 @@ + && can_create_suid_root_executable=yes; \ + rm -f $$TMPFILE; \ + if test $$can_create_suid_root_executable = yes; then \ +- $(INSTALL_SU); \ ++ echo "Installation of su is suppressed"; \ + else \ + echo "WARNING: insufficient access; not installing su"; \ + echo "NOTE: to install su, run 'make install-root' as root"; \ diff --git a/base-source/coreutils-5.96-uname-1.patch b/base-source/coreutils-5.96-uname-1.patch new file mode 100644 index 0000000..a05ae04 --- /dev/null +++ b/base-source/coreutils-5.96-uname-1.patch @@ -0,0 +1,182 @@ +Submitted By: Matthew Burgess +Date: 2005-10-23 +Initial Package Version: 5.92 +Upstream Status: pending +Origin: Scot McPherson +Description: Fix the output of uname once and for all. + + $ uname -m # This always worked. + i686 + $ uname -i # Used to report 'unknown'. + i386 + $ uname -p # Likewise. + athlon-4 + +diff -Naur coreutils-5.92.orig/src/uname.c coreutils-5.92/src/uname.c +--- coreutils-5.92.orig/src/uname.c 2005-09-15 20:34:42.000000000 +0000 ++++ coreutils-5.92/src/uname.c 2005-10-23 10:14:06.000000000 +0000 +@@ -29,6 +29,12 @@ + # include + #endif + ++#ifdef linux ++#define cpuid(in,a,b,c,d)\ ++ asm("cpuid": "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (in)); ++int has_sse( void ); ++#endif ++ + #if HAVE_SYS_SYSCTL_H + # if HAVE_SYS_PARAM_H + # include /* needed for OpenBSD 3.0 */ +@@ -256,6 +262,96 @@ + if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor)) + element = processor; + } ++#else ++ { ++ struct utsname u; ++ uname (&u); ++ element = u.machine; ++#ifdef linux ++/****************************************************************************** ++ * ++ * Hello, major hack. I shouldn't have to do this. struct utsname should ++ * have another element with this info in it. There's probably a struct ++ * somewhere that has this info, I just don't know where it is. ++ * ++ *****************************************************************************/ ++ ++ if( !strcmp( element, "i586" ) || !strcmp( element, "i686" ) ) { ++ int eax, ebx, ecx, edx, unused; ++ int model, family, sse; ++ ++ cpuid(0,unused,ebx,ecx,edx); ++ cpuid(1,eax,unused,unused,unused); ++ model = (eax >> 4) & 0xf; ++ family = (eax >> 8) & 0xf; ++ ++ switch(ebx) { ++ case 0x756e6547: // Intel ++ switch( family ) { ++ case 5: // Pentium ++ if( model <= 3 ) ++ element="pentium"; ++ if( model > 3 ) ++ element="pentium-mmx"; ++ break; ++ case 6: // PentiumPro - Pentium III ++ if( model == 1 ) // Pentium Pro ++ element="pentiumpro"; ++ if( ( model == 3 ) || ( model == 5 ) || ++ ( model == 6 ) ) // Pentium II ++ element="pentium2"; ++ if( ( model == 7 ) || ( model == 8 ) || ++ ( model == 10 ) || ( model == 11 ) ) // These are all Pentium III ++ element="pentium3"; ++ break; ++ case 15: // Pentium4 ++ element="pentium4"; ++ break; ++ default: ++ break; ++ } // end switch( family ) ++ break; ++ case 0x68747541: // AMD ++ switch(family) { ++ case 5: ++ if( ( model == 0 ) || ( model == 1 ) || ++ ( model == 2 ) || ( model == 3 ) ) // K5 ++ element="i586"; ++ if( ( model == 6 ) || ( model == 7 ) ) // K6 ++ element="k6"; ++ if( model == 8 ) // K6-2 ++ element="k6-2"; ++ if( model == 9 ) // K6-3 ++ element="k6-3"; ++ break; ++ case 6: ++ if( model <= 4 ) ++ element="athlon"; ++ if( model > 4 ) { ++ sse = has_sse(); ++ if( sse == 0 ) ++ element="athlon"; ++ if( sse == 1 ) ++ element="athlon-4"; ++ } ++ break; ++ case 15: ++ element="athlon-4"; ++ break; ++ default: ++ break; ++ } // end switch( family ) ++ break; ++ case 0x69727943: // Cyrix ++ element="i386"; // who knows what cyrix supports, lets be safe ++ break; ++ default: ++ break; ++ } // end switch(ebx) ++ } ++ ++#endif ++ } + #endif + #ifdef UNAME_PROCESSOR + if (element == unknown) +@@ -293,7 +389,7 @@ + + if (toprint & PRINT_HARDWARE_PLATFORM) + { +- char const *element = unknown; ++ char *element = unknown; + #if HAVE_SYSINFO && defined SI_PLATFORM + { + static char hardware_platform[257]; +@@ -301,6 +397,15 @@ + hardware_platform, sizeof hardware_platform)) + element = hardware_platform; + } ++#else ++ { ++ struct utsname u; ++ uname (&u); ++ element = u.machine; ++ if (strlen (element) == 4 && element[0] == 'i' && element[2] == '8' ++ && element[3] == '6') ++ element[1] = '3'; ++ } + #endif + #ifdef UNAME_HARDWARE_PLATFORM + if (element == unknown) +@@ -323,3 +428,29 @@ + + exit (EXIT_SUCCESS); + } ++ ++#ifdef linux ++ ++/****************************************************************************** ++ * ++ * int has_sse( void ) ++ * Checks Athlon CPU's to see if they support SSE. ++ * ++ *****************************************************************************/ ++ ++int has_sse( void ) ++{ ++ unsigned long edx, unused; ++ int sse; ++ cpuid(1,unused,unused,unused,edx); ++ // I think, I need this tested on a Duron with SSE ++ // and one without it. ++ sse = edx & 0x2000000; ++ if( sse == 0 ) { ++ return 0; ++ } else { ++ return 1; ++ } ++ ++} ++#endif diff --git a/base-source/coreutils-5.96.tar.bz2 b/base-source/coreutils-5.96.tar.bz2 new file mode 100644 index 0000000..28e8dcc Binary files /dev/null and b/base-source/coreutils-5.96.tar.bz2 differ diff --git a/base-source/cvs-1.11.21-zlib-1.patch b/base-source/cvs-1.11.21-zlib-1.patch new file mode 100644 index 0000000..869a364 --- /dev/null +++ b/base-source/cvs-1.11.21-zlib-1.patch @@ -0,0 +1,53 @@ +Submitted By: Matthew Burgess +Date: 2004-11-12 +Initial Package Version: 1.11.2 +Upstream Status: Not submitted +Origin: BLFS Dev Post +Description: Links against system zlib instead of the + internal zlib. + +$LastChangedBy: igor $ +$Date: 2005-10-28 09:20:09 -0500 (Fri, 28 Oct 2005) $ + +diff -Naur cvs-1.11.18.orig/src/Makefile.in cvs-1.11.18/src/Makefile.in +--- cvs-1.11.18.orig/src/Makefile.in 2004-11-11 18:17:20.000000000 +0000 ++++ cvs-1.11.18/src/Makefile.in 2004-11-12 19:58:14.962293296 +0000 +@@ -86,7 +86,7 @@ + version.$(OBJEXT) vers_ts.$(OBJEXT) watch.$(OBJEXT) \ + wrapper.$(OBJEXT) zlib.$(OBJEXT) + cvs_OBJECTS = $(am_cvs_OBJECTS) +-cvs_DEPENDENCIES = ../diff/libdiff.a ../lib/libcvs.a ../zlib/libz.a ++cvs_DEPENDENCIES = ../diff/libdiff.a ../lib/libcvs.a + binSCRIPT_INSTALL = $(INSTALL_SCRIPT) + SCRIPTS = $(bin_SCRIPTS) + DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +@@ -199,7 +199,7 @@ + # some namespace hackery going on that maybe shouldn't be. Long term fix is to + # try and remove naming ocnflicts and fix Automake to allow particular includes + # to be attached only to particular object files. Short term fix is either or. +-INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/diff -I$(top_srcdir)/zlib $(includeopt) ++INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/diff $(includeopt) + bin_SCRIPTS = cvsbug + + # The cvs executable +@@ -278,7 +278,7 @@ + cvs_LDADD = \ + ../diff/libdiff.a \ + ../lib/libcvs.a \ +- ../zlib/libz.a ++ -lz + + + # extra clean targets +diff -Naur cvs-1.11.18.orig/src/zlib.c cvs-1.11.18/src/zlib.c +--- cvs-1.11.18.orig/src/zlib.c 2004-03-19 19:18:57.000000000 +0000 ++++ cvs-1.11.18/src/zlib.c 2004-11-12 19:58:55.531125896 +0000 +@@ -22,7 +22,7 @@ + + #if defined (SERVER_SUPPORT) || defined (CLIENT_SUPPORT) + +-#include "zlib.h" ++#include + + /* OS/2 doesn't have EIO. FIXME: this whole notion of turning + a different error into EIO strikes me as pretty dubious. */ diff --git a/base-source/cvs-1.11.21.tar.bz2 b/base-source/cvs-1.11.21.tar.bz2 new file mode 100644 index 0000000..46aa7a3 Binary files /dev/null and b/base-source/cvs-1.11.21.tar.bz2 differ diff --git a/base-source/db-4.4.20.tar.gz b/base-source/db-4.4.20.tar.gz new file mode 100644 index 0000000..ccf8be1 Binary files /dev/null and b/base-source/db-4.4.20.tar.gz differ diff --git a/base-source/dejagnu-1.4.4.tar.gz b/base-source/dejagnu-1.4.4.tar.gz new file mode 100644 index 0000000..8e2ddb8 Binary files /dev/null and b/base-source/dejagnu-1.4.4.tar.gz differ diff --git a/base-source/diffutils-2.8.1-i18n-1.patch b/base-source/diffutils-2.8.1-i18n-1.patch new file mode 100644 index 0000000..488885b --- /dev/null +++ b/base-source/diffutils-2.8.1-i18n-1.patch @@ -0,0 +1,802 @@ +Submitted by: Alexander E. Patrakov +Date: 2005-08-13 +Initial Package Version: 2.8.1 +Upstream Status: Unknown, but required for LSB >= 2.0 certification +Origin: RedHat +Description: Fixes treatment of whitespace in multibyte locales. + +--- diffutils-2.8.4/src/diff.c.i18n 2002-06-17 01:55:42.000000000 -0400 ++++ diffutils-2.8.4/src/diff.c 2002-11-16 18:41:37.000000000 -0500 +@@ -275,6 +275,13 @@ + re_set_syntax (RE_SYNTAX_GREP | RE_NO_POSIX_BACKTRACKING); + excluded = new_exclude (); + ++#ifdef HANDLE_MULTIBYTE ++ if (MB_CUR_MAX > 1) ++ lines_differ = lines_differ_multibyte; ++ else ++#endif ++ lines_differ = lines_differ_singlebyte; ++ + /* Decode the options. */ + + while ((c = getopt_long (argc, argv, shortopts, longopts, 0)) != -1) +--- diffutils-2.8.4/src/diff.h.i18n 2002-11-16 18:31:32.000000000 -0500 ++++ diffutils-2.8.4/src/diff.h 2002-11-16 18:48:58.000000000 -0500 +@@ -23,6 +23,19 @@ + #include "system.h" + #include + ++/* For platform which support the ISO C amendement 1 functionality we ++ support user defined character classes. */ ++#if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H ++/* Solaris 2.5 has a bug: must be included before . */ ++# include ++# include ++# if defined (HAVE_MBRTOWC) ++# define HANDLE_MULTIBYTE 1 ++# endif ++#endif ++ ++#define TAB_WIDTH 8 ++ + /* What kind of changes a hunk contains. */ + enum changes + { +@@ -350,7 +363,13 @@ + extern char const pr_program[]; + char *concat (char const *, char const *, char const *); + char *dir_file_pathname (char const *, char const *); +-bool lines_differ (char const *, char const *); ++ ++bool (*lines_differ) (char const *, char const *); ++bool lines_differ_singlebyte (char const *, char const *); ++#ifdef HANDLE_MULTIBYTE ++bool lines_differ_multibyte (char const *, char const *); ++#endif ++ + lin translate_line_number (struct file_data const *, lin); + struct change *find_change (struct change *); + struct change *find_reverse_change (struct change *); +--- diffutils-2.8.4/src/io.c.i18n 2002-06-11 02:06:32.000000000 -0400 ++++ diffutils-2.8.4/src/io.c 2002-11-16 18:57:30.000000000 -0500 +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + /* Rotate an unsigned value to the left. */ + #define ROL(v, n) ((v) << (n) | (v) >> (sizeof (v) * CHAR_BIT - (n))) +@@ -213,6 +214,28 @@ + + /* Split the file into lines, simultaneously computing the equivalence + class for each line. */ ++#ifdef HANDLE_MULTIBYTE ++# define MBC2WC(P, END, MBLENGTH, WC, STATE, CONVFAIL) \ ++do \ ++{ \ ++ mbstate_t state_bak = STATE; \ ++ \ ++ CONVFAIL = 0; \ ++ MBLENGTH = mbrtowc (&WC, P, END - (char const *)P, &STATE); \ ++ \ ++ switch (MBLENGTH) \ ++ { \ ++ case (size_t)-2: \ ++ case (size_t)-1: \ ++ STATE = state_bak; \ ++ ++CONVFAIL; \ ++ /* Fall through. */ \ ++ case 0: \ ++ MBLENGTH = 1; \ ++ } \ ++} \ ++while (0) ++#endif + + static void + find_and_hash_each_line (struct file_data *current) +@@ -239,12 +262,280 @@ + bool same_length_diff_contents_compare_anyway = + diff_length_compare_anyway | ignore_case; + ++#ifdef HANDLE_MULTIBYTE ++ wchar_t wc; ++ size_t mblength; ++ mbstate_t state; ++ int convfail; ++ ++ memset (&state, '\0', sizeof (mbstate_t)); ++#endif ++ + while ((char const *) p < suffix_begin) + { + char const *ip = (char const *) p; + + h = 0; ++#ifdef HANDLE_MULTIBYTE ++ if (MB_CUR_MAX > 1) ++ { ++ wchar_t lo_wc; ++ char mbc[MB_LEN_MAX]; ++ mbstate_t state_wc; ++ ++ /* Hash this line until we find a newline. */ ++ switch (ignore_white_space) ++ { ++ case IGNORE_ALL_SPACE: ++ while (1) ++ { ++ if (*p == '\n') ++ { ++ ++p; ++ break; ++ } ++ ++ MBC2WC (p, suffix_begin, mblength, wc, state, convfail); ++ ++ if (convfail) ++ mbc[0] = *p++; ++ else if (!iswspace (wc)) ++ { ++ bool flag = 0; ++ ++ if (ignore_case) ++ { ++ lo_wc = towlower (wc); ++ if (lo_wc != wc) ++ { ++ flag = 1; ++ ++ p += mblength; ++ memset (&state_wc, '\0', sizeof(mbstate_t)); ++ mblength = wcrtomb (mbc, lo_wc, &state_wc); ++ ++ assert (mblength != (size_t)-1 && ++ mblength != (size_t)-2); ++ ++ mblength = (mblength < 1) ? 1 : mblength; ++ } ++ } ++ ++ if (!flag) ++ { ++ for (i = 0; i < mblength; i++) ++ mbc[i] = *p++; ++ } ++ } ++ else ++ { ++ p += mblength; ++ continue; ++ } ++ ++ for (i = 0; i < mblength; i++) ++ h = HASH (h, mbc[i]); ++ } ++ break; ++ ++ case IGNORE_SPACE_CHANGE: ++ while (1) ++ { ++ if (*p == '\n') ++ { ++ ++p; ++ break; ++ } + ++ MBC2WC (p, suffix_begin, mblength, wc, state, convfail); ++ ++ if (!convfail && iswspace (wc)) ++ { ++ while (1) ++ { ++ if (*p == '\n') ++ { ++ ++p; ++ goto hashing_done; ++ } ++ ++ p += mblength; ++ MBC2WC (p, suffix_begin, mblength, wc, state, convfail); ++ if (convfail || (!convfail && !iswspace (wc))) ++ break; ++ } ++ h = HASH (h, ' '); ++ } ++ ++ /* WC is now the first non-space. */ ++ if (convfail) ++ mbc[0] = *p++; ++ else ++ { ++ bool flag = 0; ++ ++ if (ignore_case) ++ { ++ lo_wc = towlower (wc); ++ if (lo_wc != wc) ++ { ++ flag = 1; ++ ++ p += mblength; ++ memset (&state_wc, '\0', sizeof(mbstate_t)); ++ mblength = wcrtomb (mbc, lo_wc, &state_wc); ++ ++ assert (mblength != (size_t)-1 && ++ mblength != (size_t)-2); ++ ++ mblength = (mblength < 1) ? 1 : mblength; ++ } ++ } ++ ++ if (!flag) ++ { ++ for (i = 0; i < mblength; i++) ++ mbc[i] = *p++; ++ } ++ } ++ ++ for (i = 0; i < mblength; i++) ++ h = HASH (h, mbc[i]); ++ } ++ break; ++ ++ case IGNORE_TAB_EXPANSION: ++ { ++ size_t column = 0; ++ ++ while (1) ++ { ++ if (*p == '\n') ++ { ++ ++p; ++ break; ++ } ++ ++ MBC2WC (p, suffix_begin, mblength, wc, state, convfail); ++ ++ if (convfail) ++ { ++ h = HASH (h, *p++); ++ ++column; ++ } ++ else ++ { ++ bool flag; ++ ++ switch (wc) ++ { ++ case L'\b': ++ column -= 0 < column; ++ h = HASH (h, '\b'); ++ ++p; ++ break; ++ ++ case L'\t': ++ { ++ int repetitions; ++ ++ repetitions = TAB_WIDTH - column % TAB_WIDTH; ++ column += repetitions; ++ do ++ h = HASH (h, ' '); ++ while (--repetitions != 0); ++ ++p; ++ } ++ break; ++ ++ case L'\r': ++ column = 0; ++ h = HASH (h, '\r'); ++ ++p; ++ break; ++ ++ default: ++ flag = 0; ++ column += wcwidth (wc); ++ if (ignore_case) ++ { ++ lo_wc = towlower (wc); ++ if (lo_wc != wc) ++ { ++ flag = 1; ++ p += mblength; ++ memset (&state_wc, '\0', sizeof(mbstate_t)); ++ mblength = wcrtomb (mbc, lo_wc, &state_wc); ++ ++ assert (mblength != (size_t)-1 && ++ mblength != (size_t)-2); ++ ++ mblength = (mblength < 1) ? 1 : mblength; ++ } ++ } ++ ++ if (!flag) ++ { ++ for (i = 0; i < mblength; i++) ++ mbc[i] = *p++; ++ } ++ ++ for (i = 0; i < mblength; i++) ++ h = HASH (h, mbc[i]); ++ } ++ } ++ } ++ } ++ break; ++ ++ default: ++ while (1) ++ { ++ if (*p == '\n') ++ { ++ ++p; ++ break; ++ } ++ ++ MBC2WC (p, suffix_begin, mblength, wc, state, convfail); ++ ++ if (convfail) ++ mbc[0] = *p++; ++ else ++ { ++ int flag = 0; ++ ++ if (ignore_case) ++ { ++ lo_wc = towlower (wc); ++ if (lo_wc != wc) ++ { ++ flag = 1; ++ p += mblength; ++ memset (&state_wc, '\0', sizeof(mbstate_t)); ++ mblength = wcrtomb (mbc, lo_wc, &state_wc); ++ ++ assert (mblength != (size_t)-1 && ++ mblength != (size_t)-2); ++ ++ mblength = (mblength < 1) ? 1 : mblength; ++ } ++ } ++ ++ if (!flag) ++ { ++ for (i = 0; i < mblength; i++) ++ mbc[i] = *p++; ++ } ++ } ++ ++ for (i = 0; i < mblength; i++) ++ h = HASH (h, mbc[i]); ++ } ++ } ++ } ++ else ++#endif + /* Hash this line until we find a newline. */ + if (ignore_case) + switch (ignore_white_space) +--- diffutils-2.8.4/src/side.c.i18n 2002-06-11 02:06:32.000000000 -0400 ++++ diffutils-2.8.4/src/side.c 2002-11-16 18:41:37.000000000 -0500 +@@ -73,11 +73,72 @@ + register size_t out_position = 0; + register char const *text_pointer = line[0]; + register char const *text_limit = line[1]; ++#if defined HAVE_WCHAR_H && defined HAVE_WCTYPE_H ++ unsigned char mbc[MB_LEN_MAX]; ++ wchar_t wc; ++ mbstate_t state, state_bak; ++ size_t mbc_pos, mblength; ++ int mbc_loading_flag = 0; ++ int wc_width; ++ ++ memset (&state, '\0', sizeof (mbstate_t)); ++#endif + + while (text_pointer < text_limit) + { + register unsigned char c = *text_pointer++; + ++#if defined HAVE_WCHAR_H && defined HAVE_WCTYPE_H ++ if (MB_CUR_MAX > 1 && mbc_loading_flag) ++ { ++ mbc_loading_flag = 0; ++ state_bak = state; ++ mbc[mbc_pos++] = c; ++ ++process_mbc: ++ mblength = mbrtowc (&wc, mbc, mbc_pos, &state); ++ ++ switch (mblength) ++ { ++ case (size_t)-2: /* Incomplete multibyte character. */ ++ mbc_loading_flag = 1; ++ state = state_bak; ++ break; ++ ++ case (size_t)-1: /* Invalid as a multibyte character. */ ++ if (in_position++ < out_bound) ++ { ++ out_position = in_position; ++ putc (mbc[0], out); ++ } ++ memmove (mbc, mbc + 1, --mbc_pos); ++ if (mbc_pos > 0) ++ { ++ mbc[mbc_pos] = '\0'; ++ goto process_mbc; ++ } ++ break; ++ ++ default: ++ wc_width = wcwidth (wc); ++ if (wc_width < 1) /* Unprintable multibyte character. */ ++ { ++ if (in_position <= out_bound) ++ fprintf (out, "%lc", (wint_t)wc); ++ } ++ else /* Printable multibyte character. */ ++ { ++ in_position += wc_width; ++ if (in_position <= out_bound) ++ { ++ out_position = in_position; ++ fprintf (out, "%lc", (wint_t)wc); ++ } ++ } ++ } ++ continue; ++ } ++#endif + switch (c) + { + case '\t': +@@ -135,8 +196,39 @@ + break; + + default: +- if (! ISPRINT (c)) +- goto control_char; ++#if defined HAVE_WCHAR_H && defined HAVE_WCTYPE_H ++ if (MB_CUR_MAX > 1) ++ { ++ memset (mbc, '\0', MB_LEN_MAX); ++ mbc_pos = 0; ++ mbc[mbc_pos++] = c; ++ state_bak = state; ++ ++ mblength = mbrtowc (&wc, mbc, mbc_pos, &state); ++ ++ /* The value of mblength is always less than 2 here. */ ++ switch (mblength) ++ { ++ case (size_t)-2: /* Incomplete multibyte character. */ ++ state = state_bak; ++ mbc_loading_flag = 1; ++ continue; ++ ++ case (size_t)-1: /* Invalid as a multibyte character. */ ++ state = state_bak; ++ break; ++ ++ default: ++ if (! iswprint (wc)) ++ goto control_char; ++ } ++ } ++ else ++#endif ++ { ++ if (! ISPRINT (c)) ++ goto control_char; ++ } + /* falls through */ + case ' ': + if (in_position++ < out_bound) +--- diffutils-2.8.4/src/util.c.i18n 2002-06-11 02:06:32.000000000 -0400 ++++ diffutils-2.8.4/src/util.c 2002-11-16 18:41:37.000000000 -0500 +@@ -321,7 +321,7 @@ + Return nonzero if the lines differ. */ + + bool +-lines_differ (char const *s1, char const *s2) ++lines_differ_singlebyte (char const *s1, char const *s2) + { + register unsigned char const *t1 = (unsigned char const *) s1; + register unsigned char const *t2 = (unsigned char const *) s2; +@@ -450,6 +450,293 @@ + + return 1; + } ++ ++#ifdef HANDLE_MULTIBYTE ++# define MBC2WC(T, END, MBLENGTH, WC, STATE, CONVFAIL) \ ++do \ ++{ \ ++ mbstate_t bak = STATE; \ ++ \ ++ CONVFAIL = 0; \ ++ MBLENGTH = mbrtowc (&WC, T, END - T, &STATE); \ ++ \ ++ switch (MBLENGTH) \ ++ { \ ++ case (size_t)-2: \ ++ case (size_t)-1: \ ++ STATE = bak; \ ++ ++CONVFAIL; \ ++ /* Fall through. */ \ ++ case 0: \ ++ MBLENGTH = 1; \ ++ } \ ++} \ ++while (0) ++ ++bool ++lines_differ_multibyte (char const *s1, char const *s2) ++{ ++ unsigned char const *end1, *end2; ++ unsigned char c1, c2; ++ wchar_t wc1, wc2, wc1_bak, wc2_bak; ++ size_t mblen1, mblen2; ++ mbstate_t state1, state2, state1_bak, state2_bak; ++ int convfail1, convfail2, convfail1_bak, convfail2_bak; ++ ++ unsigned char const *t1 = (unsigned char const *) s1; ++ unsigned char const *t2 = (unsigned char const *) s2; ++ unsigned char const *t1_bak, *t2_bak; ++ size_t column = 0; ++ ++ if (ignore_white_space == IGNORE_NO_WHITE_SPACE && !ignore_case) ++ { ++ while (*t1 != '\n') ++ if (*t1++ != * t2++) ++ return 1; ++ return 0; ++ } ++ ++ memset (&state1, '\0', sizeof (mbstate_t)); ++ memset (&state2, '\0', sizeof (mbstate_t)); ++ ++ end1 = s1 + strlen (s1); ++ end2 = s2 + strlen (s2); ++ ++ while (1) ++ { ++ c1 = *t1; ++ c2 = *t2; ++ MBC2WC (t1, end1, mblen1, wc1, state1, convfail1); ++ MBC2WC (t2, end2, mblen2, wc2, state2, convfail2); ++ ++ /* Test for exact char equality first, since it's a common case. */ ++ if (convfail1 ^ convfail2) ++ break; ++ else if (convfail1 && convfail2 && c1 != c2) ++ break; ++ else if (!convfail1 && !convfail2 && wc1 != wc2) ++ { ++ switch (ignore_white_space) ++ { ++ case IGNORE_ALL_SPACE: ++ /* For -w, just skip past any white space. */ ++ while (1) ++ { ++ if (convfail1) ++ break; ++ else if (wc1 == L'\n' || !iswspace (wc1)) ++ break; ++ ++ t1 += mblen1; ++ c1 = *t1; ++ MBC2WC (t1, end1, mblen1, wc1, state1, convfail1); ++ } ++ ++ while (1) ++ { ++ if (convfail2) ++ break; ++ else if (wc2 == L'\n' || !iswspace (wc2)) ++ break; ++ ++ t2 += mblen2; ++ c2 = *t2; ++ MBC2WC (t2, end2, mblen2, wc2, state2, convfail2); ++ } ++ t1 += mblen1; ++ t2 += mblen2; ++ break; ++ ++ case IGNORE_SPACE_CHANGE: ++ /* For -b, advance past any sequence of white space in ++ line 1 and consider it just one space, or nothing at ++ all if it is at the end of the line. */ ++ if (wc1 != L'\n' && iswspace (wc1)) ++ { ++ size_t mblen_bak; ++ mbstate_t state_bak; ++ ++ do ++ { ++ t1 += mblen1; ++ mblen_bak = mblen1; ++ state_bak = state1; ++ MBC2WC (t1, end1, mblen1, wc1, state1, convfail1); ++ } ++ while (!convfail1 && (wc1 != L'\n' && iswspace (wc1))); ++ ++ state1 = state_bak; ++ mblen1 = mblen_bak; ++ t1 -= mblen1; ++ convfail1 = 0; ++ wc1 = L' '; ++ } ++ ++ /* Likewise for line 2. */ ++ if (wc2 != L'\n' && iswspace (wc2)) ++ { ++ size_t mblen_bak; ++ mbstate_t state_bak; ++ ++ do ++ { ++ t2 += mblen2; ++ mblen_bak = mblen2; ++ state_bak = state2; ++ MBC2WC (t2, end2, mblen2, wc2, state2, convfail2); ++ } ++ while (!convfail2 && (wc2 != L'\n' && iswspace (wc2))); ++ ++ state2 = state_bak; ++ mblen2 = mblen_bak; ++ t2 -= mblen2; ++ convfail2 = 0; ++ wc2 = L' '; ++ } ++ ++ if (wc1 != wc2) ++ { ++ if (wc2 == L' ' && wc1 != L'\n' && ++ t1 > (unsigned char const *)s1 && ++ !convfail1_bak && iswspace (wc1_bak)) ++ { ++ t1 = t1_bak; ++ wc1 = wc1_bak; ++ state1 = state1_bak; ++ convfail1 = convfail1_bak; ++ continue; ++ } ++ if (wc1 == L' ' && wc2 != L'\n' ++ && t2 > (unsigned char const *)s2 ++ && !convfail2_bak && iswspace (wc2_bak)) ++ { ++ t2 = t2_bak; ++ wc2 = wc2_bak; ++ state2 = state2_bak; ++ convfail2 = convfail2_bak; ++ continue; ++ } ++ } ++ ++ t1_bak = t1; t2_bak = t2; ++ wc1_bak = wc1; wc2_bak = wc2; ++ state1_bak = state1; state2_bak = state2; ++ convfail1_bak = convfail1; convfail2_bak = convfail2; ++ ++ if (wc1 == L'\n') ++ wc1 = L' '; ++ else ++ t1 += mblen1; ++ ++ if (wc2 == L'\n') ++ wc2 = L' '; ++ else ++ t2 += mblen2; ++ ++ break; ++ ++ case IGNORE_TAB_EXPANSION: ++ if ((wc1 == L' ' && wc2 == L'\t') ++ || (wc1 == L'\t' && wc2 == L' ')) ++ { ++ size_t column2 = column; ++ ++ while (1) ++ { ++ if (convfail1) ++ { ++ ++t1; ++ break; ++ } ++ else if (wc1 == L' ') ++ column++; ++ else if (wc1 == L'\t') ++ column += TAB_WIDTH - column % TAB_WIDTH; ++ else ++ { ++ t1 += mblen1; ++ break; ++ } ++ ++ t1 += mblen1; ++ c1 = *t1; ++ MBC2WC (t1, end1, mblen1, wc1, state1, convfail1); ++ } ++ ++ while (1) ++ { ++ if (convfail2) ++ { ++ ++t2; ++ break; ++ } ++ else if (wc2 == L' ') ++ column2++; ++ else if (wc2 == L'\t') ++ column2 += TAB_WIDTH - column2 % TAB_WIDTH; ++ else ++ { ++ t2 += mblen2; ++ break; ++ } ++ ++ t2 += mblen2; ++ c2 = *t2; ++ MBC2WC (t2, end2, mblen2, wc2, state2, convfail2); ++ } ++ ++ if (column != column2) ++ return 1; ++ } ++ else ++ { ++ t1 += mblen1; ++ t2 += mblen2; ++ } ++ break; ++ ++ case IGNORE_NO_WHITE_SPACE: ++ t1 += mblen1; ++ t2 += mblen2; ++ break; ++ } ++ ++ /* Lowercase all letters if -i is specified. */ ++ if (ignore_case) ++ { ++ if (!convfail1) ++ wc1 = towlower (wc1); ++ if (!convfail2) ++ wc2 = towlower (wc2); ++ } ++ ++ if (convfail1 ^ convfail2) ++ break; ++ else if (convfail1 && convfail2 && c1 != c2) ++ break; ++ else if (!convfail1 && !convfail2 && wc1 != wc2) ++ break; ++ } ++ else ++ { ++ t1_bak = t1; t2_bak = t2; ++ wc1_bak = wc1; wc2_bak = wc2; ++ state1_bak = state1; state2_bak = state2; ++ convfail1_bak = convfail1; convfail2_bak = convfail2; ++ ++ t1 += mblen1; t2 += mblen2; ++ } ++ ++ if (!convfail1 && wc1 == L'\n') ++ return 0; ++ ++ column += convfail1 ? 1 : ++ (wc1 == L'\t') ? TAB_WIDTH - column % TAB_WIDTH : wcwidth (wc1); ++ } ++ ++ return 1; ++} ++#endif + + /* Find the consecutive changes at the start of the script START. + Return the last link before the first gap. */ diff --git a/base-source/diffutils-2.8.1.tar.gz b/base-source/diffutils-2.8.1.tar.gz new file mode 100644 index 0000000..0ae0a9c Binary files /dev/null and b/base-source/diffutils-2.8.1.tar.gz differ diff --git a/base-source/dosfstools-2.11.src.tar.gz b/base-source/dosfstools-2.11.src.tar.gz new file mode 100644 index 0000000..f2b82e9 Binary files /dev/null and b/base-source/dosfstools-2.11.src.tar.gz differ diff --git a/base-source/e2fsprogs-1.38.tar.gz b/base-source/e2fsprogs-1.38.tar.gz new file mode 100644 index 0000000..8537aaa Binary files /dev/null and b/base-source/e2fsprogs-1.38.tar.gz differ diff --git a/base-source/expat-2.0.0.tar.gz b/base-source/expat-2.0.0.tar.gz new file mode 100644 index 0000000..cbc4dbb Binary files /dev/null and b/base-source/expat-2.0.0.tar.gz differ diff --git a/base-source/expect-5.43.0-spawn-1.patch b/base-source/expect-5.43.0-spawn-1.patch new file mode 100644 index 0000000..c2033c0 --- /dev/null +++ b/base-source/expect-5.43.0-spawn-1.patch @@ -0,0 +1,217 @@ +Submitted By: LFS Book +Date: 2003-10-05 +Initial Package Version: 5.38 +Origin: Redhat RPM (Patch by HJ Lu) +Description: NA +diff -uNr expect-5.38.orig/exp_chan.c expect-5.38/exp_chan.c +--- expect-5.38.orig/exp_chan.c 2002-02-12 13:00:55.000000000 +1100 ++++ expect-5.38/exp_chan.c 2003-03-01 10:36:18.000000000 +1100 +@@ -519,6 +519,7 @@ + esPtr->buffer = Tcl_NewStringObj("",0); + Tcl_IncrRefCount(esPtr->buffer); + esPtr->umsize = exp_default_match_max; ++ esPtr->umsize_changed = exp_default_match_max_changed; + /* this will reallocate object with an appropriate sized buffer */ + expAdjust(esPtr); + +diff -uNr expect-5.38.orig/exp_command.h expect-5.38/exp_command.h +--- expect-5.38.orig/exp_command.h 2002-04-08 08:57:20.000000000 +1000 ++++ expect-5.38/exp_command.h 2003-03-01 10:36:18.000000000 +1100 +@@ -25,6 +25,7 @@ + EXTERN char * exp_get_var _ANSI_ARGS_((Tcl_Interp *,char *)); + + EXTERN int exp_default_match_max; ++EXTERN int exp_default_match_max_changed; + EXTERN int exp_default_parity; + EXTERN int exp_default_rm_nulls; + +@@ -97,6 +98,7 @@ + int msize; /* # of bytes that buffer can hold (max) */ + int umsize; /* # of bytes (min) that is guaranteed to match */ + /* this comes from match_max command */ ++ int umsize_changed; /* is umsize changed by user? */ + int printed; /* # of bytes written to stdout (if logging on) */ + /* but not actually returned via a match yet */ + int echoed; /* additional # of bytes (beyond "printed" above) */ +diff -uNr expect-5.38.orig/expect.c expect-5.38/expect.c +--- expect-5.38.orig/expect.c 2002-04-08 09:00:33.000000000 +1000 ++++ expect-5.38/expect.c 2003-03-01 10:36:18.000000000 +1100 +@@ -41,8 +41,17 @@ + #include "tcldbg.h" + #endif + ++/* The initial length is 2000. We increment it by 2000. The maximum ++ is 8MB (0x800000). */ ++#define EXP_MATCH_MAX 2000 ++#define EXP_MATCH_INC 2000 ++#define EXP_MATCH_STEP_LIMIT 0x700000 ++#define EXP_MATCH_LIMIT 0x800000 ++#define EXP_MATCH_LIMIT_QUOTE "0x800000" ++ + /* initial length of strings that we can guarantee patterns can match */ +-int exp_default_match_max = 2000; ++int exp_default_match_max = EXP_MATCH_MAX; ++int exp_default_match_max_changed = 0; + #define INIT_EXPECT_TIMEOUT_LIT "10" /* seconds */ + #define INIT_EXPECT_TIMEOUT 10 /* seconds */ + int exp_default_parity = TRUE; +@@ -1618,6 +1627,76 @@ + return newsize; + } + ++/* returns # of bytes until we see a newline at the end or EOF. */ ++/*ARGSUSED*/ ++static int ++expReadNewLine(interp,esPtr,save_flags) /* INTL */ ++Tcl_Interp *interp; ++ExpState *esPtr; ++int save_flags; ++{ ++ int size; ++ int exp_size; ++ int full_size; ++ int count; ++ char *str; ++ ++ count = 0; ++ for (;;) { ++ exp_size = expSizeGet(esPtr); ++ ++ /* When we reach the limit, we will only read one char at a ++ time. */ ++ if (esPtr->umsize >= EXP_MATCH_STEP_LIMIT) ++ size = TCL_UTF_MAX; ++ else ++ size = exp_size; ++ ++ if (exp_size + TCL_UTF_MAX >= esPtr->msize) { ++ if (esPtr->umsize >= EXP_MATCH_LIMIT) { ++ expDiagLogU("WARNING: interact buffer is full. probably your program\r\n"); ++ expDiagLogU("is not interactive or has a very long output line. The\r\n"); ++ expDiagLogU("current limit is " EXP_MATCH_LIMIT_QUOTE ".\r\n"); ++ expDiagLogU("Dumping first half of buffer in order to continue\r\n"); ++ expDiagLogU("Recommend you enlarge the buffer.\r\n"); ++ exp_buffer_shuffle(interp,esPtr,save_flags,EXPECT_OUT,"expect"); ++ return count; ++ } ++ else { ++ esPtr->umsize += EXP_MATCH_INC; ++ expAdjust(esPtr); ++ } ++ } ++ ++ full_size = esPtr->msize - (size / TCL_UTF_MAX); ++ size = Tcl_ReadChars(esPtr->channel, ++ esPtr->buffer, ++ full_size, ++ 1 /* append */); ++ if (size > 0) { ++ count += size; ++ /* We try again if there are more to read and we haven't ++ seen a newline at the end. */ ++ if (size == full_size) { ++ str = Tcl_GetStringFromObj(esPtr->buffer, &size); ++ if (str[size - 1] != '\n') ++ continue; ++ } ++ } ++ else { ++ /* It is even trickier. We got an error from read. We have ++ to recover from it. Let's make sure the size of ++ buffer is correct. It can be corrupted. */ ++ str = Tcl_GetString(esPtr->buffer); ++ Tcl_SetObjLength(esPtr->buffer, strlen(str)); ++ } ++ ++ break; ++ } ++ ++ return count; ++} ++ + /* returns # of bytes read or (non-positive) error of form EXP_XXX */ + /* returns 0 for end of file */ + /* If timeout is non-zero, set an alarm before doing the read, else assume */ +@@ -1632,6 +1711,8 @@ + { + int cc = EXP_TIMEOUT; + int size = expSizeGet(esPtr); ++ int full_size; ++ int count; + + if (size + TCL_UTF_MAX >= esPtr->msize) + exp_buffer_shuffle(interp,esPtr,save_flags,EXPECT_OUT,"expect"); +@@ -1648,11 +1729,43 @@ + } + #endif + +- ++ /* FIXME: If we ask less than what is available in the tcl buffer ++ when tcl has seen EOF, we will throw away the remaining data ++ since the next read will get EOF. Since expect is line-oriented, ++ we exand our buffer to get EOF or the next newline at the end of ++ the input buffer. I don't know if it is the right fix. H.J. */ ++ count = 0; ++ full_size = esPtr->msize - (size / TCL_UTF_MAX); + cc = Tcl_ReadChars(esPtr->channel, +- esPtr->buffer, +- esPtr->msize - (size / TCL_UTF_MAX), +- 1 /* append */); ++ esPtr->buffer, ++ full_size, ++ 1 /* append */); ++ if (cc > 0) { ++ count += cc; ++ /* It gets very tricky. There are more to read. We will expand ++ our buffer and get EOF or a newline at the end unless the ++ buffer length has been changed. */ ++ if (cc == full_size) { ++ char *str; ++ str = Tcl_GetStringFromObj(esPtr->buffer, &size); ++ if (str[size - 1] != '\n') { ++ if (esPtr->umsize_changed) { ++ char buf[20]; /* big enough for 64bit int in hex. */ ++ snprintf(buf,sizeof(buf),"0x%x", esPtr->umsize); ++ expDiagLogU("WARNING: interact buffer is not large enough to hold\r\n"); ++ expDiagLogU("all output. probably your program is not interactive or\r\n"); ++ expDiagLogU("has a very long output line. The current limit is "); ++ expDiagLogU(buf); ++ expDiagLogU(".\r\n"); ++ } ++ else { ++ cc = expReadNewLine(interp,esPtr,save_flags); ++ if (cc > 0) ++ count += cc; ++ } ++ } ++ } ++ } + i_read_errno = errno; + + #ifdef SIMPLE_EVENT +@@ -1673,7 +1786,7 @@ + } + } + #endif +- return cc; ++ return count > 0 ? count : cc; + } + + /* +@@ -2746,8 +2859,14 @@ + return(TCL_ERROR); + } + +- if (Default) exp_default_match_max = size; +- else esPtr->umsize = size; ++ if (Default) { ++ exp_default_match_max = size; ++ exp_default_match_max_changed = 1; ++ } ++ else { ++ esPtr->umsize = size; ++ esPtr->umsize_changed = 1; ++ } + + return(TCL_OK); + } diff --git a/base-source/expect-5.43.0.tar.gz b/base-source/expect-5.43.0.tar.gz new file mode 100644 index 0000000..0f70227 Binary files /dev/null and b/base-source/expect-5.43.0.tar.gz differ diff --git a/base-source/file-4.17.tar.gz b/base-source/file-4.17.tar.gz new file mode 100644 index 0000000..8ae4ada Binary files /dev/null and b/base-source/file-4.17.tar.gz differ diff --git a/base-source/findutils-4.2.27.tar.gz b/base-source/findutils-4.2.27.tar.gz new file mode 100644 index 0000000..baac586 Binary files /dev/null and b/base-source/findutils-4.2.27.tar.gz differ diff --git a/base-source/flex-2.5.33.tar.bz2 b/base-source/flex-2.5.33.tar.bz2 new file mode 100644 index 0000000..a8924f2 Binary files /dev/null and b/base-source/flex-2.5.33.tar.bz2 differ diff --git a/base-source/gawk-3.1.5-segfault_fix-1.patch b/base-source/gawk-3.1.5-segfault_fix-1.patch new file mode 100644 index 0000000..aa2f17b --- /dev/null +++ b/base-source/gawk-3.1.5-segfault_fix-1.patch @@ -0,0 +1,43 @@ +Submitted By: Matthew Burgess +Date: 2005-09-24 +Initial Package Version: 3.1.5 +Upstream Status: From Upstream +Origin: http://lists.gnu.org/archive/html/bug-gnu-utils/2005-08/msg00047.html +Description: Fixes a bug which causes gawk to segfault when operating on a non-existent file. + +diff -Naur gawk-3.1.5.orig/io.c gawk-3.1.5/io.c +--- gawk-3.1.5.orig/io.c 2005-07-26 18:07:43.000000000 +0000 ++++ gawk-3.1.5/io.c 2005-09-24 14:43:13.771380264 +0000 +@@ -2480,9 +2480,12 @@ + { + struct stat sbuf; + struct open_hook *oh; ++ int iop_malloced = FALSE; + +- if (iop == NULL) ++ if (iop == NULL) { + emalloc(iop, IOBUF *, sizeof(IOBUF), "iop_alloc"); ++ iop_malloced = TRUE; ++ } + memset(iop, '\0', sizeof(IOBUF)); + iop->flag = 0; + iop->fd = fd; +@@ -2495,7 +2498,8 @@ + } + + if (iop->fd == INVALID_HANDLE) { +- free(iop); ++ if (iop_malloced) ++ free(iop); + return NULL; + } + if (isatty(iop->fd)) +@@ -2503,7 +2507,7 @@ + iop->readsize = iop->size = optimal_bufsize(iop->fd, & sbuf); + iop->sbuf = sbuf; + if (do_lint && S_ISREG(sbuf.st_mode) && sbuf.st_size == 0) +- lintwarn(_("data file `%s' is empty"), name); ++ lintwarn(_("data file `%s' is empty"), name); + errno = 0; + iop->count = iop->scanoff = 0; + emalloc(iop->buf, char *, iop->size += 2, "iop_alloc"); diff --git a/base-source/gawk-3.1.5.tar.bz2 b/base-source/gawk-3.1.5.tar.bz2 new file mode 100644 index 0000000..2ca0701 Binary files /dev/null and b/base-source/gawk-3.1.5.tar.bz2 differ diff --git a/base-source/gcc-3.3.6-linkonce-1.patch b/base-source/gcc-3.3.6-linkonce-1.patch new file mode 100644 index 0000000..680d14e --- /dev/null +++ b/base-source/gcc-3.3.6-linkonce-1.patch @@ -0,0 +1,359 @@ +Submitted By: DJ Lucas +Date: 2004-12-19 +Initial Package Version: 3.3.3 +Origin: gcc-3.4.1-linkonce-1.patch +Upstream Status: Applied +Description: Fixes linkone/comdat issue + Details of this patch can be found on the following link + http://gcc.gnu.org/ml/gcc-patches/2004-08/msg00653.html + +$LastChangedBy: randy $ +$Date: 2005-08-17 11:33:20 -0500 (Wed, 17 Aug 2005) $ + +diff -Naur gcc-3.3.3-orig/gcc/config/alpha/alpha.c gcc-3.3.3/gcc/config/alpha/alpha.c +--- gcc-3.3.3-orig/gcc/config/alpha/alpha.c 2004-01-11 17:53:17.000000000 -0600 ++++ gcc-3.3.3/gcc/config/alpha/alpha.c 2004-12-19 22:51:55.974168040 -0600 +@@ -250,6 +250,8 @@ + # define TARGET_SECTION_TYPE_FLAGS unicosmk_section_type_flags + # undef TARGET_ASM_UNIQUE_SECTION + # define TARGET_ASM_UNIQUE_SECTION unicosmk_unique_section ++#undef TARGET_ASM_FUNCTION_RODATA_SECTION ++#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section + # undef TARGET_ASM_GLOBALIZE_LABEL + # define TARGET_ASM_GLOBALIZE_LABEL hook_FILEptr_constcharptr_void + #endif +diff -Naur gcc-3.3.3-orig/gcc/config/arm/pe.h gcc-3.3.3/gcc/config/arm/pe.h +--- gcc-3.3.3-orig/gcc/config/arm/pe.h 2002-05-19 00:23:00.000000000 -0500 ++++ gcc-3.3.3/gcc/config/arm/pe.h 2004-12-19 22:51:56.018161352 -0600 +@@ -101,6 +101,7 @@ + #define MULTIPLE_SYMBOL_SPACES + + #define TARGET_ASM_UNIQUE_SECTION arm_pe_unique_section ++#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section + + #define SUPPORTS_ONE_ONLY 1 + +diff -Naur gcc-3.3.3-orig/gcc/config/avr/avr.c gcc-3.3.3/gcc/config/avr/avr.c +--- gcc-3.3.3-orig/gcc/config/avr/avr.c 2002-10-24 15:07:21.000000000 -0500 ++++ gcc-3.3.3/gcc/config/avr/avr.c 2004-12-19 22:51:56.042157704 -0600 +@@ -221,6 +221,8 @@ + #define TARGET_ATTRIBUTE_TABLE avr_attribute_table + #undef TARGET_ASM_UNIQUE_SECTION + #define TARGET_ASM_UNIQUE_SECTION avr_unique_section ++#undef TARGET_ASM_FUNCTION_RODATA_SECTION ++#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section + #undef TARGET_ENCODE_SECTION_INFO + #define TARGET_ENCODE_SECTION_INFO avr_encode_section_info + #undef TARGET_SECTION_TYPE_FLAGS +diff -Naur gcc-3.3.3-orig/gcc/config/darwin.h gcc-3.3.3/gcc/config/darwin.h +--- gcc-3.3.3-orig/gcc/config/darwin.h 2003-08-08 16:17:57.000000000 -0500 ++++ gcc-3.3.3/gcc/config/darwin.h 2004-12-19 22:51:56.091150256 -0600 +@@ -677,6 +677,9 @@ + #undef TARGET_ASM_SELECT_RTX_SECTION + #define TARGET_ASM_SELECT_RTX_SECTION machopic_select_rtx_section + ++#undef TARGET_ASM_FUNCTION_RODATA_SECTION ++#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section ++ + #define ASM_DECLARE_UNRESOLVED_REFERENCE(FILE,NAME) \ + do { \ + if (FILE) { \ +diff -Naur gcc-3.3.3-orig/gcc/config/i386/cygwin.h gcc-3.3.3/gcc/config/i386/cygwin.h +--- gcc-3.3.3-orig/gcc/config/i386/cygwin.h 2003-04-29 08:56:28.000000000 -0500 ++++ gcc-3.3.3/gcc/config/i386/cygwin.h 2004-12-19 22:51:56.112147064 -0600 +@@ -331,6 +331,7 @@ + + extern void i386_pe_unique_section PARAMS ((TREE, int)); + #define TARGET_ASM_UNIQUE_SECTION i386_pe_unique_section ++#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section + + #define SUPPORTS_ONE_ONLY 1 + +diff -Naur gcc-3.3.3-orig/gcc/config/i386/i386-interix.h gcc-3.3.3/gcc/config/i386/i386-interix.h +--- gcc-3.3.3-orig/gcc/config/i386/i386-interix.h 2002-11-25 22:54:48.000000000 -0600 ++++ gcc-3.3.3/gcc/config/i386/i386-interix.h 2004-12-19 22:51:56.113146912 -0600 +@@ -330,6 +330,7 @@ + + extern void i386_pe_unique_section PARAMS ((tree, int)); + #define TARGET_ASM_UNIQUE_SECTION i386_pe_unique_section ++#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section + + #define SUPPORTS_ONE_ONLY 1 + #endif /* 0 */ +diff -Naur gcc-3.3.3-orig/gcc/config/ip2k/ip2k.c gcc-3.3.3/gcc/config/ip2k/ip2k.c +--- gcc-3.3.3-orig/gcc/config/ip2k/ip2k.c 2003-01-14 14:13:45.000000000 -0600 ++++ gcc-3.3.3/gcc/config/ip2k/ip2k.c 2004-12-19 22:51:56.167138704 -0600 +@@ -95,6 +95,9 @@ + #undef TARGET_ENCODE_SECTION_INFO + #define TARGET_ENCODE_SECTION_INFO encode_section_info + ++#undef TARGET_ASM_FUNCTION_RODATA_SECTION ++#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section ++ + #undef TARGET_ATTRIBUTE_TABLE + #define TARGET_ATTRIBUTE_TABLE ip2k_attribute_table + +diff -Naur gcc-3.3.3-orig/gcc/config/mcore/mcore.c gcc-3.3.3/gcc/config/mcore/mcore.c +--- gcc-3.3.3-orig/gcc/config/mcore/mcore.c 2003-12-31 18:24:24.000000000 -0600 ++++ gcc-3.3.3/gcc/config/mcore/mcore.c 2004-12-19 22:51:56.199133840 -0600 +@@ -157,6 +157,8 @@ + #define TARGET_ATTRIBUTE_TABLE mcore_attribute_table + #undef TARGET_ASM_UNIQUE_SECTION + #define TARGET_ASM_UNIQUE_SECTION mcore_unique_section ++#undef TARGET_ASM_FUNCTION_RODATA_SECTION ++#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section + #undef TARGET_ENCODE_SECTION_INFO + #define TARGET_ENCODE_SECTION_INFO mcore_encode_section_info + #undef TARGET_STRIP_NAME_ENCODING +diff -Naur gcc-3.3.3-orig/gcc/config/rs6000/xcoff.h gcc-3.3.3/gcc/config/rs6000/xcoff.h +--- gcc-3.3.3-orig/gcc/config/rs6000/xcoff.h 2002-10-22 18:05:22.000000000 -0500 ++++ gcc-3.3.3/gcc/config/rs6000/xcoff.h 2004-12-19 22:51:56.246126696 -0600 +@@ -164,6 +164,7 @@ + #define TARGET_ASM_SELECT_SECTION rs6000_xcoff_select_section + #define TARGET_ASM_SELECT_RTX_SECTION rs6000_xcoff_select_rtx_section + #define TARGET_ASM_UNIQUE_SECTION rs6000_xcoff_unique_section ++#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section + #define TARGET_ENCODE_SECTION_INFO rs6000_xcoff_encode_section_info + #define TARGET_STRIP_NAME_ENCODING rs6000_xcoff_strip_name_encoding + #define TARGET_SECTION_TYPE_FLAGS rs6000_xcoff_section_type_flags +diff -Naur gcc-3.3.3-orig/gcc/doc/tm.texi gcc-3.3.3/gcc/doc/tm.texi +--- gcc-3.3.3-orig/gcc/doc/tm.texi 2003-12-12 10:10:09.000000000 -0600 ++++ gcc-3.3.3/gcc/doc/tm.texi 2004-12-19 22:51:56.317115904 -0600 +@@ -5902,6 +5902,15 @@ + Whatever the actual target object format, this is often good enough. + @end deftypefn + ++@deftypefn {Target Hook} void TARGET_ASM_FUNCTION_RODATA_SECTION (tree @var{decl}) ++Switches to a readonly data section associated with ++@samp{DECL_SECTION_NAME (@var{decl})}. ++The default version of this function switches to @code{.gnu.linkonce.r.name} ++section if function's section is @code{.gnu.linkonce.t.name}, to ++@code{.rodata.name} if function is in @code{.text.name} section ++and otherwise switches to the normal readonly data section. ++@end deftypefn ++ + @deftypefn {Target Hook} void TARGET_ASM_SELECT_RTX_SECTION (enum machine_mode @var{mode}, rtx @var{x}, unsigned HOST_WIDE_INT @var{align}) + Switches to the appropriate section for output of constant pool entry + @var{x} in @var{mode}. You can assume that @var{x} is some kind of +diff -Naur gcc-3.3.3-orig/gcc/final.c gcc-3.3.3/gcc/final.c +--- gcc-3.3.3-orig/gcc/final.c 2003-12-01 02:18:36.000000000 -0600 ++++ gcc-3.3.3/gcc/final.c 2004-12-19 22:51:56.373107392 -0600 +@@ -2258,7 +2258,7 @@ + { + int log_align; + +- readonly_data_section (); ++ targetm.asm_out.function_rodata_section (current_function_decl); + + #ifdef ADDR_VEC_ALIGN + log_align = ADDR_VEC_ALIGN (NEXT_INSN (insn)); +diff -Naur gcc-3.3.3-orig/gcc/output.h gcc-3.3.3/gcc/output.h +--- gcc-3.3.3-orig/gcc/output.h 2002-12-12 18:17:20.000000000 -0600 ++++ gcc-3.3.3/gcc/output.h 2004-12-19 22:51:56.420100248 -0600 +@@ -525,6 +525,8 @@ + unsigned HOST_WIDE_INT, int)); + extern void default_unique_section PARAMS ((tree, int)); + extern void default_unique_section_1 PARAMS ((tree, int, int)); ++extern void default_function_rodata_section (tree); ++extern void default_no_function_rodata_section (tree); + extern void default_select_rtx_section PARAMS ((enum machine_mode, rtx, + unsigned HOST_WIDE_INT)); + extern void default_elf_select_rtx_section PARAMS ((enum machine_mode, rtx, +diff -Naur gcc-3.3.3-orig/gcc/target-def.h gcc-3.3.3/gcc/target-def.h +--- gcc-3.3.3-orig/gcc/target-def.h 2002-12-09 17:53:59.000000000 -0600 ++++ gcc-3.3.3/gcc/target-def.h 2004-12-19 22:51:56.443096752 -0600 +@@ -75,6 +75,10 @@ + #define TARGET_ASM_UNIQUE_SECTION default_unique_section + #endif + ++#ifndef TARGET_ASM_FUNCTION_RODATA_SECTION ++#define TARGET_ASM_FUNCTION_RODATA_SECTION default_function_rodata_section ++#endif ++ + #ifndef TARGET_ASM_SELECT_RTX_SECTION + #define TARGET_ASM_SELECT_RTX_SECTION default_select_rtx_section + #endif +@@ -175,6 +179,7 @@ + TARGET_ASM_SELECT_SECTION, \ + TARGET_ASM_SELECT_RTX_SECTION, \ + TARGET_ASM_UNIQUE_SECTION, \ ++ TARGET_ASM_FUNCTION_RODATA_SECTION, \ + TARGET_ASM_CONSTRUCTOR, \ + TARGET_ASM_DESTRUCTOR, \ + TARGET_ASM_OUTPUT_MI_THUNK, \ +diff -Naur gcc-3.3.3-orig/gcc/target.h gcc-3.3.3/gcc/target.h +--- gcc-3.3.3-orig/gcc/target.h 2002-12-09 17:53:59.000000000 -0600 ++++ gcc-3.3.3/gcc/target.h 2004-12-19 22:51:56.463093712 -0600 +@@ -114,6 +114,10 @@ + for SELECT_SECTION. */ + void (* unique_section) PARAMS ((tree, int)); + ++ /* Tell assembler to switch to the readonly data section associated ++ with function DECL. */ ++ void (* function_rodata_section) (tree); ++ + /* Output a constructor for a symbol with a given priority. */ + void (* constructor) PARAMS ((rtx, int)); + +diff -Naur gcc-3.3.3-orig/gcc/testsuite/g++.old-deja/g++.other/comdat4-aux.cc gcc-3.3.3/gcc/testsuite/g++.old-deja/g++.other/comdat4-aux.cc +--- gcc-3.3.3-orig/gcc/testsuite/g++.old-deja/g++.other/comdat4-aux.cc 1969-12-31 18:00:00.000000000 -0600 ++++ gcc-3.3.3/gcc/testsuite/g++.old-deja/g++.other/comdat4-aux.cc 2004-12-19 22:51:56.484090520 -0600 +@@ -0,0 +1,40 @@ ++extern void ++bar (int x); ++ ++inline void ++foo (int i) ++{ ++ switch (i) ++ { ++ case 3: ++ case 5: ++ case 6: ++ case 9: ++ case 15: ++ bar (1); ++ break; ++ case 2: ++ case 4: ++ case 7: ++ case 10: ++ case 11: ++ case 12: ++ bar (2); ++ break; ++ case 0: ++ case 1: ++ case 8: ++ case 13: ++ case 16: ++ bar (3); ++ break; ++ case 14: ++ bar (4); ++ break; ++ default: ++ bar (5); ++ break; ++ } ++} ++ ++void *fooaddr2 = (void *) foo; +diff -Naur gcc-3.3.3-orig/gcc/testsuite/g++.old-deja/g++.other/comdat4.C gcc-3.3.3/gcc/testsuite/g++.old-deja/g++.other/comdat4.C +--- gcc-3.3.3-orig/gcc/testsuite/g++.old-deja/g++.other/comdat4.C 1969-12-31 18:00:00.000000000 -0600 ++++ gcc-3.3.3/gcc/testsuite/g++.old-deja/g++.other/comdat4.C 2004-12-19 22:51:56.485090368 -0600 +@@ -0,0 +1,57 @@ ++// PR c++/16276 ++// { dg-do link } ++// { dg-additional-sources " comdat4-aux.cc" } ++// { dg-options "-O2" } ++ ++extern void ++bar (int x); ++ ++inline void ++foo (int i) ++{ ++ switch (i) ++ { ++ case 3: ++ case 5: ++ case 6: ++ case 9: ++ case 15: ++ bar (1); ++ break; ++ case 2: ++ case 4: ++ case 7: ++ case 10: ++ case 11: ++ case 12: ++ bar (2); ++ break; ++ case 0: ++ case 1: ++ case 8: ++ case 13: ++ case 16: ++ bar (3); ++ break; ++ case 14: ++ bar (4); ++ break; ++ default: ++ bar (5); ++ break; ++ } ++} ++ ++void *fooaddr = (void *) foo; ++ ++void ++bar (int x) ++{ ++ __asm __volatile ("" : : "r" (x)); ++} ++ ++int ++main (void) ++{ ++ return 0; ++} +diff -Naur gcc-3.3.3-orig/gcc/varasm.c gcc-3.3.3/gcc/varasm.c +--- gcc-3.3.3-orig/gcc/varasm.c 2004-01-12 12:23:08.000000000 -0600 ++++ gcc-3.3.3/gcc/varasm.c 2004-12-19 22:51:56.528083832 -0600 +@@ -568,6 +568,53 @@ + text_section (); + } + ++/* Switch to read-only data section associated with function DECL. */ ++ ++void ++default_function_rodata_section (tree decl) ++{ ++ if (decl != NULL_TREE && DECL_SECTION_NAME (decl)) ++ { ++ const char *name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl)); ++ ++ /* For .gnu.linkonce.t.foo we want to use .gnu.linkonce.r.foo. */ ++ if (DECL_ONE_ONLY (decl) && strncmp (name, ".gnu.linkonce.t.", 16) == 0) ++ { ++ size_t len = strlen (name) + 1; ++ char *rname = alloca (len); ++ ++ memcpy (rname, name, len); ++ rname[14] = 'r'; ++ named_section_flags (rname, SECTION_LINKONCE); ++ return; ++ } ++ /* For .text.foo we want to use .rodata.foo. */ ++ else if (flag_function_sections && flag_data_sections ++ && strncmp (name, ".text.", 6) == 0) ++ { ++ size_t len = strlen (name) + 1; ++ char *rname = alloca (len + 2); ++ ++ memcpy (rname, ".rodata", 7); ++ memcpy (rname + 7, name + 5, len - 5); ++ named_section_flags (rname, 0); ++ return; ++ } ++ } ++ ++ readonly_data_section (); ++} ++ ++/* Switch to read-only data section associated with function DECL ++ for targets where that section should be always the single ++ readonly data section. */ ++ ++void ++default_no_function_rodata_section (tree decl ATTRIBUTE_UNUSED) ++{ ++ readonly_data_section (); ++} ++ + /* Switch to section for variable DECL. RELOC is the same as the + argument to SELECT_SECTION. */ + diff --git a/base-source/gcc-3.3.6-no_fixincludes-1.patch b/base-source/gcc-3.3.6-no_fixincludes-1.patch new file mode 100644 index 0000000..a727f5a --- /dev/null +++ b/base-source/gcc-3.3.6-no_fixincludes-1.patch @@ -0,0 +1,30 @@ +Submitted By: Ronald Hummelink +Date: 2003-08-16 +Initial Package Version: 3.3.1 +Origin: Originally developed for GCC 3.2 by Greg Schafer +Description: Prevent fixincludes script from running. + +$LastChangedBy: randy $ +$Date: 2005-08-17 11:33:20 -0500 (Wed, 17 Aug 2005) $ + +--- gcc-3.3.1.orig/gcc/Makefile.in 2003-08-03 15:48:36.000000000 +0000 ++++ gcc-3.3.1/gcc/Makefile.in 2003-08-15 23:40:28.000000000 +0000 +@@ -2335,10 +2335,6 @@ + rm -f include/limits.h + cp xlimits.h include/limits.h + chmod a+r include/limits.h +-# Install the README +- rm -f include/README +- cp $(srcdir)/README-fixinc include/README +- chmod a+r include/README + $(STAMP) $@ + + # fixinc.sh depends on this, not on specs directly. +@@ -2369,7 +2365,6 @@ + (TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \ + SHELL='$(SHELL)' ;\ + export TARGET_MACHINE srcdir SHELL ; \ +- $(SHELL) ./fixinc.sh `${PWD_COMMAND}`/include $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS); \ + rm -f include/syslimits.h; \ + if [ -f include/limits.h ]; then \ + mv include/limits.h include/syslimits.h; \ diff --git a/base-source/gcc-3.3.6.tar.bz2 b/base-source/gcc-3.3.6.tar.bz2 new file mode 100644 index 0000000..ec73553 Binary files /dev/null and b/base-source/gcc-3.3.6.tar.bz2 differ diff --git a/base-source/gcc-4.0.3-specs-1.patch b/base-source/gcc-4.0.3-specs-1.patch new file mode 100644 index 0000000..46521e1 --- /dev/null +++ b/base-source/gcc-4.0.3-specs-1.patch @@ -0,0 +1,336 @@ +Submitted By: Robert Connolly (ashes) +Date: 2006-01-16 +Initial Package Version: 4.0.0 +Upstream Status: Not Sent - LFS Specfic +Origin: Idea originally developed by Ryan Oliver and Greg Schafer for + the Pure LFS project. + More architectures added by Zack Winkles. + Further fine tunings by Greg Schafer. + Modified for gcc 3.3.2 by Oliver Brakmann. +Rediffed against gcc 3.4.0 by Zack Winkles. + Rediffed against gcc 3.4.3 by Jim Gifford. + Rediffed against gcc 4.0.0 by Robert Connolly. +Description: This patch modifies the location of the dynamic linker for + the GCC Pass 2 build in LFS Chapter 5. + +diff -Naur gcc-20050116.orig/gcc/config/alpha/linux-elf.h gcc-20050116/gcc/config/alpha/linux-elf.h +--- gcc-20050116.orig/gcc/config/alpha/linux-elf.h 2005-01-17 00:45:16.000000000 +0000 ++++ gcc-20050116/gcc/config/alpha/linux-elf.h 2005-01-17 00:46:14.560651027 +0000 +@@ -27,7 +27,7 @@ + #define SUBTARGET_EXTRA_SPECS \ + { "elf_dynamic_linker", ELF_DYNAMIC_LINKER }, + +-#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define ELF_DYNAMIC_LINKER "/tools/lib/ld-linux.so.2" + + #define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \ + %{O*:-O3} %{!O*:-O1} \ +diff -Naur gcc-20050116.orig/gcc/config/arm/linux-elf.h gcc-20050116/gcc/config/arm/linux-elf.h +--- gcc-20050116.orig/gcc/config/arm/linux-elf.h 2005-01-17 00:45:16.000000000 +0000 ++++ gcc-20050116/gcc/config/arm/linux-elf.h 2005-01-17 00:46:50.538578614 +0000 +@@ -87,7 +87,7 @@ + %{shared:-shared} \ + %{symbolic:-Bsymbolic} \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \ ++ %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2} \ + -X \ + %{mbig-endian:-EB}" \ + SUBTARGET_EXTRA_LINK_SPEC +diff -Naur gcc-20050116.orig/gcc/config/frv/linux.h gcc-20050116/gcc/config/frv/linux.h +--- gcc-20050116.orig/gcc/config/frv/linux.h 2005-01-17 00:45:16.000000000 +0000 ++++ gcc-20050116/gcc/config/frv/linux.h 2005-01-17 01:33:50.600805260 +0000 +@@ -41,7 +41,7 @@ + %{mfdpic: -m elf32frvfd -z text} %{shared} %{pie} \ + %{!shared: %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \ ++ %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \ + %{static}}" + + /* Support for compile-time default CPU. */ +diff -Naur gcc-20050116.orig/gcc/config/i386/gnu.h gcc-20050116/gcc/config/i386/gnu.h +--- gcc-20050116.orig/gcc/config/i386/gnu.h 2005-01-17 00:45:16.000000000 +0000 ++++ gcc-20050116/gcc/config/i386/gnu.h 2005-01-17 01:34:11.142021939 +0000 +@@ -27,7 +27,7 @@ + %{!shared: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker:-dynamic-linker /lib/ld.so}} \ ++ %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so}} \ + %{static:-static}}" + + #undef STARTFILE_SPEC +diff -Naur gcc-20050116.orig/gcc/config/i386/linux.h gcc-20050116/gcc/config/i386/linux.h +--- gcc-20050116.orig/gcc/config/i386/linux.h 2005-01-17 00:45:16.000000000 +0000 ++++ gcc-20050116/gcc/config/i386/linux.h 2005-01-17 00:49:27.412667132 +0000 +@@ -105,7 +105,7 @@ + /* If ELF is the default format, we should not use /lib/elf. */ + + #define LINK_EMULATION "elf_i386" +-#define DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define DYNAMIC_LINKER "/tools/lib/ld-linux.so.2" + + #undef SUBTARGET_EXTRA_SPECS + #define SUBTARGET_EXTRA_SPECS \ +diff -Naur gcc-20050116.orig/gcc/config/i386/linux64.h gcc-20050116/gcc/config/i386/linux64.h +--- gcc-20050116.orig/gcc/config/i386/linux64.h 2005-01-17 00:45:16.000000000 +0000 ++++ gcc-20050116/gcc/config/i386/linux64.h 2005-01-17 00:50:23.055094690 +0000 +@@ -60,8 +60,8 @@ + %{!shared: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ +- %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \ ++ %{m32:%{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \ ++ %{!m32:%{!dynamic-linker:-dynamic-linker /tools/lib64/ld-linux-x86-64.so.2}}} \ + %{static:-static}}" + + #define MULTILIB_DEFAULTS { "m64" } +diff -Naur gcc-20050116.orig/gcc/config/ia64/linux.h gcc-20050116/gcc/config/ia64/linux.h +--- gcc-20050116.orig/gcc/config/ia64/linux.h 2005-01-17 00:45:17.000000000 +0000 ++++ gcc-20050116/gcc/config/ia64/linux.h 2005-01-17 00:50:43.146472133 +0000 +@@ -43,7 +43,7 @@ + %{!shared: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \ ++ %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux-ia64.so.2}} \ + %{static:-static}}" + + +diff -Naur gcc-20050116.orig/gcc/config/linux.h gcc-20050116/gcc/config/linux.h +--- gcc-20050116.orig/gcc/config/linux.h 2005-01-17 00:45:16.000000000 +0000 ++++ gcc-20050116/gcc/config/linux.h 2005-01-17 00:51:14.101809663 +0000 +@@ -104,3 +104,7 @@ + #define TARGET_C99_FUNCTIONS 1 + + #define TARGET_HAS_F_SETLKW ++ ++/* Remove /usr/include from the end of the include search path. */ ++#undef STANDARD_INCLUDE_DIR ++#define STANDARD_INCLUDE_DIR 0 +diff -Naur gcc-20050116.orig/gcc/config/m32r/linux.h gcc-20050116/gcc/config/m32r/linux.h +--- gcc-20050116.orig/gcc/config/m32r/linux.h 2005-01-17 00:45:17.000000000 +0000 ++++ gcc-20050116/gcc/config/m32r/linux.h 2005-01-17 00:51:39.720640870 +0000 +@@ -66,7 +66,7 @@ + %{!ibcs: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ ++ %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \ + %{static:-static}}}" + #else + #define LINK_SPEC "%(link_cpu) -m m32relf_linux %{shared:-shared} \ +@@ -74,7 +74,7 @@ + %{!ibcs: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ ++ %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \ + %{static:-static}}}" + #endif + +diff -Naur gcc-20050116.orig/gcc/config/m68k/linux.h gcc-20050116/gcc/config/m68k/linux.h +--- gcc-20050116.orig/gcc/config/m68k/linux.h 2005-01-17 00:45:17.000000000 +0000 ++++ gcc-20050116/gcc/config/m68k/linux.h 2005-01-17 00:52:07.633830392 +0000 +@@ -132,7 +132,7 @@ + %{!shared: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker*:-dynamic-linker /lib/ld.so.1}} \ ++ %{!dynamic-linker*:-dynamic-linker /tools/lib/ld.so.1}} \ + %{static}}" + + /* For compatibility with linux/a.out */ +diff -Naur gcc-20050116.orig/gcc/config/mips/linux.h gcc-20050116/gcc/config/mips/linux.h +--- gcc-20050116.orig/gcc/config/mips/linux.h 2005-01-17 00:45:17.000000000 +0000 ++++ gcc-20050116/gcc/config/mips/linux.h 2005-01-17 00:52:28.348034505 +0000 +@@ -115,7 +115,7 @@ + %{!ibcs: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \ ++ %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \ + %{static:-static}}}" + + #undef SUBTARGET_ASM_SPEC +diff -Naur gcc-20050116.orig/gcc/config/mips/linux64.h gcc-20050116/gcc/config/mips/linux64.h +--- gcc-20050116.orig/gcc/config/mips/linux64.h 2005-01-17 00:45:17.000000000 +0000 ++++ gcc-20050116/gcc/config/mips/linux64.h 2005-01-17 00:53:04.645878728 +0000 +@@ -60,9 +60,9 @@ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker: \ +- %{mabi=n32: -dynamic-linker /lib32/ld.so.1} \ +- %{mabi=64: -dynamic-linker /lib64/ld.so.1} \ +- %{mabi=32: -dynamic-linker /lib/ld.so.1}}} \ ++ %{mabi=n32: -dynamic-linker /tools/lib32/ld.so.1} \ ++ %{mabi=64: -dynamic-linker /tools/lib64/ld.so.1} \ ++ %{mabi=32: -dynamic-linker /tools/lib/ld.so.1}}} \ + %{static:-static}}} \ + %{mabi=n32:-melf32%{EB:b}%{EL:l}tsmipn32} \ + %{mabi=64:-melf64%{EB:b}%{EL:l}tsmip} \ +diff -Naur gcc-20050116.orig/gcc/config/mn10300/linux.h gcc-20050116/gcc/config/mn10300/linux.h +--- gcc-20050116.orig/gcc/config/mn10300/linux.h 2005-01-17 00:45:17.000000000 +0000 ++++ gcc-20050116/gcc/config/mn10300/linux.h 2005-01-17 00:53:23.477610026 +0000 +@@ -37,7 +37,7 @@ + #define LINK_SPEC "%{mrelax:--relax} %{shared:-shared} \ + %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \ ++ %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \ + %{static:-static}" + + #undef LIB_SPEC +diff -Naur gcc-20050116.orig/gcc/config/pa/pa-linux.h gcc-20050116/gcc/config/pa/pa-linux.h +--- gcc-20050116.orig/gcc/config/pa/pa-linux.h 2005-01-17 00:45:17.000000000 +0000 ++++ gcc-20050116/gcc/config/pa/pa-linux.h 2005-01-17 00:53:45.334495141 +0000 +@@ -88,7 +88,7 @@ + %{!shared: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \ ++ %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \ + %{static:-static}}" + + /* glibc's profiling functions don't need gcc to allocate counters. */ +diff -Naur gcc-20050116.orig/gcc/config/rs6000/linux64.h gcc-20050116/gcc/config/rs6000/linux64.h +--- gcc-20050116.orig/gcc/config/rs6000/linux64.h 2005-01-17 00:45:17.000000000 +0000 ++++ gcc-20050116/gcc/config/rs6000/linux64.h 2005-01-17 00:54:28.524412534 +0000 +@@ -351,11 +351,11 @@ + + #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}" ++ %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}}}" + + #define LINK_OS_LINUX_SPEC64 "-m elf64ppc %{!shared: %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker:-dynamic-linker /lib64/ld64.so.1}}}" ++ %{!dynamic-linker:-dynamic-linker /tools/lib64/ld64.so.1}}}" + + #undef TOC_SECTION_ASM_OP + #define TOC_SECTION_ASM_OP \ +diff -Naur gcc-20050116.orig/gcc/config/rs6000/sysv4.h gcc-20050116/gcc/config/rs6000/sysv4.h +--- gcc-20050116.orig/gcc/config/rs6000/sysv4.h 2005-01-17 00:45:17.000000000 +0000 ++++ gcc-20050116/gcc/config/rs6000/sysv4.h 2005-01-17 01:26:39.126999460 +0000 +@@ -1131,7 +1131,7 @@ + + #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}" ++ %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}}}" + + #if defined(HAVE_LD_EH_FRAME_HDR) + # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " +@@ -1162,7 +1162,7 @@ + + #define LINK_OS_GNU_SPEC "-m elf32ppclinux %{!shared: %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}" ++ %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}}}" + + #define CPP_OS_GNU_SPEC "-D__unix__ -D__gnu_hurd__ -D__GNU__ \ + %{!undef: \ +diff -Naur gcc-20050116.orig/gcc/config/s390/linux.h gcc-20050116/gcc/config/s390/linux.h +--- gcc-20050116.orig/gcc/config/s390/linux.h 2005-01-17 00:45:17.000000000 +0000 ++++ gcc-20050116/gcc/config/s390/linux.h 2005-01-17 01:26:58.672523211 +0000 +@@ -86,8 +86,8 @@ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker: \ +- %{m31:-dynamic-linker /lib/ld.so.1} \ +- %{m64:-dynamic-linker /lib/ld64.so.1}}}}" ++ %{m31:-dynamic-linker /tools/lib/ld.so.1} \ ++ %{m64:-dynamic-linker /tools/lib/ld64.so.1}}}}" + + + #define TARGET_ASM_FILE_END file_end_indicate_exec_stack +diff -Naur gcc-20050116.orig/gcc/config/sh/linux.h gcc-20050116/gcc/config/sh/linux.h +--- gcc-20050116.orig/gcc/config/sh/linux.h 2005-01-17 00:45:18.000000000 +0000 ++++ gcc-20050116/gcc/config/sh/linux.h 2005-01-17 01:27:19.588663163 +0000 +@@ -70,7 +70,7 @@ + "%{shared:-shared} \ + %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ ++ %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \ + %{static:-static}" + + #undef LIB_SPEC +diff -Naur gcc-20050116.orig/gcc/config/sparc/linux.h gcc-20050116/gcc/config/sparc/linux.h +--- gcc-20050116.orig/gcc/config/sparc/linux.h 2005-01-17 00:45:18.000000000 +0000 ++++ gcc-20050116/gcc/config/sparc/linux.h 2005-01-17 01:30:07.282688639 +0000 +@@ -131,13 +131,13 @@ + /* If ELF is the default format, we should not use /lib/elf. */ + + #undef LINK_SPEC +-#define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \ ++#define LINK_SPEC "-m elf32_sparc -Y P,/tools/lib %{shared:-shared} \ + %{!mno-relax:%{!r:-relax}} \ + %{!shared: \ + %{!ibcs: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ ++ %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \ + %{static:-static}}}" + + /* The sun bundled assembler doesn't accept -Yd, (and neither does gas). +diff -Naur gcc-20050116.orig/gcc/config/sparc/linux64.h gcc-20050116/gcc/config/sparc/linux64.h +--- gcc-20050116.orig/gcc/config/sparc/linux64.h 2005-01-17 00:45:18.000000000 +0000 ++++ gcc-20050116/gcc/config/sparc/linux64.h 2005-01-17 01:31:18.242712476 +0000 +@@ -167,21 +167,21 @@ + { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \ + { "link_arch", LINK_ARCH_SPEC }, + +-#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \ ++#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/tools/lib %{shared:-shared} \ + %{!shared: \ + %{!ibcs: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ ++ %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \ + %{static:-static}}} \ + " + +-#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \ ++#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,/tools/lib64 %{shared:-shared} \ + %{!shared: \ + %{!ibcs: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker:-dynamic-linker /lib64/ld-linux.so.2}} \ ++ %{!dynamic-linker:-dynamic-linker /tools/lib64/ld-linux.so.2}} \ + %{static:-static}}} \ + " + +@@ -257,12 +257,12 @@ + #else /* !SPARC_BI_ARCH */ + + #undef LINK_SPEC +-#define LINK_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \ ++#define LINK_SPEC "-m elf64_sparc -Y P,/tools/lib64 %{shared:-shared} \ + %{!shared: \ + %{!ibcs: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker:-dynamic-linker /lib64/ld-linux.so.2}} \ ++ %{!dynamic-linker:-dynamic-linker /tools/lib64/ld-linux.so.2}} \ + %{static:-static}}} \ + %{mlittle-endian:-EL} \ + %{!mno-relax:%{!r:-relax}} \ +diff -Naur gcc-20050116.orig/gcc/config/xtensa/linux.h gcc-20050116/gcc/config/xtensa/linux.h +--- gcc-20050116.orig/gcc/config/xtensa/linux.h 2005-01-17 00:45:18.000000000 +0000 ++++ gcc-20050116/gcc/config/xtensa/linux.h 2005-01-17 01:32:08.951429623 +0000 +@@ -50,7 +50,7 @@ + %{!ibcs: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \ ++ %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \ + %{static:-static}}}" + + #undef LOCAL_LABEL_PREFIX diff --git a/base-source/gcc-4.0.3.tar.bz2 b/base-source/gcc-4.0.3.tar.bz2 new file mode 100644 index 0000000..d15dfed Binary files /dev/null and b/base-source/gcc-4.0.3.tar.bz2 differ diff --git a/base-source/gdb-6.4.tar.bz2 b/base-source/gdb-6.4.tar.bz2 new file mode 100644 index 0000000..7463d0d Binary files /dev/null and b/base-source/gdb-6.4.tar.bz2 differ diff --git a/base-source/gettext-0.14.5.tar.gz b/base-source/gettext-0.14.5.tar.gz new file mode 100644 index 0000000..be3708b Binary files /dev/null and b/base-source/gettext-0.14.5.tar.gz differ diff --git a/base-source/git-1.4.2.tar.bz2 b/base-source/git-1.4.2.tar.bz2 new file mode 100644 index 0000000..cd79ce9 Binary files /dev/null and b/base-source/git-1.4.2.tar.bz2 differ diff --git a/base-source/glibc-2.3.6-linux_types-1.patch b/base-source/glibc-2.3.6-linux_types-1.patch new file mode 100644 index 0000000..a365b81 --- /dev/null +++ b/base-source/glibc-2.3.6-linux_types-1.patch @@ -0,0 +1,33 @@ +Submitted By: DJ Lucas +Date: 2006-04-05 +Initial Package Version: 2.3.6 +Upstream Status: Committed +Origin: Glibc CVS +Description: Fixes build errors where linux/types.h is included after sys/kd.h. + +diff -Naur glibc-2.3.6-orig/sysdeps/unix/sysv/linux/sys/kd.h glibc-2.3.6/sysdeps/unix/sysv/linux/sys/kd.h +--- glibc-2.3.6-orig/sysdeps/unix/sysv/linux/sys/kd.h 2001-07-05 23:56:21.000000000 -0500 ++++ glibc-2.3.6/sysdeps/unix/sysv/linux/sys/kd.h 2006-04-04 21:40:50.000000000 -0500 +@@ -1,4 +1,4 @@ +-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. ++/* Copyright (C) 1996, 1997, 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or +@@ -21,9 +21,15 @@ + + /* Make sure the header is not loaded. */ + #ifndef _LINUX_TYPES_H +-# define _LINUX_TYPES_H 1 ++# define _LINUX_TYPES_H 1 ++# define __undef_LINUX_TYPES_H + #endif + + #include + ++#ifdef __undef_LINUX_TYPES_H ++# undef _LINUX_TYPES_H ++# undef __undef_LINUX_TYPES_H ++#endif ++ + #endif /* sys/kd.h */ diff --git a/base-source/glibc-2.3.6.tar.bz2 b/base-source/glibc-2.3.6.tar.bz2 new file mode 100644 index 0000000..33c1337 Binary files /dev/null and b/base-source/glibc-2.3.6.tar.bz2 differ diff --git a/base-source/glibc-libidn-2.3.6.tar.bz2 b/base-source/glibc-libidn-2.3.6.tar.bz2 new file mode 100644 index 0000000..e8c9bd8 Binary files /dev/null and b/base-source/glibc-libidn-2.3.6.tar.bz2 differ diff --git a/base-source/gpm-1.20.1-segfault-1.patch b/base-source/gpm-1.20.1-segfault-1.patch new file mode 100644 index 0000000..981b24e --- /dev/null +++ b/base-source/gpm-1.20.1-segfault-1.patch @@ -0,0 +1,18 @@ +Submitted By: Alexander E. Patrakov semzx at newmail.ru +Date: 2003-10-03 +Initial Package Version: 1.20.1 +Origin: http://archives.linuxfromscratch.org/mail-archives/blfs-dev/2003-May/002916.html +Description: Prevent Segfault under certain conditions. +diff -urN gpm-1.20.1.old/src/lib/liblow.c gpm-1.20.1/src/lib/liblow.c +--- gpm-1.20.1.old/src/lib/liblow.c 2002-12-25 03:57:16.000000000 +0500 ++++ gpm-1.20.1/src/lib/liblow.c 2003-05-02 21:51:37.000000000 +0600 +@@ -199,7 +199,8 @@ + Gpm_Stst *new = NULL; + char* sock_name = 0; + +- option.consolename = NULL; ++ if (!checked_con) ++ option.consolename = NULL; + + gpm_report(GPM_PR_DEBUG,"VC: %d",flag); + diff --git a/base-source/gpm-1.20.1-silent-1.patch b/base-source/gpm-1.20.1-silent-1.patch new file mode 100644 index 0000000..1d9417e --- /dev/null +++ b/base-source/gpm-1.20.1-silent-1.patch @@ -0,0 +1,29 @@ +Submitted By: Alexander E. Patrakov semzx at newmail.ru +Date: 2003-10-03 +Initial Package Version: 1.20.1 +Origin: http://archives.linuxfromscratch.org/mail-archives/blfs-dev/2003-May/002916.html +Description: Don't output debug messages on screen. +diff -ur gpm-1.20.1.orig/src/lib/report-lib.c gpm-1.20.1/src/lib/report-lib.c +--- gpm-1.20.1.orig/src/lib/report-lib.c 2002-12-25 03:57:16.000000000 +0500 ++++ gpm-1.20.1/src/lib/report-lib.c 2003-05-09 20:09:25.000000000 +0600 +@@ -28,6 +28,8 @@ + { + char *string = NULL; + va_list ap; ++ if (stat != GPM_STAT_OOPS) ++ return; + va_start(ap,text); + + switch(stat) { +diff -ur gpm-1.20.1.orig/src/report.c gpm-1.20.1/src/report.c +--- gpm-1.20.1.orig/src/report.c 2002-12-25 03:57:16.000000000 +0500 ++++ gpm-1.20.1/src/report.c 2003-05-09 20:10:46.000000000 +0600 +@@ -73,6 +73,8 @@ + FILE *console = NULL; + va_list ap; + ++ if (stat <= GPM_STAT_INFO) ++ return; + va_start(ap,text); + + switch(option.run_status) { diff --git a/base-source/gpm-1.20.1.tar.bz2 b/base-source/gpm-1.20.1.tar.bz2 new file mode 100644 index 0000000..404486b Binary files /dev/null and b/base-source/gpm-1.20.1.tar.bz2 differ diff --git a/base-source/grep-2.5.1a-redhat_fixes-2.patch b/base-source/grep-2.5.1a-redhat_fixes-2.patch new file mode 100644 index 0000000..9c30342 --- /dev/null +++ b/base-source/grep-2.5.1a-redhat_fixes-2.patch @@ -0,0 +1,2109 @@ +Submitted by: Alexander E. Patrakov +Date: 2005-08-13 +Initial Package Version: 2.5.1a +Upstream Status: Partially accepted, partially rejected, but required for LSB >= 2.0 certification +Origin: RedHat +Description: Various fixes from RedHat. Individual patches: + + grep-2.5.1-fgrep.patch + grep-2.5.1-bracket.patch + grep-2.5-i18n.patch + grep-2.5.1-oi.patch + grep-2.5.1-manpage.patch + grep-2.5.1-color.patch + grep-2.5.1-icolor.patch + grep-2.5.1-egf-speedup.patch + grep-2.5.1-dfa-optional.patch + grep-2.5.1-tests.patch + grep-2.5.1-w.patch + +Testcases: + + -fgrep: ???, but required for other patches + -bracket: echo "[" | LANG=en_US.UTF-8 grep "[[:space:]]" + -i18n: many fixes for multibyte locale support, required for LSB. + -oi: echo xxYYzz | LANG=C grep -i -o yy + -manpage: typo + -color: restore the background color correctly + -icolor: ??? echo 'spam foo SPAM FOO' | grep -i --color spam + (but that's also fixed by -oi. Is this patch just a cleanup?) + -egf-speedup: without this, grep is as slow as a snail in UTF-8 locales. + -dfa-optional: disables dfa in multibyte locales by default. + -w: (echo 'foo';echo 'fo') > /tmp/testfile && grep -F -w fo /tmp/testfile + +diff -urN grep-2.5.1a.orig/doc/grep.1 grep-2.5.1a/doc/grep.1 +--- grep-2.5.1a.orig/doc/grep.1 2004-11-12 16:26:37.000000000 +0500 ++++ grep-2.5.1a/doc/grep.1 2005-10-23 09:49:43.000000000 +0600 +@@ -191,6 +191,7 @@ + .I PATTERN + as a list of fixed strings, separated by newlines, + any of which is to be matched. ++.TP + .BR \-P ", " \-\^\-perl-regexp + Interpret + .I PATTERN +@@ -302,7 +303,7 @@ + This is especially useful for tools like zgrep, e.g. + .B "gzip -cd foo.gz |grep --label=foo something" + .TP +-.BR \-\^\-line-buffering ++.BR \-\^\-line-buffered + Use line buffering, it can be a performance penality. + .TP + .BR \-q ", " \-\^\-quiet ", " \-\^\-silent +diff -urN grep-2.5.1a.orig/lib/posix/regex.h grep-2.5.1a/lib/posix/regex.h +--- grep-2.5.1a.orig/lib/posix/regex.h 2001-04-02 23:56:50.000000000 +0600 ++++ grep-2.5.1a/lib/posix/regex.h 2005-10-23 09:49:31.000000000 +0600 +@@ -109,6 +109,10 @@ + If not set, \{, \}, {, and } are literals. */ + #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1) + ++/* If this bit is set, then ignore case when matching. ++ If not set, then case is significant. */ ++#define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1) ++ + /* If this bit is set, +, ? and | aren't recognized as operators. + If not set, they are. */ + #define RE_LIMITED_OPS (RE_INTERVALS << 1) +diff -urN grep-2.5.1a.orig/src/dfa.c grep-2.5.1a/src/dfa.c +--- grep-2.5.1a.orig/src/dfa.c 2001-09-26 22:57:55.000000000 +0600 ++++ grep-2.5.1a/src/dfa.c 2005-10-23 09:49:17.000000000 +0600 +@@ -414,7 +414,7 @@ + + /* This function fetch a wide character, and update cur_mb_len, + used only if the current locale is a multibyte environment. */ +-static wchar_t ++static wint_t + fetch_wc (char const *eoferr) + { + wchar_t wc; +@@ -423,7 +423,7 @@ + if (eoferr != 0) + dfaerror (eoferr); + else +- return -1; ++ return WEOF; + } + + cur_mb_len = mbrtowc(&wc, lexptr, lexleft, &mbs); +@@ -459,7 +459,7 @@ + static void + parse_bracket_exp_mb () + { +- wchar_t wc, wc1, wc2; ++ wint_t wc, wc1, wc2; + + /* Work area to build a mb_char_classes. */ + struct mb_char_classes *work_mbc; +@@ -496,7 +496,7 @@ + work_mbc->invert = 0; + do + { +- wc1 = -1; /* mark wc1 is not initialized". */ ++ wc1 = WEOF; /* mark wc1 is not initialized". */ + + /* Note that if we're looking at some other [:...:] construct, + we just treat it as a bunch of ordinary characters. We can do +@@ -586,7 +586,7 @@ + work_mbc->coll_elems[work_mbc->ncoll_elems++] = elem; + } + } +- wc = -1; ++ wc1 = wc = WEOF; + } + else + /* We treat '[' as a normal character here. */ +@@ -600,7 +600,7 @@ + wc = fetch_wc(("Unbalanced [")); + } + +- if (wc1 == -1) ++ if (wc1 == WEOF) + wc1 = fetch_wc(_("Unbalanced [")); + + if (wc1 == L'-') +@@ -630,17 +630,17 @@ + } + REALLOC_IF_NECESSARY(work_mbc->range_sts, wchar_t, + range_sts_al, work_mbc->nranges + 1); +- work_mbc->range_sts[work_mbc->nranges] = wc; ++ work_mbc->range_sts[work_mbc->nranges] = (wchar_t)wc; + REALLOC_IF_NECESSARY(work_mbc->range_ends, wchar_t, + range_ends_al, work_mbc->nranges + 1); +- work_mbc->range_ends[work_mbc->nranges++] = wc2; ++ work_mbc->range_ends[work_mbc->nranges++] = (wchar_t)wc2; + } +- else if (wc != -1) ++ else if (wc != WEOF) + /* build normal characters. */ + { + REALLOC_IF_NECESSARY(work_mbc->chars, wchar_t, chars_al, + work_mbc->nchars + 1); +- work_mbc->chars[work_mbc->nchars++] = wc; ++ work_mbc->chars[work_mbc->nchars++] = (wchar_t)wc; + } + } + while ((wc = wc1) != L']'); +@@ -2552,6 +2552,8 @@ + } + + /* match with a character? */ ++ if (case_fold) ++ wc = towlower (wc); + for (i = 0; inchars; i++) + { + if (wc == work_mbc->chars[i]) +diff -urN grep-2.5.1a.orig/src/grep.c grep-2.5.1a/src/grep.c +--- grep-2.5.1a.orig/src/grep.c 2004-11-12 16:25:35.000000000 +0500 ++++ grep-2.5.1a/src/grep.c 2005-10-23 09:50:06.000000000 +0600 +@@ -30,6 +30,12 @@ + # include + # include + #endif ++#if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC ++/* We can handle multibyte string. */ ++# define MBS_SUPPORT ++# include ++# include ++#endif + #include + #include "system.h" + #include "getopt.h" +@@ -558,33 +564,6 @@ + { + size_t match_size; + size_t match_offset; +- if(match_icase) +- { +- /* Yuck, this is tricky */ +- char *buf = (char*) xmalloc (lim - beg); +- char *ibeg = buf; +- char *ilim = ibeg + (lim - beg); +- int i; +- for (i = 0; i < lim - beg; i++) +- ibeg[i] = tolower (beg[i]); +- while ((match_offset = (*execute) (ibeg, ilim-ibeg, &match_size, 1)) +- != (size_t) -1) +- { +- char const *b = beg + match_offset; +- if (b == lim) +- break; +- fwrite (beg, sizeof (char), match_offset, stdout); +- printf ("\33[%sm", grep_color); +- fwrite (b, sizeof (char), match_size, stdout); +- fputs ("\33[00m", stdout); +- beg = b + match_size; +- ibeg = ibeg + match_offset + match_size; +- } +- fwrite (beg, 1, lim - beg, stdout); +- free (buf); +- lastout = lim; +- return; +- } + while (lim-beg && (match_offset = (*execute) (beg, lim - beg, &match_size, 1)) + != (size_t) -1) + { +@@ -601,6 +580,7 @@ + fputs ("\33[00m", stdout); + beg = b + match_size; + } ++ fputs ("\33[K", stdout); + } + fwrite (beg, 1, lim - beg, stdout); + if (ferror (stdout)) +@@ -1697,6 +1677,37 @@ + if (!install_matcher (matcher) && !install_matcher ("default")) + abort (); + ++#ifdef MBS_SUPPORT ++ if (MB_CUR_MAX != 1 && match_icase) ++ { ++ wchar_t wc; ++ mbstate_t cur_state, prev_state; ++ int i, len = strlen(keys); ++ ++ memset(&cur_state, 0, sizeof(mbstate_t)); ++ for (i = 0; i <= len ;) ++ { ++ size_t mbclen; ++ mbclen = mbrtowc(&wc, keys + i, len - i, &cur_state); ++ if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0) ++ { ++ /* An invalid sequence, or a truncated multibyte character. ++ We treat it as a singlebyte character. */ ++ mbclen = 1; ++ } ++ else ++ { ++ if (iswupper((wint_t)wc)) ++ { ++ wc = towlower((wint_t)wc); ++ wcrtomb(keys + i, wc, &cur_state); ++ } ++ } ++ i += mbclen; ++ } ++ } ++#endif /* MBS_SUPPORT */ ++ + (*compile)(keys, keycc); + + if ((argc - optind > 1 && !no_filenames) || with_filenames) +diff -urN grep-2.5.1a.orig/src/search.c grep-2.5.1a/src/search.c +--- grep-2.5.1a.orig/src/search.c 2001-04-19 09:42:14.000000000 +0600 ++++ grep-2.5.1a/src/search.c 2005-10-23 09:51:25.000000000 +0600 +@@ -18,9 +18,13 @@ + + /* Written August 1992 by Mike Haertel. */ + ++#ifndef _GNU_SOURCE ++# define _GNU_SOURCE 1 ++#endif + #ifdef HAVE_CONFIG_H + # include + #endif ++#include + #include + #if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC + /* We can handle multibyte string. */ +@@ -31,7 +35,7 @@ + + #include "system.h" + #include "grep.h" +-#include "regex.h" ++#include + #include "dfa.h" + #include "kwset.h" + #include "error.h" +@@ -39,6 +43,9 @@ + #ifdef HAVE_LIBPCRE + # include + #endif ++#ifdef HAVE_LANGINFO_CODESET ++# include ++#endif + + #define NCHAR (UCHAR_MAX + 1) + +@@ -70,9 +77,10 @@ + call the regexp matcher at all. */ + static int kwset_exact_matches; + +-#if defined(MBS_SUPPORT) +-static char* check_multibyte_string PARAMS ((char const *buf, size_t size)); +-#endif ++/* UTF-8 encoding allows some optimizations that we can't otherwise ++ assume in a multibyte encoding. */ ++static int using_utf8; ++ + static void kwsinit PARAMS ((void)); + static void kwsmusts PARAMS ((void)); + static void Gcompile PARAMS ((char const *, size_t)); +@@ -84,6 +92,15 @@ + static size_t Pexecute PARAMS ((char const *, size_t, size_t *, int)); + + void ++check_utf8 (void) ++{ ++#ifdef HAVE_LANGINFO_CODESET ++ if (strcmp (nl_langinfo (CODESET), "UTF-8") == 0) ++ using_utf8 = 1; ++#endif ++} ++ ++void + dfaerror (char const *mesg) + { + error (2, 0, mesg); +@@ -141,38 +158,6 @@ + } + } + +-#ifdef MBS_SUPPORT +-/* This function allocate the array which correspond to "buf". +- Then this check multibyte string and mark on the positions which +- are not singlebyte character nor the first byte of a multibyte +- character. Caller must free the array. */ +-static char* +-check_multibyte_string(char const *buf, size_t size) +-{ +- char *mb_properties = malloc(size); +- mbstate_t cur_state; +- int i; +- memset(&cur_state, 0, sizeof(mbstate_t)); +- memset(mb_properties, 0, sizeof(char)*size); +- for (i = 0; i < size ;) +- { +- size_t mbclen; +- mbclen = mbrlen(buf + i, size - i, &cur_state); +- +- if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0) +- { +- /* An invalid sequence, or a truncated multibyte character. +- We treat it as a singlebyte character. */ +- mbclen = 1; +- } +- mb_properties[i] = mbclen; +- i += mbclen; +- } +- +- return mb_properties; +-} +-#endif +- + static void + Gcompile (char const *pattern, size_t size) + { +@@ -181,7 +166,8 @@ + size_t total = size; + char const *motif = pattern; + +- re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE); ++ check_utf8 (); ++ re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE | (match_icase ? RE_ICASE : 0)); + dfasyntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE, match_icase, eolbyte); + + /* For GNU regex compiler we have to pass the patterns separately to detect +@@ -233,7 +219,7 @@ + static char const line_end[] = "\\)$"; + static char const word_beg[] = "\\(^\\|[^[:alnum:]_]\\)\\("; + static char const word_end[] = "\\)\\([^[:alnum:]_]\\|$\\)"; +- char *n = malloc (sizeof word_beg - 1 + size + sizeof word_end); ++ char *n = xmalloc (sizeof word_beg - 1 + size + sizeof word_end); + size_t i; + strcpy (n, match_lines ? line_beg : word_beg); + i = strlen (n); +@@ -257,14 +243,15 @@ + size_t total = size; + char const *motif = pattern; + ++ check_utf8 (); + if (strcmp (matcher, "awk") == 0) + { +- re_set_syntax (RE_SYNTAX_AWK); ++ re_set_syntax (RE_SYNTAX_AWK | (match_icase ? RE_ICASE : 0)); + dfasyntax (RE_SYNTAX_AWK, match_icase, eolbyte); + } + else + { +- re_set_syntax (RE_SYNTAX_POSIX_EGREP); ++ re_set_syntax (RE_SYNTAX_POSIX_EGREP | (match_icase ? RE_ICASE : 0)); + dfasyntax (RE_SYNTAX_POSIX_EGREP, match_icase, eolbyte); + } + +@@ -316,7 +303,7 @@ + static char const line_end[] = ")$"; + static char const word_beg[] = "(^|[^[:alnum:]_])("; + static char const word_end[] = ")([^[:alnum:]_]|$)"; +- char *n = malloc (sizeof word_beg - 1 + size + sizeof word_end); ++ char *n = xmalloc (sizeof word_beg - 1 + size + sizeof word_end); + size_t i; + strcpy (n, match_lines ? line_beg : word_beg); + i = strlen(n); +@@ -339,15 +326,35 @@ + char eol = eolbyte; + int backref, start, len; + struct kwsmatch kwsm; +- size_t i; ++ size_t i, ret_val; ++ static int use_dfa; ++ static int use_dfa_checked = 0; + #ifdef MBS_SUPPORT +- char *mb_properties = NULL; ++ const char *last_char = NULL; ++ int mb_cur_max = MB_CUR_MAX; ++ mbstate_t mbs; ++ memset (&mbs, '\0', sizeof (mbstate_t)); + #endif /* MBS_SUPPORT */ + ++ if (!use_dfa_checked) ++ { ++ char *grep_use_dfa = getenv ("GREP_USE_DFA"); ++ if (!grep_use_dfa) ++ { + #ifdef MBS_SUPPORT +- if (MB_CUR_MAX > 1 && kwset) +- mb_properties = check_multibyte_string(buf, size); ++ /* Turn off DFA when processing multibyte input. */ ++ use_dfa = (MB_CUR_MAX == 1); ++#else ++ use_dfa = 1; + #endif /* MBS_SUPPORT */ ++ } ++ else ++ { ++ use_dfa = atoi (grep_use_dfa); ++ } ++ ++ use_dfa_checked = 1; ++ } + + buflim = buf + size; + +@@ -358,47 +365,124 @@ + if (kwset) + { + /* Find a possible match using the KWset matcher. */ +- size_t offset = kwsexec (kwset, beg, buflim - beg, &kwsm); ++#ifdef MBS_SUPPORT ++ size_t bytes_left = 0; ++#endif /* MBS_SUPPORT */ ++ size_t offset; ++#ifdef MBS_SUPPORT ++ /* kwsexec doesn't work with match_icase and multibyte input. */ ++ if (match_icase && mb_cur_max > 1) ++ /* Avoid kwset */ ++ offset = 0; ++ else ++#endif /* MBS_SUPPORT */ ++ offset = kwsexec (kwset, beg, buflim - beg, &kwsm); + if (offset == (size_t) -1) +- { ++ goto failure; + #ifdef MBS_SUPPORT +- if (MB_CUR_MAX > 1) +- free(mb_properties); +-#endif +- return (size_t)-1; ++ if (mb_cur_max > 1 && !using_utf8) ++ { ++ bytes_left = offset; ++ while (bytes_left) ++ { ++ size_t mlen = mbrlen (beg, bytes_left, &mbs); ++ ++ last_char = beg; ++ if (mlen == (size_t) -1 || mlen == 0) ++ { ++ /* Incomplete character: treat as single-byte. */ ++ memset (&mbs, '\0', sizeof (mbstate_t)); ++ beg++; ++ bytes_left--; ++ continue; ++ } ++ ++ if (mlen == (size_t) -2) ++ /* Offset points inside multibyte character: ++ * no good. */ ++ break; ++ ++ beg += mlen; ++ bytes_left -= mlen; ++ } + } ++ else ++#endif /* MBS_SUPPORT */ + beg += offset; + /* Narrow down to the line containing the candidate, and + run it through DFA. */ + end = memchr(beg, eol, buflim - beg); + end++; + #ifdef MBS_SUPPORT +- if (MB_CUR_MAX > 1 && mb_properties[beg - buf] == 0) ++ if (mb_cur_max > 1 && bytes_left) + continue; +-#endif ++#endif /* MBS_SUPPORT */ + while (beg > buf && beg[-1] != eol) + --beg; +- if (kwsm.index < kwset_exact_matches) +- goto success; +- if (dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1) ++ if ( ++#ifdef MBS_SUPPORT ++ !(match_icase && mb_cur_max > 1) && ++#endif /* MBS_SUPPORT */ ++ (kwsm.index < kwset_exact_matches)) ++ goto success_in_beg_and_end; ++ if (use_dfa && ++ dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1) + continue; + } + else + { + /* No good fixed strings; start with DFA. */ +- size_t offset = dfaexec (&dfa, beg, buflim - beg, &backref); ++#ifdef MBS_SUPPORT ++ size_t bytes_left = 0; ++#endif /* MBS_SUPPORT */ ++ size_t offset = 0; ++ if (use_dfa) ++ offset = dfaexec (&dfa, beg, buflim - beg, &backref); + if (offset == (size_t) -1) + break; + /* Narrow down to the line we've found. */ ++#ifdef MBS_SUPPORT ++ if (mb_cur_max > 1 && !using_utf8) ++ { ++ bytes_left = offset; ++ while (bytes_left) ++ { ++ size_t mlen = mbrlen (beg, bytes_left, &mbs); ++ ++ last_char = beg; ++ if (mlen == (size_t) -1 || mlen == 0) ++ { ++ /* Incomplete character: treat as single-byte. */ ++ memset (&mbs, '\0', sizeof (mbstate_t)); ++ beg++; ++ bytes_left--; ++ continue; ++ } ++ ++ if (mlen == (size_t) -2) ++ /* Offset points inside multibyte character: ++ * no good. */ ++ break; ++ ++ beg += mlen; ++ bytes_left -= mlen; ++ } ++ } ++ else ++#endif /* MBS_SUPPORT */ + beg += offset; + end = memchr (beg, eol, buflim - beg); + end++; ++#ifdef MBS_SUPPORT ++ if (mb_cur_max > 1 && bytes_left) ++ continue; ++#endif /* MBS_SUPPORT */ + while (beg > buf && beg[-1] != eol) + --beg; + } + /* Successful, no backreferences encountered! */ +- if (!backref) +- goto success; ++ if (use_dfa && !backref) ++ goto success_in_beg_and_end; + } + else + end = beg + size; +@@ -413,14 +497,11 @@ + end - beg - 1, &(patterns[i].regs)))) + { + len = patterns[i].regs.end[0] - start; +- if (exact) +- { +- *match_size = len; +- return start; +- } ++ if (exact && !match_words) ++ goto success_in_start_and_len; + if ((!match_lines && !match_words) + || (match_lines && len == end - beg - 1)) +- goto success; ++ goto success_in_beg_and_end; + /* If -w, check if the match aligns with word boundaries. + We do this iteratively because: + (a) the line may contain more than one occurence of the +@@ -431,10 +512,84 @@ + if (match_words) + while (start >= 0) + { +- if ((start == 0 || !WCHAR ((unsigned char) beg[start - 1])) +- && (len == end - beg - 1 +- || !WCHAR ((unsigned char) beg[start + len]))) +- goto success; ++ int lword_match = 0; ++ if (start == 0) ++ lword_match = 1; ++ else ++ { ++ assert (start > 0); ++#ifdef MBS_SUPPORT ++ if (mb_cur_max > 1) ++ { ++ const char *s; ++ int mr; ++ wchar_t pwc; ++ ++ if (using_utf8) ++ { ++ s = beg + start - 1; ++ while (s > buf ++ && (unsigned char) *s >= 0x80 ++ && (unsigned char) *s <= 0xbf) ++ --s; ++ } ++ else ++ s = last_char; ++ mr = mbtowc (&pwc, s, beg + start - s); ++ if (mr <= 0) ++ { ++ memset (&mbs, '\0', sizeof (mbstate_t)); ++ lword_match = 1; ++ } ++ else if (!(iswalnum (pwc) || pwc == L'_') ++ && mr == (int) (beg + start - s)) ++ lword_match = 1; ++ } ++ else ++#endif /* MBS_SUPPORT */ ++ if (!WCHAR ((unsigned char) beg[start - 1])) ++ lword_match = 1; ++ } ++ ++ if (lword_match) ++ { ++ int rword_match = 0; ++ if (start + len == end - beg - 1) ++ rword_match = 1; ++ else ++ { ++#ifdef MBS_SUPPORT ++ if (mb_cur_max > 1) ++ { ++ wchar_t nwc; ++ int mr; ++ ++ mr = mbtowc (&nwc, beg + start + len, ++ end - beg - start - len - 1); ++ if (mr <= 0) ++ { ++ memset (&mbs, '\0', sizeof (mbstate_t)); ++ rword_match = 1; ++ } ++ else if (!iswalnum (nwc) && nwc != L'_') ++ rword_match = 1; ++ } ++ else ++#endif /* MBS_SUPPORT */ ++ if (!WCHAR ((unsigned char) beg[start + len])) ++ rword_match = 1; ++ } ++ ++ if (rword_match) ++ { ++ if (!exact) ++ /* Returns the whole line. */ ++ goto success_in_beg_and_end; ++ else ++ /* Returns just this word match. */ ++ goto success_in_start_and_len; ++ } ++ } + if (len > 0) + { + /* Try a shorter length anchored at the same place. */ +@@ -461,26 +616,154 @@ + } + } /* for Regex patterns. */ + } /* for (beg = end ..) */ +-#ifdef MBS_SUPPORT +- if (MB_CUR_MAX > 1 && mb_properties) +- free (mb_properties); +-#endif /* MBS_SUPPORT */ ++ ++ failure: + return (size_t) -1; + +- success: +-#ifdef MBS_SUPPORT +- if (MB_CUR_MAX > 1 && mb_properties) +- free (mb_properties); +-#endif /* MBS_SUPPORT */ +- *match_size = end - beg; +- return beg - buf; ++ success_in_beg_and_end: ++ len = end - beg; ++ start = beg - buf; ++ /* FALLTHROUGH */ ++ ++ success_in_start_and_len: ++ *match_size = len; ++ return start; + } + ++#ifdef MBS_SUPPORT ++static int f_i_multibyte; /* whether we're using the new -Fi MB method */ ++static struct ++{ ++ wchar_t **patterns; ++ size_t count, maxlen; ++ unsigned char *match; ++} Fimb; ++#endif ++ + static void + Fcompile (char const *pattern, size_t size) + { ++ int mb_cur_max = MB_CUR_MAX; + char const *beg, *lim, *err; + ++ check_utf8 (); ++#ifdef MBS_SUPPORT ++ /* Support -F -i for UTF-8 input. */ ++ if (match_icase && mb_cur_max > 1) ++ { ++ mbstate_t mbs; ++ wchar_t *wcpattern = xmalloc ((size + 1) * sizeof (wchar_t)); ++ const char *patternend = pattern; ++ size_t wcsize; ++ kwset_t fimb_kwset = NULL; ++ char *starts = NULL; ++ wchar_t *wcbeg, *wclim; ++ size_t allocated = 0; ++ ++ memset (&mbs, '\0', sizeof (mbs)); ++# ifdef __GNU_LIBRARY__ ++ wcsize = mbsnrtowcs (wcpattern, &patternend, size, size, &mbs); ++ if (patternend != pattern + size) ++ wcsize = (size_t) -1; ++# else ++ { ++ char *patterncopy = xmalloc (size + 1); ++ ++ memcpy (patterncopy, pattern, size); ++ patterncopy[size] = '\0'; ++ patternend = patterncopy; ++ wcsize = mbsrtowcs (wcpattern, &patternend, size, &mbs); ++ if (patternend != patterncopy + size) ++ wcsize = (size_t) -1; ++ free (patterncopy); ++ } ++# endif ++ if (wcsize + 2 <= 2) ++ { ++fimb_fail: ++ free (wcpattern); ++ free (starts); ++ if (fimb_kwset) ++ kwsfree (fimb_kwset); ++ free (Fimb.patterns); ++ Fimb.patterns = NULL; ++ } ++ else ++ { ++ if (!(fimb_kwset = kwsalloc (NULL))) ++ error (2, 0, _("memory exhausted")); ++ ++ starts = xmalloc (mb_cur_max * 3); ++ wcbeg = wcpattern; ++ do ++ { ++ int i; ++ size_t wclen; ++ ++ if (Fimb.count >= allocated) ++ { ++ if (allocated == 0) ++ allocated = 128; ++ else ++ allocated *= 2; ++ Fimb.patterns = xrealloc (Fimb.patterns, ++ sizeof (wchar_t *) * allocated); ++ } ++ Fimb.patterns[Fimb.count++] = wcbeg; ++ for (wclim = wcbeg; ++ wclim < wcpattern + wcsize && *wclim != L'\n'; ++wclim) ++ *wclim = towlower (*wclim); ++ *wclim = L'\0'; ++ wclen = wclim - wcbeg; ++ if (wclen > Fimb.maxlen) ++ Fimb.maxlen = wclen; ++ if (wclen > 3) ++ wclen = 3; ++ if (wclen == 0) ++ { ++ if ((err = kwsincr (fimb_kwset, "", 0)) != 0) ++ error (2, 0, err); ++ } ++ else ++ for (i = 0; i < (1 << wclen); i++) ++ { ++ char *p = starts; ++ int j, k; ++ ++ for (j = 0; j < wclen; ++j) ++ { ++ wchar_t wc = wcbeg[j]; ++ if (i & (1 << j)) ++ { ++ wc = towupper (wc); ++ if (wc == wcbeg[j]) ++ continue; ++ } ++ k = wctomb (p, wc); ++ if (k <= 0) ++ goto fimb_fail; ++ p += k; ++ } ++ if ((err = kwsincr (fimb_kwset, starts, p - starts)) != 0) ++ error (2, 0, err); ++ } ++ if (wclim < wcpattern + wcsize) ++ ++wclim; ++ wcbeg = wclim; ++ } ++ while (wcbeg < wcpattern + wcsize); ++ f_i_multibyte = 1; ++ kwset = fimb_kwset; ++ free (starts); ++ Fimb.match = xmalloc (Fimb.count); ++ if ((err = kwsprep (kwset)) != 0) ++ error (2, 0, err); ++ return; ++ } ++ } ++#endif /* MBS_SUPPORT */ ++ ++ + kwsinit (); + beg = pattern; + do +@@ -499,6 +782,76 @@ + error (2, 0, err); + } + ++#ifdef MBS_SUPPORT ++static int ++Fimbexec (const char *buf, size_t size, size_t *plen, int exact) ++{ ++ size_t len, letter, i; ++ int ret = -1; ++ mbstate_t mbs; ++ wchar_t wc; ++ int patterns_left; ++ ++ assert (match_icase && f_i_multibyte == 1); ++ assert (MB_CUR_MAX > 1); ++ ++ memset (&mbs, '\0', sizeof (mbs)); ++ memset (Fimb.match, '\1', Fimb.count); ++ letter = len = 0; ++ patterns_left = 1; ++ while (patterns_left && len <= size) ++ { ++ size_t c; ++ ++ patterns_left = 0; ++ if (len < size) ++ { ++ c = mbrtowc (&wc, buf + len, size - len, &mbs); ++ if (c + 2 <= 2) ++ return ret; ++ ++ wc = towlower (wc); ++ } ++ else ++ { ++ c = 1; ++ wc = L'\0'; ++ } ++ ++ for (i = 0; i < Fimb.count; i++) ++ { ++ if (Fimb.match[i]) ++ { ++ if (Fimb.patterns[i][letter] == L'\0') ++ { ++ /* Found a match. */ ++ *plen = len; ++ if (!exact && !match_words) ++ return 0; ++ else ++ { ++ /* For -w or exact look for longest match. */ ++ ret = 0; ++ Fimb.match[i] = '\0'; ++ continue; ++ } ++ } ++ ++ if (Fimb.patterns[i][letter] == wc) ++ patterns_left = 1; ++ else ++ Fimb.match[i] = '\0'; ++ } ++ } ++ ++ len += c; ++ letter++; ++ } ++ ++ return ret; ++} ++#endif /* MBS_SUPPORT */ ++ + static size_t + Fexecute (char const *buf, size_t size, size_t *match_size, int exact) + { +@@ -506,88 +859,268 @@ + register size_t len; + char eol = eolbyte; + struct kwsmatch kwsmatch; ++ size_t ret_val; + #ifdef MBS_SUPPORT +- char *mb_properties; +- if (MB_CUR_MAX > 1) +- mb_properties = check_multibyte_string (buf, size); ++ int mb_cur_max = MB_CUR_MAX; ++ mbstate_t mbs; ++ memset (&mbs, '\0', sizeof (mbstate_t)); ++ const char *last_char = NULL; + #endif /* MBS_SUPPORT */ + + for (beg = buf; beg <= buf + size; ++beg) + { +- size_t offset = kwsexec (kwset, beg, buf + size - beg, &kwsmatch); ++ size_t offset; ++ offset = kwsexec (kwset, beg, buf + size - beg, &kwsmatch); ++ + if (offset == (size_t) -1) +- { ++ goto failure; + #ifdef MBS_SUPPORT +- if (MB_CUR_MAX > 1) +- free(mb_properties); +-#endif /* MBS_SUPPORT */ +- return offset; ++ if (mb_cur_max > 1 && !using_utf8) ++ { ++ size_t bytes_left = offset; ++ while (bytes_left) ++ { ++ size_t mlen = mbrlen (beg, bytes_left, &mbs); ++ ++ last_char = beg; ++ if (mlen == (size_t) -1 || mlen == 0) ++ { ++ /* Incomplete character: treat as single-byte. */ ++ memset (&mbs, '\0', sizeof (mbstate_t)); ++ beg++; ++ bytes_left--; ++ continue; ++ } ++ ++ if (mlen == (size_t) -2) ++ /* Offset points inside multibyte character: no good. */ ++ break; ++ ++ beg += mlen; ++ bytes_left -= mlen; ++ } ++ ++ if (bytes_left) ++ continue; + } +-#ifdef MBS_SUPPORT +- if (MB_CUR_MAX > 1 && mb_properties[offset+beg-buf] == 0) +- continue; /* It is a part of multibyte character. */ ++ else + #endif /* MBS_SUPPORT */ + beg += offset; +- len = kwsmatch.size[0]; +- if (exact) +- { +- *match_size = len; + #ifdef MBS_SUPPORT +- if (MB_CUR_MAX > 1) +- free (mb_properties); ++ /* For f_i_multibyte, the string at beg now matches first 3 chars of ++ one of the search strings (less if there are shorter search strings). ++ See if this is a real match. */ ++ if (f_i_multibyte ++ && Fimbexec (beg, buf + size - beg, &kwsmatch.size[0], exact)) ++ goto next_char; + #endif /* MBS_SUPPORT */ +- return beg - buf; +- } ++ len = kwsmatch.size[0]; ++ if (exact && !match_words) ++ goto success_in_beg_and_len; + if (match_lines) + { + if (beg > buf && beg[-1] != eol) +- continue; ++ goto next_char; + if (beg + len < buf + size && beg[len] != eol) +- continue; ++ goto next_char; + goto success; + } + else if (match_words) +- for (try = beg; len; ) +- { +- if (try > buf && WCHAR((unsigned char) try[-1])) +- break; +- if (try + len < buf + size && WCHAR((unsigned char) try[len])) +- { +- offset = kwsexec (kwset, beg, --len, &kwsmatch); +- if (offset == (size_t) -1) +- { ++ { ++ while (len) ++ { ++ int word_match = 0; ++ if (beg > buf) ++ { + #ifdef MBS_SUPPORT +- if (MB_CUR_MAX > 1) +- free (mb_properties); ++ if (mb_cur_max > 1) ++ { ++ const char *s; ++ int mr; ++ wchar_t pwc; ++ ++ if (using_utf8) ++ { ++ s = beg - 1; ++ while (s > buf ++ && (unsigned char) *s >= 0x80 ++ && (unsigned char) *s <= 0xbf) ++ --s; ++ } ++ else ++ s = last_char; ++ mr = mbtowc (&pwc, s, beg - s); ++ if (mr <= 0) ++ memset (&mbs, '\0', sizeof (mbstate_t)); ++ else if ((iswalnum (pwc) || pwc == L'_') ++ && mr == (int) (beg - s)) ++ goto next_char; ++ } ++ else + #endif /* MBS_SUPPORT */ +- return offset; +- } +- try = beg + offset; +- len = kwsmatch.size[0]; +- } +- else +- goto success; +- } ++ if (WCHAR ((unsigned char) beg[-1])) ++ goto next_char; ++ } ++#ifdef MBS_SUPPORT ++ if (mb_cur_max > 1) ++ { ++ wchar_t nwc; ++ int mr; ++ ++ mr = mbtowc (&nwc, beg + len, buf + size - beg - len); ++ if (mr <= 0) ++ { ++ memset (&mbs, '\0', sizeof (mbstate_t)); ++ word_match = 1; ++ } ++ else if (!iswalnum (nwc) && nwc != L'_') ++ word_match = 1; ++ } ++ else ++#endif /* MBS_SUPPORT */ ++ if (beg + len >= buf + size || !WCHAR ((unsigned char) beg[len])) ++ word_match = 1; ++ if (word_match) ++ { ++ if (!exact) ++ /* Returns the whole line now we know there's a word match. */ ++ goto success; ++ else ++ /* Returns just this word match. */ ++ goto success_in_beg_and_len; ++ } ++ if (len > 0) ++ { ++ /* Try a shorter length anchored at the same place. */ ++ --len; ++ offset = kwsexec (kwset, beg, len, &kwsmatch); ++ ++ if (offset == -1) ++ goto next_char; /* Try a different anchor. */ ++#ifdef MBS_SUPPORT ++ if (mb_cur_max > 1 && !using_utf8) ++ { ++ size_t bytes_left = offset; ++ while (bytes_left) ++ { ++ size_t mlen = mbrlen (beg, bytes_left, &mbs); ++ ++ last_char = beg; ++ if (mlen == (size_t) -1 || mlen == 0) ++ { ++ /* Incomplete character: treat as single-byte. */ ++ memset (&mbs, '\0', sizeof (mbstate_t)); ++ beg++; ++ bytes_left--; ++ continue; ++ } ++ ++ if (mlen == (size_t) -2) ++ { ++ /* Offset points inside multibyte character: ++ * no good. */ ++ break; ++ } ++ ++ beg += mlen; ++ bytes_left -= mlen; ++ } ++ ++ if (bytes_left) ++ { ++ memset (&mbs, '\0', sizeof (mbstate_t)); ++ goto next_char; /* Try a different anchor. */ ++ } ++ } ++ else ++#endif /* MBS_SUPPORT */ ++ beg += offset; ++#ifdef MBS_SUPPORT ++ /* The string at beg now matches first 3 chars of one of ++ the search strings (less if there are shorter search ++ strings). See if this is a real match. */ ++ if (f_i_multibyte ++ && Fimbexec (beg, len - offset, &kwsmatch.size[0], ++ exact)) ++ goto next_char; ++#endif /* MBS_SUPPORT */ ++ len = kwsmatch.size[0]; ++ } ++ } ++ } + else + goto success; +- } +- ++next_char:; + #ifdef MBS_SUPPORT +- if (MB_CUR_MAX > 1) +- free (mb_properties); ++ /* Advance to next character. For MB_CUR_MAX == 1 case this is handled ++ by ++beg above. */ ++ if (mb_cur_max > 1) ++ { ++ if (using_utf8) ++ { ++ unsigned char c = *beg; ++ if (c >= 0xc2) ++ { ++ if (c < 0xe0) ++ ++beg; ++ else if (c < 0xf0) ++ beg += 2; ++ else if (c < 0xf8) ++ beg += 3; ++ else if (c < 0xfc) ++ beg += 4; ++ else if (c < 0xfe) ++ beg += 5; ++ } ++ } ++ else ++ { ++ size_t l = mbrlen (beg, buf + size - beg, &mbs); ++ ++ last_char = beg; ++ if (l + 2 >= 2) ++ beg += l - 1; ++ else ++ memset (&mbs, '\0', sizeof (mbstate_t)); ++ } ++ } + #endif /* MBS_SUPPORT */ ++ } ++ ++ failure: + return -1; + + success: ++#ifdef MBS_SUPPORT ++ if (mb_cur_max > 1 && !using_utf8) ++ { ++ end = beg + len; ++ while (end < buf + size) ++ { ++ size_t mlen = mbrlen (end, buf + size - end, &mbs); ++ if (mlen == (size_t) -1 || mlen == (size_t) -2 || mlen == 0) ++ { ++ memset (&mbs, '\0', sizeof (mbstate_t)); ++ mlen = 1; ++ } ++ if (mlen == 1 && *end == eol) ++ break; ++ ++ end += mlen; ++ } ++ } ++ else ++#endif /* MBS_SUPPORT */ + end = memchr (beg + len, eol, (buf + size) - (beg + len)); ++ + end++; + while (buf < beg && beg[-1] != eol) + --beg; +- *match_size = end - beg; +-#ifdef MBS_SUPPORT +- if (MB_CUR_MAX > 1) +- free (mb_properties); +-#endif /* MBS_SUPPORT */ ++ len = end - beg; ++ /* FALLTHROUGH */ ++ ++ success_in_beg_and_len: ++ *match_size = len; + return beg - buf; + } + +diff -urN grep-2.5.1a.orig/src/search.c.orig grep-2.5.1a/src/search.c.orig +--- grep-2.5.1a.orig/src/search.c.orig 1970-01-01 05:00:00.000000000 +0500 ++++ grep-2.5.1a/src/search.c.orig 2005-10-23 09:48:39.000000000 +0600 +@@ -0,0 +1,714 @@ ++/* search.c - searching subroutines using dfa, kwset and regex for grep. ++ Copyright 1992, 1998, 2000 Free Software Foundation, Inc. ++ ++ 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. */ ++ ++/* Written August 1992 by Mike Haertel. */ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++#include ++#if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC ++/* We can handle multibyte string. */ ++# define MBS_SUPPORT ++# include ++# include ++#endif ++ ++#include "system.h" ++#include "grep.h" ++#include "regex.h" ++#include "dfa.h" ++#include "kwset.h" ++#include "error.h" ++#include "xalloc.h" ++#ifdef HAVE_LIBPCRE ++# include ++#endif ++ ++#define NCHAR (UCHAR_MAX + 1) ++ ++/* For -w, we also consider _ to be word constituent. */ ++#define WCHAR(C) (ISALNUM(C) || (C) == '_') ++ ++/* DFA compiled regexp. */ ++static struct dfa dfa; ++ ++/* The Regex compiled patterns. */ ++static struct patterns ++{ ++ /* Regex compiled regexp. */ ++ struct re_pattern_buffer regexbuf; ++ struct re_registers regs; /* This is here on account of a BRAIN-DEAD ++ Q@#%!# library interface in regex.c. */ ++} patterns0; ++ ++struct patterns *patterns; ++size_t pcount; ++ ++/* KWset compiled pattern. For Ecompile and Gcompile, we compile ++ a list of strings, at least one of which is known to occur in ++ any string matching the regexp. */ ++static kwset_t kwset; ++ ++/* Number of compiled fixed strings known to exactly match the regexp. ++ If kwsexec returns < kwset_exact_matches, then we don't need to ++ call the regexp matcher at all. */ ++static int kwset_exact_matches; ++ ++#if defined(MBS_SUPPORT) ++static char* check_multibyte_string PARAMS ((char const *buf, size_t size)); ++#endif ++static void kwsinit PARAMS ((void)); ++static void kwsmusts PARAMS ((void)); ++static void Gcompile PARAMS ((char const *, size_t)); ++static void Ecompile PARAMS ((char const *, size_t)); ++static size_t EGexecute PARAMS ((char const *, size_t, size_t *, int )); ++static void Fcompile PARAMS ((char const *, size_t)); ++static size_t Fexecute PARAMS ((char const *, size_t, size_t *, int)); ++static void Pcompile PARAMS ((char const *, size_t )); ++static size_t Pexecute PARAMS ((char const *, size_t, size_t *, int)); ++ ++void ++dfaerror (char const *mesg) ++{ ++ error (2, 0, mesg); ++} ++ ++static void ++kwsinit (void) ++{ ++ static char trans[NCHAR]; ++ int i; ++ ++ if (match_icase) ++ for (i = 0; i < NCHAR; ++i) ++ trans[i] = TOLOWER (i); ++ ++ if (!(kwset = kwsalloc (match_icase ? trans : (char *) 0))) ++ error (2, 0, _("memory exhausted")); ++} ++ ++/* If the DFA turns out to have some set of fixed strings one of ++ which must occur in the match, then we build a kwset matcher ++ to find those strings, and thus quickly filter out impossible ++ matches. */ ++static void ++kwsmusts (void) ++{ ++ struct dfamust const *dm; ++ char const *err; ++ ++ if (dfa.musts) ++ { ++ kwsinit (); ++ /* First, we compile in the substrings known to be exact ++ matches. The kwset matcher will return the index ++ of the matching string that it chooses. */ ++ for (dm = dfa.musts; dm; dm = dm->next) ++ { ++ if (!dm->exact) ++ continue; ++ ++kwset_exact_matches; ++ if ((err = kwsincr (kwset, dm->must, strlen (dm->must))) != 0) ++ error (2, 0, err); ++ } ++ /* Now, we compile the substrings that will require ++ the use of the regexp matcher. */ ++ for (dm = dfa.musts; dm; dm = dm->next) ++ { ++ if (dm->exact) ++ continue; ++ if ((err = kwsincr (kwset, dm->must, strlen (dm->must))) != 0) ++ error (2, 0, err); ++ } ++ if ((err = kwsprep (kwset)) != 0) ++ error (2, 0, err); ++ } ++} ++ ++#ifdef MBS_SUPPORT ++/* This function allocate the array which correspond to "buf". ++ Then this check multibyte string and mark on the positions which ++ are not singlebyte character nor the first byte of a multibyte ++ character. Caller must free the array. */ ++static char* ++check_multibyte_string(char const *buf, size_t size) ++{ ++ char *mb_properties = malloc(size); ++ mbstate_t cur_state; ++ int i; ++ memset(&cur_state, 0, sizeof(mbstate_t)); ++ memset(mb_properties, 0, sizeof(char)*size); ++ for (i = 0; i < size ;) ++ { ++ size_t mbclen; ++ mbclen = mbrlen(buf + i, size - i, &cur_state); ++ ++ if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0) ++ { ++ /* An invalid sequence, or a truncated multibyte character. ++ We treat it as a singlebyte character. */ ++ mbclen = 1; ++ } ++ mb_properties[i] = mbclen; ++ i += mbclen; ++ } ++ ++ return mb_properties; ++} ++#endif ++ ++static void ++Gcompile (char const *pattern, size_t size) ++{ ++ const char *err; ++ char const *sep; ++ size_t total = size; ++ char const *motif = pattern; ++ ++ re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE); ++ dfasyntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE, match_icase, eolbyte); ++ ++ /* For GNU regex compiler we have to pass the patterns separately to detect ++ errors like "[\nallo\n]\n". The patterns here are "[", "allo" and "]" ++ GNU regex should have raise a syntax error. The same for backref, where ++ the backref should have been local to each pattern. */ ++ do ++ { ++ size_t len; ++ sep = memchr (motif, '\n', total); ++ if (sep) ++ { ++ len = sep - motif; ++ sep++; ++ total -= (len + 1); ++ } ++ else ++ { ++ len = total; ++ total = 0; ++ } ++ ++ patterns = realloc (patterns, (pcount + 1) * sizeof (*patterns)); ++ if (patterns == NULL) ++ error (2, errno, _("memory exhausted")); ++ ++ patterns[pcount] = patterns0; ++ ++ if ((err = re_compile_pattern (motif, len, ++ &(patterns[pcount].regexbuf))) != 0) ++ error (2, 0, err); ++ pcount++; ++ ++ motif = sep; ++ } while (sep && total != 0); ++ ++ /* In the match_words and match_lines cases, we use a different pattern ++ for the DFA matcher that will quickly throw out cases that won't work. ++ Then if DFA succeeds we do some hairy stuff using the regex matcher ++ to decide whether the match should really count. */ ++ if (match_words || match_lines) ++ { ++ /* In the whole-word case, we use the pattern: ++ \(^\|[^[:alnum:]_]\)\(userpattern\)\([^[:alnum:]_]|$\). ++ In the whole-line case, we use the pattern: ++ ^\(userpattern\)$. */ ++ ++ static char const line_beg[] = "^\\("; ++ static char const line_end[] = "\\)$"; ++ static char const word_beg[] = "\\(^\\|[^[:alnum:]_]\\)\\("; ++ static char const word_end[] = "\\)\\([^[:alnum:]_]\\|$\\)"; ++ char *n = malloc (sizeof word_beg - 1 + size + sizeof word_end); ++ size_t i; ++ strcpy (n, match_lines ? line_beg : word_beg); ++ i = strlen (n); ++ memcpy (n + i, pattern, size); ++ i += size; ++ strcpy (n + i, match_lines ? line_end : word_end); ++ i += strlen (n + i); ++ pattern = n; ++ size = i; ++ } ++ ++ dfacomp (pattern, size, &dfa, 1); ++ kwsmusts (); ++} ++ ++static void ++Ecompile (char const *pattern, size_t size) ++{ ++ const char *err; ++ const char *sep; ++ size_t total = size; ++ char const *motif = pattern; ++ ++ if (strcmp (matcher, "awk") == 0) ++ { ++ re_set_syntax (RE_SYNTAX_AWK); ++ dfasyntax (RE_SYNTAX_AWK, match_icase, eolbyte); ++ } ++ else ++ { ++ re_set_syntax (RE_SYNTAX_POSIX_EGREP); ++ dfasyntax (RE_SYNTAX_POSIX_EGREP, match_icase, eolbyte); ++ } ++ ++ /* For GNU regex compiler we have to pass the patterns separately to detect ++ errors like "[\nallo\n]\n". The patterns here are "[", "allo" and "]" ++ GNU regex should have raise a syntax error. The same for backref, where ++ the backref should have been local to each pattern. */ ++ do ++ { ++ size_t len; ++ sep = memchr (motif, '\n', total); ++ if (sep) ++ { ++ len = sep - motif; ++ sep++; ++ total -= (len + 1); ++ } ++ else ++ { ++ len = total; ++ total = 0; ++ } ++ ++ patterns = realloc (patterns, (pcount + 1) * sizeof (*patterns)); ++ if (patterns == NULL) ++ error (2, errno, _("memory exhausted")); ++ patterns[pcount] = patterns0; ++ ++ if ((err = re_compile_pattern (motif, len, ++ &(patterns[pcount].regexbuf))) != 0) ++ error (2, 0, err); ++ pcount++; ++ ++ motif = sep; ++ } while (sep && total != 0); ++ ++ /* In the match_words and match_lines cases, we use a different pattern ++ for the DFA matcher that will quickly throw out cases that won't work. ++ Then if DFA succeeds we do some hairy stuff using the regex matcher ++ to decide whether the match should really count. */ ++ if (match_words || match_lines) ++ { ++ /* In the whole-word case, we use the pattern: ++ (^|[^[:alnum:]_])(userpattern)([^[:alnum:]_]|$). ++ In the whole-line case, we use the pattern: ++ ^(userpattern)$. */ ++ ++ static char const line_beg[] = "^("; ++ static char const line_end[] = ")$"; ++ static char const word_beg[] = "(^|[^[:alnum:]_])("; ++ static char const word_end[] = ")([^[:alnum:]_]|$)"; ++ char *n = malloc (sizeof word_beg - 1 + size + sizeof word_end); ++ size_t i; ++ strcpy (n, match_lines ? line_beg : word_beg); ++ i = strlen(n); ++ memcpy (n + i, pattern, size); ++ i += size; ++ strcpy (n + i, match_lines ? line_end : word_end); ++ i += strlen (n + i); ++ pattern = n; ++ size = i; ++ } ++ ++ dfacomp (pattern, size, &dfa, 1); ++ kwsmusts (); ++} ++ ++static size_t ++EGexecute (char const *buf, size_t size, size_t *match_size, int exact) ++{ ++ register char const *buflim, *beg, *end; ++ char eol = eolbyte; ++ int backref, start, len; ++ struct kwsmatch kwsm; ++ size_t i; ++#ifdef MBS_SUPPORT ++ char *mb_properties = NULL; ++#endif /* MBS_SUPPORT */ ++ ++#ifdef MBS_SUPPORT ++ if (MB_CUR_MAX > 1 && kwset) ++ mb_properties = check_multibyte_string(buf, size); ++#endif /* MBS_SUPPORT */ ++ ++ buflim = buf + size; ++ ++ for (beg = end = buf; end < buflim; beg = end) ++ { ++ if (!exact) ++ { ++ if (kwset) ++ { ++ /* Find a possible match using the KWset matcher. */ ++ size_t offset = kwsexec (kwset, beg, buflim - beg, &kwsm); ++ if (offset == (size_t) -1) ++ goto failure; ++ beg += offset; ++ /* Narrow down to the line containing the candidate, and ++ run it through DFA. */ ++ end = memchr(beg, eol, buflim - beg); ++ end++; ++#ifdef MBS_SUPPORT ++ if (MB_CUR_MAX > 1 && mb_properties[beg - buf] == 0) ++ continue; ++#endif ++ while (beg > buf && beg[-1] != eol) ++ --beg; ++ if (kwsm.index < kwset_exact_matches) ++ goto success_in_beg_and_end; ++ if (dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1) ++ continue; ++ } ++ else ++ { ++ /* No good fixed strings; start with DFA. */ ++ size_t offset = dfaexec (&dfa, beg, buflim - beg, &backref); ++ if (offset == (size_t) -1) ++ break; ++ /* Narrow down to the line we've found. */ ++ beg += offset; ++ end = memchr (beg, eol, buflim - beg); ++ end++; ++ while (beg > buf && beg[-1] != eol) ++ --beg; ++ } ++ /* Successful, no backreferences encountered! */ ++ if (!backref) ++ goto success_in_beg_and_end; ++ } ++ else ++ end = beg + size; ++ ++ /* If we've made it to this point, this means DFA has seen ++ a probable match, and we need to run it through Regex. */ ++ for (i = 0; i < pcount; i++) ++ { ++ patterns[i].regexbuf.not_eol = 0; ++ if (0 <= (start = re_search (&(patterns[i].regexbuf), beg, ++ end - beg - 1, 0, ++ end - beg - 1, &(patterns[i].regs)))) ++ { ++ len = patterns[i].regs.end[0] - start; ++ if (exact && !match_words) ++ goto success_in_start_and_len; ++ if ((!match_lines && !match_words) ++ || (match_lines && len == end - beg - 1)) ++ goto success_in_beg_and_end; ++ /* If -w, check if the match aligns with word boundaries. ++ We do this iteratively because: ++ (a) the line may contain more than one occurence of the ++ pattern, and ++ (b) Several alternatives in the pattern might be valid at a ++ given point, and we may need to consider a shorter one to ++ find a word boundary. */ ++ if (match_words) ++ while (start >= 0) ++ { ++ if ((start == 0 || !WCHAR ((unsigned char) beg[start - 1])) ++ && (len == end - beg - 1 ++ || !WCHAR ((unsigned char) beg[start + len]))) ++ goto success_in_beg_and_end; ++ if (len > 0) ++ { ++ /* Try a shorter length anchored at the same place. */ ++ --len; ++ patterns[i].regexbuf.not_eol = 1; ++ len = re_match (&(patterns[i].regexbuf), beg, ++ start + len, start, ++ &(patterns[i].regs)); ++ } ++ if (len <= 0) ++ { ++ /* Try looking further on. */ ++ if (start == end - beg - 1) ++ break; ++ ++start; ++ patterns[i].regexbuf.not_eol = 0; ++ start = re_search (&(patterns[i].regexbuf), beg, ++ end - beg - 1, ++ start, end - beg - 1 - start, ++ &(patterns[i].regs)); ++ len = patterns[i].regs.end[0] - start; ++ } ++ } ++ } ++ } /* for Regex patterns. */ ++ } /* for (beg = end ..) */ ++ ++ failure: ++#ifdef MBS_SUPPORT ++ if (MB_CUR_MAX > 1 && mb_properties) ++ free (mb_properties); ++#endif /* MBS_SUPPORT */ ++ return (size_t) -1; ++ ++ success_in_beg_and_end: ++ len = end - beg; ++ start = beg - buf; ++ /* FALLTHROUGH */ ++ ++ success_in_start_and_len: ++#ifdef MBS_SUPPORT ++ if (MB_CUR_MAX > 1 && mb_properties) ++ free (mb_properties); ++#endif /* MBS_SUPPORT */ ++ *match_size = len; ++ return start; ++} ++ ++static void ++Fcompile (char const *pattern, size_t size) ++{ ++ char const *beg, *lim, *err; ++ ++ kwsinit (); ++ beg = pattern; ++ do ++ { ++ for (lim = beg; lim < pattern + size && *lim != '\n'; ++lim) ++ ; ++ if ((err = kwsincr (kwset, beg, lim - beg)) != 0) ++ error (2, 0, err); ++ if (lim < pattern + size) ++ ++lim; ++ beg = lim; ++ } ++ while (beg < pattern + size); ++ ++ if ((err = kwsprep (kwset)) != 0) ++ error (2, 0, err); ++} ++ ++static size_t ++Fexecute (char const *buf, size_t size, size_t *match_size, int exact) ++{ ++ register char const *beg, *try, *end; ++ register size_t len; ++ char eol = eolbyte; ++ struct kwsmatch kwsmatch; ++#ifdef MBS_SUPPORT ++ char *mb_properties; ++ if (MB_CUR_MAX > 1) ++ mb_properties = check_multibyte_string (buf, size); ++#endif /* MBS_SUPPORT */ ++ ++ for (beg = buf; beg <= buf + size; ++beg) ++ { ++ size_t offset = kwsexec (kwset, beg, buf + size - beg, &kwsmatch); ++ if (offset == (size_t) -1) ++ goto failure; ++#ifdef MBS_SUPPORT ++ if (MB_CUR_MAX > 1 && mb_properties[offset+beg-buf] == 0) ++ continue; /* It is a part of multibyte character. */ ++#endif /* MBS_SUPPORT */ ++ beg += offset; ++ len = kwsmatch.size[0]; ++ if (exact && !match_words) ++ goto success_in_beg_and_len; ++ if (match_lines) ++ { ++ if (beg > buf && beg[-1] != eol) ++ continue; ++ if (beg + len < buf + size && beg[len] != eol) ++ continue; ++ goto success; ++ } ++ else if (match_words) ++ for (try = beg; len; ) ++ { ++ if (try > buf && WCHAR((unsigned char) try[-1])) ++ break; ++ if (try + len < buf + size && WCHAR((unsigned char) try[len])) ++ { ++ offset = kwsexec (kwset, beg, --len, &kwsmatch); ++ if (offset == (size_t) -1) ++ { ++#ifdef MBS_SUPPORT ++ if (MB_CUR_MAX > 1) ++ free (mb_properties); ++#endif /* MBS_SUPPORT */ ++ return offset; ++ } ++ try = beg + offset; ++ len = kwsmatch.size[0]; ++ } ++ else ++ goto success; ++ } ++ else ++ goto success; ++ } ++ ++ failure: ++#ifdef MBS_SUPPORT ++ if (MB_CUR_MAX > 1) ++ free (mb_properties); ++#endif /* MBS_SUPPORT */ ++ return -1; ++ ++ success: ++ end = memchr (beg + len, eol, (buf + size) - (beg + len)); ++ end++; ++ while (buf < beg && beg[-1] != eol) ++ --beg; ++ len = end - beg; ++ /* FALLTHROUGH */ ++ ++ success_in_beg_and_len: ++ *match_size = len; ++#ifdef MBS_SUPPORT ++ if (MB_CUR_MAX > 1) ++ free (mb_properties); ++#endif /* MBS_SUPPORT */ ++ return beg - buf; ++} ++ ++#if HAVE_LIBPCRE ++/* Compiled internal form of a Perl regular expression. */ ++static pcre *cre; ++ ++/* Additional information about the pattern. */ ++static pcre_extra *extra; ++#endif ++ ++static void ++Pcompile (char const *pattern, size_t size) ++{ ++#if !HAVE_LIBPCRE ++ error (2, 0, _("The -P option is not supported")); ++#else ++ int e; ++ char const *ep; ++ char *re = xmalloc (4 * size + 7); ++ int flags = PCRE_MULTILINE | (match_icase ? PCRE_CASELESS : 0); ++ char const *patlim = pattern + size; ++ char *n = re; ++ char const *p; ++ char const *pnul; ++ ++ /* FIXME: Remove this restriction. */ ++ if (eolbyte != '\n') ++ error (2, 0, _("The -P and -z options cannot be combined")); ++ ++ *n = '\0'; ++ if (match_lines) ++ strcpy (n, "^("); ++ if (match_words) ++ strcpy (n, "\\b("); ++ n += strlen (n); ++ ++ /* The PCRE interface doesn't allow NUL bytes in the pattern, so ++ replace each NUL byte in the pattern with the four characters ++ "\000", removing a preceding backslash if there are an odd ++ number of backslashes before the NUL. ++ ++ FIXME: This method does not work with some multibyte character ++ encodings, notably Shift-JIS, where a multibyte character can end ++ in a backslash byte. */ ++ for (p = pattern; (pnul = memchr (p, '\0', patlim - p)); p = pnul + 1) ++ { ++ memcpy (n, p, pnul - p); ++ n += pnul - p; ++ for (p = pnul; pattern < p && p[-1] == '\\'; p--) ++ continue; ++ n -= (pnul - p) & 1; ++ strcpy (n, "\\000"); ++ n += 4; ++ } ++ ++ memcpy (n, p, patlim - p); ++ n += patlim - p; ++ *n = '\0'; ++ if (match_words) ++ strcpy (n, ")\\b"); ++ if (match_lines) ++ strcpy (n, ")$"); ++ ++ cre = pcre_compile (re, flags, &ep, &e, pcre_maketables ()); ++ if (!cre) ++ error (2, 0, ep); ++ ++ extra = pcre_study (cre, 0, &ep); ++ if (ep) ++ error (2, 0, ep); ++ ++ free (re); ++#endif ++} ++ ++static size_t ++Pexecute (char const *buf, size_t size, size_t *match_size, int exact) ++{ ++#if !HAVE_LIBPCRE ++ abort (); ++ return -1; ++#else ++ /* This array must have at least two elements; everything after that ++ is just for performance improvement in pcre_exec. */ ++ int sub[300]; ++ ++ int e = pcre_exec (cre, extra, buf, size, 0, 0, ++ sub, sizeof sub / sizeof *sub); ++ ++ if (e <= 0) ++ { ++ switch (e) ++ { ++ case PCRE_ERROR_NOMATCH: ++ return -1; ++ ++ case PCRE_ERROR_NOMEMORY: ++ error (2, 0, _("Memory exhausted")); ++ ++ default: ++ abort (); ++ } ++ } ++ else ++ { ++ /* Narrow down to the line we've found. */ ++ char const *beg = buf + sub[0]; ++ char const *end = buf + sub[1]; ++ char const *buflim = buf + size; ++ char eol = eolbyte; ++ if (!exact) ++ { ++ end = memchr (end, eol, buflim - end); ++ end++; ++ while (buf < beg && beg[-1] != eol) ++ --beg; ++ } ++ ++ *match_size = end - beg; ++ return beg - buf; ++ } ++#endif ++} ++ ++struct matcher const matchers[] = { ++ { "default", Gcompile, EGexecute }, ++ { "grep", Gcompile, EGexecute }, ++ { "egrep", Ecompile, EGexecute }, ++ { "awk", Ecompile, EGexecute }, ++ { "fgrep", Fcompile, Fexecute }, ++ { "perl", Pcompile, Pexecute }, ++ { "", 0, 0 }, ++}; +diff -urN grep-2.5.1a.orig/tests/fmbtest.sh grep-2.5.1a/tests/fmbtest.sh +--- grep-2.5.1a.orig/tests/fmbtest.sh 1970-01-01 05:00:00.000000000 +0500 ++++ grep-2.5.1a/tests/fmbtest.sh 2005-10-23 09:51:12.000000000 +0600 +@@ -0,0 +1,111 @@ ++#!/bin/sh ++ ++: ${srcdir=.} ++ ++# If cs_CZ.UTF-8 locale doesn't work, skip this test silently ++LC_ALL=cs_CZ.UTF-8 locale -k LC_CTYPE 2>/dev/null | ${GREP} -q charmap.*UTF-8 \ ++ || exit 77 ++ ++failures=0 ++ ++cat > csinput < cspatfile <) ++ grodvi ... DVIÍѥݥ¹¥È¥×¥í¥»¥Ã¥µ (NTT JTeX or ASCIIÆüËܸìTeX) ++ gxditview ... X¥¦¥£¥ó¥É¥¦Íѥݥ¹¥È¥×¥í¥»¥Ã¥µ ++ gtbl ... tbl¥Þ¥¯¥íÍÑ¥×¥ê¥×¥í¥»¥Ã¥µ ++ gpic ... pic¥Þ¥¯¥íÍÑ¥×¥ê¥×¥í¥»¥Ã¥µ ++ geqn ... eqn¥Þ¥¯¥íÍÑ¥×¥ê¥×¥í¥»¥Ã¥µ ++ xtotroff ... X¤Î¥Õ¥©¥ó¥È¤«¤égroffÍÑ¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹ ++ ¤ë¥Ä¡¼¥ë ++ ++¡ô lj4¥Ý¥¹¥È¥×¥í¥»¥Ã¥µ¡¢bib´ØÏ¢¤Î¥³¥Þ¥ó¥É¤ÏÆüËܸì̤Âбþ¤Ç¤¹¡£ ++ ++ ++¡ý ¥¤¥ó¥¹¥È¡¼¥ë ++ ++ °Ê²¼¤Î´Ä¶­¤Çmake½ÐÍè¤ë¤³¤È¤ò³Îǧ¤·¤Æ¤¤¤Þ¤¹¡£ ++ ++ ¡ù FreeBSD 2.1.0-RELEASE ++ XFree86-3.1.2, gcc 2.6.3 ++ ++ ¡ù Debian GNU/Linux 2.2 ++ ++ ¡ù NEC EWS/4800/310 ++ SVR4.2 Release9.1 Rev.B, X11R5, gcc 2.6.0 ++ ++ (1) ¥ª¥ê¥¸¥Ê¥ë¤ÈƱÍÍconfigure¤ò¼Â¹Ô¤·¤¿¸å¡¢make & install¤·¤Æ²¼¤µ¤¤¡£ ++ ¾Ü¤·¤¯¤ÏINSTALL¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ ++ ++ *) grodvi¤ÏNTT JTeX·Á¼°¤Þ¤¿¤ÏASCIIÆüËܸìTeX·Á¼°¤ÎDVI¥Õ¥¡¥¤¥ë¤ò¥µ¥Ý¡¼ ++ ¥È¤·¤Æ¤¤¤Þ¤¹¡£groff¤¬½ÐÎϤ¹¤ëDVI¥Õ¥¡¥¤¥ë¤òASCIIÆüËܸìTeX·Á¼°¤Ë ++ ¤·¤¿¤¤¾ì¹ç¤Ïconfigure --JTeX=ASCII¤È¤·¤Æ¤¯¤À¤µ¤¤¡£ ++ --JTeX¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤ÏNTT JTeX·Á¼°¤Ë¤Ê¤ê¤Þ¤¹¡£ ++ ++ (2) groff¤Îmake¤Î¸å¡¢gxditview(groff¤ÎX¥¦¥£¥ó¥É¥¦Íѥݥ¹¥È¥×¥í¥»¥Ã¥µ) ++ ¤òmake¤·¤Þ¤¹¡£¥È¥Ã¥×¥Ç¥£¥ì¥¯¥È¥êľ²¼¤Îxditview¤Øcd¤·¤Æ¡¢ ++ ++ % xmkmf ++ % make depend ++ % make all ++ % make install install.man ++ ++ ¤Ç¡¢¥¤¥ó¥¹¥È¡¼¥ë´°Î»¤Ç¤¹¡£ ++ ++ ++¡ý »È¤¤Êý ++ ++ groff¤Î-T¥ª¥×¥·¥ç¥ó¤Ë-Tnippon(üËöɽ¼¨)¤òÄɲä·¤¿°Ê³°¤Ï¥ª¥ê¥¸¥Ê¥ë¤Î¤Þ ++¤Þ¤Ç¤¹¡£ ++°Ê²¼¤Ï»ÈÍÑÎã¡£ ++ ++ (£±) groff -Tnippon -man groff.jman ++ ++ ÆüËܸì¤ò´Þ¤àroff¥Õ¥¡¥¤¥ë(groff.jman)¤òman¥Þ¥¯¥í¤ò»È¤Ã¤Æ¥Õ¥©¡¼¥Þ¥Ã¥È¤·¡¢ ++üËö¤Ëɽ¼¨¤·¤Þ¤¹¡£ ++ ++ (£²) groff -Tps -man groff.jman ++ ++ ÆüËܸì¤ò´Þ¤àroff¥Õ¥¡¥¤¥ë¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤·¡¢PostScript¤ËÊÑ´¹¤·¤Þ¤¹¡£ ++ ++ (£³) groff -TX100 -man groff.jman ++ ++ ÆüËܸì¤ò´Þ¤àroff¥Õ¥¡¥¤¥ë¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤·¡¢X¥¦¥£¥ó¥É¥¦¤Ëɽ¼¨¤·¤Þ¤¹¡£ ++ ++ (£´) groff -Tdvi -man groff.jman ++ ++ ÆüËܸì¤ò´Þ¤àroff¥Õ¥¡¥¤¥ë¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤·¡¢DVI¥Õ¥¡¥¤¥ë¤ò½ÐÎϤ·¤Þ¤¹¡£ ++ ++ ++¡ý ÆüËܸ첽¤Ë¤Ä¤¤¤Æ ++ ++¡¦ ÆüËܸìʸ»ú¥³¡¼¥É¤ÏÆüËܸìEUC(¤Î¥³¡¼¥É¥»¥Ã¥È1)¤Î¤ß¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤¹¡£ ++ ++¡¦ ÆüËܸì¥Õ¥©¥ó¥È¤Ë¤Ä¤¤¤Æ¤Ï¡¢¥«¥ì¥ó¥È¥Õ¥©¥ó¥È¤¬¥Ü¡¼¥ë¥ÉÂΤλþ¤Ï¥´¥·¥Ã ++ ¥¯ÂΤˡ¢¤½¤ì°Ê³°¤Î¥Õ¥©¥ó¥È(¥í¡¼¥Þ¥ó¡¢¥¤¥¿¥ê¥Ã¥¯¡¢¥¤¥¿¥ê¥Ã¥¯¥Ü¡¼¥ë¥É ++ Åù)¤¬¥«¥ì¥ó¥È¥Õ¥©¥ó¥È¤Î»þ¤ÏÌÀÄ«ÂΤˡ¢¼«Æ°Åª¤ËÀÚ¤êÂØ¤ï¤ê¤Þ¤¹¡£ÆüËܸì ++ ¥Õ¥©¥ó¥È¤òľÀÜ»ØÄꤹ¤ë¤³¤È¤Ï½ÐÍè¤Þ¤»¤ó¡£ ++ ++ (Ãí) ¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë̾¤¬'B'¤Ç½ª¤Ã¤Æ¤¤¤ë¥Õ¥©¥ó¥È(B¡¢TB¡¢HNB¤Ê¤É)¤ò ++ ¥Ü¡¼¥ë¥É¥Õ¥©¥ó¥È¤È¤·¤Æ¤¤¤Þ¤¹¡£ ++ ++¡¦ ¹ÔƬ¡¢¤ª¤è¤Ó¹ÔËö¶ØÂ§¤ËÂбþ¤·¤Æ¤¤¤Þ¤¹¡£¤½¤ì¤¾¤ì¤Î¶ØÂ§Ê¸»ú¤Ï¡¢ ++ ++ ¹ÔƬ¶ØÂ§Ê¸»ú: ¡¢ ¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡Ë¡Í¡Ï¡Ñ¡×¡Ù¡Û ++ ¤¡¤£¤¥¤§¤©¤Ã¤ã¤å¤ç¥¡¥£¥¥¥§¥©¥Ã¥ã¥å¥ç ++ . ? ! " ' ) ] * , : ; > } ++ ¹ÔËö¶ØÂ§Ê¸»ú: ¡Ê ¡Ì¡Î¡Ð¡Ö¡Ø¡Ú ++ ++ ¤òÄêµÁ¤·¤Æ¤¤¤Þ¤¹¡£ ++ ++¡¦ -Tps¤ò»ØÄꤷ¤¿¾ì¹ç¡¢EUCʸ»ú¤ÈASCIIʸ»ú¤Î´Ö¤Ë¤Ï¡¢Éý¤Î¶¹¤¤¶õÇò¤¬¼«Æ° ++ Ū¤ËÁÞÆþ¤µ¤ì¤Þ¤¹¡£¤³¤Î¶õÇò¤ÎÉý¤Ïdevps/DESC¤Îwcharkern¤Ç»ØÄꤷ¤Þ¤¹¡£ ++ unitñ°Ì¤Ç¤¹¡£0¤ò»ØÄꤹ¤ë¤È¶õÇò¤ÏÁÞÆþ¤µ¤ì¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£ ++ ++¡¦ -Tps¤ò»ØÄꤷ¤¿¾ì¹ç¡¢EUCʸ»ú¤ÏASCIIʸ»ú¤ËÂФ·¤Æ¾¯¤·²¼¤²¤Æ½ÐÎϤµ¤ì¤Þ ++ ¤¹(¤½¤Î¤Þ¤Þ¤À¤ÈASCIIʸ»ú¤¬Íî¤Á¹þ¤ó¤Ç¸«¤¨¤ë¤¿¤á)¡£¤³¤Î²¼¤²Éý¤Ï ++ devps/DESC¤Îlowerwchar¤Ç»ØÄꤷ¤Þ¤¹¡£unitñ°Ì¤Ç¤¹¡£0¤ò»ØÄꤹ¤ë¤È»ú²¼ ++ ¤²¤Ï¹Ô¤Ê¤ï¤ì¤Þ¤»¤ó¡£ ++ ++¡¦ ¥ª¥ê¥¸¥Ê¥ë¤Ç¤Ï²þ¹Ô¥³¡¼¥É¤Ï̵¾ò·ï¤Ë¥¹¥Ú¡¼¥¹Ê¸»ú¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¤¬¡¢EUC ++ ʸ»ú¤Ç°Ï¤Þ¤ì¤¿²þ¹Ô¥³¡¼¥É¤Ï¥¹¥Ú¡¼¥¹¤ËÊÑ´¹¤»¤ºÌµ»ë¤¹¤ë¤è¤¦¤Ë¤·¤Þ¤·¤¿¡£ ++ ++¡¦ EUC¤Î¥¹¥Ú¡¼¥¹Ê¸»ú(0xa1a1)¤ÏASCII¤Î¥¹¥Ú¡¼¥¹Ê¸»ú¤È¤·¤Æ½èÍý¤µ¤ì¤Þ¤¹¡£ ++ ++ ++¡ý ¼Õ¼­ ++ ++grodvi¤ÎASCIIÆüËܸìTeXÂбþ¤Ï¡¢±§ÅÔµÜÂç³Ø¤Î²£ÅĤµ¤ó¤¬¹Ô¤Ê¤Ã¤Æ¤¯¤À¤µ¤¤¤Þ ++¤·¤¿¡£grohtml¤ÎÆüËܸì(EUC)Âбþ¤Ï¡¢²Ö¿ó¿®ºÈ¤µ¤ó¤¬¹Ô¤Ã¤Æ¤¯¤ì¤Þ¤·¤¿¡£ ++¤Þ¤¿¡¢Â¿¤¯¤ÎÊý¤«¤é¥Ð¥°¤Ë´Ø¤¹¤ëÊó¹ð¡¢½¤Àµ¥¤¥á¡¼¥¸¤òÁ÷¤Ã¤ÆÄº¤­¤Þ¤·¤¿¡£ ++¸æ¶¨ÎϤ¯¤À¤µ¤Ã¤¿³§ÍͤˤϤȤƤⴶ¼Õ¤·¤Æ¤ª¤ê¤Þ¤¹¡£Í­Æñ¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£ ++ ++ ++¡ý ¤ª´ê¤¤ ++ ++¸½¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ïlj4¥Ý¥¹¥È¥×¥í¥»¥Ã¥µ¡¢bib´ØÏ¢¤Î¥³¥Þ¥ó¥É·²¤¬ÆüËܸ첽¤µ¤ì ++¤Æ¤ª¤ê¤Þ¤»¤ó¡£¤³¤ì¤é¤ÎÆüËܸ첽¤ò¹Ô¤Ã¤Æ¤¯¤À¤µ¤ëÊý¤òÊ罸Ãפ·¤Æ¤ª¤ê¤Þ¤¹¡£ ++¤¼¤Ò¸æ¶¨ÎϤ¯¤À¤µ¤¤¡£¤Þ¤¿¡¢ÆüËܸìÂбþgroff¤Ë´Ø¤·¤Æ¸æ°Õ¸«¡¢¸æ´õ˾Åù¤ò ++À§Èó¤ªÊ¹¤«¤»¤¯¤À¤µ¤¤¡£º£¸å¤Î»²¹Í¤Ë¤µ¤»¤ÆÄº¤­¤Þ¤¹(¤â¤Á¤í¤ó¥Ð¥°Êó¹ð¤â ++´¿·Þ¤Ç¤¹¡ª)¡£ ++°Ê¾å¤ÏE-Mail¤Ë¤Æ¡¢tm-kita@kh.rim.or.jp°¸¤Ë¤ªÁ÷¤ê¤¯¤À¤µ¤¤¡£ +--- groff-1.18.1.1.orig/src/include/config.hin ++++ groff-1.18.1.1/src/include/config.hin +@@ -1,84 +1,96 @@ +-/* src/include/config.hin. Generated automatically from configure.ac by autoheader. */ ++/* src/include/config.hin. Generated from configure.ac by autoheader. */ + + /* Define if your C++ doesn't understand `delete []'. */ + #undef ARRAY_DELETE_NEEDS_SIZE + ++/* Define if you want to use multibyte extension. */ ++#undef ENABLE_MULTIBYTE ++ + /* Define if you have a C++ . */ + #undef HAVE_CC_LIMITS_H + + /* Define if you have a C++ . */ + #undef HAVE_CC_OSFCN_H + +-/* Define if you have the header file. */ ++/* Define to 1 if you have the header file. */ + #undef HAVE_DIRENT_H + +-/* Define if you have the `fmod' function. */ ++/* Define to 1 if you have the `fmod' function. */ + #undef HAVE_FMOD + +-/* Define if you have the `getcwd' function. */ ++/* Define to 1 if you have the `getcwd' function. */ + #undef HAVE_GETCWD + +-/* Define if you have the `getpagesize' function. */ ++/* Define to 1 if you have the `getpagesize' function. */ + #undef HAVE_GETPAGESIZE + +-/* Define if you have the `gettimeofday' function. */ ++/* Define to 1 if you have the `gettimeofday' function. */ + #undef HAVE_GETTIMEOFDAY + +-/* Define if you have the header file. */ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_INTTYPES_H ++ ++/* Define to 1 if you have the `isatty' function. */ ++#undef HAVE_ISATTY ++ ++/* Define if you have and nl_langinfo(CODESET). */ ++#undef HAVE_LANGINFO_CODESET ++ ++/* Define to 1 if you have the header file. */ + #undef HAVE_LIMITS_H + +-/* Define if you have the header file. */ ++/* Define to 1 if you have the header file. */ + #undef HAVE_MATH_H + ++/* Define to 1 if you have the header file. */ ++#undef HAVE_MEMORY_H ++ + /* Define if you have mkstemp(). */ + #undef HAVE_MKSTEMP + +-/* Define if you have a working `mmap' system call. */ ++/* Define to 1 if you have a working `mmap' system call. */ + #undef HAVE_MMAP + +-/* Define if you have the `putenv' function. */ ++/* Define to 1 if you have the `putenv' function. */ + #undef HAVE_PUTENV + +-/* Define if you have the `rename' function. */ ++/* Define to 1 if you have the `rename' function. */ + #undef HAVE_RENAME + +-/* Define if you have the `snprintf' function. */ ++/* Define to 1 if you have the `snprintf' function. */ + #undef HAVE_SNPRINTF + +-/* Define if you have the `isatty' function. */ +-#undef HAVE_ISATTY +- +-/* Define if you have the header file. */ ++/* Define to 1 if you have the header file. */ + #undef HAVE_STDINT_H + +-/* Define if you have the header file. */ ++/* Define to 1 if you have the header file. */ + #undef HAVE_STDLIB_H + +-/* Define if you have the `strcasecmp' function. */ ++/* Define to 1 if you have the `strcasecmp' function. */ + #undef HAVE_STRCASECMP + +-/* Define if you have the `strerror' function. */ ++/* Define to 1 if you have the `strerror' function. */ + #undef HAVE_STRERROR + +-/* Define if you have the header file. */ ++/* Define to 1 if you have the header file. */ + #undef HAVE_STRINGS_H + +-/* Define if you have the header file. */ ++/* Define to 1 if you have the header file. */ + #undef HAVE_STRING_H + +-/* Define if you have the `strncasecmp' function. */ ++/* Define to 1 if you have the `strncasecmp' function. */ + #undef HAVE_STRNCASECMP + +-/* Define if you have the `strsep' function. */ ++/* Define to 1 if you have the `strsep' function. */ + #undef HAVE_STRSEP + +-/* Define if you have the `strtol' function. */ ++/* Define to 1 if you have the `strtol' function. */ + #undef HAVE_STRTOL + + /* Define if defines struct exception. */ + #undef HAVE_STRUCT_EXCEPTION + +-/* Define if you have the header file. */ ++/* Define to 1 if you have the header file. */ + #undef HAVE_SYS_DIR_H + + /* Define if you have sys_errlist in or in . */ +@@ -87,10 +99,16 @@ + /* Define if you have sysnerr in or . */ + #undef HAVE_SYS_NERR + +-/* Define if you have the header file. */ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_STAT_H ++ ++/* Define to 1 if you have the header file. */ + #undef HAVE_SYS_TIME_H + +-/* Define if you have the header file. */ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_TYPES_H ++ ++/* Define to 1 if you have the header file. */ + #undef HAVE_UNISTD_H + + /* Define if the host's encoding is EBCDIC. */ +@@ -120,6 +138,21 @@ + /* Define if your C++ doesn't declare strncasecmp(). */ + #undef NEED_DECLARATION_STRNCASECMP + ++/* Define to the address where bug reports for this package should be sent. */ ++#undef PACKAGE_BUGREPORT ++ ++/* Define to the full name of this package. */ ++#undef PACKAGE_NAME ++ ++/* Define to the full name and version of this package. */ ++#undef PACKAGE_STRING ++ ++/* Define to the one symbol short name of this package. */ ++#undef PACKAGE_TARNAME ++ ++/* Define to the version of this package. */ ++#undef PACKAGE_VERSION ++ + /* Define if the printer's page size is A4. */ + #undef PAGEA4 + +@@ -129,7 +162,10 @@ + /* Define if srand() returns void not int. */ + #undef RET_TYPE_SRAND_IS_VOID + +-/* Define if `sys_siglist' is declared by or . */ ++/* Define to 1 if you have the ANSI C header files. */ ++#undef STDC_HEADERS ++ ++/* Define to 1 if `sys_siglist' is declared by or . */ + #undef SYS_SIGLIST_DECLARED + + /* Define if your C++ compiler uses a traditional (Reiser) preprocessor. */ +--- groff-1.18.1.1.orig/src/include/encoding.h ++++ groff-1.18.1.1/src/include/encoding.h +@@ -0,0 +1,175 @@ ++// -*- C++ -*- ++/* Copyright (c) 2001 Fumitoshi UKAI ++ ++This file is part of groff. ++ ++groff 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. ++ ++groff 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 */ ++ ++#ifndef ENCODING_H ++#define ENCODING_H ++ ++#include ++ ++#ifdef ENABLE_MULTIBYTE ++typedef int wchar; // negative is used for charcode & index ++#else ++typedef char wchar; ++#endif ++ ++#include ++ ++#ifdef __cplusplus ++class encoding_istream { ++public: ++ encoding_istream() {}; ++ virtual ~encoding_istream() {}; ++ virtual int getbyte() = 0; ++ virtual int peekbyte() = 0; ++ virtual void ungetbyte(int ch) = 0; ++}; ++ ++class encoding_istream_str: public encoding_istream { ++private: ++ const unsigned char *s; ++ int *i; ++ encoding_istream_str() {}; ++public: ++ encoding_istream_str(const unsigned char *s0, int *i0) : s(s0), i(i0) {}; ++ ~encoding_istream_str() {}; ++ inline int getbyte() { return s[(*i)++]; }; ++ inline int peekbyte() { return s[(*i)]; }; ++ inline void ungetbyte(int ch) { --(*i); }; ++}; ++ ++class encoding_istream_fp: public encoding_istream { ++private: ++ FILE *fp; ++public: ++ encoding_istream_fp(FILE *fp0) : fp(fp0) {}; ++ ~encoding_istream_fp() {}; ++ inline int getbyte() { return fgetc(fp); }; ++ inline int peekbyte() { int ch = fgetc(fp); ungetc(ch, fp); return ch; }; ++ inline void ungetbyte(int ch) { ungetc(ch, fp); }; ++}; ++ ++class encoding_ostream { ++public: ++ encoding_ostream() {}; ++ virtual ~encoding_ostream() {}; ++ virtual void putbyte(unsigned char ch) = 0; ++}; ++ ++class encoding_ostream_str: public encoding_ostream { ++private: ++ unsigned char *s; ++ int *i; ++ int len; ++ encoding_ostream_str() {}; ++public: ++ encoding_ostream_str(unsigned char *s0, int *i0, int max) : s(s0), i(i0), len(max) {}; ++ ~encoding_ostream_str() {}; ++ inline void putbyte(unsigned char ch) { ++ if (*i < len) ++ s[(*i)++] = ch; ++ } ++}; ++ ++class encoding_ostream_fp: public encoding_ostream { ++private: ++ FILE *fp; ++ const char *format; ++public: ++ encoding_ostream_fp(FILE *ofp, const char *fmt = "%c") : fp(ofp), format(fmt) {}; ++ ~encoding_ostream_fp() {}; ++ inline void putbyte(unsigned char ch) { ++ fprintf(fp, format, ch); ++ } ++}; ++ ++class encoding_handler { ++public: ++ encoding_handler() {}; ++ virtual ~encoding_handler() {}; ++ ++ // name of this encoding_handler ++ virtual const char *name() { return ""; }; ++ ++ // check if this byte is byte in multibyte character in this encoding? ++ virtual int is_wchar_byte(unsigned char c) { return 0; }; ++ ++ // make new wchar from c0 (beginning of multibytes) and rest from `in' ++ virtual wchar make_wchar(unsigned char c0, encoding_istream& in) { ++ return wchar(c0); ++ } ++ // make new wchar from c0 (beginning of multibytes) and rest from `fp' ++ virtual wchar make_wchar(unsigned char c0, FILE *fp) { ++ encoding_istream_fp in(fp); ++ return make_wchar(c0, in); ++ } ++ // make new wchar from c0 (beginning of multibtyes) and rest from ++ // s[*i], *i will be changed to point the byte of next character. ++ virtual wchar make_wchar(unsigned char c0, const unsigned char *s, int *i) { ++ encoding_istream_str in(s, i); ++ return make_wchar(c0, in); ++ } ++ ++ // put wchar to outputstream ++ // returns number of bytes written ++ virtual int put_wchar(wchar wc, encoding_ostream& eos) { ++ eos.putbyte((unsigned char)wc); ++ return 1; ++ } ++ // put wchar to `fp' using `fmt' ++ // returns number of bytes written ++ virtual int put_wchar(wchar wc, FILE *fp, const char *fmt = "%c") { ++ encoding_ostream_fp out(fp, fmt); ++ return put_wchar(wc, out); ++ } ++ // put wchar to s[*i] (until maxlen) ++ // *i will be changed to point the byte of next character. ++ virtual int put_wchar(wchar wc, unsigned char *s, int *i, int maxlen) { ++ encoding_ostream_str out(s, i, maxlen); ++ return put_wchar(wc, out); ++ } ++ ++ // maximum number of bytes of multibyte character in this encoding ++ virtual int max_wchar_len() { return 1; }; ++ ++}; ++ ++encoding_handler* select_input_encoding_handler(const char* encoding_name); ++encoding_handler* select_output_encoding_handler(const char* encoding_name); ++extern encoding_handler* input_encoding; ++extern encoding_handler* output_encoding; ++void init_encoding_handler(); ++ ++// check if wc is wchar? ++int is_wchar_code(wchar wc); ++ ++// check if wc is wchar & can be represented in single byte? ++int is_wchar_singlebyte(wchar wc); ++ ++// get singlebyte representation of wchar (if is_wchar_singlebyte(wc)) ++unsigned char wchar_singlebyte(wchar wc); ++ ++// get actual wide character code ++int wchar_code(wchar wc); ++ ++// make wchar from wide character code ++int make_wchar(int w); ++ ++#endif ++ ++#endif /* ENCODING_H */ +--- groff-1.18.1.1.orig/src/include/lib.h ++++ groff-1.18.1.1/src/include/lib.h +@@ -88,8 +88,15 @@ + + extern char invalid_char_table[]; + ++#include "encoding.h" /* XXX: ukai */ ++ + inline int invalid_input_char(int c) + { ++#ifdef ENABLE_MULTIBYTE ++ if (input_encoding->is_wchar_byte(c)) ++ return 0; ++ else ++#endif + return c >= 0 && invalid_char_table[c]; + } + +--- groff-1.18.1.1.orig/src/include/device.h ++++ groff-1.18.1.1/src/include/device.h +@@ -18,4 +18,9 @@ + with groff; see the file COPYING. If not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + ++#ifndef _DEVICE_H ++#define _DEVICE_H ++ + extern const char *device; ++ ++#endif /* _DEVICE_H */ +--- groff-1.18.1.1.orig/src/include/config.h ++++ groff-1.18.1.1/src/include/config.h +@@ -0,0 +1,187 @@ ++/* src/include/config.h. Generated by configure. */ ++/* src/include/config.hin. Generated from configure.ac by autoheader. */ ++ ++/* Define if your C++ doesn't understand `delete []'. */ ++/* #undef ARRAY_DELETE_NEEDS_SIZE */ ++ ++/* Define if you want to use multibyte extension. */ ++#define ENABLE_MULTIBYTE 1 ++ ++/* Define if you have a C++ . */ ++#define HAVE_CC_LIMITS_H 1 ++ ++/* Define if you have a C++ . */ ++/* #undef HAVE_CC_OSFCN_H */ ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_DIRENT_H 1 ++ ++/* Define to 1 if you have the `fmod' function. */ ++#define HAVE_FMOD 1 ++ ++/* Define to 1 if you have the `getcwd' function. */ ++#define HAVE_GETCWD 1 ++ ++/* Define to 1 if you have the `getpagesize' function. */ ++#define HAVE_GETPAGESIZE 1 ++ ++/* Define to 1 if you have the `gettimeofday' function. */ ++#define HAVE_GETTIMEOFDAY 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_INTTYPES_H 1 ++ ++/* Define to 1 if you have the `isatty' function. */ ++#define HAVE_ISATTY 1 ++ ++/* Define if you have and nl_langinfo(CODESET). */ ++#define HAVE_LANGINFO_CODESET 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_LIMITS_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_MATH_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_MEMORY_H 1 ++ ++/* Define if you have mkstemp(). */ ++#define HAVE_MKSTEMP 1 ++ ++/* Define to 1 if you have a working `mmap' system call. */ ++#define HAVE_MMAP 1 ++ ++/* Define to 1 if you have the `putenv' function. */ ++#define HAVE_PUTENV 1 ++ ++/* Define to 1 if you have the `rename' function. */ ++#define HAVE_RENAME 1 ++ ++/* Define to 1 if you have the `snprintf' function. */ ++#define HAVE_SNPRINTF 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_STDINT_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_STDLIB_H 1 ++ ++/* Define to 1 if you have the `strcasecmp' function. */ ++#define HAVE_STRCASECMP 1 ++ ++/* Define to 1 if you have the `strerror' function. */ ++#define HAVE_STRERROR 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_STRINGS_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_STRING_H 1 ++ ++/* Define to 1 if you have the `strncasecmp' function. */ ++#define HAVE_STRNCASECMP 1 ++ ++/* Define to 1 if you have the `strsep' function. */ ++#define HAVE_STRSEP 1 ++ ++/* Define to 1 if you have the `strtol' function. */ ++#define HAVE_STRTOL 1 ++ ++/* Define if defines struct exception. */ ++#define HAVE_STRUCT_EXCEPTION 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_SYS_DIR_H 1 ++ ++/* Define if you have sys_errlist in or in . */ ++#define HAVE_SYS_ERRLIST 1 ++ ++/* Define if you have sysnerr in or . */ ++#define HAVE_SYS_NERR 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_SYS_STAT_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_SYS_TIME_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_SYS_TYPES_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_UNISTD_H 1 ++ ++/* Define if the host's encoding is EBCDIC. */ ++/* #undef IS_EBCDIC_HOST */ ++ ++/* Define if localtime() takes a long * not a time_t *. */ ++/* #undef LONG_FOR_TIME_T */ ++ ++/* Define if your C++ doesn't declare gettimeofday(). */ ++/* #undef NEED_DECLARATION_GETTIMEOFDAY */ ++ ++/* Define if your C++ doesn't declare hypot(). */ ++/* #undef NEED_DECLARATION_HYPOT */ ++ ++/* Define if your C++ doesn't declare pclose(). */ ++/* #undef NEED_DECLARATION_PCLOSE */ ++ ++/* Define if your C++ doesn't declare popen(). */ ++/* #undef NEED_DECLARATION_POPEN */ ++ ++/* Define if your C++ doesn't declare putenv(). */ ++/* #undef NEED_DECLARATION_PUTENV */ ++ ++/* Define if your C++ doesn't declare strcasecmp(). */ ++/* #undef NEED_DECLARATION_STRCASECMP */ ++ ++/* Define if your C++ doesn't declare strncasecmp(). */ ++/* #undef NEED_DECLARATION_STRNCASECMP */ ++ ++/* Define to the address where bug reports for this package should be sent. */ ++#define PACKAGE_BUGREPORT "" ++ ++/* Define to the full name of this package. */ ++#define PACKAGE_NAME "" ++ ++/* Define to the full name and version of this package. */ ++#define PACKAGE_STRING "" ++ ++/* Define to the one symbol short name of this package. */ ++#define PACKAGE_TARNAME "" ++ ++/* Define to the version of this package. */ ++#define PACKAGE_VERSION "" ++ ++/* Define if the printer's page size is A4. */ ++#define PAGEA4 1 ++ ++/* Define as the return type of signal handlers (`int' or `void'). */ ++#define RETSIGTYPE void ++ ++/* Define if srand() returns void not int. */ ++#define RET_TYPE_SRAND_IS_VOID 1 ++ ++/* Define to 1 if you have the ANSI C header files. */ ++#define STDC_HEADERS 1 ++ ++/* Define to 1 if `sys_siglist' is declared by or . */ ++#define SYS_SIGLIST_DECLARED 1 ++ ++/* Define if your C++ compiler uses a traditional (Reiser) preprocessor. */ ++/* #undef TRADITIONAL_CPP */ ++ ++/* Define if the 0200 bit of the status returned by wait() indicates whether a ++ core image was produced for a process that was terminated by a signal. */ ++/* #undef WCOREFLAG */ ++ ++/* Define if -D_POSIX_SOURCE is necessary. */ ++/* #undef _POSIX_SOURCE */ ++ ++/* Define if you have ISC 3.x or 4.x. */ ++/* #undef _SYSV3 */ ++ ++/* Define uintmax_t to `unsigned long' or `unsigned long long' if ++ does not exist. */ ++/* #undef uintmax_t */ +--- groff-1.18.1.1.orig/src/include/printer.h ++++ groff-1.18.1.1/src/include/printer.h +@@ -38,6 +38,8 @@ + + #include "color.h" + ++#include "encoding.h" ++ + struct environment { + int fontno; + int size; +@@ -63,6 +65,9 @@ + printer(); + virtual ~printer(); + void load_font(int i, const char *name); ++#ifdef ENABLE_MULTIBYTE ++ void set_wchar_char(wchar c, char *s, int i0, int len, const environment *env, int *widthp = 0); ++#endif + void set_ascii_char(unsigned char c, const environment *env, + int *widthp = 0); + void set_special_char(const char *nm, const environment *env, +--- groff-1.18.1.1.orig/src/include/font.h ++++ groff-1.18.1.1/src/include/font.h +@@ -18,11 +18,17 @@ + with groff; see the file COPYING. If not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + ++#include "encoding.h" ++ + typedef void (*FONT_COMMAND_HANDLER)(const char *, const char *, + const char *, int); + + struct font_kern_list; + struct font_char_metric; ++#ifdef ENABLE_MULTIBYTE ++struct fontset_list; ++struct font_wchar_metric; ++#endif + struct font_widths_cache; + + class font { +@@ -53,6 +59,9 @@ + const char *get_special_device_encoding(int index); + const char *get_name(); + const char *get_internal_name(); ++#ifdef ENABLE_MULTIBYTE ++ const char *get_subfont_name(int index); ++#endif + + static int scan_papersize(const char *, const char **, double *, double *); + +@@ -62,6 +71,9 @@ + static int load_desc(); + static int name_to_index(const char *); + static int number_to_index(int); ++#ifdef ENABLE_MULTIBYTE ++ static int wchar_index(wchar); ++#endif + static FONT_COMMAND_HANDLER + set_unknown_desc_command_handler(FONT_COMMAND_HANDLER); + +@@ -76,6 +88,11 @@ + static int spare2; + static int sizescale; + static int tcommand; ++#ifdef ENABLE_MULTIBYTE ++ // XXX: should be in charinfo or font_wchar_metric? ++ static int lowerwchar; ++ static int wcharkern; ++#endif + static int pass_filenames; + static int use_charnames_in_special; + +@@ -83,13 +100,27 @@ + static const char **style_table; + static const char *family; + static int *sizes; ++#ifdef ENABLE_MULTIBYTE ++ // fontsets - sub font list ++ static fontset_list *fontsets; ++ // get fontset for `wc' in current font `fname' ++ static int get_fontset_font(const char *fname, wchar wc); ++ // is the fontno's font load on demand? ++ static int is_on_demand(int fontno); ++#endif + private: + unsigned ligatures; + font_kern_list **kern_hash_table; + int space_width; +- short *ch_index; ++ short *ch_index; /* XXX: this is used unless font_wchar_metric. */ + int nindices; + font_char_metric *ch; ++#ifdef ENABLE_MULTIBYTE ++ // font metric for wchar ++ font_wchar_metric *wch; ++ // get font metric for wchar indexed by c ++ font_wchar_metric *get_font_wchar_metric(int c); ++#endif + int ch_used; + int ch_size; + int special; +--- groff-1.18.1.1.orig/src/include/driver.h ++++ groff-1.18.1.1/src/include/driver.h +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include "encoding.h" // XXX: ukai + #include "errarg.h" + #include "error.h" + #include "font.h" +--- groff-1.18.1.1.orig/src/libs/libdriver/input.cc ++++ groff-1.18.1.1/src/libs/libdriver/input.cc +@@ -250,6 +250,7 @@ + + #include "driver.h" + #include "device.h" ++#include "encoding.h" + + #include + #include +@@ -1439,6 +1440,19 @@ + char *subcmd_str = get_string_arg(); + char subcmd = subcmd_str[0]; + switch (subcmd) { ++#ifdef ENABLE_MULTIBYTE ++ case 'e': // x encoding: select encoding ++ { ++ char *str_arg = get_string_arg(); ++ if (str_arg == 0) ++ warning("empty argument for `x encoding' command"); ++ else { ++ select_input_encoding_handler(str_arg); ++ delete str_arg; ++ } ++ break; ++ } ++#endif + case 'f': // x font: mount font + { + IntArg n = get_integer_arg(); +@@ -1517,7 +1531,7 @@ + return stopped; + } + +- ++//////////////////////////////////////////////////////////////// + /********************************************************************** + exported part (by driver.h) + **********************************************************************/ +@@ -1625,6 +1639,18 @@ + if (str_arg[0] != 'i') + fatal("the third command must be `x init'"); + delete str_arg; ++#ifdef ENABLE_MULTIBYTE ++ Char c = get_char(); ++ while (is_space_or_tab(c) && c != Char('\n') && c != Char(EOF)) ++ c = get_char(); ++ unget_char(c); ++ if (c != Char('\n') && c != Char(EOF)) { ++ const char *tmp_encoding = get_string_arg(); ++ if (tmp_encoding && *tmp_encoding) ++ select_input_encoding_handler(tmp_encoding); ++ delete tmp_encoding; ++ } ++#endif + skip_line_x(); + } + +@@ -1763,6 +1789,18 @@ + size_t i = 0; + while ((c = str_arg[i++]) != '\0') { + EnvInt w; ++#ifdef ENABLE_MULTIBYTE ++ if (input_encoding->is_wchar_byte(c)) { ++ int i0 = i - 1; ++ wchar wc = input_encoding->make_wchar(c, (const unsigned char *)str_arg, (int *)&i); ++ if (is_wchar_code(wc)) { ++ /* XXX: singlebyte check? */ ++ pr->set_wchar_char(wc, str_arg, i0, i - i0, current_env, &w); ++ } else { ++ pr->set_ascii_char((unsigned char) c, current_env, &w); ++ } ++ } else ++#endif + pr->set_ascii_char((unsigned char) c, current_env, &w); + current_env->hpos += w; + } +--- groff-1.18.1.1.orig/src/libs/libdriver/printer.cc ++++ groff-1.18.1.1/src/libs/libdriver/printer.cc +@@ -27,6 +27,7 @@ + */ + + #include "driver.h" ++#include "encoding.h" + + printer *pr = 0; + +@@ -138,6 +139,24 @@ + } + } + ++#ifdef ENABLE_MULTIBYTE ++void printer::set_wchar_char(wchar c, char *s, int i0, int len, const environment *env, int *widthp) ++{ ++ unsigned char *buf = new unsigned char[len+1]; ++ memset(buf, 0, len+1); ++ memcpy(buf, s+i0, len); ++ font *f; ++ int w; ++ int i = set_char_and_width((const char *)buf, env, &w, &f); ++ if (i != -1) { ++ set_char(c, f, env, w, (const char *)buf); ++ if (widthp) ++ *widthp = w; ++ } ++ delete [] buf; ++} ++#endif ++ + void printer::set_special_char(const char *nm, const environment *env, + int *widthp) + { +--- groff-1.18.1.1.orig/src/libs/libgroff/fontfile.cc ++++ groff-1.18.1.1/src/libs/libgroff/fontfile.cc +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include "encoding.h" // XXX: ukai + #include "font.h" + #include "searchpath.h" + #include "device.h" +@@ -36,6 +37,10 @@ + int font::res = 0; + int font::hor = 1; + int font::vert = 1; ++#ifdef ENABLE_MULTIBYTE ++int font::lowerwchar = 0; ++int font::wcharkern = 0; ++#endif + int font::unitwidth = 0; + int font::paperwidth = 0; + int font::paperlength = 0; +--- groff-1.18.1.1.orig/src/libs/libgroff/font.cc ++++ groff-1.18.1.1/src/libs/libgroff/font.cc +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include "encoding.h" // XXX: ukai + #include "errarg.h" + #include "error.h" + #include "cset.h" +@@ -43,8 +44,39 @@ + int italic_correction; + int subscript_correction; + char *special_device_coding; ++#ifdef ENABLE_MULTIBYTE ++ char *subfont_name; ++#endif + }; + ++#ifdef ENABLE_MULTIBYTE ++struct fontset_list { ++ struct fontset_list *next; ++ char *primary_font_name; ++ int fontset_font; ++ wchar start_code; ++ wchar end_code; ++ int on_demand; ++}; ++ ++fontset_list *font::fontsets = NULL; ++ ++struct font_wchar_metric { ++ struct font_wchar_metric *next; ++ char type; ++ int start_code; ++ int end_code; ++ int width; ++ int height; ++ int depth; ++ int pre_math_space; ++ int italic_correction; ++ int subscript_correction; ++ char *special_device_coding; ++ char *subfont_name; ++}; ++#endif ++ + struct font_kern_list { + int i1; + int i2; +@@ -149,7 +181,11 @@ + + font::font(const char *s) + : ligatures(0), kern_hash_table(0), space_width(0), ch_index(0), nindices(0), +- ch(0), ch_used(0), ch_size(0), special(0), widths_cache(0) ++ ch(0), ++#ifdef ENABLE_MULTIBYTE ++ wch(0), ++#endif ++ ch_used(0), ch_size(0), special(0), widths_cache(0) + { + name = new char[strlen(s) + 1]; + strcpy(name, s); +@@ -183,6 +219,17 @@ + widths_cache = widths_cache->next; + delete tem; + } ++#ifdef ENABLE_MULTIBYTE ++ struct font_wchar_metric *wcp, *nwcp; ++ for (wcp = wch; wcp != NULL; wcp = nwcp) { ++ nwcp = wcp->next; ++ if (wcp->special_device_coding) ++ delete [] wcp->special_device_coding; ++ if (wcp->subfont_name) ++ delete [] wcp->subfont_name; ++ delete wcp; ++ } ++#endif + } + + static int scale_round(int n, int x, int y) +@@ -244,6 +291,11 @@ + + int font::contains(int c) + { ++#ifdef ENABLE_MULTIBYTE ++ font_wchar_metric *wcp = get_font_wchar_metric(c); ++ if (wcp != NULL) ++ return 1; ++#endif + return c >= 0 && c < nindices && ch_index[c] >= 0; + } + +@@ -266,8 +318,31 @@ + a_delete width; + } + ++#ifdef ENABLE_MULTIBYTE ++struct font_wchar_metric * ++font::get_font_wchar_metric(int c) ++{ ++ /* XXX: c is font index, not char code... */ ++ /* XXX: we assume wchar_code == font index code for wchars */ ++ /* XXX: does really code conflicts with index? */ ++ struct font_wchar_metric *wcp; ++ for (wcp = wch; wcp != NULL; wcp = wcp->next) { ++ if (wcp->start_code <= wchar_code(c) && wchar_code(c) <= wcp->end_code) { ++ return wcp; ++ } ++ } ++ return NULL; ++} ++#endif ++ + int font::get_width(int c, int point_size) + { ++#ifdef ENABLE_MULTIBYTE ++ font_wchar_metric *wcp = get_font_wchar_metric(c); ++ if (wcp != NULL) { ++ return scale(wcp->width, point_size); ++ } ++#endif + assert(c >= 0 && c < nindices); + int i = ch_index[c]; + assert(i >= 0); +@@ -299,30 +374,60 @@ + + int font::get_height(int c, int point_size) + { ++#ifdef ENABLE_MULTIBYTE ++ font_wchar_metric *wcp = get_font_wchar_metric(c); ++ if (wcp != NULL) { ++ return scale(wcp->height, point_size); ++ } ++#endif + assert(c >= 0 && c < nindices && ch_index[c] >= 0); + return scale(ch[ch_index[c]].height, point_size); + } + + int font::get_depth(int c, int point_size) + { ++#ifdef ENABLE_MULTIBYTE ++ font_wchar_metric *wcp = get_font_wchar_metric(c); ++ if (wcp != NULL) { ++ return scale(wcp->depth, point_size); ++ } ++#endif + assert(c >= 0 && c < nindices && ch_index[c] >= 0); + return scale(ch[ch_index[c]].depth, point_size); + } + + int font::get_italic_correction(int c, int point_size) + { ++#ifdef ENABLE_MULTIBYTE ++ font_wchar_metric *wcp = get_font_wchar_metric(c); ++ if (wcp != NULL) { ++ return scale(wcp->italic_correction, point_size); ++ } ++#endif + assert(c >= 0 && c < nindices && ch_index[c] >= 0); + return scale(ch[ch_index[c]].italic_correction, point_size); + } + + int font::get_left_italic_correction(int c, int point_size) + { ++#ifdef ENABLE_MULTIBYTE ++ font_wchar_metric *wcp = get_font_wchar_metric(c); ++ if (wcp != NULL) { ++ return scale(wcp->pre_math_space, point_size); ++ } ++#endif + assert(c >= 0 && c < nindices && ch_index[c] >= 0); + return scale(ch[ch_index[c]].pre_math_space, point_size); + } + + int font::get_subscript_correction(int c, int point_size) + { ++#ifdef ENABLE_MULTIBYTE ++ font_wchar_metric *wcp = get_font_wchar_metric(c); ++ if (wcp != NULL) { ++ return scale(wcp->subscript_correction, point_size); ++ } ++#endif + assert(c >= 0 && c < nindices && ch_index[c] >= 0); + return scale(ch[ch_index[c]].subscript_correction, point_size); + } +@@ -371,12 +476,24 @@ + + int font::get_character_type(int c) + { ++#ifdef ENABLE_MULTIBYTE ++ font_wchar_metric *wcp = get_font_wchar_metric(c); ++ if (wcp != NULL) { ++ return wcp->type; ++ } ++#endif + assert(c >= 0 && c < nindices && ch_index[c] >= 0); + return ch[ch_index[c]].type; + } + + int font::get_code(int c) + { ++#ifdef ENABLE_MULTIBYTE ++ font_wchar_metric *wcp = get_font_wchar_metric(c); ++ if (wcp != NULL) { ++ return c; ++ } ++#endif + assert(c >= 0 && c < nindices && ch_index[c] >= 0); + return ch[ch_index[c]].code; + } +@@ -393,10 +510,26 @@ + + const char *font::get_special_device_encoding(int c) + { ++#ifdef ENABLE_MULTIBYTE ++ font_wchar_metric *wcp = get_font_wchar_metric(c); ++ if (wcp != NULL) ++ return wcp->special_device_coding; ++#endif + assert(c >= 0 && c < nindices && ch_index[c] >= 0); + return( ch[ch_index[c]].special_device_coding ); + } + ++#ifdef ENABLE_MULTIBYTE ++const char *font::get_subfont_name(int c) ++{ ++ font_wchar_metric *wcp = get_font_wchar_metric(c); ++ if (wcp != NULL) ++ return wcp->subfont_name; ++ assert(c >= 0 && c < nindices && ch_index[c] >= 0); ++ return ch[ch_index[c]].subfont_name; ++} ++#endif ++ + void font::alloc_ch_index(int index) + { + if (nindices == 0) { +@@ -554,9 +687,11 @@ + return 0; + } + ++ + // If the font can't be found, then if not_found is non-NULL, it will be set + // to 1 otherwise a message will be printed. + ++ + int font::load(int *not_found) + { + char *path; +@@ -570,7 +705,7 @@ + } + text_file t(fp, path); + t.skip_comments = 1; +- char *p; ++ char *p = NULL; + for (;;) { + if (!t.next()) { + t.error("missing charset command"); +@@ -681,6 +816,9 @@ + } + else if (strcmp(command, "charset") == 0) { + had_charset = 1; ++#ifdef ENABLE_MULTIBYTE ++ int had_range = 0; ++#endif + int last_index = -1; + for (;;) { + if (!t.next()) { +@@ -695,6 +833,11 @@ + command = nm; + break; + } ++#ifdef ENABLE_MULTIBYTE ++ int start_code = 0; ++ int end_code = 0; ++ int nrange = sscanf(nm, "u%X..u%X", &start_code, &end_code); ++#endif + if (p[0] == '"') { + if (last_index == -1) { + t.error("first charset entry is duplicate"); +@@ -711,7 +854,64 @@ + } + copy_entry(index, last_index); + } ++#ifdef ENABLE_MULTIBYTE ++ else if (nrange == 2) { ++ had_range = 1; ++ font_wchar_metric *wcp = new font_wchar_metric; ++ wcp->start_code = start_code; ++ wcp->end_code = end_code; ++ wcp->height = 0; ++ wcp->depth = 0; ++ wcp->pre_math_space = 0; ++ wcp->italic_correction = 0; ++ wcp->subscript_correction = 0; ++ int nparms = sscanf(p, "%d,%d,%d,%d,%d,%d", ++ &wcp->width, &wcp->height, &wcp->depth, ++ &wcp->italic_correction, ++ &wcp->pre_math_space, ++ &wcp->subscript_correction); ++ if (nparms < 1) { ++ t.error("bad width for `%1'", nm); ++ return 0; ++ } ++ p = strtok(0, WS); ++ if (p == 0) { ++ t.error("missing character type for `%1'", nm); ++ return 0; ++ } ++ int type; ++ if (sscanf(p, "%d", &type) != 1) { ++ t.error("bad character type for `%1'", nm); ++ return 0; ++ } ++ if (type < 0 || type > 255) { ++ t.error("character type `%1' out of range", type); ++ return 0; ++ } ++ wcp->type = type; ++ ++ p = strtok(0, WS); ++ if ((p == 0) || (strcmp(p, "--") == 0)) { ++ wcp->subfont_name = NULL; ++ } else { ++ wcp->subfont_name = new char[strlen(p) + 1]; ++ strcpy(wcp->subfont_name, p); ++ } ++ ++ p = strtok(0, WS); ++ if ((p == NULL) || (strcmp(p, "--") == 0)) { ++ wcp->special_device_coding = NULL; ++ } else { ++ wcp->special_device_coding = new char[strlen(p) + 1]; ++ strcpy(wcp->special_device_coding, p); ++ } ++ wcp->next = wch; ++ wch = wcp; ++ p = NULL; ++ } ++#endif + else { ++ + font_char_metric metric; + metric.height = 0; + metric.depth = 0; +@@ -747,6 +947,16 @@ + t.error("missing code for `%1'", nm); + return 0; + } ++#ifdef ENABLE_MULTIBYTE ++ char *subp = strchr(p, ':'); ++ if (subp) { ++ *subp++ = '\0'; ++ metric.subfont_name = new char[strlen(subp) + 1]; ++ strcpy(metric.subfont_name, subp); ++ } else { ++ metric.subfont_name = NULL; ++ } ++#endif + char *ptr; + metric.code = (int)strtol(p, &ptr, 0); + if (metric.code == 0 && ptr == p) { +@@ -777,7 +987,11 @@ + } + } + } ++#ifdef ENABLE_MULTIBYTE ++ if (!had_range && last_index == -1) { ++#else + if (last_index == -1) { ++#endif + t.error("I didn't seem to find any characters"); + return 0; + } +@@ -811,6 +1025,11 @@ + { "biggestfont", &font::biggestfont }, + { "spare2", &font::spare2 }, + { "sizescale", &font::sizescale } ++#ifdef ENABLE_MULTIBYTE ++ , ++ { "lowerwchar", &font::lowerwchar }, ++ { "wcharkern", &font::wcharkern } ++#endif + }; + + int font::load_desc() +@@ -981,6 +1200,67 @@ + tcommand = 1; + else if (strcmp("use_charnames_in_special", p) == 0) + use_charnames_in_special = 1; ++#ifdef ENABLE_MULTIBYTE ++ else if (strcmp("fontset", p) == 0) { ++ /* fontset .. [ondemand] */ ++ p = strtok(0, WS); ++ if (p == NULL) { ++ t.error("no primary font for fontset"); ++ return 0; ++ } ++ char *pfont = NULL; ++ if (strcmp(p, "-") != 0) { ++ pfont = new char[strlen(p)+1]; ++ strcpy(pfont, p); ++ } ++ p = strtok(0, WS); ++ if (p == NULL) { ++ t.error("no fontset font for `%1'", ++ pfont ? pfont : "-"); ++ return 0; ++ } ++ int fontset_font = 0; ++ for (int i = 0; i < nfonts; i++) { ++ if (strcmp(p, font_name_table[i]) == 0) { ++ fontset_font = i; ++ break; ++ } ++ } ++ if (fontset_font == nfonts) { ++ t.error("fontset font `%1' for font `%2' not defined", ++ p, pfont ? pfont : "-"); ++ return 0; ++ } ++ p = strtok(0, WS); ++ if (p == NULL) { ++ t.error("no range for fontset font `%1' for font `%2'", ++ font_name_table[fontset_font], ++ pfont ? pfont : "-"); ++ return 0; ++ } ++ wchar start_code = 0; ++ wchar end_code = 0; ++ int nparms = sscanf(p, "%x..%x", &start_code, &end_code); ++ if (nparms != 2) { ++ t.error("invalid range format `%1'", p); ++ return 0; ++ } ++ p = strtok(0, WS); ++ int on_demand = 0; ++ if (p != NULL && strcmp(p, "ondemand") == 0) { ++ on_demand = 1; ++ } ++ /* XXX */ ++ fontset_list *fl = new fontset_list; ++ fl->primary_font_name = pfont; ++ fl->fontset_font = fontset_font; ++ fl->start_code = start_code; ++ fl->end_code = end_code; ++ fl->on_demand = on_demand; ++ fl->next = fontsets; ++ fontsets = fl; ++ } ++#endif + else if (strcmp("charset", p) == 0) + break; + else if (unknown_desc_command_handler) { +@@ -1020,6 +1300,39 @@ + return 1; + } + ++#ifdef ENABLE_MULTIBYTE ++int ++font::get_fontset_font(const char *fname, wchar wc) { ++ fontset_list *fl; ++ int avail_fontno = -1; ++ wc = wchar_code(wc); ++ for (fl = fontsets; fl != NULL; fl = fl->next) { ++ if (fl->primary_font_name == NULL) { ++ if (fl->start_code <= wc && wc <= fl->end_code) { ++ avail_fontno = fl->fontset_font; ++ } ++ } ++ else if (fname && strcmp(fl->primary_font_name, fname) == 0) { ++ if (fl->start_code <= wc && wc <= fl->end_code) { ++ return fl->fontset_font; ++ } ++ } ++ } ++ return avail_fontno; ++} ++ ++int ++font::is_on_demand(int fontno) { ++ fontset_list *fl; ++ for (fl = fontsets; fl != NULL; fl = fl->next) { ++ if (fl->fontset_font == fontno) { ++ return fl->on_demand; ++ } ++ } ++ return 0; ++} ++#endif ++ + void font::handle_unknown_font_command(const char *, const char *, + const char *, int) + { +--- groff-1.18.1.1.orig/src/libs/libgroff/searchpath.cc ++++ groff-1.18.1.1/src/libs/libgroff/searchpath.cc +@@ -19,6 +19,7 @@ + with groff; see the file COPYING. If not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + ++#include "encoding.h" + #include "lib.h" + + #include +--- groff-1.18.1.1.orig/src/libs/libgroff/nametoindex.cc ++++ groff-1.18.1.1/src/libs/libgroff/nametoindex.cc +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include "encoding.h" // XXX: ukai + #include "errarg.h" + #include "error.h" + #include "font.h" +@@ -37,6 +38,9 @@ + character_indexer(); + ~character_indexer(); + int ascii_char_index(unsigned char); ++#ifdef ENABLE_MULTIBYTE ++ int wchar_index(wchar); ++#endif + int named_char_index(const char *); + int numbered_char_index(int); + private: +@@ -68,6 +72,13 @@ + return ascii_index[c]; + } + ++#ifdef ENABLE_MULTIBYTE ++int character_indexer::wchar_index(wchar wc) ++{ ++ return wc; /* XXX: wchar code == index */ ++} ++#endif ++ + int character_indexer::numbered_char_index(int n) + { + if (n >= 0 && n < NSMALL) { +@@ -103,6 +114,30 @@ + int font::name_to_index(const char *s) + { + assert(s != 0 && s[0] != '\0' && s[0] != ' '); ++#ifdef ENABLE_MULTIBYTE ++ { ++ int i = 1; ++ wchar wc = input_encoding->make_wchar(s[0], (const unsigned char *)s, &i); ++ /* XXX ++ * if wchar can be represented in single byte (<256), ++ * it should be the same as char. ++ */ ++ if (is_wchar_singlebyte(wc)) { ++ return indexer.ascii_char_index(wchar_singlebyte(wc)); ++ } ++ if (is_wchar_code(wc)) { ++ return indexer.wchar_index(wc); ++ } ++ /* XXX: uA1A1 and \xa1a1 are synonyms */ ++ if (s[0] == 'u') { ++ char *res; ++ long n = strtol(s + 1, &res, 16); ++ if (res != s + 1 && *res == '\0') { ++ return indexer.wchar_index(n); ++ } ++ } ++ } ++#endif + if (s[1] == '\0') + return indexer.ascii_char_index(s[0]); + /* char128 and \200 are synonyms */ +@@ -115,3 +150,9 @@ + return indexer.named_char_index(s); + } + ++#ifdef ENABLE_MULTIBYTE ++int font::wchar_index(wchar wc) ++{ ++ return indexer.wchar_index(wc); ++} ++#endif +--- groff-1.18.1.1.orig/src/libs/libgroff/encoding.cc ++++ groff-1.18.1.1/src/libs/libgroff/encoding.cc +@@ -0,0 +1,441 @@ ++// -*- C++ -*- ++/* Copyright (C) 2001 Fumitoshi UKAI ++ ++This file is part of groff. ++ ++groff 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. ++ ++groff 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 */ ++ ++#include "encoding.h" ++#include "device.h" ++ ++#include ++#ifdef ENABLE_MULTIBYTE ++#include ++#include ++#ifdef HAVE_LANGINFO_CODESET ++#include ++#else ++#include ++#endif ++#endif ++ ++class ascii8_handler : public encoding_handler { ++ // encoding handler for 8bit ascii ++ // no multibyte support ++public: ++ ascii8_handler() {} ++ ~ascii8_handler() {} ++ ++ const char *name() { return "C"; }; /* ??? */ ++ ++ inline int is_wchar_byte(unsigned char c) { return 0; } ++ inline wchar make_wchar(unsigned char c0, encoding_istream& eis) { ++ return wchar(c0); ++ } ++ inline int put_wchar(wchar wc, encoding_ostream& eos) { ++ eos.putbyte((unsigned char)wchar_code(wc)); ++ return 1; ++ } ++ inline int max_wchar_len() { return 1; }; ++ ++}; ++ ++#ifdef ENABLE_MULTIBYTE ++class utf8_handler: public encoding_handler { ++public: ++ utf8_handler() { } ++ ~utf8_handler() { } ++ ++ const char *name() { return "UTF-8"; }; ++ ++ inline int is_wchar_byte(unsigned char c) { ++ return (c >= 0x80); ++ } ++ ++ /* ++ 0000 0000-0000 007F 0xxxxxxx ++ 0000 0080-0000 07FF 110xxxxx 10xxxxxx ++ 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx ++ ++ 0001 0000-001F FFFF 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx ++ 0020 0000-03FF FFFF 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx ++ 0400 0000-7FFF FFFF 1111110x 10xxxxxx ... 10xxxxxx ++ */ ++ ++ inline wchar make_wchar(unsigned char c0, encoding_istream& eis) { ++ wchar wc = 0; ++ int count = 0; ++ if (! is_wchar_byte(c0)) { ++ return c0; ++ } ++ if ((c0 & 0xFC) == 0xFC) { ++ wc = c0 & 0x01; ++ count = 5; ++ } else if ((c0 & 0xF8) == 0xF8) { ++ wc = c0 & 0x03; ++ count = 4; ++ } else if ((c0 & 0xF0) == 0xF0) { ++ wc = c0 & 0x07; ++ count = 3; ++ } else if ((c0 & 0xE0) == 0xE0) { ++ wc = c0 & 0x0F; ++ count = 2; ++ } else if ((c0 & 0xC0) == 0xC0) { ++ wc = c0 & 0x1F; ++ count = 1; ++ } ++ for (; count > 0; count--) { ++ wc <<= 6; ++ int c1 = eis.getbyte(); ++ if (! is_wchar_byte(c1)) { ++ /* illegal utf8 sequence? */ ++ } ++ wc |= (c1 & 0x3F); ++ } ++ return -wc; // XXX: negative ++ } ++ ++ inline int put_wchar(wchar wc, encoding_ostream& eos) { ++ int count = 0; ++ if (! is_wchar_code(wc)) { ++ eos.putbyte(wc); ++ return 1; ++ } ++ wc = -wc; // XXX: negative -> character code ++ ++ if (wc < 0x800) { ++ count = 1; eos.putbyte((wc >> 6) | 0xC0); ++ } else if (wc < 0x10000) { ++ count = 2; eos.putbyte((wc >> 12) | 0xE0); ++ } else if (wc < 0x200000) { ++ count = 3; eos.putbyte((wc >> 18) | 0xF0); ++ } else if (wc < 0x4000000) { ++ count = 4; eos.putbyte((wc >> 24) | 0xf8); ++ } else if (wc <= 0x7fffffff) { ++ count = 5; eos.putbyte((wc >> 30) | 0xFC); ++ } ++ for (int i = 0; i < count; i++) { ++ eos.putbyte(((wc >> 6 * (count - i - 1)) & 0x3f) | 0x80); ++ } ++ return count; ++ } ++ inline int max_wchar_len() { return 6; }; /* XXX 3?*/ ++ ++}; ++ ++#define USE_ICONV ++#ifdef USE_ICONV ++#include ++#include ++ ++class iconv_handler : public encoding_handler { ++private: ++ iconv_t icd, ocd; ++ const char *encoding_name; ++ static iconv_handler *ih_header; ++ ++public: ++ iconv_handler *next; ++ ++ static iconv_handler *new_iconv_handler(const char *ename) { ++ iconv_handler *ip; ++ // if already created, use it. ++ for (ip = ih_header; ip != NULL; ip = ip->next) { ++ if (strcmp(ip->name(), ename) == 0) { ++ return ip; ++ } ++ } ++ // not found, create new one. ++ ip = new iconv_handler(ename); ++ ip->next = ih_header; ++ ih_header = ip; ++ return ip; ++ } ++ iconv_handler(const char *ename) : encoding_name(ename) { ++ // internal code is UCS-2BE ++ icd = iconv_open("UCS-2BE", encoding_name); ++ ocd = iconv_open(encoding_name, "UCS-2BE"); ++ }; ++ ~iconv_handler() {}; ++ ++ const char *name() { return encoding_name; }; ++ ++ inline int is_wchar_byte(unsigned char c) { ++ return (c >= 0x80); /* ??? */ ++ } ++ ++ inline wchar make_wchar(unsigned char c0, encoding_istream& eis) { ++ wchar wc = 0; ++ char inbuf[8], outbuf[8]; ++ char *inp, *outp; ++ size_t inbytesleft, outbytesleft; ++ int i = 0; ++ ++ if (! is_wchar_byte(c0)) { ++ return c0; ++ } ++ for (inbuf[i++] = c0; ;inbuf[i++] = eis.getbyte()) { ++ inbytesleft = i; ++ outbytesleft = sizeof(outbuf); ++ inp = inbuf; ++ outp = outbuf; ++ size_t r = iconv(icd, &inp, &inbytesleft, &outp, &outbytesleft); ++ if (r == (size_t)-1) { ++ if (errno == EILSEQ) { ++ /* illegal sequence? */ ++ return '?'; ++ } else if (errno == EINVAL) { ++ /* incomplete sequence? */ ++ continue; ++ } else if (errno == E2BIG) { ++ /* no room to output? */ ++ return '?'; ++ } ++ } ++ /* ok */ ++ /* UCS-2 is 2 bytes */ ++ wc = ((outbuf[0] & 0x0ff) << 8) | (outbuf[1] & 0x0ff); ++ return -wc; // XXX: negative ++ } ++ } ++ ++ ++ inline int put_wchar(wchar wc, encoding_ostream& eos) { ++ char inbuf[4], outbuf[4]; ++ char *inp, *outp; ++ size_t inbytesleft, outbytesleft; ++ ++ if (!is_wchar_code(wc)) { ++ eos.putbyte(wc & 0x0ff); ++ return 1; ++ } ++ wc = -wc; // XXX: negative -> character code ++ ++ inbuf[0] = (wc >> 8) & 0x0ff; ++ inbuf[1] = (wc >> 0) & 0x0ff; ++ inbuf[2] = 0; ++ inbytesleft = 2; ++ outbytesleft = 4; ++ inp = inbuf; ++ outp = outbuf; ++ size_t r = iconv(ocd, &inp, &inbytesleft, &outp, &outbytesleft); ++ if (r == (size_t)-1) { ++ if (errno == EILSEQ) { ++ /* illegal sequence? */; ++ } else if (errno == EINVAL) { ++ /* incomplete sequence? */; ++ } else if (errno == E2BIG) { ++ /* no room to output? */; ++ } ++ eos.putbyte('?'); ++ return 1; ++ } ++ char *op = outbuf; ++ int n = 0; ++ for (; op < outp; op++, n++) { ++ eos.putbyte(*op & 0x0ff); ++ } ++ return outp - outbuf; ++ } ++ inline int max_wchar_len() { return 6; }; /* XXX */ ++ ++}; ++#else ++class euc_handler : public encoding_handler { ++ static const int WCTABLE_OFFSET = 0xa1; ++ static const int WCTABLE_SIZE = 94; ++ static const int EUCMASK = 0x8080; ++ ++public: ++ euc_handler() {} ++ ~euc_handler() {}; ++ ++ const char *name() { return "EUC-JP"; }; ++ ++ inline int is_wchar_byte(unsigned char c) { ++ return (c >= 0xa1 && c <= 0xfe); ++ } ++ ++ inline wchar make_wchar(unsigned char c0, encoding_istream& eis) { ++ wchar wc; ++ if (! is_wchar_byte(c0)) { ++ return c0; ++ } ++ int c1 = eis.peekbyte(); ++ if (! is_wchar_byte(c1)) { ++ eis.ungetbyte(c1); ++ return c0; ++ } ++ c1 = eis.getbyte(); ++ wc = (c0 & 0xff) << 8; ++ wc |= (c1 & 0xff); ++ ++ if (wc == 0xa1a1) ++ return ' '; ++ return -wc; ++ } ++ ++ inline int put_wchar(wchar wc, encoding_ostream& eos) { ++ if (is_wchar_code(wc)) { ++ wc = -wc; ++ eos.putbyte((wc >> 8) & 0x0ff); ++ eos.putbyte((wc >> 0) & 0x0ff); ++ return 2; ++ } else { ++ eos.putbyte(wc & 0x0ff); ++ return 1; ++ } ++ } ++ inline int max_wchar_len() { return 2; }; /* XXX */ ++}; ++#endif /* USE_ICONV */ ++#endif ++ ++static ascii8_handler ascii8; ++#ifdef ENABLE_MULTIBYTE ++static utf8_handler utf8; ++#ifdef USE_ICONV ++iconv_handler *iconv_handler::ih_header = NULL; ++#else ++static euc_handler eucjp; ++#endif ++#endif ++ ++encoding_handler *input_encoding = &ascii8; ++encoding_handler *output_encoding = &ascii8; ++ ++static void ++new_encoding_handler(encoding_handler **eptr, const char *encoding_name) ++{ ++ if (!encoding_name) { ++ *eptr = &ascii8; ++ return; ++ } ++#ifdef ENABLE_MULTIBYTE ++ if (strcmp(encoding_name, "UTF-8") == 0) { ++ *eptr = &utf8; ++ return; ++ } ++#ifdef USE_ICONV ++ if (strcmp(encoding_name, "C") != 0) { ++ *eptr = iconv_handler::new_iconv_handler(encoding_name); ++ return; ++ } ++#else ++ // printf("encoding request: [%s]\n", encoding_name); ++ if (strcmp(encoding_name, "EUC-JP") == 0) { ++ // printf("encoding: [EUC-JP]\n"); ++ *eptr = &eucjp; ++ return; ++ } ++#endif ++#endif ++ // default ++ *eptr = &ascii8; ++ return; ++} ++ ++encoding_handler * ++select_input_encoding_handler(const char *encoding_name) ++{ ++ new_encoding_handler(&input_encoding, encoding_name); ++ return input_encoding; ++} ++ ++encoding_handler * ++select_output_encoding_handler(const char *encoding_name) ++{ ++ new_encoding_handler(&output_encoding, encoding_name); ++ return output_encoding; ++} ++ ++void ++init_encoding_handler() ++{ ++#ifdef ENABLE_MULTIBYTE ++ const char *locale, *charset; ++ // groff 1 defines ISO-8859-1 as the input encoding, so this is required ++ // for compatibility. groff 2 will define UTF-8 (or possibly officially ++ // allow it to be switchable?) ++ select_input_encoding_handler("ISO-8859-1"); ++ select_output_encoding_handler("C"); ++ ++ locale = setlocale(LC_ALL, ""); ++ if (locale == NULL || ++ strcmp(locale, "C") == 0 || strcmp(locale, "POSIX") == 0) { ++ return; ++ } ++ /* check LC_CTYPE is C or POSIX */ ++ locale = setlocale(LC_CTYPE, NULL); ++ if (strcmp(locale, "C") == 0 || strcmp(locale, "POSIX") == 0) { ++ return; ++ } ++ /* otherwise */ ++#if HAVE_LANGINFO_CODESET ++ charset = nl_langinfo(CODESET); ++#else ++ charset = strchr(locale, '.'); ++ if (charset) ++ ++charset; ++ else ++ charset = ""; ++#endif ++ if (strncmp(locale, "ja", 2) == 0 || strncmp(locale, "zh", 2) == 0 || ++ (strncmp(locale, "ko", 2) == 0 && strcmp(charset, "UTF-8") == 0)) { ++ select_input_encoding_handler(charset); ++ select_output_encoding_handler(charset); ++ } else if ((!device || strcmp(device, "ascii8") == 0)) { ++ select_input_encoding_handler(NULL); ++ select_output_encoding_handler(NULL); ++ } ++#endif ++ return; ++} ++ ++int ++is_wchar_code(wchar wc) ++{ ++ return (wc < 0); ++} ++ ++int ++is_wchar_singlebyte(wchar wc) ++{ ++ return ((-256 < wc) && (wc < 0)); ++} ++ ++unsigned char ++wchar_singlebyte(wchar wc) ++{ ++ if (wc >= 0) ++ return (unsigned char)wc; ++ else ++ return (unsigned char)-wc; ++} ++ ++int ++wchar_code(wchar wc) ++{ ++ if (wc >= 0) ++ return wc; ++ else ++ return -wc; ++} ++ ++int ++make_wchar(int w) ++{ ++ return -w; ++} +--- groff-1.18.1.1.orig/src/libs/libgroff/Makefile.sub ++++ groff-1.18.1.1/src/libs/libgroff/Makefile.sub +@@ -6,6 +6,7 @@ + color.$(OBJEXT) \ + cset.$(OBJEXT) \ + device.$(OBJEXT) \ ++ encoding.$(OBJEXT) \ + errarg.$(OBJEXT) \ + error.$(OBJEXT) \ + fatal.$(OBJEXT) \ +@@ -45,6 +46,7 @@ + $(srcdir)/color.cc \ + $(srcdir)/cset.cc \ + $(srcdir)/device.cc \ ++ $(srcdir)/encoding.cc \ + $(srcdir)/errarg.cc \ + $(srcdir)/error.cc \ + $(srcdir)/fatal.cc \ +--- groff-1.18.1.1.orig/src/libs/libgroff/tmpfile.cc ++++ groff-1.18.1.1/src/libs/libgroff/tmpfile.cc +@@ -24,6 +24,7 @@ + #include + #include + ++#include "encoding.h" + #include "posix.h" + #include "errarg.h" + #include "error.h" +--- groff-1.18.1.1.orig/src/utils/tfmtodit/tfmtodit.cc ++++ groff-1.18.1.1/src/utils/tfmtodit/tfmtodit.cc +@@ -650,7 +650,7 @@ + gives the groff name of the character, `i' gives its index in + the encoding, which is filled in later (-1 if it does not appear). */ + +-struct { ++struct S { + const char *ch; + int i; + } lig_chars[] = { +@@ -670,7 +670,7 @@ + + // Each possible ligature appears in this table. + +-struct { ++struct S2 { + unsigned char c1, c2, res; + const char *ch; + } lig_table[] = { +--- groff-1.18.1.1.orig/src/preproc/eqn/eqn.y ++++ groff-1.18.1.1/src/preproc/eqn/eqn.y +@@ -21,6 +21,7 @@ + #include + #include + ++#include "encoding.h" /* XXX */ + #include "lib.h" + #include "box.h" + extern int non_empty_flag; +--- groff-1.18.1.1.orig/src/preproc/eqn/lex.cc ++++ groff-1.18.1.1/src/preproc/eqn/lex.cc +@@ -23,6 +23,7 @@ + #include "eqn_tab.h" + #include "stringclass.h" + #include "ptable.h" ++#include "encoding.h" + + struct definition { + char is_macro; +@@ -375,6 +376,11 @@ + lex_error("invalid input character code %1", c); + else { + line += char(c); ++#ifdef ENABLE_MULTIBYTE ++ if (input_encoding->is_wchar_byte(c)) { ++ line += char(getc(fp)); ++ } ++#endif + if (c == '\n') + break; + } +--- groff-1.18.1.1.orig/src/preproc/eqn/main.cc ++++ groff-1.18.1.1/src/preproc/eqn/main.cc +@@ -258,6 +258,7 @@ + program_name = argv[0]; + static char stderr_buf[BUFSIZ]; + setbuf(stderr, stderr_buf); ++ init_encoding_handler(); + int opt; + int load_startup_file = 1; + static const struct option long_options[] = { +--- groff-1.18.1.1.orig/src/preproc/eqn/text.cc ++++ groff-1.18.1.1/src/preproc/eqn/text.cc +@@ -21,13 +21,20 @@ + #include "eqn.h" + #include "pbox.h" + #include "ptable.h" ++#include "encoding.h" + + class char_box : public simple_box { + unsigned char c; ++#ifdef ENABLE_MULTIBYTE ++ wchar wc; ++#endif + char next_is_italic; + char prev_is_italic; + public: + char_box(unsigned char); ++#ifdef ENABLE_MULTIBYTE ++ char_box(unsigned char, wchar); ++#endif + void debug_print(); + void output(); + int is_char(); +@@ -165,11 +172,22 @@ + } + + char_box::char_box(unsigned char cc) +-: c(cc), next_is_italic(0), prev_is_italic(0) ++: c(cc), ++#ifdef ENABLE_MULTIBYTE ++ wc(cc), ++#endif ++ next_is_italic(0), prev_is_italic(0) + { + spacing_type = char_table[c].spacing_type; + } + ++#ifdef ENABLE_MULTIBYTE ++char_box::char_box(unsigned char cc, wchar wc) ++: c(cc), wc(wc), next_is_italic(0), prev_is_italic(0) ++{ ++} ++#endif ++ + void char_box::hint(unsigned flags) + { + if (flags & HINT_PREV_IS_ITALIC) +@@ -188,7 +206,11 @@ + if (c == '\\') + fputs("\\e", stdout); + else ++#ifdef ENABLE_MULTIBYTE ++ output_encoding->put_wchar(wc, stdout); ++#else + putchar(c); ++#endif + if (!next_is_italic) + fputs("\\/", stdout); + else +@@ -497,6 +519,14 @@ + break; + default: + normal_char: ++#ifdef ENABLE_MULTIBYTE ++ if (input_encoding->is_wchar_byte(c)) { ++ int i = 1; ++ wchar wc = input_encoding->make_wchar(c, (unsigned char *)s, &i); ++ b = new char_box('A', wc); // char_info of wc is same the 'A'. ++ s += i; ++ } else ++#endif + b = new char_box(c); + break; + } +--- groff-1.18.1.1.orig/src/preproc/eqn/box.cc ++++ groff-1.18.1.1/src/preproc/eqn/box.cc +@@ -80,7 +80,7 @@ + + int nroff = 0; // should we grok ndefine or tdefine? + +-struct { ++struct S { + const char *name; + int *ptr; + } param_table[] = { +--- groff-1.18.1.1.orig/src/preproc/html/pre-html.cc ++++ groff-1.18.1.1/src/preproc/html/pre-html.cc +@@ -63,6 +63,10 @@ + #define DEFAULT_IMAGE_RES 100 // number of pixels per inch resolution + #define IMAGE_BOARDER_PIXELS 0 + #define INLINE_LEADER_CHAR '\\' ++#define A4_LENGTH 841890 // taken from devps/Makefile.sub ++#define LETTER_LENGTH 792000 // taken from devps/Makefile.sub ++#define A4_OFFSET 0 ++#define LETTER_OFFSET 50 // 50/72 of an inch + + #define TRANSPARENT "-background white -transparent white" + #define MIN_ALPHA_BITS 0 +@@ -104,6 +108,7 @@ + static char *macroset_template= NULL; // image template passed to troff by -D + static int troff_arg = 0; // troff arg index + static char *image_dir = NULL; // user specified image directory ++static char *gsPaper = NULL; // the paper size that gs must use + static int textAlphaBits = MAX_ALPHA_BITS; + static int graphicAlphaBits = MAX_ALPHA_BITS; + static char *antiAlias = NULL; // antialias arguments we pass to gs. +@@ -211,6 +216,54 @@ + } + + /* ++ * get_papersize - returns an integer determining the paper length from ++ * devps/DESC ++ */ ++ ++static int get_papersize (void) ++{ ++ char *pathp; ++ FILE *f; ++ int res; ++ f = font_path.open_file("devps/DESC", &pathp); ++ if (f == 0) ++ fatal("can't open devps/DESC"); ++ while (get_line(f)) { ++ int n = sscanf(linebuf, "paperlength %d", &res); ++ if (n >= 1) { ++ fclose(f); ++ return res; ++ } ++ if (!strncmp(linebuf, "papersize", 9)) { ++ double length; ++ char *p = linebuf + 9; ++ while (*p == ' ' || *p == '\t') ++ p++; ++ for (p = strtok(p, " \t"); p; p = strtok(0, " \t")) { ++ if (font::scan_papersize(p, 0, &length, 0)) { ++ fclose(f); ++ return int(length * postscriptRes + 0.5); ++ } ++ } ++ fatal("bad argument to `papersize' keyword in devps/DESC"); ++ } ++ } ++ fatal("can't find `papersize' or `paperlength' keyword in devps/DESC"); ++ return 0; ++} ++ ++/* ++ * determine_vertical_offset - works out the default vertical offset from ++ * the page length ++ */ ++ ++static void determine_vertical_offset (void) ++{ ++ vertical_offset = ((A4_LENGTH-get_papersize())*72)/postscriptRes; ++ gsPaper = "-sPAPERSIZE=a4"; ++} ++ ++/* + * html_system - a wrapper for system() + */ + +@@ -1469,6 +1522,7 @@ + int ok=1; + + postscriptRes = get_resolution(); ++ determine_vertical_offset(); + i = scanArguments(argc, argv); + setupAntiAlias(); + checkImageDir(); +--- groff-1.18.1.1.orig/src/preproc/grn/hdb.cc ++++ groff-1.18.1.1/src/preproc/grn/hdb.cc +@@ -115,7 +115,6 @@ + type = DBGetType(string); /* interpret element type */ + if (type < 0) { /* no more data */ + done = TRUE; +- (void) fclose(file); + } else { + #ifdef UW_FASTSCAN + (void) xscanf(file, &x, &y); /* always one point */ +--- groff-1.18.1.1.orig/src/preproc/refer/command.cc ++++ groff-1.18.1.1/src/preproc/refer/command.cc +@@ -632,7 +632,7 @@ + ? means that the previous argument is optional, * means that the + previous argument can occur any number of times. */ + +-struct { ++struct S { + const char *name; + command_t func; + const char *arg_types; +--- groff-1.18.1.1.orig/src/devices/grotty/grotty.man ++++ groff-1.18.1.1/src/devices/grotty/grotty.man +@@ -50,7 +50,9 @@ + command + with a + .BR \-Tascii , +-.B \-Tlatin1 ++.BR \-Tascii8 , ++.BR \-Tlatin1 , ++.B \-Tnippon + or + .B \-Tutf8 + option on ASCII based systems, and with +@@ -235,8 +237,10 @@ + .I name + is the name of the device, usually + .BR ascii , ++.BR ascii8 , + .BR latin1 , + .BR utf8 , ++.B nippon + or + .BR cp1047 . + .TP +@@ -315,10 +319,20 @@ + device. + . + .TP ++.B @FONTDIR@/devascii8/DESC ++Device description file for ++.B ascii8 ++device. ++.TP + .B @FONTDIR@/devlatin1/DESC + Device description file for + .B latin1 + device. ++.TP ++.B @FONTDIR@/devnippon/DESC ++Device description file for ++.B nippon ++device. + . + .TP + .BI @FONTDIR@/devlatin1/ F +--- groff-1.18.1.1.orig/src/devices/grotty/tty.cc ++++ groff-1.18.1.1/src/devices/grotty/tty.cc +@@ -20,6 +20,7 @@ + + #include "driver.h" + #include "device.h" ++#include "encoding.h" + + extern "C" const char *Version_string; + +@@ -51,8 +52,18 @@ + HDRAW_MODE = 0x08, + CU_MODE = 0x10, + COLOR_CHANGE = 0x20 ++#ifdef ENABLE_MULTIBYTE ++ , WCHAR_MODE = 0x100 ++#endif + }; + ++#ifdef ENABLE_MULTIBYTE ++# ifdef putchar ++# undef putchar ++# endif ++#define putchar(wc) output_encoding->put_wchar((wc), stdout) ++#endif ++ + // Mode to use for bold-underlining. + static unsigned char bold_underline_mode = BOLD_MODE|UNDERLINE_MODE; + +@@ -89,6 +100,7 @@ + static tty_font *load_tty_font(const char *); + }; + ++ + tty_font *tty_font::load_tty_font(const char *s) + { + tty_font *f = new tty_font(s); +@@ -98,8 +110,26 @@ + } + const char *num = f->get_internal_name(); + long n; ++#ifdef ENABLE_MULTIBYTE ++ if (num != 0) { ++ n = strtol(num, 0, 0); ++ switch (n) { ++ case 1: ++ f->mode = int(UNDERLINE_MODE); ++ break; ++ case 2: ++ case 5: ++ f->mode = int(BOLD_MODE); ++ break; ++ case 3: ++ f->mode = int(BOLD_MODE|UNDERLINE_MODE); ++ break; ++ } ++ } ++#else + if (num != 0 && (n = strtol(num, 0, 0)) != 0) + f->mode = int(n & (BOLD_MODE|UNDERLINE_MODE)); ++#endif + if (!underline_flag) + f->mode &= ~UNDERLINE_MODE; + if (!bold_flag) +@@ -135,6 +165,9 @@ + short hpos; + unsigned int code; + unsigned char mode; ++#ifdef ENABLE_MULTIBYTE ++ short cols; ++#endif + unsigned char back_color_idx; + unsigned char fore_color_idx; + void *operator new(size_t); +@@ -184,7 +217,7 @@ + void make_underline(); + void make_bold(unsigned int); + unsigned char color_to_idx(color *col); +- void add_char(unsigned int, int, int, color *, color *, unsigned char); ++ void add_char(unsigned int, int, int, color *, color *, font *, unsigned char); + public: + tty_printer(const char *device); + ~tty_printer(); +@@ -193,7 +226,7 @@ + void special(char *arg, const environment *env, char type); + void change_color(const environment *env); + void change_fill_color(const environment *env); +- void put_char(unsigned int); ++ int put_char(unsigned int); + void put_color(unsigned char, int); + void begin_page(int) { } + void end_page(int page_length); +@@ -203,6 +236,10 @@ + tty_printer::tty_printer(const char *device) : cached_v(0) + { + is_utf8 = !strcmp(device, "utf8"); ++#ifdef ENABLE_MULTIBYTE ++ if (is_utf8) ++ select_output_encoding_handler("UTF-8"); ++#endif + tty_colors[0].set_rgb(0, // black + 0, + 0); +@@ -242,8 +279,18 @@ + void tty_printer::make_underline() + { + if (old_drawing_scheme) { ++#if 0 /* def ENABLE_MULTIBYTE XXX: not necessary? */ ++ if ((p->mode & WCHAR_MODE)) { ++ putchar('_'); putchar('_'); ++ putchar('\b'); putchar('\b'); ++ } else { ++ putchar('_'); ++ putchar('\b'); ++ } ++#else + putchar('_'); + putchar('\b'); ++#endif + } + else { + if (!is_underline) { +@@ -285,17 +332,25 @@ + void tty_printer::set_char(int i, font *f, const environment *env, + int w, const char *name) + { ++#ifdef ENABLE_MULTIBYTE ++ if (is_wchar_code(i)) { ++ add_char(wchar_code(i), env->hpos, env->vpos, env->col, env->fill, ++ f, ((tty_font *)f)->get_mode()); ++ return; ++ } ++#endif + if (w != font::hor) + fatal("width of character not equal to horizontal resolution"); + add_char(f->get_code(i), + env->hpos, env->vpos, + env->col, env->fill, +- ((tty_font *)f)->get_mode()); ++ f, ((tty_font *)f)->get_mode()); + } + + void tty_printer::add_char(unsigned int c, + int h, int v, + color *fore, color *back, ++ font *curfont, + unsigned char mode) + { + #if 0 +@@ -338,6 +393,16 @@ + g->code = c; + g->fore_color_idx = color_to_idx(fore); + g->back_color_idx = color_to_idx(back); ++#ifdef ENABLE_MULTIBYTE ++ if (is_wchar_code(c)) ++ mode |= WCHAR_MODE; ++ if (curfont && curfont->contains(c)) { ++ int gw0 = curfont->get_space_width(font::unitwidth); ++ int gw = curfont->get_width(c, font::unitwidth); ++ g->cols = gw/gw0; ++ } else ++ g->cols = 1; /* XXX */ ++#endif + g->mode = mode; + + // The list will be reversed later. After reversal, it must be in +@@ -357,7 +422,7 @@ + void tty_printer::special(char *arg, const environment *env, char type) + { + if (type == 'u') { +- add_char(*arg - '0', env->hpos, env->vpos, env->col, env->fill, CU_MODE); ++ add_char(*arg - '0', env->hpos, env->vpos, env->col, env->fill, get_font_from_index(env->fontno), CU_MODE); + return; + } + if (type != 'p') +@@ -395,12 +460,12 @@ + + void tty_printer::change_color(const environment *env) + { +- add_char(0, env->hpos, env->vpos, env->col, env->fill, COLOR_CHANGE); ++ add_char(0, env->hpos, env->vpos, env->col, env->fill, get_font_from_index(env->fontno), COLOR_CHANGE); + } + + void tty_printer::change_fill_color(const environment *env) + { +- add_char(0, env->hpos, env->vpos, env->col, env->fill, COLOR_CHANGE); ++ add_char(0, env->hpos, env->vpos, env->col, env->fill, get_font_from_index(env->fontno), COLOR_CHANGE); + } + + void tty_printer::draw(int code, int *p, int np, const environment *env) +@@ -420,7 +485,7 @@ + len = -len; + } + while (len >= 0) { +- add_char('|', env->hpos, v, env->col, env->fill, VDRAW_MODE); ++ add_char('|', env->hpos, v, env->col, env->fill, get_font_from_index(env->fontno), VDRAW_MODE); + len -= font::vert; + v += font::vert; + } +@@ -434,18 +499,24 @@ + len = -len; + } + while (len >= 0) { +- add_char('-', h, env->vpos, env->col, env->fill, HDRAW_MODE); ++ add_char('-', h, env->vpos, env->col, env->fill, get_font_from_index(env->fontno), HDRAW_MODE); + len -= font::hor; + h += font::hor; + } + } + } + +-void tty_printer::put_char(unsigned int wc) ++int tty_printer::put_char(unsigned int wc) + { ++#ifdef ENABLE_MULTIBYTE ++ if (wc >= 0x80) { ++ return output_encoding->put_wchar(make_wchar(wc), stdout); ++ } ++#else + if (is_utf8 && wc >= 0x80) { + char buf[6 + 1]; + int count; ++ int len; + char *p = buf; + if (wc < 0x800) + count = 1, *p = (unsigned char)((wc >> 6) | 0xc0); +@@ -458,14 +529,18 @@ + else if (wc <= 0x7fffffff) + count = 5, *p = (unsigned char)((wc >> 30) | 0xfC); + else +- return; ++ return 0; ++ len = count; + do *++p = (unsigned char)(((wc >> (6 * --count)) & 0x3f) | 0x80); + while (count > 0); + *++p = '\0'; + putstring(buf); ++ return len; + } ++#endif + else + putchar(wc); ++ return 1; + } + + void tty_printer::put_color(unsigned char color_index, int back) +@@ -629,7 +704,11 @@ + } + } + put_char(p->code); ++#ifdef ENABLE_MULTIBYTE ++ hpos += p->cols; ++#else + hpos++; ++#endif + } + if (!old_drawing_scheme + && (is_bold || is_underline +@@ -667,6 +746,7 @@ + if (getenv("GROFF_NO_SGR")) + old_drawing_scheme = 1; + setbuf(stderr, stderr_buf); ++ init_encoding_handler(); + int c; + static const struct option long_options[] = { + { "help", no_argument, 0, CHAR_MAX + 1 }, +--- groff-1.18.1.1.orig/src/devices/grops/ps.cc ++++ groff-1.18.1.1/src/devices/grops/ps.cc +@@ -24,6 +24,7 @@ + #include "cset.h" + #include "nonposix.h" + #include "paper.h" ++#include "encoding.h" + + #include "ps.h" + #include +@@ -193,12 +194,23 @@ + return *this; + } + ++#ifdef ENABLE_MULTIBYTE ++ps_output &ps_output::put_string(const wchar *s, int n) ++#else + ps_output &ps_output::put_string(const char *s, int n) ++#endif + { + int len = 0; + int i; + for (i = 0; i < n; i++) { ++#ifdef ENABLE_MULTIBYTE ++ wchar wc = s[i]; ++ char c = 0; ++ if (is_wchar_singlebyte(wc)) ++ c = wchar_singlebyte(wc); ++#else + char c = s[i]; ++#endif + if (is_ascii(c) && csprint(c)) { + if (c == '(' || c == ')' || c == '\\') + len += 2; +@@ -224,8 +236,13 @@ + putc('\n', fp); + col = 0; + } ++#ifdef ENABLE_MULTIBYTE ++ int nb = output_encoding->put_wchar(s[i], fp, "%02x"); ++ col += nb * 2; ++#else + fprintf(fp, "%02x", s[i] & 0377); + col += 2; ++#endif + } + putc('>', fp); + col++; +@@ -396,6 +413,9 @@ + int encoding_index; + char *encoding; + char *reencoded_name; ++#ifdef ENABLE_MULTIBYTE ++ char *encodingname; ++#endif + ~ps_font(); + void handle_unknown_font_command(const char *command, const char *arg, + const char *filename, int lineno); +@@ -414,6 +434,9 @@ + + ps_font::ps_font(const char *nm) + : font(nm), encoding_index(-1), encoding(0), reencoded_name(0) ++#ifdef ENABLE_MULTIBYTE ++ , encodingname(0) ++#endif + { + } + +@@ -421,6 +444,9 @@ + { + a_delete encoding; + a_delete reencoded_name; ++#ifdef ENABLE_MULTIBYTE ++ a_delete encodingname; ++#endif + } + + void ps_font::handle_unknown_font_command(const char *command, const char *arg, +@@ -433,6 +459,15 @@ + else + encoding = strsave(arg); + } ++#ifdef ENABLE_MULTIBYTE ++ if (strcmp(command, "encodingname") == 0) { ++ if (arg == 0) ++ error_with_file_and_line(filename, lineno, ++ "`encodingname' command requires an argument"); ++ else ++ encodingname = strsave(arg); ++ } ++#endif + } + + static void handle_unknown_desc_command(const char *command, const char *arg, +@@ -487,7 +522,11 @@ + int paper_length; + int equalise_spaces; + enum { SBUF_SIZE = 256 }; ++#ifdef ENABLE_MULTIBYTE ++ wchar sbuf[SBUF_SIZE]; ++#else + char sbuf[SBUF_SIZE]; ++#endif + int sbuf_len; + int sbuf_start_hpos; + int sbuf_vpos; +@@ -606,7 +645,11 @@ + { + if (i == space_char_index || invis_count > 0) + return; ++#ifdef ENABLE_MULTIBYTE ++ wchar code = f->get_code(i); ++#else + unsigned char code = f->get_code(i); ++#endif + style sty(f, env->size, env->height, env->slant); + if (sty.slant != 0) { + if (sty.slant > 80 || sty.slant < -80) { +@@ -763,6 +806,14 @@ + if (sty == defined_styles[i]) { + sprintf(buf, "F%d", i); + out.put_symbol(buf); ++#ifdef ENABLE_MULTIBYTE ++ char *encodingname = ((ps_font *)sty.f)->encodingname; ++ if (encodingname != 0) { ++ select_output_encoding_handler(encodingname); ++ } else { ++ select_output_encoding_handler("LATIN1"); ++ } ++#endif + return; + } + if (ndefined_styles >= MAX_DEFINED_STYLES) +@@ -772,6 +823,14 @@ + const char *psname = sty.f->get_internal_name(); + if (psname == 0) + fatal("no internalname specified for font `%1'", sty.f->get_name()); ++#ifdef ENABLE_MULTIBYTE ++ char *encodingname = ((ps_font *)sty.f)->encodingname; ++ if (encodingname != 0) { ++ select_output_encoding_handler(encodingname); ++ } else { ++ select_output_encoding_handler("LATIN1"); ++ } ++#endif + char *encoding = ((ps_font *)sty.f)->encoding; + if (encoding != 0) { + char *s = ((ps_font *)sty.f)->reencoded_name; +@@ -1555,6 +1614,7 @@ + string env; + static char stderr_buf[BUFSIZ]; + setbuf(stderr, stderr_buf); ++ init_encoding_handler(); + int c; + static const struct option long_options[] = { + { "help", no_argument, 0, CHAR_MAX + 1 }, +--- groff-1.18.1.1.orig/src/devices/grops/ps.h ++++ groff-1.18.1.1/src/devices/grops/ps.h +@@ -18,10 +18,16 @@ + with groff; see the file COPYING. If not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + ++#include "encoding.h" // XXX ++ + class ps_output { + public: + ps_output(FILE *, int max_line_length); ++#ifdef ENABLE_MULTIBYTE ++ ps_output &put_string(const wchar *, int); ++#else + ps_output &put_string(const char *, int); ++#endif + ps_output &put_number(int); + ps_output &put_fix_number(int); + ps_output &put_float(double); +--- groff-1.18.1.1.orig/src/devices/grohtml/html.h ++++ groff-1.18.1.1/src/devices/grohtml/html.h +@@ -49,6 +49,9 @@ + class simple_output { + public: + simple_output(FILE *, int max_line_length); ++#ifdef ENABLE_MULTIBYTE ++ simple_output &put_string(const wchar *, int); ++#endif + simple_output &put_string(const char *, int); + simple_output &put_string(const char *s); + simple_output &put_string(const string &s); +--- groff-1.18.1.1.orig/src/devices/grohtml/post-html.cc ++++ groff-1.18.1.1/src/devices/grohtml/post-html.cc +@@ -29,6 +29,7 @@ + #include "html.h" + #include "html-text.h" + #include "html-table.h" ++#include "encoding.h" // XXX: ukai + + #include + +@@ -280,6 +281,9 @@ + public: + char_buffer(); + ~char_buffer(); ++#ifdef ENABLE_MULTIBYTE ++ char *add_string(const wchar *, unsigned int); ++#endif + char *add_string(const char *, unsigned int); + char *add_string(const string &); + private: +@@ -301,6 +305,43 @@ + } + } + ++#ifdef ENABLE_MULTIBYTE ++char *char_buffer::add_string (const wchar *s, unsigned int length) ++{ ++ int i=0; ++ unsigned int old_used; ++ ++ if (tail == 0) { ++ tail = new char_block; ++ head = tail; ++ } else { ++ if (tail->used + length*2 + 1 > char_block::SIZE) { ++ tail->next = new char_block; ++ tail = tail->next; ++ } ++ } ++ // at this point we have a tail which is ready for the string. ++ if (tail->used + length*2 + 1 > char_block::SIZE) { ++ fatal("need to increase char_block::SIZE"); ++ } ++ ++ old_used = tail->used; ++ do { ++ length -= output_encoding->put_wchar(s[i], (unsigned char *)tail->buffer, &tail->used, length*2); ++ i++; ++ } while (length>0); ++ ++ // add terminating nul character ++ ++ tail->buffer[tail->used] = '\0'; ++ tail->used++; ++ ++ // and return start of new string ++ ++ return( &tail->buffer[old_used] ); ++} ++#endif ++ + char *char_buffer::add_string (const char *s, unsigned int length) + { + int i=0; +@@ -320,6 +361,7 @@ + } + + old_used = tail->used; ++ /* XXX: encoding - ukai */ + do { + tail->buffer[tail->used] = s[i]; + tail->used++; +@@ -1917,6 +1959,15 @@ + + current_paragraph->do_para(&html, "", indentation, pageoffset, linelength); + } ++#if 0 // def ENABLE_MULTIBYTE /* XXX */ ++ else if (strcmp(fontname, "M") == 0) { ++ current_paragraph->done_bold(); ++ current_paragraph->done_italic(); ++ current_paragraph->done_tt(); ++ } else if (strcmp(fontname, "G") == 0) { ++ current_paragraph->do_bold(); ++ } ++#endif + } + + void html_printer::determine_header_level (int level) +@@ -2948,6 +2999,11 @@ + current_paragraph->done_italic(); + current_paragraph->done_tt(); + } ++#ifdef ENABLE_MULTIBYTE ++ else if (strcmp(fontname, "G") == 0) { ++ current_paragraph->done_bold(); ++ } ++#endif + } + + /* +@@ -2992,6 +3048,15 @@ + current_paragraph->do_italic(); + current_paragraph->do_bold(); + } ++#ifdef ENABLE_MULTIBYTE ++ else if (strcmp(fontname, "M") == 0) { ++ current_paragraph->done_bold(); ++ current_paragraph->done_italic(); ++ current_paragraph->done_tt(); ++ } else if (strcmp(fontname, "G") == 0) { ++ current_paragraph->do_bold(); ++ } ++#endif + } + + /* +@@ -3331,7 +3396,23 @@ + + last_sbuf_length = sbuf.length(); + if (html_glyph == NULL) ++#ifdef ENABLE_MULTIBYTE ++ { ++ if (is_wchar_code(code)) { ++ int mblen = output_encoding->max_wchar_len(); ++ unsigned char *wbuf = new unsigned char[mblen]; ++ int i = 0, j = 0; ++ output_encoding->put_wchar(code, wbuf, &j, mblen); ++ for (i = 0; i < j; i++) { ++ sbuf += wbuf[i]; ++ } ++ } ++ else ++ sbuf += ((char)code); ++ } ++#else + sbuf += ((char)code); ++#endif + else + sbuf += html_glyph; + } +@@ -3445,12 +3526,12 @@ + return; + + flush_sbuf(); ++ sbuf_style = sty; /* XXX? */ + add_to_sbuf(i, name); + sbuf_end_hpos = env->hpos + w; + sbuf_start_hpos = env->hpos; + sbuf_prev_hpos = env->hpos; + sbuf_vpos = env->vpos; +- sbuf_style = sty; + sbuf_kern = 0; + } + +@@ -3659,6 +3740,7 @@ + program_name = argv[0]; + static char stderr_buf[BUFSIZ]; + setbuf(stderr, stderr_buf); ++ init_encoding_handler(); + int c; + static const struct option long_options[] = { + { "help", no_argument, 0, CHAR_MAX + 1 }, +--- groff-1.18.1.1.orig/src/devices/grodvi/dvi.cc ++++ groff-1.18.1.1/src/devices/grodvi/dvi.cc +@@ -21,6 +21,7 @@ + + #include "driver.h" + #include "nonposix.h" ++#include "encoding.h" + + extern "C" const char *Version_string; + +@@ -104,6 +105,9 @@ + struct output_font { + dvi_font *f; + int point_size; ++#ifdef ENABLE_MULTIBYTE ++ const char *sf; // subfont name ++#endif + output_font() : f(0) { } + }; + +@@ -121,6 +125,9 @@ + output_font output_font_table[FONTS_MAX]; + font *cur_font; + int cur_point_size; ++#ifdef ENABLE_MULTIBYTE ++ const char *cur_subfont; ++#endif + color cur_color; + int pushed; + int pushed_h; +@@ -341,9 +348,18 @@ + if (*env->col != cur_color) + set_color(env->col); + int code = f->get_code(index); ++#ifdef ENABLE_MULTIBYTE ++ const char *sf = f->get_subfont_name(index); ++ if (env->size != cur_point_size || f != cur_font || ++ (sf != cur_subfont && strcmp(sf, cur_subfont))) { ++#else + if (env->size != cur_point_size || f != cur_font) { ++#endif + cur_font = f; + cur_point_size = env->size; ++#ifdef ENABLE_MULTIBYTE ++ cur_subfont = sf; ++#endif + int i; + for (i = 0;; i++) { + if (i >= FONTS_MAX) { +@@ -352,9 +368,16 @@ + if (output_font_table[i].f == 0) { + output_font_table[i].f = (dvi_font *)cur_font; + output_font_table[i].point_size = cur_point_size; ++#ifdef ENABLE_MULTIBYTE ++ output_font_table[i].sf = cur_subfont; ++#endif + define_font(i); + } + if (output_font_table[i].f == cur_font ++#ifdef ENABLE_MULTIBYTE ++ && (output_font_table[i].sf == cur_subfont || ++ strcmp(output_font_table[i].sf, cur_subfont) == 0) ++#endif + && output_font_table[i].point_size == cur_point_size) + break; + } +@@ -398,7 +421,13 @@ + out4(f->checksum); + out4(output_font_table[i].point_size*RES_7227); + out4(int((double(f->design_size)/(1<<20))*RES_7227*100 + .5)); ++#ifdef ENABLE_MULTIBYTE ++ const char *nm; ++ if (!(nm = output_font_table[i].sf)) ++ nm = f->get_internal_name(); ++#else + const char *nm = f->get_internal_name(); ++#endif + out1(0); + out_string(nm); + } +@@ -889,6 +918,7 @@ + program_name = argv[0]; + static char stderr_buf[BUFSIZ]; + setbuf(stderr, stderr_buf); ++ init_encoding_handler(); + int c; + static const struct option long_options[] = { + { "help", no_argument, 0, CHAR_MAX + 1 }, +--- groff-1.18.1.1.orig/src/xditview/encoding.h ++++ groff-1.18.1.1/src/xditview/encoding.h +@@ -0,0 +1,31 @@ ++// -*- C++ -*- ++/* Copyright (c) 2001 Fumitoshi UKAI ++ ++This file is part of groff. ++ ++groff 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. ++ ++groff 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 */ ++ ++#ifndef ENCODING_H ++#define ENCODING_H ++ ++#include "config.h" ++ ++#ifdef ENABLE_MULTIBYTE ++typedef unsigned int wchar; ++#else ++typedef char wchar; ++#endif ++ ++#endif +--- groff-1.18.1.1.orig/src/xditview/lex.c ++++ groff-1.18.1.1/src/xditview/lex.c +@@ -2,8 +2,10 @@ + #include + #include + #include ++#include "config.h" + #include "DviP.h" + ++int + DviGetAndPut(dw, cp) + DviWidget dw; + int *cp; +@@ -67,6 +69,7 @@ + return Buffer; + } + ++int + GetNumber(dw) + DviWidget dw; + { +@@ -90,6 +93,98 @@ + DviUngetC(dw, c); + return i; + } ++ ++#ifdef ENABLE_MULTIBYTE ++#include ++#include ++#include ++#include ++ ++static iconv_t icd; ++void ++DviInitLocale() ++{ ++ char *enc; ++ setlocale(LC_ALL, ""); ++ enc = nl_langinfo(CODESET); ++ icd = iconv_open("UCS-2BE", enc); ++} ++ ++int ++DviGetCharacter(dw, cp) ++ DviWidget dw; ++ char *cp; ++{ ++ char inbuf[8]; ++ char outbuf[8]; ++ char *inp, *outp; ++ size_t inbytesleft, outbytesleft = 8; ++ int i = 0; ++ int j; ++ int wc = 0; ++ int c; ++ size_t r; ++ ++ while (wc == 0) { ++ DviGetC(dw, &c); ++ if (c == EOF) ++ return EOF; ++ inbuf[i++] = c; ++ inbytesleft = i; ++ outbytesleft = BUFSIZ; ++ inp = inbuf; ++ outp = outbuf; ++ r = iconv(icd, &inp, &inbytesleft, &outp, &outbytesleft); ++ if (r == (size_t)-1) { ++ if (errno == EILSEQ) { ++ /* illegal sequence */ ++ } else if (errno == EINVAL) { ++ /* incomplete sequence */ ++ continue; ++ } else if (errno == E2BIG) { ++ /* no room to output? */ ++ ++ } ++ DviUngetC(dw, c); ++ } ++ /* ok - pass inbuf to cp */ ++ for (j = 0; j < i; j++) { ++ cp[j] = inbuf[j]; ++ } ++ cp[j] = '\0'; ++ return i; ++ } ++ /* NOT REACHED */ ++} ++ ++int ++DviWCharP(char *name, int *wc) ++{ ++ char outbuf[BUFSIZ]; ++ char *inp, *outp; ++ int inbytesleft, outbytesleft; ++ size_t r; ++ *wc = 0; ++ inp = name; ++ inbytesleft = strlen(name); ++ outp = outbuf; ++ outbytesleft = sizeof(outbuf)-1; ++ r = iconv(icd, &inp, &inbytesleft, &outp, &outbytesleft); ++ if (r < 0) { ++ return 0; ++ } ++ /* UCS-2 check */ ++ if (outbuf + 2 != outp) { ++ return 0; ++ } ++ for (inp = outbuf; inp < outp; inp++) { ++ *wc <<= 8; ++ *wc |= (*inp) & 0x0ff; ++ } ++ return 1; ++} ++ ++#endif + + /* + Local Variables: +--- groff-1.18.1.1.orig/src/xditview/Dvi.c ++++ groff-1.18.1.1/src/xditview/Dvi.c +@@ -4,6 +4,8 @@ + #endif /* lint */ + #endif /* SABER */ + ++#include "config.h" ++ + /* + * Dvi.c - Dvi display widget + * +@@ -49,6 +51,8 @@ + NBI -adobe-new century schoolbook-bold-i-normal--*-100-*-*-*-*-iso8859-1\n\ + S -adobe-symbol-medium-r-normal--*-100-*-*-*-*-adobe-fontspecific\n\ + SS -adobe-symbol-medium-r-normal--*-100-*-*-*-*-adobe-fontspecific\n\ ++M -misc-fixed-medium-r-normal--*-100-*-*-*-*-jisx0208.1983-0\n\ ++G -misc-fixed-medium-r-normal--*-100-*-*-*-*-jisx0208.1983-0\ + "; + + #define offset(field) XtOffset(DviWidget, field) +@@ -94,6 +98,20 @@ + + static void SaveToFile (); + ++/* font.c */ ++extern void ParseFontMap(); ++extern void DestroyFontMap(); ++extern void ForgetFonts(); ++ ++/* page.c */ ++extern void DestroyFileMap(); ++extern int SearchPagePosition(); ++extern void FileSeek(); ++extern void ForgetPagePositions(); ++ ++/* parse.c */ ++extern int ParseInput(); ++ + DviClassRec dviClassRec = { + { + &widgetClassRec, /* superclass */ +@@ -406,6 +424,7 @@ + return ret; + } + ++void + SetDevice (dw, name) + DviWidget dw; + char *name; +@@ -559,6 +578,9 @@ + DviWidgetClass super = (DviWidgetClass) wc->core_class.superclass; + if (wc->command_class.save == InheritSaveToFile) + wc->command_class.save = super->command_class.save; ++#ifdef ENABLE_MULTIBYTE ++ DviInitLocale(); ++#endif + } + + /* +--- groff-1.18.1.1.orig/src/xditview/parse.c ++++ groff-1.18.1.1/src/xditview/parse.c +@@ -9,15 +9,49 @@ + #include + #include + #include ++#include "config.h" + #include "DviP.h" ++#include "encoding.h" + + static int StopSeen = 0; +-static ParseDrawFunction(), ParseDeviceControl(); +-static push_env(), pop_env(); ++static void ParseDrawFunction(), ParseDeviceControl(); ++static void push_env(), pop_env(); ++ ++/* draw.c */ ++extern int PutCharacter(); ++extern int PutNumberedCharacter(); ++extern void HorizontalGoto(); ++extern void Word(); ++extern void VerticalGoto(); ++extern void VerticalMove(); ++extern void FlushCharCache(); ++extern void Newline(); ++extern void DrawLine(); ++extern void DrawCircle(); ++extern void DrawFilledCircle(); ++extern void DrawEllipse(); ++extern void DrawFilledEllipse(); ++extern void DrawArc(); ++extern void DrawPolygon(); ++extern void DrawFilledPolygon(); ++extern void DrawSpline(); ++ ++/* Dvi.c */ ++extern void SetDevice(); ++ ++/* page.c */ ++extern void RememberPagePosition(); ++ ++/* font.c */ ++extern void SetFontPosition(); ++ ++/* lex.c */ ++extern int GetNumber(); + + #define HorizontalMove(dw, delta) ((dw)->dvi.state->x += (delta)) + + ++int + ParseInput(dw) + register DviWidget dw; + { +@@ -57,11 +91,17 @@ + DviGetC(dw,&otherc)-'0'); + /* fall through */ + case 'c': /* single ascii character */ ++#ifdef ENABLE_MULTIBYTE ++ DviGetCharacter(dw, Buffer); ++ if (Buffer[0] == ' ') ++ break; ++#else + DviGetC(dw,&c); + if (c == ' ') + break; + Buffer[0] = c; + Buffer[1] = '\0'; ++#endif + (void) PutCharacter (dw, Buffer); + break; + case 'C': +@@ -69,10 +109,15 @@ + (void) PutCharacter (dw, Buffer); + break; + case 't': ++#ifdef ENABLE_MULTIBYTE ++ while (DviGetCharacter(dw, Buffer) != EOF ++ && Buffer[0] != ' ' && Buffer[0] != '\n') { ++#else + Buffer[1] = '\0'; + while (DviGetC (dw, &c) != EOF + && c != ' ' && c != '\n') { + Buffer[0] = c; ++#endif + HorizontalMove (dw, PutCharacter (dw, Buffer)); + } + break; +@@ -158,7 +203,7 @@ + } + } + +-static ++static void + push_env(dw) + DviWidget dw; + { +@@ -177,7 +222,7 @@ + dw->dvi.state = new; + } + +-static ++static void + pop_env(dw) + DviWidget dw; + { +@@ -188,7 +233,7 @@ + XtFree ((char *) old); + } + +-static ++static void + InitTypesetter (dw) + DviWidget dw; + { +@@ -200,7 +245,7 @@ + + #define DRAW_ARGS_MAX 128 + +-static ++static void + ParseDrawFunction(dw, buf) + DviWidget dw; + char *buf; +@@ -284,13 +329,12 @@ + } + } + +-static ++static void + ParseDeviceControl(dw) /* Parse the x commands */ + DviWidget dw; + { + char str[20], str1[50]; + int c, n; +- extern int LastPage, CurrentPage; + + GetWord (dw, str, 20); + switch (str[0]) { /* crude for now */ +--- groff-1.18.1.1.orig/src/xditview/DviChar.c ++++ groff-1.18.1.1/src/xditview/DviChar.c +@@ -5,7 +5,10 @@ + * font indexes and back + */ + +-#include "DviChar.h" ++#include ++#include "config.h" ++#include "DviChar.h" ++#include "encoding.h" + + extern char *xmalloc(); + +@@ -21,7 +24,7 @@ + static int standard_maps_loaded = 0; + static void load_standard_maps (); + static int hash_name (); +-static dispose_hash(), compute_hash(); ++static void dispose_hash(), compute_hash(); + + DviCharNameMap * + DviFindMap (encoding) +@@ -58,7 +61,7 @@ + compute_hash (map); + } + +-static ++static void + dispose_hash (map) + DviCharNameMap *map; + { +@@ -88,7 +91,7 @@ + return i; + } + +-static ++static void + compute_hash (map) + DviCharNameMap *map; + { +@@ -120,7 +123,10 @@ + { + int i; + DviCharNameHash *h; +- ++#ifdef ENABLE_MULTIBYTE ++ if (map->char_index) ++ return (*map->char_index)(map, name); ++#endif + i = hash_name (name) % DVI_HASH_SIZE; + for (h = map->buckets[i]; h; h=h->next) + if (!strcmp (h->name, name)) +@@ -128,9 +134,47 @@ + return -1; + } + ++#ifdef ENABLE_MULTIBYTE ++#include ++void ++DviChar2XChar2b(int c, XChar2b *xc) ++{ ++ /* XXX: can we assume 'c' is EUC-JP ? */ ++ xc->byte1 = (c >> 8) & 0x7f; ++ xc->byte2 = (c) &0x7f; ++ return; ++} ++ ++int ++DviCharIndexJISX0208_1983(map, name) ++ DviCharNameMap *map; ++ char *name; ++{ ++ /* XXX: can we assume name points EUC-JP chars? */ ++ unsigned char ub = *name, lb = *(name + 1); ++ int wc; ++ wc = (name[0] & 0xff) << 8; ++ wc |= (name[1] & 0xff); ++ return(wc); ++} ++ ++static DviCharNameMap JISX0208_1983_0_map = { ++ "jisx0208.1983-0", ++ 0, ++ DviChar2XChar2b, ++ DviCharIndexJISX0208_1983, ++{ ++{ "DummyEntry", /* 0 */}, ++}}; ++#endif ++ + static DviCharNameMap ISO8859_1_map = { + "iso8859-1", + 0, ++#ifdef ENABLE_MULTIBYTE ++ 0, ++ 0, ++#endif + { + { 0, /* 0 */}, + { 0, /* 1 */}, +@@ -393,6 +437,10 @@ + static DviCharNameMap Adobe_Symbol_map = { + "adobe-fontspecific", + 1, ++#ifdef ENABLE_MULTIBYTE ++ 0, ++ 0, ++#endif + { + { 0, /* 0 */}, + { 0, /* 1 */}, +@@ -659,4 +707,7 @@ + standard_maps_loaded = 1; + DviRegisterMap (&ISO8859_1_map); + DviRegisterMap (&Adobe_Symbol_map); ++#ifdef ENABLE_MULTIBYTE ++ DviRegisterMap (&JISX0208_1983_0_map); ++#endif + } +--- groff-1.18.1.1.orig/src/xditview/config.h ++++ groff-1.18.1.1/src/xditview/config.h +@@ -0,0 +1,4 @@ ++#ifndef _config_h ++#include "../include/config.h" ++#define _config_h ++#endif +--- groff-1.18.1.1.orig/src/xditview/XFontName.c ++++ groff-1.18.1.1/src/xditview/XFontName.c +@@ -225,6 +225,7 @@ + return True; + } + ++Bool + XCopyFontName (name1, name2, fontNameAttributes) + XFontName *name1, *name2; + unsigned int fontNameAttributes; +--- groff-1.18.1.1.orig/src/xditview/GXditview.ad ++++ groff-1.18.1.1/src/xditview/GXditview.ad +@@ -55,3 +55,25 @@ + GXditview.promptShell.promptDialog.cancel.label: Cancel + GXditview.promptShell.promptDialog.cancel.translations: #override \ + : Cancel() unset() ++ ++GXditview*fontMap: \ ++TR -adobe-times-medium-r-normal--*-100-*-*-*-*-iso8859-1\n\ ++TI -adobe-times-medium-i-normal--*-100-*-*-*-*-iso8859-1\n\ ++TB -adobe-times-bold-r-normal--*-100-*-*-*-*-iso8859-1\n\ ++TBI -adobe-times-bold-i-normal--*-100-*-*-*-*-iso8859-1\n\ ++CR -adobe-courier-medium-r-normal--*-100-*-*-*-*-iso8859-1\n\ ++CI -adobe-courier-medium-o-normal--*-100-*-*-*-*-iso8859-1\n\ ++CB -adobe-courier-bold-r-normal--*-100-*-*-*-*-iso8859-1\n\ ++CBI -adobe-courier-bold-o-normal--*-100-*-*-*-*-iso8859-1\n\ ++HR -adobe-helvetica-medium-r-normal--*-100-*-*-*-*-iso8859-1\n\ ++HI -adobe-helvetica-medium-o-normal--*-100-*-*-*-*-iso8859-1\n\ ++HB -adobe-helvetica-bold-r-normal--*-100-*-*-*-*-iso8859-1\n\ ++HBI -adobe-helvetica-bold-o-normal--*-100-*-*-*-*-iso8859-1\n\ ++NR -adobe-new century schoolbook-medium-r-normal--*-100-*-*-*-*-iso8859-1\n\ ++NI -adobe-new century schoolbook-medium-i-normal--*-100-*-*-*-*-iso8859-1\n\ ++NB -adobe-new century schoolbook-bold-r-normal--*-100-*-*-*-*-iso8859-1\n\ ++NBI -adobe-new century schoolbook-bold-i-normal--*-100-*-*-*-*-iso8859-1\n\ ++S -adobe-symbol-medium-r-normal--*-100-*-*-*-*-adobe-fontspecific\n\ ++SS -adobe-symbol-medium-r-normal--*-100-*-*-*-*-adobe-fontspecific\n\ ++M -misc-fixed-medium-r-normal--*-100-*-*-*-*-jisx0208.1983-0\n\ ++G -misc-fixed-medium-r-normal--*-100-*-*-*-*-jisx0208.1983-0 +--- groff-1.18.1.1.orig/src/xditview/GXditview-ad.h ++++ groff-1.18.1.1/src/xditview/GXditview-ad.h +@@ -50,3 +50,24 @@ + "GXditview.promptShell.promptDialog.cancel.label: Cancel", + "GXditview.promptShell.promptDialog.cancel.translations: #override \ + : Cancel() unset()", ++"GXditview*fontMap: \ ++TR -adobe-times-medium-r-normal--*-100-*-*-*-*-iso8859-1\\n\ ++TI -adobe-times-medium-i-normal--*-100-*-*-*-*-iso8859-1\\n\ ++TB -adobe-times-bold-r-normal--*-100-*-*-*-*-iso8859-1\\n\ ++TBI -adobe-times-bold-i-normal--*-100-*-*-*-*-iso8859-1\\n\ ++CR -adobe-courier-medium-r-normal--*-100-*-*-*-*-iso8859-1\\n\ ++CI -adobe-courier-medium-o-normal--*-100-*-*-*-*-iso8859-1\\n\ ++CB -adobe-courier-bold-r-normal--*-100-*-*-*-*-iso8859-1\\n\ ++CBI -adobe-courier-bold-o-normal--*-100-*-*-*-*-iso8859-1\\n\ ++HR -adobe-helvetica-medium-r-normal--*-100-*-*-*-*-iso8859-1\\n\ ++HI -adobe-helvetica-medium-o-normal--*-100-*-*-*-*-iso8859-1\\n\ ++HB -adobe-helvetica-bold-r-normal--*-100-*-*-*-*-iso8859-1\\n\ ++HBI -adobe-helvetica-bold-o-normal--*-100-*-*-*-*-iso8859-1\\n\ ++NR -adobe-new century schoolbook-medium-r-normal--*-100-*-*-*-*-iso8859-1\\n\ ++NI -adobe-new century schoolbook-medium-i-normal--*-100-*-*-*-*-iso8859-1\\n\ ++NB -adobe-new century schoolbook-bold-r-normal--*-100-*-*-*-*-iso8859-1\\n\ ++NBI -adobe-new century schoolbook-bold-i-normal--*-100-*-*-*-*-iso8859-1\\n\ ++S -adobe-symbol-medium-r-normal--*-100-*-*-*-*-adobe-fontspecific\\n\ ++SS -adobe-symbol-medium-r-normal--*-100-*-*-*-*-adobe-fontspecific\\n\ ++M -misc-fixed-medium-r-normal--*-100-*-*-*-*-jisx0208.1983-0\\n\ ++G -misc-fixed-medium-r-normal--*-100-*-*-*-*-jisx0208.1983-0", +--- groff-1.18.1.1.orig/src/xditview/DviP.h ++++ groff-1.18.1.1/src/xditview/DviP.h +@@ -8,6 +8,7 @@ + + #ifndef _XtDviP_h + #define _XtDviP_h ++#include "config.h" + + #include "Dvi.h" + #include "DviChar.h" +@@ -89,9 +90,17 @@ + #define DVI_CHAR_CACHE_SIZE 1024 + + typedef struct _dviCharCache { ++#ifdef ENABLE_MULTIBYTE ++ XTextItem16 cache[DVI_TEXT_CACHE_SIZE]; ++#else + XTextItem cache[DVI_TEXT_CACHE_SIZE]; ++#endif + char adjustable[DVI_TEXT_CACHE_SIZE]; ++#ifdef ENABLE_MULTIBYTE ++ XChar2b char_cache[DVI_CHAR_CACHE_SIZE]; ++#else + char char_cache[DVI_CHAR_CACHE_SIZE]; ++#endif + int index; + int max; + int char_index; +@@ -182,6 +191,7 @@ + int word_flag; + } DviPart; + ++extern int DviGetAndPut(); + #define DviGetIn(dw,cp)\ + (dw->dvi.tmpFile ? (\ + DviGetAndPut (dw, cp) \ +@@ -228,6 +238,11 @@ + extern DeviceFont *QueryDeviceFont (); + + extern char *GetWord(), *GetLine(); ++ ++#ifdef ENABLE_MULTIBYTE ++extern void DviInitLocale(); ++extern int DviGEtCharacter(); ++#endif + #endif /* _XtDviP_h */ + + +--- groff-1.18.1.1.orig/src/xditview/device.c ++++ groff-1.18.1.1/src/xditview/device.c +@@ -2,10 +2,12 @@ + + #include + #include ++#include + + #include + #include + ++#include "config.h" + #include "device.h" + + #ifndef FONTPATH +@@ -48,6 +50,9 @@ + Device *dev; + struct charinfo *char_table[CHAR_TABLE_SIZE]; + struct charinfo *code_table[256]; ++#ifdef ENABLE_MULTIBYTE ++ struct charrange *range; ++#endif + }; + + struct charinfo { +@@ -71,6 +76,15 @@ + static struct charinfo *add_char(); + static int read_charset_section(); + static char *canonicalize_name(); ++#ifdef ENABLE_MULTIBYTE ++struct charrange { ++ struct charrange *next; ++ int width; ++ int start_code; ++ int end_code; ++}; ++static void add_charrange(); ++#endif + + static + Device *new_device(name) +@@ -256,6 +270,9 @@ + f->char_table[i] = 0; + for (i = 0; i < 256; i++) + f->code_table[i] = 0; ++#ifdef ENABLE_MULTIBYTE ++ f->range = 0; ++#endif + return f; + } + +@@ -267,6 +284,15 @@ + + if (!f) + return; ++#ifdef ENABLE_MULTIBYTE ++ { ++ struct charrange *cp, *cp2; ++ for (cp = f->range; cp != NULL; cp = cp2) { ++ cp2 = cp->next; ++ XtFree((char *)cp); ++ } ++ } ++#endif + XtFree(f->name); + for (i = 0; i < CHAR_TABLE_SIZE; i++) { + struct charinfo *ptr = f->char_table[i]; +@@ -342,6 +368,20 @@ + { + struct charinfo *p; + ++#ifdef ENABLE_MULTIBYTE ++ int wc; ++ extern DviWCharP(); ++ if (DviWCharP(name, &wc)) { ++ struct charrange *rp; ++ for (rp = f->range; rp != NULL; rp = rp->next) { ++ if (rp->start_code <= wc && wc <= rp->end_code) { ++ *widthp = scale_round(rp->width, ps, ++ f->dev->unitwidth); ++ return 1; ++ } ++ } ++ } ++#endif + name = canonicalize_name(name); + for (p = f->char_table[hash_name(name) % CHAR_TABLE_SIZE];; p = p->next) { + if (!p) +@@ -424,6 +464,22 @@ + return ci; + } + ++#ifdef ENABLE_MULTIBYTE ++static void ++add_charrange(f, width, start_code, end_code) ++ DeviceFont *f; ++ int width, start_code, end_code; ++{ ++ struct charrange *ci; ++ ci = (struct charrange *)XtMalloc(sizeof(struct charrange)); ++ ci->start_code = start_code; ++ ci->end_code = end_code; ++ ci->width = width; ++ ci->next = f->range; ++ f->range = ci; ++} ++#endif ++ + /* Return non-zero for success. */ + + static +@@ -439,11 +495,31 @@ + int width; + int code; + char *p; ++#ifdef ENABLE_MULTIBYTE ++ int scode, ecode; ++#endif + + current_lineno++; + name = strtok(buf, WS); + if (!name) + continue; /* ignore blank lines */ ++#ifdef ENABLE_MULTIBYTE ++ if (sscanf(name, "u%X..u%X", &scode, &ecode) == 2) { ++ p = strtok((char *)0, WS); ++ if (!p) ++ break; ++ if (sscanf(p, "%d", &width) != 1) { ++ error("bad width field"); ++ return 0; ++ } ++ p = strtok((char *)0, WS); ++ if (!p) { ++ error("missing type field"); ++ return 0; ++ } ++ add_charrange(f, width, scode, ecode); ++ } else { ++#endif + p = strtok((char *)0, WS); + if (!p) /* end of charset section */ + break; +@@ -479,6 +555,9 @@ + } + last_charinfo = add_char(f, name, width, code); + } ++#ifdef ENABLE_MULTIBYTE ++ } ++#endif + } + return 1; + } +@@ -559,7 +638,7 @@ + FILE *open_device_file(device_name, file_name, result) + char *device_name, *file_name, **result; + { +- char *buf, *path; ++ char *buf; + FILE *fp; + + buf = XtMalloc(3 + strlen(device_name) + 1 + strlen(file_name) + 1); +--- groff-1.18.1.1.orig/src/xditview/page.c ++++ groff-1.18.1.1/src/xditview/page.c +@@ -28,6 +28,7 @@ + return m; + } + ++void + DestroyFileMap (m) + DviFileMap *m; + { +@@ -39,6 +40,7 @@ + } + } + ++void + ForgetPagePositions (dw) + DviWidget dw; + { +@@ -46,6 +48,7 @@ + dw->dvi.file_map = 0; + } + ++void + RememberPagePosition(dw, number) + DviWidget dw; + int number; +@@ -64,6 +67,7 @@ + m->position = ftell (dw->dvi.file); + } + ++int + SearchPagePosition (dw, number) + DviWidget dw; + int number; +@@ -75,6 +79,7 @@ + return m->position; + } + ++void + FileSeek(dw, position) + DviWidget dw; + long position; +--- groff-1.18.1.1.orig/src/xditview/FontMap.jisx0208 ++++ groff-1.18.1.1/src/xditview/FontMap.jisx0208 +@@ -0,0 +1,2 @@ ++M -misc-fixed-medium-r-normal--*-100-*-*-*-*-jisx0208.1983-0 ++G -misc-fixed-medium-r-normal--*-100-*-*-*-*-jisx0208.1983-0 +--- groff-1.18.1.1.orig/src/xditview/xditview.c ++++ groff-1.18.1.1/src/xditview/xditview.c +@@ -46,6 +46,7 @@ + #include + #include + ++#include + #include + + #include "Dvi.h" +@@ -101,7 +102,7 @@ + * Report the syntax for calling xditview. + */ + +-static ++static void + Syntax(call) + char *call; + { +@@ -126,12 +127,12 @@ + char *name; + void (*function)(); + } menuEntries[] = { +- "nextPage", NextPage, +- "previousPage", PreviousPage, +- "selectPage", SelectPage, +- "print", Print, +- "openFile", OpenFile, +- "quit", Quit, ++ {"nextPage", NextPage}, ++ {"previousPage",PreviousPage}, ++ {"selectPage", SelectPage}, ++ {"print", Print}, ++ {"openFile", OpenFile}, ++ {"quit", Quit}, + }; + + static void NextPageAction(), PreviousPageAction(), SelectPageAction(); +@@ -139,17 +140,18 @@ + static void AcceptAction(), CancelAction(); + static void PrintAction(); + static void RerasterizeAction(); ++static void MakePrompt(); + + XtActionsRec xditview_actions[] = { +- "NextPage", NextPageAction, +- "PreviousPage", PreviousPageAction, +- "SelectPage", SelectPageAction, +- "Print", PrintAction, +- "OpenFile", OpenFileAction, +- "Rerasterize", RerasterizeAction, +- "Quit", QuitAction, +- "Accept", AcceptAction, +- "Cancel", CancelAction, ++ {"NextPage", NextPageAction}, ++ {"PreviousPage", PreviousPageAction}, ++ {"SelectPage", SelectPageAction}, ++ {"Print", PrintAction}, ++ {"OpenFile", OpenFileAction}, ++ {"Rerasterize", RerasterizeAction}, ++ {"Quit", QuitAction}, ++ {"Accept", AcceptAction}, ++ {"Cancel", CancelAction}, + }; + + #define MenuNextPage 0 +@@ -318,6 +320,7 @@ + + static char fileBuf[1024]; + ++static void + ResetMenuEntry (entry) + Widget entry; + { +@@ -516,6 +519,7 @@ + CancelAction (widget, event, params, num_params); + } + ++static void + MakePrompt(centerw, prompt, func, def) + Widget centerw; + char *prompt; +--- groff-1.18.1.1.orig/src/xditview/xtotroff.c ++++ groff-1.18.1.1/src/xditview/xtotroff.c +@@ -2,6 +2,7 @@ + * xtotroff + * + * convert X font metrics into troff font metrics ++ * XXX: ENABLE_MULTIBYTE may not work yet + */ + + #include +@@ -10,6 +11,7 @@ + #include + #include + #include ++#include "config.h" + #include "XFontName.h" + #include "DviChar.h" + +@@ -171,6 +173,47 @@ + fprintf (out, "spacewidth %d\n", w); + } + fprintf (out, "charset\n"); ++#if 0 /* def ENABLE_MULTIBYTE */ ++ if (fi->min_byte1 != 0 || fi->max_byte1 != 0) { ++ /* ++ * 2 byte code font. ++ */ ++ int N; ++ int D = fi->max_char_or_byte2 - fi->min_char_or_byte2 + 1; ++ int max = (fi->max_byte1 - fi->min_byte1 + 1) * ++ (fi->max_char_or_byte2 - fi->min_char_or_byte2 + 1); ++ unsigned byte1; ++ unsigned byte2; ++ unsigned int euc_code; ++ ++ for (N = 0; N < max; N++) { ++ byte1 = N / D + fi->min_byte1; ++ byte2 = N % D + fi->min_char_or_byte2; ++ euc_code = ((byte1 << 8) | byte2) & 0xffff | 0x8080; ++ wid = fi->max_bounds.width; ++ fputc(byte1 & 0xff | 0x80, out);/* output EUC code */ ++ fputc(byte2 & 0xff | 0x80, out);/* output EUC code */ ++ fprintf (out, "\t%d", wid); ++ if (groff_flag) { ++ int param[5]; ++ param[0] = fi->max_bounds.ascent; ++ param[1] = fi->max_bounds.descent; ++ param[2] = 0 /* charRBearing (fi, c) - wid */; ++ param[3] = 0 /* charLBearing (fi, c) */; ++ param[4] = 0; /* XXX */ ++ for (j = 0; j < 5; j++) ++ if (param[j] < 0) ++ param[j] = 0; ++ for (j = 4; j >= 0; j--) ++ if (param[j] != 0) ++ break; ++ for (k = 0; k <= j; k++) ++ fprintf (out, ",%d", param[k]); ++ } ++ fprintf (out, "\t0\t%#x\n", euc_code); ++ } ++ } else ++#endif /* ENABLE_MULTIBYTE */ + for (c = fi->min_char_or_byte2; c <= fi->max_char_or_byte2; c++) { + char *name = DviCharName (char_map,c,0); + if (charExists (fi, c) && (groff_flag || name)) { +--- groff-1.18.1.1.orig/src/xditview/DviChar.h ++++ groff-1.18.1.1/src/xditview/DviChar.h +@@ -10,6 +10,8 @@ + * CharSetRegistry from the CharSetEncoding + */ + ++#include "config.h" ++ + # define DVI_MAX_SYNONYMS 10 + # define DVI_MAP_SIZE 256 + # define DVI_HASH_SIZE 256 +@@ -23,6 +25,10 @@ + typedef struct _dviCharNameMap { + char *encoding; + int special; ++#ifdef ENABLE_MULTIBYTE ++ void (*char2XChar2b)(/* int c, XChar2b *xc */); ++ int (*char_index)(/* struct _dviCharNameMap *map, char *name */); ++#endif + char *dvi_names[DVI_MAP_SIZE][DVI_MAX_SYNONYMS]; + DviCharNameHash *buckets[DVI_HASH_SIZE]; + } DviCharNameMap; +--- groff-1.18.1.1.orig/src/xditview/draw.c ++++ groff-1.18.1.1/src/xditview/draw.c +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include "config.h" + + /* math.h on a Sequent doesn't define M_PI, apparently */ + #ifndef M_PI +@@ -17,6 +18,7 @@ + #endif + + #include "DviP.h" ++#include "encoding.h" /* XXX */ + + #define DeviceToX(dw, n) ((int)((n) * (dw)->dvi.scale_factor + .5)) + #define XPos(dw) (DeviceToX((dw), (dw)->dvi.state->x - \ +@@ -25,6 +27,10 @@ + + static int FakeCharacter(); + ++/* font.c */ ++extern int MaxFontPosition(); ++ ++void + HorizontalMove(dw, delta) + DviWidget dw; + int delta; +@@ -32,6 +38,7 @@ + dw->dvi.state->x += delta; + } + ++void + HorizontalGoto(dw, NewPosition) + DviWidget dw; + int NewPosition; +@@ -39,6 +46,7 @@ + dw->dvi.state->x = NewPosition; + } + ++void + VerticalMove(dw, delta) + DviWidget dw; + int delta; +@@ -46,6 +54,7 @@ + dw->dvi.state->y += delta; + } + ++void + VerticalGoto(dw, NewPosition) + DviWidget dw; + int NewPosition; +@@ -53,6 +62,7 @@ + dw->dvi.state->y = NewPosition; + } + ++void + AdjustCacheDeltas (dw) + DviWidget dw; + { +@@ -94,14 +104,21 @@ + } + } + ++void + FlushCharCache (dw) + DviWidget dw; + { + if (dw->dvi.cache.char_index != 0) { + AdjustCacheDeltas (dw); ++#ifdef ENABLE_MULTIBYTE ++ XDrawText16 (XtDisplay (dw), XtWindow (dw), dw->dvi.normal_GC, ++ dw->dvi.cache.start_x, dw->dvi.cache.start_y, ++ dw->dvi.cache.cache, dw->dvi.cache.index + 1); ++#else + XDrawText (XtDisplay (dw), XtWindow (dw), dw->dvi.normal_GC, + dw->dvi.cache.start_x, dw->dvi.cache.start_y, + dw->dvi.cache.cache, dw->dvi.cache.index + 1); ++#endif + } + dw->dvi.cache.index = 0; + dw->dvi.cache.max = DVI_TEXT_CACHE_SIZE; +@@ -115,6 +132,7 @@ + dw->dvi.cache.start_y = dw->dvi.cache.y = YPos (dw); + } + ++void + Newline (dw) + DviWidget dw; + { +@@ -123,6 +141,7 @@ + dw->dvi.word_flag = 0; + } + ++void + Word (dw) + DviWidget dw; + { +@@ -135,7 +154,6 @@ + :\ + (fi)->max_bounds.width\ + ) +- + + static + int charExists (fi, c) +@@ -152,14 +170,25 @@ + || p->ascent != 0 || p->descent != 0 || p->attributes != 0); + } + +-static ++static void ++#ifdef ENABLE_MULTIBYTE ++DoCharacter (dw, c, wid, char2xchar2b) ++#else + DoCharacter (dw, c, wid) ++#endif + DviWidget dw; + int c; + int wid; /* width in device units */ ++#ifdef ENABLE_MULTIBYTE ++ void (*char2xchar2b)(); ++#endif + { + register XFontStruct *font; ++#ifdef ENABLE_MULTIBYTE ++ register XTextItem16 *text; ++#else + register XTextItem *text; ++#endif + int x, y; + + x = XPos(dw); +@@ -225,9 +254,25 @@ + text->font = None; + dw->dvi.cache.x += text->delta; + } ++#ifdef ENABLE_MULTIBYTE ++ if (charExists(font, c) || char2xchar2b) { ++#else + if (charExists(font, c)) { ++#endif + int w; ++#ifdef ENABLE_MULTIBYTE ++ if (char2xchar2b) { ++ (*char2xchar2b)(c, ++ &dw->dvi.cache.char_cache[dw->dvi.cache.char_index++]); ++ } else { ++ dw->dvi.cache.char_cache[dw->dvi.cache.char_index]. ++ byte1 = (unsigned char)'\0'; ++ dw->dvi.cache.char_cache[dw->dvi.cache.char_index++]. ++ byte2 = (unsigned char)c; ++ } ++#else + dw->dvi.cache.char_cache[dw->dvi.cache.char_index++] = (char) c; ++#endif + ++text->nchars; + w = charWidth(font, c); + dw->dvi.cache.x += w; +@@ -291,7 +336,11 @@ + if (map) + c = DviCharIndex (map, buf); + if (c >= 0) ++#ifdef ENABLE_MULTIBYTE ++ DoCharacter (dw, c, wid, map->char2XChar2b); ++#else + DoCharacter (dw, c, wid); ++#endif + else + (void) FakeCharacter (dw, buf, wid); + dw->dvi.state->font_number = prevFont; +@@ -345,6 +394,7 @@ + return 1; + } + ++void + PutNumberedCharacter (dw, c) + DviWidget dw; + int c; +@@ -368,7 +418,11 @@ + dw->dvi.state->font_size, c, &wid)) + return; + if (dw->dvi.native) { ++#ifdef ENABLE_MULTIBYTE ++ DoCharacter (dw, c, wid, NULL); ++#else + DoCharacter (dw, c, wid); ++#endif + return; + } + map = QueryFontMap (dw, dw->dvi.state->font_number); +@@ -379,7 +433,11 @@ + name = device_name_for_code ((DeviceFont *)0, c)) { + int code = DviCharIndex (map, name); + if (code >= 0) { ++#ifdef ENABLE_MULTIBYTE ++ DoCharacter (dw, code, wid, map->char2XChar2b); ++#else + DoCharacter (dw, code, wid); ++#endif + break; + } + if (FakeCharacter (dw, name, wid)) +@@ -387,13 +445,14 @@ + } + } + ++void + ClearPage (dw) + DviWidget dw; + { + XClearWindow (XtDisplay (dw), XtWindow (dw)); + } + +-static ++static void + setGC (dw) + DviWidget dw; + { +@@ -417,7 +476,7 @@ + } + } + +-static ++static void + setFillGC (dw) + DviWidget dw; + { +@@ -444,6 +503,7 @@ + } + } + ++void + DrawLine (dw, x, y) + DviWidget dw; + int x, y; +@@ -459,6 +519,7 @@ + xp + DeviceToX (dw, x), yp + DeviceToX (dw, y)); + } + ++void + DrawCircle (dw, diam) + DviWidget dw; + int diam; +@@ -473,6 +534,7 @@ + d, d, 0, 64*360); + } + ++void + DrawFilledCircle (dw, diam) + DviWidget dw; + int diam; +@@ -490,6 +552,7 @@ + d, d, 0, 64*360); + } + ++void + DrawEllipse (dw, a, b) + DviWidget dw; + int a, b; +@@ -501,6 +564,7 @@ + DeviceToX (dw, a), DeviceToX (dw, b), 0, 64*360); + } + ++void + DrawFilledEllipse (dw, a, b) + DviWidget dw; + int a, b; +@@ -515,6 +579,7 @@ + DeviceToX (dw, a), DeviceToX (dw, b), 0, 64*360); + } + ++void + DrawArc (dw, x0, y0, x1, y1) + DviWidget dw; + int x0, y0, x1, y1; +@@ -541,6 +606,7 @@ + rad*2, rad*2, angle1, angle2); + } + ++void + DrawPolygon (dw, v, n) + DviWidget dw; + int *v; +@@ -572,7 +638,7 @@ + XtFree((char *)p); + } + +- ++void + DrawFilledPolygon (dw, v, n) + DviWidget dw; + int *v; +@@ -608,7 +674,7 @@ + + #define POINTS_MAX 10000 + +-static ++static void + appendPoint(points, pointi, x, y) + XPoint *points; + int *pointi; +@@ -623,7 +689,7 @@ + + #define FLATNESS 1 + +-static ++static void + flattenCurve(points, pointi, x2, y2, x3, y3, x4, y4) + XPoint *points; + int *pointi; +@@ -659,7 +725,7 @@ + } + } + +- ++void + DrawSpline (dw, v, n) + DviWidget dw; + int *v; +--- groff-1.18.1.1.orig/src/xditview/font.c ++++ groff-1.18.1.1/src/xditview/font.c +@@ -9,10 +9,16 @@ + #include + #include + #include ++#include + #include "DviP.h" + #include "XFontName.h" + +-static DisposeFontSizes(); ++static void DisposeFontSizes(); ++void DestroyFontMap(); ++ ++/* XFontName.c */ ++extern Bool XParseFontName(); ++extern Bool XFormatFontName(); + + static char * + savestr (s) +@@ -115,7 +121,7 @@ + # define SizePosition 8 + # define EncodingPosition 13 + +-static ++static int + ConvertFontNameToSize (n) + char *n; + { +@@ -191,7 +197,7 @@ + return sizes; + } + +-static ++static void + DisposeFontSizes (dw, fs) + DviWidget dw; + DviFontSizeList *fs; +@@ -263,6 +269,7 @@ + return f; + } + ++void + ForgetFonts (dw) + DviWidget dw; + { +@@ -322,6 +329,7 @@ + } + #endif + ++void + ParseFontMap (dw) + DviWidget dw; + { +@@ -357,6 +365,7 @@ + dw->dvi.font_map = fm; + } + ++void + DestroyFontMap (font_map) + DviFontMap *font_map; + { +@@ -374,6 +383,7 @@ + + /* ARGSUSED */ + ++void + SetFontPosition (dw, position, dvi_name, extra) + DviWidget dw; + int position; +--- groff-1.18.1.1.orig/src/roff/troff/charinfo.h ++++ groff-1.18.1.1/src/roff/troff/charinfo.h +@@ -29,9 +29,16 @@ + macro *mac; + unsigned char special_translation; + unsigned char hyphenation_code; ++#ifdef ENABLE_MULTIBYTE ++ unsigned short flags; ++#else + unsigned char flags; ++#endif + unsigned char ascii_code; + unsigned char asciify_code; ++#ifdef ENABLE_MULTIBYTE ++ wchar wchar_code; ++#endif + char not_found; + char transparent_translate; // non-zero means translation applies + // to transparent throughput +@@ -47,6 +54,11 @@ + OVERLAPS_VERTICALLY = 16, + TRANSPARENT = 32, + NUMBERED = 64 ++#ifdef ENABLE_MULTIBYTE ++ , ++ DONT_BREAK_BEFORE = 0x100, // 256, pre kinsoku ++ DONT_BREAK_AFTER = 0x200 // 512, post kinsoku ++#endif + }; + enum { + TRANSLATE_NONE, +@@ -74,7 +86,11 @@ + int get_translation_input(); + charinfo *get_translation(int = 0); + void set_translation(charinfo *, int, int); ++#ifdef ENABLE_MULTIBYTE ++ void set_flags(unsigned short); ++#else + void set_flags(unsigned char); ++#endif + void set_special_translation(int, int); + int get_special_translation(int = 0); + macro *set_macro(macro *, int = 0); +@@ -84,6 +100,12 @@ + int get_number(); + int numbered(); + int is_fallback(); ++#ifdef ENABLE_MULTIBYTE ++ wchar get_wchar_code(); ++ void set_wchar_code(wchar); ++ int cannot_break_before(); // pre kinsoku ++ int cannot_break_after(); // post kinsoku ++#endif + symbol *get_symbol(); + }; + +@@ -131,6 +153,18 @@ + return fallback; + } + ++#ifdef ENABLE_MULTIBYTE ++inline int charinfo::cannot_break_before() ++{ ++ return flags & DONT_BREAK_BEFORE; ++} ++ ++inline int charinfo::cannot_break_after() ++{ ++ return flags & DONT_BREAK_AFTER; ++} ++#endif ++ + inline charinfo *charinfo::get_translation(int transparent_throughput) + { + return (transparent_throughput && !transparent_translate +@@ -153,7 +187,18 @@ + return (translate_input ? asciify_code : 0); + } + ++#ifdef ENABLE_MULTIBYTE ++inline wchar charinfo::get_wchar_code() ++{ ++ return wchar_code; ++} ++#endif ++ ++#ifdef ENABLE_MULTIBYTE ++inline void charinfo::set_flags(unsigned short c) ++#else + inline void charinfo::set_flags(unsigned char c) ++#endif + { + flags = c; + } +--- groff-1.18.1.1.orig/src/roff/troff/troff.h ++++ groff-1.18.1.1/src/roff/troff/troff.h +@@ -28,6 +28,7 @@ + #include + #include + ++#include "encoding.h" + #include "assert.h" + #include "color.h" + #include "device.h" +--- groff-1.18.1.1.orig/src/roff/troff/env.cc ++++ groff-1.18.1.1/src/roff/troff/env.cc +@@ -32,6 +32,7 @@ + #include "charinfo.h" + #include "macropath.h" + #include "input.h" ++#include "font.h" // ENABLE_MULTIBYTE only? + #include + + symbol default_family("T"); +@@ -264,6 +265,13 @@ + void environment::add_char(charinfo *ci) + { + int s; ++#ifdef ENABLE_MULTIBYTE ++ int fontno = get_font(); // current font # ++ int fontset_font = get_fontset_fontno(fontno, ci->get_wchar_code()); ++ if (fontno >= 0 && fontno != fontset_font) { ++ change_curfont(fontset_font); ++ } ++#endif + if (interrupted) + ; + // don't allow fields in dummy environments +@@ -286,11 +294,95 @@ + else { + if (line == 0) + start_line(); ++#ifdef ENABLE_MULTIBYTE ++ /* ++ * XXX: NEED REWRITE TO BE MORE GENERIC ++ * This code is based on jgroff ++ * about kerning between ASCII and EUC-JP ++ */ ++ if (!ci->get_wchar_code()) { ++ /* ++ * This node is a ASCII character node. ++ */ ++ if (!pre_char_is_ascii && enable_wcharkern && !hwkern.is_zero()) { ++ /* ++ * Insert a little space node between EUC and ASCII. ++ */ ++ word_space_node *ws; ++ ++ if (ci->ends_sentence() || ci->transparent() || ci->cannot_break_before()) ++ ws = new unbreakable_space_node(hwkern.to_units(), get_fill_color()); ++ else ++ ws = new word_space_node(hwkern.to_units(), ++ get_fill_color(), ++ new width_list(env_space_width(this), ++ env_sentence_space_width(this))); ++ curenv->add_node(ws); ++ } ++ pre_char_is_ascii = 1; ++ pre_wchar_cannot_break_after = 0; ++ } else { ++ /* ++ * This node is a EUC charcater node. ++ */ ++ if (!pre_char_is_ascii && line->get_node_type() == NODE_NEWLINE_SPACE) { ++ /* ++ * remove a newline-node. ++ */ ++ node *ns_node = line; ++ line = line->next; ++ width_total -= ns_node->width(); ++ space_total -= ns_node->nspaces(); ++ delete ns_node; ++ } ++ ++ if (!pre_wchar_cannot_break_after && !ci->cannot_break_before()) { ++ /* ++ * add a zero-width-space-node before EUC charcater node. ++ */ ++ add_node(new kword_space_node(get_fill_color())); ++ met_with_kword_space = 1; ++ } ++ pre_wchar_cannot_break_after = ci->cannot_break_after(); ++ ++ if (pre_char_is_ascii && enable_wcharkern && !hwkern.is_zero()) { ++ /* ++ * Insert a little space node between ASCII and EUC. ++ */ ++ unbreakable_space_node *ws = ++ new unbreakable_space_node(hwkern.to_units(), get_fill_color()); ++ curenv->add_node(ws); ++ } ++ pre_char_is_ascii = 0; ++ ++ if (!vlower.is_zero()) { ++ /* ++ * Lower a EUC charcater node. ++ */ ++ curenv->add_node(new vmotion_node(vlower.to_units(), ++ get_fill_color())); // lower ++ } ++ } ++#endif + if (ci != hyphen_indicator_char) + line = line->add_char(ci, this, &width_total, &space_total); + else + line = line->add_discretionary_hyphen(); ++#ifdef ENABLE_MULTIBYTE ++ enable_wcharkern = 1; ++ if (!vlower.is_zero() && ci->get_wchar_code()) { ++ /* ++ * Raise a EUC charcater node. ++ */ ++ curenv->add_node(new vmotion_node(-vlower.to_units(), ++ get_fill_color())); // raise ++ } ++#endif + } ++#ifdef ENABLE_MULTIBYTE ++ if (fontset_font >= 0 && fontno != fontset_font) ++ change_curfont(fontno); /* restore saved font # */ ++#endif + } + + node *environment::make_char_node(charinfo *ci) +@@ -394,7 +486,11 @@ + width_total += x; + return; + } ++#ifdef ENABLE_MULTIBYTE ++ add_node(new newline_space_node(x, get_fill_color())); // This node may be removed ++#else + add_node(new word_space_node(x, get_fill_color(), w)); ++#endif + possibly_break_line(0, spread_flag); + spread_flag = 0; + } +@@ -480,6 +576,35 @@ + warning(WARN_FONT, "bad font number"); + } + ++#ifdef ENABLE_MULTIBYTE ++void environment::change_curfont(symbol nm) ++{ ++ int n = symbol_fontno(nm); ++ if (n < 0) { ++ n = next_available_font_position(); ++ if (!mount_font(n, nm)) ++ return; ++ } ++ fontno = n; ++} ++ ++void environment::change_curfont(int n) ++{ ++ if (is_good_fontno(n)) ++ fontno = n; ++ else ++ error("bad font number"); ++} ++ ++void environment::set_encoding(symbol enc) ++{ ++ if (enc.is_null() || enc.is_empty()) ++ return; ++ select_input_encoding_handler(enc.contents()); ++ select_output_encoding_handler(enc.contents()); ++} ++#endif /* ENABLE_MULTIBYTE */ ++ + void environment::set_family(symbol fam) + { + if (interrupted) +@@ -649,6 +774,16 @@ + control_char('.'), + no_break_control_char('\''), + hyphen_indicator_char(0) ++#ifdef ENABLE_MULTIBYTE ++ , ++ stretch_threshold(0), ++ pre_wchar_cannot_break_after(0), ++ pre_char_is_ascii(-1), ++ enable_wcharkern(0), ++ met_with_kword_space(0), ++ hwkern(font::wcharkern), ++ vlower(font::lowerwchar) ++#endif + { + prev_family = family = lookup_family(default_family); + prev_fontno = fontno = 1; +@@ -739,6 +874,16 @@ + control_char(e->control_char), + no_break_control_char(e->no_break_control_char), + hyphen_indicator_char(e->hyphen_indicator_char) ++#ifdef ENABLE_MULTIBYTE ++ , ++ stretch_threshold(e->stretch_threshold), ++ pre_wchar_cannot_break_after(0), ++ pre_char_is_ascii(-1), ++ enable_wcharkern(0), ++ met_with_kword_space(0), ++ hwkern(font::wcharkern), ++ vlower(font::lowerwchar) ++#endif + { + } + +@@ -1781,6 +1926,9 @@ + target_text_length = line_length - saved_indent; + width_total = H0; + space_total = 0; ++#ifdef ENABLE_MULTIBYTE ++ enable_wcharkern = 0; ++#endif + } + + hunits environment::get_hyphenation_space() +@@ -1819,6 +1967,23 @@ + skip_line(); + } + ++#ifdef ENABLE_MULTIBYTE ++void stretch_threshold_request() ++{ ++ int n; ++ if (has_arg() && get_integer(&n)) { ++ if (n < 0 || n > 100) { ++ warning(WARN_RANGE, "stretch threshold value %1 out of range", n); ++ } else { ++ curenv->stretch_threshold = n; ++ } ++ } else { ++ curenv->stretch_threshold = 0; ++ } ++ skip_line(); ++} ++#endif ++ + breakpoint *environment::choose_breakpoint() + { + hunits x = width_total; +@@ -2014,6 +2179,30 @@ + // When a macro follows a paragraph in fill mode, the + // current line should not be empty. + || (width_total - line->width()) > target_text_length)) { ++#ifdef ENABLE_MULTIBYTE ++ if (met_with_kword_space) { ++ node *linep = line; ++ node *prep = 0; ++ while (linep->next) { ++ if (linep->next->get_node_type() == NODE_GLYPH) ++ prep = 0; ++ else if (linep->next->get_node_type() == NODE_KWORD_SPACE) ++ prep = linep; ++ linep = linep->next; ++ } ++ if (prep) { ++ /* ++ * delete a kword_space_node which is in the top of line. ++ */ ++ linep = prep->next; ++ prep->next = linep->next; ++ width_total -= linep->width(); ++ space_total -= linep->nspaces(); ++ delete linep; ++ } ++ met_with_kword_space = 0; ++ } ++#endif + hyphenate_line(start_here); + breakpoint *bp = choose_breakpoint(); + if (bp == 0) +@@ -2026,6 +2215,15 @@ + bp->nd->split(bp->index, &pre, &post); + *ndp = post; + hunits extra_space_width = H0; ++#ifdef ENABLE_MULTIBYTE ++ int sv_adjust_mode = adjust_mode; ++ if (stretch_threshold) { ++ int ratio = bp->width * 100 / target_text_length; ++ if (ratio < stretch_threshold) { ++ adjust_mode = ADJUST_LEFT; ++ } ++ } ++#endif + switch(adjust_mode) { + case ADJUST_BOTH: + if (bp->nspaces != 0) +@@ -2041,6 +2239,9 @@ + saved_indent += target_text_length - bp->width; + break; + } ++#ifdef ENABLE_MULTIBYTE ++ adjust_mode = sv_adjust_mode; ++#endif + distribute_space(pre, bp->nspaces, extra_space_width); + hunits output_width = bp->width + extra_space_width; + input_line_start -= output_width; +@@ -3237,6 +3438,9 @@ + init_request("hys", hyphenation_space_request); + init_request("hym", hyphenation_margin_request); + init_request("pvs", post_vertical_spacing); ++#ifdef ENABLE_MULTIBYTE ++ init_request("stt", stretch_threshold_request); ++#endif + init_int_env_reg(".f", get_font); + init_int_env_reg(".b", get_bold); + init_hunits_env_reg(".i", get_indent); +--- groff-1.18.1.1.orig/src/roff/troff/node.h ++++ groff-1.18.1.1/src/roff/troff/node.h +@@ -20,6 +20,8 @@ + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + + ++#include "config.h" ++ + struct hyphen_list { + unsigned char hyphen; + unsigned char breakable; +@@ -31,6 +33,9 @@ + void hyphenate(hyphen_list *, unsigned); + + enum hyphenation_type { HYPHEN_MIDDLE, HYPHEN_BOUNDARY, HYPHEN_INHIBIT }; ++#ifdef ENABLE_MULTIBYTE ++enum node_type {NODE_GLYPH, NODE_KWORD_SPACE, NODE_NEWLINE_SPACE, NODE_ANOTHER}; ++#endif + + class ascii_output_file; + +@@ -106,6 +111,9 @@ + + virtual int same(node *) = 0; + virtual const char *type() = 0; ++#ifdef ENABLE_MULTIBYTE ++ virtual node_type get_node_type(); ++#endif + }; + + inline node::node() +@@ -212,6 +220,24 @@ + int force_tprint(); + }; + ++#ifdef ENABLE_MULTIBYTE ++class kword_space_node : public word_space_node { ++public: ++ kword_space_node(color *, node * = 0); ++ node *copy(); ++ const char *type(); ++ node_type get_node_type(); ++}; ++ ++class newline_space_node : public word_space_node { ++public: ++ newline_space_node(hunits, color *, node * = 0); ++ node *copy(); ++ const char *type(); ++ node_type get_node_type(); ++}; ++#endif ++ + class unbreakable_space_node : public word_space_node { + unbreakable_space_node(hunits, int, color *, node * = 0); + public: +@@ -538,6 +564,9 @@ + node *copy_node_list(node *); + + int get_bold_fontno(int f); ++#ifdef ENABLE_MULTIBYTE ++int get_fontset_fontno(int f, wchar wc); ++#endif + + inline hyphen_list::hyphen_list(unsigned char code, hyphen_list *p) + : hyphen(0), breakable(0), hyphenation_code(code), next(p) +@@ -595,3 +624,4 @@ + + font_family *lookup_family(symbol); + symbol get_font_name(int, environment *); ++ +--- groff-1.18.1.1.orig/src/roff/troff/env.h ++++ groff-1.18.1.1/src/roff/troff/env.h +@@ -213,6 +213,15 @@ + unsigned char control_char; + unsigned char no_break_control_char; + charinfo *hyphen_indicator_char; ++#ifdef ENABLE_MULTIBYTE ++ int stretch_threshold; ++ int pre_wchar_cannot_break_after; ++ int pre_char_is_ascii; ++ int enable_wcharkern; ++ int met_with_kword_space; ++ hunits hwkern; ++ vunits vlower; ++#endif + + environment(symbol); + environment(const environment *); // for temporary environment +@@ -279,6 +288,10 @@ + void wrap_up_tab(); + void set_font(int); + void set_font(symbol); ++#ifdef ENABLE_MULTIBYTE ++ void change_curfont(int); ++ void change_curfont(symbol); ++#endif + void set_family(symbol); + void set_size(int); + void set_char_height(int); +@@ -309,6 +322,9 @@ + const char *get_point_size_string(); + const char *get_requested_point_size_string(); + void output_pending_lines(); ++#ifdef ENABLE_MULTIBYTE ++ void set_encoding(symbol); ++#endif + + friend void title_length(); + friend void space_size(); +@@ -347,6 +363,9 @@ + #ifdef WIDOW_CONTROL + friend void widow_control_request(); + #endif /* WIDOW_CONTROL */ ++#ifdef ENABLE_MULTIBYTE ++ friend void stretch_threshold_request(); ++#endif + + friend void do_divert(int append, int boxing); + }; +--- groff-1.18.1.1.orig/src/roff/troff/input.cc ++++ groff-1.18.1.1/src/roff/troff/input.cc +@@ -35,6 +35,7 @@ + #include "macropath.h" + #include "defs.h" + #include "input.h" ++#include "encoding.h" // XXX: ukai + + // Needed for getpid() and isatty() + #include "posix.h" +@@ -89,6 +90,11 @@ + charinfo *charset_table[256]; + unsigned char hpf_code_table[256]; + ++#ifdef ENABLE_MULTIBYTE ++charinfo *wcharset_table_entry(wchar wc); ++ ++#endif /* ENABLE_MULTIBYTE */ ++ + static int warning_mask = DEFAULT_WARNING_MASK; + static int inhibit_errors = 0; + static int ignoring = 0; +@@ -148,6 +154,20 @@ + input_iterator *make_temp_iterator(const char *); + const char *input_char_description(int); + ++#ifdef ENABLE_MULTIBYTE ++static void ++select_encoding() ++{ ++ symbol e = get_long_name(1); ++ if (e.is_null()) { ++ skip_line(); ++ return; ++ } ++ curenv->set_encoding(e); ++ skip_line(); ++ ++} ++#endif + + void set_escape_char() + { +@@ -1524,6 +1544,19 @@ + type = TOKEN_NEWLINE; + } + ++#ifdef ENABLE_MULTIBYTE ++class encoding_istream_input : public encoding_istream { ++private: ++ node **np; ++public: ++ encoding_istream_input(node **n) : np(n) {}; ++ ~encoding_istream_input() {}; ++ int getbyte() { return input_stack::get(np); }; ++ int peekbyte() { return input_stack::peek(); }; ++ void ungetbyte(int ch) { return; }; ++}; ++#endif ++ + void token::next() + { + if (nd) { +@@ -1533,6 +1566,10 @@ + units x; + for (;;) { + node *n; ++#ifdef ENABLE_MULTIBYTE ++ encoding_istream_input einput(&n); ++#endif ++ + int cc = input_stack::get(&n); + if (cc != escape_char || escape_char == 0) { + handle_normal_char: +@@ -1686,8 +1723,22 @@ + } + return; + default: ++#ifdef ENABLE_MULTIBYTE ++ wc = input_encoding->make_wchar(cc, einput); ++ if (is_wchar_code(wc)) { ++ type = TOKEN_WCHAR; ++ c = 0; ++ } else if (wc == ' ') { ++ type = TOKEN_SPACE; ++ c = cc; ++ } else { ++ type = TOKEN_CHAR; ++ c = cc; ++ } ++#else + type = TOKEN_CHAR; + c = cc; ++#endif + return; + } + } +@@ -2057,6 +2108,10 @@ + switch(type) { + case TOKEN_CHAR: + return c == t.c; ++#ifdef ENABLE_MULTIBYTE ++ case TOKEN_WCHAR: ++ return wc == t.wc; ++#endif + case TOKEN_SPECIAL: + return nm == t.nm; + case TOKEN_NUMBERED_CHAR: +@@ -2563,6 +2618,27 @@ + } + break; + } ++#ifdef ENABLE_MULTIBYTE ++ case token::TOKEN_WCHAR: ++ { ++ wchar wch = tok.wc; ++ ++ if (possibly_handle_first_page_transition()) ++ ; ++ else { ++ for (;;) { ++ curenv->add_char(wcharset_table_entry(wch)); ++ tok.next(); ++ if (tok.type != token::TOKEN_WCHAR) ++ break; ++ wch = tok.wc; ++ } ++ suppress_next = 1; ++ bol = 0; ++ } ++ break; ++ } ++#endif /* ENABLE_MULTIBYTE */ + case token::TOKEN_TRANSPARENT: + { + if (bol) { +@@ -6018,6 +6094,10 @@ + { + if (type == TOKEN_CHAR) + return charset_table[c]; ++#ifdef ENABLE_MULTIBYTE ++ if (type == TOKEN_WCHAR) ++ return wcharset_table_entry(wc); ++#endif + if (type == TOKEN_SPECIAL) + return get_charinfo(nm); + if (type == TOKEN_NUMBERED_CHAR) +@@ -6070,6 +6150,11 @@ + case TOKEN_CHAR: + *pp = (*pp)->add_char(charset_table[c], curenv, &w, &s); + break; ++#ifdef ENABLE_MULTIBYTE ++ case TOKEN_WCHAR: ++ *pp = (*pp)->add_char(wcharset_table_entry(wc), curenv, &w, &s); ++ break; ++#endif + case TOKEN_DUMMY: + n = new dummy_node; + break; +@@ -6142,6 +6227,11 @@ + case TOKEN_CHAR: + curenv->add_char(charset_table[c]); + break; ++#ifdef ENABLE_MULTIBYTE ++ case TOKEN_WCHAR: ++ curenv->add_char(wcharset_table_entry(wc)); ++ break; ++#endif + case TOKEN_DUMMY: + curenv->add_node(new dummy_node); + break; +@@ -6900,6 +6990,7 @@ + if (!safer_flag) + mac_path = ¯o_path; + set_string(".T", device); ++ init_encoding_handler(); + init_charset_table(); + init_hpf_code_table(); + if (!font::load_desc()) +@@ -6924,6 +7015,9 @@ + // In the DESC file a font name of 0 (zero) means leave this + // position empty. + if (strcmp(font::font_name_table[i], "0") != 0) ++#ifdef ENABLE_MULTIBYTE ++ if (!font::is_on_demand(i)) ++#endif + mount_font(j, symbol(font::font_name_table[i])); + curdiv = topdiv = new top_level_diversion; + if (nflag) +@@ -7081,6 +7175,9 @@ + init_request("ecs", save_escape_char); + init_request("el", else_request); + init_request("em", end_macro); ++#ifdef ENABLE_MULTIBYTE ++ init_request("encoding", select_encoding); ++#endif + init_request("eo", escape_off); + init_request("ex", exit_request); + init_request("fchar", define_fallback_character); +@@ -7533,12 +7630,92 @@ + + dictionary charinfo_dictionary(501); + ++#ifdef ENABLE_MULTIBYTE ++struct charinfo_list { ++ struct charinfo_list *next; ++ charinfo *ci; ++} *wcharset_table = NULL; ++ ++/* XXX: use more efficient method? */ ++static charinfo* ++lookup_wcharset_table(wchar wc) ++{ ++ struct charinfo_list *cl; ++ for (cl = wcharset_table; cl; cl = cl->next) { ++ if (cl->ci && cl->ci->get_wchar_code() == wc) ++ return cl->ci; ++ } ++ return NULL; ++} ++ ++static void ++add_wcharset_table(charinfo *ci) ++{ ++ struct charinfo_list *cl = new struct charinfo_list; ++ cl->next = wcharset_table; ++ cl->ci = ci; ++ wcharset_table = cl; ++} ++ ++charinfo *wcharset_table_entry(wchar wc) ++{ ++ if (! is_wchar_code(wc)) ++ return NULL; ++ charinfo *cp = lookup_wcharset_table(wc); ++ if (cp == NULL) { ++ int i = wchar_code(wc); ++ char buf[16]; ++ if (i > 0x100) ++ sprintf(buf, "u%04X", i); ++ else { ++ cp = get_charinfo_by_number(i); ++ if (cp != NULL) ++ return cp; ++ sprintf(buf, "char%d", i); // ??? ++ } ++ symbol nm = symbol(buf); ++ cp = new charinfo(nm); ++ (void)charinfo_dictionary.lookup(nm, cp); ++ cp->set_wchar_code(wc); ++ add_wcharset_table(cp); ++ } ++ return cp; ++} ++ ++static charinfo * ++wchar_charinfo(symbol nm) ++{ ++ const char *p = nm.contents(); ++ if (*p != 'u') { ++ return NULL; ++ } ++ char *pp; ++ wchar wc = make_wchar(strtol(p + 1, &pp, 16)); ++ if (pp < p + 5) ++ return NULL; ++ charinfo *cp = lookup_wcharset_table(wc); ++ if (cp) ++ return cp; ++ /* create on demand */ ++ cp = new charinfo(nm); ++ cp->set_wchar_code(wc); ++ add_wcharset_table(cp); ++ return cp; ++} ++#endif ++ + charinfo *get_charinfo(symbol nm) + { + void *p = charinfo_dictionary.lookup(nm); + if (p != 0) + return (charinfo *)p; ++#ifdef ENABLE_MULTIBYTE ++ charinfo *cp = wchar_charinfo(nm); ++ if (cp == NULL) ++ cp = new charinfo(nm); ++#else + charinfo *cp = new charinfo(nm); ++#endif + (void)charinfo_dictionary.lookup(nm, cp); + return cp; + } +@@ -7548,6 +7725,9 @@ + charinfo::charinfo(symbol s) + : translation(0), mac(0), special_translation(TRANSLATE_NONE), + hyphenation_code(0), flags(0), ascii_code(0), asciify_code(0), ++#ifdef ENABLE_MULTIBYTE ++ wchar_code(0), ++#endif + not_found(0), transparent_translate(1), translate_input(0), + fallback(0), nm(s) + { +@@ -7592,6 +7772,14 @@ + asciify_code = c; + } + ++#ifdef ENABLE_MULTIBYTE ++void charinfo::set_wchar_code(wchar wc) ++{ ++ wchar_code = wc; ++ index = wc; /* XXX: wchar code == index */ ++} ++#endif ++ + macro *charinfo::set_macro(macro *m, int f) + { + macro *tem = mac; +@@ -7647,6 +7835,13 @@ + int font::name_to_index(const char *nm) + { + charinfo *ci; ++#ifdef ENABLE_MULTIBYTE ++ int i = 1; ++ wchar wc = input_encoding->make_wchar(nm[0], (const unsigned char *)nm, &i); ++ if (is_wchar_code(wc)) { ++ ci = wcharset_table_entry(wc); ++ } else ++#endif + if (nm[1] == 0) + ci = charset_table[nm[0] & 0xff]; + else if (nm[0] == '\\' && nm[2] == 0) +@@ -7663,3 +7858,10 @@ + { + return get_charinfo_by_number(n)->get_index(); + } ++ ++#ifdef ENABLE_MULTIBYTE ++int font::wchar_index(wchar wc) ++{ ++ return(wcharset_table_entry(wc)->get_index()); ++} ++#endif +--- groff-1.18.1.1.orig/src/roff/troff/token.h ++++ groff-1.18.1.1/src/roff/troff/token.h +@@ -28,12 +28,18 @@ + symbol nm; + node *nd; + unsigned char c; ++#ifdef ENABLE_MULTIBYTE ++ wchar wc; ++#endif + int val; + units dim; + enum token_type { + TOKEN_BACKSPACE, + TOKEN_BEGIN_TRAP, + TOKEN_CHAR, // a normal printing character ++#ifdef ENABLE_MULTIBYTE ++ TOKEN_WCHAR, // a multibyte character ++#endif + TOKEN_DUMMY, // \& + TOKEN_EMPTY, // this is the initial value + TOKEN_END_TRAP, +--- groff-1.18.1.1.orig/src/roff/troff/troff.man ++++ groff-1.18.1.1/src/roff/troff/troff.man +@@ -22,6 +22,10 @@ + A copy of the Free Documentation License is included as a file called + FDL in the main directory of the groff source package. + .. ++.ig ++A copy of the GNU Free Documentation License is also available in this ++Debian package as /usr/share/doc/groff-base/copyright. ++.. + . + . + .\" -------------------------------------------------------------------- +--- groff-1.18.1.1.orig/src/roff/troff/node.cc ++++ groff-1.18.1.1/src/roff/troff/node.cc +@@ -38,6 +38,7 @@ + #include "input.h" + #include "div.h" + #include "geometry.h" ++#include "encoding.h" + + #include "nonposix.h" + +@@ -745,8 +746,15 @@ + int current_font_number; + symbol *font_position; + int nfont_positions; ++#ifdef ENABLE_MULTIBYTE ++ const char *current_encoding; ++#endif + enum { TBUF_SIZE = 256 }; ++#ifdef ENABLE_MULTIBYTE ++ wchar tbuf[TBUF_SIZE]; ++#else + char tbuf[TBUF_SIZE]; ++#endif + int tbuf_len; + int tbuf_kern; + int begun_page; +@@ -756,6 +764,9 @@ + void put(int i); + void put(unsigned int i); + void put(const char *s); ++#ifdef ENABLE_MULTIBYTE ++ void putw(const wchar wc); ++#endif + void set_font(tfont *tf); + void flush_tbuf(); + public: +@@ -799,6 +810,13 @@ + putc(c, fp); + } + ++#ifdef ENABLE_MULTIBYTE ++inline void troff_output_file::putw(wchar wc) ++{ ++ output_encoding->put_wchar(wc, fp); ++} ++#endif ++ + inline void troff_output_file::put(unsigned char c) + { + putc(c, fp); +@@ -956,7 +974,11 @@ + check_output_limits(hpos, vpos - current_size); + + for (int i = 0; i < tbuf_len; i++) ++#ifdef ENABLE_MULTIBYTE ++ putw(tbuf[i]); ++#else + put(tbuf[i]); ++#endif + put('\n'); + tbuf_len = 0; + } +@@ -988,7 +1010,13 @@ + flush_tbuf(); + set_font(tf); + } ++#ifdef ENABLE_MULTIBYTE ++ wchar c = ci->get_wchar_code(); ++ if (c == '\0') ++ c = ci->get_ascii_code(); ++#else + char c = ci->get_ascii_code(); ++#endif + if (c == '\0') { + flush_tbuf(); + do_motion(); +@@ -1014,7 +1042,8 @@ + } + else if (tcommand_flag) { + if (tbuf_len > 0 && hpos == output_hpos && vpos == output_vpos +- && gcol == current_glyph_color && fcol == current_fill_color ++ && (!gcol || gcol == current_glyph_color) ++ && (!fcol || fcol == current_fill_color) + && kk == tbuf_kern + && tbuf_len < TBUF_SIZE) { + check_charinfo(tf, ci); +@@ -1039,17 +1068,26 @@ + check_charinfo(tf, ci); + // check_output_limits(output_hpos, output_vpos); + if (vpos == output_vpos +- && gcol == current_glyph_color && fcol == current_fill_color ++ && (!gcol || gcol == current_glyph_color) ++ && (!fcol || fcol == current_fill_color) + && n > 0 && n < 100 && !force_motion) { + put(char(n/10 + '0')); + put(char(n%10 + '0')); ++#ifdef ENABLE_MULTIBYTE ++ putw(c); ++#else + put(c); ++#endif + output_hpos = hpos; + } + else { + do_motion(); + put('c'); ++#ifdef ENABLE_MULTIBYTE ++ putw(c); ++#else + put(c); ++#endif + } + hpos += w.to_units() + kk; + } +@@ -1063,7 +1101,13 @@ + return; + if (tf != current_tfont) + set_font(tf); ++#ifdef ENABLE_MULTIBYTE ++ wchar c = ci->get_wchar_code(); ++ if (c == '\0') ++ c = ci->get_ascii_code(); ++#else + char c = ci->get_ascii_code(); ++#endif + if (c == '\0') { + do_motion(); + glyph_color(gcol); +@@ -1087,11 +1131,16 @@ + else { + int n = hpos - output_hpos; + if (vpos == output_vpos +- && gcol == current_glyph_color && fcol == current_fill_color ++ && (!gcol || gcol == current_glyph_color) ++ && (!fcol || fcol == current_fill_color) + && n > 0 && n < 100) { + put(char(n/10 + '0')); + put(char(n%10 + '0')); ++#ifdef ENABLE_MULTIBYTE ++ putw(c); ++#else + put(c); ++#endif + output_hpos = hpos; + } + else { +@@ -1099,13 +1148,26 @@ + glyph_color(gcol); + fill_color(fcol); + put('c'); ++#ifdef ENABLE_MULTIBYTE ++ putw(c); ++#else + put(c); ++#endif + } + } + } + + void troff_output_file::set_font(tfont *tf) + { ++#ifdef ENABLE_MULTIBYTE ++ /* XXX */ ++ if (current_encoding != output_encoding->name()) { ++ put("x encoding "); ++ put(output_encoding->name()); ++ put('\n'); ++ current_encoding = output_encoding->name(); ++ } ++#endif + if (current_tfont == tf) + return; + int n = tf->get_input_position(); +@@ -1162,7 +1224,7 @@ + + void troff_output_file::fill_color(color *col) + { +- if ((current_fill_color == col) || !color_flag) ++ if (!col || current_fill_color == col || !color_flag) + return; + flush_tbuf(); + put("DF"); +@@ -1210,7 +1272,7 @@ + + void troff_output_file::glyph_color(color *col) + { +- if ((current_glyph_color == col) || !color_flag) ++ if (!col || current_glyph_color == col || !color_flag) + return; + flush_tbuf(); + put("m"); +@@ -1497,7 +1559,17 @@ + put(' '); + put(vresolution); + put('\n'); ++#ifdef ENABLE_MULTIBYTE ++ current_encoding = output_encoding->name(); ++ put("x init"); ++ if (current_encoding && *current_encoding != '\0') { ++ put(' '); ++ put(current_encoding); ++ } ++ put('\n'); ++#else + put("x init\n"); ++#endif + } + + /* output_file */ +@@ -1777,6 +1849,9 @@ + int same(node *); + const char *type(); + int force_tprint(); ++#ifdef ENABLE_MULTIBYTE ++ node_type get_node_type(); ++#endif + }; + + glyph_node *glyph_node::free_list = 0; +@@ -1802,6 +1877,9 @@ + int same(node *); + const char *type(); + int force_tprint(); ++#ifdef ENABLE_MULTIBYTE ++ node_type get_node_type(); ++#endif + }; + + class kern_pair_node : public node { +@@ -5225,6 +5303,55 @@ + return 0; + } + ++#ifdef ENABLE_MULTIBYTE ++kword_space_node::kword_space_node(color *c, node *x) : word_space_node(0, c, new width_list(0, 0), x) ++{} ++ ++node *kword_space_node::copy() ++{ ++ return new kword_space_node(col); ++} ++newline_space_node::newline_space_node(hunits d, color *c, node *x) : word_space_node(d, c, new width_list(0, 0), x) ++{} ++ ++node *newline_space_node::copy() ++{ ++ return new newline_space_node(n, col); ++} ++ ++const char *kword_space_node::type() ++{ ++ return "kword_space_node"; ++} ++const char *newline_space_node::type() ++{ ++ return "newline_space_node"; ++} ++ ++node_type node::get_node_type() ++{ ++ return NODE_ANOTHER; ++} ++node_type glyph_node::get_node_type() ++{ ++ return NODE_GLYPH; ++} ++ ++node_type ligature_node::get_node_type() ++{ ++ return NODE_ANOTHER; ++} ++ ++node_type kword_space_node::get_node_type() ++{ ++ return NODE_KWORD_SPACE; ++} ++node_type newline_space_node::get_node_type() ++{ ++ return NODE_NEWLINE_SPACE; ++} ++#endif ++ + int unbreakable_space_node::same(node *nd) + { + return n == ((unbreakable_space_node *)nd)->n +@@ -5625,6 +5752,28 @@ + return 0; + } + ++#ifdef ENABLE_MULTIBYTE ++int get_fontset_fontno(int n, wchar wc) ++{ ++ if (n >= 0 && n < font_table_size && font_table[n] != 0) { ++ /* XXX: external_name should be used? */ ++ int fn = font::get_fontset_font(font_table[n]->get_name().contents(), wc); ++ if (fn >= 0) { ++ symbol nm(font::font_name_table[fn]); ++ int nn = symbol_fontno(nm); ++ if (nn < 0) { ++ nn = next_available_font_position(); ++ if (!mount_font(nn, nm)) { ++ return -1; /* XXX */ ++ } ++ } ++ return nn; ++ } ++ } ++ return n; ++} ++#endif ++ + hunits env_digit_width(environment *env) + { + node *n = make_glyph_node(charset_table['0'], env); +--- groff-1.18.1.1.orig/src/roff/nroff/nroff.sh ++++ groff-1.18.1.1/src/roff/nroff/nroff.sh +@@ -12,6 +12,8 @@ + T=-Tlatin1 ;; + IBM-1047) + T=-Tcp1047 ;; ++ EUC-JP) ++ T=-Tnippon ;; + *) + case "${LC_ALL-${LC_CTYPE-${LANG}}}" in + *.UTF-8) +@@ -20,6 +22,8 @@ + T=-Tlatin1 ;; + *.IBM-1047) + T=-Tcp1047 ;; ++ ja_JP.ujis | ja_JP.eucJP) ++ T=-Tnippon ;; + *) + case "$LESSCHARSET" in + utf-8) +@@ -28,8 +32,10 @@ + T=-Tlatin1 ;; + cp1047) + T=-Tcp1047 ;; ++ japanese) ++ T=-Tnippon ;; + *) +- T=-Tascii ;; ++ T=-Tascii8 ;; + esac ;; + esac ;; + esac +@@ -52,7 +58,7 @@ + exit 1 ;; + -[iptSUC] | -[mrno]*) + opts="$opts $1" ;; +- -Tascii | -Tlatin1 | -Tutf8 | -Tcp1047) ++ -Tascii | -Tlatin1 | -Tutf8 | -Tcp1047 | -Tascii8 | -Tnippon) + T=$1 ;; + -T*) + # ignore other devices +--- groff-1.18.1.1.orig/src/roff/nroff/nroff.man ++++ groff-1.18.1.1/src/roff/nroff/nroff.man +@@ -53,8 +53,10 @@ + command using groff. + Only + .BR ascii , ++.BR ascii8 , + .BR latin1 , + .BR utf8 , ++.BR nippon , + and + .B cp1047 + are valid arguments for the +--- groff-1.18.1.1.orig/src/roff/groff/groff.cc ++++ groff-1.18.1.1/src/roff/groff/groff.cc +@@ -107,6 +107,7 @@ + program_name = argv[0]; + static char stderr_buf[BUFSIZ]; + setbuf(stderr, stderr_buf); ++ init_encoding_handler(); + assert(NCOMMANDS <= MAX_COMMANDS); + string Pargs, Largs, Fargs; + int vflag = 0; +--- groff-1.18.1.1.orig/src/roff/groff/groff.man ++++ groff-1.18.1.1/src/roff/groff/groff.man +@@ -15,6 +15,10 @@ + A copy of the Free Documentation License is included as a file called + FDL in the main directory of the groff source package. + .. ++.ig ++A copy of the GNU Free Documentation License is also available in this ++Debian package as /usr/share/doc/groff-base/copyright. ++.. + . + .\" -------------------------------------------------------------------- + .\" Setup +@@ -118,7 +122,7 @@ + .c -------------------------------------------------------------------- + .c ShortOpt ([char [punct]]) + .c +-.c `-c' somwhere in the text ++.c `-c' somewhere in the text + .c second arg is punctuation + .c + .de ShortOpt +@@ -130,7 +134,7 @@ + .c -------------------------------------------------------------------- + .c LongOpt ([name [punct]]) + .c +-.c `--name' somwhere in the text ++.c `--name' somewhere in the text + .c second arg is punctuation + .c + .de LongOpt +@@ -314,7 +318,7 @@ + .B groff + program allows to control the whole + .I groff +-system by comand line options. ++system by command line options. + . + This is a great simplification in comparison to the classical case (which + uses pipes only). +@@ -610,7 +614,7 @@ + . + . + .\" -------------------------------------------------------------------- +-.SS Tranparent Options ++.SS Transparent Options + .\" -------------------------------------------------------------------- + . + The following options are transparently handed over to the formatter +@@ -695,7 +699,7 @@ + is much easier than + .IR "classical roff" . + . +-This section gives an overview of the parts that consitute the groff ++This section gives an overview of the parts that constitute the groff + system. + . + It complements +@@ -948,6 +952,10 @@ + Text output using the EBCDIC code page IBM cp1047 (e.g. OS/390 Unix). + . + .TP ++.B nippon ++Text output using the Japanese-EUC character set. ++. ++.TP + .B dvi + TeX DVI format. + . +@@ -956,6 +964,12 @@ + HTML output. + . + .TP ++.B ascii8 ++For typewriter-like devices. Unlike ++.BR ascii , ++this device is 8 bit clean. This device is intended to be used ++for codesets other than ASCII and ISO-8859-1. ++.TP + .B latin1 + Text output using the ISO Latin-1 (ISO 8859-1) character set; see + .BR iso_8859_1 (7). +@@ -1031,7 +1045,7 @@ + . + .P + Today, most printing or drawing hardware is handled by the operating +-system, by device drivers, or by software interfaces, usally accepting ++system, by device drivers, or by software interfaces, usually accepting + PostScript. + . + Consequently, there isn't an urgent need for more hardware device +--- groff-1.18.1.1.orig/font/devX75/DESC ++++ groff-1.18.1.1/font/devX75/DESC +@@ -1,5 +1,17 @@ + styles R I B BI +-fonts 6 0 0 0 0 0 S ++fonts 8 0 0 0 0 0 S M G ++fontset B G 2E00..9FFF ++fontset CB G 2E00..9FFF ++fontset HB G 2E00..9FFF ++fontset NB G 2E00..9FFF ++fontset TB G 2E00..9FFF ++fontset - M 2E00..9FFF ++fontset B G FF00..FFEF ++fontset CB G FF00..FFEF ++fontset HB G FF00..FFEF ++fontset NB G FF00..FFEF ++fontset TB G FF00..FFEF ++fontset - M FF00..FFEF + sizes 8 10 12 14 18 24 0 + res 75 + X11 +--- groff-1.18.1.1.orig/font/devX75/M.proto ++++ groff-1.18.1.1/font/devX75/M.proto +@@ -0,0 +1,6 @@ ++name M ++spacewidth 2 ++charset ++u2E00..u9FFF 10 0 ++uFF00..uFFEF 10 0 ++ +--- groff-1.18.1.1.orig/font/devX75/Makefile.sub ++++ groff-1.18.1.1/font/devX75/Makefile.sub +@@ -1,2 +1,13 @@ + DEV=X75 +-DEVFILES=DESC TR TI TB TBI CR CI CB CBI HR HI HB HBI NR NI NB NBI S ++DEVFILES=DESC TR TI TB TBI CR CI CB CBI HR HI HB HBI NR NI NB NBI S M G ++CLEANADD=M G ++ ++M: M.proto ++ @echo Making M ++ @-rm -f M ++ @cat $(srcdir)/M.proto > M ++ ++G: M ++ @echo Making G ++ @-rm -f G ++ @sed -e 's/name M/name G/' M > G +--- groff-1.18.1.1.orig/font/devlbp/Makefile.sub ++++ groff-1.18.1.1/font/devlbp/Makefile.sub +@@ -13,9 +13,9 @@ + -rm -f DESC + cat $(srcdir)/DESC.in >>DESC + if test "$(PAGE)" = A4; then \ +- echo "papersize a4" >>DESC; \ ++ echo "papersize /etc/papersize a4" >>DESC; \ + else \ +- echo "papersize letter" >>DESC; \ ++ echo "papersize /etc/papersize letter" >>DESC; \ + fi + test -z '$(LBPPRINT)' || echo print '$(LBPPRINT)' >>DESC + +--- groff-1.18.1.1.orig/font/devascii/Makefile.sub ++++ groff-1.18.1.1/font/devascii/Makefile.sub +@@ -12,8 +12,8 @@ + @-rm -f $@ + @(charwidth=`expr $(RES) / $(CPI)` ; \ + sed -e "s/^name [A-Z]*$$/name $@/" \ +- -e "s/^\\([^ ]*\\) [0-9]+ /\\1 $$charwidth /" \ +- -e "s/^spacewidth [0-9]+$$/spacewidth $$charwidth/" \ ++ -e "s/^\\([^ ]*\\) [0-9][0-9]* /\\1 $$charwidth /" \ ++ -e "s/^spacewidth [0-9][0-9]*$$/spacewidth $$charwidth/" \ + -e "s/^internalname .*$$/internalname $@/" \ + -e "/^internalname/s/BI/3/" \ + -e "/^internalname/s/B/2/" \ +--- groff-1.18.1.1.orig/font/devascii8/Makefile.sub ++++ groff-1.18.1.1/font/devascii8/Makefile.sub +@@ -0,0 +1,31 @@ ++DEV=ascii8 ++FONTS=R I B BI ++DEVFILES=$(FONTS) DESC ++CLEANADD=$(FONTS) DESC ++ ++RES=240 ++CPI=10 ++LPI=6 ++ ++$(FONTS): R.proto ++ @echo Making $@ ++ @-rm -f $@ ++ @(charwidth=`expr $(RES) / $(CPI)` ; \ ++ sed -e "s/^name [A-Z]*$$/name $@/" \ ++ -e "s/^\\([^ ]*\\) [0-9][0-9]* /\\1 $$charwidth /" \ ++ -e "s/^spacewidth [0-9][0-9]*$$/spacewidth $$charwidth/" \ ++ -e "s/^internalname .*$$/internalname $@/" \ ++ -e "/^internalname/s/BI/3/" \ ++ -e "/^internalname/s/B/2/" \ ++ -e "/^internalname/s/I/1/" \ ++ -e "/^internalname .*[^ 0-9]/d" \ ++ $(srcdir)/R.proto >$@) ++ ++DESC: DESC.proto ++ @echo Making $@ ++ @-rm -f $@ ++ @sed -e "s/^res .*$$/res $(RES)/" \ ++ -e "s/^hor .*$$/hor `expr $(RES) / $(CPI)`/" \ ++ -e "s/^vert .*$$/vert `expr $(RES) / $(LPI)`/" \ ++ -e "s/^fonts .*$$/fonts `set $(FONTS); echo $$#` $(FONTS)/" \ ++ $(srcdir)/DESC.proto >$@ +--- groff-1.18.1.1.orig/font/devascii8/R.proto ++++ groff-1.18.1.1/font/devascii8/R.proto +@@ -0,0 +1,262 @@ ++name R ++internalname 0 ++spacewidth 24 ++charset ++! 24 0 0041 ++" 24 0 0042 ++dq " ++lq " ++rq " ++# 24 0 0043 ++sh " ++$ 24 0 0044 ++Do " ++% 24 0 0045 ++& 24 0 0046 ++' 24 0 0047 ++aa " ++fm " ++aq " ++cq " ++( 24 0 0050 ++) 24 0 0051 ++* 24 0 0052 ++** " +++ 24 0 0053 ++pl " ++, 24 0 0054 ++\- 24 0 0055 ++hy " ++- " ++mi " ++en " ++. 24 0 0056 ++/ 24 0 0057 ++sl " ++f/ " ++0 24 0 0060 ++1 24 0 0061 ++2 24 0 0062 ++3 24 0 0063 ++4 24 0 0064 ++5 24 0 0065 ++6 24 0 0066 ++7 24 0 0067 ++8 24 0 0070 ++9 24 0 0071 ++: 24 0 0072 ++; 24 0 0073 ++< 24 0 0074 ++la " ++fo " ++= 24 0 0075 ++eq " ++> 24 0 0076 ++ra " ++fc " ++? 24 0 0077 ++@ 24 0 0100 ++at " ++A 24 0 0101 ++*A " ++B 24 0 0102 ++*B " ++C 24 0 0103 ++D 24 0 0104 ++E 24 0 0105 ++*E " ++F 24 0 0106 ++G 24 0 0107 ++H 24 0 0110 ++*Y " ++I 24 0 0111 ++*I " ++J 24 0 0112 ++K 24 0 0113 ++*K " ++L 24 0 0114 ++M 24 0 0115 ++*M " ++N 24 0 0116 ++*N " ++O 24 0 0117 ++ci " ++*O " ++P 24 0 0120 ++*R " ++Q 24 0 0121 ++R 24 0 0122 ++S 24 0 0123 ++T 24 0 0124 ++*T " ++U 24 0 0125 ++V 24 0 0126 ++W 24 0 0127 ++X 24 0 0130 ++*X " ++Y 24 0 0131 ++*U " ++Z 24 0 0132 ++*Z " ++[ 24 0 0133 ++lB " ++\ 24 0 0134 ++rs " ++] 24 0 0135 ++rB " ++a^ 24 0 0136 ++^ " ++ha " ++_ 24 0 0137 ++ru " ++ul " ++` 24 0 0140 ++oq " ++ga " ++a 24 0 0141 ++b 24 0 0142 ++c 24 0 0143 ++d 24 0 0144 ++e 24 0 0145 ++f 24 0 0146 ++g 24 0 0147 ++h 24 0 0150 ++i 24 0 0151 ++.i " ++j 24 0 0152 ++k 24 0 0153 ++l 24 0 0154 ++m 24 0 0155 ++n 24 0 0156 ++o 24 0 0157 ++*o " ++p 24 0 0160 ++q 24 0 0161 ++r 24 0 0162 ++s 24 0 0163 ++t 24 0 0164 ++u 24 0 0165 ++v 24 0 0166 ++w 24 0 0167 ++x 24 0 0170 ++mu " ++y 24 0 0171 ++z 24 0 0172 ++lC 24 0 0173 ++{ " ++ba 24 0 0174 ++or " ++bv " ++br " ++| " ++lb " ++lc " ++lf " ++lk " ++lt " ++rb " ++rc " ++rf " ++rk " ++rt " ++rC 24 0 0175 ++} " ++a~ 24 0 0176 ++~ " ++ap " ++ti " ++char161 24 0 0241 ++char162 24 0 0242 ++char163 24 0 0243 ++char164 24 0 0244 ++char165 24 0 0245 ++char166 24 0 0246 ++char167 24 0 0247 ++char168 24 0 0250 ++char169 24 0 0251 ++char170 24 0 0252 ++char171 24 0 0253 ++char172 24 0 0254 ++char173 24 0 0255 ++char174 24 0 0256 ++char175 24 0 0257 ++char176 24 0 0260 ++char177 24 0 0261 ++char178 24 0 0262 ++char179 24 0 0263 ++char180 24 0 0264 ++char181 24 0 0265 ++char182 24 0 0266 ++char183 24 0 0267 ++char184 24 0 0270 ++char185 24 0 0271 ++char186 24 0 0272 ++char187 24 0 0273 ++char188 24 0 0274 ++char189 24 0 0275 ++char190 24 0 0276 ++char191 24 0 0277 ++char192 24 0 0300 ++char193 24 0 0301 ++char194 24 0 0302 ++char195 24 0 0303 ++char196 24 0 0304 ++char197 24 0 0305 ++char198 24 0 0306 ++char199 24 0 0307 ++char200 24 0 0310 ++char201 24 0 0311 ++char202 24 0 0312 ++char203 24 0 0313 ++char204 24 0 0314 ++char205 24 0 0315 ++char206 24 0 0316 ++char207 24 0 0317 ++char208 24 0 0320 ++char209 24 0 0321 ++char210 24 0 0322 ++char211 24 0 0323 ++char212 24 0 0324 ++char213 24 0 0325 ++char214 24 0 0326 ++char215 24 0 0327 ++char216 24 0 0330 ++char217 24 0 0331 ++char218 24 0 0332 ++char219 24 0 0333 ++char220 24 0 0334 ++char221 24 0 0335 ++char222 24 0 0336 ++char223 24 0 0337 ++char224 24 0 0340 ++char225 24 0 0341 ++char226 24 0 0342 ++char227 24 0 0343 ++char228 24 0 0344 ++char229 24 0 0345 ++char230 24 0 0346 ++char231 24 0 0347 ++char232 24 0 0350 ++char233 24 0 0351 ++char234 24 0 0352 ++char235 24 0 0353 ++char236 24 0 0354 ++char237 24 0 0355 ++char238 24 0 0356 ++char239 24 0 0357 ++char240 24 0 0360 ++char241 24 0 0361 ++char242 24 0 0362 ++char243 24 0 0363 ++char244 24 0 0364 ++char245 24 0 0365 ++char246 24 0 0366 ++char247 24 0 0367 ++char248 24 0 0370 ++char249 24 0 0371 ++char250 24 0 0372 ++char251 24 0 0373 ++char252 24 0 0374 ++char253 24 0 0375 ++char254 24 0 0376 ++char255 24 0 0377 +--- groff-1.18.1.1.orig/font/devascii8/DESC.proto ++++ groff-1.18.1.1/font/devascii8/DESC.proto +@@ -0,0 +1,8 @@ ++res 240 ++hor 24 ++vert 40 ++unitwidth 10 ++sizes 10 0 ++fonts 4 R I B BI ++tcommand ++postpro grotty +--- groff-1.18.1.1.orig/font/devX100/DESC ++++ groff-1.18.1.1/font/devX100/DESC +@@ -1,5 +1,17 @@ + styles R I B BI +-fonts 6 0 0 0 0 0 S ++fonts 8 0 0 0 0 0 S M G ++fontset B G 2E00..9FFF ++fontset CB G 2E00..9FFF ++fontset HB G 2E00..9FFF ++fontset NB G 2E00..9FFF ++fontset TB G 2E00..9FFF ++fontset - M 2E00..9FFF ++fontset B G FF00..FFEF ++fontset CB G FF00..FFEF ++fontset HB G FF00..FFEF ++fontset NB G FF00..FFEF ++fontset TB G FF00..FFEF ++fontset - M FF00..FFEF + sizes 8 10 12 14 18 24 0 + res 100 + X11 +--- groff-1.18.1.1.orig/font/devX100/M.proto ++++ groff-1.18.1.1/font/devX100/M.proto +@@ -0,0 +1,5 @@ ++name M ++spacewidth 3 ++charset ++u2E00..u9FFF 20 0 ++uFF00..uFFEF 20 0 +--- groff-1.18.1.1.orig/font/devX100/Makefile.sub ++++ groff-1.18.1.1/font/devX100/Makefile.sub +@@ -1,2 +1,13 @@ + DEV=X100 +-DEVFILES=DESC TR TI TB TBI CR CI CB CBI HR HI HB HBI NR NI NB NBI S ++DEVFILES=DESC TR TI TB TBI CR CI CB CBI HR HI HB HBI NR NI NB NBI S M G ++CLEANADD=M G ++ ++M: M.proto ++ @echo Making M ++ @-rm -f M ++ @cat $(srcdir)/M.proto > M ++ ++G: M ++ @echo Making G ++ @-rm -f G ++ @sed -e 's/name M/name G/' M > G +--- groff-1.18.1.1.orig/font/devX100-12/DESC ++++ groff-1.18.1.1/font/devX100-12/DESC +@@ -1,5 +1,17 @@ + styles R I B BI +-fonts 6 0 0 0 0 0 S ++fonts 8 0 0 0 0 0 S M G ++fontset B G 2E00..9FFF ++fontset CB G 2E00..9FFF ++fontset HB G 2E00..9FFF ++fontset NB G 2E00..9FFF ++fontset TB G 2E00..9FFF ++fontset - M 2E00..9FFF ++fontset B G FF00..FFEF ++fontset CB G FF00..FFEF ++fontset HB G FF00..FFEF ++fontset NB G FF00..FFEF ++fontset TB G FF00..FFEF ++fontset - M FF00..FFEF + sizes 8 10 12 14 18 24 0 + res 100 + X11 +--- groff-1.18.1.1.orig/font/devX100-12/M.proto ++++ groff-1.18.1.1/font/devX100-12/M.proto +@@ -0,0 +1,5 @@ ++name M ++spacewidth 4 ++charset ++u2E00..u9FFF 20 0 ++uFF00..uFFEF 20 0 +--- groff-1.18.1.1.orig/font/devX100-12/Makefile.sub ++++ groff-1.18.1.1/font/devX100-12/Makefile.sub +@@ -1,2 +1,14 @@ + DEV=X100-12 +-DEVFILES=DESC TR TI TB TBI CR CI CB CBI HR HI HB HBI NR NI NB NBI S ++DEVFILES=DESC TR TI TB TBI CR CI CB CBI HR HI HB HBI NR NI NB NBI S M G ++CLEANADD=M G ++ ++M: M.proto ++ @echo Making M ++ @-rm -f M ++ @cat $(srcdir)/M.proto > M ++ ++G: M ++ @echo Making G ++ @-rm -f G ++ @sed -e 's/name M/name G/' M > G ++ +--- groff-1.18.1.1.orig/font/devlj4/Makefile.sub ++++ groff-1.18.1.1/font/devlj4/Makefile.sub +@@ -22,9 +22,9 @@ + echo "unitwidth `expr 7620000 / $(LJ4RES)`" >>DESC + cat $(srcdir)/DESC.in >>DESC + if test "$(PAGE)" = A4; then \ +- echo "papersize a4" >>DESC; \ ++ echo "papersize /etc/papersize a4" >>DESC; \ + else \ +- echo "papersize letter" >>DESC; \ ++ echo "papersize /etc/papersize letter" >>DESC; \ + fi + test -z '$(LJ4PRINT)' || echo print '$(LJ4PRINT)' >>DESC + +--- groff-1.18.1.1.orig/font/devnippon/M.proto ++++ groff-1.18.1.1/font/devnippon/M.proto +@@ -0,0 +1,6 @@ ++name M ++internalname 4 ++spacewidth 48 ++charset ++u2E00..u9FFF 48 0 ++uFF00..uFFEF 48 0 +--- groff-1.18.1.1.orig/font/devnippon/Makefile.sub ++++ groff-1.18.1.1/font/devnippon/Makefile.sub +@@ -0,0 +1,48 @@ ++DEV=nippon ++FONTS=R I B BI ++WFONTS=M G ++ALLFONTS=$(FONTS) $(WFONTS) ++DEVFILES=$(ALLFONTS) DESC ++CLEANADD=$(ALLFONTS) DESC ++ ++RES=240 ++CPI=10 ++LPI=6 ++ ++$(FONTS): R.proto ++ @echo Making $@ ++ @-rm -f $@ ++ @(charwidth=`expr $(RES) / $(CPI)` ; \ ++ sed -e "s/^name [A-Z]*$$/name $@/" \ ++ -e "s/^\\([^ ]*\\) [0-9][0-9]* /\\1 $$charwidth /" \ ++ -e "s/^spacewidth [0-9][0-9]*$$/spacewidth $$charwidth/" \ ++ -e "s/^internalname .*$$/internalname $@/" \ ++ -e "/^internalname/s/BI/3/" \ ++ -e "/^internalname/s/B/2/" \ ++ -e "/^internalname/s/I/1/" \ ++ -e "/^internalname .*[^ 0-9]/d" \ ++ $(srcdir)/R.proto >$@) ++ ++M: M.proto ++ @echo Making M ++ @-rm -f M ++ @(wcharwidth=`expr $(RES) / $(CPI) \* 2` ; \ ++ spacewidth=`expr $(RES) / $(CPI)` ; \ ++ sed -e "s/^spacewidth [0-9][0-9]*$$/spacewidth $$spacewidth/" \ ++ -e "s/^u\\([0-9A-F]*\\)..u\\([0-9A-F]*\\) [0-9][0-9]*/u\\1..u\\2 $$wcharwidth/" \ ++ $(srcdir)/M.proto > $@) ++ ++G: M ++ @echo Making G ++ @-rm -f G ++ @sed -e 's/name M/name G/' \ ++ -e 's/internalname 4/internalname 5/' M > G ++ ++DESC: DESC.proto ++ @echo Making $@ ++ @-rm -f $@ ++ @sed -e "s/^res .*$$/res $(RES)/" \ ++ -e "s/^hor .*$$/hor `expr $(RES) / $(CPI)`/" \ ++ -e "s/^vert .*$$/vert `expr $(RES) / $(LPI)`/" \ ++ -e "s/^fonts .*$$/fonts `set $(ALLFONTS); echo $$#` $(ALLFONTS)/" \ ++ $(srcdir)/DESC.proto >$@ +--- groff-1.18.1.1.orig/font/devnippon/R.proto ++++ groff-1.18.1.1/font/devnippon/R.proto +@@ -0,0 +1,167 @@ ++name R ++internalname 0 ++spacewidth 24 ++charset ++! 24 0 0041 ++" 24 0 0042 ++dq " ++lq " ++rq " ++# 24 0 0043 ++sh " ++$ 24 0 0044 ++Do " ++% 24 0 0045 ++& 24 0 0046 ++' 24 0 0047 ++aa " ++fm " ++aq " ++cq " ++( 24 0 0050 ++) 24 0 0051 ++* 24 0 0052 ++** " +++ 24 0 0053 ++pl " ++, 24 0 0054 ++\- 24 0 0055 ++hy " ++- " ++mi " ++en " ++. 24 0 0056 ++/ 24 0 0057 ++sl " ++f/ " ++0 24 0 0060 ++1 24 0 0061 ++2 24 0 0062 ++3 24 0 0063 ++4 24 0 0064 ++5 24 0 0065 ++6 24 0 0066 ++7 24 0 0067 ++8 24 0 0070 ++9 24 0 0071 ++: 24 0 0072 ++; 24 0 0073 ++< 24 0 0074 ++la " ++fo " ++= 24 0 0075 ++eq " ++> 24 0 0076 ++ra " ++fc " ++? 24 0 0077 ++@ 24 0 0100 ++at " ++A 24 0 0101 ++*A " ++B 24 0 0102 ++*B " ++C 24 0 0103 ++D 24 0 0104 ++E 24 0 0105 ++*E " ++F 24 0 0106 ++G 24 0 0107 ++H 24 0 0110 ++*Y " ++I 24 0 0111 ++*I " ++J 24 0 0112 ++K 24 0 0113 ++*K " ++L 24 0 0114 ++M 24 0 0115 ++*M " ++N 24 0 0116 ++*N " ++O 24 0 0117 ++ci " ++*O " ++P 24 0 0120 ++*R " ++Q 24 0 0121 ++R 24 0 0122 ++S 24 0 0123 ++T 24 0 0124 ++*T " ++U 24 0 0125 ++V 24 0 0126 ++W 24 0 0127 ++X 24 0 0130 ++*X " ++Y 24 0 0131 ++*U " ++Z 24 0 0132 ++*Z " ++[ 24 0 0133 ++lB " ++\ 24 0 0134 ++rs " ++] 24 0 0135 ++rB " ++a^ 24 0 0136 ++^ " ++ha " ++_ 24 0 0137 ++ru " ++ul " ++` 24 0 0140 ++oq " ++ga " ++a 24 0 0141 ++b 24 0 0142 ++c 24 0 0143 ++d 24 0 0144 ++e 24 0 0145 ++f 24 0 0146 ++g 24 0 0147 ++h 24 0 0150 ++i 24 0 0151 ++.i " ++j 24 0 0152 ++k 24 0 0153 ++l 24 0 0154 ++m 24 0 0155 ++n 24 0 0156 ++o 24 0 0157 ++*o " ++p 24 0 0160 ++q 24 0 0161 ++r 24 0 0162 ++s 24 0 0163 ++t 24 0 0164 ++u 24 0 0165 ++v 24 0 0166 ++w 24 0 0167 ++x 24 0 0170 ++mu " ++y 24 0 0171 ++z 24 0 0172 ++lC 24 0 0173 ++{ " ++ba 24 0 0174 ++or " ++bv " ++br " ++| " ++lb " ++lc " ++lf " ++lk " ++lt " ++rb " ++rc " ++rf " ++rk " ++rt " ++rC 24 0 0175 ++} " ++a~ 24 0 0176 ++~ " ++ap " ++ti " +--- groff-1.18.1.1.orig/font/devnippon/DESC.proto ++++ groff-1.18.1.1/font/devnippon/DESC.proto +@@ -0,0 +1,12 @@ ++res 240 ++hor 24 ++vert 40 ++unitwidth 10 ++sizes 10 0 ++fonts 6 R I B BI M G ++fontset B G 2E00..9FFF ++fontset - M 2E00..9FFF ++fontset B G FF00..FFEF ++fontset - M FF00..FFEF ++tcommand ++postpro grotty +--- groff-1.18.1.1.orig/font/devps/M.proto ++++ groff-1.18.1.1/font/devps/M.proto +@@ -0,0 +1,9 @@ ++name M ++internalname Ryumin-Light-EUC-H ++spacewidth 250 ++encodingname EUC-JP ++charset ++u2E00..u9FFF 1000 3 ++uFF00..uFF5F 1000 3 ++uFF60..uFF9F 500 3 ++uFFA0..uFFEF 1000 3 +--- groff-1.18.1.1.orig/font/devps/DESC.in ++++ groff-1.18.1.1/font/devps/DESC.in +@@ -1,11 +1,33 @@ + res 72000 + hor 1 + vert 1 ++lowerwchar 300 ++wcharkern 400 + sizescale 1000 + unitwidth 1000 + sizes 1000-10000000 0 + styles R I B BI + family T +-fonts 9 0 0 0 0 0 SS S ZD ZDR ++fonts 11 0 0 0 0 0 SS S ZD ZDR M G ++fontset B G 2E00..9FFF ++fontset AB G 2E00..9FFF ++fontset BMB G 2E00..9FFF ++fontset CB G 2E00..9FFF ++fontset HB G 2E00..9FFF ++fontset HNB G 2E00..9FFF ++fontset NB G 2E00..9FFF ++fontset PB G 2E00..9FFF ++fontset TB G 2E00..9FFF ++fontset - M 2E00..9FFF ++fontset B G FF00..FFEF ++fontset AB G FF00..FFEF ++fontset BMB G FF00..FFEF ++fontset CB G FF00..FFEF ++fontset HB G FF00..FFEF ++fontset HNB G FF00..FFEF ++fontset NB G FF00..FFEF ++fontset PB G FF00..FFEF ++fontset TB G FF00..FFEF ++fontset - M FF00..FFEF + tcommand + postpro grops +--- groff-1.18.1.1.orig/font/devps/Makefile.sub ++++ groff-1.18.1.1/font/devps/Makefile.sub +@@ -2,23 +2,23 @@ + DISTFILES=text.enc download \ + S ZD ZDR SS AB ABI AI AR BMB BMBI BMI BMR \ + CB CBI CI CR HB HBI HI HR HNB HNBI HNI HNR \ +- NB NBI NI NR PB PBI PI PR TB TBI TI TR ZCMI ++ NB NBI NI NR PB PBI PI PR TB TBI TI TR ZCMI M G + PSFILES=prologue symbolsl.pfa zapfdr.pfa + DEVGENFILES=generate/Makefile generate/afmname generate/dingbats.map \ + generate/dingbats.rmap generate/lgreekmap generate/symbol.sed \ + generate/symbolchars generate/symbolsl.afm generate/textmap + DEVFILES=DESC $(PSFILES) $(DISTFILES) $(DEVGENFILES) + +-CLEANADD=DESC $(PSFILES) ++CLEANADD=DESC $(PSFILES) M G + + DESC: DESC.in + -rm -f DESC + cat $(srcdir)/DESC.in >DESC + echo broken $(BROKEN_SPOOLER_FLAGS) >>DESC + if test "$(PAGE)" = A4; then \ +- echo "papersize a4" >>DESC; \ ++ echo "papersize /etc/papersize a4" >>DESC; \ + else \ +- echo "papersize letter" >>DESC; \ ++ echo "papersize /etc/papersize letter" >>DESC; \ + fi + test -z '$(PSPRINT)' || echo print '$(PSPRINT)' >>DESC + +@@ -33,3 +33,14 @@ + $(PSFILES): + -rm -f $@ + sed -f $(srcdir)/psstrip.sed $? >$@ ++ ++M: M.proto ++ @echo Making M ++ @-rm -f M ++ @cp M.proto M ++ ++G: M ++ @echo Making G ++ @-rm -f G ++ @sed -e 's/name M/name G/' \ ++ -e 's/internalname Ryumin-Light-EUC-H/internalname GothicBBB-Medium-EUC-H/' M > G +--- groff-1.18.1.1.orig/font/devutf8/M.proto ++++ groff-1.18.1.1/font/devutf8/M.proto +@@ -0,0 +1,6 @@ ++name M ++internalname 4 ++spacewidth 48 ++charset ++u2E00..u9FFF 48 0 ++uFF00..uFFEF 48 0 +--- groff-1.18.1.1.orig/font/devutf8/Makefile.sub ++++ groff-1.18.1.1/font/devutf8/Makefile.sub +@@ -1,7 +1,8 @@ + DEV=utf8 + FONTS=R I B BI +-DEVFILES=$(FONTS) DESC +-CLEANADD=$(FONTS) DESC ++WFONTS=M G ++DEVFILES=$(FONTS) $(WFONTS) DESC ++CLEANADD=$(FONTS) $(WFONTS) DESC + + RES=240 + CPI=10 +@@ -12,8 +13,8 @@ + @-rm -f $@ + @(charwidth=`expr $(RES) / $(CPI)` ; \ + sed -e "s/^name [A-Z]*$$/name $@/" \ +- -e "s/^\\([^ ]*\\) [0-9]+ /\\1 $$charwidth /" \ +- -e "s/^spacewidth [0-9]+$$/spacewidth $$charwidth/" \ ++ -e "s/^\\([^ ]*\\) [0-9][0-9]* /\\1 $$charwidth /" \ ++ -e "s/^spacewidth [0-9][0-9]*$$/spacewidth $$charwidth/" \ + -e "s/^internalname .*$$/internalname $@/" \ + -e "/^internalname/s/BI/3/" \ + -e "/^internalname/s/B/2/" \ +@@ -21,12 +22,27 @@ + -e "/^internalname .*[^ 0-9]/d" \ + $(srcdir)/R.proto >$@) + ++M: M.proto ++ @echo Making M ++ @-rm -f M ++ (wcharwidth=`expr $(RES) / $(CPI) \* 2` ; \ ++ spacewidth=`expr $(RES) / $(CPI)` ; \ ++ sed -e "s/^spacewidth [0-9][0-9]*$$/spacewidth $$spacewidth/" \ ++ -e "s/^u\\([0-9A-F]*\\)..u\\([0-9A-F]*\\) [0-9][0-9]*/u\\1..u\\2 $$wcharwidth/" \ ++ $(srcdir)/M.proto > $@) ++ ++G: M ++ @echo Making G ++ @-rm -f G ++ @sed -e 's/name M/name G/' \ ++ -e 's/internalname 4/internalname 5/' M > G ++ + DESC: DESC.proto + @echo Making $@ + @-rm -f $@ + @sed -e "s/^res .*$$/res $(RES)/" \ + -e "s/^hor .*$$/hor `expr $(RES) / $(CPI)`/" \ + -e "s/^vert .*$$/vert `expr $(RES) / $(LPI)`/" \ +- -e "s/^fonts .*$$/fonts `set $(FONTS); echo $$#` $(FONTS)/" \ ++ -e "s/^fonts .*$$/fonts `set $(FONTS) $(WFONTS); echo $$#` $(FONTS) $(WFONTS)/" \ + $(srcdir)/DESC.proto >$@ + +--- groff-1.18.1.1.orig/font/devutf8/DESC.proto ++++ groff-1.18.1.1/font/devutf8/DESC.proto +@@ -3,6 +3,10 @@ + vert 40 + unitwidth 10 + sizes 10 0 +-fonts 4 R I B BI ++fonts 6 R I B BI M G ++fontset B G 2E00..9FFF ++fontset B G FF00..FFEF ++fontset - M 2E00..9FFF ++fontset - M FF00..FFEF + tcommand + postpro grotty +--- groff-1.18.1.1.orig/font/devhtml/M.proto ++++ groff-1.18.1.1/font/devhtml/M.proto +@@ -0,0 +1,5 @@ ++name M ++spacewidth 16 ++charset ++u2E00..u9FFF 16,14,2 0 ++uFF00..uFFEF 16,14,2 0 +--- groff-1.18.1.1.orig/font/devhtml/Makefile.sub ++++ groff-1.18.1.1/font/devhtml/Makefile.sub +@@ -1,8 +1,10 @@ + DEV=html + PROTOFONTS=R I B BI CR CI CB CBI + FONTS=$(PROTOFONTS) S +-DEVFILES=$(FONTS) DESC +-CLEANADD=$(FONTS) DESC ++WFONTS=M G ++ALLFONTS=$(FONTS) $(WFONTS) ++DEVFILES=$(ALLFONTS) DESC ++CLEANADD=$(ALLFONTS) DESC + + RES=240 + CPI=10 +@@ -13,8 +15,8 @@ + @-rm -f $@ + @(charwidth=`expr $(RES) / $(CPI)` ; \ + sed -e "s/^name [A-Z]*$$/name $@/" \ +- -e "s/^\\([^ ]*\\) [0-9]+ /\\1 $$charwidth /" \ +- -e "s/^spacewidth [0-9]+$$/spacewidth $$charwidth/" \ ++ -e "s/^\\([^ ]*\\) [0-9][0-9]* /\\1 $$charwidth /" \ ++ -e "s/^spacewidth [0-9][0-9]*$$/spacewidth $$charwidth/" \ + -e "s/^internalname .*$$/internalname $@/" \ + -e "/^internalname/s/CR/4/" \ + -e "/^internalname/s/BI/3/" \ +@@ -29,6 +31,19 @@ + @sed -e "s/^res .*$$/res $(RES)/" \ + -e "s/^hor .*$$/hor `expr $(RES) / $(CPI)`/" \ + -e "s/^vert .*$$/vert `expr $(RES) / $(LPI)`/" \ +- -e "s/^fonts .*$$/fonts `set $(FONTS); echo $$#` $(FONTS)/" \ ++ -e "s/^fonts .*$$/fonts `set $(ALLFONTS); echo $$#` $(ALLFONTS)/" \ + $(srcdir)/DESC.proto >$@ + ++M: M.proto ++ @echo Making M ++ @-rm -f M ++ @(wcharwidth=`expr $(RES) / $(CPI) \* 2`; \ ++ spacewidth=`expr $(RES) / $(CPI)`; \ ++ sed -e "s/^u\\([0-9A-F]*\\)..u\\([0-9A-F]*\\) [0-9][0-9]*/u\\1..u\\2 $$wcharwidth/" \ ++ -e "s/^spacewidth [0-9][0-9]*$$/spacewidth $$spacewidth/" \ ++ $(srcdir)/M.proto > $@) ++ ++G: M ++ @echo Making G ++ @-rm -f G ++ @sed -e 's/name M/name G/' M > G +--- groff-1.18.1.1.orig/font/devhtml/DESC.proto ++++ groff-1.18.1.1/font/devhtml/DESC.proto +@@ -3,7 +3,11 @@ + vert 40 + unitwidth 10 + sizes 6 8 10 12 14 16 18 0 +-fonts 9 R I B BI CR CI CB CBI S ++fonts 11 R I B BI CR CI CB CBI S M G ++fontset B G 2E00..9FFF ++fontset - M 2E00..9FFF ++fontset B G FF00..FFEF ++fontset - M FF00..FFEF + tcommand + html + postpro post-grohtml +--- groff-1.18.1.1.orig/font/devX75-12/DESC ++++ groff-1.18.1.1/font/devX75-12/DESC +@@ -1,5 +1,17 @@ + styles R I B BI +-fonts 6 0 0 0 0 0 S ++fonts 8 0 0 0 0 0 S M G ++fontset B G 2E00..9FFF ++fontset CB G 2E00..9FFF ++fontset HB G 2E00..9FFF ++fontset NB G 2E00..9FFF ++fontset TB G 2E00..9FFF ++fontset - M 2E00..9FFF ++fontset B G FF00..FFEF ++fontset CB G FF00..FFEF ++fontset HB G FF00..FFEF ++fontset NB G FF00..FFEF ++fontset TB G FF00..FFEF ++fontset - M FF00..FFEF + sizes 8 10 12 14 18 24 0 + res 75 + X11 +--- groff-1.18.1.1.orig/font/devX75-12/M.proto ++++ groff-1.18.1.1/font/devX75-12/M.proto +@@ -0,0 +1,5 @@ ++name M ++spacewidth 2 ++charset ++u2E00..u9FFF 12 0 ++uFF00..uFFEF 12 0 +--- groff-1.18.1.1.orig/font/devX75-12/Makefile.sub ++++ groff-1.18.1.1/font/devX75-12/Makefile.sub +@@ -1,2 +1,13 @@ + DEV=X75-12 +-DEVFILES=DESC TR TI TB TBI CR CI CB CBI HR HI HB HBI NR NI NB NBI S ++DEVFILES=DESC TR TI TB TBI CR CI CB CBI HR HI HB HBI NR NI NB NBI S M G ++CLEANADD=M G ++ ++M: M.proto ++ @echo Making M ++ @-rm -f M ++ @cat $(srcdir)/M.proto > M ++ ++G: M ++ @echo Making G ++ @-rm -f G ++ @sed -e 's/name M/name G/' M > G +--- groff-1.18.1.1.orig/font/devdvi/M.proto-NTT ++++ groff-1.18.1.1/font/devdvi/M.proto-NTT +@@ -0,0 +1,6882 @@ ++name M ++internalname dmj10 ++checksum 0 ++designsize 10485760 ++charset ++¡¡ F 1:0 ++¡¢ F 2:0 ++¡£ F 3:0 ++¡¤ F 4:0 ++¡¥ F 5:0 ++¡¦ F 6:0 ++¡§ F 7:0 ++¡¨ F 8:0 ++¡© F 9:0 ++¡ª F 10:0 ++¡« F 11:0 ++¡¬ F 12:0 ++¡­ F 13:0 ++¡® F 14:0 ++¡¯ F 15:0 ++¡° F 16:0 ++¡± F 17:0 ++¡² F 18:0 ++¡³ F 19:0 ++¡´ F 20:0 ++¡µ F 21:0 ++¡¶ F 22:0 ++¡· F 23:0 ++¡¸ F 24:0 ++¡¹ F 25:0 ++¡º F 26:0 ++¡» F 27:0 ++¡¼ F 28:0 ++¡½ F 29:0 ++¡¾ F 30:0 ++¡¿ F 31:0 ++¡À F 32:0 ++¡Á F 33:0 ++¡Â F 34:0 ++¡Ã F 35:0 ++¡Ä F 36:0 ++¡Å F 37:0 ++¡Æ F 38:0 ++¡Ç F 39:0 ++¡È F 40:0 ++¡É F 41:0 ++¡Ê F 42:0 ++¡Ë F 43:0 ++¡Ì F 44:0 ++¡Í F 45:0 ++¡Î F 46:0 ++¡Ï F 47:0 ++¡Ð F 48:0 ++¡Ñ F 49:0 ++¡Ò F 50:0 ++¡Ó F 51:0 ++¡Ô F 52:0 ++¡Õ F 53:0 ++¡Ö F 54:0 ++¡× F 55:0 ++¡Ø F 56:0 ++¡Ù F 57:0 ++¡Ú F 58:0 ++¡Û F 59:0 ++¡Ü F 60:0 ++¡Ý F 61:0 ++¡Þ F 62:0 ++¡ß F 63:0 ++¡à F 64:0 ++¡á F 65:0 ++¡â F 66:0 ++¡ã F 67:0 ++¡ä F 68:0 ++¡å F 69:0 ++¡æ F 70:0 ++¡ç F 71:0 ++¡è F 72:0 ++¡é F 73:0 ++¡ê F 74:0 ++¡ë F 75:0 ++¡ì F 76:0 ++¡í F 77:0 ++¡î F 78:0 ++¡ï F 79:0 ++¡ð F 80:0 ++¡ñ F 81:0 ++¡ò F 82:0 ++¡ó F 83:0 ++¡ô F 84:0 ++¡õ F 85:0 ++¡ö F 86:0 ++¡÷ F 87:0 ++¡ø F 88:0 ++¡ù F 89:0 ++¡ú F 90:0 ++¡û F 91:0 ++¡ü F 92:0 ++¡ý F 93:0 ++¡þ F 94:0 ++¢¡ F 101:0 ++¢¢ F 102:0 ++¢£ F 103:0 ++¢¤ F 104:0 ++¢¥ F 105:0 ++¢¦ F 106:0 ++¢§ F 107:0 ++¢¨ F 108:0 ++¢© F 109:0 ++¢ª F 110:0 ++¢« F 111:0 ++¢¬ F 112:0 ++¢­ F 113:0 ++¢® F 114:0 ++¢º F 126:0 ++¢» F 127:0 ++¢¼ F 128:0 ++¢½ F 129:0 ++¢¾ F 130:0 ++¢¿ F 131:0 ++¢À F 132:0 ++¢Á F 133:0 ++¢Ê F 142:0 ++¢Ë F 143:0 ++¢Ì F 144:0 ++¢Í F 145:0 ++¢Î F 146:0 ++¢Ï F 147:0 ++¢Ð F 148:0 ++¢Ü F 160:0 ++¢Ý F 161:0 ++¢Þ F 162:0 ++¢ß F 163:0 ++¢à F 164:0 ++¢á F 165:0 ++¢â F 166:0 ++¢ã F 167:0 ++¢ä F 168:0 ++¢å F 169:0 ++¢æ F 170:0 ++¢ç F 171:0 ++¢è F 172:0 ++¢é F 173:0 ++¢ê F 174:0 ++¢ò F 182:0 ++¢ó F 183:0 ++¢ô F 184:0 ++¢õ F 185:0 ++¢ö F 186:0 ++¢÷ F 187:0 ++¢ø F 188:0 ++¢ù F 189:0 ++¢þ F 194:0 ++£° F 48:1 ++£± F 49:1 ++£² F 50:1 ++£³ F 51:1 ++£´ F 52:1 ++£µ F 53:1 ++£¶ F 54:1 ++£· F 55:1 ++£¸ F 56:1 ++£¹ F 57:1 ++£Á F 65:1 ++£Â F 66:1 ++£Ã F 67:1 ++£Ä F 68:1 ++£Å F 69:1 ++£Æ F 70:1 ++£Ç F 71:1 ++£È F 72:1 ++£É F 73:1 ++£Ê F 74:1 ++£Ë F 75:1 ++£Ì F 76:1 ++£Í F 77:1 ++£Î F 78:1 ++£Ï F 79:1 ++£Ð F 80:1 ++£Ñ F 81:1 ++£Ò F 82:1 ++£Ó F 83:1 ++£Ô F 84:1 ++£Õ F 85:1 ++£Ö F 86:1 ++£× F 87:1 ++£Ø F 88:1 ++£Ù F 89:1 ++£Ú F 90:1 ++£á F 97:1 ++£â F 98:1 ++£ã F 99:1 ++£ä F 100:1 ++£å F 101:1 ++£æ F 102:1 ++£ç F 103:1 ++£è F 104:1 ++£é F 105:1 ++£ê F 106:1 ++£ë F 107:1 ++£ì F 108:1 ++£í F 109:1 ++£î F 110:1 ++£ï F 111:1 ++£ð F 112:1 ++£ñ F 113:1 ++£ò F 114:1 ++£ó F 115:1 ++£ô F 116:1 ++£õ F 117:1 ++£ö F 118:1 ++£÷ F 119:1 ++£ø F 120:1 ++£ù F 121:1 ++£ú F 122:1 ++¤¡ F 1:2 ++¤¢ F 2:2 ++¤£ F 3:2 ++¤¤ F 4:2 ++¤¥ F 5:2 ++¤¦ F 6:2 ++¤§ F 7:2 ++¤¨ F 8:2 ++¤© F 9:2 ++¤ª F 10:2 ++¤« F 11:2 ++¤¬ F 12:2 ++¤­ F 13:2 ++¤® F 14:2 ++¤¯ F 15:2 ++¤° F 16:2 ++¤± F 17:2 ++¤² F 18:2 ++¤³ F 19:2 ++¤´ F 20:2 ++¤µ F 21:2 ++¤¶ F 22:2 ++¤· F 23:2 ++¤¸ F 24:2 ++¤¹ F 25:2 ++¤º F 26:2 ++¤» F 27:2 ++¤¼ F 28:2 ++¤½ F 29:2 ++¤¾ F 30:2 ++¤¿ F 31:2 ++¤À F 32:2 ++¤Á F 33:2 ++¤Â F 34:2 ++¤Ã F 35:2 ++¤Ä F 36:2 ++¤Å F 37:2 ++¤Æ F 38:2 ++¤Ç F 39:2 ++¤È F 40:2 ++¤É F 41:2 ++¤Ê F 42:2 ++¤Ë F 43:2 ++¤Ì F 44:2 ++¤Í F 45:2 ++¤Î F 46:2 ++¤Ï F 47:2 ++¤Ð F 48:2 ++¤Ñ F 49:2 ++¤Ò F 50:2 ++¤Ó F 51:2 ++¤Ô F 52:2 ++¤Õ F 53:2 ++¤Ö F 54:2 ++¤× F 55:2 ++¤Ø F 56:2 ++¤Ù F 57:2 ++¤Ú F 58:2 ++¤Û F 59:2 ++¤Ü F 60:2 ++¤Ý F 61:2 ++¤Þ F 62:2 ++¤ß F 63:2 ++¤à F 64:2 ++¤á F 65:2 ++¤â F 66:2 ++¤ã F 67:2 ++¤ä F 68:2 ++¤å F 69:2 ++¤æ F 70:2 ++¤ç F 71:2 ++¤è F 72:2 ++¤é F 73:2 ++¤ê F 74:2 ++¤ë F 75:2 ++¤ì F 76:2 ++¤í F 77:2 ++¤î F 78:2 ++¤ï F 79:2 ++¤ð F 80:2 ++¤ñ F 81:2 ++¤ò F 82:2 ++¤ó F 83:2 ++¥¡ F 1:3 ++¥¢ F 2:3 ++¥£ F 3:3 ++¥¤ F 4:3 ++¥¥ F 5:3 ++¥¦ F 6:3 ++¥§ F 7:3 ++¥¨ F 8:3 ++¥© F 9:3 ++¥ª F 10:3 ++¥« F 11:3 ++¥¬ F 12:3 ++¥­ F 13:3 ++¥® F 14:3 ++¥¯ F 15:3 ++¥° F 16:3 ++¥± F 17:3 ++¥² F 18:3 ++¥³ F 19:3 ++¥´ F 20:3 ++¥µ F 21:3 ++¥¶ F 22:3 ++¥· F 23:3 ++¥¸ F 24:3 ++¥¹ F 25:3 ++¥º F 26:3 ++¥» F 27:3 ++¥¼ F 28:3 ++¥½ F 29:3 ++¥¾ F 30:3 ++¥¿ F 31:3 ++¥À F 32:3 ++¥Á F 33:3 ++¥Â F 34:3 ++¥Ã F 35:3 ++¥Ä F 36:3 ++¥Å F 37:3 ++¥Æ F 38:3 ++¥Ç F 39:3 ++¥È F 40:3 ++¥É F 41:3 ++¥Ê F 42:3 ++¥Ë F 43:3 ++¥Ì F 44:3 ++¥Í F 45:3 ++¥Î F 46:3 ++¥Ï F 47:3 ++¥Ð F 48:3 ++¥Ñ F 49:3 ++¥Ò F 50:3 ++¥Ó F 51:3 ++¥Ô F 52:3 ++¥Õ F 53:3 ++¥Ö F 54:3 ++¥× F 55:3 ++¥Ø F 56:3 ++¥Ù F 57:3 ++¥Ú F 58:3 ++¥Û F 59:3 ++¥Ü F 60:3 ++¥Ý F 61:3 ++¥Þ F 62:3 ++¥ß F 63:3 ++¥à F 64:3 ++¥á F 65:3 ++¥â F 66:3 ++¥ã F 67:3 ++¥ä F 68:3 ++¥å F 69:3 ++¥æ F 70:3 ++¥ç F 71:3 ++¥è F 72:3 ++¥é F 73:3 ++¥ê F 74:3 ++¥ë F 75:3 ++¥ì F 76:3 ++¥í F 77:3 ++¥î F 78:3 ++¥ï F 79:3 ++¥ð F 80:3 ++¥ñ F 81:3 ++¥ò F 82:3 ++¥ó F 83:3 ++¥ô F 84:3 ++¥õ F 85:3 ++¥ö F 86:3 ++¦¡ F 1:4 ++¦¢ F 2:4 ++¦£ F 3:4 ++¦¤ F 4:4 ++¦¥ F 5:4 ++¦¦ F 6:4 ++¦§ F 7:4 ++¦¨ F 8:4 ++¦© F 9:4 ++¦ª F 10:4 ++¦« F 11:4 ++¦¬ F 12:4 ++¦­ F 13:4 ++¦® F 14:4 ++¦¯ F 15:4 ++¦° F 16:4 ++¦± F 17:4 ++¦² F 18:4 ++¦³ F 19:4 ++¦´ F 20:4 ++¦µ F 21:4 ++¦¶ F 22:4 ++¦· F 23:4 ++¦¸ F 24:4 ++¦Á F 33:4 ++¦Â F 34:4 ++¦Ã F 35:4 ++¦Ä F 36:4 ++¦Å F 37:4 ++¦Æ F 38:4 ++¦Ç F 39:4 ++¦È F 40:4 ++¦É F 41:4 ++¦Ê F 42:4 ++¦Ë F 43:4 ++¦Ì F 44:4 ++¦Í F 45:4 ++¦Î F 46:4 ++¦Ï F 47:4 ++¦Ð F 48:4 ++¦Ñ F 49:4 ++¦Ò F 50:4 ++¦Ó F 51:4 ++¦Ô F 52:4 ++¦Õ F 53:4 ++¦Ö F 54:4 ++¦× F 55:4 ++¦Ø F 56:4 ++§¡ F 1:5 ++§¢ F 2:5 ++§£ F 3:5 ++§¤ F 4:5 ++§¥ F 5:5 ++§¦ F 6:5 ++§§ F 7:5 ++§¨ F 8:5 ++§© F 9:5 ++§ª F 10:5 ++§« F 11:5 ++§¬ F 12:5 ++§­ F 13:5 ++§® F 14:5 ++§¯ F 15:5 ++§° F 16:5 ++§± F 17:5 ++§² F 18:5 ++§³ F 19:5 ++§´ F 20:5 ++§µ F 21:5 ++§¶ F 22:5 ++§· F 23:5 ++§¸ F 24:5 ++§¹ F 25:5 ++§º F 26:5 ++§» F 27:5 ++§¼ F 28:5 ++§½ F 29:5 ++§¾ F 30:5 ++§¿ F 31:5 ++§À F 32:5 ++§Á F 33:5 ++§Ñ F 49:5 ++§Ò F 50:5 ++§Ó F 51:5 ++§Ô F 52:5 ++§Õ F 53:5 ++§Ö F 54:5 ++§× F 55:5 ++§Ø F 56:5 ++§Ù F 57:5 ++§Ú F 58:5 ++§Û F 59:5 ++§Ü F 60:5 ++§Ý F 61:5 ++§Þ F 62:5 ++§ß F 63:5 ++§à F 64:5 ++§á F 65:5 ++§â F 66:5 ++§ã F 67:5 ++§ä F 68:5 ++§å F 69:5 ++§æ F 70:5 ++§ç F 71:5 ++§è F 72:5 ++§é F 73:5 ++§ê F 74:5 ++§ë F 75:5 ++§ì F 76:5 ++§í F 77:5 ++§î F 78:5 ++§ï F 79:5 ++§ð F 80:5 ++§ñ F 81:5 ++¨¡ F 1:6 ++¨¢ F 2:6 ++¨£ F 3:6 ++¨¤ F 4:6 ++¨¥ F 5:6 ++¨¦ F 6:6 ++¨§ F 7:6 ++¨¨ F 8:6 ++¨© F 9:6 ++¨ª F 10:6 ++¨« F 11:6 ++¨¬ F 12:6 ++¨­ F 13:6 ++¨® F 14:6 ++¨¯ F 15:6 ++¨° F 16:6 ++¨± F 17:6 ++¨² F 18:6 ++¨³ F 19:6 ++¨´ F 20:6 ++¨µ F 21:6 ++¨¶ F 22:6 ++¨· F 23:6 ++¨¸ F 24:6 ++¨¹ F 25:6 ++¨º F 26:6 ++¨» F 27:6 ++¨¼ F 28:6 ++¨½ F 29:6 ++¨¾ F 30:6 ++¨¿ F 31:6 ++¨À F 32:6 ++°¡ F 0:a ++°¢ F 1:a ++°£ F 2:a ++°¤ F 3:a ++°¥ F 4:a ++°¦ F 5:a ++°§ F 6:a ++°¨ F 7:a ++°© F 8:a ++°ª F 9:a ++°« F 10:a ++°¬ F 11:a ++°­ F 12:a ++°® F 13:a ++°¯ F 14:a ++°° F 15:a ++°± F 16:a ++°² F 17:a ++°³ F 18:a ++°´ F 19:a ++°µ F 20:a ++°¶ F 21:a ++°· F 22:a ++°¸ F 23:a ++°¹ F 24:a ++°º F 25:a ++°» F 26:a ++°¼ F 27:a ++°½ F 28:a ++°¾ F 29:a ++°¿ F 30:a ++°À F 31:a ++°Á F 32:a ++°Â F 33:a ++°Ã F 34:a ++°Ä F 35:a ++°Å F 36:a ++°Æ F 37:a ++°Ç F 38:a ++°È F 39:a ++°É F 40:a ++°Ê F 41:a ++°Ë F 42:a ++°Ì F 43:a ++°Í F 44:a ++°Î F 45:a ++°Ï F 46:a ++°Ð F 47:a ++°Ñ F 48:a ++°Ò F 49:a ++°Ó F 50:a ++°Ô F 51:a ++°Õ F 52:a ++°Ö F 53:a ++°× F 54:a ++°Ø F 55:a ++°Ù F 56:a ++°Ú F 57:a ++°Û F 58:a ++°Ü F 59:a ++°Ý F 60:a ++°Þ F 61:a ++°ß F 62:a ++°à F 63:a ++°á F 64:a ++°â F 65:a ++°ã F 66:a ++°ä F 67:a ++°å F 68:a ++°æ F 69:a ++°ç F 70:a ++°è F 71:a ++°é F 72:a ++°ê F 73:a ++°ë F 74:a ++°ì F 75:a ++°í F 76:a ++°î F 77:a ++°ï F 78:a ++°ð F 79:a ++°ñ F 80:a ++°ò F 81:a ++°ó F 82:a ++°ô F 83:a ++°õ F 84:a ++°ö F 85:a ++°÷ F 86:a ++°ø F 87:a ++°ù F 88:a ++°ú F 89:a ++°û F 90:a ++°ü F 91:a ++°ý F 92:a ++°þ F 93:a ++±¡ F 94:a ++±¢ F 95:a ++±£ F 96:a ++±¤ F 97:a ++±¥ F 98:a ++±¦ F 99:a ++±§ F 100:a ++±¨ F 101:a ++±© F 102:a ++±ª F 103:a ++±« F 104:a ++±¬ F 105:a ++±­ F 106:a ++±® F 107:a ++±¯ F 108:a ++±° F 109:a ++±± F 110:a ++±² F 111:a ++±³ F 112:a ++±´ F 113:a ++±µ F 114:a ++±¶ F 115:a ++±· F 116:a ++±¸ F 117:a ++±¹ F 118:a ++±º F 119:a ++±» F 120:a ++±¼ F 121:a ++±½ F 122:a ++±¾ F 123:a ++±¿ F 124:a ++±À F 125:a ++±Á F 126:a ++±Â F 127:a ++±Ã F 128:a ++±Ä F 129:a ++±Å F 130:a ++±Æ F 131:a ++±Ç F 132:a ++±È F 133:a ++±É F 134:a ++±Ê F 135:a ++±Ë F 136:a ++±Ì F 137:a ++±Í F 138:a ++±Î F 139:a ++±Ï F 140:a ++±Ð F 141:a ++±Ñ F 142:a ++±Ò F 143:a ++±Ó F 144:a ++±Ô F 145:a ++±Õ F 146:a ++±Ö F 147:a ++±× F 148:a ++±Ø F 149:a ++±Ù F 150:a ++±Ú F 151:a ++±Û F 152:a ++±Ü F 153:a ++±Ý F 154:a ++±Þ F 155:a ++±ß F 156:a ++±à F 157:a ++±á F 158:a ++±â F 159:a ++±ã F 160:a ++±ä F 161:a ++±å F 162:a ++±æ F 163:a ++±ç F 164:a ++±è F 165:a ++±é F 166:a ++±ê F 167:a ++±ë F 168:a ++±ì F 169:a ++±í F 170:a ++±î F 171:a ++±ï F 172:a ++±ð F 173:a ++±ñ F 174:a ++±ò F 175:a ++±ó F 176:a ++±ô F 177:a ++±õ F 178:a ++±ö F 179:a ++±÷ F 180:a ++±ø F 181:a ++±ù F 182:a ++±ú F 183:a ++±û F 184:a ++±ü F 185:a ++±ý F 186:a ++±þ F 187:a ++²¡ F 188:a ++²¢ F 189:a ++²£ F 190:a ++²¤ F 191:a ++²¥ F 192:a ++²¦ F 193:a ++²§ F 194:a ++²¨ F 195:a ++²© F 196:a ++²ª F 197:a ++²« F 198:a ++²¬ F 199:a ++²­ F 200:a ++²® F 201:a ++²¯ F 202:a ++²° F 203:a ++²± F 204:a ++²² F 205:a ++²³ F 206:a ++²´ F 207:a ++²µ F 208:a ++²¶ F 209:a ++²· F 210:a ++²¸ F 211:a ++²¹ F 212:a ++²º F 213:a ++²» F 214:a ++²¼ F 215:a ++²½ F 216:a ++²¾ F 217:a ++²¿ F 218:a ++²À F 219:a ++²Á F 220:a ++²Â F 221:a ++²Ã F 222:a ++²Ä F 223:a ++²Å F 224:a ++²Æ F 225:a ++²Ç F 226:a ++²È F 227:a ++²É F 228:a ++²Ê F 229:a ++²Ë F 230:a ++²Ì F 231:a ++²Í F 232:a ++²Î F 233:a ++²Ï F 234:a ++²Ð F 235:a ++²Ñ F 236:a ++²Ò F 237:a ++²Ó F 238:a ++²Ô F 239:a ++²Õ F 240:a ++²Ö F 241:a ++²× F 242:a ++²Ø F 243:a ++²Ù F 244:a ++²Ú F 245:a ++²Û F 246:a ++²Ü F 247:a ++²Ý F 248:a ++²Þ F 249:a ++²ß F 250:a ++²à F 251:a ++²á F 252:a ++²â F 253:a ++²ã F 254:a ++²ä F 255:a ++²å F 0:b ++²æ F 1:b ++²ç F 2:b ++²è F 3:b ++²é F 4:b ++²ê F 5:b ++²ë F 6:b ++²ì F 7:b ++²í F 8:b ++²î F 9:b ++²ï F 10:b ++²ð F 11:b ++²ñ F 12:b ++²ò F 13:b ++²ó F 14:b ++²ô F 15:b ++²õ F 16:b ++²ö F 17:b ++²÷ F 18:b ++²ø F 19:b ++²ù F 20:b ++²ú F 21:b ++²û F 22:b ++²ü F 23:b ++²ý F 24:b ++²þ F 25:b ++³¡ F 26:b ++³¢ F 27:b ++³£ F 28:b ++³¤ F 29:b ++³¥ F 30:b ++³¦ F 31:b ++³§ F 32:b ++³¨ F 33:b ++³© F 34:b ++³ª F 35:b ++³« F 36:b ++³¬ F 37:b ++³­ F 38:b ++³® F 39:b ++³¯ F 40:b ++³° F 41:b ++³± F 42:b ++³² F 43:b ++³³ F 44:b ++³´ F 45:b ++³µ F 46:b ++³¶ F 47:b ++³· F 48:b ++³¸ F 49:b ++³¹ F 50:b ++³º F 51:b ++³» F 52:b ++³¼ F 53:b ++³½ F 54:b ++³¾ F 55:b ++³¿ F 56:b ++³À F 57:b ++³Á F 58:b ++³Â F 59:b ++³Ã F 60:b ++³Ä F 61:b ++³Å F 62:b ++³Æ F 63:b ++³Ç F 64:b ++³È F 65:b ++³É F 66:b ++³Ê F 67:b ++³Ë F 68:b ++³Ì F 69:b ++³Í F 70:b ++³Î F 71:b ++³Ï F 72:b ++³Ð F 73:b ++³Ñ F 74:b ++³Ò F 75:b ++³Ó F 76:b ++³Ô F 77:b ++³Õ F 78:b ++³Ö F 79:b ++³× F 80:b ++³Ø F 81:b ++³Ù F 82:b ++³Ú F 83:b ++³Û F 84:b ++³Ü F 85:b ++³Ý F 86:b ++³Þ F 87:b ++³ß F 88:b ++³à F 89:b ++³á F 90:b ++³â F 91:b ++³ã F 92:b ++³ä F 93:b ++³å F 94:b ++³æ F 95:b ++³ç F 96:b ++³è F 97:b ++³é F 98:b ++³ê F 99:b ++³ë F 100:b ++³ì F 101:b ++³í F 102:b ++³î F 103:b ++³ï F 104:b ++³ð F 105:b ++³ñ F 106:b ++³ò F 107:b ++³ó F 108:b ++³ô F 109:b ++³õ F 110:b ++³ö F 111:b ++³÷ F 112:b ++³ø F 113:b ++³ù F 114:b ++³ú F 115:b ++³û F 116:b ++³ü F 117:b ++³ý F 118:b ++³þ F 119:b ++´¡ F 120:b ++´¢ F 121:b ++´£ F 122:b ++´¤ F 123:b ++´¥ F 124:b ++´¦ F 125:b ++´§ F 126:b ++´¨ F 127:b ++´© F 128:b ++´ª F 129:b ++´« F 130:b ++´¬ F 131:b ++´­ F 132:b ++´® F 133:b ++´¯ F 134:b ++´° F 135:b ++´± F 136:b ++´² F 137:b ++´³ F 138:b ++´´ F 139:b ++´µ F 140:b ++´¶ F 141:b ++´· F 142:b ++´¸ F 143:b ++´¹ F 144:b ++´º F 145:b ++´» F 146:b ++´¼ F 147:b ++´½ F 148:b ++´¾ F 149:b ++´¿ F 150:b ++´À F 151:b ++´Á F 152:b ++´Â F 153:b ++´Ã F 154:b ++´Ä F 155:b ++´Å F 156:b ++´Æ F 157:b ++´Ç F 158:b ++´È F 159:b ++´É F 160:b ++´Ê F 161:b ++´Ë F 162:b ++´Ì F 163:b ++´Í F 164:b ++´Î F 165:b ++´Ï F 166:b ++´Ð F 167:b ++´Ñ F 168:b ++´Ò F 169:b ++´Ó F 170:b ++´Ô F 171:b ++´Õ F 172:b ++´Ö F 173:b ++´× F 174:b ++´Ø F 175:b ++´Ù F 176:b ++´Ú F 177:b ++´Û F 178:b ++´Ü F 179:b ++´Ý F 180:b ++´Þ F 181:b ++´ß F 182:b ++´à F 183:b ++´á F 184:b ++´â F 185:b ++´ã F 186:b ++´ä F 187:b ++´å F 188:b ++´æ F 189:b ++´ç F 190:b ++´è F 191:b ++´é F 192:b ++´ê F 193:b ++´ë F 194:b ++´ì F 195:b ++´í F 196:b ++´î F 197:b ++´ï F 198:b ++´ð F 199:b ++´ñ F 200:b ++´ò F 201:b ++´ó F 202:b ++´ô F 203:b ++´õ F 204:b ++´ö F 205:b ++´÷ F 206:b ++´ø F 207:b ++´ù F 208:b ++´ú F 209:b ++´û F 210:b ++´ü F 211:b ++´ý F 212:b ++´þ F 213:b ++µ¡ F 214:b ++µ¢ F 215:b ++µ£ F 216:b ++µ¤ F 217:b ++µ¥ F 218:b ++µ¦ F 219:b ++µ§ F 220:b ++µ¨ F 221:b ++µ© F 222:b ++µª F 223:b ++µ« F 224:b ++µ¬ F 225:b ++µ­ F 226:b ++µ® F 227:b ++µ¯ F 228:b ++µ° F 229:b ++µ± F 230:b ++µ² F 231:b ++µ³ F 232:b ++µ´ F 233:b ++µµ F 234:b ++µ¶ F 235:b ++µ· F 236:b ++µ¸ F 237:b ++µ¹ F 238:b ++µº F 239:b ++µ» F 240:b ++µ¼ F 241:b ++µ½ F 242:b ++µ¾ F 243:b ++µ¿ F 244:b ++µÀ F 245:b ++µÁ F 246:b ++µÂ F 247:b ++µÃ F 248:b ++µÄ F 249:b ++µÅ F 250:b ++µÆ F 251:b ++µÇ F 252:b ++µÈ F 253:b ++µÉ F 254:b ++µÊ F 255:b ++µË F 0:c ++µÌ F 1:c ++µÍ F 2:c ++µÎ F 3:c ++µÏ F 4:c ++µÐ F 5:c ++µÑ F 6:c ++µÒ F 7:c ++µÓ F 8:c ++µÔ F 9:c ++µÕ F 10:c ++µÖ F 11:c ++µ× F 12:c ++µØ F 13:c ++µÙ F 14:c ++µÚ F 15:c ++µÛ F 16:c ++µÜ F 17:c ++µÝ F 18:c ++µÞ F 19:c ++µß F 20:c ++µà F 21:c ++µá F 22:c ++µâ F 23:c ++µã F 24:c ++µä F 25:c ++µå F 26:c ++µæ F 27:c ++µç F 28:c ++µè F 29:c ++µé F 30:c ++µê F 31:c ++µë F 32:c ++µì F 33:c ++µí F 34:c ++µî F 35:c ++µï F 36:c ++µð F 37:c ++µñ F 38:c ++µò F 39:c ++µó F 40:c ++µô F 41:c ++µõ F 42:c ++µö F 43:c ++µ÷ F 44:c ++µø F 45:c ++µù F 46:c ++µú F 47:c ++µû F 48:c ++µü F 49:c ++µý F 50:c ++µþ F 51:c ++¶¡ F 52:c ++¶¢ F 53:c ++¶£ F 54:c ++¶¤ F 55:c ++¶¥ F 56:c ++¶¦ F 57:c ++¶§ F 58:c ++¶¨ F 59:c ++¶© F 60:c ++¶ª F 61:c ++¶« F 62:c ++¶¬ F 63:c ++¶­ F 64:c ++¶® F 65:c ++¶¯ F 66:c ++¶° F 67:c ++¶± F 68:c ++¶² F 69:c ++¶³ F 70:c ++¶´ F 71:c ++¶µ F 72:c ++¶¶ F 73:c ++¶· F 74:c ++¶¸ F 75:c ++¶¹ F 76:c ++¶º F 77:c ++¶» F 78:c ++¶¼ F 79:c ++¶½ F 80:c ++¶¾ F 81:c ++¶¿ F 82:c ++¶À F 83:c ++¶Á F 84:c ++¶Â F 85:c ++¶Ã F 86:c ++¶Ä F 87:c ++¶Å F 88:c ++¶Æ F 89:c ++¶Ç F 90:c ++¶È F 91:c ++¶É F 92:c ++¶Ê F 93:c ++¶Ë F 94:c ++¶Ì F 95:c ++¶Í F 96:c ++¶Î F 97:c ++¶Ï F 98:c ++¶Ð F 99:c ++¶Ñ F 100:c ++¶Ò F 101:c ++¶Ó F 102:c ++¶Ô F 103:c ++¶Õ F 104:c ++¶Ö F 105:c ++¶× F 106:c ++¶Ø F 107:c ++¶Ù F 108:c ++¶Ú F 109:c ++¶Û F 110:c ++¶Ü F 111:c ++¶Ý F 112:c ++¶Þ F 113:c ++¶ß F 114:c ++¶à F 115:c ++¶á F 116:c ++¶â F 117:c ++¶ã F 118:c ++¶ä F 119:c ++¶å F 120:c ++¶æ F 121:c ++¶ç F 122:c ++¶è F 123:c ++¶é F 124:c ++¶ê F 125:c ++¶ë F 126:c ++¶ì F 127:c ++¶í F 128:c ++¶î F 129:c ++¶ï F 130:c ++¶ð F 131:c ++¶ñ F 132:c ++¶ò F 133:c ++¶ó F 134:c ++¶ô F 135:c ++¶õ F 136:c ++¶ö F 137:c ++¶÷ F 138:c ++¶ø F 139:c ++¶ù F 140:c ++¶ú F 141:c ++¶û F 142:c ++¶ü F 143:c ++¶ý F 144:c ++¶þ F 145:c ++·¡ F 146:c ++·¢ F 147:c ++·£ F 148:c ++·¤ F 149:c ++·¥ F 150:c ++·¦ F 151:c ++·§ F 152:c ++·¨ F 153:c ++·© F 154:c ++·ª F 155:c ++·« F 156:c ++·¬ F 157:c ++·­ F 158:c ++·® F 159:c ++·¯ F 160:c ++·° F 161:c ++·± F 162:c ++·² F 163:c ++·³ F 164:c ++·´ F 165:c ++·µ F 166:c ++·¶ F 167:c ++·· F 168:c ++·¸ F 169:c ++·¹ F 170:c ++·º F 171:c ++·» F 172:c ++·¼ F 173:c ++·½ F 174:c ++·¾ F 175:c ++·¿ F 176:c ++·À F 177:c ++·Á F 178:c ++·Â F 179:c ++·Ã F 180:c ++·Ä F 181:c ++·Å F 182:c ++·Æ F 183:c ++·Ç F 184:c ++·È F 185:c ++·É F 186:c ++·Ê F 187:c ++·Ë F 188:c ++·Ì F 189:c ++·Í F 190:c ++·Î F 191:c ++·Ï F 192:c ++·Ð F 193:c ++·Ñ F 194:c ++·Ò F 195:c ++·Ó F 196:c ++·Ô F 197:c ++·Õ F 198:c ++·Ö F 199:c ++·× F 200:c ++·Ø F 201:c ++·Ù F 202:c ++·Ú F 203:c ++·Û F 204:c ++·Ü F 205:c ++·Ý F 206:c ++·Þ F 207:c ++·ß F 208:c ++·à F 209:c ++·á F 210:c ++·â F 211:c ++·ã F 212:c ++·ä F 213:c ++·å F 214:c ++·æ F 215:c ++·ç F 216:c ++·è F 217:c ++·é F 218:c ++·ê F 219:c ++·ë F 220:c ++·ì F 221:c ++·í F 222:c ++·î F 223:c ++·ï F 224:c ++·ð F 225:c ++·ñ F 226:c ++·ò F 227:c ++·ó F 228:c ++·ô F 229:c ++·õ F 230:c ++·ö F 231:c ++·÷ F 232:c ++·ø F 233:c ++·ù F 234:c ++·ú F 235:c ++·û F 236:c ++·ü F 237:c ++·ý F 238:c ++·þ F 239:c ++¸¡ F 240:c ++¸¢ F 241:c ++¸£ F 242:c ++¸¤ F 243:c ++¸¥ F 244:c ++¸¦ F 245:c ++¸§ F 246:c ++¸¨ F 247:c ++¸© F 248:c ++¸ª F 249:c ++¸« F 250:c ++¸¬ F 251:c ++¸­ F 252:c ++¸® F 253:c ++¸¯ F 254:c ++¸° F 255:c ++¸± F 0:d ++¸² F 1:d ++¸³ F 2:d ++¸´ F 3:d ++¸µ F 4:d ++¸¶ F 5:d ++¸· F 6:d ++¸¸ F 7:d ++¸¹ F 8:d ++¸º F 9:d ++¸» F 10:d ++¸¼ F 11:d ++¸½ F 12:d ++¸¾ F 13:d ++¸¿ F 14:d ++¸À F 15:d ++¸Á F 16:d ++¸Â F 17:d ++¸Ã F 18:d ++¸Ä F 19:d ++¸Å F 20:d ++¸Æ F 21:d ++¸Ç F 22:d ++¸È F 23:d ++¸É F 24:d ++¸Ê F 25:d ++¸Ë F 26:d ++¸Ì F 27:d ++¸Í F 28:d ++¸Î F 29:d ++¸Ï F 30:d ++¸Ð F 31:d ++¸Ñ F 32:d ++¸Ò F 33:d ++¸Ó F 34:d ++¸Ô F 35:d ++¸Õ F 36:d ++¸Ö F 37:d ++¸× F 38:d ++¸Ø F 39:d ++¸Ù F 40:d ++¸Ú F 41:d ++¸Û F 42:d ++¸Ü F 43:d ++¸Ý F 44:d ++¸Þ F 45:d ++¸ß F 46:d ++¸à F 47:d ++¸á F 48:d ++¸â F 49:d ++¸ã F 50:d ++¸ä F 51:d ++¸å F 52:d ++¸æ F 53:d ++¸ç F 54:d ++¸è F 55:d ++¸é F 56:d ++¸ê F 57:d ++¸ë F 58:d ++¸ì F 59:d ++¸í F 60:d ++¸î F 61:d ++¸ï F 62:d ++¸ð F 63:d ++¸ñ F 64:d ++¸ò F 65:d ++¸ó F 66:d ++¸ô F 67:d ++¸õ F 68:d ++¸ö F 69:d ++¸÷ F 70:d ++¸ø F 71:d ++¸ù F 72:d ++¸ú F 73:d ++¸û F 74:d ++¸ü F 75:d ++¸ý F 76:d ++¸þ F 77:d ++¹¡ F 78:d ++¹¢ F 79:d ++¹£ F 80:d ++¹¤ F 81:d ++¹¥ F 82:d ++¹¦ F 83:d ++¹§ F 84:d ++¹¨ F 85:d ++¹© F 86:d ++¹ª F 87:d ++¹« F 88:d ++¹¬ F 89:d ++¹­ F 90:d ++¹® F 91:d ++¹¯ F 92:d ++¹° F 93:d ++¹± F 94:d ++¹² F 95:d ++¹³ F 96:d ++¹´ F 97:d ++¹µ F 98:d ++¹¶ F 99:d ++¹· F 100:d ++¹¸ F 101:d ++¹¹ F 102:d ++¹º F 103:d ++¹» F 104:d ++¹¼ F 105:d ++¹½ F 106:d ++¹¾ F 107:d ++¹¿ F 108:d ++¹À F 109:d ++¹Á F 110:d ++¹Â F 111:d ++¹Ã F 112:d ++¹Ä F 113:d ++¹Å F 114:d ++¹Æ F 115:d ++¹Ç F 116:d ++¹È F 117:d ++¹É F 118:d ++¹Ê F 119:d ++¹Ë F 120:d ++¹Ì F 121:d ++¹Í F 122:d ++¹Î F 123:d ++¹Ï F 124:d ++¹Ð F 125:d ++¹Ñ F 126:d ++¹Ò F 127:d ++¹Ó F 128:d ++¹Ô F 129:d ++¹Õ F 130:d ++¹Ö F 131:d ++¹× F 132:d ++¹Ø F 133:d ++¹Ù F 134:d ++¹Ú F 135:d ++¹Û F 136:d ++¹Ü F 137:d ++¹Ý F 138:d ++¹Þ F 139:d ++¹ß F 140:d ++¹à F 141:d ++¹á F 142:d ++¹â F 143:d ++¹ã F 144:d ++¹ä F 145:d ++¹å F 146:d ++¹æ F 147:d ++¹ç F 148:d ++¹è F 149:d ++¹é F 150:d ++¹ê F 151:d ++¹ë F 152:d ++¹ì F 153:d ++¹í F 154:d ++¹î F 155:d ++¹ï F 156:d ++¹ð F 157:d ++¹ñ F 158:d ++¹ò F 159:d ++¹ó F 160:d ++¹ô F 161:d ++¹õ F 162:d ++¹ö F 163:d ++¹÷ F 164:d ++¹ø F 165:d ++¹ù F 166:d ++¹ú F 167:d ++¹û F 168:d ++¹ü F 169:d ++¹ý F 170:d ++¹þ F 171:d ++º¡ F 172:d ++º¢ F 173:d ++º£ F 174:d ++º¤ F 175:d ++º¥ F 176:d ++º¦ F 177:d ++º§ F 178:d ++º¨ F 179:d ++º© F 180:d ++ºª F 181:d ++º« F 182:d ++º¬ F 183:d ++º­ F 184:d ++º® F 185:d ++º¯ F 186:d ++º° F 187:d ++º± F 188:d ++º² F 189:d ++º³ F 190:d ++º´ F 191:d ++ºµ F 192:d ++º¶ F 193:d ++º· F 194:d ++º¸ F 195:d ++º¹ F 196:d ++ºº F 197:d ++º» F 198:d ++º¼ F 199:d ++º½ F 200:d ++º¾ F 201:d ++º¿ F 202:d ++ºÀ F 203:d ++ºÁ F 204:d ++ºÂ F 205:d ++ºÃ F 206:d ++ºÄ F 207:d ++ºÅ F 208:d ++ºÆ F 209:d ++ºÇ F 210:d ++ºÈ F 211:d ++ºÉ F 212:d ++ºÊ F 213:d ++ºË F 214:d ++ºÌ F 215:d ++ºÍ F 216:d ++ºÎ F 217:d ++ºÏ F 218:d ++ºÐ F 219:d ++ºÑ F 220:d ++ºÒ F 221:d ++ºÓ F 222:d ++ºÔ F 223:d ++ºÕ F 224:d ++ºÖ F 225:d ++º× F 226:d ++ºØ F 227:d ++ºÙ F 228:d ++ºÚ F 229:d ++ºÛ F 230:d ++ºÜ F 231:d ++ºÝ F 232:d ++ºÞ F 233:d ++ºß F 234:d ++ºà F 235:d ++ºá F 236:d ++ºâ F 237:d ++ºã F 238:d ++ºä F 239:d ++ºå F 240:d ++ºæ F 241:d ++ºç F 242:d ++ºè F 243:d ++ºé F 244:d ++ºê F 245:d ++ºë F 246:d ++ºì F 247:d ++ºí F 248:d ++ºî F 249:d ++ºï F 250:d ++ºð F 251:d ++ºñ F 252:d ++ºò F 253:d ++ºó F 254:d ++ºô F 255:d ++ºõ F 0:e ++ºö F 1:e ++º÷ F 2:e ++ºø F 3:e ++ºù F 4:e ++ºú F 5:e ++ºû F 6:e ++ºü F 7:e ++ºý F 8:e ++ºþ F 9:e ++»¡ F 10:e ++»¢ F 11:e ++»£ F 12:e ++»¤ F 13:e ++»¥ F 14:e ++»¦ F 15:e ++»§ F 16:e ++»¨ F 17:e ++»© F 18:e ++»ª F 19:e ++»« F 20:e ++»¬ F 21:e ++»­ F 22:e ++»® F 23:e ++»¯ F 24:e ++»° F 25:e ++»± F 26:e ++»² F 27:e ++»³ F 28:e ++»´ F 29:e ++»µ F 30:e ++»¶ F 31:e ++»· F 32:e ++»¸ F 33:e ++»¹ F 34:e ++»º F 35:e ++»» F 36:e ++»¼ F 37:e ++»½ F 38:e ++»¾ F 39:e ++»¿ F 40:e ++»À F 41:e ++»Á F 42:e ++»Â F 43:e ++»Ã F 44:e ++»Ä F 45:e ++»Å F 46:e ++»Æ F 47:e ++»Ç F 48:e ++»È F 49:e ++»É F 50:e ++»Ê F 51:e ++»Ë F 52:e ++»Ì F 53:e ++»Í F 54:e ++»Î F 55:e ++»Ï F 56:e ++»Ð F 57:e ++»Ñ F 58:e ++»Ò F 59:e ++»Ó F 60:e ++»Ô F 61:e ++»Õ F 62:e ++»Ö F 63:e ++»× F 64:e ++»Ø F 65:e ++»Ù F 66:e ++»Ú F 67:e ++»Û F 68:e ++»Ü F 69:e ++»Ý F 70:e ++»Þ F 71:e ++»ß F 72:e ++»à F 73:e ++»á F 74:e ++»â F 75:e ++»ã F 76:e ++»ä F 77:e ++»å F 78:e ++»æ F 79:e ++»ç F 80:e ++»è F 81:e ++»é F 82:e ++»ê F 83:e ++»ë F 84:e ++»ì F 85:e ++»í F 86:e ++»î F 87:e ++»ï F 88:e ++»ð F 89:e ++»ñ F 90:e ++»ò F 91:e ++»ó F 92:e ++»ô F 93:e ++»õ F 94:e ++»ö F 95:e ++»÷ F 96:e ++»ø F 97:e ++»ù F 98:e ++»ú F 99:e ++»û F 100:e ++»ü F 101:e ++»ý F 102:e ++»þ F 103:e ++¼¡ F 104:e ++¼¢ F 105:e ++¼£ F 106:e ++¼¤ F 107:e ++¼¥ F 108:e ++¼¦ F 109:e ++¼§ F 110:e ++¼¨ F 111:e ++¼© F 112:e ++¼ª F 113:e ++¼« F 114:e ++¼¬ F 115:e ++¼­ F 116:e ++¼® F 117:e ++¼¯ F 118:e ++¼° F 119:e ++¼± F 120:e ++¼² F 121:e ++¼³ F 122:e ++¼´ F 123:e ++¼µ F 124:e ++¼¶ F 125:e ++¼· F 126:e ++¼¸ F 127:e ++¼¹ F 128:e ++¼º F 129:e ++¼» F 130:e ++¼¼ F 131:e ++¼½ F 132:e ++¼¾ F 133:e ++¼¿ F 134:e ++¼À F 135:e ++¼Á F 136:e ++¼Â F 137:e ++¼Ã F 138:e ++¼Ä F 139:e ++¼Å F 140:e ++¼Æ F 141:e ++¼Ç F 142:e ++¼È F 143:e ++¼É F 144:e ++¼Ê F 145:e ++¼Ë F 146:e ++¼Ì F 147:e ++¼Í F 148:e ++¼Î F 149:e ++¼Ï F 150:e ++¼Ð F 151:e ++¼Ñ F 152:e ++¼Ò F 153:e ++¼Ó F 154:e ++¼Ô F 155:e ++¼Õ F 156:e ++¼Ö F 157:e ++¼× F 158:e ++¼Ø F 159:e ++¼Ù F 160:e ++¼Ú F 161:e ++¼Û F 162:e ++¼Ü F 163:e ++¼Ý F 164:e ++¼Þ F 165:e ++¼ß F 166:e ++¼à F 167:e ++¼á F 168:e ++¼â F 169:e ++¼ã F 170:e ++¼ä F 171:e ++¼å F 172:e ++¼æ F 173:e ++¼ç F 174:e ++¼è F 175:e ++¼é F 176:e ++¼ê F 177:e ++¼ë F 178:e ++¼ì F 179:e ++¼í F 180:e ++¼î F 181:e ++¼ï F 182:e ++¼ð F 183:e ++¼ñ F 184:e ++¼ò F 185:e ++¼ó F 186:e ++¼ô F 187:e ++¼õ F 188:e ++¼ö F 189:e ++¼÷ F 190:e ++¼ø F 191:e ++¼ù F 192:e ++¼ú F 193:e ++¼û F 194:e ++¼ü F 195:e ++¼ý F 196:e ++¼þ F 197:e ++½¡ F 198:e ++½¢ F 199:e ++½£ F 200:e ++½¤ F 201:e ++½¥ F 202:e ++½¦ F 203:e ++½§ F 204:e ++½¨ F 205:e ++½© F 206:e ++½ª F 207:e ++½« F 208:e ++½¬ F 209:e ++½­ F 210:e ++½® F 211:e ++½¯ F 212:e ++½° F 213:e ++½± F 214:e ++½² F 215:e ++½³ F 216:e ++½´ F 217:e ++½µ F 218:e ++½¶ F 219:e ++½· F 220:e ++½¸ F 221:e ++½¹ F 222:e ++½º F 223:e ++½» F 224:e ++½¼ F 225:e ++½½ F 226:e ++½¾ F 227:e ++½¿ F 228:e ++½À F 229:e ++½Á F 230:e ++½Â F 231:e ++½Ã F 232:e ++½Ä F 233:e ++½Å F 234:e ++½Æ F 235:e ++½Ç F 236:e ++½È F 237:e ++½É F 238:e ++½Ê F 239:e ++½Ë F 240:e ++½Ì F 241:e ++½Í F 242:e ++½Î F 243:e ++½Ï F 244:e ++½Ð F 245:e ++½Ñ F 246:e ++½Ò F 247:e ++½Ó F 248:e ++½Ô F 249:e ++½Õ F 250:e ++½Ö F 251:e ++½× F 252:e ++½Ø F 253:e ++½Ù F 254:e ++½Ú F 255:e ++½Û F 0:f ++½Ü F 1:f ++½Ý F 2:f ++½Þ F 3:f ++½ß F 4:f ++½à F 5:f ++½á F 6:f ++½â F 7:f ++½ã F 8:f ++½ä F 9:f ++½å F 10:f ++½æ F 11:f ++½ç F 12:f ++½è F 13:f ++½é F 14:f ++½ê F 15:f ++½ë F 16:f ++½ì F 17:f ++½í F 18:f ++½î F 19:f ++½ï F 20:f ++½ð F 21:f ++½ñ F 22:f ++½ò F 23:f ++½ó F 24:f ++½ô F 25:f ++½õ F 26:f ++½ö F 27:f ++½÷ F 28:f ++½ø F 29:f ++½ù F 30:f ++½ú F 31:f ++½û F 32:f ++½ü F 33:f ++½ý F 34:f ++½þ F 35:f ++¾¡ F 36:f ++¾¢ F 37:f ++¾£ F 38:f ++¾¤ F 39:f ++¾¥ F 40:f ++¾¦ F 41:f ++¾§ F 42:f ++¾¨ F 43:f ++¾© F 44:f ++¾ª F 45:f ++¾« F 46:f ++¾¬ F 47:f ++¾­ F 48:f ++¾® F 49:f ++¾¯ F 50:f ++¾° F 51:f ++¾± F 52:f ++¾² F 53:f ++¾³ F 54:f ++¾´ F 55:f ++¾µ F 56:f ++¾¶ F 57:f ++¾· F 58:f ++¾¸ F 59:f ++¾¹ F 60:f ++¾º F 61:f ++¾» F 62:f ++¾¼ F 63:f ++¾½ F 64:f ++¾¾ F 65:f ++¾¿ F 66:f ++¾À F 67:f ++¾Á F 68:f ++¾Â F 69:f ++¾Ã F 70:f ++¾Ä F 71:f ++¾Å F 72:f ++¾Æ F 73:f ++¾Ç F 74:f ++¾È F 75:f ++¾É F 76:f ++¾Ê F 77:f ++¾Ë F 78:f ++¾Ì F 79:f ++¾Í F 80:f ++¾Î F 81:f ++¾Ï F 82:f ++¾Ð F 83:f ++¾Ñ F 84:f ++¾Ò F 85:f ++¾Ó F 86:f ++¾Ô F 87:f ++¾Õ F 88:f ++¾Ö F 89:f ++¾× F 90:f ++¾Ø F 91:f ++¾Ù F 92:f ++¾Ú F 93:f ++¾Û F 94:f ++¾Ü F 95:f ++¾Ý F 96:f ++¾Þ F 97:f ++¾ß F 98:f ++¾à F 99:f ++¾á F 100:f ++¾â F 101:f ++¾ã F 102:f ++¾ä F 103:f ++¾å F 104:f ++¾æ F 105:f ++¾ç F 106:f ++¾è F 107:f ++¾é F 108:f ++¾ê F 109:f ++¾ë F 110:f ++¾ì F 111:f ++¾í F 112:f ++¾î F 113:f ++¾ï F 114:f ++¾ð F 115:f ++¾ñ F 116:f ++¾ò F 117:f ++¾ó F 118:f ++¾ô F 119:f ++¾õ F 120:f ++¾ö F 121:f ++¾÷ F 122:f ++¾ø F 123:f ++¾ù F 124:f ++¾ú F 125:f ++¾û F 126:f ++¾ü F 127:f ++¾ý F 128:f ++¾þ F 129:f ++¿¡ F 130:f ++¿¢ F 131:f ++¿£ F 132:f ++¿¤ F 133:f ++¿¥ F 134:f ++¿¦ F 135:f ++¿§ F 136:f ++¿¨ F 137:f ++¿© F 138:f ++¿ª F 139:f ++¿« F 140:f ++¿¬ F 141:f ++¿­ F 142:f ++¿® F 143:f ++¿¯ F 144:f ++¿° F 145:f ++¿± F 146:f ++¿² F 147:f ++¿³ F 148:f ++¿´ F 149:f ++¿µ F 150:f ++¿¶ F 151:f ++¿· F 152:f ++¿¸ F 153:f ++¿¹ F 154:f ++¿º F 155:f ++¿» F 156:f ++¿¼ F 157:f ++¿½ F 158:f ++¿¾ F 159:f ++¿¿ F 160:f ++¿À F 161:f ++¿Á F 162:f ++¿Â F 163:f ++¿Ã F 164:f ++¿Ä F 165:f ++¿Å F 166:f ++¿Æ F 167:f ++¿Ç F 168:f ++¿È F 169:f ++¿É F 170:f ++¿Ê F 171:f ++¿Ë F 172:f ++¿Ì F 173:f ++¿Í F 174:f ++¿Î F 175:f ++¿Ï F 176:f ++¿Ð F 177:f ++¿Ñ F 178:f ++¿Ò F 179:f ++¿Ó F 180:f ++¿Ô F 181:f ++¿Õ F 182:f ++¿Ö F 183:f ++¿× F 184:f ++¿Ø F 185:f ++¿Ù F 186:f ++¿Ú F 187:f ++¿Û F 188:f ++¿Ü F 189:f ++¿Ý F 190:f ++¿Þ F 191:f ++¿ß F 192:f ++¿à F 193:f ++¿á F 194:f ++¿â F 195:f ++¿ã F 196:f ++¿ä F 197:f ++¿å F 198:f ++¿æ F 199:f ++¿ç F 200:f ++¿è F 201:f ++¿é F 202:f ++¿ê F 203:f ++¿ë F 204:f ++¿ì F 205:f ++¿í F 206:f ++¿î F 207:f ++¿ï F 208:f ++¿ð F 209:f ++¿ñ F 210:f ++¿ò F 211:f ++¿ó F 212:f ++¿ô F 213:f ++¿õ F 214:f ++¿ö F 215:f ++¿÷ F 216:f ++¿ø F 217:f ++¿ù F 218:f ++¿ú F 219:f ++¿û F 220:f ++¿ü F 221:f ++¿ý F 222:f ++¿þ F 223:f ++À¡ F 224:f ++À¢ F 225:f ++À£ F 226:f ++À¤ F 227:f ++À¥ F 228:f ++À¦ F 229:f ++À§ F 230:f ++À¨ F 231:f ++À© F 232:f ++Àª F 233:f ++À« F 234:f ++À¬ F 235:f ++À­ F 236:f ++À® F 237:f ++À¯ F 238:f ++À° F 239:f ++À± F 240:f ++À² F 241:f ++À³ F 242:f ++À´ F 243:f ++Àµ F 244:f ++À¶ F 245:f ++À· F 246:f ++À¸ F 247:f ++À¹ F 248:f ++Àº F 249:f ++À» F 250:f ++À¼ F 251:f ++À½ F 252:f ++À¾ F 253:f ++À¿ F 254:f ++ÀÀ F 255:f ++ÀÁ F 0:g ++À F 1:g ++Àà F 2:g ++ÀÄ F 3:g ++ÀÅ F 4:g ++ÀÆ F 5:g ++ÀÇ F 6:g ++ÀÈ F 7:g ++ÀÉ F 8:g ++ÀÊ F 9:g ++ÀË F 10:g ++ÀÌ F 11:g ++ÀÍ F 12:g ++ÀÎ F 13:g ++ÀÏ F 14:g ++ÀÐ F 15:g ++ÀÑ F 16:g ++ÀÒ F 17:g ++ÀÓ F 18:g ++ÀÔ F 19:g ++ÀÕ F 20:g ++ÀÖ F 21:g ++À× F 22:g ++ÀØ F 23:g ++ÀÙ F 24:g ++ÀÚ F 25:g ++ÀÛ F 26:g ++ÀÜ F 27:g ++ÀÝ F 28:g ++ÀÞ F 29:g ++Àß F 30:g ++Àà F 31:g ++Àá F 32:g ++Àâ F 33:g ++Àã F 34:g ++Àä F 35:g ++Àå F 36:g ++Àæ F 37:g ++Àç F 38:g ++Àè F 39:g ++Àé F 40:g ++Àê F 41:g ++Àë F 42:g ++Àì F 43:g ++Àí F 44:g ++Àî F 45:g ++Àï F 46:g ++Àð F 47:g ++Àñ F 48:g ++Àò F 49:g ++Àó F 50:g ++Àô F 51:g ++Àõ F 52:g ++Àö F 53:g ++À÷ F 54:g ++Àø F 55:g ++Àù F 56:g ++Àú F 57:g ++Àû F 58:g ++Àü F 59:g ++Àý F 60:g ++Àþ F 61:g ++Á¡ F 62:g ++Á¢ F 63:g ++Á£ F 64:g ++Á¤ F 65:g ++Á¥ F 66:g ++Á¦ F 67:g ++Á§ F 68:g ++Á¨ F 69:g ++Á© F 70:g ++Áª F 71:g ++Á« F 72:g ++Á¬ F 73:g ++Á­ F 74:g ++Á® F 75:g ++Á¯ F 76:g ++Á° F 77:g ++Á± F 78:g ++Á² F 79:g ++Á³ F 80:g ++Á´ F 81:g ++Áµ F 82:g ++Á¶ F 83:g ++Á· F 84:g ++Á¸ F 85:g ++Á¹ F 86:g ++Áº F 87:g ++Á» F 88:g ++Á¼ F 89:g ++Á½ F 90:g ++Á¾ F 91:g ++Á¿ F 92:g ++ÁÀ F 93:g ++ÁÁ F 94:g ++Á F 95:g ++Áà F 96:g ++ÁÄ F 97:g ++ÁÅ F 98:g ++ÁÆ F 99:g ++ÁÇ F 100:g ++ÁÈ F 101:g ++ÁÉ F 102:g ++ÁÊ F 103:g ++ÁË F 104:g ++ÁÌ F 105:g ++ÁÍ F 106:g ++ÁÎ F 107:g ++ÁÏ F 108:g ++ÁÐ F 109:g ++ÁÑ F 110:g ++ÁÒ F 111:g ++ÁÓ F 112:g ++ÁÔ F 113:g ++ÁÕ F 114:g ++ÁÖ F 115:g ++Á× F 116:g ++ÁØ F 117:g ++ÁÙ F 118:g ++ÁÚ F 119:g ++ÁÛ F 120:g ++ÁÜ F 121:g ++ÁÝ F 122:g ++ÁÞ F 123:g ++Áß F 124:g ++Áà F 125:g ++Áá F 126:g ++Áâ F 127:g ++Áã F 128:g ++Áä F 129:g ++Áå F 130:g ++Áæ F 131:g ++Áç F 132:g ++Áè F 133:g ++Áé F 134:g ++Áê F 135:g ++Áë F 136:g ++Áì F 137:g ++Áí F 138:g ++Áî F 139:g ++Áï F 140:g ++Áð F 141:g ++Áñ F 142:g ++Áò F 143:g ++Áó F 144:g ++Áô F 145:g ++Áõ F 146:g ++Áö F 147:g ++Á÷ F 148:g ++Áø F 149:g ++Áù F 150:g ++Áú F 151:g ++Áû F 152:g ++Áü F 153:g ++Áý F 154:g ++Áþ F 155:g ++¡ F 156:g ++¢ F 157:g ++£ F 158:g ++¤ F 159:g ++Â¥ F 160:g ++¦ F 161:g ++§ F 162:g ++¨ F 163:g ++© F 164:g ++ª F 165:g ++« F 166:g ++¬ F 167:g ++­ F 168:g ++® F 169:g ++¯ F 170:g ++° F 171:g ++± F 172:g ++² F 173:g ++³ F 174:g ++´ F 175:g ++µ F 176:g ++¶ F 177:g ++· F 178:g ++¸ F 179:g ++¹ F 180:g ++º F 181:g ++» F 182:g ++¼ F 183:g ++½ F 184:g ++¾ F 185:g ++¿ F 186:g ++ÂÀ F 187:g ++ÂÁ F 188:g ++ F 189:g ++Âà F 190:g ++ÂÄ F 191:g ++ÂÅ F 192:g ++ÂÆ F 193:g ++ÂÇ F 194:g ++ÂÈ F 195:g ++ÂÉ F 196:g ++ÂÊ F 197:g ++ÂË F 198:g ++ÂÌ F 199:g ++ÂÍ F 200:g ++ÂÎ F 201:g ++ÂÏ F 202:g ++ÂÐ F 203:g ++ÂÑ F 204:g ++ÂÒ F 205:g ++ÂÓ F 206:g ++ÂÔ F 207:g ++ÂÕ F 208:g ++ÂÖ F 209:g ++Â× F 210:g ++ÂØ F 211:g ++ÂÙ F 212:g ++ÂÚ F 213:g ++ÂÛ F 214:g ++ÂÜ F 215:g ++ÂÝ F 216:g ++ÂÞ F 217:g ++Âß F 218:g ++Âà F 219:g ++Âá F 220:g ++Ââ F 221:g ++Âã F 222:g ++Âä F 223:g ++Âå F 224:g ++Âæ F 225:g ++Âç F 226:g ++Âè F 227:g ++Âé F 228:g ++Âê F 229:g ++Âë F 230:g ++Âì F 231:g ++Âí F 232:g ++Âî F 233:g ++Âï F 234:g ++Âð F 235:g ++Âñ F 236:g ++Âò F 237:g ++Âó F 238:g ++Âô F 239:g ++Âõ F 240:g ++Âö F 241:g ++Â÷ F 242:g ++Âø F 243:g ++Âù F 244:g ++Âú F 245:g ++Âû F 246:g ++Âü F 247:g ++Âý F 248:g ++Âþ F 249:g ++á F 250:g ++â F 251:g ++ã F 252:g ++ä F 253:g ++Ã¥ F 254:g ++æ F 255:g ++ç F 0:h ++è F 1:h ++é F 2:h ++ê F 3:h ++ë F 4:h ++ì F 5:h ++í F 6:h ++î F 7:h ++ï F 8:h ++ð F 9:h ++ñ F 10:h ++ò F 11:h ++ó F 12:h ++ô F 13:h ++õ F 14:h ++ö F 15:h ++÷ F 16:h ++ø F 17:h ++ù F 18:h ++ú F 19:h ++û F 20:h ++ü F 21:h ++ý F 22:h ++þ F 23:h ++ÿ F 24:h ++ÃÀ F 25:h ++ÃÁ F 26:h ++àF 27:h ++Ãà F 28:h ++ÃÄ F 29:h ++ÃÅ F 30:h ++ÃÆ F 31:h ++ÃÇ F 32:h ++ÃÈ F 33:h ++ÃÉ F 34:h ++ÃÊ F 35:h ++ÃË F 36:h ++ÃÌ F 37:h ++ÃÍ F 38:h ++ÃÎ F 39:h ++ÃÏ F 40:h ++ÃÐ F 41:h ++ÃÑ F 42:h ++ÃÒ F 43:h ++ÃÓ F 44:h ++ÃÔ F 45:h ++ÃÕ F 46:h ++ÃÖ F 47:h ++Ã× F 48:h ++ÃØ F 49:h ++ÃÙ F 50:h ++ÃÚ F 51:h ++ÃÛ F 52:h ++ÃÜ F 53:h ++ÃÝ F 54:h ++ÃÞ F 55:h ++Ãß F 56:h ++Ãà F 57:h ++Ãá F 58:h ++Ãâ F 59:h ++Ãã F 60:h ++Ãä F 61:h ++Ãå F 62:h ++Ãæ F 63:h ++Ãç F 64:h ++Ãè F 65:h ++Ãé F 66:h ++Ãê F 67:h ++Ãë F 68:h ++Ãì F 69:h ++Ãí F 70:h ++Ãî F 71:h ++Ãï F 72:h ++Ãð F 73:h ++Ãñ F 74:h ++Ãò F 75:h ++Ãó F 76:h ++Ãô F 77:h ++Ãõ F 78:h ++Ãö F 79:h ++Ã÷ F 80:h ++Ãø F 81:h ++Ãù F 82:h ++Ãú F 83:h ++Ãû F 84:h ++Ãü F 85:h ++Ãý F 86:h ++Ãþ F 87:h ++Ä¡ F 88:h ++Ä¢ F 89:h ++Ä£ F 90:h ++Ĥ F 91:h ++Ä¥ F 92:h ++Ħ F 93:h ++ħ F 94:h ++Ĩ F 95:h ++Ä© F 96:h ++Ī F 97:h ++Ä« F 98:h ++Ĭ F 99:h ++Ä­ F 100:h ++Ä® F 101:h ++į F 102:h ++İ F 103:h ++ı F 104:h ++IJ F 105:h ++ij F 106:h ++Ä´ F 107:h ++ĵ F 108:h ++Ķ F 109:h ++Ä· F 110:h ++ĸ F 111:h ++Ĺ F 112:h ++ĺ F 113:h ++Ä» F 114:h ++ļ F 115:h ++Ľ F 116:h ++ľ F 117:h ++Ä¿ F 118:h ++ÄÀ F 119:h ++ÄÁ F 120:h ++Ä F 121:h ++Äà F 122:h ++ÄÄ F 123:h ++ÄÅ F 124:h ++ÄÆ F 125:h ++ÄÇ F 126:h ++ÄÈ F 127:h ++ÄÉ F 128:h ++ÄÊ F 129:h ++ÄË F 130:h ++ÄÌ F 131:h ++ÄÍ F 132:h ++ÄÎ F 133:h ++ÄÏ F 134:h ++ÄÐ F 135:h ++ÄÑ F 136:h ++ÄÒ F 137:h ++ÄÓ F 138:h ++ÄÔ F 139:h ++ÄÕ F 140:h ++ÄÖ F 141:h ++Ä× F 142:h ++ÄØ F 143:h ++ÄÙ F 144:h ++ÄÚ F 145:h ++ÄÛ F 146:h ++ÄÜ F 147:h ++ÄÝ F 148:h ++ÄÞ F 149:h ++Äß F 150:h ++Äà F 151:h ++Äá F 152:h ++Äâ F 153:h ++Äã F 154:h ++Ää F 155:h ++Äå F 156:h ++Äæ F 157:h ++Äç F 158:h ++Äè F 159:h ++Äé F 160:h ++Äê F 161:h ++Äë F 162:h ++Äì F 163:h ++Äí F 164:h ++Äî F 165:h ++Äï F 166:h ++Äð F 167:h ++Äñ F 168:h ++Äò F 169:h ++Äó F 170:h ++Äô F 171:h ++Äõ F 172:h ++Äö F 173:h ++Ä÷ F 174:h ++Äø F 175:h ++Äù F 176:h ++Äú F 177:h ++Äû F 178:h ++Äü F 179:h ++Äý F 180:h ++Äþ F 181:h ++Å¡ F 182:h ++Å¢ F 183:h ++Å£ F 184:h ++Ť F 185:h ++Å¥ F 186:h ++Ŧ F 187:h ++ŧ F 188:h ++Ũ F 189:h ++Å© F 190:h ++Ū F 191:h ++Å« F 192:h ++Ŭ F 193:h ++Å­ F 194:h ++Å® F 195:h ++ů F 196:h ++Ű F 197:h ++ű F 198:h ++Ų F 199:h ++ų F 200:h ++Å´ F 201:h ++ŵ F 202:h ++Ŷ F 203:h ++Å· F 204:h ++Ÿ F 205:h ++Ź F 206:h ++ź F 207:h ++Å» F 208:h ++ż F 209:h ++Ž F 210:h ++ž F 211:h ++Å¿ F 212:h ++ÅÀ F 213:h ++ÅÁ F 214:h ++Å F 215:h ++Åà F 216:h ++ÅÄ F 217:h ++ÅÅ F 218:h ++ÅÆ F 219:h ++ÅÇ F 220:h ++ÅÈ F 221:h ++ÅÉ F 222:h ++ÅÊ F 223:h ++ÅË F 224:h ++ÅÌ F 225:h ++ÅÍ F 226:h ++ÅÎ F 227:h ++ÅÏ F 228:h ++ÅÐ F 229:h ++ÅÑ F 230:h ++ÅÒ F 231:h ++ÅÓ F 232:h ++ÅÔ F 233:h ++ÅÕ F 234:h ++ÅÖ F 235:h ++Å× F 236:h ++ÅØ F 237:h ++ÅÙ F 238:h ++ÅÚ F 239:h ++ÅÛ F 240:h ++ÅÜ F 241:h ++ÅÝ F 242:h ++ÅÞ F 243:h ++Åß F 244:h ++Åà F 245:h ++Åá F 246:h ++Åâ F 247:h ++Åã F 248:h ++Åä F 249:h ++Åå F 250:h ++Åæ F 251:h ++Åç F 252:h ++Åè F 253:h ++Åé F 254:h ++Åê F 255:h ++Åë F 0:i ++Åì F 1:i ++Åí F 2:i ++Åî F 3:i ++Åï F 4:i ++Åð F 5:i ++Åñ F 6:i ++Åò F 7:i ++Åó F 8:i ++Åô F 9:i ++Åõ F 10:i ++Åö F 11:i ++Å÷ F 12:i ++Åø F 13:i ++Åù F 14:i ++Åú F 15:i ++Åû F 16:i ++Åü F 17:i ++Åý F 18:i ++Åþ F 19:i ++Æ¡ F 20:i ++Æ¢ F 21:i ++Æ£ F 22:i ++Ƥ F 23:i ++Æ¥ F 24:i ++Ʀ F 25:i ++Ƨ F 26:i ++ƨ F 27:i ++Æ© F 28:i ++ƪ F 29:i ++Æ« F 30:i ++Ƭ F 31:i ++Æ­ F 32:i ++Æ® F 33:i ++Ư F 34:i ++ư F 35:i ++Ʊ F 36:i ++Ʋ F 37:i ++Ƴ F 38:i ++Æ´ F 39:i ++Ƶ F 40:i ++ƶ F 41:i ++Æ· F 42:i ++Ƹ F 43:i ++ƹ F 44:i ++ƺ F 45:i ++Æ» F 46:i ++Ƽ F 47:i ++ƽ F 48:i ++ƾ F 49:i ++Æ¿ F 50:i ++ÆÀ F 51:i ++ÆÁ F 52:i ++ÆÂ F 53:i ++ÆÃ F 54:i ++ÆÄ F 55:i ++ÆÅ F 56:i ++ÆÆ F 57:i ++ÆÇ F 58:i ++ÆÈ F 59:i ++ÆÉ F 60:i ++ÆÊ F 61:i ++ÆË F 62:i ++ÆÌ F 63:i ++ÆÍ F 64:i ++ÆÎ F 65:i ++ÆÏ F 66:i ++ÆÐ F 67:i ++ÆÑ F 68:i ++ÆÒ F 69:i ++ÆÓ F 70:i ++ÆÔ F 71:i ++ÆÕ F 72:i ++ÆÖ F 73:i ++Æ× F 74:i ++ÆØ F 75:i ++ÆÙ F 76:i ++ÆÚ F 77:i ++ÆÛ F 78:i ++ÆÜ F 79:i ++ÆÝ F 80:i ++ÆÞ F 81:i ++Æß F 82:i ++Æà F 83:i ++Æá F 84:i ++Æâ F 85:i ++Æã F 86:i ++Æä F 87:i ++Æå F 88:i ++Ææ F 89:i ++Æç F 90:i ++Æè F 91:i ++Æé F 92:i ++Æê F 93:i ++Æë F 94:i ++Æì F 95:i ++Æí F 96:i ++Æî F 97:i ++Æï F 98:i ++Æð F 99:i ++Æñ F 100:i ++Æò F 101:i ++Æó F 102:i ++Æô F 103:i ++Æõ F 104:i ++Æö F 105:i ++Æ÷ F 106:i ++Æø F 107:i ++Æù F 108:i ++Æú F 109:i ++Æû F 110:i ++Æü F 111:i ++Æý F 112:i ++Æþ F 113:i ++Ç¡ F 114:i ++Ç¢ F 115:i ++Ç£ F 116:i ++Ǥ F 117:i ++Ç¥ F 118:i ++Ǧ F 119:i ++ǧ F 120:i ++Ǩ F 121:i ++Ç© F 122:i ++Ǫ F 123:i ++Ç« F 124:i ++Ǭ F 125:i ++Ç­ F 126:i ++Ç® F 127:i ++ǯ F 128:i ++ǰ F 129:i ++DZ F 130:i ++Dz F 131:i ++dz F 132:i ++Ç´ F 133:i ++ǵ F 134:i ++Ƕ F 135:i ++Ç· F 136:i ++Ǹ F 137:i ++ǹ F 138:i ++Ǻ F 139:i ++Ç» F 140:i ++Ǽ F 141:i ++ǽ F 142:i ++Ǿ F 143:i ++Ç¿ F 144:i ++ÇÀ F 145:i ++ÇÁ F 146:i ++Ç F 147:i ++Çà F 148:i ++ÇÄ F 149:i ++ÇÅ F 150:i ++ÇÆ F 151:i ++ÇÇ F 152:i ++ÇÈ F 153:i ++ÇÉ F 154:i ++ÇÊ F 155:i ++ÇË F 156:i ++ÇÌ F 157:i ++ÇÍ F 158:i ++ÇÎ F 159:i ++ÇÏ F 160:i ++ÇÐ F 161:i ++ÇÑ F 162:i ++ÇÒ F 163:i ++ÇÓ F 164:i ++ÇÔ F 165:i ++ÇÕ F 166:i ++ÇÖ F 167:i ++Ç× F 168:i ++ÇØ F 169:i ++ÇÙ F 170:i ++ÇÚ F 171:i ++ÇÛ F 172:i ++ÇÜ F 173:i ++ÇÝ F 174:i ++ÇÞ F 175:i ++Çß F 176:i ++Çà F 177:i ++Çá F 178:i ++Çâ F 179:i ++Çã F 180:i ++Çä F 181:i ++Çå F 182:i ++Çæ F 183:i ++Çç F 184:i ++Çè F 185:i ++Çé F 186:i ++Çê F 187:i ++Çë F 188:i ++Çì F 189:i ++Çí F 190:i ++Çî F 191:i ++Çï F 192:i ++Çð F 193:i ++Çñ F 194:i ++Çò F 195:i ++Çó F 196:i ++Çô F 197:i ++Çõ F 198:i ++Çö F 199:i ++Ç÷ F 200:i ++Çø F 201:i ++Çù F 202:i ++Çú F 203:i ++Çû F 204:i ++Çü F 205:i ++Çý F 206:i ++Çþ F 207:i ++È¡ F 208:i ++È¢ F 209:i ++È£ F 210:i ++Ȥ F 211:i ++È¥ F 212:i ++Ȧ F 213:i ++ȧ F 214:i ++Ȩ F 215:i ++È© F 216:i ++Ȫ F 217:i ++È« F 218:i ++Ȭ F 219:i ++È­ F 220:i ++È® F 221:i ++ȯ F 222:i ++Ȱ F 223:i ++ȱ F 224:i ++Ȳ F 225:i ++ȳ F 226:i ++È´ F 227:i ++ȵ F 228:i ++ȶ F 229:i ++È· F 230:i ++ȸ F 231:i ++ȹ F 232:i ++Ⱥ F 233:i ++È» F 234:i ++ȼ F 235:i ++Ƚ F 236:i ++Ⱦ F 237:i ++È¿ F 238:i ++ÈÀ F 239:i ++ÈÁ F 240:i ++È F 241:i ++Èà F 242:i ++ÈÄ F 243:i ++ÈÅ F 244:i ++ÈÆ F 245:i ++ÈÇ F 246:i ++ÈÈ F 247:i ++ÈÉ F 248:i ++ÈÊ F 249:i ++ÈË F 250:i ++ÈÌ F 251:i ++ÈÍ F 252:i ++ÈÎ F 253:i ++ÈÏ F 254:i ++ÈÐ F 255:i ++ÈÑ F 0:j ++ÈÒ F 1:j ++ÈÓ F 2:j ++ÈÔ F 3:j ++ÈÕ F 4:j ++ÈÖ F 5:j ++È× F 6:j ++ÈØ F 7:j ++ÈÙ F 8:j ++ÈÚ F 9:j ++ÈÛ F 10:j ++ÈÜ F 11:j ++ÈÝ F 12:j ++ÈÞ F 13:j ++Èß F 14:j ++Èà F 15:j ++Èá F 16:j ++Èâ F 17:j ++Èã F 18:j ++Èä F 19:j ++Èå F 20:j ++Èæ F 21:j ++Èç F 22:j ++Èè F 23:j ++Èé F 24:j ++Èê F 25:j ++Èë F 26:j ++Èì F 27:j ++Èí F 28:j ++Èî F 29:j ++Èï F 30:j ++Èð F 31:j ++Èñ F 32:j ++Èò F 33:j ++Èó F 34:j ++Èô F 35:j ++Èõ F 36:j ++Èö F 37:j ++È÷ F 38:j ++Èø F 39:j ++Èù F 40:j ++Èú F 41:j ++Èû F 42:j ++Èü F 43:j ++Èý F 44:j ++Èþ F 45:j ++É¡ F 46:j ++É¢ F 47:j ++É£ F 48:j ++ɤ F 49:j ++É¥ F 50:j ++ɦ F 51:j ++ɧ F 52:j ++ɨ F 53:j ++É© F 54:j ++ɪ F 55:j ++É« F 56:j ++ɬ F 57:j ++É­ F 58:j ++É® F 59:j ++ɯ F 60:j ++ɰ F 61:j ++ɱ F 62:j ++ɲ F 63:j ++ɳ F 64:j ++É´ F 65:j ++ɵ F 66:j ++ɶ F 67:j ++É· F 68:j ++ɸ F 69:j ++ɹ F 70:j ++ɺ F 71:j ++É» F 72:j ++ɼ F 73:j ++ɽ F 74:j ++ɾ F 75:j ++É¿ F 76:j ++ÉÀ F 77:j ++ÉÁ F 78:j ++É F 79:j ++Éà F 80:j ++ÉÄ F 81:j ++ÉÅ F 82:j ++ÉÆ F 83:j ++ÉÇ F 84:j ++ÉÈ F 85:j ++ÉÉ F 86:j ++ÉÊ F 87:j ++ÉË F 88:j ++ÉÌ F 89:j ++ÉÍ F 90:j ++ÉÎ F 91:j ++ÉÏ F 92:j ++ÉÐ F 93:j ++ÉÑ F 94:j ++ÉÒ F 95:j ++ÉÓ F 96:j ++ÉÔ F 97:j ++ÉÕ F 98:j ++ÉÖ F 99:j ++É× F 100:j ++ÉØ F 101:j ++ÉÙ F 102:j ++ÉÚ F 103:j ++ÉÛ F 104:j ++ÉÜ F 105:j ++ÉÝ F 106:j ++ÉÞ F 107:j ++Éß F 108:j ++Éà F 109:j ++Éá F 110:j ++Éâ F 111:j ++Éã F 112:j ++Éä F 113:j ++Éå F 114:j ++Éæ F 115:j ++Éç F 116:j ++Éè F 117:j ++Éé F 118:j ++Éê F 119:j ++Éë F 120:j ++Éì F 121:j ++Éí F 122:j ++Éî F 123:j ++Éï F 124:j ++Éð F 125:j ++Éñ F 126:j ++Éò F 127:j ++Éó F 128:j ++Éô F 129:j ++Éõ F 130:j ++Éö F 131:j ++É÷ F 132:j ++Éø F 133:j ++Éù F 134:j ++Éú F 135:j ++Éû F 136:j ++Éü F 137:j ++Éý F 138:j ++Éþ F 139:j ++Ê¡ F 140:j ++Ê¢ F 141:j ++Ê£ F 142:j ++ʤ F 143:j ++Ê¥ F 144:j ++ʦ F 145:j ++ʧ F 146:j ++ʨ F 147:j ++Ê© F 148:j ++ʪ F 149:j ++Ê« F 150:j ++ʬ F 151:j ++Ê­ F 152:j ++Ê® F 153:j ++ʯ F 154:j ++ʰ F 155:j ++ʱ F 156:j ++ʲ F 157:j ++ʳ F 158:j ++Ê´ F 159:j ++ʵ F 160:j ++ʶ F 161:j ++Ê· F 162:j ++ʸ F 163:j ++ʹ F 164:j ++ʺ F 165:j ++Ê» F 166:j ++ʼ F 167:j ++ʽ F 168:j ++ʾ F 169:j ++Ê¿ F 170:j ++ÊÀ F 171:j ++ÊÁ F 172:j ++Ê F 173:j ++Êà F 174:j ++ÊÄ F 175:j ++ÊÅ F 176:j ++ÊÆ F 177:j ++ÊÇ F 178:j ++ÊÈ F 179:j ++ÊÉ F 180:j ++ÊÊ F 181:j ++ÊË F 182:j ++ÊÌ F 183:j ++ÊÍ F 184:j ++ÊÎ F 185:j ++ÊÏ F 186:j ++ÊÐ F 187:j ++ÊÑ F 188:j ++ÊÒ F 189:j ++ÊÓ F 190:j ++ÊÔ F 191:j ++ÊÕ F 192:j ++ÊÖ F 193:j ++Ê× F 194:j ++ÊØ F 195:j ++ÊÙ F 196:j ++ÊÚ F 197:j ++ÊÛ F 198:j ++ÊÜ F 199:j ++ÊÝ F 200:j ++ÊÞ F 201:j ++Êß F 202:j ++Êà F 203:j ++Êá F 204:j ++Êâ F 205:j ++Êã F 206:j ++Êä F 207:j ++Êå F 208:j ++Êæ F 209:j ++Êç F 210:j ++Êè F 211:j ++Êé F 212:j ++Êê F 213:j ++Êë F 214:j ++Êì F 215:j ++Êí F 216:j ++Êî F 217:j ++Êï F 218:j ++Êð F 219:j ++Êñ F 220:j ++Êò F 221:j ++Êó F 222:j ++Êô F 223:j ++Êõ F 224:j ++Êö F 225:j ++Ê÷ F 226:j ++Êø F 227:j ++Êù F 228:j ++Êú F 229:j ++Êû F 230:j ++Êü F 231:j ++Êý F 232:j ++Êþ F 233:j ++Ë¡ F 234:j ++Ë¢ F 235:j ++Ë£ F 236:j ++ˤ F 237:j ++Ë¥ F 238:j ++˦ F 239:j ++˧ F 240:j ++˨ F 241:j ++Ë© F 242:j ++˪ F 243:j ++Ë« F 244:j ++ˬ F 245:j ++Ë­ F 246:j ++Ë® F 247:j ++˯ F 248:j ++˰ F 249:j ++˱ F 250:j ++˲ F 251:j ++˳ F 252:j ++Ë´ F 253:j ++˵ F 254:j ++˶ F 255:j ++Ë· F 0:k ++˸ F 1:k ++˹ F 2:k ++˺ F 3:k ++Ë» F 4:k ++˼ F 5:k ++˽ F 6:k ++˾ F 7:k ++Ë¿ F 8:k ++ËÀ F 9:k ++ËÁ F 10:k ++Ë F 11:k ++Ëà F 12:k ++ËÄ F 13:k ++ËÅ F 14:k ++ËÆ F 15:k ++ËÇ F 16:k ++ËÈ F 17:k ++ËÉ F 18:k ++ËÊ F 19:k ++ËË F 20:k ++ËÌ F 21:k ++ËÍ F 22:k ++ËÎ F 23:k ++ËÏ F 24:k ++ËÐ F 25:k ++ËÑ F 26:k ++ËÒ F 27:k ++ËÓ F 28:k ++ËÔ F 29:k ++ËÕ F 30:k ++ËÖ F 31:k ++Ë× F 32:k ++ËØ F 33:k ++ËÙ F 34:k ++ËÚ F 35:k ++ËÛ F 36:k ++ËÜ F 37:k ++ËÝ F 38:k ++ËÞ F 39:k ++Ëß F 40:k ++Ëà F 41:k ++Ëá F 42:k ++Ëâ F 43:k ++Ëã F 44:k ++Ëä F 45:k ++Ëå F 46:k ++Ëæ F 47:k ++Ëç F 48:k ++Ëè F 49:k ++Ëé F 50:k ++Ëê F 51:k ++Ëë F 52:k ++Ëì F 53:k ++Ëí F 54:k ++Ëî F 55:k ++Ëï F 56:k ++Ëð F 57:k ++Ëñ F 58:k ++Ëò F 59:k ++Ëó F 60:k ++Ëô F 61:k ++Ëõ F 62:k ++Ëö F 63:k ++Ë÷ F 64:k ++Ëø F 65:k ++Ëù F 66:k ++Ëú F 67:k ++Ëû F 68:k ++Ëü F 69:k ++Ëý F 70:k ++Ëþ F 71:k ++Ì¡ F 72:k ++Ì¢ F 73:k ++Ì£ F 74:k ++̤ F 75:k ++Ì¥ F 76:k ++̦ F 77:k ++̧ F 78:k ++̨ F 79:k ++Ì© F 80:k ++̪ F 81:k ++Ì« F 82:k ++̬ F 83:k ++Ì­ F 84:k ++Ì® F 85:k ++̯ F 86:k ++̰ F 87:k ++̱ F 88:k ++̲ F 89:k ++̳ F 90:k ++Ì´ F 91:k ++̵ F 92:k ++̶ F 93:k ++Ì· F 94:k ++̸ F 95:k ++̹ F 96:k ++̺ F 97:k ++Ì» F 98:k ++̼ F 99:k ++̽ F 100:k ++̾ F 101:k ++Ì¿ F 102:k ++ÌÀ F 103:k ++ÌÁ F 104:k ++Ì F 105:k ++Ìà F 106:k ++ÌÄ F 107:k ++ÌÅ F 108:k ++ÌÆ F 109:k ++ÌÇ F 110:k ++ÌÈ F 111:k ++ÌÉ F 112:k ++ÌÊ F 113:k ++ÌË F 114:k ++ÌÌ F 115:k ++ÌÍ F 116:k ++ÌÎ F 117:k ++ÌÏ F 118:k ++ÌÐ F 119:k ++ÌÑ F 120:k ++ÌÒ F 121:k ++ÌÓ F 122:k ++ÌÔ F 123:k ++ÌÕ F 124:k ++ÌÖ F 125:k ++Ì× F 126:k ++ÌØ F 127:k ++ÌÙ F 128:k ++ÌÚ F 129:k ++ÌÛ F 130:k ++ÌÜ F 131:k ++ÌÝ F 132:k ++ÌÞ F 133:k ++Ìß F 134:k ++Ìà F 135:k ++Ìá F 136:k ++Ìâ F 137:k ++Ìã F 138:k ++Ìä F 139:k ++Ìå F 140:k ++Ìæ F 141:k ++Ìç F 142:k ++Ìè F 143:k ++Ìé F 144:k ++Ìê F 145:k ++Ìë F 146:k ++Ìì F 147:k ++Ìí F 148:k ++Ìî F 149:k ++Ìï F 150:k ++Ìð F 151:k ++Ìñ F 152:k ++Ìò F 153:k ++Ìó F 154:k ++Ìô F 155:k ++Ìõ F 156:k ++Ìö F 157:k ++Ì÷ F 158:k ++Ìø F 159:k ++Ìù F 160:k ++Ìú F 161:k ++Ìû F 162:k ++Ìü F 163:k ++Ìý F 164:k ++Ìþ F 165:k ++Í¡ F 166:k ++Í¢ F 167:k ++Í£ F 168:k ++ͤ F 169:k ++Í¥ F 170:k ++ͦ F 171:k ++ͧ F 172:k ++ͨ F 173:k ++Í© F 174:k ++ͪ F 175:k ++Í« F 176:k ++ͬ F 177:k ++Í­ F 178:k ++Í® F 179:k ++ͯ F 180:k ++Ͱ F 181:k ++ͱ F 182:k ++Ͳ F 183:k ++ͳ F 184:k ++Í´ F 185:k ++͵ F 186:k ++Ͷ F 187:k ++Í· F 188:k ++͸ F 189:k ++͹ F 190:k ++ͺ F 191:k ++Í» F 192:k ++ͼ F 193:k ++ͽ F 194:k ++; F 195:k ++Í¿ F 196:k ++ÍÀ F 197:k ++ÍÁ F 198:k ++Í F 199:k ++Íà F 200:k ++ÍÄ F 201:k ++ÍÅ F 202:k ++ÍÆ F 203:k ++ÍÇ F 204:k ++ÍÈ F 205:k ++ÍÉ F 206:k ++ÍÊ F 207:k ++ÍË F 208:k ++ÍÌ F 209:k ++ÍÍ F 210:k ++ÍÎ F 211:k ++ÍÏ F 212:k ++ÍÐ F 213:k ++ÍÑ F 214:k ++ÍÒ F 215:k ++ÍÓ F 216:k ++ÍÔ F 217:k ++ÍÕ F 218:k ++ÍÖ F 219:k ++Í× F 220:k ++ÍØ F 221:k ++ÍÙ F 222:k ++ÍÚ F 223:k ++ÍÛ F 224:k ++ÍÜ F 225:k ++ÍÝ F 226:k ++ÍÞ F 227:k ++Íß F 228:k ++Íà F 229:k ++Íá F 230:k ++Íâ F 231:k ++Íã F 232:k ++Íä F 233:k ++Íå F 234:k ++Íæ F 235:k ++Íç F 236:k ++Íè F 237:k ++Íé F 238:k ++Íê F 239:k ++Íë F 240:k ++Íì F 241:k ++Íí F 242:k ++Íî F 243:k ++Íï F 244:k ++Íð F 245:k ++Íñ F 246:k ++Íò F 247:k ++Íó F 248:k ++Íô F 249:k ++Íõ F 250:k ++Íö F 251:k ++Í÷ F 252:k ++Íø F 253:k ++Íù F 254:k ++Íú F 255:k ++Íû F 0:l ++Íü F 1:l ++Íý F 2:l ++Íþ F 3:l ++Ρ F 4:l ++΢ F 5:l ++Σ F 6:l ++Τ F 7:l ++Î¥ F 8:l ++Φ F 9:l ++Χ F 10:l ++Ψ F 11:l ++Ω F 12:l ++Ϊ F 13:l ++Ϋ F 14:l ++ά F 15:l ++έ F 16:l ++ή F 17:l ++ί F 18:l ++ΰ F 19:l ++α F 20:l ++β F 21:l ++γ F 22:l ++δ F 23:l ++ε F 24:l ++ζ F 25:l ++η F 26:l ++θ F 27:l ++ι F 28:l ++κ F 29:l ++λ F 30:l ++μ F 31:l ++ν F 32:l ++ξ F 33:l ++ο F 34:l ++ÎÀ F 35:l ++ÎÁ F 36:l ++ΠF 37:l ++Îà F 38:l ++ÎÄ F 39:l ++ÎÅ F 40:l ++ÎÆ F 41:l ++ÎÇ F 42:l ++ÎÈ F 43:l ++ÎÉ F 44:l ++ÎÊ F 45:l ++ÎË F 46:l ++ÎÌ F 47:l ++ÎÍ F 48:l ++ÎÎ F 49:l ++ÎÏ F 50:l ++ÎÐ F 51:l ++ÎÑ F 52:l ++ÎÒ F 53:l ++ÎÓ F 54:l ++ÎÔ F 55:l ++ÎÕ F 56:l ++ÎÖ F 57:l ++Î× F 58:l ++ÎØ F 59:l ++ÎÙ F 60:l ++ÎÚ F 61:l ++ÎÛ F 62:l ++ÎÜ F 63:l ++ÎÝ F 64:l ++ÎÞ F 65:l ++Îß F 66:l ++Îà F 67:l ++Îá F 68:l ++Îâ F 69:l ++Îã F 70:l ++Îä F 71:l ++Îå F 72:l ++Îæ F 73:l ++Îç F 74:l ++Îè F 75:l ++Îé F 76:l ++Îê F 77:l ++Îë F 78:l ++Îì F 79:l ++Îí F 80:l ++Îî F 81:l ++Îï F 82:l ++Îð F 83:l ++Îñ F 84:l ++Îò F 85:l ++Îó F 86:l ++Îô F 87:l ++Îõ F 88:l ++Îö F 89:l ++Î÷ F 90:l ++Îø F 91:l ++Îù F 92:l ++Îú F 93:l ++Îû F 94:l ++Îü F 95:l ++Îý F 96:l ++Îþ F 97:l ++Ï¡ F 98:l ++Ï¢ F 99:l ++Ï£ F 100:l ++Ϥ F 101:l ++Ï¥ F 102:l ++Ϧ F 103:l ++ϧ F 104:l ++Ϩ F 105:l ++Ï© F 106:l ++Ϫ F 107:l ++Ï« F 108:l ++Ϭ F 109:l ++Ï­ F 110:l ++Ï® F 111:l ++ϯ F 112:l ++ϰ F 113:l ++ϱ F 114:l ++ϲ F 115:l ++ϳ F 116:l ++Ï´ F 117:l ++ϵ F 118:l ++϶ F 119:l ++Ï· F 120:l ++ϸ F 121:l ++Ϲ F 122:l ++Ϻ F 123:l ++Ï» F 124:l ++ϼ F 125:l ++Ͻ F 126:l ++Ͼ F 127:l ++Ï¿ F 128:l ++ÏÀ F 129:l ++ÏÁ F 130:l ++Ï F 131:l ++Ïà F 132:l ++ÏÄ F 133:l ++ÏÅ F 134:l ++ÏÆ F 135:l ++ÏÇ F 136:l ++ÏÈ F 137:l ++ÏÉ F 138:l ++ÏÊ F 139:l ++ÏË F 140:l ++ÏÌ F 141:l ++ÏÍ F 142:l ++ÏÎ F 143:l ++ÏÏ F 144:l ++ÏÐ F 145:l ++ÏÑ F 146:l ++ÏÒ F 147:l ++ÏÓ F 148:l ++С F 0:m ++Т F 1:m ++У F 2:m ++Ф F 3:m ++Ð¥ F 4:m ++Ц F 5:m ++Ч F 6:m ++Ш F 7:m ++Щ F 8:m ++Ъ F 9:m ++Ы F 10:m ++Ь F 11:m ++Э F 12:m ++Ю F 13:m ++Я F 14:m ++а F 15:m ++б F 16:m ++в F 17:m ++г F 18:m ++д F 19:m ++е F 20:m ++ж F 21:m ++з F 22:m ++и F 23:m ++й F 24:m ++к F 25:m ++л F 26:m ++м F 27:m ++н F 28:m ++о F 29:m ++п F 30:m ++ÐÀ F 31:m ++ÐÁ F 32:m ++РF 33:m ++Ðà F 34:m ++ÐÄ F 35:m ++ÐÅ F 36:m ++ÐÆ F 37:m ++ÐÇ F 38:m ++ÐÈ F 39:m ++ÐÉ F 40:m ++ÐÊ F 41:m ++ÐË F 42:m ++ÐÌ F 43:m ++ÐÍ F 44:m ++ÐÎ F 45:m ++ÐÏ F 46:m ++ÐÐ F 47:m ++ÐÑ F 48:m ++ÐÒ F 49:m ++ÐÓ F 50:m ++ÐÔ F 51:m ++ÐÕ F 52:m ++ÐÖ F 53:m ++Ð× F 54:m ++ÐØ F 55:m ++ÐÙ F 56:m ++ÐÚ F 57:m ++ÐÛ F 58:m ++ÐÜ F 59:m ++ÐÝ F 60:m ++ÐÞ F 61:m ++Ðß F 62:m ++Ðà F 63:m ++Ðá F 64:m ++Ðâ F 65:m ++Ðã F 66:m ++Ðä F 67:m ++Ðå F 68:m ++Ðæ F 69:m ++Ðç F 70:m ++Ðè F 71:m ++Ðé F 72:m ++Ðê F 73:m ++Ðë F 74:m ++Ðì F 75:m ++Ðí F 76:m ++Ðî F 77:m ++Ðï F 78:m ++Ðð F 79:m ++Ðñ F 80:m ++Ðò F 81:m ++Ðó F 82:m ++Ðô F 83:m ++Ðõ F 84:m ++Ðö F 85:m ++Ð÷ F 86:m ++Ðø F 87:m ++Ðù F 88:m ++Ðú F 89:m ++Ðû F 90:m ++Ðü F 91:m ++Ðý F 92:m ++Ðþ F 93:m ++Ñ¡ F 94:m ++Ñ¢ F 95:m ++Ñ£ F 96:m ++Ѥ F 97:m ++Ñ¥ F 98:m ++Ѧ F 99:m ++ѧ F 100:m ++Ѩ F 101:m ++Ñ© F 102:m ++Ѫ F 103:m ++Ñ« F 104:m ++Ѭ F 105:m ++Ñ­ F 106:m ++Ñ® F 107:m ++ѯ F 108:m ++Ѱ F 109:m ++ѱ F 110:m ++Ѳ F 111:m ++ѳ F 112:m ++Ñ´ F 113:m ++ѵ F 114:m ++Ѷ F 115:m ++Ñ· F 116:m ++Ѹ F 117:m ++ѹ F 118:m ++Ѻ F 119:m ++Ñ» F 120:m ++Ѽ F 121:m ++ѽ F 122:m ++Ѿ F 123:m ++Ñ¿ F 124:m ++ÑÀ F 125:m ++ÑÁ F 126:m ++Ñ F 127:m ++Ñà F 128:m ++ÑÄ F 129:m ++ÑÅ F 130:m ++ÑÆ F 131:m ++ÑÇ F 132:m ++ÑÈ F 133:m ++ÑÉ F 134:m ++ÑÊ F 135:m ++ÑË F 136:m ++ÑÌ F 137:m ++ÑÍ F 138:m ++ÑÎ F 139:m ++ÑÏ F 140:m ++ÑÐ F 141:m ++ÑÑ F 142:m ++ÑÒ F 143:m ++ÑÓ F 144:m ++ÑÔ F 145:m ++ÑÕ F 146:m ++ÑÖ F 147:m ++Ñ× F 148:m ++ÑØ F 149:m ++ÑÙ F 150:m ++ÑÚ F 151:m ++ÑÛ F 152:m ++ÑÜ F 153:m ++ÑÝ F 154:m ++ÑÞ F 155:m ++Ñß F 156:m ++Ñà F 157:m ++Ñá F 158:m ++Ñâ F 159:m ++Ñã F 160:m ++Ñä F 161:m ++Ñå F 162:m ++Ñæ F 163:m ++Ñç F 164:m ++Ñè F 165:m ++Ñé F 166:m ++Ñê F 167:m ++Ñë F 168:m ++Ñì F 169:m ++Ñí F 170:m ++Ñî F 171:m ++Ñï F 172:m ++Ñð F 173:m ++Ññ F 174:m ++Ñò F 175:m ++Ñó F 176:m ++Ñô F 177:m ++Ñõ F 178:m ++Ñö F 179:m ++Ñ÷ F 180:m ++Ñø F 181:m ++Ñù F 182:m ++Ñú F 183:m ++Ñû F 184:m ++Ñü F 185:m ++Ñý F 186:m ++Ñþ F 187:m ++Ò¡ F 188:m ++Ò¢ F 189:m ++Ò£ F 190:m ++Ò¤ F 191:m ++Ò¥ F 192:m ++Ò¦ F 193:m ++Ò§ F 194:m ++Ò¨ F 195:m ++Ò© F 196:m ++Òª F 197:m ++Ò« F 198:m ++Ò¬ F 199:m ++Ò­ F 200:m ++Ò® F 201:m ++Ò¯ F 202:m ++Ò° F 203:m ++Ò± F 204:m ++Ò² F 205:m ++Ò³ F 206:m ++Ò´ F 207:m ++Òµ F 208:m ++Ò¶ F 209:m ++Ò· F 210:m ++Ò¸ F 211:m ++Ò¹ F 212:m ++Òº F 213:m ++Ò» F 214:m ++Ò¼ F 215:m ++Ò½ F 216:m ++Ò¾ F 217:m ++Ò¿ F 218:m ++ÒÀ F 219:m ++ÒÁ F 220:m ++Ò F 221:m ++Òà F 222:m ++ÒÄ F 223:m ++ÒÅ F 224:m ++ÒÆ F 225:m ++ÒÇ F 226:m ++ÒÈ F 227:m ++ÒÉ F 228:m ++ÒÊ F 229:m ++ÒË F 230:m ++ÒÌ F 231:m ++ÒÍ F 232:m ++ÒÎ F 233:m ++ÒÏ F 234:m ++ÒÐ F 235:m ++ÒÑ F 236:m ++ÒÒ F 237:m ++ÒÓ F 238:m ++ÒÔ F 239:m ++ÒÕ F 240:m ++ÒÖ F 241:m ++Ò× F 242:m ++ÒØ F 243:m ++ÒÙ F 244:m ++ÒÚ F 245:m ++ÒÛ F 246:m ++ÒÜ F 247:m ++ÒÝ F 248:m ++ÒÞ F 249:m ++Òß F 250:m ++Òà F 251:m ++Òá F 252:m ++Òâ F 253:m ++Òã F 254:m ++Òä F 255:m ++Òå F 0:n ++Òæ F 1:n ++Òç F 2:n ++Òè F 3:n ++Òé F 4:n ++Òê F 5:n ++Òë F 6:n ++Òì F 7:n ++Òí F 8:n ++Òî F 9:n ++Òï F 10:n ++Òð F 11:n ++Òñ F 12:n ++Òò F 13:n ++Òó F 14:n ++Òô F 15:n ++Òõ F 16:n ++Òö F 17:n ++Ò÷ F 18:n ++Òø F 19:n ++Òù F 20:n ++Òú F 21:n ++Òû F 22:n ++Òü F 23:n ++Òý F 24:n ++Òþ F 25:n ++Ó¡ F 26:n ++Ó¢ F 27:n ++Ó£ F 28:n ++Ó¤ F 29:n ++Ó¥ F 30:n ++Ó¦ F 31:n ++Ó§ F 32:n ++Ó¨ F 33:n ++Ó© F 34:n ++Óª F 35:n ++Ó« F 36:n ++Ó¬ F 37:n ++Ó­ F 38:n ++Ó® F 39:n ++Ó¯ F 40:n ++Ó° F 41:n ++Ó± F 42:n ++Ó² F 43:n ++Ó³ F 44:n ++Ó´ F 45:n ++Óµ F 46:n ++Ó¶ F 47:n ++Ó· F 48:n ++Ó¸ F 49:n ++Ó¹ F 50:n ++Óº F 51:n ++Ó» F 52:n ++Ó¼ F 53:n ++Ó½ F 54:n ++Ó¾ F 55:n ++Ó¿ F 56:n ++ÓÀ F 57:n ++ÓÁ F 58:n ++Ó F 59:n ++Óà F 60:n ++ÓÄ F 61:n ++ÓÅ F 62:n ++ÓÆ F 63:n ++ÓÇ F 64:n ++ÓÈ F 65:n ++ÓÉ F 66:n ++ÓÊ F 67:n ++ÓË F 68:n ++ÓÌ F 69:n ++ÓÍ F 70:n ++ÓÎ F 71:n ++ÓÏ F 72:n ++ÓÐ F 73:n ++ÓÑ F 74:n ++ÓÒ F 75:n ++ÓÓ F 76:n ++ÓÔ F 77:n ++ÓÕ F 78:n ++ÓÖ F 79:n ++Ó× F 80:n ++ÓØ F 81:n ++ÓÙ F 82:n ++ÓÚ F 83:n ++ÓÛ F 84:n ++ÓÜ F 85:n ++ÓÝ F 86:n ++ÓÞ F 87:n ++Óß F 88:n ++Óà F 89:n ++Óá F 90:n ++Óâ F 91:n ++Óã F 92:n ++Óä F 93:n ++Óå F 94:n ++Óæ F 95:n ++Óç F 96:n ++Óè F 97:n ++Óé F 98:n ++Óê F 99:n ++Óë F 100:n ++Óì F 101:n ++Óí F 102:n ++Óî F 103:n ++Óï F 104:n ++Óð F 105:n ++Óñ F 106:n ++Óò F 107:n ++Óó F 108:n ++Óô F 109:n ++Óõ F 110:n ++Óö F 111:n ++Ó÷ F 112:n ++Óø F 113:n ++Óù F 114:n ++Óú F 115:n ++Óû F 116:n ++Óü F 117:n ++Óý F 118:n ++Óþ F 119:n ++Ô¡ F 120:n ++Ô¢ F 121:n ++Ô£ F 122:n ++Ô¤ F 123:n ++Ô¥ F 124:n ++Ô¦ F 125:n ++Ô§ F 126:n ++Ô¨ F 127:n ++Ô© F 128:n ++Ôª F 129:n ++Ô« F 130:n ++Ô¬ F 131:n ++Ô­ F 132:n ++Ô® F 133:n ++Ô¯ F 134:n ++Ô° F 135:n ++Ô± F 136:n ++Ô² F 137:n ++Ô³ F 138:n ++Ô´ F 139:n ++Ôµ F 140:n ++Ô¶ F 141:n ++Ô· F 142:n ++Ô¸ F 143:n ++Ô¹ F 144:n ++Ôº F 145:n ++Ô» F 146:n ++Ô¼ F 147:n ++Ô½ F 148:n ++Ô¾ F 149:n ++Ô¿ F 150:n ++ÔÀ F 151:n ++ÔÁ F 152:n ++Ô F 153:n ++Ôà F 154:n ++ÔÄ F 155:n ++ÔÅ F 156:n ++ÔÆ F 157:n ++ÔÇ F 158:n ++ÔÈ F 159:n ++ÔÉ F 160:n ++ÔÊ F 161:n ++ÔË F 162:n ++ÔÌ F 163:n ++ÔÍ F 164:n ++ÔÎ F 165:n ++ÔÏ F 166:n ++ÔÐ F 167:n ++ÔÑ F 168:n ++ÔÒ F 169:n ++ÔÓ F 170:n ++ÔÔ F 171:n ++ÔÕ F 172:n ++ÔÖ F 173:n ++Ô× F 174:n ++ÔØ F 175:n ++ÔÙ F 176:n ++ÔÚ F 177:n ++ÔÛ F 178:n ++ÔÜ F 179:n ++ÔÝ F 180:n ++ÔÞ F 181:n ++Ôß F 182:n ++Ôà F 183:n ++Ôá F 184:n ++Ôâ F 185:n ++Ôã F 186:n ++Ôä F 187:n ++Ôå F 188:n ++Ôæ F 189:n ++Ôç F 190:n ++Ôè F 191:n ++Ôé F 192:n ++Ôê F 193:n ++Ôë F 194:n ++Ôì F 195:n ++Ôí F 196:n ++Ôî F 197:n ++Ôï F 198:n ++Ôð F 199:n ++Ôñ F 200:n ++Ôò F 201:n ++Ôó F 202:n ++Ôô F 203:n ++Ôõ F 204:n ++Ôö F 205:n ++Ô÷ F 206:n ++Ôø F 207:n ++Ôù F 208:n ++Ôú F 209:n ++Ôû F 210:n ++Ôü F 211:n ++Ôý F 212:n ++Ôþ F 213:n ++Õ¡ F 214:n ++Õ¢ F 215:n ++Õ£ F 216:n ++Õ¤ F 217:n ++Õ¥ F 218:n ++Õ¦ F 219:n ++Õ§ F 220:n ++Õ¨ F 221:n ++Õ© F 222:n ++Õª F 223:n ++Õ« F 224:n ++Õ¬ F 225:n ++Õ­ F 226:n ++Õ® F 227:n ++Õ¯ F 228:n ++Õ° F 229:n ++Õ± F 230:n ++Õ² F 231:n ++Õ³ F 232:n ++Õ´ F 233:n ++Õµ F 234:n ++Õ¶ F 235:n ++Õ· F 236:n ++Õ¸ F 237:n ++Õ¹ F 238:n ++Õº F 239:n ++Õ» F 240:n ++Õ¼ F 241:n ++Õ½ F 242:n ++Õ¾ F 243:n ++Õ¿ F 244:n ++ÕÀ F 245:n ++ÕÁ F 246:n ++Õ F 247:n ++Õà F 248:n ++ÕÄ F 249:n ++ÕÅ F 250:n ++ÕÆ F 251:n ++ÕÇ F 252:n ++ÕÈ F 253:n ++ÕÉ F 254:n ++ÕÊ F 255:n ++ÕË F 0:o ++ÕÌ F 1:o ++ÕÍ F 2:o ++ÕÎ F 3:o ++ÕÏ F 4:o ++ÕÐ F 5:o ++ÕÑ F 6:o ++ÕÒ F 7:o ++ÕÓ F 8:o ++ÕÔ F 9:o ++ÕÕ F 10:o ++ÕÖ F 11:o ++Õ× F 12:o ++ÕØ F 13:o ++ÕÙ F 14:o ++ÕÚ F 15:o ++ÕÛ F 16:o ++ÕÜ F 17:o ++ÕÝ F 18:o ++ÕÞ F 19:o ++Õß F 20:o ++Õà F 21:o ++Õá F 22:o ++Õâ F 23:o ++Õã F 24:o ++Õä F 25:o ++Õå F 26:o ++Õæ F 27:o ++Õç F 28:o ++Õè F 29:o ++Õé F 30:o ++Õê F 31:o ++Õë F 32:o ++Õì F 33:o ++Õí F 34:o ++Õî F 35:o ++Õï F 36:o ++Õð F 37:o ++Õñ F 38:o ++Õò F 39:o ++Õó F 40:o ++Õô F 41:o ++Õõ F 42:o ++Õö F 43:o ++Õ÷ F 44:o ++Õø F 45:o ++Õù F 46:o ++Õú F 47:o ++Õû F 48:o ++Õü F 49:o ++Õý F 50:o ++Õþ F 51:o ++Ö¡ F 52:o ++Ö¢ F 53:o ++Ö£ F 54:o ++Ö¤ F 55:o ++Ö¥ F 56:o ++Ö¦ F 57:o ++Ö§ F 58:o ++Ö¨ F 59:o ++Ö© F 60:o ++Öª F 61:o ++Ö« F 62:o ++Ö¬ F 63:o ++Ö­ F 64:o ++Ö® F 65:o ++Ö¯ F 66:o ++Ö° F 67:o ++Ö± F 68:o ++Ö² F 69:o ++Ö³ F 70:o ++Ö´ F 71:o ++Öµ F 72:o ++Ö¶ F 73:o ++Ö· F 74:o ++Ö¸ F 75:o ++Ö¹ F 76:o ++Öº F 77:o ++Ö» F 78:o ++Ö¼ F 79:o ++Ö½ F 80:o ++Ö¾ F 81:o ++Ö¿ F 82:o ++ÖÀ F 83:o ++ÖÁ F 84:o ++Ö F 85:o ++Öà F 86:o ++ÖÄ F 87:o ++ÖÅ F 88:o ++ÖÆ F 89:o ++ÖÇ F 90:o ++ÖÈ F 91:o ++ÖÉ F 92:o ++ÖÊ F 93:o ++ÖË F 94:o ++ÖÌ F 95:o ++ÖÍ F 96:o ++ÖÎ F 97:o ++ÖÏ F 98:o ++ÖÐ F 99:o ++ÖÑ F 100:o ++ÖÒ F 101:o ++ÖÓ F 102:o ++ÖÔ F 103:o ++ÖÕ F 104:o ++ÖÖ F 105:o ++Ö× F 106:o ++ÖØ F 107:o ++ÖÙ F 108:o ++ÖÚ F 109:o ++ÖÛ F 110:o ++ÖÜ F 111:o ++ÖÝ F 112:o ++ÖÞ F 113:o ++Öß F 114:o ++Öà F 115:o ++Öá F 116:o ++Öâ F 117:o ++Öã F 118:o ++Öä F 119:o ++Öå F 120:o ++Öæ F 121:o ++Öç F 122:o ++Öè F 123:o ++Öé F 124:o ++Öê F 125:o ++Öë F 126:o ++Öì F 127:o ++Öí F 128:o ++Öî F 129:o ++Öï F 130:o ++Öð F 131:o ++Öñ F 132:o ++Öò F 133:o ++Öó F 134:o ++Öô F 135:o ++Öõ F 136:o ++Öö F 137:o ++Ö÷ F 138:o ++Öø F 139:o ++Öù F 140:o ++Öú F 141:o ++Öû F 142:o ++Öü F 143:o ++Öý F 144:o ++Öþ F 145:o ++ס F 146:o ++×¢ F 147:o ++×£ F 148:o ++פ F 149:o ++×¥ F 150:o ++צ F 151:o ++×§ F 152:o ++ר F 153:o ++ש F 154:o ++ת F 155:o ++׫ F 156:o ++׬ F 157:o ++×­ F 158:o ++×® F 159:o ++ׯ F 160:o ++×° F 161:o ++×± F 162:o ++ײ F 163:o ++׳ F 164:o ++×´ F 165:o ++×µ F 166:o ++×¶ F 167:o ++×· F 168:o ++׸ F 169:o ++×¹ F 170:o ++׺ F 171:o ++×» F 172:o ++×¼ F 173:o ++×½ F 174:o ++×¾ F 175:o ++׿ F 176:o ++×À F 177:o ++×Á F 178:o ++× F 179:o ++×à F 180:o ++×Ä F 181:o ++×Å F 182:o ++ׯ F 183:o ++×Ç F 184:o ++×È F 185:o ++×É F 186:o ++×Ê F 187:o ++×Ë F 188:o ++×Ì F 189:o ++×Í F 190:o ++×Î F 191:o ++×Ï F 192:o ++×Ð F 193:o ++×Ñ F 194:o ++×Ò F 195:o ++×Ó F 196:o ++×Ô F 197:o ++×Õ F 198:o ++×Ö F 199:o ++×× F 200:o ++ר F 201:o ++×Ù F 202:o ++×Ú F 203:o ++×Û F 204:o ++×Ü F 205:o ++×Ý F 206:o ++×Þ F 207:o ++×ß F 208:o ++×à F 209:o ++×á F 210:o ++×â F 211:o ++×ã F 212:o ++×ä F 213:o ++×å F 214:o ++׿ F 215:o ++×ç F 216:o ++×è F 217:o ++×é F 218:o ++×ê F 219:o ++×ë F 220:o ++×ì F 221:o ++×í F 222:o ++×î F 223:o ++×ï F 224:o ++×ð F 225:o ++×ñ F 226:o ++×ò F 227:o ++×ó F 228:o ++×ô F 229:o ++×õ F 230:o ++×ö F 231:o ++×÷ F 232:o ++×ø F 233:o ++×ù F 234:o ++×ú F 235:o ++×û F 236:o ++×ü F 237:o ++×ý F 238:o ++×þ F 239:o ++Ø¡ F 240:o ++Ø¢ F 241:o ++Ø£ F 242:o ++ؤ F 243:o ++Ø¥ F 244:o ++ئ F 245:o ++ا F 246:o ++ب F 247:o ++Ø© F 248:o ++ت F 249:o ++Ø« F 250:o ++ج F 251:o ++Ø­ F 252:o ++Ø® F 253:o ++د F 254:o ++ذ F 255:o ++ر F 0:p ++ز F 1:p ++س F 2:p ++Ø´ F 3:p ++ص F 4:p ++ض F 5:p ++Ø· F 6:p ++ظ F 7:p ++ع F 8:p ++غ F 9:p ++Ø» F 10:p ++ؼ F 11:p ++ؽ F 12:p ++ؾ F 13:p ++Ø¿ F 14:p ++ØÀ F 15:p ++ØÁ F 16:p ++ØÂ F 17:p ++ØÃ F 18:p ++ØÄ F 19:p ++ØÅ F 20:p ++ØÆ F 21:p ++ØÇ F 22:p ++ØÈ F 23:p ++ØÉ F 24:p ++ØÊ F 25:p ++ØË F 26:p ++ØÌ F 27:p ++ØÍ F 28:p ++ØÎ F 29:p ++ØÏ F 30:p ++ØÐ F 31:p ++ØÑ F 32:p ++ØÒ F 33:p ++ØÓ F 34:p ++ØÔ F 35:p ++ØÕ F 36:p ++ØÖ F 37:p ++Ø× F 38:p ++ØØ F 39:p ++ØÙ F 40:p ++ØÚ F 41:p ++ØÛ F 42:p ++ØÜ F 43:p ++ØÝ F 44:p ++ØÞ F 45:p ++Øß F 46:p ++Øà F 47:p ++Øá F 48:p ++Øâ F 49:p ++Øã F 50:p ++Øä F 51:p ++Øå F 52:p ++Øæ F 53:p ++Øç F 54:p ++Øè F 55:p ++Øé F 56:p ++Øê F 57:p ++Øë F 58:p ++Øì F 59:p ++Øí F 60:p ++Øî F 61:p ++Øï F 62:p ++Øð F 63:p ++Øñ F 64:p ++Øò F 65:p ++Øó F 66:p ++Øô F 67:p ++Øõ F 68:p ++Øö F 69:p ++Ø÷ F 70:p ++Øø F 71:p ++Øù F 72:p ++Øú F 73:p ++Øû F 74:p ++Øü F 75:p ++Øý F 76:p ++Øþ F 77:p ++Ù¡ F 78:p ++Ù¢ F 79:p ++Ù£ F 80:p ++Ù¤ F 81:p ++Ù¥ F 82:p ++Ù¦ F 83:p ++Ù§ F 84:p ++Ù¨ F 85:p ++Ù© F 86:p ++Ùª F 87:p ++Ù« F 88:p ++Ù¬ F 89:p ++Ù­ F 90:p ++Ù® F 91:p ++Ù¯ F 92:p ++Ù° F 93:p ++Ù± F 94:p ++Ù² F 95:p ++Ù³ F 96:p ++Ù´ F 97:p ++Ùµ F 98:p ++Ù¶ F 99:p ++Ù· F 100:p ++Ù¸ F 101:p ++Ù¹ F 102:p ++Ùº F 103:p ++Ù» F 104:p ++Ù¼ F 105:p ++Ù½ F 106:p ++Ù¾ F 107:p ++Ù¿ F 108:p ++ÙÀ F 109:p ++ÙÁ F 110:p ++Ù F 111:p ++Ùà F 112:p ++ÙÄ F 113:p ++ÙÅ F 114:p ++ÙÆ F 115:p ++ÙÇ F 116:p ++ÙÈ F 117:p ++ÙÉ F 118:p ++ÙÊ F 119:p ++ÙË F 120:p ++ÙÌ F 121:p ++ÙÍ F 122:p ++ÙÎ F 123:p ++ÙÏ F 124:p ++ÙÐ F 125:p ++ÙÑ F 126:p ++ÙÒ F 127:p ++ÙÓ F 128:p ++ÙÔ F 129:p ++ÙÕ F 130:p ++ÙÖ F 131:p ++Ù× F 132:p ++ÙØ F 133:p ++ÙÙ F 134:p ++ÙÚ F 135:p ++ÙÛ F 136:p ++ÙÜ F 137:p ++ÙÝ F 138:p ++ÙÞ F 139:p ++Ùß F 140:p ++Ùà F 141:p ++Ùá F 142:p ++Ùâ F 143:p ++Ùã F 144:p ++Ùä F 145:p ++Ùå F 146:p ++Ùæ F 147:p ++Ùç F 148:p ++Ùè F 149:p ++Ùé F 150:p ++Ùê F 151:p ++Ùë F 152:p ++Ùì F 153:p ++Ùí F 154:p ++Ùî F 155:p ++Ùï F 156:p ++Ùð F 157:p ++Ùñ F 158:p ++Ùò F 159:p ++Ùó F 160:p ++Ùô F 161:p ++Ùõ F 162:p ++Ùö F 163:p ++Ù÷ F 164:p ++Ùø F 165:p ++Ùù F 166:p ++Ùú F 167:p ++Ùû F 168:p ++Ùü F 169:p ++Ùý F 170:p ++Ùþ F 171:p ++Ú¡ F 172:p ++Ú¢ F 173:p ++Ú£ F 174:p ++Ú¤ F 175:p ++Ú¥ F 176:p ++Ú¦ F 177:p ++Ú§ F 178:p ++Ú¨ F 179:p ++Ú© F 180:p ++Úª F 181:p ++Ú« F 182:p ++Ú¬ F 183:p ++Ú­ F 184:p ++Ú® F 185:p ++Ú¯ F 186:p ++Ú° F 187:p ++Ú± F 188:p ++Ú² F 189:p ++Ú³ F 190:p ++Ú´ F 191:p ++Úµ F 192:p ++Ú¶ F 193:p ++Ú· F 194:p ++Ú¸ F 195:p ++Ú¹ F 196:p ++Úº F 197:p ++Ú» F 198:p ++Ú¼ F 199:p ++Ú½ F 200:p ++Ú¾ F 201:p ++Ú¿ F 202:p ++ÚÀ F 203:p ++ÚÁ F 204:p ++Ú F 205:p ++Úà F 206:p ++ÚÄ F 207:p ++ÚÅ F 208:p ++ÚÆ F 209:p ++ÚÇ F 210:p ++ÚÈ F 211:p ++ÚÉ F 212:p ++ÚÊ F 213:p ++ÚË F 214:p ++ÚÌ F 215:p ++ÚÍ F 216:p ++ÚÎ F 217:p ++ÚÏ F 218:p ++ÚÐ F 219:p ++ÚÑ F 220:p ++ÚÒ F 221:p ++ÚÓ F 222:p ++ÚÔ F 223:p ++ÚÕ F 224:p ++ÚÖ F 225:p ++Ú× F 226:p ++ÚØ F 227:p ++ÚÙ F 228:p ++ÚÚ F 229:p ++ÚÛ F 230:p ++ÚÜ F 231:p ++ÚÝ F 232:p ++ÚÞ F 233:p ++Úß F 234:p ++Úà F 235:p ++Úá F 236:p ++Úâ F 237:p ++Úã F 238:p ++Úä F 239:p ++Úå F 240:p ++Úæ F 241:p ++Úç F 242:p ++Úè F 243:p ++Úé F 244:p ++Úê F 245:p ++Úë F 246:p ++Úì F 247:p ++Úí F 248:p ++Úî F 249:p ++Úï F 250:p ++Úð F 251:p ++Úñ F 252:p ++Úò F 253:p ++Úó F 254:p ++Úô F 255:p ++Úõ F 0:q ++Úö F 1:q ++Ú÷ F 2:q ++Úø F 3:q ++Úù F 4:q ++Úú F 5:q ++Úû F 6:q ++Úü F 7:q ++Úý F 8:q ++Úþ F 9:q ++Û¡ F 10:q ++Û¢ F 11:q ++Û£ F 12:q ++Û¤ F 13:q ++Û¥ F 14:q ++Û¦ F 15:q ++Û§ F 16:q ++Û¨ F 17:q ++Û© F 18:q ++Ûª F 19:q ++Û« F 20:q ++Û¬ F 21:q ++Û­ F 22:q ++Û® F 23:q ++Û¯ F 24:q ++Û° F 25:q ++Û± F 26:q ++Û² F 27:q ++Û³ F 28:q ++Û´ F 29:q ++Ûµ F 30:q ++Û¶ F 31:q ++Û· F 32:q ++Û¸ F 33:q ++Û¹ F 34:q ++Ûº F 35:q ++Û» F 36:q ++Û¼ F 37:q ++Û½ F 38:q ++Û¾ F 39:q ++Û¿ F 40:q ++ÛÀ F 41:q ++ÛÁ F 42:q ++Û F 43:q ++Ûà F 44:q ++ÛÄ F 45:q ++ÛÅ F 46:q ++ÛÆ F 47:q ++ÛÇ F 48:q ++ÛÈ F 49:q ++ÛÉ F 50:q ++ÛÊ F 51:q ++ÛË F 52:q ++ÛÌ F 53:q ++ÛÍ F 54:q ++ÛÎ F 55:q ++ÛÏ F 56:q ++ÛÐ F 57:q ++ÛÑ F 58:q ++ÛÒ F 59:q ++ÛÓ F 60:q ++ÛÔ F 61:q ++ÛÕ F 62:q ++ÛÖ F 63:q ++Û× F 64:q ++ÛØ F 65:q ++ÛÙ F 66:q ++ÛÚ F 67:q ++ÛÛ F 68:q ++ÛÜ F 69:q ++ÛÝ F 70:q ++ÛÞ F 71:q ++Ûß F 72:q ++Ûà F 73:q ++Ûá F 74:q ++Ûâ F 75:q ++Ûã F 76:q ++Ûä F 77:q ++Ûå F 78:q ++Ûæ F 79:q ++Ûç F 80:q ++Ûè F 81:q ++Ûé F 82:q ++Ûê F 83:q ++Ûë F 84:q ++Ûì F 85:q ++Ûí F 86:q ++Ûî F 87:q ++Ûï F 88:q ++Ûð F 89:q ++Ûñ F 90:q ++Ûò F 91:q ++Ûó F 92:q ++Ûô F 93:q ++Ûõ F 94:q ++Ûö F 95:q ++Û÷ F 96:q ++Ûø F 97:q ++Ûù F 98:q ++Ûú F 99:q ++Ûû F 100:q ++Ûü F 101:q ++Ûý F 102:q ++Ûþ F 103:q ++Ü¡ F 104:q ++Ü¢ F 105:q ++Ü£ F 106:q ++ܤ F 107:q ++Ü¥ F 108:q ++ܦ F 109:q ++ܧ F 110:q ++ܨ F 111:q ++Ü© F 112:q ++ܪ F 113:q ++Ü« F 114:q ++ܬ F 115:q ++Ü­ F 116:q ++Ü® F 117:q ++ܯ F 118:q ++ܰ F 119:q ++ܱ F 120:q ++ܲ F 121:q ++ܳ F 122:q ++Ü´ F 123:q ++ܵ F 124:q ++ܶ F 125:q ++Ü· F 126:q ++ܸ F 127:q ++ܹ F 128:q ++ܺ F 129:q ++Ü» F 130:q ++ܼ F 131:q ++ܽ F 132:q ++ܾ F 133:q ++Ü¿ F 134:q ++ÜÀ F 135:q ++ÜÁ F 136:q ++Ü F 137:q ++Üà F 138:q ++ÜÄ F 139:q ++ÜÅ F 140:q ++ÜÆ F 141:q ++ÜÇ F 142:q ++ÜÈ F 143:q ++ÜÉ F 144:q ++ÜÊ F 145:q ++ÜË F 146:q ++ÜÌ F 147:q ++ÜÍ F 148:q ++ÜÎ F 149:q ++ÜÏ F 150:q ++ÜÐ F 151:q ++ÜÑ F 152:q ++ÜÒ F 153:q ++ÜÓ F 154:q ++ÜÔ F 155:q ++ÜÕ F 156:q ++ÜÖ F 157:q ++Ü× F 158:q ++ÜØ F 159:q ++ÜÙ F 160:q ++ÜÚ F 161:q ++ÜÛ F 162:q ++ÜÜ F 163:q ++ÜÝ F 164:q ++ÜÞ F 165:q ++Üß F 166:q ++Üà F 167:q ++Üá F 168:q ++Üâ F 169:q ++Üã F 170:q ++Üä F 171:q ++Üå F 172:q ++Üæ F 173:q ++Üç F 174:q ++Üè F 175:q ++Üé F 176:q ++Üê F 177:q ++Üë F 178:q ++Üì F 179:q ++Üí F 180:q ++Üî F 181:q ++Üï F 182:q ++Üð F 183:q ++Üñ F 184:q ++Üò F 185:q ++Üó F 186:q ++Üô F 187:q ++Üõ F 188:q ++Üö F 189:q ++Ü÷ F 190:q ++Üø F 191:q ++Üù F 192:q ++Üú F 193:q ++Üû F 194:q ++Üü F 195:q ++Üý F 196:q ++Üþ F 197:q ++Ý¡ F 198:q ++Ý¢ F 199:q ++Ý£ F 200:q ++ݤ F 201:q ++Ý¥ F 202:q ++ݦ F 203:q ++ݧ F 204:q ++ݨ F 205:q ++Ý© F 206:q ++ݪ F 207:q ++Ý« F 208:q ++ݬ F 209:q ++Ý­ F 210:q ++Ý® F 211:q ++ݯ F 212:q ++ݰ F 213:q ++ݱ F 214:q ++ݲ F 215:q ++ݳ F 216:q ++Ý´ F 217:q ++ݵ F 218:q ++ݶ F 219:q ++Ý· F 220:q ++ݸ F 221:q ++ݹ F 222:q ++ݺ F 223:q ++Ý» F 224:q ++ݼ F 225:q ++ݽ F 226:q ++ݾ F 227:q ++Ý¿ F 228:q ++ÝÀ F 229:q ++ÝÁ F 230:q ++Ý F 231:q ++Ýà F 232:q ++ÝÄ F 233:q ++ÝÅ F 234:q ++ÝÆ F 235:q ++ÝÇ F 236:q ++ÝÈ F 237:q ++ÝÉ F 238:q ++ÝÊ F 239:q ++ÝË F 240:q ++ÝÌ F 241:q ++ÝÍ F 242:q ++ÝÎ F 243:q ++ÝÏ F 244:q ++ÝÐ F 245:q ++ÝÑ F 246:q ++ÝÒ F 247:q ++ÝÓ F 248:q ++ÝÔ F 249:q ++ÝÕ F 250:q ++ÝÖ F 251:q ++Ý× F 252:q ++ÝØ F 253:q ++ÝÙ F 254:q ++ÝÚ F 255:q ++ÝÛ F 0:r ++ÝÜ F 1:r ++ÝÝ F 2:r ++ÝÞ F 3:r ++Ýß F 4:r ++Ýà F 5:r ++Ýá F 6:r ++Ýâ F 7:r ++Ýã F 8:r ++Ýä F 9:r ++Ýå F 10:r ++Ýæ F 11:r ++Ýç F 12:r ++Ýè F 13:r ++Ýé F 14:r ++Ýê F 15:r ++Ýë F 16:r ++Ýì F 17:r ++Ýí F 18:r ++Ýî F 19:r ++Ýï F 20:r ++Ýð F 21:r ++Ýñ F 22:r ++Ýò F 23:r ++Ýó F 24:r ++Ýô F 25:r ++Ýõ F 26:r ++Ýö F 27:r ++Ý÷ F 28:r ++Ýø F 29:r ++Ýù F 30:r ++Ýú F 31:r ++Ýû F 32:r ++Ýü F 33:r ++Ýý F 34:r ++Ýþ F 35:r ++Þ¡ F 36:r ++Þ¢ F 37:r ++Þ£ F 38:r ++Þ¤ F 39:r ++Þ¥ F 40:r ++Þ¦ F 41:r ++Þ§ F 42:r ++Þ¨ F 43:r ++Þ© F 44:r ++Þª F 45:r ++Þ« F 46:r ++Þ¬ F 47:r ++Þ­ F 48:r ++Þ® F 49:r ++Þ¯ F 50:r ++Þ° F 51:r ++Þ± F 52:r ++Þ² F 53:r ++Þ³ F 54:r ++Þ´ F 55:r ++Þµ F 56:r ++Þ¶ F 57:r ++Þ· F 58:r ++Þ¸ F 59:r ++Þ¹ F 60:r ++Þº F 61:r ++Þ» F 62:r ++Þ¼ F 63:r ++Þ½ F 64:r ++Þ¾ F 65:r ++Þ¿ F 66:r ++ÞÀ F 67:r ++ÞÁ F 68:r ++Þ F 69:r ++Þà F 70:r ++ÞÄ F 71:r ++ÞÅ F 72:r ++ÞÆ F 73:r ++ÞÇ F 74:r ++ÞÈ F 75:r ++ÞÉ F 76:r ++ÞÊ F 77:r ++ÞË F 78:r ++ÞÌ F 79:r ++ÞÍ F 80:r ++ÞÎ F 81:r ++ÞÏ F 82:r ++ÞÐ F 83:r ++ÞÑ F 84:r ++ÞÒ F 85:r ++ÞÓ F 86:r ++ÞÔ F 87:r ++ÞÕ F 88:r ++ÞÖ F 89:r ++Þ× F 90:r ++ÞØ F 91:r ++ÞÙ F 92:r ++ÞÚ F 93:r ++ÞÛ F 94:r ++ÞÜ F 95:r ++ÞÝ F 96:r ++ÞÞ F 97:r ++Þß F 98:r ++Þà F 99:r ++Þá F 100:r ++Þâ F 101:r ++Þã F 102:r ++Þä F 103:r ++Þå F 104:r ++Þæ F 105:r ++Þç F 106:r ++Þè F 107:r ++Þé F 108:r ++Þê F 109:r ++Þë F 110:r ++Þì F 111:r ++Þí F 112:r ++Þî F 113:r ++Þï F 114:r ++Þð F 115:r ++Þñ F 116:r ++Þò F 117:r ++Þó F 118:r ++Þô F 119:r ++Þõ F 120:r ++Þö F 121:r ++Þ÷ F 122:r ++Þø F 123:r ++Þù F 124:r ++Þú F 125:r ++Þû F 126:r ++Þü F 127:r ++Þý F 128:r ++Þþ F 129:r ++ß¡ F 130:r ++ߢ F 131:r ++ߣ F 132:r ++ߤ F 133:r ++ߥ F 134:r ++ߦ F 135:r ++ß§ F 136:r ++ߨ F 137:r ++ß© F 138:r ++ߪ F 139:r ++ß« F 140:r ++߬ F 141:r ++ß­ F 142:r ++ß® F 143:r ++߯ F 144:r ++ß° F 145:r ++ß± F 146:r ++ß² F 147:r ++ß³ F 148:r ++ß´ F 149:r ++ßµ F 150:r ++ß¶ F 151:r ++ß· F 152:r ++߸ F 153:r ++ß¹ F 154:r ++ߺ F 155:r ++ß» F 156:r ++ß¼ F 157:r ++ß½ F 158:r ++ß¾ F 159:r ++ß¿ F 160:r ++ßÀ F 161:r ++ßÁ F 162:r ++ß F 163:r ++ßà F 164:r ++ßÄ F 165:r ++ßÅ F 166:r ++߯ F 167:r ++ßÇ F 168:r ++ßÈ F 169:r ++ßÉ F 170:r ++ßÊ F 171:r ++ßË F 172:r ++ßÌ F 173:r ++ßÍ F 174:r ++ßÎ F 175:r ++ßÏ F 176:r ++ßÐ F 177:r ++ßÑ F 178:r ++ßÒ F 179:r ++ßÓ F 180:r ++ßÔ F 181:r ++ßÕ F 182:r ++ßÖ F 183:r ++ß× F 184:r ++ߨ F 185:r ++ßÙ F 186:r ++ßÚ F 187:r ++ßÛ F 188:r ++ßÜ F 189:r ++ßÝ F 190:r ++ßÞ F 191:r ++ßß F 192:r ++ßà F 193:r ++ßá F 194:r ++ßâ F 195:r ++ßã F 196:r ++ßä F 197:r ++ßå F 198:r ++ßæ F 199:r ++ßç F 200:r ++ßè F 201:r ++ßé F 202:r ++ßê F 203:r ++ßë F 204:r ++ßì F 205:r ++ßí F 206:r ++ßî F 207:r ++ßï F 208:r ++ßð F 209:r ++ßñ F 210:r ++ßò F 211:r ++ßó F 212:r ++ßô F 213:r ++ßõ F 214:r ++ßö F 215:r ++ß÷ F 216:r ++ßø F 217:r ++ßù F 218:r ++ßú F 219:r ++ßû F 220:r ++ßü F 221:r ++ßý F 222:r ++ßþ F 223:r ++à¡ F 224:r ++ࢠF 225:r ++࣠F 226:r ++ठF 227:r ++ॠF 228:r ++ঠF 229:r ++à§ F 230:r ++ਠF 231:r ++à© F 232:r ++ઠF 233:r ++à« F 234:r ++ଠF 235:r ++à­ F 236:r ++à® F 237:r ++௠F 238:r ++à° F 239:r ++à± F 240:r ++ಠF 241:r ++à³ F 242:r ++à´ F 243:r ++ൠF 244:r ++à¶ F 245:r ++à· F 246:r ++ภF 247:r ++๠F 248:r ++ຠF 249:r ++à» F 250:r ++༠F 251:r ++འF 252:r ++ྠF 253:r ++à¿ F 254:r ++àÀ F 255:r ++àÁ F 0:s ++à F 1:s ++àà F 2:s ++àÄ F 3:s ++àÅ F 4:s ++àÆ F 5:s ++àÇ F 6:s ++àÈ F 7:s ++àÉ F 8:s ++àÊ F 9:s ++àË F 10:s ++àÌ F 11:s ++àÍ F 12:s ++àÎ F 13:s ++àÏ F 14:s ++àÐ F 15:s ++àÑ F 16:s ++àÒ F 17:s ++àÓ F 18:s ++àÔ F 19:s ++àÕ F 20:s ++àÖ F 21:s ++à× F 22:s ++àØ F 23:s ++àÙ F 24:s ++àÚ F 25:s ++àÛ F 26:s ++àÜ F 27:s ++àÝ F 28:s ++àÞ F 29:s ++àß F 30:s ++àà F 31:s ++àá F 32:s ++àâ F 33:s ++àã F 34:s ++àä F 35:s ++àå F 36:s ++àæ F 37:s ++àç F 38:s ++àè F 39:s ++àé F 40:s ++àê F 41:s ++àë F 42:s ++àì F 43:s ++àí F 44:s ++àî F 45:s ++àï F 46:s ++àð F 47:s ++àñ F 48:s ++àò F 49:s ++àó F 50:s ++àô F 51:s ++àõ F 52:s ++àö F 53:s ++à÷ F 54:s ++àø F 55:s ++àù F 56:s ++àú F 57:s ++àû F 58:s ++àü F 59:s ++àý F 60:s ++àþ F 61:s ++á¡ F 62:s ++ᢠF 63:s ++ᣠF 64:s ++ᤠF 65:s ++ᥠF 66:s ++ᦠF 67:s ++á§ F 68:s ++ᨠF 69:s ++á© F 70:s ++᪠F 71:s ++á« F 72:s ++ᬠF 73:s ++á­ F 74:s ++á® F 75:s ++ᯠF 76:s ++á° F 77:s ++á± F 78:s ++á² F 79:s ++á³ F 80:s ++á´ F 81:s ++áµ F 82:s ++á¶ F 83:s ++á· F 84:s ++ḠF 85:s ++á¹ F 86:s ++ẠF 87:s ++á» F 88:s ++á¼ F 89:s ++á½ F 90:s ++á¾ F 91:s ++á¿ F 92:s ++áÀ F 93:s ++áÁ F 94:s ++á F 95:s ++áà F 96:s ++áÄ F 97:s ++áÅ F 98:s ++áÆ F 99:s ++áÇ F 100:s ++áÈ F 101:s ++áÉ F 102:s ++áÊ F 103:s ++áË F 104:s ++áÌ F 105:s ++áÍ F 106:s ++áÎ F 107:s ++áÏ F 108:s ++áÐ F 109:s ++áÑ F 110:s ++áÒ F 111:s ++áÓ F 112:s ++áÔ F 113:s ++áÕ F 114:s ++áÖ F 115:s ++á× F 116:s ++áØ F 117:s ++áÙ F 118:s ++áÚ F 119:s ++áÛ F 120:s ++áÜ F 121:s ++áÝ F 122:s ++áÞ F 123:s ++áß F 124:s ++áà F 125:s ++áá F 126:s ++áâ F 127:s ++áã F 128:s ++áä F 129:s ++áå F 130:s ++áæ F 131:s ++áç F 132:s ++áè F 133:s ++áé F 134:s ++áê F 135:s ++áë F 136:s ++áì F 137:s ++áí F 138:s ++áî F 139:s ++áï F 140:s ++áð F 141:s ++áñ F 142:s ++áò F 143:s ++áó F 144:s ++áô F 145:s ++áõ F 146:s ++áö F 147:s ++á÷ F 148:s ++áø F 149:s ++áù F 150:s ++áú F 151:s ++áû F 152:s ++áü F 153:s ++áý F 154:s ++áþ F 155:s ++â¡ F 156:s ++⢠F 157:s ++⣠F 158:s ++⤠F 159:s ++⥠F 160:s ++⦠F 161:s ++â§ F 162:s ++⨠F 163:s ++â© F 164:s ++⪠F 165:s ++â« F 166:s ++⬠F 167:s ++â­ F 168:s ++â® F 169:s ++⯠F 170:s ++â° F 171:s ++â± F 172:s ++â² F 173:s ++â³ F 174:s ++â´ F 175:s ++âµ F 176:s ++â¶ F 177:s ++â· F 178:s ++⸠F 179:s ++â¹ F 180:s ++⺠F 181:s ++â» F 182:s ++â¼ F 183:s ++â½ F 184:s ++â¾ F 185:s ++â¿ F 186:s ++âÀ F 187:s ++âÁ F 188:s ++â F 189:s ++âà F 190:s ++âÄ F 191:s ++âÅ F 192:s ++âÆ F 193:s ++âÇ F 194:s ++âÈ F 195:s ++âÉ F 196:s ++âÊ F 197:s ++âË F 198:s ++âÌ F 199:s ++âÍ F 200:s ++âÎ F 201:s ++âÏ F 202:s ++âÐ F 203:s ++âÑ F 204:s ++âÒ F 205:s ++âÓ F 206:s ++âÔ F 207:s ++âÕ F 208:s ++âÖ F 209:s ++â× F 210:s ++âØ F 211:s ++âÙ F 212:s ++âÚ F 213:s ++âÛ F 214:s ++âÜ F 215:s ++âÝ F 216:s ++âÞ F 217:s ++âß F 218:s ++âà F 219:s ++âá F 220:s ++ââ F 221:s ++âã F 222:s ++âä F 223:s ++âå F 224:s ++âæ F 225:s ++âç F 226:s ++âè F 227:s ++âé F 228:s ++âê F 229:s ++âë F 230:s ++âì F 231:s ++âí F 232:s ++âî F 233:s ++âï F 234:s ++âð F 235:s ++âñ F 236:s ++âò F 237:s ++âó F 238:s ++âô F 239:s ++âõ F 240:s ++âö F 241:s ++â÷ F 242:s ++âø F 243:s ++âù F 244:s ++âú F 245:s ++âû F 246:s ++âü F 247:s ++âý F 248:s ++âþ F 249:s ++ã¡ F 250:s ++㢠F 251:s ++㣠F 252:s ++㤠F 253:s ++㥠F 254:s ++㦠F 255:s ++ã§ F 0:t ++㨠F 1:t ++ã© F 2:t ++㪠F 3:t ++ã« F 4:t ++㬠F 5:t ++ã­ F 6:t ++ã® F 7:t ++㯠F 8:t ++ã° F 9:t ++ã± F 10:t ++ã² F 11:t ++ã³ F 12:t ++ã´ F 13:t ++ãµ F 14:t ++ã¶ F 15:t ++ã· F 16:t ++㸠F 17:t ++ã¹ F 18:t ++㺠F 19:t ++ã» F 20:t ++ã¼ F 21:t ++ã½ F 22:t ++ã¾ F 23:t ++ã¿ F 24:t ++ãÀ F 25:t ++ãÁ F 26:t ++ã F 27:t ++ãà F 28:t ++ãÄ F 29:t ++ãÅ F 30:t ++ãÆ F 31:t ++ãÇ F 32:t ++ãÈ F 33:t ++ãÉ F 34:t ++ãÊ F 35:t ++ãË F 36:t ++ãÌ F 37:t ++ãÍ F 38:t ++ãÎ F 39:t ++ãÏ F 40:t ++ãÐ F 41:t ++ãÑ F 42:t ++ãÒ F 43:t ++ãÓ F 44:t ++ãÔ F 45:t ++ãÕ F 46:t ++ãÖ F 47:t ++ã× F 48:t ++ãØ F 49:t ++ãÙ F 50:t ++ãÚ F 51:t ++ãÛ F 52:t ++ãÜ F 53:t ++ãÝ F 54:t ++ãÞ F 55:t ++ãß F 56:t ++ãà F 57:t ++ãá F 58:t ++ãâ F 59:t ++ãã F 60:t ++ãä F 61:t ++ãå F 62:t ++ãæ F 63:t ++ãç F 64:t ++ãè F 65:t ++ãé F 66:t ++ãê F 67:t ++ãë F 68:t ++ãì F 69:t ++ãí F 70:t ++ãî F 71:t ++ãï F 72:t ++ãð F 73:t ++ãñ F 74:t ++ãò F 75:t ++ãó F 76:t ++ãô F 77:t ++ãõ F 78:t ++ãö F 79:t ++ã÷ F 80:t ++ãø F 81:t ++ãù F 82:t ++ãú F 83:t ++ãû F 84:t ++ãü F 85:t ++ãý F 86:t ++ãþ F 87:t ++ä¡ F 88:t ++ä¢ F 89:t ++ä£ F 90:t ++ä¤ F 91:t ++ä¥ F 92:t ++ä¦ F 93:t ++ä§ F 94:t ++ä¨ F 95:t ++ä© F 96:t ++äª F 97:t ++ä« F 98:t ++ä¬ F 99:t ++ä­ F 100:t ++ä® F 101:t ++ä¯ F 102:t ++ä° F 103:t ++ä± F 104:t ++ä² F 105:t ++ä³ F 106:t ++ä´ F 107:t ++äµ F 108:t ++ä¶ F 109:t ++ä· F 110:t ++ä¸ F 111:t ++ä¹ F 112:t ++äº F 113:t ++ä» F 114:t ++ä¼ F 115:t ++ä½ F 116:t ++ä¾ F 117:t ++ä¿ F 118:t ++äÀ F 119:t ++äÁ F 120:t ++ä F 121:t ++äà F 122:t ++äÄ F 123:t ++äÅ F 124:t ++äÆ F 125:t ++äÇ F 126:t ++äÈ F 127:t ++äÉ F 128:t ++äÊ F 129:t ++äË F 130:t ++äÌ F 131:t ++äÍ F 132:t ++äÎ F 133:t ++äÏ F 134:t ++äÐ F 135:t ++äÑ F 136:t ++äÒ F 137:t ++äÓ F 138:t ++äÔ F 139:t ++äÕ F 140:t ++äÖ F 141:t ++ä× F 142:t ++äØ F 143:t ++äÙ F 144:t ++äÚ F 145:t ++äÛ F 146:t ++äÜ F 147:t ++äÝ F 148:t ++äÞ F 149:t ++äß F 150:t ++äà F 151:t ++äá F 152:t ++äâ F 153:t ++äã F 154:t ++ää F 155:t ++äå F 156:t ++äæ F 157:t ++äç F 158:t ++äè F 159:t ++äé F 160:t ++äê F 161:t ++äë F 162:t ++äì F 163:t ++äí F 164:t ++äî F 165:t ++äï F 166:t ++äð F 167:t ++äñ F 168:t ++äò F 169:t ++äó F 170:t ++äô F 171:t ++äõ F 172:t ++äö F 173:t ++ä÷ F 174:t ++äø F 175:t ++äù F 176:t ++äú F 177:t ++äû F 178:t ++äü F 179:t ++äý F 180:t ++äþ F 181:t ++å¡ F 182:t ++å¢ F 183:t ++å£ F 184:t ++å¤ F 185:t ++å¥ F 186:t ++å¦ F 187:t ++å§ F 188:t ++å¨ F 189:t ++å© F 190:t ++åª F 191:t ++å« F 192:t ++å¬ F 193:t ++å­ F 194:t ++å® F 195:t ++å¯ F 196:t ++å° F 197:t ++å± F 198:t ++å² F 199:t ++å³ F 200:t ++å´ F 201:t ++åµ F 202:t ++å¶ F 203:t ++å· F 204:t ++å¸ F 205:t ++å¹ F 206:t ++åº F 207:t ++å» F 208:t ++å¼ F 209:t ++å½ F 210:t ++å¾ F 211:t ++å¿ F 212:t ++åÀ F 213:t ++åÁ F 214:t ++å F 215:t ++åà F 216:t ++åÄ F 217:t ++åÅ F 218:t ++åÆ F 219:t ++åÇ F 220:t ++åÈ F 221:t ++åÉ F 222:t ++åÊ F 223:t ++åË F 224:t ++åÌ F 225:t ++åÍ F 226:t ++åÎ F 227:t ++åÏ F 228:t ++åÐ F 229:t ++åÑ F 230:t ++åÒ F 231:t ++åÓ F 232:t ++åÔ F 233:t ++åÕ F 234:t ++åÖ F 235:t ++å× F 236:t ++åØ F 237:t ++åÙ F 238:t ++åÚ F 239:t ++åÛ F 240:t ++åÜ F 241:t ++åÝ F 242:t ++åÞ F 243:t ++åß F 244:t ++åà F 245:t ++åá F 246:t ++åâ F 247:t ++åã F 248:t ++åä F 249:t ++åå F 250:t ++åæ F 251:t ++åç F 252:t ++åè F 253:t ++åé F 254:t ++åê F 255:t ++åë F 0:u ++åì F 1:u ++åí F 2:u ++åî F 3:u ++åï F 4:u ++åð F 5:u ++åñ F 6:u ++åò F 7:u ++åó F 8:u ++åô F 9:u ++åõ F 10:u ++åö F 11:u ++å÷ F 12:u ++åø F 13:u ++åù F 14:u ++åú F 15:u ++åû F 16:u ++åü F 17:u ++åý F 18:u ++åþ F 19:u ++æ¡ F 20:u ++æ¢ F 21:u ++æ£ F 22:u ++æ¤ F 23:u ++æ¥ F 24:u ++æ¦ F 25:u ++æ§ F 26:u ++æ¨ F 27:u ++æ© F 28:u ++æª F 29:u ++æ« F 30:u ++æ¬ F 31:u ++æ­ F 32:u ++æ® F 33:u ++æ¯ F 34:u ++æ° F 35:u ++æ± F 36:u ++æ² F 37:u ++æ³ F 38:u ++æ´ F 39:u ++æµ F 40:u ++æ¶ F 41:u ++æ· F 42:u ++æ¸ F 43:u ++æ¹ F 44:u ++æº F 45:u ++æ» F 46:u ++æ¼ F 47:u ++æ½ F 48:u ++æ¾ F 49:u ++æ¿ F 50:u ++æÀ F 51:u ++æÁ F 52:u ++æÂ F 53:u ++æÃ F 54:u ++æÄ F 55:u ++æÅ F 56:u ++æÆ F 57:u ++æÇ F 58:u ++æÈ F 59:u ++æÉ F 60:u ++æÊ F 61:u ++æË F 62:u ++æÌ F 63:u ++æÍ F 64:u ++æÎ F 65:u ++æÏ F 66:u ++æÐ F 67:u ++æÑ F 68:u ++æÒ F 69:u ++æÓ F 70:u ++æÔ F 71:u ++æÕ F 72:u ++æÖ F 73:u ++æ× F 74:u ++æØ F 75:u ++æÙ F 76:u ++æÚ F 77:u ++æÛ F 78:u ++æÜ F 79:u ++æÝ F 80:u ++æÞ F 81:u ++æß F 82:u ++æà F 83:u ++æá F 84:u ++æâ F 85:u ++æã F 86:u ++æä F 87:u ++æå F 88:u ++ææ F 89:u ++æç F 90:u ++æè F 91:u ++æé F 92:u ++æê F 93:u ++æë F 94:u ++æì F 95:u ++æí F 96:u ++æî F 97:u ++æï F 98:u ++æð F 99:u ++æñ F 100:u ++æò F 101:u ++æó F 102:u ++æô F 103:u ++æõ F 104:u ++æö F 105:u ++æ÷ F 106:u ++æø F 107:u ++æù F 108:u ++æú F 109:u ++æû F 110:u ++æü F 111:u ++æý F 112:u ++æþ F 113:u ++ç¡ F 114:u ++ç¢ F 115:u ++ç£ F 116:u ++ç¤ F 117:u ++ç¥ F 118:u ++ç¦ F 119:u ++ç§ F 120:u ++ç¨ F 121:u ++ç© F 122:u ++çª F 123:u ++ç« F 124:u ++ç¬ F 125:u ++ç­ F 126:u ++ç® F 127:u ++ç¯ F 128:u ++ç° F 129:u ++ç± F 130:u ++ç² F 131:u ++ç³ F 132:u ++ç´ F 133:u ++çµ F 134:u ++ç¶ F 135:u ++ç· F 136:u ++ç¸ F 137:u ++ç¹ F 138:u ++çº F 139:u ++ç» F 140:u ++ç¼ F 141:u ++ç½ F 142:u ++ç¾ F 143:u ++ç¿ F 144:u ++çÀ F 145:u ++çÁ F 146:u ++ç F 147:u ++çà F 148:u ++çÄ F 149:u ++çÅ F 150:u ++çÆ F 151:u ++çÇ F 152:u ++çÈ F 153:u ++çÉ F 154:u ++çÊ F 155:u ++çË F 156:u ++çÌ F 157:u ++çÍ F 158:u ++çÎ F 159:u ++çÏ F 160:u ++çÐ F 161:u ++çÑ F 162:u ++çÒ F 163:u ++çÓ F 164:u ++çÔ F 165:u ++çÕ F 166:u ++çÖ F 167:u ++ç× F 168:u ++çØ F 169:u ++çÙ F 170:u ++çÚ F 171:u ++çÛ F 172:u ++çÜ F 173:u ++çÝ F 174:u ++çÞ F 175:u ++çß F 176:u ++çà F 177:u ++çá F 178:u ++çâ F 179:u ++çã F 180:u ++çä F 181:u ++çå F 182:u ++çæ F 183:u ++çç F 184:u ++çè F 185:u ++çé F 186:u ++çê F 187:u ++çë F 188:u ++çì F 189:u ++çí F 190:u ++çî F 191:u ++çï F 192:u ++çð F 193:u ++çñ F 194:u ++çò F 195:u ++çó F 196:u ++çô F 197:u ++çõ F 198:u ++çö F 199:u ++ç÷ F 200:u ++çø F 201:u ++çù F 202:u ++çú F 203:u ++çû F 204:u ++çü F 205:u ++çý F 206:u ++çþ F 207:u ++è¡ F 208:u ++è¢ F 209:u ++è£ F 210:u ++è¤ F 211:u ++è¥ F 212:u ++è¦ F 213:u ++è§ F 214:u ++è¨ F 215:u ++è© F 216:u ++èª F 217:u ++è« F 218:u ++è¬ F 219:u ++è­ F 220:u ++è® F 221:u ++è¯ F 222:u ++è° F 223:u ++è± F 224:u ++è² F 225:u ++è³ F 226:u ++è´ F 227:u ++èµ F 228:u ++è¶ F 229:u ++è· F 230:u ++è¸ F 231:u ++è¹ F 232:u ++èº F 233:u ++è» F 234:u ++è¼ F 235:u ++è½ F 236:u ++è¾ F 237:u ++è¿ F 238:u ++èÀ F 239:u ++èÁ F 240:u ++è F 241:u ++èà F 242:u ++èÄ F 243:u ++èÅ F 244:u ++èÆ F 245:u ++èÇ F 246:u ++èÈ F 247:u ++èÉ F 248:u ++èÊ F 249:u ++èË F 250:u ++èÌ F 251:u ++èÍ F 252:u ++èÎ F 253:u ++èÏ F 254:u ++èÐ F 255:u ++èÑ F 0:v ++èÒ F 1:v ++èÓ F 2:v ++èÔ F 3:v ++èÕ F 4:v ++èÖ F 5:v ++è× F 6:v ++èØ F 7:v ++èÙ F 8:v ++èÚ F 9:v ++èÛ F 10:v ++èÜ F 11:v ++èÝ F 12:v ++èÞ F 13:v ++èß F 14:v ++èà F 15:v ++èá F 16:v ++èâ F 17:v ++èã F 18:v ++èä F 19:v ++èå F 20:v ++èæ F 21:v ++èç F 22:v ++èè F 23:v ++èé F 24:v ++èê F 25:v ++èë F 26:v ++èì F 27:v ++èí F 28:v ++èî F 29:v ++èï F 30:v ++èð F 31:v ++èñ F 32:v ++èò F 33:v ++èó F 34:v ++èô F 35:v ++èõ F 36:v ++èö F 37:v ++è÷ F 38:v ++èø F 39:v ++èù F 40:v ++èú F 41:v ++èû F 42:v ++èü F 43:v ++èý F 44:v ++èþ F 45:v ++é¡ F 46:v ++é¢ F 47:v ++é£ F 48:v ++é¤ F 49:v ++é¥ F 50:v ++é¦ F 51:v ++é§ F 52:v ++é¨ F 53:v ++é© F 54:v ++éª F 55:v ++é« F 56:v ++é¬ F 57:v ++é­ F 58:v ++é® F 59:v ++é¯ F 60:v ++é° F 61:v ++é± F 62:v ++é² F 63:v ++é³ F 64:v ++é´ F 65:v ++éµ F 66:v ++é¶ F 67:v ++é· F 68:v ++é¸ F 69:v ++é¹ F 70:v ++éº F 71:v ++é» F 72:v ++é¼ F 73:v ++é½ F 74:v ++é¾ F 75:v ++é¿ F 76:v ++éÀ F 77:v ++éÁ F 78:v ++é F 79:v ++éà F 80:v ++éÄ F 81:v ++éÅ F 82:v ++éÆ F 83:v ++éÇ F 84:v ++éÈ F 85:v ++éÉ F 86:v ++éÊ F 87:v ++éË F 88:v ++éÌ F 89:v ++éÍ F 90:v ++éÎ F 91:v ++éÏ F 92:v ++éÐ F 93:v ++éÑ F 94:v ++éÒ F 95:v ++éÓ F 96:v ++éÔ F 97:v ++éÕ F 98:v ++éÖ F 99:v ++é× F 100:v ++éØ F 101:v ++éÙ F 102:v ++éÚ F 103:v ++éÛ F 104:v ++éÜ F 105:v ++éÝ F 106:v ++éÞ F 107:v ++éß F 108:v ++éà F 109:v ++éá F 110:v ++éâ F 111:v ++éã F 112:v ++éä F 113:v ++éå F 114:v ++éæ F 115:v ++éç F 116:v ++éè F 117:v ++éé F 118:v ++éê F 119:v ++éë F 120:v ++éì F 121:v ++éí F 122:v ++éî F 123:v ++éï F 124:v ++éð F 125:v ++éñ F 126:v ++éò F 127:v ++éó F 128:v ++éô F 129:v ++éõ F 130:v ++éö F 131:v ++é÷ F 132:v ++éø F 133:v ++éù F 134:v ++éú F 135:v ++éû F 136:v ++éü F 137:v ++éý F 138:v ++éþ F 139:v ++ê¡ F 140:v ++ê¢ F 141:v ++ê£ F 142:v ++ê¤ F 143:v ++ê¥ F 144:v ++ê¦ F 145:v ++ê§ F 146:v ++ê¨ F 147:v ++ê© F 148:v ++êª F 149:v ++ê« F 150:v ++ê¬ F 151:v ++ê­ F 152:v ++ê® F 153:v ++ê¯ F 154:v ++ê° F 155:v ++ê± F 156:v ++ê² F 157:v ++ê³ F 158:v ++ê´ F 159:v ++êµ F 160:v ++ê¶ F 161:v ++ê· F 162:v ++ê¸ F 163:v ++ê¹ F 164:v ++êº F 165:v ++ê» F 166:v ++ê¼ F 167:v ++ê½ F 168:v ++ê¾ F 169:v ++ê¿ F 170:v ++êÀ F 171:v ++êÁ F 172:v ++ê F 173:v ++êà F 174:v ++êÄ F 175:v ++êÅ F 176:v ++êÆ F 177:v ++êÇ F 178:v ++êÈ F 179:v ++êÉ F 180:v ++êÊ F 181:v ++êË F 182:v ++êÌ F 183:v ++êÍ F 184:v ++êÎ F 185:v ++êÏ F 186:v ++êÐ F 187:v ++êÑ F 188:v ++êÒ F 189:v ++êÓ F 190:v ++êÔ F 191:v ++êÕ F 192:v ++êÖ F 193:v ++ê× F 194:v ++êØ F 195:v ++êÙ F 196:v ++êÚ F 197:v ++êÛ F 198:v ++êÜ F 199:v ++êÝ F 200:v ++êÞ F 201:v ++êß F 202:v ++êà F 203:v ++êá F 204:v ++êâ F 205:v ++êã F 206:v ++êä F 207:v ++êå F 208:v ++êæ F 209:v ++êç F 210:v ++êè F 211:v ++êé F 212:v ++êê F 213:v ++êë F 214:v ++êì F 215:v ++êí F 216:v ++êî F 217:v ++êï F 218:v ++êð F 219:v ++êñ F 220:v ++êò F 221:v ++êó F 222:v ++êô F 223:v ++êõ F 224:v ++êö F 225:v ++ê÷ F 226:v ++êø F 227:v ++êù F 228:v ++êú F 229:v ++êû F 230:v ++êü F 231:v ++êý F 232:v ++êþ F 233:v ++ë¡ F 234:v ++ë¢ F 235:v ++ë£ F 236:v ++ë¤ F 237:v ++ë¥ F 238:v ++ë¦ F 239:v ++ë§ F 240:v ++ë¨ F 241:v ++ë© F 242:v ++ëª F 243:v ++ë« F 244:v ++ë¬ F 245:v ++ë­ F 246:v ++ë® F 247:v ++ë¯ F 248:v ++ë° F 249:v ++ë± F 250:v ++ë² F 251:v ++ë³ F 252:v ++ë´ F 253:v ++ëµ F 254:v ++ë¶ F 255:v ++ë· F 0:w ++ë¸ F 1:w ++ë¹ F 2:w ++ëº F 3:w ++ë» F 4:w ++ë¼ F 5:w ++ë½ F 6:w ++ë¾ F 7:w ++ë¿ F 8:w ++ëÀ F 9:w ++ëÁ F 10:w ++ë F 11:w ++ëà F 12:w ++ëÄ F 13:w ++ëÅ F 14:w ++ëÆ F 15:w ++ëÇ F 16:w ++ëÈ F 17:w ++ëÉ F 18:w ++ëÊ F 19:w ++ëË F 20:w ++ëÌ F 21:w ++ëÍ F 22:w ++ëÎ F 23:w ++ëÏ F 24:w ++ëÐ F 25:w ++ëÑ F 26:w ++ëÒ F 27:w ++ëÓ F 28:w ++ëÔ F 29:w ++ëÕ F 30:w ++ëÖ F 31:w ++ë× F 32:w ++ëØ F 33:w ++ëÙ F 34:w ++ëÚ F 35:w ++ëÛ F 36:w ++ëÜ F 37:w ++ëÝ F 38:w ++ëÞ F 39:w ++ëß F 40:w ++ëà F 41:w ++ëá F 42:w ++ëâ F 43:w ++ëã F 44:w ++ëä F 45:w ++ëå F 46:w ++ëæ F 47:w ++ëç F 48:w ++ëè F 49:w ++ëé F 50:w ++ëê F 51:w ++ëë F 52:w ++ëì F 53:w ++ëí F 54:w ++ëî F 55:w ++ëï F 56:w ++ëð F 57:w ++ëñ F 58:w ++ëò F 59:w ++ëó F 60:w ++ëô F 61:w ++ëõ F 62:w ++ëö F 63:w ++ë÷ F 64:w ++ëø F 65:w ++ëù F 66:w ++ëú F 67:w ++ëû F 68:w ++ëü F 69:w ++ëý F 70:w ++ëþ F 71:w ++ì¡ F 72:w ++ì¢ F 73:w ++ì£ F 74:w ++ì¤ F 75:w ++ì¥ F 76:w ++ì¦ F 77:w ++ì§ F 78:w ++ì¨ F 79:w ++ì© F 80:w ++ìª F 81:w ++ì« F 82:w ++ì¬ F 83:w ++ì­ F 84:w ++ì® F 85:w ++ì¯ F 86:w ++ì° F 87:w ++ì± F 88:w ++ì² F 89:w ++ì³ F 90:w ++ì´ F 91:w ++ìµ F 92:w ++ì¶ F 93:w ++ì· F 94:w ++ì¸ F 95:w ++ì¹ F 96:w ++ìº F 97:w ++ì» F 98:w ++ì¼ F 99:w ++ì½ F 100:w ++ì¾ F 101:w ++ì¿ F 102:w ++ìÀ F 103:w ++ìÁ F 104:w ++ì F 105:w ++ìà F 106:w ++ìÄ F 107:w ++ìÅ F 108:w ++ìÆ F 109:w ++ìÇ F 110:w ++ìÈ F 111:w ++ìÉ F 112:w ++ìÊ F 113:w ++ìË F 114:w ++ìÌ F 115:w ++ìÍ F 116:w ++ìÎ F 117:w ++ìÏ F 118:w ++ìÐ F 119:w ++ìÑ F 120:w ++ìÒ F 121:w ++ìÓ F 122:w ++ìÔ F 123:w ++ìÕ F 124:w ++ìÖ F 125:w ++ì× F 126:w ++ìØ F 127:w ++ìÙ F 128:w ++ìÚ F 129:w ++ìÛ F 130:w ++ìÜ F 131:w ++ìÝ F 132:w ++ìÞ F 133:w ++ìß F 134:w ++ìà F 135:w ++ìá F 136:w ++ìâ F 137:w ++ìã F 138:w ++ìä F 139:w ++ìå F 140:w ++ìæ F 141:w ++ìç F 142:w ++ìè F 143:w ++ìé F 144:w ++ìê F 145:w ++ìë F 146:w ++ìì F 147:w ++ìí F 148:w ++ìî F 149:w ++ìï F 150:w ++ìð F 151:w ++ìñ F 152:w ++ìò F 153:w ++ìó F 154:w ++ìô F 155:w ++ìõ F 156:w ++ìö F 157:w ++ì÷ F 158:w ++ìø F 159:w ++ìù F 160:w ++ìú F 161:w ++ìû F 162:w ++ìü F 163:w ++ìý F 164:w ++ìþ F 165:w ++í¡ F 166:w ++í¢ F 167:w ++í£ F 168:w ++í¤ F 169:w ++í¥ F 170:w ++í¦ F 171:w ++í§ F 172:w ++í¨ F 173:w ++í© F 174:w ++íª F 175:w ++í« F 176:w ++í¬ F 177:w ++í­ F 178:w ++í® F 179:w ++í¯ F 180:w ++í° F 181:w ++í± F 182:w ++í² F 183:w ++í³ F 184:w ++í´ F 185:w ++íµ F 186:w ++í¶ F 187:w ++í· F 188:w ++í¸ F 189:w ++í¹ F 190:w ++íº F 191:w ++í» F 192:w ++í¼ F 193:w ++í½ F 194:w ++í¾ F 195:w ++í¿ F 196:w ++íÀ F 197:w ++íÁ F 198:w ++í F 199:w ++íà F 200:w ++íÄ F 201:w ++íÅ F 202:w ++íÆ F 203:w ++íÇ F 204:w ++íÈ F 205:w ++íÉ F 206:w ++íÊ F 207:w ++íË F 208:w ++íÌ F 209:w ++íÍ F 210:w ++íÎ F 211:w ++íÏ F 212:w ++íÐ F 213:w ++íÑ F 214:w ++íÒ F 215:w ++íÓ F 216:w ++íÔ F 217:w ++íÕ F 218:w ++íÖ F 219:w ++í× F 220:w ++íØ F 221:w ++íÙ F 222:w ++íÚ F 223:w ++íÛ F 224:w ++íÜ F 225:w ++íÝ F 226:w ++íÞ F 227:w ++íß F 228:w ++íà F 229:w ++íá F 230:w ++íâ F 231:w ++íã F 232:w ++íä F 233:w ++íå F 234:w ++íæ F 235:w ++íç F 236:w ++íè F 237:w ++íé F 238:w ++íê F 239:w ++íë F 240:w ++íì F 241:w ++íí F 242:w ++íî F 243:w ++íï F 244:w ++íð F 245:w ++íñ F 246:w ++íò F 247:w ++íó F 248:w ++íô F 249:w ++íõ F 250:w ++íö F 251:w ++í÷ F 252:w ++íø F 253:w ++íù F 254:w ++íú F 255:w ++íû F 0:x ++íü F 1:x ++íý F 2:x ++íþ F 3:x ++î¡ F 4:x ++î¢ F 5:x ++î£ F 6:x ++î¤ F 7:x ++î¥ F 8:x ++î¦ F 9:x ++î§ F 10:x ++î¨ F 11:x ++î© F 12:x ++îª F 13:x ++î« F 14:x ++î¬ F 15:x ++î­ F 16:x ++î® F 17:x ++î¯ F 18:x ++î° F 19:x ++î± F 20:x ++î² F 21:x ++î³ F 22:x ++î´ F 23:x ++îµ F 24:x ++î¶ F 25:x ++î· F 26:x ++î¸ F 27:x ++î¹ F 28:x ++îº F 29:x ++î» F 30:x ++î¼ F 31:x ++î½ F 32:x ++î¾ F 33:x ++î¿ F 34:x ++îÀ F 35:x ++îÁ F 36:x ++î F 37:x ++îà F 38:x ++îÄ F 39:x ++îÅ F 40:x ++îÆ F 41:x ++îÇ F 42:x ++îÈ F 43:x ++îÉ F 44:x ++îÊ F 45:x ++îË F 46:x ++îÌ F 47:x ++îÍ F 48:x ++îÎ F 49:x ++îÏ F 50:x ++îÐ F 51:x ++îÑ F 52:x ++îÒ F 53:x ++îÓ F 54:x ++îÔ F 55:x ++îÕ F 56:x ++îÖ F 57:x ++î× F 58:x ++îØ F 59:x ++îÙ F 60:x ++îÚ F 61:x ++îÛ F 62:x ++îÜ F 63:x ++îÝ F 64:x ++îÞ F 65:x ++îß F 66:x ++îà F 67:x ++îá F 68:x ++îâ F 69:x ++îã F 70:x ++îä F 71:x ++îå F 72:x ++îæ F 73:x ++îç F 74:x ++îè F 75:x ++îé F 76:x ++îê F 77:x ++îë F 78:x ++îì F 79:x ++îí F 80:x ++îî F 81:x ++îï F 82:x ++îð F 83:x ++îñ F 84:x ++îò F 85:x ++îó F 86:x ++îô F 87:x ++îõ F 88:x ++îö F 89:x ++î÷ F 90:x ++îø F 91:x ++îù F 92:x ++îú F 93:x ++îû F 94:x ++îü F 95:x ++îý F 96:x ++îþ F 97:x ++ï¡ F 98:x ++ï¢ F 99:x ++ï£ F 100:x ++ï¤ F 101:x ++ï¥ F 102:x ++ï¦ F 103:x ++ï§ F 104:x ++ï¨ F 105:x ++ï© F 106:x ++ïª F 107:x ++ï« F 108:x ++ï¬ F 109:x ++ï­ F 110:x ++ï® F 111:x ++ï¯ F 112:x ++ï° F 113:x ++ï± F 114:x ++ï² F 115:x ++ï³ F 116:x ++ï´ F 117:x ++ïµ F 118:x ++ï¶ F 119:x ++ï· F 120:x ++ï¸ F 121:x ++ï¹ F 122:x ++ïº F 123:x ++ï» F 124:x ++ï¼ F 125:x ++ï½ F 126:x ++ï¾ F 127:x ++ï¿ F 128:x ++ïÀ F 129:x ++ïÁ F 130:x ++ï F 131:x ++ïà F 132:x ++ïÄ F 133:x ++ïÅ F 134:x ++ïÆ F 135:x ++ïÇ F 136:x ++ïÈ F 137:x ++ïÉ F 138:x ++ïÊ F 139:x ++ïË F 140:x ++ïÌ F 141:x ++ïÍ F 142:x ++ïÎ F 143:x ++ïÏ F 144:x ++ïÐ F 145:x ++ïÑ F 146:x ++ïÒ F 147:x ++ïÓ F 148:x ++ïÔ F 149:x ++ïÕ F 150:x ++ïÖ F 151:x ++ï× F 152:x ++ïØ F 153:x ++ïÙ F 154:x ++ïÚ F 155:x ++ïÛ F 156:x ++ïÜ F 157:x ++ïÝ F 158:x ++ïÞ F 159:x ++ïß F 160:x ++ïà F 161:x ++ïá F 162:x ++ïâ F 163:x ++ïã F 164:x ++ïä F 165:x ++ïå F 166:x ++ïæ F 167:x ++ïç F 168:x ++ïè F 169:x ++ïé F 170:x ++ïê F 171:x ++ïë F 172:x ++ïì F 173:x ++ïí F 174:x ++ïî F 175:x ++ïï F 176:x ++ïð F 177:x ++ïñ F 178:x ++ïò F 179:x ++ïó F 180:x ++ïô F 181:x ++ïõ F 182:x ++ïö F 183:x ++ï÷ F 184:x ++ïø F 185:x ++ïù F 186:x ++ïú F 187:x ++ïû F 188:x ++ïü F 189:x ++ïý F 190:x ++ïþ F 191:x ++ð¡ F 192:x ++ð¢ F 193:x ++ð£ F 194:x ++ð¤ F 195:x ++ð¥ F 196:x ++ð¦ F 197:x ++ð§ F 198:x ++ð¨ F 199:x ++ð© F 200:x ++ðª F 201:x ++ð« F 202:x ++ð¬ F 203:x ++ð­ F 204:x ++ð® F 205:x ++ð¯ F 206:x ++ð° F 207:x ++ð± F 208:x ++ð² F 209:x ++ð³ F 210:x ++ð´ F 211:x ++ðµ F 212:x ++ð¶ F 213:x ++ð· F 214:x ++ð¸ F 215:x ++ð¹ F 216:x ++ðº F 217:x ++ð» F 218:x ++ð¼ F 219:x ++ð½ F 220:x ++ð¾ F 221:x ++ð¿ F 222:x ++ðÀ F 223:x ++ðÁ F 224:x ++ð F 225:x ++ðà F 226:x ++ðÄ F 227:x ++ðÅ F 228:x ++ðÆ F 229:x ++ðÇ F 230:x ++ðÈ F 231:x ++ðÉ F 232:x ++ðÊ F 233:x ++ðË F 234:x ++ðÌ F 235:x ++ðÍ F 236:x ++ðÎ F 237:x ++ðÏ F 238:x ++ðÐ F 239:x ++ðÑ F 240:x ++ðÒ F 241:x ++ðÓ F 242:x ++ðÔ F 243:x ++ðÕ F 244:x ++ðÖ F 245:x ++ð× F 246:x ++ðØ F 247:x ++ðÙ F 248:x ++ðÚ F 249:x ++ðÛ F 250:x ++ðÜ F 251:x ++ðÝ F 252:x ++ðÞ F 253:x ++ðß F 254:x ++ðà F 255:x ++ðá F 0:y ++ðâ F 1:y ++ðã F 2:y ++ðä F 3:y ++ðå F 4:y ++ðæ F 5:y ++ðç F 6:y ++ðè F 7:y ++ðé F 8:y ++ðê F 9:y ++ðë F 10:y ++ðì F 11:y ++ðí F 12:y ++ðî F 13:y ++ðï F 14:y ++ðð F 15:y ++ðñ F 16:y ++ðò F 17:y ++ðó F 18:y ++ðô F 19:y ++ðõ F 20:y ++ðö F 21:y ++ð÷ F 22:y ++ðø F 23:y ++ðù F 24:y ++ðú F 25:y ++ðû F 26:y ++ðü F 27:y ++ðý F 28:y ++ðþ F 29:y ++ñ¡ F 30:y ++ñ¢ F 31:y ++ñ£ F 32:y ++ñ¤ F 33:y ++ñ¥ F 34:y ++ñ¦ F 35:y ++ñ§ F 36:y ++ñ¨ F 37:y ++ñ© F 38:y ++ñª F 39:y ++ñ« F 40:y ++ñ¬ F 41:y ++ñ­ F 42:y ++ñ® F 43:y ++ñ¯ F 44:y ++ñ° F 45:y ++ñ± F 46:y ++ñ² F 47:y ++ñ³ F 48:y ++ñ´ F 49:y ++ñµ F 50:y ++ñ¶ F 51:y ++ñ· F 52:y ++ñ¸ F 53:y ++ñ¹ F 54:y ++ñº F 55:y ++ñ» F 56:y ++ñ¼ F 57:y ++ñ½ F 58:y ++ñ¾ F 59:y ++ñ¿ F 60:y ++ñÀ F 61:y ++ñÁ F 62:y ++ñ F 63:y ++ñà F 64:y ++ñÄ F 65:y ++ñÅ F 66:y ++ñÆ F 67:y ++ñÇ F 68:y ++ñÈ F 69:y ++ñÉ F 70:y ++ñÊ F 71:y ++ñË F 72:y ++ñÌ F 73:y ++ñÍ F 74:y ++ñÎ F 75:y ++ñÏ F 76:y ++ñÐ F 77:y ++ñÑ F 78:y ++ñÒ F 79:y ++ñÓ F 80:y ++ñÔ F 81:y ++ñÕ F 82:y ++ñÖ F 83:y ++ñ× F 84:y ++ñØ F 85:y ++ñÙ F 86:y ++ñÚ F 87:y ++ñÛ F 88:y ++ñÜ F 89:y ++ñÝ F 90:y ++ñÞ F 91:y ++ñß F 92:y ++ñà F 93:y ++ñá F 94:y ++ñâ F 95:y ++ñã F 96:y ++ñä F 97:y ++ñå F 98:y ++ñæ F 99:y ++ñç F 100:y ++ñè F 101:y ++ñé F 102:y ++ñê F 103:y ++ñë F 104:y ++ñì F 105:y ++ñí F 106:y ++ñî F 107:y ++ñï F 108:y ++ñð F 109:y ++ññ F 110:y ++ñò F 111:y ++ñó F 112:y ++ñô F 113:y ++ñõ F 114:y ++ñö F 115:y ++ñ÷ F 116:y ++ñø F 117:y ++ñù F 118:y ++ñú F 119:y ++ñû F 120:y ++ñü F 121:y ++ñý F 122:y ++ñþ F 123:y ++ò¡ F 124:y ++ò¢ F 125:y ++ò£ F 126:y ++ò¤ F 127:y ++ò¥ F 128:y ++ò¦ F 129:y ++ò§ F 130:y ++ò¨ F 131:y ++ò© F 132:y ++òª F 133:y ++ò« F 134:y ++ò¬ F 135:y ++ò­ F 136:y ++ò® F 137:y ++ò¯ F 138:y ++ò° F 139:y ++ò± F 140:y ++ò² F 141:y ++ò³ F 142:y ++ò´ F 143:y ++òµ F 144:y ++ò¶ F 145:y ++ò· F 146:y ++ò¸ F 147:y ++ò¹ F 148:y ++òº F 149:y ++ò» F 150:y ++ò¼ F 151:y ++ò½ F 152:y ++ò¾ F 153:y ++ò¿ F 154:y ++òÀ F 155:y ++òÁ F 156:y ++ò F 157:y ++òà F 158:y ++òÄ F 159:y ++òÅ F 160:y ++òÆ F 161:y ++òÇ F 162:y ++òÈ F 163:y ++òÉ F 164:y ++òÊ F 165:y ++òË F 166:y ++òÌ F 167:y ++òÍ F 168:y ++òÎ F 169:y ++òÏ F 170:y ++òÐ F 171:y ++òÑ F 172:y ++òÒ F 173:y ++òÓ F 174:y ++òÔ F 175:y ++òÕ F 176:y ++òÖ F 177:y ++ò× F 178:y ++òØ F 179:y ++òÙ F 180:y ++òÚ F 181:y ++òÛ F 182:y ++òÜ F 183:y ++òÝ F 184:y ++òÞ F 185:y ++òß F 186:y ++òà F 187:y ++òá F 188:y ++òâ F 189:y ++òã F 190:y ++òä F 191:y ++òå F 192:y ++òæ F 193:y ++òç F 194:y ++òè F 195:y ++òé F 196:y ++òê F 197:y ++òë F 198:y ++òì F 199:y ++òí F 200:y ++òî F 201:y ++òï F 202:y ++òð F 203:y ++òñ F 204:y ++òò F 205:y ++òó F 206:y ++òô F 207:y ++òõ F 208:y ++òö F 209:y ++ò÷ F 210:y ++òø F 211:y ++òù F 212:y ++òú F 213:y ++òû F 214:y ++òü F 215:y ++òý F 216:y ++òþ F 217:y ++ó¡ F 218:y ++ó¢ F 219:y ++ó£ F 220:y ++ó¤ F 221:y ++ó¥ F 222:y ++ó¦ F 223:y ++ó§ F 224:y ++ó¨ F 225:y ++ó© F 226:y ++óª F 227:y ++ó« F 228:y ++ó¬ F 229:y ++ó­ F 230:y ++ó® F 231:y ++ó¯ F 232:y ++ó° F 233:y ++ó± F 234:y ++ó² F 235:y ++ó³ F 236:y ++ó´ F 237:y ++óµ F 238:y ++ó¶ F 239:y ++ó· F 240:y ++ó¸ F 241:y ++ó¹ F 242:y ++óº F 243:y ++ó» F 244:y ++ó¼ F 245:y ++ó½ F 246:y ++ó¾ F 247:y ++ó¿ F 248:y ++óÀ F 249:y ++óÁ F 250:y ++ó F 251:y ++óà F 252:y ++óÄ F 253:y ++óÅ F 254:y ++óÆ F 255:y ++óÇ F 0:z ++óÈ F 1:z ++óÉ F 2:z ++óÊ F 3:z ++óË F 4:z ++óÌ F 5:z ++óÍ F 6:z ++óÎ F 7:z ++óÏ F 8:z ++óÐ F 9:z ++óÑ F 10:z ++óÒ F 11:z ++óÓ F 12:z ++óÔ F 13:z ++óÕ F 14:z ++óÖ F 15:z ++ó× F 16:z ++óØ F 17:z ++óÙ F 18:z ++óÚ F 19:z ++óÛ F 20:z ++óÜ F 21:z ++óÝ F 22:z ++óÞ F 23:z ++óß F 24:z ++óà F 25:z ++óá F 26:z ++óâ F 27:z ++óã F 28:z ++óä F 29:z ++óå F 30:z ++óæ F 31:z ++óç F 32:z ++óè F 33:z ++óé F 34:z ++óê F 35:z ++óë F 36:z ++óì F 37:z ++óí F 38:z ++óî F 39:z ++óï F 40:z ++óð F 41:z ++óñ F 42:z ++óò F 43:z ++óó F 44:z ++óô F 45:z ++óõ F 46:z ++óö F 47:z ++ó÷ F 48:z ++óø F 49:z ++óù F 50:z ++óú F 51:z ++óû F 52:z ++óü F 53:z ++óý F 54:z ++óþ F 55:z ++ô¡ F 56:z ++ô¢ F 57:z ++ô£ F 58:z ++ô¤ F 59:z +--- groff-1.18.1.1.orig/font/devdvi/DESC.in ++++ groff-1.18.1.1/font/devdvi/DESC.in +@@ -6,6 +6,10 @@ + sizes 500-1000000 0 + styles R I B BI + family T +-fonts 13 0 0 0 0 0 0 0 0 0 MI S EX CW ++fonts 15 0 0 0 0 0 0 0 0 0 MI S EX CW M G ++fontset B G 100..FFFF ++fontset HB G 100..FFFF ++fontset SB G 100..FFFF ++fontset - M 100..FFFF + tcommand + postpro grodvi +--- groff-1.18.1.1.orig/font/devdvi/Makefile.sub ++++ groff-1.18.1.1/font/devdvi/Makefile.sub +@@ -3,15 +3,68 @@ + TR TI TB TBI CW CWI HR HI HB HBI \ + TREC TIEC TBEC TBIEC CWEC CWIEC HREC HIEC HBEC HBIEC \ + TRTC TITC TBTC TBITC CWTC CWITC HRTC HITC HBTC HBITC \ +- MI S EX SA SB \ ++ MI S EX SA SB M G \ + generate/CompileFonts generate/Makefile \ + generate/msam.map generate/msbm.map \ + generate/texb.map generate/texex.map generate/texi.map generate/texmi.map \ + generate/texr.map generate/texsy.map generate/textt.map \ + generate/ec.map generate/tc.map + +-CLEANADD=DESC ++CLEANADD=DESC M G + + DESC: DESC.in + cat $(srcdir)/DESC.in >DESC + test -z '$(DVIPRINT)' || echo print '$(DVIPRINT)' >>DESC ++ ++M: M.proto-$(DVIFORMAT) ++ @echo Making $@ ++ @-rm -f $@ ++ cp M.proto-$(DVIFORMAT) M ++# @if [ x$(DVIFORMAT) = xNTT ]; then \ ++# sed -e 's/ F / 959887,808326,151561 1 /' \ ++# -e 's/:0$$/:dmjsy10/' \ ++# -e 's/:1$$/:dmjroma10/' \ ++# -e 's/:2$$/:dmjhira10/' \ ++# -e 's/:3$$/:dmjkata10/' \ ++# -e 's/:4$$/:dmjgreek10/' \ ++# -e 's/:5$$/:dmjrussian10/' \ ++# -e 's/:6$$/:dmjkeisen10/' \ ++# -e 's/:a$$/:dmjka10/' \ ++# -e 's/:b$$/:dmjkb10/' \ ++# -e 's/:c$$/:dmjkc10/' \ ++# -e 's/:d$$/:dmjkd10/' \ ++# -e 's/:e$$/:dmjke10/' \ ++# -e 's/:f$$/:dmjkf10/' \ ++# -e 's/:g$$/:dmjkg10/' \ ++# -e 's/:h$$/:dmjkh10/' \ ++# -e 's/:i$$/:dmjki10/' \ ++# -e 's/:j$$/:dmjkj10/' \ ++# -e 's/:k$$/:dmjkk10/' \ ++# -e 's/:l$$/:dmjkl10/' \ ++# -e 's/:m$$/:dmjkm10/' \ ++# -e 's/:n$$/:dmjkn10/' \ ++# -e 's/:o$$/:dmjko10/' \ ++# -e 's/:p$$/:dmjkp10/' \ ++# -e 's/:q$$/:dmjkq10/' \ ++# -e 's/:r$$/:dmjkr10/' \ ++# -e 's/:s$$/:dmjks10/' \ ++# -e 's/:t$$/:dmjkt10/' \ ++# -e 's/:u$$/:dmjku10/' \ ++# -e 's/:v$$/:dmjkv10/' \ ++# -e 's/:w$$/:dmjkw10/' \ ++# -e 's/:x$$/:dmjkx10/' \ ++# -e 's/:y$$/:dmjky10/' \ ++# -e 's/:z$$/:dmjkz10/' \ ++# < M.proto-NTT > M ;\ ++# else \ ++# ../devnippon/createM -jis "1006514,815360,145600" 1 < M.proto-ASCII | \ ++# sed -f FixMetric.sed > M ;\ ++# fi ++ ++G: M ++ @echo Making $@ ++ @-rm -f $@ ++ @sed -e 's/name M/name G/' \ ++ -e 's/dmj/dgj/' \ ++ -e 's/internalname min10/internalname goth10/' \ ++ < M > G +--- groff-1.18.1.1.orig/font/devdvi/M.proto-ASCII ++++ groff-1.18.1.1/font/devdvi/M.proto-ASCII +@@ -0,0 +1,4 @@ ++name M ++internalname min10 ++checksum -375402250 ++designsize 10485760 +--- groff-1.18.1.1.orig/font/devdvi/FixMetric.sed ++++ groff-1.18.1.1/font/devdvi/FixMetric.sed +@@ -0,0 +1,77 @@ ++s/1006514,.*0x212b$/370845,815360,145600 1 0x212b/ ++s/1006514,.*0x212c$/370845,815360,145600 1 0x212c/ ++s/1006514,.*0x2126$/370845,815360,145600 1 0x2126/ ++s/1006514,.*0x2127$/370845,815360,145600 1 0x2127/ ++s/1006514,.*0x2128$/370845,815360,145600 1 0x2128/ ++s/1006514,.*0x212a$/370845,815360,145600 1 0x212a/ ++s/1006514,.*0x212d$/370845,815360,145600 1 0x212d/ ++s/1006514,.*0x212e$/370845,815360,145600 1 0x212e/ ++s/1006514,.*0x213e$/370845,815360,145600 1 0x213e/ ++s/1006514,.*0x2142$/370845,815360,145600 1 0x2142/ ++s/1006514,.*0x2143$/370845,815360,145600 1 0x2143/ ++s/1006514,.*0x2146$/370845,815360,145600 1 0x2146/ ++s/1006514,.*0x2147$/370845,815360,145600 1 0x2147/ ++s/1006514,.*0x2124$/370845,815360,145600 1 0x2124/ ++s/1006514,.*0x2125$/370845,815360,145600 1 0x2125/ ++s/1006514,.*0x214b$/528496,815360,145600 1 0x214b/ ++s/1006514,.*0x214d$/528496,815360,145600 1 0x214d/ ++s/1006514,.*0x214f$/528496,815360,145600 1 0x214f/ ++s/1006514,.*0x2151$/528496,815360,145600 1 0x2151/ ++s/1006514,.*0x2153$/528496,815360,145600 1 0x2153/ ++s/1006514,.*0x2155$/528496,815360,145600 1 0x2155/ ++s/1006514,.*0x2157$/528496,815360,145600 1 0x2157/ ++s/1006514,.*0x2159$/528496,815360,145600 1 0x2159/ ++s/1006514,.*0x215b$/528496,815360,145600 1 0x215b/ ++s/1006514,.*0x2129$/528496,815360,145600 1 0x2129/ ++s/1006514,.*0x212f$/528496,815360,145600 1 0x212f/ ++s/1006514,.*0x2130$/528496,815360,145600 1 0x2130/ ++s/1006514,.*0x2133$/528496,815360,145600 1 0x2133/ ++s/1006514,.*0x2135$/528496,815360,145600 1 0x2135/ ++s/1006514,.*0x2148$/528496,815360,145600 1 0x2148/ ++s/1006514,.*0x2149$/528496,815360,145600 1 0x2149/ ++s/1006514,.*0x216b$/528496,815360,145600 1 0x216b/ ++s/1006514,.*0x216c$/528496,815360,145600 1 0x216c/ ++s/1006514,.*0x216d$/528496,815360,145600 1 0x216d/ ++s/1006514,.*0x2178$/528496,815360,145600 1 0x2178/ ++s/1006514,.*0x214a$/528496,815360,145600 1 0x214a/ ++s/1006514,.*0x214c$/528496,815360,145600 1 0x214c/ ++s/1006514,.*0x214e$/528496,815360,145600 1 0x214e/ ++s/1006514,.*0x2150$/528496,815360,145600 1 0x2150/ ++s/1006514,.*0x2152$/528496,815360,145600 1 0x2152/ ++s/1006514,.*0x2154$/528496,815360,145600 1 0x2154/ ++s/1006514,.*0x2156$/528496,815360,145600 1 0x2156/ ++s/1006514,.*0x2158$/528496,815360,145600 1 0x2158/ ++s/1006514,.*0x215a$/528496,815360,145600 1 0x215a/ ++s/1006514,.*0x2122$/528496,815360,145600 1 0x2122/ ++s/1006514,.*0x2123$/528496,815360,145600 1 0x2123/ ++s/1006514,.*0x2136$/783741,815360,145600 1 0x2136/ ++s/1006514,.*0x2137$/783741,815360,145600 1 0x2137/ ++s/1006514,.*0x2139$/783741,815360,145600 1 0x2139/ ++s/1006514,.*0x2168$/783741,815360,145600 1 0x2168/ ++s/1006514,.*0x2169$/783741,815360,145600 1 0x2169/ ++s/1006514,.*0x216a$/783741,815360,145600 1 0x216a/ ++s/1006514,.*0x2170$/783741,815360,145600 1 0x2170/ ++s/1006514,.*0x2171$/783741,815360,145600 1 0x2171/ ++s/1006514,.*0x2172$/783741,815360,145600 1 0x2172/ ++s/1006514,.*0x2421$/783741,815360,145600 1 0x2421/ ++s/1006514,.*0x2423$/783741,815360,145600 1 0x2423/ ++s/1006514,.*0x2425$/783741,815360,145600 1 0x2425/ ++s/1006514,.*0x2427$/783741,815360,145600 1 0x2427/ ++s/1006514,.*0x2429$/783741,815360,145600 1 0x2429/ ++s/1006514,.*0x2443$/783741,815360,145600 1 0x2443/ ++s/1006514,.*0x2463$/783741,815360,145600 1 0x2463/ ++s/1006514,.*0x2465$/783741,815360,145600 1 0x2465/ ++s/1006514,.*0x2467$/783741,815360,145600 1 0x2467/ ++s/1006514,.*0x246e$/783741,815360,145600 1 0x246e/ ++s/1006514,.*0x2521$/783741,815360,145600 1 0x2521/ ++s/1006514,.*0x2523$/783741,815360,145600 1 0x2523/ ++s/1006514,.*0x2525$/783741,815360,145600 1 0x2525/ ++s/1006514,.*0x2527$/783741,815360,145600 1 0x2527/ ++s/1006514,.*0x2529$/783741,815360,145600 1 0x2529/ ++s/1006514,.*0x2543$/783741,815360,145600 1 0x2543/ ++s/1006514,.*0x2563$/783741,815360,145600 1 0x2563/ ++s/1006514,.*0x2565$/783741,815360,145600 1 0x2565/ ++s/1006514,.*0x2567$/783741,815360,145600 1 0x2567/ ++s/1006514,.*0x256e$/783741,815360,145600 1 0x256e/ ++s/1006514,.*0x2575$/783741,815360,145600 1 0x2575/ ++s/1006514,.*0x2576$/783741,815360,145600 1 0x2576/ +--- groff-1.18.1.1.orig/ChangeLog.jp ++++ groff-1.18.1.1/ChangeLog.jp +@@ -0,0 +1,345 @@ ++2002-11-04 Fumitoshi UKAI ++ ++ * src/libs/libgroff/encoding.cc: for C or POSIX locale, ++ use ascii8 encoding handler ++ * font/devX*: new font desc for M, G ++ * src/xditview: support ENABLE_MULTIBYTE (Japanese only?) ++ ++2002-10-09 Fumitoshi UKAI ++ ++ * update groff-1.18-7 ++ ++2002-09-23 Fumitoshi UKAI ++ ++ * src/roff/troff/input.cc: fix bug in wchar_charinfo() ++ check u where is 4- HEX chars ++ * src/device/grohtml/post-html.cc: works ENABLE_MULTIBYTE ++ * font/devhtml: add font M, G for Japanese ++ ++2002-09-22 Fumitoshi UKAI ++ ++ * new multibyte patch ++ ++2001-08-16 Fumitoshi UKAI ++ ++ * tmac/euc-jp.tmac: ++ fix disappearing `-' char ++ ++2001-07-21 Fumitoshi UKAI ++ ++ * add ENABLE_MULTIBYTE support to src/xditview ++ ++2001-07-20 Fumitoshi UKAI ++ ++ * introduce "fontset" in font/*/DESC ++ obsoletes "ondemand" ++ ++2001-07-19 Fumitoshi UKAI ++ ++ * don't use input_encoding->is_wchar_code() ++ * fix troffrc empty line ++ * fix duplicate strcasecmp() ++ ++2001-07-19 Fumitoshi UKAI ++ ++ * sub font selection move into environment::add_char() ++ it makes possible to use \[uni] ++ ++2001-07-19 Fumitoshi UKAI ++ ++ * use generic iconv_handler instead of euc_handler ++ * internal code now uses UCS-2 ++ ++2001-07-19 Fumitoshi UKAI uni%X ++ - still no code conversion ++ - font description is not accurate ++ * change "fixed" to charset range ++ ++2001-07-18 Fumitoshi UKAI ++ ++ * Configuration Change: ++ obsolete: --enable-japanese (#ifdef NIPPON) ++ new: --enable-multibyte (#ifdef ENABLE_MULTIBYTE) ++ ++2001-07-18 Fumitoshi UKAI ++ ++ * create charinfo for wchar on demand (src/roff/troff/input.cc) ++ * use "fixed" for font wchar metric (src/libs/libgroff/font.cc) ++ - font/*/M,G ++ ++2001-07-17 Fumitoshi UKAI ++ ++ * add utf8 encoding handler to src/libs/libgroff/encoding.cc ++ (this utf8 encodig handler is too slow!) ++ ++2001-07-15 Fumitoshi UKAI ++ ++ * based on groff 1.17.2-1 ++ * use src/include/encoding.h instead of eucmac.h ++ * introduce src/libs/libgroff/encoding.cc ++ * introduce tmac/euc-jp.tmac for EUC-JP documents ++ ++2001-05-24 Fumitoshi UKAI ++ ++ * Apply for groff-1.17 ++ ++2000-01-06 Yoshiaki Yanagihara ++ ++ * Apply japanese patch "jgroff-0.101" ++ (thanks hanataka@abyss.rim.or.jp). ++ * Added japanese extention option at configure.in, aclocal.m4. ++ ++Sat Jan 1 17:10:32 JST 2000 HANATAKA Shinya ++ ++ * jgroff-0.100 ¤ò¤½¤Î¤Þ¤Þ groff-1.14 ¤ËŬÍѤ·¤Æ jgroff-101 ++ ¤È¤·¤¿¡£ ++ * grohtml ¤òÆüËܸì¤ËÂбþ¤µ¤»¤ë¡£ ++ * ÆüËܸì¥Þ¥Ë¥å¥¢¥ëÍÑ¤Ë tmac.docj ¤È tmac.andocj ¥Þ¥¯¥í¤òÄɲᣠ++ ++Sun Mar 15 18:23:12 1998 Yoshiaki Yanagihara ++ ++ * jgroff ¤Î¥Ù¡¼¥¹¤ò groff-1.11a ¤ËÊѹ¹¤·¡¢jgroff-0.99¥Ñ¥Ã¥Á¤ò ++ ŬÍѤ·¤¿¤â¤Î¤ò jgroff-0.100 ¤È¤·¤¿¡£ ++ ´ðËÜŪ¤Ë jgroff-0.99 ¤Èµ¡Ç½¤ÏƱ¤¸ *¤Ï¤º*¡£ ++ ++Fri Dec 22 11:47:46 1995 Kitagawa Toshiyuki ++ ++ * ¥Ð¡¼¥¸¥ç¥ó0.99¡£ ++ ++Mon Dec 18 18:28:37 1995 Kitagawa Toshiyuki ++ ++ * tmac/Makefile.sub: ¥¿¡¼¥²¥Ã¥È stamp-wrap¡¢uninstall_sub ¤¬°ìÉô ++ OS¤Îsh¤Ç¹½Ê¸¥¨¥é¡¼¤È¤Ê¤ë¥ª¥ê¥¸¥Ê¥ë¥Ð¥°¤ò½¤Àµ¡£ ++ ++Wed Dec 13 15:09:26 1995 Kitagawa Toshiyuki ++ ++ * jgroff.sh: ¥ª¥ê¥¸¥Ê¥ë¤Ç¥¤¥ó¥¹¥È¡¼¥ë¥Ñ¥¹¤¬Êѹ¹¤µ¤ì¤¿¤Î¤Ë¹ç¤ï¤»¡¢ ++ GROFF_TMAC_PATH¡¢GROFF_FONT_PATH¤òshare/groffÇÛ²¼¤ËÊѹ¹¡£ ++ ++Sat Dec 9 15:28:36 1995 Kitagawa Toshiyuki ++ ++ * wchar.h¤«¤éeucmac.h¤Ë¥Õ¥¡¥¤¥ë̾¤òÊѹ¹¡£ ++ ++Fri Dec 8 12:15:47 1995 Yoshio Takaeda ++ ++ * troff/env.cc(add_char): ¡ØASCIIʸ»ú + ²þ¹Ô¥³¡¼¥É + EUCʸ»ú¡Ù¤È¤¤¤¦ ++ ¥Ñ¥¿¡¼¥ó¤Î»þ¡¢²þ¹Ô¥³¡¼¥É¤¬¥¹¥Ú¡¼¥¹¤ËÊÑ´¹¤µ¤ì¤Ê¤¤¥Ð¥°¤ò½¤Àµ¡£ ++ ++Thu Dec 7 21:35:06 1995 Yanagihara Yoshiaki ++ ++ * troff/input.cc (process_input_stack): gcc-2.7.0¤ÇÊÑ¿ôÄêµÁ¤¬¥¹¥³¡¼¥× ++ °ãÈ¿¤È¤Ê¤Ã¤Æ¤·¤Þ¤¦²Õ½ê¤ò½¤Àµ¡£ ++ ++Thu Dec 7 21:35:06 1995 Yanagihara Yoshiaki ++ ++ * jgroff¤Î¥Ù¡¼¥¹¥½¡¼¥¹¤ògroff-1.10¤ËÊѹ¹¡£ ++ ++Thu Apr 6 16:56:32 1995 Kitagawa Toshiyuki ++ ++ * devdvi/M.proto-NTT: DNP¤Îpk¥Õ¥©¥ó¥È¤Î¥Á¥§¥Ã¥¯¥µ¥àÃͤ¬0¤Ê¤Î¤Ç¡¢¤³ ++ ¤ì¤Ë¹ç¤ï¤»¤Æchecksum¤ÎÃͤò0¤ËÊѹ¹¡£ ++ ++Mon Apr 3 20:36:37 1995 Kitagawa Toshiyuki ++ ++ * troff/env.cc (possibly_break_line): ++ line¥ê¥¹¥ÈÃæ¤Îkword_space_node¤òÄ´À°¤¹¤ë½èÍý¤Ç¡¢lineÃæ¤Ë¤³¤Î¥Î¡¼¥É ++ ¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï½èÍý¤ò¥¹¥­¥Ã¥×¤¹¤ë¤è¤¦¤Ë¤·¤¿(EUC¥³¡¼¥É¤ò´Þ¤Þ ++ ¤Ê¤¤roff¤ò½èÍý¤¹¤ë¾ì¹ç¤Ë¤Ïkword_space_node¤Ï¸½¤ì¤Ê¤¤¤Î¤Ç½èÍý¤¬¹â® ++ ²½¤µ¤ì¤ë)¡£ ++ ++Mon Apr 3 20:36:37 1995 Kitagawa Toshiyuki ++ ++ * troff/env.cc (add_char): hwkern¡¢vlower¤Î½é´ü²½¤Ïdevice½é´ü²½¸å ++ ¤Ë°ìÅÙ¤À¤±¹Ô¤¨¤ÐÎɤ¤¤Î¤Çenvironment¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿¤Ç¤³¤ì¤ò ++ ¹Ô¤¦¤è¤¦¤ËÊѹ¹¡£ ++ ++Sat Apr 1 17:57:23 1995 Kitagawa Toshiyuki ++ ++ * troff/input.cc (mount_on_demand): on demand¤Ç¥Þ¥¦¥ó¥È¤µ¤ì¤ë¥Õ¥© ++ ¥ó¥È̾¤ò¥Ç¥Ð¥¤¥¹¤´¤È¤ÎDESC¥Õ¥¡¥¤¥ë¤Ç»ØÄê¤Ç¤­¤ë¤è¤¦¤ËÊѹ¹¡£ ++ ¥Ç¥£¥ì¥¯¥Æ¥£¥Öondemand¤Ç»ØÄꤷ¤¿¥Õ¥©¥ó¥È¤¬on demand¤Ç¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ ++ ++Fri Mar 31 20:23:43 1995 Kitagawa Toshiyuki ++ ++ * libgroff/font.cc (load): ´Á»ú¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ëÍѤ˥ǥ£¥ì¥¯¥Æ¥£¥Ö ++ fixedkanji¤òÄɲᣤ³¤ì¤Ï³ÆÊ¸»ú¤Î¥á¥È¥ê¥Ã¥¯¤¬Á´¤ÆÆ±¤¸¤Ç¤¢¤ë»ö¤ò»ØÄê ++ ¤¹¤ë¤â¤Î¤Ç¡¢fixedkanji¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ïcharset¤Ïɾ²Á¤µ¤ì¤Ê¤¤ ++ ¤¿¤á´Á»ú¥Õ¥©¥ó¥È¤Î¥í¡¼¥É¤¬Â®¤¤¡£ ++ ++Thu Mar 30 18:20:24 1995 Kitagawa Toshiyuki ++ ++ * troff: node¼±Ê̤òʸ»úÎóÈæ³Ó¤Ç¹Ô¤Ã¤Æ¤¤¤¿¤¬¹â®²½¤Î¤¿¤á¿ôÃÍÈæ³Ó¤Ë ++ Êѹ¹¤·¤¿¡£ ++ ++Wed Mar 29 20:20:49 1995 Kitagawa Toshiyuki ++ ++ * troff/input.cc: ´Á»ú¥Õ¥©¥ó¥È(M¤ÈG)¤òon demand¤Ç¥Þ¥¦¥ó¥È¤¹¤ë¤è¤¦ ++ ¤ËÊѹ¹¡£¤³¤ì¤Ë¤è¤Ã¤Æ´Á»ú¤ò´Þ¤Þ¤Ê¤¤roff¥Õ¥¡¥¤¥ë¤Î½èÍý»þ´Ö¤¬¹â®²½¤µ ++ ¤ì¤¿¡£ ++ ++Fri Mar 10 15:34:26 1995 Shigeki Yoshida ++ ++ * troff/input.cc (process): geqn¤Ç¡¢ ++ ++ .EQ ++ Í×ÁÇ sub µ­¹æ ++ .EN ++ ++ ¤ò½èÍý¤¹¤ë¤È¡¢"illegal token in argument to \Z"¤È¤Ê¤Ã¤Æ¤·¤Þ¤¦¥Ð¥° ++ (\Z¥·¡¼¥±¥ó¥¹¤Î°ú¿ô¤ËEUCʸ»ú¤¬Í褿¾ì¹ç¤ÎÂбþϳ¤ì)¤ò½¤Àµ¡£ ++ ++Mon Feb 6 11:22:33 1995 Yoshio Takaeda ++ ++ * troff/input.cc: ¹ÔƬ¶ØÂ§Ê¸»ú¤ÎEUC¥³¡¼¥É¤Î°ìÉô¤¬ÉÔÀµ¡£ ++ ++Mon Jan 30 14:02:54 1995 Kitagawa Toshiyuki ++ ++ * ¥Ð¡¼¥¸¥ç¥ó0.97¡£ ++ ++Fri Dec 10 14:26:14 1994 Kazutaka YOKOTA ++ ++ * devdvi/M.proto: NTT JTeX¤ÈASCIIÆüËܸìTeXξÊý¤Îdvi¥Õ¥¡¥¤¥ë¤ò°·¤¨¤ë¤è¤¦ ++ M.proto¥Õ¥¡¥¤¥ë¤òÊѹ¹¡£ ++ ++Fri Dec 9 14:26:14 1994 Kazutaka YOKOTA ++ ++ * troff/node.cc: boldfont_list[]¤Ë¥Õ¥©¥ó¥È̾ B ¤òÅÐÏ¿¤·¤Æ¤¤¤Ê¤«¤Ã ++ ¤¿¤¿¤á¡¢dvi¥Õ¥¡¥¤¥ë¤Ë¥´¥·¥Ã¥¯ÂΤ¬½ÐÎϤµ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ ++ ++Fri Dec 9 14:23:22 1994 Kazutaka YOKOTA ++ ++ * grotty/tty.cc (add_char): EUCʸ»ú¤ËÂФ·¤ÆWCHAR_MODE¤òÀßÄꤷ¤Æ¤¤ ++ ¤Ê¤«¤Ã¤¿¤¿¤á¡¢tty½ÐÎϤǥ´¥·¥Ã¥¯ÂΤ¬Æó½ÅÂǤÁ¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ ++ ++Fri Dec 9 14:19:33 1994 Kazutaka YOKOTA ++ ++ * devdvi/Makefile.sub: ¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë G ¤Ç¡¢name¥Ç¥£¥ì¥¯¥Æ¥£¥Ö¤¬ ++ `name M'¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ ++ ++Wed Nov 30 13:24:54 1994 Kitagawa Toshiyuki ++ ++ * ¥Ð¡¼¥¸¥ç¥ó0.96¡£ ++ ++ * grodvi/dvi.cc: FreeBSD 1.1.5R¤Îstrcmp(3)¤Ç¤Ï°ú¿ô¤Ë¥Ì¥ë¥Ý¥¤¥ó¥¿¤ò ++ ÅϤ¹¤È¥³¥¢¥À¥ó¥×¤·¤Æ¤·¤Þ¤¦¤Î¤Ç¡¢¤³¤ì¤ò²óÈò¤¹¤ë¥³¡¼¥É¤òÄɲä·¤¿¡£ ++ ++Tue Nov 29 13:52:54 1994 Kitagawa Toshiyuki ++ ++ * troff/input.cc: EUC¤Î¥¹¥Ú¡¼¥¹Ê¸»ú(0xa1a1)¤ÏASCII¤Î¥¹¥Ú¡¼¥¹Ê¸»ú¤È ++ ¤·¤Æ½èÍý¤¹¤ë¤è¤¦½¤Àµ¡£ ++ ++ * devnippon/createM: JISX0208¤Ë¤ª¤¤¤ÆÊ¸»ú¤¬Ì¤ÄêµÁ¤ÎÉôʬ¤Ë¤Ä¤¤¤Æ¤Ï ++ ¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¤Ë½ÐÎϤ·¤Ê¤¤¤è¤¦½¤Àµ¡£ ++ ++Mon Nov 28 18:15:31 1994 Kitagawa Toshiyuki ++ ++ * grodvi/dvi.cc: grodvi¤òÆüËܸ첽¤·¤¿¡£ ++ ++Fri Nov 25 15:39:05 1994 Kitagawa Toshiyuki ++ ++ * troff/env.cc: EUCʸ»ú¤Ç»Ï¤Þ¤ë¹Ô¤ËÂФ·¤Æ¶ÑÅù³ä¤êÉÕ¤±¤¬¹Ô¤ï¤ì¤¿¾ì ++ ¹ç¡¢¹ÔƬ¤Ë;ʬ¤Ê¶õÇò¤¬Æþ¤ë»ö¤¬¤¢¤Ã¤¿¤Î¤Ç¤³¤ì¤ò½¤Àµ¤·¤¿¡£ ++ ++Fri Nov 18 20:19:55 1994 Masubuchi Toshimichi ++ ++ * devnippon/createM.c: createM¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤¬ÉÔÄê¤Ë¤Ê¤ë¤¿¤á¡¢ ++ make¤¬½ªÎ»¤·¤Æ¤·¤Þ¤¦¡£createM¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤¬0¤Ë¤Ê¤ë¤è¤¦½¤Àµ¡£ ++ ++ * devnippon/Makefile.sub: PATH´Ä¶­ÊÑ¿ô¤Ë¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤¬´Þ¤Þ ++ ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢devnippon/M¤òmake¤¹¤ë»þÅÀ¤ÇcreateM¤¬¸«¤Ä¤«¤é¤ºmake ++ ¥¨¥é¡¼¤Ë¤Ê¤ë¥Ð¥°¤ò½¤Àµ¡£ ++ ++Thu Nov 17 17:11:26 1994 Kitagawa Toshiyuki ++ ++ * devnippon/createM.c: gets()¤òfgets()¤ËÊѹ¹¡£ ++ ++Sat Nov 12 13:38:19 1994 Kitagawa Toshiyuki ++ ++ * ¥Ð¡¼¥¸¥ç¥ó0.95¡£ ++ ++ * troff/env.cc: .stt ¥ê¥¯¥¨¥¹¥È¤òÄɲÃ(¥í¡¼¥«¥ë¤Ê¥Þ¥Ë¥å¥¢¥ë½ñ¼°¤Ë¹ç ++ ¤ï¤»¤ë¤¿¤á -> ¤³¤Î¥ê¥¯¥¨¥¹¥È¤ÏÈó¸ø³«)¡£ ++ ++ * troff/input.cc (init_charset_table): ASCII¤Î¹ÔƬ¶ØÂ§Ê¸»ú¤È¤·¤Æ ++ ,:;>}¤òÄɲä·¤¿¡£ ++ ++ * EUC¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¤Ï¡¢make»þ¤Ë¥Ä¡¼¥ë¤Ë¤è¤Ã¤ÆÀ¸À®¤¹¤ë¤è¤¦Êѹ¹¡£ ++ ¤³¤ì¤Ë¤è¤êpatch¥µ¥¤¥º¤¬¤«¤Ê¤ê¾®¤µ¤¯¤Ê¤Ã¤¿¡£ ++ ++Fri Nov 11 20:53:00 1994 Kitagawa Toshiyuki ++ ++ * troff/env.cc (add_char): + ¤Î¾ì¹ç¡¢´Ö¤ËÆþ¤ì ++ ¤ë¶õÇò¤Ï¶ØÂ§¤Ë°ãÈ¿¤·¤Ê¤¤¤«¤®¤ê¥Ö¥ì¡¼¥¯²Äǽ¤Ê¶õÇò¤¬Æþ¤ë¤è¤¦½¤Àµ¤·¤¿¡£ ++ ++ ++Tue Oct 25 04:46:09 1994 Kitagawa Toshiyuki (kitagawa@bsd2.kbnes.nec.co.jp) ++ ++ * ¥Ð¡¼¥¸¥ç¥ó0.94¡£ ++ ++ * libdriver/input.cc (do_file): -Tlatin1¤ÇEUC¤Ç¤Ï¤Ê¤¤Ê¸»ú¥³¡¼¥É¤ò ++ EUC¤ÈȽÃǤ·¤Æ¤·¤Þ¤¦¥Ð¥°¤ò½¤Àµ¡£ ++ ++Mon Oct 24 07:16:19 1994 Kitagawa Toshiyuki (kitagawa@bsd2.kbnes.nec.co.jp) ++ ++ * troff/node.cc (is_boldfont): FreeBSD 1.1.5¤Ç¡¢¥¼¥íÈÖÃÏ»²¾È¤Î¤¿¤á¥³ ++ ¥¢¥À¥ó¥×¤¹¤ë¥Ð¥°¤ò½¤Àµ¡£ ++ ++ * indxbib/dirnamemax.c: FreeBSD 1.1.5¤Ïpathconf()¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¤Î¤Ç ++ _POSIX_VERSION¤òundef¤·¤¿¡£ ++ ++ * ¥Ð¡¼¥¸¥ç¥ó0.93¡£ ++ ++ * geqn¤òÆüËܸ첽¤·¤¿¡£ ++ ++ * devps/DESC¤Îwcharkern¤òÀßÄꤹ¤ë¤È¹ÔƬ¤Ë¶õÇò¤¬Æþ¤Ã¤Æ¤·¤Þ¤¦¥Ð¥°¤Î ++ ½¤ÀµÊýË¡¤òÊѹ¹¡£ ++ ++Sat Oct 22 08:19:15 1994 Kitagawa Toshiyuki (kitagawa@bsd2.kbnes.nec.co.jp) ++ ++ * ¥Ð¡¼¥¸¥ç¥ó0.90¡£ ++ ++ * xtotroff¤òÆüËܸ첽¡£ ++ ++Fri Oct 21 05:33:02 1994 Kitagawa Toshiyuki (kitagawa@bsd2.kbnes.nec.co.jp) ++ ++ * devps/DESC¤Îwcharkern¤òÀßÄꤹ¤ë¤È¹ÔƬ¤Ë¶õÇò¤¬Æþ¤Ã¤Æ¤·¤Þ¤¦»ö¤¬¤¢ ++ ¤Ã¤¿¤Î¤Ç¡¢¤³¤ì¤ò½¤Àµ¡£ ++ ++ * pre-release¥Ð¡¼¥¸¥ç¥ó¡£ ++ ++ * gxditview¤òÆüËܸ첽¤·¤¿(¥Õ¥©¥ó¥È¥á¥È¥ê¥Ã¥¯¤Î¼è¤ê½Ð¤·¤¬¤¤¤¤²Ã¸º)¡£ ++ ++Thu Oct 20 05:23:09 1994 Kitagawa Toshiyuki (kitagawa@bsd2.kbnes.nec.co.jp) ++ ++ * ¥Õ¥©¥ó¥ÈÈÖ¹æ3¤Ë¥Ü¡¼¥ë¥ÉÂΰʳ°¤Î¥Õ¥©¥ó¥È¤ò¥Þ¥¦¥ó¥È¤·¤¿¾ì¹ç¡¢´Á»ú¥Õ¥© ++ ¥ó¥È¤¬¥´¥·¥Ã¥¯ÂΤˤʤäƤ·¤Þ¤¦¥Ð¥°¤ò½¤Àµ¡£ ++ ++Wed Oct 19 06:48:55 1994 Kitagawa Toshiyuki (kitagawa@bsd2.kbnes.nec.co.jp) ++ ++ * beta¥Ð¡¼¥¸¥ç¥ó¡£ ++ ++Tue Oct 18 05:02:59 1994 Kitagawa Toshiyuki (kitagawa@bsd2.kbnes.nec.co.jp) ++ ++ * pic: ++ gpic¤òÆüËܸìÂбþ¤·¤¿¡£ ++ ++ * tbl: ++ gtbl¤òÆüËܸìÂбþ¤·¤¿¡£ ++ ++ * troff/troff: ++ Times-Bold°Ê³°¤Î¥Ü¡¼¥ë¥ÉÂΤ¬¥«¥ì¥ó¥È¥Õ¥©¥ó¥È¤Î»þ¡¢´Á»ú¥Õ¥©¥ó¥È¤¬¥´ ++ ¥·¥Ã¥¯¤ËÀÚ¤êÂØ¤ï¤é¤Ê¤¤¥Ð¥°¤ò½¤Àµ¡£ ++ ++ * troff/troff: ++ DESC¤Ë¥Ç¥£¥ì¥¯¥Æ¥£¥Öwcharkern¤òÄɲä·¡¢ASCIIʸ»ú¤ÈEUCʸ»ú¤Î´Ö¤Ë¡¢ ++ »ØÄꤷ¤¿unit¿ô¤À¤±breakÉÔ²Äǽ¤Ê¶õÇò¤òÆþ¤ì¤ë¤è¤¦¤Ë¤·¤¿¡£ ++ ++ * troff/troff: ++ DESC¤Ë¥Ç¥£¥ì¥¯¥Æ¥£¥Ölowerwchar¤òÄɲä·¡¢ASCIIʸ»ú¤ËÂФ·¤ÆEUCʸ»ú¤ò¡¢ ++ »ØÄꤷ¤¿unit¿ô¤À¤±²¼¤²¤ë¤è¤¦¤Ë¤·¤¿(ASCIIʸ»ú¤¬Íî¤Á¹þ¤ó¤Ç¸«¤¨¤ë¤¿¤á)¡£ ++ ++Fri Oct 14 08:29:06 1994 Kitagawa Toshiyuki (kitagawa@bsd2.kbnes.nec.co.jp) ++ ++ * aplah¥Ð¡¼¥¸¥ç¥ó¡£ +--- groff-1.18.1.1.orig/tmac/troffrc ++++ groff-1.18.1.1/tmac/troffrc +@@ -13,7 +13,9 @@ + .do ds troffrc!X100 X.tmac + .do ds troffrc!X100-12 X.tmac + .do ds troffrc!ascii tty.tmac ++.do ds troffrc!ascii8 tty.tmac + .do ds troffrc!latin1 tty.tmac ++.do ds troffrc!nippon tty.tmac + .do ds troffrc!utf8 tty.tmac + .do ds troffrc!cp1047 tty.tmac + .do ds troffrc!lj4 lj4.tmac +@@ -36,4 +38,13 @@ + .\" Load hyphenation patterns from `hyphen.us' (in the tmac directory). + .do hpf hyphen.us + . ++.\" For CJK hack. The hardcoded list of locales is especially nasty, but ++.\" getting the locale charmap requires a troff extension. ++.ie "\V[LANG]"ja_JP.eucJP" .do mso euc-jp.tmac ++.el .ie "\V[LANG]"zh_CN" .do mso gb.tmac ++.el .ie "\V[LANG]"zh_CN.GBK" .do mso gb.tmac ++.el .ie "\V[LANG]"zh_SG" .do mso gb.tmac ++.el .ie "\V[LANG]"zh_SG.GBK" .do mso gb.tmac ++.el .if "\V[LANG]"zh_TW" .do mso big5.tmac ++. + .\" Don't let blank lines creep in here. +--- groff-1.18.1.1.orig/tmac/docj-nroff ++++ groff-1.18.1.1/tmac/docj-nroff +@@ -0,0 +1,247 @@ ++.\" Copyright (c) 1991 The Regents of the University of California. ++.\" All rights reserved. ++.\" ++.\" 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. All advertising materials mentioning features or use of this software ++.\" must display the following acknowledgement: ++.\" This product includes software developed by the University of ++.\" California, Berkeley and its contributors. ++.\" 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. ++.\" ++.\" @(#)doc-nroff 5.6 (Berkeley) 8/5/91 ++.\" ++.\" tmac.mdoc-nroff ++.ds aD \fI ++.ds aR \fI ++.ds cM \fB ++.ds dF \fR ++.ds eM \fI ++.ds eR \fR ++.ds eV \fR ++.ds fA \fI ++.ds fD \fB ++.ds fL \fB ++.ds fN \fB ++.ds fP \fP ++.ds fS ++.ds fT \fI ++.ds Hs \fR ++.ds iC \fB ++.ds lI \fR ++.ds lP \fR\|(\fP ++.ds rP \fR\|)\fP ++.ds lp \fR\|(\fP ++.ds rp \fR\|)\fP ++.ds lB \fR\|[\|\fP ++.ds rB \fR\|]\fP ++.ds mL \fB ++.ds nM \fB ++.ds nO \fR ++.ds pA \fI ++.ds Pu {\ .\ ,\ ;\ :\ (\ )\ [\ ]} ++.ds rA \fR ++.ds rT \fI ++.ds sH \fB ++.ds sP ++.ds sY \fB ++.ds sX \fI ++.ds tF \fR ++.ds tN ++.ds vA \fI ++.ds Vs \fR ++.ds vT \fB ++.ds xR \fR ++.nr sI .5i ++.nr Ti .5i ++.nr cR 1 ++.nr Pp 1v ++.ds lS \0\0 ++.nr lS \w'\0\0'u ++.nr dI 6n ++.de pL ++.ie \\n(cR .nr Hm 0 ++.el .nr Hm .5i ++.nr Fm .5i ++.nr ll 78n ++.ll 78n ++.nr lt 78n ++.lt 78n ++.nr po 0i ++.po 0i ++.nr dV 1v ++.ad l ++.na ++.. ++.ds <= \&<\&= ++.ds >= \&>\&= ++.ds Rq '' ++.ds Lq `` ++.ds ua ^ ++.ds aa \' ++.ds ga \` ++.ds sL ` ++.ds sR ' ++.ds q \&" ++.ds Pi pi ++.ds Ne != ++.ds Le <= ++.ds Ge >= ++.ds Lt < ++.ds Gt > ++.ds Pm +- ++.ds If infinity ++.ds Na \fINaN\fP ++.ds Ba \fR\&|\fP ++ ++.de hK ++.nr % 1 ++.ds hT \\*(dT ++.if !"\\*(cH"Null" \{\ ++. ie !"\\*(gP"Null" .as hT \|(\|\\*(cH\\*(gP\|) ++. el .as hT \\|(\\|\\*(cH\\|) ++.\} ++.if "\\*(cH"Null" .if !"\\*(gP"Null" .as hT \&\|(\|\\*(gP\|) ++.ie \\n(cR \{\ ++. hM ++. wh -1v fM ++.\} ++.el \{\ ++. wh 0 hM ++. wh -1.167i fM ++.\} ++.if \\n(nl==0:\\n(nl==-1 'bp ++.em lM ++.. ++.nr fW \w'0' ++.de sW ++.nr sW \w\\$1 ++.ie \\n(sW>=\\n(fW \{\ ++. ie \\n(sW%\\n(fW .nr sW (\\n(sW/\\n(fW)+1 ++. el .nr sW \\n(sW/\\n(fW ++.\} ++.el .nr sW 0 ++.. ++.de aW ++.nr sW \w\\*(A\\$1 ++.ie \\n(sW>=\\n(fW \{\ ++. ie \\n(sW%\\n(fW .nr sW (\\n(sW/\\n(fW)+1 ++. el .nr sW \\n(sW/\\n(fW ++.\} ++.el .nr sW 0 ++.. ++.de Ql ++.if \\n(aC==0 \{\ ++. ds mN Ql ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++.\} ++.ds qL \&\\*(sL ++.ds qR \&\\*(sR ++.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.de Sh ++.nr nS 0 ++.nr sE 0 ++.nr iS 0 ++.ie "\\$1"NAME" \{\ ++. hK ++' in 0 ++.\} ++.el \{\ ++. ie "\\$1"̾Á°" \{\ ++. hK ++' in 0 ++. \} ++. el \{\ ++. ie "\\$1"̾¾Î" \{\ ++. hK ++' in 0 ++. \} ++. el \{\ ++. nr nS 0 ++. nr nA 0 ++. nr nF 0 ++. nr nT 0 ++. nr nY 0 ++. nr aN 0 ++. nr oT 0 ++. if "\\$1"SEE" .nr nA 1 ++. if "\\$1"´ØÏ¢¹àÌÜ" .nr nA 1 ++. if "\\$1"FILES" .nr nF 1 ++. if "\\$1"¥Õ¥¡¥¤¥ë" .nr nF 1 ++. if "\\$1"´ØÏ¢¥Õ¥¡¥¤¥ë" .nr nF 1 ++. if "\\$1"STANDARDS" .nr nT 1 ++. if "\\$1"½àµò" .nr nT 1 ++. if "\\$1"µ¬³Ê" .nr nT 1 ++. if "\\$1"SYNOPSIS" .nr nS 1 ++. if "\\$1"½ñ¼°" .nr nS 1 ++. if "\\$1"DESCRIPTION" \{\ ++. rr fB ++. rr Fb ++. ds Fb ++. nr fY 0 ++. nr fZ 0 ++. \} ++. if "\\$1"ÀâÌÀ" \{\ ++. rr fB ++. rr Fb ++. ds Fb ++. nr fY 0 ++. nr fZ 0 ++. \} ++. if "\\$1"²òÀâ" \{\ ++. rr fB ++. rr Fb ++. ds Fb ++. nr fY 0 ++. nr fZ 0 ++. \} ++. if "\\$1"AUTHORS" .nr nY 1 ++. if "\\$1"Ãø¼Ô" .nr nY 1 ++. if "\\$1"ºî¼Ô" .nr nY 1 ++. in 0 ++. \} ++. \} ++.\} ++.pL ++'sp ++.ns ++.ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i ++.if !\\n(cR .ne 3 ++'fi ++\&\\*(sH\\$1 \|\\$2 \|\\$3 \|\\$4 \|\\$5 \|\\$6 \|\\$7 \|\\$8 \|\\$9 ++\&\fP\s0\& ++.in \\n(.iu+\\n(Tiu ++.if "\\$1"SEE" .nr sE 1 ++.ns ++.. +--- groff-1.18.1.1.orig/tmac/groff_trace.man ++++ groff-1.18.1.1/tmac/groff_trace.man +@@ -31,6 +31,10 @@ + A copy of the Free Documentation License is included as a file called + FDL in the main directory of the groff source package. + .. ++.ig ++A copy of the GNU Free Documentation License is also available in this ++Debian package as /usr/share/doc/groff/copyright. ++.. + . + .\" -------------------------------------------------------------------- + .\" Setup +--- groff-1.18.1.1.orig/tmac/docj-ditroff ++++ groff-1.18.1.1/tmac/docj-ditroff +@@ -0,0 +1,305 @@ ++.\" Copyright (c) 1991 The Regents of the University of California. ++.\" All rights reserved. ++.\" ++.\" 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. All advertising materials mentioning features or use of this software ++.\" must display the following acknowledgement: ++.\" This product includes software developed by the University of ++.\" California, Berkeley and its contributors. ++.\" 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. ++.\" ++.\" @(#)doc-ditroff 5.8 (Berkeley) 8/5/91 ++.\" ++.\" tmac.mdoc-ditroff ++.if \n(.g .if !rC .nr C 0 ++.ds aD \fI\s10 ++.ds aR \f(CO\s10 ++.ds cM \f(CB\s10 ++.ds dF \fR\s10 ++.ds eM \fI\s10 ++.ds eR \fC\s10 ++.ds eV \fC\s10 ++.ds fA \f(CO\s10 ++.ds fD \f(CB\s10 ++.ds fL \f(CB\s10 ++.ds fN \f(CB\s10 ++.ds fP \fP\s0 ++.ds fS \s0 ++.ds fT \f(CO\s10 ++.ds Hs \fR\s10 ++.ds iC \f(CB\s10 ++.ds lI \fC ++.ds lP \fR\|(\|\fP\s10 ++.ds lp \fR(\fP\s10 ++.ds rP \fR\|)\|\fP\s10 ++.ds rp \fR)\fP\s10 ++.ds lB \fR\^[\^\fP\s10 ++.ds rB \fR\^]\fP\s10 ++.ds mL \fB\s10 ++.ds nM \f(CB\s10 ++.ds nO \fR\s10 ++.ds nT \s0 ++.ds pA \fC\s10 ++.ds Pu \fR{\ .\ ,\ :\ ;\ (\ )\ [\ ]\ \fR} ++.ds rA \fR\s10 ++.ds rT \f(CO\s10 ++.ds sH \fB\s10 ++.ds sP \s0 ++.ds sY \fB\s10 ++.ds sX \fR\s10 ++.ds tF \fR ++.ds tN \s9 ++.ds vA \fI\s10 ++.ds Vs \fR\s10 ++.ds vT \f(CB\s10 ++.ds xR \fC\s10 ++.tr *\(** ++.nr sI \w\fC,u*5 ++.nr Ti \n(sIu ++.nr Pp .5v ++.ds lS \0 ++.nr lS \w'\0'u ++.nr dI 6n ++.de pL ++.nr Hm .5i ++.nr Fm .5i ++.nr ll 6.5i ++.ll 6.5i ++.nr lt 6.5i ++.lt 6.5i ++.nr po 1i ++.po 1.i ++.nr dV .5v ++.. ++.ds <= \(<= ++.ds >= \(>= ++.ie \n(.g \{\ ++. ds Lq \(lq ++. ds Rq \(rq ++.\} ++.el \{\ ++. ds Lq \&`` ++. ds Rq \&'' ++.\} ++.ds ua \(ua ++.ds aa \(aa ++.ds ga \(ga ++.ds sR \&' ++.ds sL \&` ++.ds q \&" ++.ds Pi \(*p ++.ds Ne \(!= ++.ds Le \(<= ++.ds Ge \(>= ++.ds Lt < ++.ds Gt > ++.ds Pm \(+- ++.ds If \(if ++.ds Na \fINaN\fP ++.ds Ba \fR\&|\fP ++.nr gX 0 ++.de hK ++.ds hT \\*(dT ++.if !"\\*(cH"Null" \{\ ++. ie !"\\*(gP"Null" .as hT \|(\|\\*(cH\\*(gP\|) ++. el .as hT \\|(\\|\\*(cH\\|) ++.\} ++.if "\\*(cH"Null" \{\ ++. if !"\\*(gP"Null" .as hT \&\|(\|\\*(gP\|) ++.\} ++.wh 0 hM ++.wh -1.25i fM ++.nr nL \\n(nl ++.ie \\n(gX==1 \{\ ++. rm n1 ++. bp ++.\} ++.el \{\ ++' bp ++.\} ++.if \\n(nL>0 \{\ ++. if !\\nC \{\ ++. nr % 1 ++. \} ++.\} ++.nr gX 0 ++.em lM ++.. ++.nr fW \w\fC0 ++.de sW ++.nr sW \w\fC\\$1 ++.ie \\n(sW>=\\n(fW \{\ ++. ie \\n(sW%\\n(fW .nr sW (\\n(sW/\\n(fW)+1 ++. el .nr sW \\n(sW/\\n(fW ++.\} ++.el \{\ ++. ie \\n(sW>0 .nr sW 1 ++. el .nr sW 0 ++.\} ++.. ++.de aW ++.nr sW \w\fC\\*(A\\$1 ++.ie \\n(sW>=\\n(fW \{\ ++. ie \\n(sW%\\n(fW .nr sW (\\n(sW/\\n(fW)+1 ++. el .nr sW \\n(sW/\\n(fW ++.\} ++.el \{\ ++. ie \\n(sW>0 .nr sW 1 ++. el .nr sW 0 ++.\} ++.. ++.de Ql ++.if \\n(aC==0 \{\ ++. ds mN Ql ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. nr fV \\n(.$ ++. fV ++.\} ++.nr aP \\n(aP+1 ++.aW \\n(aP ++.nr aP \\n(aP-1 ++.if \\n(sW>2 .Li ++.if \\n(sW<=2 \{\ ++. if (\\n(aP>0) \{\ ++. ds A\\n(aP Li ++. nr aP \\n(aP -1 ++. \} ++. if (\\n(aP==0) \{\ ++. rm C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 ++. rm S1 S2 S3 S4 S5 S6 S7 S8 S9 ++. rn A8 A9 ++. rn A7 A8 ++. rn A6 A7 ++. rn A5 A6 ++. rn A4 A5 ++. rn A3 A4 ++. rn A2 A3 ++. rn A1 A2 ++. ds A1 Li ++. nr fV \\n(aC+1 ++. nr aC 0 ++. fV ++. \} ++. ds qL \&\\*(sL ++. ds qR \&\\*(sR ++. En ++.\} ++.. ++.de Sh ++.nr nS 0 ++.nr sE 0 ++.nr iS 0 ++'ad ++.ie "\\$1"NAME" \{\ ++. hK ++' in 0 ++.\} ++.el \{\ ++. ie "\\$1"̾Á°" \{\ ++. hK ++' in 0 ++. \} ++. el \{\ ++. ie "\\$1"̾¾Î" \{\ ++. hK ++' in 0 ++. \} ++. el \{\ ++. nr nS 0 ++. nr nA 0 ++. nr nF 0 ++. nr nT 0 ++. nr nY 0 ++. nr oT 0 ++. if "\\$1"SYNOPSIS" \{\ ++. na ++. nr nS 1 ++. \} ++. if "\\$1"½ñ¼°" \{\ ++. na ++. nr nS 1 ++. \} ++. if "\\$1"DESCRIPTION" \{\ ++. nr fY 0 ++. nr fZ 0 ++. nr fB 0 ++. nr Fb 0 ++. ds Fb ++. \} ++. if "\\$1"ÀâÌÀ" \{\ ++. nr fY 0 ++. nr fZ 0 ++. nr fB 0 ++. nr Fb 0 ++. ds Fb ++. \} ++. if "\\$1"²òÀâ" \{\ ++. nr fY 0 ++. nr fZ 0 ++. nr fB 0 ++. nr Fb 0 ++. ds Fb ++. \} ++. if "\\$1"SEE" \{\ ++. nr nA 1 ++. na ++. \} ++. if "\\$1"´ØÏ¢¹àÌÜ" \{\ ++. nr nA 1 ++. na ++. \} ++. if "\\$1"FILES" .nr nF 1 ++. if "\\$1"¥Õ¥¡¥¤¥ë" .nr nF 1 ++. if "\\$1"´ØÏ¢¥Õ¥¡¥¤¥ë" .nr nF 1 ++. if "\\$1"STANDARDS" .nr nT 1 ++. if "\\$1"½àµò" .nr nT 1 ++. if "\\$1"µ¬³Ê" .nr nT 1 ++. if "\\$1"AUTHORS" .nr nY 1 ++. if "\\$1"Ãø¼Ô" .nr nY 1 ++. if "\\$1"ºî¼Ô" .nr nY 1 ++. if "\\$1"SEE" .nr sE 1 ++. if "\\$1"´ØÏ¢¹àÌÜ" .nr sE 1 ++. in 0 ++. nr aN 0 ++. \} ++. \} ++.\} ++.pL ++'sp ++.ns ++.ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i ++.if !\\n(cR .ne 3 ++'fi ++\&\\*(sH\\$1 \|\\$2 \|\\$3 \|\\$4 \|\\$5 \|\\$6 \|\\$7 \|\\$8 \|\\$9 ++\&\fP\s0\& ++.in \\n(.iu+\\n(Tiu ++.ns ++.. +--- groff-1.18.1.1.orig/tmac/tty.tmac ++++ groff-1.18.1.1/tmac/tty.tmac +@@ -68,7 +68,7 @@ + .ie '\*(.T'cp1047' \ + . do mso cp1047.tmac + .el \ +-. if '\*(.T'latin1' \ ++. if !'\*(.T'ascii' \ + . do mso latin1.tmac + . + .\" If you want the character definitions in tty-char.tmac to be loaded +--- groff-1.18.1.1.orig/tmac/gb.tmac ++++ groff-1.18.1.1/tmac/gb.tmac +@@ -0,0 +1,15 @@ ++.\" Kinsoku table for the GB2312 encoding of Chinese, recoded from ++.\" kinsoku.el in Emacs 22.0.50. ++.\" Checked by Simon Law, who reckons this is "mostly right". That will ++.\" probably do for now ... ++.\" ++.cflags 256 ¡¢¡££®£¬¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡¯¡±£©¡³¡µ¡·¡¹¡»¡½ ++.cflags 256 ¡¿£»£º£¿£¡¡À¡Á¡Â¡Ã¡ã¡ä¡å¡æ£¯£Ü£¢£ß£þ£ü¨å ++.cflags 512 ¨Å¨Æ¨Ç¨È¨É¨Ê¨Ë¨Ì¨Í¨Î¨Ï¨Ð¨Ñ¨Ò¨Ó¨Ô¨Õ¨Ö¨×¨Ø¨Ù¨è ++.\" Simon Law supplied these. ++.cflags 512 £¨¡®¡°¡²¡´¡¶¡¸¡º¡¼¡¾ ++.\" ++.\" http://tcl.apache.org/sources/tcl/tools/encoding/gb2312.txt lists U+FF0D ++.\" as FULLWIDTH HYPHEN-MINUS. Is this correct? ++.\" ++.hc £­ +--- groff-1.18.1.1.orig/tmac/docj.tmac ++++ groff-1.18.1.1/tmac/docj.tmac +@@ -0,0 +1,3427 @@ ++.\" Copyright (c) 1991 The Regents of the University of California. ++.\" All rights reserved. ++.\" ++.\" 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. All advertising materials mentioning features or use of this software ++.\" must display the following acknowledgement: ++.\" This product includes software developed by the University of ++.\" California, Berkeley and its contributors. ++.\" 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. ++.\" ++.\" @(#)doc 5.8 (Berkeley) 8/5/91 ++.\" Modified by jjc@jclark.com as follows: the doc-* files are assumed to be ++.\" installed as mdoc/doc-* rather than tmac.doc-* (the filename ++.\" `tmac.doc-common' would be too long); when using groff, the doc-* files ++.\" are loaded using the `mso' request. ++.\" ++.\" .mdoc-parse - attempt to parse troff request arguments ++.\" %beginstrip% ++.if \n(.g \{\ ++.cp 0 ++.ftr C CR ++.\} ++.if \n(.g .ig ++.de sO ++.so /usr/share/tmac/\\$1 ++.. ++.if !\n(.g .ig ++.de sO ++.mso mdoc/\\$1 ++.. ++.if t \{\ ++. sO docj-ditroff ++.\} ++.if n \{\ ++. sO docj-nroff ++.\} ++.sO doc-common ++.sO doc-syms ++.\" NS Db macro - start/stop DEBUG MODE ++.\" NS Db register DEBUG MODE ++.\" NS iN register DEBUG MODE (inline if 1, to stderr if 0 (default)) ++.nr Db 0 ++.de Db ++.ie \\n(.$==0 \{\ ++. ie \\n(Db==0 \{\ ++.tm DEBUGGING ON ++. nr Db 1 ++. \} ++. el \{\ ++.tm DEBUGGING OFF ++. nr Db 0 ++. \} ++.\} ++.el \{\ ++. if "\\$1"on" \{\ ++.tm DEBUGGING ON ++. nr Db 1 ++. \} ++. if "\\$1"off" \{\ ++.tm DEBUGGING OFF ++. nr Db 0 ++. \} ++.\} ++.. ++.\" NS aV macro - parse argument vector (recursive) (.aV arg ... ) ++.\" NS fV macro - parse argument vector (recursive) (.fV) ++.\" NS aC register argument counter (aV/fV) ++.\" NS fV register argument counter (must set to \\n(.$ prior to reuqest) (fV) ++.\" NS A[0-9] argument vector (aV/fV) ++.\" NS C[0-9] reg. arg type(1=macro, 2=arg, 3=punct-suf, 4=punct-pre) (aV/fV) ++.\" NS S[0-9] space vector (sV) ++.\" NS aP register argument pointer (aV) ++.\" NS yU local string used for debugging ++.\" NS iI local register (indent for inline debug mode) ++.\" NS mN name of calling request (set in each user requestable macro) ++.de aV ++.nr aC \\n(aC+1 ++.ie "\\$1"|" \{\ ++. if "\\*(mN"Op" .ds A\\n(aC \fR\\$1\fP ++. if "\\*(mN"Ar" .ds A\\n(aC \fR\\$1\fP ++. if "\\*(mN"Fl" .ds A\\n(aC \fR\\$1\fP ++. if "\\*(mN"Cm" .ds A\\n(aC \fR\\$1\fP ++. if "\\*(mN"It" .ds A\\n(aC \fR\\$1\fP ++.\} ++.el .ds A\\n(aC \\$1 ++.aU \\n(aC ++.nr C\\n(aC \\n(aT ++.s\\n(aT ++.if \\n(Db \{\ ++. if \\n(aT==1 .ds yU Executable ++. if \\n(aT==2 .ds yU String ++. if \\n(aT==3 .ds yU Closing Punctuation or suffix ++. if \\n(aT==4 .ds yU Opening Punctuation or prefix ++. if \\n(iN==1 \{\ ++. br ++. nr iI \\n(.iu ++. in -\\n(iIu ++. if \\n(aC==1 \{\ ++\&\fBDEBUG(argv) MACRO:\fP `.\\*(mN' \fBLine #:\fP \\n(.c ++. \} ++\&\t\fBArgc:\fP \\n(aC \fBArgv:\fP `\\*(A\\n(aC' \fBLength:\fP \\n(sW ++\&\t\fBSpace:\fP `\\*(S\\n(aC' \fBClass:\fP \\*(yU ++. \} ++. if \\n(iN==0 \{\ ++. if \\n(aC==1 \{\ ++. tm DEBUG(argv) MACRO: `.\\*(mN' Line #: \\n(.c ++. \} ++. tm \tArgc: \\n(aC Argv: `\\*(A\\n(aC' Length: \\n(sW ++. tm \tSpace: `\\*(S\\n(aC' Class: \\*(yU ++. \} ++.\} ++.ie \\n(.$==1 \{\ ++. nr aP 0 ++. ie \\n(dZ==1 \{\ ++. if \\n(oM>1 .as b1 \\*(S0 ++. \} ++. el \{\ ++. if \\n(oM>0 \{\ ++. if \\n(fC==0 .as b1 \\*(S0 ++. \} ++. \} ++. ds S0 \\*(S\\n(aC ++. if \\n(Db \{\ ++. if \\n(iN==1 \{\ ++\&MACRO REQUEST: \t.\\*(mN \\*(A1 \\*(A2 \\*(A3 \\*(A4 \\*(A5 \\*(A6 \\*(A7 \\*(A8 \\*(A9 ++. br ++. in \\n(iIu ++. \} ++. if \\n(iN==0 \{\ ++.tm \tMACRO REQUEST: .\\*(mN \\*(A1 \\*(A2 \\*(A3 \\*(A4 \\*(A5 \\*(A6 \\*(A7 \\*(A8 \\*(A9 ++. \} ++. \} ++.\} ++.el .aV \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.de fV ++.nr aC \\n(aC+1 ++.if "\\*(A\\n(aC"|" \{\ ++. if "\\*(mN"Op" .ds A\\n(aC \fR\\*(A\\n(aC\fP ++. if "\\*(mN"Ar" .ds A\\n(aC \fR\\*(A\\n(aC\fP ++. if "\\*(mN"Fl" .ds A\\n(aC \fR\&\\*(A\\n(aC\fP ++. if "\\*(mN"Cm" .ds A\\n(aC \fR\\*(A\\n(aC\fP ++. if "\\*(mN"It" .ds A\\n(aC \fR\\*(A\\n(aC\fP ++.\} ++.aU \\n(aC ++.nr C\\n(aC \\n(aT ++.s\\n(aT ++.if \\n(Db \{\ ++. if \\n(aT==1 .ds yU Executable ++. if \\n(aT==2 .ds yU String ++. if \\n(aT==3 .ds yU Closing Punctuation or suffix ++. if \\n(aT==4 .ds yU Opening Punctuation or prefix ++. if \\n(iN==1 \{\ ++. br ++. nr iI \\n(.iu ++. in -\\n(iIu ++. if \\n(aC==1 \{\ ++\&\fBDEBUG(fargv) MACRO:\fP `.\\*(mN' \fBLine #:\fP \\n(.c ++. \} ++\&\t\fBArgc:\fP \\n(aC \fBArgv:\fP `\\*(A\\n(aC' \fBLength:\fP \\n(sW ++\&\t\fBSpace:\fP `\\*(S\\n(aC' \fBClass:\fP \\*(yU ++. \} ++. if \\n(iN==0 \{\ ++. if \\n(aC==1 \{\ ++. tm DEBUG(fargv) MACRO: `.\\*(mN' Line #: \\n(.c ++. \} ++. tm \tArgc: \\n(aC Argv: `\\*(A\\n(aC' Length: \\n(sW ++. tm \tSpace: `\\*(S\\n(aC' Class: \\*(yU ++. \} ++.\} ++.ie \\n(fV==1 \{\ ++. nr aP 0 ++. ie \\n(dZ==1 \{\ ++. if \\n(oM>1 .as b1 \\*(S0 ++. \} ++. el \{\ ++. if \\n(oM>0 \{\ ++. if \\n(fC==0 .as b1 \\*(S0 ++. \} ++. \} ++. ds S0 \\*(S\\n(aC ++. nr fV 0 ++. if \\n(Db \{\ ++. ie \\n(iN \{\ ++\&\tMACRO REQUEST: .\\*(mN \\*(A1 \\*(A2 \\*(A3 \\*(A4 \\*(A5 \\*(A6 \\*(A7 \\*(A8 \\*(A9 ++. br ++. in \\n(iIu ++. \} ++. el \{\ ++.tm \tMACRO REQUEST: .\\*(mN \\*(A1 \\*(A2 \\*(A3 \\*(A4 \\*(A5 \\*(A6 \\*(A7 \\*(A8 \\*(A9 ++. \} ++. \} ++.\} ++.el \{\ ++. nr fV \\n(fV-1 ++. fV ++.\} ++.. ++.\" NS aX macro - stuff saved strings into `b1' (used by -diag list) ++.de aX ++.nr aP \\n(aP+1 ++.as b1 \&\\*(A\\n(aP ++.ie \\n(fV==1 \{\ ++. nr aP 0 ++. nr fV 0 ++.\} ++.el \{\ ++. as b1 \&\\*(sV ++. nr fV \\n(fV-1 ++. aX ++.\} ++.. ++.\" NS aI macro - append arg to arg vector: .aI [arg] [type] (used by .En only) ++.de aI ++.ie \\n(aC<9 \{\ ++. nr aC \\n(aC+1 ++. ds A\\n(aC \\$1 ++. nr C\\n(aC \\$2 ++. s\\$2 ++. ds xV S\\n(aC ++.\} ++.el \{\ ++. tm Usage: Too many arguments (maximum of 8 accepted) (#\\n(.c) ++. tm \\*(A1 \\*(A2 \\*(A3 \\*(A4 \\*(A5 \\*(A6 \\*(A7 \\*(A8 \\*(A9 ++.\} ++.. ++.\" ++.\" NS aZ macro - print buffer (pB) and clean up arg vectors (aY) ++.de aZ ++.pB ++.aY ++.. ++.\" NS aY macro - clean up arg vector ++.de aY ++.rm C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 ++.rm A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 ++.rm S1 S2 S3 S4 S5 S6 S7 S8 S9 ++.nr aC 0 ++.nr aP 0 ++.. ++.\" NS pB macro - test for end of vector (eol) (print b1 buffer or divert) ++.de pB ++.ie \\n(dZ==1 \{\ ++. if \\n(oM==1 \{\&\\*(b1 ++. rm S0 ++. ds b1 ++. \} ++. if \\n(oM==0 \{\ ++. x2 ++. \} ++.\} ++.el \{\ ++. ie \\n(oM==0 \{\&\\*(b1 ++. rm S0 ++. ds b1 ++. \} ++. el \{\ ++. if ((\\n(sM==1)&(\\n(tP==0)) \{\ ++. x1 ++. \} ++. \} ++.\} ++.hy ++.. ++.\" NS x1 macro - save buffer and divert if tP flag set ++.\" NS eB diversion string ++.\" NS b2 string save of buffer ++.\" NS lK register count of lines read from input file ++.de x1 ++.nr dZ \\n(dZ+1 ++.ds b2 \\*(b1 ++.ds b1 ++.nr lK \\n(.c ++.ev 2 ++.fi ++.di eB ++.. ++.\" ++.\" NS x2 macro - end diversion and print ++.\" NS b0 string local temporary ++.de x2 ++.br ++.di ++.ev ++.ie (\\n(.c-\\n(lK>1) \{\ ++. ds b0 \&\\*(eB\\ ++. ds b1 \\*(b2\\*(b0\\*(b1 ++.\} ++.el .ds b1 \\*(b2\\*(b1 ++\&\\*(b1 ++.rm eB b2 b0 b1 ++.nr dZ \\n(dZ-1 ++.. ++.\" NS Fl macro - flags (appends - and prints flags) ++.\" NS cF register save current font ++.\" NS cZ register save current font size ++.de Fl ++.as b1 \&\\*(fL ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 \{\ ++. as b1 \&\|\-\|\fP\s0 ++. pB ++. \} ++. el \{\ ++. ds mN Fl ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>0 \{\ ++. ie (\\n(aC-\\n(aP)==0 \{\ ++. as b1 \&\|\-\fP\s0 ++. aZ ++. \} ++. el \{\ ++. nr aP \\n(aP+1 ++. ie \\n(C\\n(aP==1 \{\ ++. as b1 \&\|\-\fP\s0 ++. \\*(A\\n(aP ++. \} ++. el \{\ ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. if \\n(C\\n(aP==3 \{\ ++. as b1 \&\|\-\| ++. \} ++. fR ++. \} ++. \} ++.\} ++.. ++.\" ++.\" NS fR macro - Fl flag recursion routine (special handling) ++.\" NS jM local register ++.\" NS jN local register ++.\" ++.de fR ++.hy 0 ++.nr jM \\n(C\\n(aP ++.ie \\n(jM==1 \{\ ++. as b1 \&\fP\s0 ++. \\*(A\\n(aP ++.\} ++.el \{\ ++. nr jN \\n(aP ++. ie \\n(jM==2 \{\ ++. ie !"\\*(A\\n(aP"\\*(Ba" \{\ ++. ie !"\\*(A\\n(aP"\fR|\fP" \{\ ++. ie "\\*(A\\n(aP"-" .as b1 \&\|\-\^\-\| ++. el .as b1 \&\|\-\\*(A\\n(aP ++. \} ++. el .as b1 \&\\*(A\\n(aP ++. \} ++. el .as b1 \&\\*(A\\n(aP ++. \} ++. el .as b1 \&\f\\n(cF\s\\n(cZ\\*(A\\n(aP\fP\s0 ++. ie \\n(aC==\\n(aP \{\ ++. if \\n(jM==4 .as b1 \&\|\- ++. as b1 \&\fP\s0 ++. aZ ++. \} ++. el \{\ ++. nr aP \\n(aP+1 ++. ie ((\\n(C\\n(aP==3)&(\\n(C\\n(jN==4)) .as b1 \&\|\- ++. el .as b1 \&\\*(S\\n(jN ++. fR \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.rr jM jN ++.. ++.\" ++.\" NS nR macro - general name recursion routine ++.\" NS jM local register ++.\" NS jN local register ++.de nR ++.hy 0 ++.nr jM \\n(C\\n(aP ++.ie \\n(jM==1 \{\ ++. as b1 \&\f\\n(cF\s\\n(cZ ++. \\*(A\\n(aP ++.\} ++.el \{\ ++. nr jN \\n(aP ++. ie \\n(jM==2 .as b1 \&\\*(A\\n(aP ++. el .as b1 \&\f\\n(cF\s\\n(cZ\\*(A\\n(aP\fP\s0 ++. ie \\n(aC==\\n(aP \{\ ++. as b1 \&\f\\n(cF\s\\n(cZ ++. aZ ++. \} ++. el \{\ ++. nr aP \\n(aP+1 ++. as b1 \&\\*(S\\n(jN ++. nR ++. \} ++.\} ++.rr jM jN ++.. ++.\" NS Ar macro - command line `argument' macro ++.\" ++.de Ar ++.as b1 \\*(aR ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 \{\ ++. as b1 file\ ...\fP\s0 ++. pB ++. \} ++. el \{\ ++. ds mN Ar ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>0 \{\ ++. ie (\\n(aC-\\n(aP)==0 \{\ ++. as b1 \&file\ ...\fP\s0 ++. aZ ++. \} ++. el \{\ ++. nr aP \\n(aP+1 ++. ie \\n(C\\n(aP==1 \{\ ++. as b1 \&file\ ...\fP\s0 ++. \\*(A\\n(aP ++. \} ++. el \{\ ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. if \\n(C\\n(aP==3 \{\ ++. as b1 \&file\ ... ++. \} ++. nR ++. \} ++. \} ++.\} ++.. ++.\" NS Ad macro - Addresses ++.de Ad ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .Ad address ... \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN Ad ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. as b1 \\*(aD ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. nR ++.\} ++.. ++.\" NS Cd macro - Config declaration (for section 4 SYNOPSIS) (not callable) ++.\" needs work - not very translatable ++.de Cd ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .Cd Configuration file declaration (#\\n(.c) ++. el \{\ ++. ds mN Cd ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++. \} ++.\} ++.br ++.if \\n(aC>\\n(aP \{\ ++. as b1 \\*(nM ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. ie \\n(nS \{\ ++. if "\\*(mN"Cd" \{\ ++. rs ++. ie \\n(nS>1 .br ++. el \{\ ++. if \\n(iS==0 .nr iS \\n(Dsu ++. \} ++. in +\\n(iSu ++. ti -\\n(iSu ++. nr nS \\n(nS+1 ++. \} ++. nR ++. in -\\n(iSu ++. \} ++. el .nR ++.\} ++.. ++.\" NS Cm macro - Interactive command modifier (flag) ++.de Cm ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .Cm Interactive command modifier ... \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN Cm ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. as b1 \\*(cM ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. nR ++.\} ++.. ++.\" NS Dv macro - define variable ++.de Dv ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .Dv define_variable ... \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN Dv ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. as b1 \\*(eR ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. nR ++.\} ++.. ++.\" NS Em macro - Emphasis ++.de Em ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 \{\ ++. tm Usage: .Em text ... \\*(Pu (#\\n(.c) ++. \} ++. el \{\ ++. ds mN Em ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. as b1 \\*(eM ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. nR ++.\} ++.. ++.\" NS Er macro - Errnotype ++.de Er ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .Er ERRNOTYPE ... \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN Er ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. as b1 \\*(eR ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. nR ++.\} ++.. ++.\" NS Ev macro - Environment variable ++.de Ev ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .Ev ENVIRONMENT_VARIABLE ... \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN Ev ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. as b1 \\*(eV ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. nR ++.\} ++.. ++.\" NS Fd macro - function declaration - not callable (& no err check) ++.\" NS fD register subroutine test (in synopsis only) ++.\" NS fY register subroutine count (in synopsis only) (fortran only) ++.\" NS fZ register also subroutine count (in synopsis only) ++.de Fd ++.ds mN Fd ++.if \\n(nS>0 \{\ ++.\" if a variable type was the last thing given, want vertical space ++. if \\n(fX>0 \{\ ++. Pp ++. nr fX 0 ++. \} ++.\" if a subroutine was the last thing given, want vertical space ++. if \\n(fZ>0 \{\ ++. ie \\n(fD==0 \{\ ++. Pp ++. rs ++. \} ++. el .br ++. \} ++. nr fD \\n(fD+1 ++.\} ++.nr cF \\n(.f ++.nr cZ \\n(.s ++\&\\*(fD\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.br ++.ft \\n(cF ++.fs \\n(cZ ++.. ++.\" NS Fr macro - function return value - not callable (at the moment) ++.de Fr ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .Fr Function_return_value... \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN Fr ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. as b1 \\*(aR ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. nR ++.\} ++.. ++.\" NS Ic macro - Interactive command ++.de Ic ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .Ic Interactive command ... \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN Ic ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. as b1 \\*(iC ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. nR ++.\} ++.. ++.\" NS Li macro - literals ++.de Li ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage .Li argument ... \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN Li ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. as b1 \\*(lI ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. nR ++.\} ++.. ++.\" NS Or macro - Pipe symbol (OR) ++.de Or ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .Or ... \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN Or ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. as b1 \\*(iC ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. nR ++.\} ++.. ++.\" NS Ms macro - Math symbol ++.de Ms ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .Ms Math symbol ... \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN Ms ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. as b1 \\*(sY ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. nR ++.\} ++.. ++.\" NS Nm macro - Name of command or page topic ++.\" NS n1 string - save first invocation of .Nm ++.\" NS iS register - indent second command line in a synopsis ++.de Nm ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 \{\ ++. ie "\\*(n1"" .tm Usage: .Nm Name(s) ... \\*(Pu (#\\n(.c) ++. el \&\\*(nM\\*(n1\fP\s0 ++. \} ++. el \{\ ++. ds mN Nm ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++. \} ++.\} ++.if \\n(aC>0 \{\ ++. ie \\n(aC==\\n(aP \{\ ++. as b1 \&\\*(nM\\*(n1\fP\s0 ++. aZ ++. \} ++. el \{\ ++. as b1 \\*(nM ++. nr aP \\n(aP+1 ++. ie \\n(C\\n(aP==1 \{\ ++. as b1 \&\\*(n1\fP\s0 ++. \\*(A\\n(aP ++. \} ++. el \{\ ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. if \\n(nS \{\ ++. if "\\*(mN"Nm" \{\ ++. rs ++. in -\\n(iSu ++. ie \\n(nS>1 .br ++. el \{\ ++. if \\n(iS==0 \{\ ++. sw \\$1 ++. nr iS ((\\n(sWu+1)*\\n(fW)u ++. \} ++. \} ++. in +\\n(iSu ++. ti -\\n(iSu ++. nr nS \\n(nS+1 ++. \} ++. \} ++. if "\\*(n1"" .ds n1 \\*(A\\n(aP ++. nR ++. \} ++. \} ++.\} ++.. ++.\" NS Pa macro - Pathname ++.de Pa ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 \&\\*(pA~\fP\s0 ++. el \{\ ++. ds mN Pa ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. as b1 \\*(pA ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. nR ++.\} ++.. ++.\" NS Sy macro - Symbolics ++.de Sy ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .Sy symbolic_text ... \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN Sy ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. as b1 \\*(sY ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. nR ++.\} ++.. ++.\" NS Tn macro - Trade Name Macro ++.de Tn ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .Tn Trade_name(s) ... \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN Tn ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. as b1 \\*(tN\\*(tF ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. nR ++.\} ++.. ++.\" NS nN macro - Trade Name Macro for inside of reference ++.de nN ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .Tn Trade_name(s) ... \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN Tn ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. as b1 \\*(tN ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. rR ++.\} ++.. ++.\" NS Va macro - variable name macro ++.de Va ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .Va variable_name(s) ... \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN Va ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. as b1 \\*(vA ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. nR ++.\} ++.. ++.\" ++.\" NS No macro - Normal text macro (default text style if mess up) ++.de No ++.as b1 \\*(nO ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .No must be called with arguments (#\\n(.c) ++. el \{\ ++. ds mN No ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++. ie \\n(C\\n(aP==1 \{\ ++. \\*(A\\n(aP ++. \} ++. el \{\ ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. nR ++. \} ++.\} ++.. ++.\"------------------------------------------------------------------------ ++.\" NS Op macro - Option Expression ++.de Op ++.if \\n(aC==0 \{\ ++. ds mN Op ++.\} ++.\" .ds qL \&\\*(lO ++.\" .ds qR \&\\*(rO ++.ds qL \&\\*(lB ++.ds qR \&\\*(rB ++.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 ++.. ++.\" NS Aq macro - Enclose string in angle brackets ++.de Aq ++.if \\n(aC==0 .ds mN Aq ++.ds qL \&< ++.ds qR \&> ++.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Bq macro - Enclose string in square brackets ++.de Bq ++.if \\n(aC==0 .ds mN Bq ++.ds qL \&\\*(lB ++.ds qR \&\\*(rB ++.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Dq macro - Enclose string in double quotes ++.de Dq ++.if \\n(aC==0 .ds mN Dq ++.ds qL \&\\*(Lq ++.ds qR \&\\*(Rq ++.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Eq macro - Enclose string in double quotes ++.de Eq ++.if \\n(aC==0 .ds mN Eq ++.ds qL \\$1 ++.ds qR \\$2 ++.En \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Pq macro - Enclose string in parenthesis ++.de Pq ++.if \\n(aC==0 .ds mN Pq ++.ds qL \&\\*(lP ++.ds qR \&\\*(rP ++.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Ql macro - Quoted literal is in file mdocj-[dit|n|g]roff (too large ++.\" an if-else to carry along recursively for `if n ...') ++.\" ++.\" NS Sq macro - Enclose string in single quotes ++.de Qq ++.if \\n(aC==0 .ds mN Qq ++.ds qL \&\\*q ++.ds qR \&\\*q ++.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Sq macro - Enclose string in single quotes ++.de Sq ++.if \\n(aC==0 .ds mN Sq ++.ds qL \&\\*(sL ++.ds qR \&\\*(sR ++.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" ++.\" NS Es macro - Set up strings for .En call ++.de Es ++.if \\n(aC==0 \{\ ++. ie \\n(.$>2 .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. el \{\ ++. ds qL \\$1 ++. ds qR \\$2 ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++. ds qL \\*(A\\n(aP ++. nr aP \\n(aP+1 ++. ds qR \\*(A\\n(aP ++. ie \\n(aC>\\n(aP .c\\n(C\\n(aP ++. el .aZ ++.\} ++.. ++.\" .tm En beg arg(A[\\n(aP])==\\*(A\\n(aP; ++.\" .tm En oM==\\n(oM; dZ==\\n(dZ; Xt==\\n(Xt; aC==\\n(aC ++.\" NS En macro - Enclose string with given args (eg [ and ] etc) ++.\" NS qL string variable set by calling macro ++.\" NS qR string variable set by calling macro ++.\" NS aJ register (for vR) ++.de En ++.ie \\n(aC==0 \{\ ++. ie \\n(.$==0 \{\ ++. as b1 \&\\*(qL\\*(qR ++. pB ++. \} ++. el \{\ ++.\". as mN (En) ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. as b1 \&\\*(qL ++. \} ++.\} ++.el \{\ ++. as b1 \&\\*(qL ++.\} ++.if \\n(aC>0 \{\ ++. ie (\\n(aC-\\n(aP)==0 \{\ ++. as b1 \&\\*(qR ++. aZ ++. \} ++. el \{\ ++. ie \\n(C\\n(aC==3 \{\ ++. nr aJ \\n(aC-1 ++. vR ++. nr aJ \\n(aJ+1 ++. ds A\\n(aJ \&\\*(qR\\*(A\\n(aJ ++. nr aJ 0 ++. \} ++. el .aI \&\\*(qR 3 ++. nr aP \\n(aP+1 ++. if \\n(C\\n(aP==1 .\\*(A\\n(aP ++. if \\n(C\\n(aP>1 \{\ ++. nr aP \\n(aP-1 ++. No ++. \} ++. \} ++.\} ++.. ++.\" NS vR macro - vector routine (for En, trace backwards past trail punct) ++.de vR ++.if \\n(C\\n(aJ==3 \{\ ++. nr aJ \\n(aJ-1 ++. vR ++.\} ++.. ++.\"------------------------------------------------------------------------ ++.\" NS Ao macro - Angle open ++.de Ao ++.if \\n(aC==0 .ds mN Ao ++.ds qL \&< ++.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Ac macro - Angle close ++.de Ac ++.if \\n(aC==0 .ds mN Ac ++.ds qR \&> ++.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Bo macro - Bracket open ++.de Bo ++.if \\n(aC==0 .ds mN Bo ++.ds qL \&[ ++.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Bc macro - Bracket close ++.de Bc ++.if \\n(aC==0 .ds mN Bc ++.ds qR \&] ++.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Do macro - Double Quote open ++.de Do ++.if \\n(aC==0 .ds mN Do ++.ds qL \&\\*(Lq ++.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Dc macro - Double Quote close ++.de Dc ++.if \\n(aC==0 .ds mN Dc ++.ds qR \&\\*(Rq ++.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Eo macro - Enclose open ++.de Eo ++.if \\n(aC==0 .ds mN Eo ++.ds qL \\$1 ++.eO \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Ec macro - Enclose close ++.de Ec ++.if \\n(aC==0 .ds mN Ec ++.ds qR \\$1 ++.eC \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Oo macro - Option open ++.de Oo ++.if \\n(aC==0 .ds mN Oo ++.ds qL \&[ ++.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Oc macro - Option close ++.de Oc ++.if \\n(aC==0 .ds mN Oc ++.ds qR \&] ++.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Po macro - Parenthesis open ++.de Po ++.if \\n(aC==0 .ds mN Po ++.ds qL \&( ++.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Pc macro - Parenthesis close ++.de Pc ++.if \\n(aC==0 .ds mN Pc ++.ds qR \&) ++.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Qo macro - Straight Double Quote open ++.de Qo ++.if \\n(aC==0 .ds mN Qo ++.ds qL \&\\*q ++.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Qc macro - Straight Double Quote close ++.de Qc ++.if \\n(aC==0 .ds mN Qc ++.ds qR \&\\*q ++.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS So macro - Single Quote open ++.de So ++.if \\n(aC==0 .ds mN So ++.ds qL \&\\*(sL ++.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Sc macro - Single Quote close ++.de Sc ++.if \\n(aC==0 .ds mN Sc ++.ds qR \&\\*(sR ++.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Xo macro - Extend open (continue) ++.de Xo ++.if \\n(aC==0 .ds mN Xo ++.\" .nr mN 1 ++.ds qL ++.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS Xe macro - Extend close (end) ++.de Xc ++.\" .nr mN 0 ++.if \\n(aC==0 .ds mN Xc ++.ds qR ++.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS eO macro - enclose string open ++.\" NS oM register (extension possible) ++.de eO ++.nr oM \\n(oM+1 ++.\" .tm eO last arg==A[\\n(aC]==\\*(A\\n(aC; aP==\\n(aP; oM==\\n(oM; dZ==\\n(dZ; ++.ie \\n(aC==0 \{\ ++. ie \\n(.$>0 \{\ ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. as b1 \\*(qL ++. \} ++. el \{\ ++. as b1 \\*(qL ++. if (\\n(dZ==0)&(\\n(sM==1) \{\ ++. nr dZ \\n(dZ+1 ++. ds b2 \\*(b1 ++. ds b1 ++. nr lK \\n(.c ++. ev 2 ++. fi ++. di eB ++. \} ++. \} ++.\} ++.el \{\ ++. as b1 \\*(qL ++.\} ++.ie \\n(aC>0 \{\ ++. if \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++. ie \\n(C\\n(aP==1 .\\*(A\\n(aP ++. el \{\ ++. nr aP \\n(aP-1 ++. No ++. \} ++. \} ++. if \\n(aC==\\n(aP \{\ ++. if \\n(tP==1 \{\ ++.\" .tm SETTING Xt!!! ++. nr Xt 1 ++. \} ++.\".\" . ds S0 ++.\"CHANGED ds S0 \\*(iV ++. aY ++. \} ++.\} ++.el \{\ ++. if \\n(oM>1 .as b1 \\*(sV ++.\} ++.. ++.\" ++.\" NS eC macro - enclose string close ++.\" NS aa local register ++.de eC ++.nr oM \\n(oM-1 ++.\" tm eC last arg==A[\\n(aC]==\\*(A\\n(aC; aP==\\n(aP; oM==\\n(oM; dZ==\\n(dZ; ++.as b1 \\*(qR ++.if \\n(aC==0 \{\ ++. ie \\n(.$>0 \{\ ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++. el \{\ ++. ie "\\*(xB"" \{\ ++. pB ++. \} ++. el \{\ ++. pB ++.\\*(L\\n(lC ++. nr Xt 0 ++. ds xB ++. \} ++. \} ++.\} ++.if \\n(aC>0 \{\ ++. ie \\n(aC==\\n(aP \{\ ++. ie \\n(oM==0 \{\ ++. aZ ++. \} ++. el .aY ++. \} ++. el \{\ ++. nr aa \\n(aP+1 ++. if \\n(C\\n(aa==2 .as b1 \\*(S\\n(aC ++.\" tm CURRENT arg (aP==\\*(A\\n(aP and ap+1==\\*(A\\n(aa) tP==\\n(tP Xt==\\n(Xt ++. rr aa ++. if \\n(tP>0 \{\ ++.\" tm UNSETTING Xt==\\n(Xt!!!! ++. if \\n(Xt>0 .nr Xt \\n(Xt-1 ++.\" tm NOW Xt==\\n(Xt!!!! ++. \} ++. No ++. \} ++.\} ++.. ++.\"------------------------------------------------------------------------ ++.\" NS Pf macro - Prefix (calls .pF) ++.de Pf ++.if \\n(aC==0 .ds mN Pf ++.ds qL \&\\$1 ++.pF \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" NS pF macro - Prefix (for prefixing open quotes, brackets etc) ++.de pF ++.ie \\n(aC==0 \{\ ++. as b1 \&\\*(qL ++. ie \\n(.$<2 \{\ ++. tm Warning: Missing arguments - prefix .Pf) ++. pB ++. \} ++. el .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.\} ++.el \{\ ++. ie (\\n(aC-\\n(aP)>1 \{\ ++. nr aP \\n(aP+1 ++. as b1 \&\\*(A\\n(aP ++. \} ++. el .tm Warning: .Pf: trailing prefix (#\\n(.c) ++.\} ++.if \\n(aC>0 \{\ ++. ie (\\n(aC-\\n(aP)==0 .aZ ++. el \{\ ++. nr aP \\n(aP+1 ++. c\\n(C\\n(aP ++. \} ++.\} ++.. ++.\" NS Ns macro - remove space (space remove done by .aV or .fV) ++.de Ns ++.if \\n(aC==0 \{\ ++. ds mN Ns ++. ie \\n(.$>0 .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. el .tm Usage: .Ns must be called with arguments (#\\n(.c) ++.\} ++.No ++.. ++.de Ap ++.if \\n(aC==0 \{\ ++. ds mN Ap ++. tm Usage: Ap "cannot be first request on a line (no .Ap)" (#\\n(.c) ++.\} ++.as b1 \&' ++.No ++.. ++.\" NS Hv macro - Hard (unpaddable) Space vector ++.\" NS iV string inter-vector space ++.\" NS sV string inter-argument space ++.de Hv ++.ds iV \\*(sV ++.ds sV \\*(hV ++.. ++.\" NS Sv macro - Soft Space vector (troff limitation) ++.de Sv ++.ds sV \\*(iV ++.. ++.\" NS Tv macro - Tab Space vector ++.de Tv ++.ds sV \\*(tV ++.. ++.\" NS Sm macro - Space mode ++.\" NS sM register - default is one (space mode on) ++.nr sM 1 ++.de Sm ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm "Usage: .Sm [off | on]" (#\\n(.c) ++. el \{\ ++. ds mN Sm ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>0 \{\ ++. nr aP \\n(aP+1 ++. if "\\*(A\\n(aP"on" \{\ ++. ds sV \\*(iV ++. nr sM 1 ++. \} ++. if "\\*(A\\n(aP"off" \{\ ++. ds sV ++. rm S0 S1 S2 S3 S4 S5 S6 S7 S8 S9 ++. nr sM 0 ++. \} ++. ie \\n(aC>\\n(aP \{\ ++. No ++. \} ++. el .aY ++.\} ++.. ++.\"------------------------------------------------------------------------ ++.\" Size and Argument type macros ++.\" NS aT macro - argument type ++.\" NS aU macro - argument type (same as .aT but uses A[1-9] strings ++.\" NS aT register argument type ++.if \n(.g \{\ ++.de aT ++.nr aT 0 ++.ie \\n(sW>2:(\A'\\$1'==0) \{\ ++. nr aT 2 ++.\} ++.el \{\ ++. if \\n(sW==1 \{\ ++. ie \\n(z\\$1>2 \{\ ++. nr aT \\n(z\\$1 ++. \} ++. el .nr aT 2 ++. \} ++. if \\n(sW==2 \{\ ++. ie \\n(\\$1 \{\ ++. nr aT 1 ++. \} ++. el .nr aT 2 ++. \} ++.\} ++.. ++.de aU ++.nr aT 0 ++.aW \\$1 ++.ie \\n(sW>2:(\A'\\*(A\\$1'==0) .nr aT 2 ++.el \{\ ++. if \\n(sW==1 \{\ ++. ie \\n(z\\*(A\\$1>2 \{\ ++. nr aT \\n(z\\*(A\\$1 ++. \} ++. el .nr aT 2 ++. \} ++. if \\n(sW==2 \{\ ++. ie (\\n(\\*(A\\$1) \{\ ++. nr aT 1 ++. \} ++. el .nr aT 2 ++. \} ++.\} ++.. ++.\} ++.if !\n(.g \{\ ++.de aT ++.nr aT 0 ++.ie \\n(sW>2 \{\ ++. nr aT 2 ++.\} ++.el \{\ ++. if \\n(sW==1 \{\ ++. ie \\n(z\\$1>2 \{\ ++. nr aT \\n(z\\$1 ++. \} ++. el .nr aT 2 ++. \} ++. if \\n(sW==2 \{\ ++. ie \\n(\\$1 \{\ ++. nr aT 1 ++. \} ++. el .nr aT 2 ++. \} ++.\} ++.. ++.de aU ++.nr aT 0 ++.aW \\$1 ++.ie \\n(sW>2 .nr aT 2 ++.el \{\ ++. if \\n(sW==1 \{\ ++. ie \\n(z\\*(A\\$1>2 \{\ ++. nr aT \\n(z\\*(A\\$1 ++. \} ++. el .nr aT 2 ++. \} ++. if \\n(sW==2 \{\ ++. ie (\\n(\\*(A\\$1) \{\ ++. nr aT 1 ++. \} ++. el .nr aT 2 ++. \} ++.\} ++.. ++.\} ++.\" NS s1 macro - set spacing for class type 1 ++.\" NS s2 macro - set spacing for class type 2 ++.\" NS s3 macro - set spacing for class type 3 ++.\" NS s1 macro - set spacing for class type 1 ++.\" NS s2 macro - set spacing for class type 2 ++.\" NS s3 macro - set spacing for class type 3 ++.\" NS s4 macro - set spacing for class type 4 ++.\" NS S[0-9] string spacing ++.\" NS xX local register ++.\" NS aa local register ++.de s0 ++.tm MDOC-ERROR: bogus type 0 (can't set space '\\*(A\\n(aC') (#\\n(.c) ++.. ++.de s1 ++.if \\n(\\*(A\\n(aC==3 \{\ ++. nr xX \\n(aC-1 ++. rm S\\n(xX ++. ds S\\n(aC \\*(sV ++.\} ++.if \\n(\\*(A\\n(aC==2 \{\ ++. nr xX \\n(aC-1 ++.\" this kludge can probably go away, but need to double check first ++. ie "\\*(A\\n(aC"Nb" .ds S\\n(xX \\*(hV ++. el .rm S\\n(xX ++.\} ++.. ++.de s2 ++.ds S\\n(aC \\*(sV ++.. ++.de s3 ++.if \\n(aC>1 \{\ ++. nr xX \\n(aC-1 ++. rm S\\n(xX ++.\} ++.ds S\\n(aC \\*(sV ++.. ++.de s4 ++.nr aa 0 ++.. ++.\" Class switches (on current argument aP) ++.\" NS c0 macro - catch errors (non-existent class type 0) ++.\" NS c1 macro - call request if type 1 ++.\" NS c2 macro - call .No if type 2 ++.\" NS c3 macro - call .No if type 3 ++.\" NS c4 macro - call .No if type 4 ++.de c0 ++.tm MDOC-ERROR: bogus class 0 (can't determine '\\*(A\\n(aC') (#\\n(.c) ++.. ++.de c1 ++.\\*(A\\n(aP ++.. ++.de c2 ++.nr aP \\n(aP-1 ++.No ++.. ++.de c3 ++.nr aP \\n(aP-1 ++.No ++.. ++.de c4 ++.nr aP \\n(aP-1 ++.No ++.. ++.\" NS y1 macro - ignore if class 1 ++.\" NS y2 macro - ignore if class 2 ++.\" NS y3 macro - append if type 3 ++.\" NS y4 macro - append if type 4 ++.de y1 ++.nr aa 1 ++.. ++.de y2 ++.nr aa 1 ++.. ++.de y3 ++.as b1 \\*(A\\n(aP ++.nr aP \\n(aP+1 ++.n\\C\\n(aP ++.. ++.de y4 ++.as b1 \\*(A\\n(aP ++.nr aP \\n(aP+1 ++.n\\C\\n(aP ++.. ++.\"-------------------------------------------------------------------------- ++.\" Ns Bf macro - Begin Font Mode (will be begin-mode/end-mode in groff & TeX) ++.\" Ns Ef macro - End Font Mode ++.de Bf ++.ds mN Bf ++.ie \\n(.$>0 \{\ ++. nr bF \\n(.f ++. nr bZ \\n(.s ++. if "\\$1"Em" \&\\*(eM\c ++. if "\\$1"Li" \&\\*(lI\c ++. if "\\$1"Sy" \&\\*(sY\c ++. if "\\$1"-emphasis" \&\\*(eM\c ++. if "\\$1"-literal" \&\\*(lI\c ++. if "\\$1"-symbolic" \&\\*(sY\c ++.\} ++.el .tm Usage .Bf [Em | emphasis | Li | literal | Sy | symbolic] (#\\n(.c) ++.. ++.de Ef ++.ds mN Ef ++.ie \\n(.$>0 .tm Usage .Ef (does not take arguments) (#\\n(.c) ++.el \&\f\\n(bF\s\\n(bZ ++.. ++.\" Ns Bk macro - Begin Keep ++.\" Ns Ek macro - End Keep ++.\" Ns kS string - keep type ++.de Bk ++.ds mN Bk ++.ie \\n(.$==0 \{\ ++.tm Usage: .Bk [-lines | -words] (#\\n(.c) ++.\} ++.el \{\ ++. if !"\\*(kS"" .tm .Bk: nesting keeps not implemented yet. (#\\n(.c) ++. if "\\$1"-lines" .tm .Bd -lines: Not implemented yet. (#\\n(.c) ++. if "\\$1"-words" .Hv ++. ds kS \\$1 ++.\} ++.. ++.de Ek ++.ds mN Ek ++.ie \\n(.$>0 .tm Usage .Ek (does not take arguments) (#\\n(.c) ++.el \{\ ++. if "\\*(kS"-lines" .tm .Bd -lines: Not implemented yet. (#\\n(.c) ++. if "\\*(kS"-words" .Sv ++. rm kS ++.\} ++.. ++.\" NS Bd macro - Begin Display display-type [offset string] ++.\" NS Ed macro - end Display ++.\" NS O[0-9] registers - stack of indent ++.\" NS d[0-9] registers - display-type stack ++.de Bd ++.ds mN Bd ++.ie \\n(.$==0 \{\ ++.tm Usage: .Bd [-literal | -filled | -ragged | -unfilled] [-offset [string]] [-compact] (#\\n(.c) ++.\} ++.el \{\ ++. ds aa ++. nr bV 0 ++. nr iD 0 ++. nr dP \\n(dP+1 ++. if "\\$1"-literal" \{\ ++. nr iD \\n(iD+1 ++. ds d\\n(dP dL ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. ie t \{\&\\*(lI ++' ta 9n 18n 27n 36n 45n 54n 63n 72n ++. \} ++. el \{\ ++' ta 8n 16n 24n 32n 40n 48n 56n 64n 72n ++. \} ++. nf ++. \} ++. if "\\$1"-filled" \{\ ++. nr iD \\n(iD+1 ++. ds d\\n(dP dF ++. br ++. \} ++. if "\\$1"-ragged" \{\ ++. nr iD \\n(iD+1 ++. ds d\\n(dP dR ++. na ++. \} ++. if "\\$1"-unfilled" \{\ ++. nr iD \\n(iD+1 ++. ds d\\n(dP dU ++. nf ++. \} ++.\" .tm Here is argc: \\n(.$ and here is iD \\n(iD ++. if ((\\n(iD>=1)&(\\n(.$>\\n(iD)) \{\ ++. bV \\$2 \\$3 \\$4 ++. \} ++. if \\n(O\\n(dP>0 'in \\n(.iu+\\n(O\\n(dPu ++. if (\\n(bV==0) \{\ ++. if (\\n(nS==0) \{\ ++. ie "\\*(d\\n(dP"dR" .sp \\n(dVu ++. el 'sp \\n(dVu ++. \} ++. \} ++. if \\n(cR==0 .ne 2v ++. nr bV 0 ++. nr iD 0 ++.\} ++.. ++.\" NS bV macro - resolve remaining .Bd arguments ++.de bV ++.\" .tm in bV with args: \\$1 \\$2 \\$3 ++.nr iD 1 ++.ds bY ++.if "\\$1"-offset" \{\ ++. ds bY \\$2 ++. if "\\*(bY"left" \{\ ++. nr iD \\n(iD+1 ++. nr O\\n(dP 0 ++. \} ++. if "\\*(bY"right" \{\ ++. nr iD \\n(iD+1 ++. nr O\\n(dP (\\n(.l/3)u ++. \} ++. if "\\*(bY"center" \{\ ++. nr iD \\n(iD+1 ++. nr O\\n(dP (\\n(.l-\\n(.i)/4u ++. \} ++. if "\\*(bY"indent" \{\ ++. nr iD \\n(iD+1 ++. nr O\\n(dP \\n(dIu ++. \} ++. if "\\*(bY"indent-two" \{\ ++. nr iD \\n(iD+1 ++. nr O\\n(dP \\n(dIu+\\n(dIu ++. \} ++. if \\n(iD==1 \{\ ++. nr iD \\n(iD+1 ++. sW "\\*(bY" ++. ie \\n(sW>2 \{\ ++. ie ((\\*(bY>9n)&(\\*(bY<100n)) \{\ ++. nr O\\n(dP \\*(bY ++. \} ++. el .nr O\\n(dP (\\n(sW)*\\n(fWu ++. \} ++. el \{\ ++. if \\n(sW==2 .aT \\*(bY ++. ie \\n(aT==1 \{\ ++. nr O\\n(dP \\n(\\*(bY ++. \} ++. el .nr O\\n(dP \\*(bY ++. \} ++. \} ++.\} ++.if "\\$1"-compact" \{\ ++. nr bV 1 ++.\} ++.if \\n(iD<\\n(.$ \{\ ++. ie "\\*(bY"" \{\ ++. bV \\$2 \\$3 ++. \} ++. el \{\ ++. bV \\$3 ++. \} ++.\} ++.. ++.\" NS Ed macro - end display ++.de Ed ++.ds mN Ed ++.br ++.if \\n(dP==0 .tm mdoc: Extraneous .Ed ++.if "\\*(d\\n(dP"dL" \{\ ++. ft \\n(cF ++. fz \\n(cZ ++.\} ++.in \\n(.iu-\\n(O\\n(dPu ++.rr O\\n(dP ++.rm d\\n(dP ++.nr dP \\n(dP-1 ++.fi ++.if t .ad ++.. ++.\"-------------------------------------------------------------------------- ++.\" NS Bl macro - begin list (.Bl list-type) ++.\" NS L[0-9] registers - stack of list types ++.de Bl ++.ie \\n(.$==0 \{\ ++.tm Usage: .Bl [[-hang | -tag] [-width]] [ -item | -enum | -bullet | -diag] (#\\n(.c) ++.\} ++.el \{\ ++. ds mN Bl ++. nr aP 0 ++. nr lC \\n(lC+1 ++. ds A1 \\$2 ++. ds A2 \\$3 ++. ds A3 \\$4 ++. ds A4 \\$5 ++. ds A5 \\$6 ++. ds A6 \\$7 ++. ds A7 \\$8 ++. ds A8 \\$9 ++. nr fV \\n(.$-1 ++. if "\\$1"-hang" \{\ ++. nr aP \\n(aP+1 ++. ds L\\n(lC hL ++. nr w\\n(lC 6n ++. nr tC 1 ++. \} ++. if "\\$1"-tag" \{\ ++. nr aP \\n(aP+1 ++. ds L\\n(lC tL ++. nr tC 1 ++. \} ++. if "\\$1"-item" \{\ ++. nr aP \\n(aP+1 ++. ds L\\n(lC iT ++. nr tC 1 ++. \} ++. if "\\$1"-enum" \{\ ++. nr aP \\n(aP+1 ++. ds L\\n(lC nU ++. nr w\\n(lC 3n ++. nr tC 1 ++. \} ++. if "\\$1"-bullet" \{\ ++. nr aP \\n(aP+1 ++. ds L\\n(lC bU ++. nr w\\n(lC 2n ++. nr tC 1 ++. \} ++. if "\\$1"-dash" \{\ ++. nr aP \\n(aP+1 ++. ds L\\n(lC hU ++. nr w\\n(lC 2n ++. nr tC 1 ++. \} ++. if "\\$1"-hyphen" \{\ ++. nr aP \\n(aP+1 ++. ds L\\n(lC hU ++. nr w\\n(lC 2n ++. nr tC 1 ++. \} ++. if "\\$1"-inset" \{\ ++. nr aP \\n(aP+1 ++. ds L\\n(lC lL ++. nr tC 1 ++. \} ++. if "\\$1"-diag" \{\ ++. nr aP \\n(aP+1 ++. ds L\\n(lC mL ++. nr mL 1 ++. \} ++. if "\\$1"-ohang" \{\ ++. nr aP \\n(aP+1 ++. ds L\\n(lC oL ++. nr tC 1 ++. \} ++. if "\\$1"-column" \{\ ++. nr aP \\n(aP+1 ++. ds L\\n(lC cL ++. \} ++. ie \\n(aP==0 \{\ ++. tm \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. tm Usage: .Bl [[-inset|-tag] -width] [-item|-enum|-bullet|-diag] (#\\n(.c) ++. \} ++. el \{\ ++. tY ++. if (\\n(aP==1)&(\\n(aP<\\n(.$) \{\ ++. nr aP 0 ++. lV ++. if "\\*(L\\n(lC"cL" \{\ ++. W\\n(wV ++. nr w\\n(lC 0 ++' in -\\n(eWu ++. ie \\n(v\\n(lC==1 \{\ ++. nr aa 0 ++. \} ++. el \{\ ++. sp \\n(dVu ++. \} ++. nf ++. nr wV 0 ++. \} ++. \} ++. \} ++. nr aP 0 ++.\" . ds b1 ++. aY ++.\" .tm Here is L[\\n(lC]==\\*(L\\n(lC ++.\} ++.. ++.if \n(.g \{\ ++. nr i 10 ++. while \ni<100 \{\ ++. nr num!\nin 1 ++. nr i +1 ++. \} ++.\} ++.\" NS lV macro - resolve remaining .Bl arguments ++.de lV ++.nr aP \\n(aP+1 ++.if \\n(fV>=\\n(aP \{\ ++. nr iD 0 ++. if "\\*(A\\n(aP"-compact" \{\ ++. nr iD 1 ++. nr v\\n(lC 1 ++. \} ++. if "\\*(A\\n(aP"-width" \{\ ++. nr iD 1 ++. nr aP \\n(aP+1 ++. nr tW 1 ++. ds t\\n(lC TagwidtH ++. ds tS \\*(A\\n(aP ++. aW \\n(aP ++. ie \\n(sW>2 \{\ ++. nr w\\n(lC (\\n(sW)*\\n(fWu ++. if \\n(sW==3 \{\ ++. ie \\n(.g \{\ ++. if \A'\\*(tS' .if r num!\\*(tS \{\ ++. nr w\\n(lC \\*(tS ++. \} ++. \} ++. el \{\ ++. if (\\*(tS>9n)&(\\*(tS<99n) \{\ ++. nr w\\n(lC \\*(tSu ++. \} ++. \} ++. \} ++. \} ++. el \{\ ++. aT \\*(tS ++. ie \\n(aT==1 \{\ ++. nr w\\n(lC \\n(\\*(tS ++. \} ++. el \{\ ++. nr w\\n(lC \\*(tSu ++. \} ++. \} ++. \} ++. if "\\*(A\\n(aP"-offset" \{\ ++. nr iD 1 ++. nr aP \\n(aP+1 ++. ie "\\*(A\\n(aP"indent" \{\ ++. nr o\\n(lC \\n(Dsu ++. \} ++. el \{\ ++. ds tS \\*(A\\n(aP ++. aW \\n(aP ++. ie \\n(sW>2 \{\ ++. nr o\\n(lC (\\n(sW)*\\n(fWu ++. ie \\n(.g \{\ ++. if \A'\\*(tS' .if r num!\\*(tS \{\ ++. nr o\\n(lC \\*(tS ++. \} ++. \} ++. el \{\ ++. if (\\*(tS>9n)&(\\*(tS<100n) \{\ ++. nr o\\n(lC \\*(tS ++. \} ++. \} ++. \} ++. el \{\ ++. ie \\n(C\\n(aP==1 .nr o\\n(lC \\n(\\*(tS ++. el .nr o\\n(lC \\*(tS ++. \} ++. \} ++. \} ++. if \\n(iD==0 \{\ ++. if "\\*(L\\n(lC"cL" \{\ ++. nr wV \\n(wV+1 ++. ds A\\n(wV \\*(A\\n(aP ++. \} ++. \} ++. if \\n(fV>\\n(aP .lV ++.\} ++.. ++.\" NS El macro - end list ++.\" NS iD local register ++.de El ++.ie \\n(.$>0 \{\ ++. tm Usage: .El (#\\n(.c) ++.\} ++.el \{\ ++. ds mN El ++. nr iD 0 ++. if "\\*(L\\n(lC"cL" \{\ ++. nr iD 1 ++. cC ++. \} ++. if "\\*(L\\n(lC"nU" \{\ ++. nr nU 0 ++. \} ++. if \\n(mL>0 \{\ ++. nr iD 1 ++. nr mL 0 ++. tZ ++. nr lC \\n(lC-1 ++. tY ++. \} ++. if "\\*(L\\n(lC"iT" \{\ ++' in \\n(.iu-\\n(o\\n(lCu ++. tZ ++. nr lC \\n(lC-1 ++. tY ++. nr iD 1 ++. \} ++. if "\\*(L\\n(lC"oL" \{\ ++' in \\n(.iu-\\n(o\\n(lCu ++. tZ ++. nr lC \\n(lC-1 ++. tY ++. nr iD 1 ++. \} ++. if "\\*(L\\n(lC"lL" \{\ ++' in \\n(.iu-\\n(o\\n(lCu ++. tZ ++. nr lC \\n(lC-1 ++. tY ++. nr iD 1 ++. \} ++. if \\n(iD==0 \{\ ++. lE ++. \} ++. br ++. nr iD 0 ++.\} ++.. ++.\" NS It macro - list item ++.\" NS iD local register ++.\" NS aA save pA font string for section FILES (no underline if nroff) ++.de It ++.if "\\*(L\\n(lC"" \{\ ++. tm Usage .Bl -list-type [-width [string] | -compact | -offset [string]] (#\\n(.c) ++. tm .It \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 ++.\} ++.\" .tm Here is L[\\n(lC]==\\*(L\\n(lC ++.ne 3v ++.ie \\n(.$>0 \{\ ++. ds mN It ++. ds b1 ++. nr iD 0 ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. if "\\*(L\\n(lC"mL" \{\ ++. nr iD 1 ++. nr aP 0 ++. aX ++. \\*(L\\n(lC ++. \} ++. if "\\*(L\\n(lC"cL" \{\ ++. ds b1 ++. nr aP 0 ++. nr iD 1 ++. \\*(L\\n(lC ++. \} ++. if "\\*(L\\n(lC"iT" \{\ ++. nr aP 0 ++. nr iD 1 ++. \\*(L\\n(lC ++. \} ++. if \\n(iD==0 \{\ ++. fV ++.\" tm ------------------------------------------------------------------------ ++.\" tm It list-type==\\*(L\\n(lC, aP==\\n(aP ++.\" tm It beg arg(A[1])==\\*(A1; oM==\\n(oM; dZ==\\n(dZ; Xt==\\n(Xt; aC==\\n(aC ++. nr oM \\n(oM+1 ++. nr tP 1 ++. nr aP \\n(aP+1 ++. nr tX \\n(C\\n(aP ++. ds tX \\*(A\\n(aP ++. if \\n(nF==1 \{\ ++. ds aA \\*(pA ++. if n .ds pA \\*(nO ++. \} ++. ie \\n(C\\n(aP==1 \{\ ++. \\*(A\\n(aP ++. \} ++. el \{\ ++. nr aP \\n(aP-1 ++. No ++. \} ++.\" tm in It here is b1==\\*(b1 ++.\" tm It mid arg(A[1])==\\*(A1; oM==\\n(oM; dZ==\\n(dZ; Xt==\\n(Xt; aC==\\n(aC ++. ie \\n(Xt==1 .ds xB \&\\*(L\\n(lC ++. el .\\*(L\\n(lC ++. \} ++. nr iD 0 ++.\} ++.el .\\*(L\\n(lC ++.. ++.\" NS lL macro - .It item of list-type inset ++.de lL ++.lY ++.br ++\&\\*(b1 ++.nr oM \\n(oM-1 ++.nr tP 0 ++.ds b1 ++.aY ++'fi ++.. ++.\" NS hL macro - .It item of list-type hanging label (as opposed to tagged) ++.de hL ++.lX ++.nr bb \\n(w\\n(lCu+\\n(lSu ++.ti -\\n(bbu ++.ie \w\\*(b1u>=(\\n(w\\n(lCu) \&\\*(b1 ++.el \&\\*(b1\h'|\\n(bbu'\c ++.nr oM \\n(oM-1 ++.ds b1 ++.nr tP 0 ++.aY ++'fi ++.. ++.\" NS oL macro - .It item of list-type overhanging label ++.de oL ++.lY ++\&\\*(b1 ++.br ++.nr oM \\n(oM-1 ++.ds b1 ++.nr tP 0 ++.aY ++'fi ++.. ++.\" NS iT macro - .It item of list-type [empty label] ++.de iT ++.lY ++.br ++.\" .ds b1 ++.aY ++'fi ++.. ++.\" NS nU macro - Enumerated list ++.\" NS nU register count ++.\" NS hU macro - Hyphen paragraph list (sub bullet list) ++.\" NS bU macro - Bullet paragraph list ++.de nU ++.nr oM \\n(oM+1 ++.nr nU \\n(nU+1 ++.ds b1 \&\\n(nU. ++.uL ++.. ++.de bU ++.nr oM \\n(oM+1 ++.nr bU \\n(bU+1 ++.ds b1 \&\\*(sY\&\(bu\fP ++.uL ++.. ++.de hU ++.nr oM \\n(oM+1 ++.nr bU \\n(bU+1 ++.ds b1 \&\\*(sY\&\-\fP ++.uL ++.. ++.\" NS uL macro - .It item of list-type enum/bullet/hyphen ++.de uL ++.lX ++.nr bb \\n(w\\n(lCu+\\n(lSu ++.ti -\\n(bbu ++.ie \w\\*(b1u>=(\\n(w\\n(lCu) \&\\*(b1 ++.el \&\\*(b1\h'|\\n(bbu'\c ++.nr oM \\n(oM-1 ++.\" .nr dZ \\n(dZ+1 ++.ds b1 ++.nr tP 0 ++.aY ++'fi ++.. ++.\" NS mL macro - .It item of list-type diagnostic-message ++.de mL ++.nr cF \\n(.f ++.nr cZ \\n(.s ++.ie \\n(mL==1 \{\ ++. nr zB \\n(.c ++. ie (\\n(zB-\\n(zA)>1 .Pp ++. el .br ++. nr zA \\n(zB ++. nr zB 0 ++.\} ++.el \{\ ++. nr zA \\n(.c ++. br ++.\} ++\&\\*(sY\\*(b1\f\\n(cF\s\\n(cZ\\*(lS\c ++.aY ++.ds b1 ++'fi ++.. ++.\" NS tL macro - .It item of list-type "tag" ++.de tL ++.\" tm in tL here is b1==\\*(b1 ++.if \\n(tW==0 .lW ++.lX ++.nr bb \\n(w\\n(lCu+\\n(lSu ++.ti -\\n(bbu ++.ie (\w\\*(b1u)>(\\n(w\\n(lCu) \{\&\\*(b1 ++. br ++.\} ++.el \&\\*(b1\h'|\\n(bbu'\c ++.if \\n(nF==1 \{\ ++. if n .ds pA \\*(aA ++.\} ++.nr oM \\n(oM-1 ++.nr tP 0 ++.\" .nr dZ \\n(dZ+1 ++.ds b1 ++.aY ++'fi ++.. ++.\" NS lW macro - resolve unknown label/tag width (if .Bl [inset | tag] only) ++.de lW ++.if !"TagwidtH"\\*(t\\n(lC" \{\ ++. ie \\n(tX==1 \{\ ++. ds t\\n(lN \\*(tX ++. nr w\\n(lN \\n(\\*(tX ++. \} ++. el \{\ ++. ds t\\n(lN No ++. nr w\\n(lN \\n(No ++. \} ++. if !"\\*(t\\n(lC"\\*(t\\n(lN" .nr tC 1 ++.\} ++.. ++.\" NS lX macro - set up vertical spacing (if compact) and offset+indent (all) ++.de lX ++.ie \\n(tC \{\ ++. nr tC 0 ++. nr tW 0 ++. if \\n(v\\n(lC==0 .sp \\n(dVu ++. in \\n(.iu+\\n(w\\n(lCu+\\n(o\\n(lCu+\\n(lSu ++.\} ++.el \{\ ++. ie \\n(v\\n(lC==1 \{\ ++. nr aa 0 ++. \} ++. el \{\ ++. sp \\n(dVu ++. \} ++.\} ++.if !\\n(cR .ne 2v ++.. ++.\" NS lY macro - set up vertical spacing (if compact) and offset+indent (all) ++.de lY ++.ie \\n(tC \{\ ++. nr tC 0 ++. nr tW 0 ++. if \\n(v\\n(lC==0 .sp \\n(dVu ++. in \\n(.iu+\\n(o\\n(lCu ++.\} ++.el \{\ ++. ie \\n(v\\n(lC==1 \{\ ++. nr aa 0 ++. \} ++. el \{\ ++. sp \\n(dVu ++. \} ++.\} ++.if !\\n(cR .ne 2v ++.. ++.\" NS tS temporary string ++.\" NS hL macro - hanging list function ++.\" NS tS temporary string ++.\" NS hL macro - hanging list function ++.\" NS lT macro - tagged list function ++.\" NS lE macro - list end function ++.\" NS tX string (initial string) ++.\" NS tX register (initial class) ++.\" NS tC parameter change flag ++.\" NS Xt save current list-type flag ++.\" NS lC register - list type stack counter ++.\" NS tP register tag flag (for diversions) ++.\" NS w[0-9] register tag stack (nested tags) ++.\" NS t[0-9] register tag string stack (nested tags) ++.\" NS o[0-9] register offset stack (nested tags) ++.\" NS v[0-9] register vertical tag break stack ++.\" NS h[0-9] register horizontal tag stack (continuous if 1, break if 0) ++.nr lC 0 ++.nr wV 0 ++.nr w1 0 ++.nr o1 0 ++.nr v1 0 ++.nr h1 0 ++.ds t\n(lC ++.de lE ++.\" IN lC o[\\n(lC]==\\n(o\\n(lC, w[\\n(lC]==\\n(w\\n(lC, ++.ie \\n(o\\n(lC>0 \{\ ++' in \\n(.iu-(\\n(w\\n(lCu)-(\\n(o\\n(lCu)-\\n(lSu ++. rr o\\n(lC ++.\} ++.el 'in \\n(.iu-\\n(w\\n(lCu-\\n(lSu ++.if \\n(lC<=0 .tm Extraneous .El call (#\\n(.c) ++.tZ ++.nr lC \\n(lC-1 ++.tY ++.. ++.\" NS tY macro - set up next block for list ++.\" NS tZ macro - decrement stack ++.\" NS tY register (next possible lC value) ++.de tY ++.nr tY (\\n(lC+1) ++.nr w\\n(tY 0 ++.nr h\\n(tY 0 ++.nr o\\n(tY 0 ++.ds t\\n(tY \\*(t\\n(lC ++.ds L\\n(tY ++.nr v\\n(tY 0 ++.. ++.de tZ ++.rm L\\n(tY ++.rr w\\n(tY ++.rr h\\n(tY ++.rr o\\n(tY ++.rm t\\n(tY ++.rr v\\n(tY ++.nr tY \\n(tY-1 ++.. ++.\" initial values ++.nr w1 0 ++.nr o1 0 ++.nr h1 0 ++.ds t1 ++.nr v1 0 ++.nr tY 1 ++.\" NS Xr macro - cross reference (man page only) ++.de Xr ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .Xr manpage_name [section#] \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN Xr ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++. ie \\n(C\\n(aP==1 .tm Usage: .Xr manpage_name [section#] \\*(Pu (#\\n(.c) ++. el \{\ ++. ie \\n(C\\n(aP>2 .y\\n(C\\n(aP ++. el \{\ ++. as b1 \&\\*(xR\\*(A\\n(aP\fP\s0 ++. if \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++. if \\n(C\\n(aP==2 \{\ ++. as b1 \&(\\*(A\\n(aP) ++. nr aP \\n(aP+1 ++. \} ++. if \\n(aC>=\\n(aP \{\ ++. c\\n(C\\n(aP ++. \} ++. \} ++. \} ++. aZ ++. \} ++.\} ++.. ++.\" NS Sx macro - cross section reference ++.de Sx ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Sx Usage: .Sx Section Header \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN Sx ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++. as b1 \\*(sX ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. nR ++.\} ++.. ++.\" NS cC macro - column-list end-list ++.\" NS eW macro - column indent width ++.\" NS cI register - column indent width ++.\" NS W[1-5] macro - establish tabs for list-type column ++.de cC ++'in \\n(.iu-\\n(o\\n(lCu-\\n(w\\n(lCu ++.ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i ++.fi ++.tZ ++.nr lC \\n(lC-1 ++.tY ++.. ++.de W1 ++.ta \w\\*(A1 u ++.nr eW \w\\*(A1 u ++'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu ++.. ++.de W2 ++.ta \w\\*(A1 u +\w\\*(A2 u ++.nr eW \w\\*(A1 u+\w\\*(A2 u ++'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu ++.. ++.de W3 ++.ta \w\\*(A1 u +\w\\*(A2 u +\w\\*(A3 u ++.nr eW \w\\*(A1 u+\w\\*(A2 u+\w\\*(A3 u ++'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu ++.. ++.de W4 ++.ta \w\\*(A1 u +\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u ++.nr eW \w\\*(A1 u+\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u ++'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu ++.. ++.de W5 ++.ta \w\\*(A1 u +\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u +\w\\*(A5 u ++.nr eW \w\\*(A1 u +\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u +\w\\*(A5 u ++' in \\n(.iu+\\n(eWu+\\n(o\\n(lCu ++.. ++.\" This is packed abnormally close, intercol width should be an option ++.de W6 ++.ta \w\\*(A1 u +\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u +\w\\*(A5 u +\w\\*(A6 ++.nr eW \w\\*(A1 u +\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u +\w\\*(A5 u +\w\\*(A6 ++' in \\n(.iu+\\n(eWu+\\n(o\\n(lCu ++.. ++.\" NS cL macro - column items ++.de cL ++.if \\n(w\\n(lC==0 .nr w\\n(lC \\n(eWu ++.if \\n(.u==0 \{\ ++. fi ++' in \\n(.iu+\\n(eWu ++.\} ++.ti -\\n(eWu ++.fV ++.nr aP \\n(aP+1 ++.ie \\n(aC>=\\n(aP \{\ ++. if "\\*(A\\n(aP"Ta" \{\ ++. nr jJ \\n(aP-1 ++. rm S\\n(jJ ++. rr jJ ++. \} ++. c\\n(C\\n(aP ++.\} ++.el .tm Usage: .It column_string [Ta [column_string ...] ] (#\\n(.c) ++.. ++.\" NS Ta macro - append tab (\t) ++.de Ta ++.ie \\n(aC>0 \{\ ++. nr aP \\n(aP+1 ++. ie \\n(aC>=\\n(aP \{\ ++. if "\\*(A\\n(aP"Ta" \{\ ++. nr jJ \\n(aP-1 ++. rm S\\n(jJ ++. rr jJ ++. \} ++. as b1 \\t ++. c\\n(C\\n(aP ++. \} ++. el \{\ ++. as b1 \\t\\c ++. rm S\\n(aP ++. pB ++. aY ++.\" . ds b1 ++. \} ++.\} ++.el \{\ ++. tm Usage: Ta must follow column entry: e.g. (#\\n(.c) ++. tm .It column_string [Ta [column_string ...] ] ++.\} ++.. ++.\" ++.\" NS Dl macro - display (one line) literal ++.de Dl ++'ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i ++.in \\n(.iu+\\n(Dsu ++.ie \\n(aC==0 \{\ ++. ie \\n(.$==0 \{\ ++. tm Usage: .Dl argument ... (#\\n(.c) ++. \} ++. el \{\ ++. ds mN Dl ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++. Li ++. \} ++.\} ++.el \{\ ++. tm Usage: .Dl not callable by other macros (#\\n(.c) ++.\} ++.in \\n(.iu-\\n(Dsu ++.. ++.\" ++.\" NS D1 macro - display (one line) ++.de D1 ++'ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i ++.in \\n(.iu+\\n(Dsu ++.ie \\n(aC==0 \{\ ++. ie \\n(.$==0 \{\ ++. tm Usage: .D1 argument ... (#\\n(.c) ++. \} ++. el \{\ ++. ds mN D1 ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++. nr aP \\n(aP+1 ++. ie \\n(C\\n(aP==1 .\\*(A\\n(aP ++. el .No ++. \} ++.\} ++.el \{\ ++. tm Usage: .D1 not callable by other macros (#\\n(.c) ++.\} ++.in \\n(.iu-\\n(Dsu ++.. ++.\" NS Ex macro - DEFUNCT ++.de Ex ++.tm Ex defunct, Use .D1: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" ++.\" NS Ex macro - DEFUNCT ++.de Ex ++.tm Ex defunct, Use .D1: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.. ++.\" ++.\" NS Vt macro - Variable type (for forcing old style variable declarations) ++.\" this is not done in the same manner as .Ot for fortrash - clean up later ++.de Vt ++.\" if a function declaration was the last thing given, want vertical space ++.if \\n(fD>0 \{\ ++. Pp ++. nr fD 0 ++.\} ++.\" if a subroutine was the last thing given, want vertical space ++.if \\n(fZ>0 \{\ ++. ie \\n(fX==0 \{\ ++. Pp ++. rs ++. \} ++. el .br ++.\} ++.nr fX \\n(fX+1 ++.nr cF \\n(.f ++.nr cZ \\n(.s ++\\*(fT\&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.ie \\n(oT==0 .br ++.el \&\ \& ++.ft \\n(cF ++.fs \\n(cZ ++.. ++.\" ++.\" NS Ft macro - Function type ++.nr fZ 0 ++.de Ft ++.if \\n(nS>0 \{\ ++. if \\n(fZ>0 \{\ ++. Pp ++. nr fD 0 ++. nr fX 0 ++. \} ++. if \\n(fD>0 \{\ ++. Pp ++. nr fD 0 ++. nr fX 0 ++. \} ++. if \\n(fX>0 \{\ ++. Pp ++. nr fX 0 ++. \} ++. nr fY 1 ++.\} ++.nr cF \\n(.f ++.nr cZ \\n(.s ++\&\\*(fT\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.ft \\n(cF ++.fs \\n(cZ ++.\" .br ++.. ++.\" ++.\" NS Ot macro - Old Function type (fortran - no newline) ++.\" Ns oT register ++.nr oT 0 ++.de Ot ++.nr oT 1 ++.if \\n(nS>0 \{\ ++. if \\n(fZ>0 \{\ ++. Pp ++. nr fD 0 ++. nr fX 0 ++. \} ++. if \\n(fD>0 \{\ ++. Pp ++. nr fD 0 ++. nr fX 0 ++. \} ++. if \\n(fX>0 \{\ ++. Pp ++. nr fX 0 ++. \} ++. nr fY 1 ++.\} ++.if \\n(.$==4 .as b1 \&\\*(fT\&\\$1 \\$2 \\$3 \\$4 ++.if \\n(.$==3 .as b1 \&\\*(fT\&\\$1 \\$2 \\$3 ++.if \\n(.$==2 .as b1 \&\\*(fT\&\\$1 \\$2 ++.if \\n(.$==1 .as b1 \&\\*(fT\&\\$1 ++.as b1 \&\ \fP ++.. ++.\" ++.\" NS Fa macro - Function arguments ++.de Fa ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .Fa Function Arguments ... \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN Fa ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++. \} ++.\} ++.ie \\n(fC>0 \{\ ++. fC ++.\} ++.el \{\ ++. if \\n(aC>\\n(aP \{\ ++. as b1 \\*(fA ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. nR ++. if \\n(nS>0 \{\ ++. if \\n(fZ>0 .br ++. \} ++. \} ++.\} ++.. ++.\" NS fC macro - interal .Fa for .FO and .Fc ++.de fC ++.ie \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++.\" . nr aa \\n(aP ++.\" . if \\n(nS>0 \{\ ++. ds Fb ++. nr fB 0 ++. nr Fb 0 ++. fB \\*(A\\n(aP ++. if \\n(fB>1 \{\ ++. rm A\\n(aP ++. rn Fb A\\n(aP ++. \} ++.\" . \} ++. if \\n(fC>1 \{\ ++. as b1 \&\f\\n(cF\s\\n(cZ,\\*(S\\n(aP\\*(fA\\*(A\\n(aP\fP\s0 ++.\" . as b1 \&\\,\\*(S\\n(aP\fP\s0\\*(fA\\*(A\\n(aP\fP\s0 ++. \} ++. if \\n(fC==1 \{\ ++. as b1 \&\|\\*(fA\\*(A\\n(aP\fP\s0 ++. \} ++. nr fC \\n(fC+1 ++. fC ++.\} ++.el \{\ ++. aY ++.\} ++.. ++.\" NS Fn macro - functions ++.\" NS fY register - dick with old style function declarations (fortran) ++.\" NS fZ register - break a line when more than one function in a synopsis ++.\" ++.de Fn ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .Fn function_name function_arg(s) ... \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN Fn ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++. \} ++.\} ++.if \\n(nS>0 \{\ ++.\" if there is/has been more than one subroutine declaration ++. if \\n(fY==0 \{\ ++. if \\n(fZ>0 \{\ ++. Pp ++. nr fX 0 ++. nr fD 0 ++. \} ++. \} ++. if \\n(fY==1 \{\ ++. br ++. nr fX 0 ++. nr fD 0 ++. nr fY 0 ++. \} ++. if \\n(fD>0 \{\ ++. Pp ++. nr fX 0 ++. \} ++. if \\n(fX>0 \{\ ++. Pp ++. nr fD 0 ++. \} ++. nr fZ \\n(fZ+1 ++. nr fY 0 ++. rs ++. ie \\n(nS>1 .br ++. el \{\ ++. if \\n(iS==0 \{\ ++. nr iS ((8)*\\n(fW)u ++. \} ++. \} ++. in +\\n(iSu ++. ti -\\n(iSu ++. nr nS \\n(nS+1 ++.\} ++.if \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. as b1 \\*(fN\\*(A\\n(aP\fP\s0\\*(lp ++. ie \\n(aC>\\n(aP \{\ ++. as b1 \\*(fA ++. nr aP \\n(aP+1 ++. f\\n(C\\n(aP ++. \} ++. el \{\ ++. as b1 \|\\*(rp ++. aZ ++. \} ++. if \\n(nS>0 \{\ ++. in -\\n(iSu ++. \} ++.\} ++.. ++.\" ++.\" NS f1 macro - class switch ++.\" NS f2 macro - handle function arguments ++.\" NS f3 macro - punctuation ++.\" NS f4 macro - write out function ++.de f1 ++.as b1 \\*(rp\f\\n(cF\s\\n(cZ ++.\\*(A\\n(aP ++.. ++.de f2 ++.if \\n(nS>0 \{\ ++. ds Fb ++. nr fB 0 ++. nr Fb 0 ++. fB \\*(A\\n(aP ++. if \\n(fB>1 \{\ ++. rm A\\n(aP ++. rn Fb A\\n(aP ++. \} ++.\} ++.as b1 \\*(A\\n(aP ++.ie \\n(aC>\\n(aP \{\ ++. nr aa \\n(aP ++. nr aP \\n(aP+1 ++. if \\n(C\\n(aP==2 \{\ ++. as b1 \&\|\f\\n(cF\s\\n(cZ,\\*(S\\n(aa\fP\s0\| ++. \} ++. f\\n(C\\n(aP ++.\} ++.el \{\ ++. as b1 \\*(rp\f\\n(cF\s\\n(cZ ++. aZ ++.\} ++.. ++.de f3 ++.as b1 \\*(rp\f\\n(cF\s\\n(cZ\\*(A\\n(aP ++.ie \\n(aC>\\n(aP \{\ ++. No ++.\} ++.el .aZ ++.. ++.de f4 ++.as b1 \\*(rp\f\\n(cF\s\\n(cZ\\*(S\\n(aP\\*(A\\n(aP ++.ie \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++. No ++.\} ++.el .aZ ++.. ++.de Fo ++.hy 0 ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .Fo function_name ++. el \{\ ++. ds mN Fo ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++. \} ++.\} ++.if \\n(nS>0 \{\ ++.\" if there is/has been more than one subroutine declaration ++. if \\n(fY==0 \{\ ++. if \\n(fZ>0 \{\ ++. Pp ++. nr fX 0 ++. nr fD 0 ++. \} ++. \} ++. if \\n(fY==1 \{\ ++. br ++. nr fX 0 ++. nr fD 0 ++. nr fY 0 ++. \} ++. if \\n(fD>0 \{\ ++. Pp ++. nr fX 0 ++. \} ++. if \\n(fX>0 \{\ ++. Pp ++. nr fD 0 ++. \} ++. nr fZ \\n(fZ+1 ++. nr fY 0 ++. rs ++. ie \\n(nS>1 .br ++. el \{\ ++. if \\n(iS==0 \{\ ++. nr iS ((8)*\\n(fW)u ++. \} ++. \} ++. in +\\n(iSu ++. ti -\\n(iSu ++. nr nS \\n(nS+1 ++.\} ++.if \\n(aC>\\n(aP \{\ ++. nr oM \\n(oM+1 ++. nr fC 1 ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. as b1 \\*(fN\\*(A\\n(aP\fP\s0\\*(lp ++. aY ++.\} ++.. ++.de Fc ++.if \\n(aC==0 \{\ ++. if \\n(.$>0 \{\ ++. ds mN Fo ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++. \} ++.\} ++.nr fC 0 ++.nr oM \\n(oM-1 ++.as b1 \|\\*(rp ++.ie \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++. \\*(A\\n(aP ++.\} ++.el \{\ ++. aZ ++.\} ++.if \\n(nS>0 \{\ ++. in -\\n(iSu ++.\} ++.hy ++.. ++.\" NS fb macro - if SYNOPSIS, set hard space inbetween function args ++.\" NS fb register - count of words in a function argument ++.\" NS Fb register - counter ++.\" NS Fb string - temporary string ++.de fB ++.\" .tm fB==\\n(fB, Fb==\\n(Fb, 1==\\$1 2==\\$2 3==\\$3 4==\\$4 5==\\$5 6==\\$6 ++.if \\n(fB==0 \{\ ++. nr fB \\n(.$ ++. nr Fb 0 ++. ds Fb ++.\} ++.nr Fb \\n(Fb+1 ++.as Fb \&\\$1 ++.if \\n(Fb<\\n(fB \{\ ++. as Fb \&\\*(hV ++. fB \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.\} ++.. ++.\" NS Fc - Function close - not implemented yet ++.\" NS Fo - Function open - not implemented yet ++.\" ++.\" Very crude references, stash all reference info into strings (usual ++.\" use of b1 buffer, then b1 contents copied to string of retrievable ++.\" naming convention), print out reference on .Re request and clean up. ++.\" Ordering very limited, no fancy citations, but can do articles, journals ++.\" and books - need to add several missing options (like city etc). ++.\" should be able to grab a refer entry, massage it a wee bit (prefix ++.\" a `.' to the %[A-Z]) and not worry (ha!) ++.\" ++.\" NS Rs macro - Reference Start ++.\" NS rS register - Reference Start flag ++.\" NS rS string - Reference Start buffer name for next save (of b1 buffer) ++.de Rs ++.nr rS 1 ++.rC ++.if \\n(nA==1 .Pp ++.nr Kl 0 ++.. ++.\" NS Re macro - Reference End ++.de Re ++.rZ ++.rC ++.nr rS 0 ++.. ++.\" NS rC macro - reference cleanup ++.de rC ++.nr uK 0 ++.nr jK 0 ++.nr nK 0 ++.nr oK 0 ++.nr qK 0 ++.nr rK 0 ++.nr tK 0 ++.nr vK 0 ++.nr dK 0 ++.nr pK 0 ++.nr bK 0 ++.ds rS ++.rm U1 U2 U3 U4 U5 U6 U7 U8 ++.rm uK jK nK oK rK qK tK vK dK pK bK ++.. ++.\" NS rZ macro - reference print ++.de rZ ++.if \\n(uK \{\&\\*(U1, ++. nr aK 1 ++. if (\\n(uK>1 \{\ ++. aK ++. \} ++. nr Kl -\\n(uK ++.\} ++.if \\n(tK \{\ ++. nr Kl \\n(Kl-1 ++. if \\n(Kl==0 \{\ ++. ie (\\n(jK==1):(\\n(bK==1) \{\&\\*q\\*(tK\\*q. ++. \} ++. el \{\&\\*(eM\\*(tK\\*(nO. ++. \} ++. \} ++. if \\n(Kl>0 \{\ ++. ie (\\n(jK==1):(\\n(bK==1) \{\&\\*q\\*(tK\\*q, ++. \} ++. el \{\&\\*(eM\\*(tK\\*(nO, ++. \} ++. \} ++.\} ++.if \\n(bK \{\ ++. nr Kl \\n(Kl-1 ++. if \\n(Kl==0 \&\\*(eM\\*(bK\\*(nO. ++. if \\n(Kl>0 \&\\*(eM\\*(bK\\*(nO, ++.\} ++.if \\n(jK \{\ ++. nr Kl \\n(Kl-1 ++. if \\n(Kl==0 \&\\*(eM\\*(jK\\*(nO. ++. if \\n(Kl>0 \&\\*(eM\\*(jK\\*(nO, ++.\} ++.if \\n(rK \{\ ++. nr Kl \\n(Kl-1 ++. if \\n(Kl==0 \&\\*(rK. ++. if \\n(Kl>0 \&\\*(rK, ++.\} ++.if \\n(nK \{\ ++. nr Kl \\n(Kl-1 ++. if \\n(Kl==0 \&\\*(nK. ++. if \\n(Kl>0 \&\\*(nK, ++.\} ++.if \\n(vK \{\ ++. nr Kl \\n(Kl-1 ++. if \\n(Kl==0 \&\\*(vK. ++. if \\n(Kl>0 \&\\*(vK, ++.\} ++.if \\n(pK \{\ ++. nr Kl \\n(Kl-1 ++. if \\n(Kl==0 \&\\*(pK. ++. if \\n(Kl>0 \&\\*(pK, ++.\} ++.if \\n(qK \{\ ++. nr Kl \\n(Kl-1 ++. if \\n(Kl==0 \&\\*(qK. ++. if \\n(Kl>0 \&\\*(qK, ++.\} ++.if \\n(dK \{\ ++. nr Kl \\n(Kl-1 ++. if \\n(Kl==0 \&\\*(dK. ++. if \\n(Kl>0 \&\\*(dK, ++.\} ++.if \\n(oK \{\ ++. nr Kl \\n(Kl-1 ++. if \\n(Kl==0 \&\\*(oK. ++. if \\n(Kl>0 \&\\*(oK, ++.\} ++.if \\n(Kl>0 .tm unresolved reference problem ++.. ++.\" NS aK macro - print out reference authors ++.de aK ++.nr aK \\n(aK+1 ++.ie (\\n(uK-\\n(aK)==0 \{\&and \\*(U\\n(aK, ++.\} ++.el \{\&\\*(U\\n(aK, ++. aK ++.\} ++.. ++.\" NS %A macro - reference author(s) ++.\" NS uK register - reference author(s) counter ++.\" NS U[1-9] strings - reference author(s) names ++.de %A ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .%A Author_name (#\\n(.c) ++. el \{\ ++. nr uK \\n(uK+1 ++. nr Kl \\n(Kl+1 ++. ds rS U\\n(uK ++. ds mN %A ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. rR ++.\} ++.. ++.\" NS %B macro - [reference] Book Name ++.\" NS bK string - Book Name ++.\" NS bK register - Book Name flag ++.de %B ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .%B Book Name (#\\n(.c) ++. el \{\ ++. ds mN %B ++. if \\n(rS>0 \{\ ++. nr bK \\n(bK+1 ++. nr Kl \\n(Kl+1 ++. ds rS bK ++. \} ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. ie \\n(rS==0 \{\ ++. as b1 \&\\*(eM ++. nR ++. \} ++. el .rR ++.\} ++.. ++.\" NS %D macro - [reference] Date ++.\" NS dK string - Date String ++.\" NS dK register - Date flag ++.de %D ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .%D Date (#\\n(.c) ++. el \{\ ++. ds mN %D ++. nr dK \\n(dK+1 ++. nr Kl \\n(Kl+1 ++. ds rS dK ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. rR ++.\} ++.. ++.\" NS %J macro - [reference] Journal Name ++.\" NS jK register - [reference] Journal Name flag ++.\" NS jK string - [reference] Journal Name ++.de %J ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .%J Journal Name (#\\n(.c) ++. el \{\ ++. ds mN %J ++. nr jK \\n(jK+1 ++. ds rS jK ++. nr Kl \\n(Kl+1 ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. rR ++.\} ++.. ++.\" NS %N macro - [reference] issue number ++.\" NS nK register - [reference] issue number flag ++.\" NS nK string - [reference] issue number ++.de %N ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .%N issue number (#\\n(.c) ++. el \{\ ++. nr nK \\n(nK+1 ++. nr Kl \\n(Kl+1 ++. ds rS nK ++. ds mN %N ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. rR ++.\} ++.. ++.\" NS %O macro - [reference] optional information ++.\" NS oK register - [reference] optional information flag ++.\" NS oK string - [reference] optional information ++.de %O ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .%O optional information ... \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN %O ++. nr oK \\n(oK+1 ++. nr Kl \\n(Kl+1 ++. ds rS oK ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. rR ++.\} ++.. ++.\" NS %P macro - [reference] page numbers ++.\" NS pK register - [reference] page number flag ++.\" NS pK string - [reference] page number ++.de %P ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .%P page numbers ... \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN %P ++. nr pK \\n(pK+1 ++. nr Kl \\n(Kl+1 ++. ds rS pK ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. rR ++.\} ++.. ++.\" NS %Q macro - Corporate or Foreign Author ++.\" NS qK string - Corporate or Foreign Author ++.\" NS qK register - Corporate or Foreign Author flag ++.de %Q ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .%Q Corporate or Foreign Author (#\\n(.c) ++. el \{\ ++. ds mN %Q ++. nr qK \\n(qK+1 ++. nr Kl \\n(Kl+1 ++. ds rS qK ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. rR ++.\} ++.. ++.\" NS %R macro - [reference] report name ++.\" NS rK string - [reference] report name ++.\" NS rK register - [reference] report flag ++.de %R ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .%R reference report (#\\n(.c) ++. el \{\ ++. ds mN %R ++. nr rK \\n(rK+1 ++. nr Kl \\n(Kl+1 ++. ds rS rK ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. rR ++.\} ++.. ++.\" NS %T macro - reference title ++.\" NS tK string - reference title ++.\" NS tK register - reference title flag ++.de %T ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .%T (#\\n(.c) ++. el \{\ ++. ds mN %T ++. if \\n(rS>0 \{\ ++. nr tK \\n(tK+1 ++. nr Kl \\n(Kl+1 ++. ds rS tK ++. \} ++. ds A1 \\$1 ++. ds A2 \\$2 ++. ds A3 \\$3 ++. ds A4 \\$4 ++. ds A5 \\$5 ++. ds A6 \\$6 ++. ds A7 \\$7 ++. ds A8 \\$8 ++. ds A9 \\$9 ++. nr fV \\n(.$ ++. fV ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++.\" . ie \\n(jS==1 \{\ ++.\" . nr cF \\n(.f ++.\" . nr cZ \\n(.s ++.\" . ds qL \&\\*(Lq\\*(rA ++.\" . ds qR \&\\*(Rq\f\\n(cF\s\\n(cZ ++.\" . En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++.\" . \} ++.\" . el \{\ ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. ie \\n(rS==0 \{\ ++. as b1 \&\\*(eM ++. nR ++. \} ++. el .rR ++.\" . \} ++.\} ++.. ++.\" NS %V macro - reference volume ++.\" NS vK string - reference volume ++.\" NS vK register - reference volume flag ++.de %V ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .%V Volume , ... \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN %V ++. nr vK \\n(vK+1 ++. nr Kl \\n(Kl+1 ++. ds rS vK ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. rR ++.\} ++.. ++.\" NS rR macro - reference recursion routine ++.\" NS jM local register ++.\" NS jN local register ++.de rR ++.hy 0 ++.nr jM \\n(C\\n(aP ++.ie \\n(jM==1 \{\ ++.\" . as b1 \&\f\\n(cF\s\\n(cZ ++. ie "\\*(A\\n(aP"Tn" \{\ ++. nN ++. \} ++. el \{\ ++. if \\n(aC>8 .tm Usage: \\*(mN - maximum 8 arguments (#\\n(.c) ++. aI rR 1 ++. \\*(A\\n(aP ++. \} ++.\} ++.el \{\ ++. nr jN \\n(aP ++. ie \\n(jM==2 .as b1 \&\\*(A\\n(aP ++. el .as b1 \&\\*(A\\n(aP ++.\" . el .as b1 \&\f\\n(cF\s\\n(cZ\\*(A\\n(aP\fP\s0 ++. ie \\n(aC==\\n(aP \{\ ++.\" . as b1 \&\f\\n(cF\s\\n(cZ ++. rD ++. \} ++. el \{\ ++. nr aP \\n(aP+1 ++. as b1 \&\\*(S\\n(jN ++. rR ++. \} ++.\} ++.rr jM jN ++.. ++.\" NS rD macro - save b1 buffer in to appropriate name ++.de rD ++.as \\*(rS \\*(b1 ++.ds b1 ++.ds rS ++.aY ++.. ++.\" NS Hf macro - source include header files. ++.de Hf ++.Pp ++File: ++.Pa \\$1 ++.Pp ++.nr cF \\n(.f ++.nr cZ \\n(.s ++.ie t \{\ ++\&\\*(lI ++.br ++.ta +9n 18n 27n 36n 45n 54n 63n 72n ++.\} ++.el \{\ ++.ta +8n 16n 24n 32n 40n 48n 56n 64n 72n ++.\} ++.nf ++.so \\$1 ++.fi ++.ft \\n(cF ++.fz \\n(cZ ++.Pp ++.. ++.\" NS An macro - author name ++.\" NS aN register ++.nr aN 0 ++.de An ++.if \\n(nY==1 \{\ ++. ie \\n(aN==1 \{\ ++. br ++. \} ++. el \{\ ++. nr aN 1 ++. \} ++.\} ++.if \\n(aC==0 \{\ ++. ie \\n(.$==0 .tm Usage: .An author_name ... \\*(Pu (#\\n(.c) ++. el \{\ ++. ds mN An ++. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ++. \} ++.\} ++.if \\n(aC>\\n(aP \{\ ++. nr aP \\n(aP+1 ++. nr cF \\n(.f ++. nr cZ \\n(.s ++. nR ++.\} ++.. ++.\" NS Sf macro -defunct ++.de Sf ++.tm .Sf defunct, use prefix or Ns ++.. ++.ds rV "function returns the value 0 if successful; otherwise the value -1 is returned and the global variable \\*(vAerrno\fP is set to indicate the error. ++.\" Ns Rv macro - return values ++.\" Ns rV string - standard return message ++.de Rv ++.ie \\n(.$==0 \{\ ++.tm Usage: .Rv [-std] (#\\n(.c) ++.\} ++.el \{\ ++. ds mN Rv ++.\" . nr aP 0 ++.\" . nr lR \\n(lR+1 ++.\" . ds A1 \\$2 ++.\" . ds A2 \\$3 ++.\" . ds A3 \\$4 ++.\" . ds A4 \\$5 ++.\" . ds A5 \\$6 ++.\" . ds A6 \\$7 ++.\" . ds A7 \\$8 ++.\" . ds A8 \\$9 ++.\" . nr fV \\n(.$-1 ++. if "\\$1"-std" \{\ ++. nr cH \\*(cH ++. if (\\n(cH<2):(\\n(cH>3) .tm Usage: .Rv -std sections 2 and 3 only ++. br ++\&The ++.Fn \\$2 ++\&\\*(rV ++. \} ++.\} ++.. +--- groff-1.18.1.1.orig/tmac/Makefile.sub ++++ groff-1.18.1.1/tmac/Makefile.sub +@@ -25,15 +25,19 @@ + html.tmac www.tmac \ + eqnrc \ + troffrc troffrc-end \ +- hyphen.us ++ hyphen.us \ ++ andocj.tmac \ ++ euc-jp.tmac \ ++ gb.tmac big5.tmac + SPECIALFILES=an.tmac man.tmac s.tmac ms.tmac +-STRIPFILES=e.tmac doc.tmac doc-old.tmac +-MDOCFILES=doc-common doc-ditroff doc-nroff doc-syms ++STRIPFILES=e.tmac doc.tmac doc-old.tmac docj.tmac ++MDOCFILES=doc-common doc-ditroff doc-nroff doc-syms docj-ditroff docj-nroff + mdocdir=$(tmacdir)/mdoc + CLEANADD=\ + stamp-wrap stamp-sed *-wrap man.tmac-sed ms.tmac-sed \ + stamp-strip e.tmac-s doc.tmac-s doc-old.tmac-s \ +- doc-common-s doc-ditroff-s doc-nroff-s doc-syms-s mdoc.local-s ++ doc-common-s doc-ditroff-s doc-nroff-s doc-syms-s mdoc.local-s \ ++ docj.tmac-s docj-ditroff-s docj-nroff-s + tmac_s_prefix= + tmac_an_prefix= + tmac_wrap= +--- groff-1.18.1.1.orig/tmac/euc-jp.tmac ++++ groff-1.18.1.1/tmac/euc-jp.tmac +@@ -0,0 +1,7 @@ ++.\" euc-jp.tmac ++.\" ++.cflags 256 ,:;>} ++.cflags 256 ¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡Ë¡Í¡Ï¡Ñ¡×¡Ù¡Û¤¡¤£¤¥¤§¤©¤Ã¤ã¤å¤ç¡¼ ++.cflags 256 ¥¡¥£¥¥¥§¥©¥Ã¥ã¥å¥ç ++.cflags 512 ¡Ê¡Ì¡Î¡Ð¡Ö¡Ø¡Ú ++.hc ¡¾ +--- groff-1.18.1.1.orig/tmac/big5.tmac ++++ groff-1.18.1.1/tmac/big5.tmac +@@ -0,0 +1,15 @@ ++.\" Kinsoku table for the BIG5 encoding of Chinese, recoded from ++.\" kinsoku.el in Emacs 22.0.50. ++.\" Needs review by native zh_TW speaker. ++.\" ++.cflags 256 ¡B¡C¡A¡D¡G¡F¡H¡I¡Ã¡Ä ++.cflags 256 ¡²Éi¡X¡þ¡U¡L¡¦¡¨¡^ ++.cflags 256 ¡f¡b¡r¡n¡v¡z¡j¡Ñ¡×¡Õ¡Ø¡Û¡ñ¢X ++.cflags 256 ¡½¡µ¡¶¡¾¡¿¡°¢E¡÷¡ö¡ô¡ã ++.cflags 512 ¡Ö¡Ù¡ï¡ð¢X¢C¡ì ++.cflags 512 ÛÖ¶yÅV¡D¡¶¡ù£H¢} ++.\" ++.\" http://tcl.apache.org/sources/tcl/tools/encoding/big5.txt lists U+FF0D ++.\" as FULLWIDTH HYPHEN-MINUS. Is this correct? ++.\" ++.hc ¡Ð +--- groff-1.18.1.1.orig/tmac/andocj.tmac ++++ groff-1.18.1.1/tmac/andocj.tmac +@@ -0,0 +1,12 @@ ++.\" Load either tmac.an or tmac.doc. ++.if !\n(.g .ab These macros require groff. ++.de Dd ++.rm Dd ++.do mso tmac.docj ++\\*(Dd\\ ++.. ++.de TH ++.rm TH ++.do mso tmac.an ++\\*(TH\\ ++.. +--- groff-1.18.1.1.orig/aclocal.m4 ++++ groff-1.18.1.1/aclocal.m4 +@@ -356,6 +356,19 @@ + AC_MSG_RESULT(no);AC_MSG_ERROR([header files do not support C++ (if you are using a version of gcc/g++ earlier than 2.5, you should install libg++)])) + AC_LANG_POP(C++)])dnl + dnl ++dnl Support Multibyte characters, such as Japanese Code (EUC-JP) ++dnl ++AC_DEFUN(GROFF_MULTIBYTE, ++[AC_MSG_CHECKING([whether to enable multibyte extension]) ++AC_ARG_ENABLE(multibyte, [ --enable-multibyte Enable multibyte extension], ++ multibyte=$enableval, multibyte=no) ++if test "x$multibyte" != "xno"; then ++ AC_DEFINE(ENABLE_MULTIBYTE, 1, ++ [Define if you want to use multibyte extension.]) ++fi ++AC_MSG_RESULT([$multibyte]) ++])dnl ++dnl + dnl + AC_DEFUN(GROFF_TMAC, + [AC_MSG_CHECKING([for prefix of system macro packages]) +@@ -415,6 +428,33 @@ + AC_MSG_RESULT([$tmac_wrap]) + AC_SUBST(tmac_wrap)])dnl + dnl ++dnl codeset.m4 from gettext, by Bruno Haible. ++dnl ++AC_DEFUN(GROFF_LANGINFO_CODESET, ++[AC_CACHE_CHECK([for nl_langinfo and CODESET], groff_cv_langinfo_codeset, ++ [AC_TRY_LINK([#include ], ++ [char* cs = nl_langinfo(CODESET);], ++ groff_cv_langinfo_codeset=yes, ++ groff_cv_langinfo_codeset=no) ++ ]) ++ if test $groff_cv_langinfo_codeset = yes; then ++ AC_DEFINE(HAVE_LANGINFO_CODESET, 1, ++ [Define if you have and nl_langinfo(CODESET).]) ++ fi ++])dnl ++dnl ++dnl ++AC_DEFUN(GROFF_DVIFORMAT, ++[AC_MSG_CHECKING([japanese dvi file format]) ++if test "x$dvi_format" != "xASCII"; then ++ DVIFORMAT=NTT ++else ++ DVIFORMAT=ASCII ++fi ++AC_MSG_RESULT([$DVIFORMAT]) ++AC_SUBST(DVIFORMAT) ++])dnl ++dnl + dnl + AC_DEFUN(GROFF_G, + [AC_MSG_CHECKING([for existing troff installation]) +@@ -481,7 +521,7 @@ + AC_DEFINE(IS_EBCDIC_HOST, 1, + [Define if the host's encoding is EBCDIC.]), + groff_cv_ebcdic="no" +- TTYDEVDIRS="font/devascii font/devlatin1" ++ TTYDEVDIRS="font/devascii font/devlatin1 font/devascii8 font/devnippon" + OTHERDEVDIRS="font/devlj4 font/devlbp" + AC_MSG_RESULT(no)) + AC_SUBST(TTYDEVDIRS) +--- groff-1.18.1.1.orig/configure.ac ++++ groff-1.18.1.1/configure.ac +@@ -68,6 +68,9 @@ + GROFF_G + GROFF_TMAC + GROFF_HTML_PROGRAMS ++GROFF_MULTIBYTE ++GROFF_DVIFORMAT ++GROFF_LANGINFO_CODESET + AC_CONFIG_FILES(stamp-h, [echo timestamp > stamp-h]) + AC_CONFIG_FILES([Makefile doc/Makefile src/xditview/Imakefile]) + AC_OUTPUT +--- groff-1.18.1.1.orig/stamp-h ++++ groff-1.18.1.1/stamp-h +@@ -0,0 +1 @@ ++timestamp +--- groff-1.18.1.1.orig/contrib/pic2graph/pic2graph.sh ++++ groff-1.18.1.1/contrib/pic2graph/pic2graph.sh +@@ -32,7 +32,7 @@ + # We don't have complete option coverage on eqn because this is primarily + # intended as a pic translator; we can live with eqn defaults. + # +-# $Id: pic2graph.sh,v 1.2 2002/07/17 04:55:46 wlemb Exp $ ++# $Id: pic2graph.sh,v 1.5 2003/10/31 19:32:36 wlemb Exp $ + # + groffpic_opts="" + gs_opts="" +@@ -44,7 +44,7 @@ + do + case $1 in + -unsafe) +- groffpic_opts="-U" ++ groffpic_opts="-U";; + -format) + format=$2 + shift;; +@@ -68,16 +68,34 @@ + eqndelim="delim $eqndelim" + fi + ++# create temporary directory ++tmp= ++for d in "$GROFF_TMPDIR" "$TMPDIR" "$TMP" "$TEMP" /tmp; do ++ test -z "$d" && continue ++ ++ tmp=`(umask 077 && mktemp -d -q "$d/pic2graph-XXXXXX") 2> /dev/null` \ ++ && test -n "$tmp" && test -d "$tmp" \ ++ && break ++ ++ tmp=$d/pic2graph$$-$RANDOM ++ (umask 077 && mkdir $tmp) 2> /dev/null \ ++ && break ++done; ++if test -z "$tmp"; then ++ echo "$0: cannot create temporary directory" >&2 ++ { (exit 1); exit 1; } ++fi ++ ++trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 2 15 ++ + # Here goes: + # 1. Wrap the input in dummy .PS/PE macros (and add possibly null .EQ/.EN) + # 2. Process through eqn and pic to emit troff markup. + # 3. Process through groff to emit Postscript. + # 4. Use convert(1) to crop the PostScript and turn it into a bitmap. +-tmp=/usr/tmp/pic2graph-$$ +-trap "rm ${tmp}.*" 0 2 15 + (echo ".EQ"; echo $eqndelim; echo ".EN"; echo ".PS"; cat; echo ".PE") | \ +- groff -e -p $groffpic_opts -Tps >${tmp}.ps \ +- && convert -crop 0x0 $convert_opts ${tmp}.ps ${tmp}.${format} \ +- && cat ${tmp}.${format} ++ groff -e -p $groffpic_opts -Tps -P-pletter > $tmp/pic2graph.ps \ ++ && convert -crop 0x0 $convert_opts $tmp/pic2graph.ps $tmp/pic2graph.$format \ ++ && cat $tmp/pic2graph.$format + + # End +--- groff-1.18.1.1.orig/contrib/mom/groff_mom.man ++++ groff-1.18.1.1/contrib/mom/groff_mom.man +@@ -13,6 +13,10 @@ + A copy of the Free Documentation License is included as a file called + FDL in the main directory of the groff source package. + .. ++.ig ++A copy of the GNU Free Documentation License is also available in this ++Debian package as /usr/share/doc/groff/copyright. ++.. + . + .mso www.tmac + . +--- groff-1.18.1.1.orig/contrib/groffer/groffer.sh ++++ groff-1.18.1.1/contrib/groffer/groffer.sh +@@ -3228,17 +3228,12 @@ + do + if is_not_empty "$d"; then + if obj d is_dir && obj d is_writable; then +- _TMP_DIR="${d}/${_PROGRAM_NAME}${_PROCESS_ID}"; +- if obj _TMP_DIR is_dir; then +- rm -f "${_TMP_DIR}"/*; ++ _TMP_DIR="$(mktemp -d "${d}/${_PROGRAM_NAME}.XXXXXX")" ++ if test $? = 0; then + break; + else +- mkdir "${_TMP_DIR}"; +- if obj _TMP_DIR is_not_dir; then +- _TMP_DIR=''; +- continue; +- fi; +- break; ++ _TMP_DIR=''; ++ continue; + fi; + fi; + if obj _TMP_DIR is_not_writable; then +--- groff-1.18.1.1.orig/contrib/eqn2graph/eqn2graph.sh ++++ groff-1.18.1.1/contrib/eqn2graph/eqn2graph.sh +@@ -32,7 +32,7 @@ + # + # Thus, we pass -U to groff(1), and everything else to convert(1). + # +-# $Id: eqn2graph.sh,v 1.2 2002/07/17 04:55:46 wlemb Exp $ ++# $Id: eqn2graph.sh,v 1.3 2003/10/28 07:46:23 wlemb Exp $ + # + groff_opts="" + convert_opts="" +@@ -58,17 +58,34 @@ + shift + done + ++# create temporary directory ++tmp= ++for d in "$GROFF_TMPDIR" "$TMPDIR" "$TMP" "$TEMP" /tmp; do ++ test -z "$d" && continue ++ ++ tmp=`(umask 077 && mktemp -d -q "$d/eqn2graph-XXXXXX") 2> /dev/null` \ ++ && test -n "$tmp" && test -d "$tmp" \ ++ && break ++ ++ tmp=$d/eqn2graph$$-$RANDOM ++ (umask 077 && mkdir $tmp) 2> /dev/null && break ++done; ++if test -z "$tmp"; then ++ echo "$0: cannot create temporary directory" >&2 ++ { (exit 1); exit 1; } ++fi ++ ++trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 2 15 ++ + # Here goes: + # 1. Add .EQ/.EN. + # 2. Process through eqn(1) to emit troff markup. + # 3. Process through groff(1) to emit Postscript. + # 4. Use convert(1) to crop the Postscript and turn it into a bitmap. +-tmp=/usr/tmp/eqn2graph-$$ +-trap "rm ${tmp}.*" 0 2 15 + read equation +-(echo ".EQ"; echo 'delim $$'; echo ".EN"; echo '$'"${equation}"'$') | \ +- groff -e $groff_opts -Tps >${tmp}.ps \ +- && convert -crop 0x0 $convert_opts ${tmp}.ps ${tmp}.${format} \ +- && cat ${tmp}.${format} ++(echo ".EQ"; echo 'delim $$'; echo ".EN"; echo '$'"$equation"'$') | \ ++ groff -e $groff_opts -Tps -P-pletter > $tmp/eqn2graph.ps \ ++ && convert -crop 0x0 $convert_opts $tmp/eqn2graph.ps $tmp/eqn2graph.$format \ ++ && cat $tmp/eqn2graph.$format + + # End +--- groff-1.18.1.1.orig/configure ++++ groff-1.18.1.1/configure +@@ -305,7 +305,7 @@ + # include + #endif" + +-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 datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS groff_top_builddir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX TTYDEVDIRS OTHERDEVDIRS LPR LP LPQ PSPRINT DVIPRINT PERLPATH YACC RANLIB ac_ct_RANLIB INSTALL_INFO INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SH_SCRIPT_SED_CMD CPP EGREP LIBM LIBOBJS BROKEN_SPOOLER_FLAGS PAGE g sys_tmac_prefix tmac_wrap pnmcut pnmcrop pnmtopng gs psselect make_html make_install_html LTLIBOBJS' ++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 datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS groff_top_builddir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX TTYDEVDIRS OTHERDEVDIRS LPR LP LPQ PSPRINT DVIPRINT PERLPATH YACC RANLIB ac_ct_RANLIB INSTALL_INFO INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SH_SCRIPT_SED_CMD CPP EGREP LIBM LIBOBJS BROKEN_SPOOLER_FLAGS PAGE g sys_tmac_prefix tmac_wrap pnmcut pnmcrop pnmtopng gs psselect make_html make_install_html DVIFORMAT LTLIBOBJS' + ac_subst_files='' + + # Initialize some variables set by options. +@@ -841,6 +841,11 @@ + + cat <<\_ACEOF + ++Optional Features: ++ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) ++ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] ++ --enable-multibyte Enable multibyte extension ++ + Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags +@@ -2530,7 +2535,7 @@ + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + groff_cv_ebcdic="no" +- TTYDEVDIRS="font/devascii font/devlatin1" ++ TTYDEVDIRS="font/devascii font/devlatin1 font/devascii8 font/devnippon" + OTHERDEVDIRS="font/devlj4 font/devlbp" + echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6 +@@ -5859,6 +5864,84 @@ + esac + + ++echo "$as_me:$LINENO: checking whether to enable multibyte extension" >&5 ++echo $ECHO_N "checking whether to enable multibyte extension... $ECHO_C" >&6 ++# Check whether --enable-multibyte or --disable-multibyte was given. ++if test "${enable_multibyte+set}" = set; then ++ enableval="$enable_multibyte" ++ multibyte=$enableval ++else ++ multibyte=no ++fi; ++if test "x$multibyte" != "xno"; then ++ ++cat >>confdefs.h <<\_ACEOF ++#define ENABLE_MULTIBYTE 1 ++_ACEOF ++ ++fi ++echo "$as_me:$LINENO: result: $multibyte" >&5 ++echo "${ECHO_T}$multibyte" >&6 ++ ++echo "$as_me:$LINENO: checking japanese dvi file format" >&5 ++echo $ECHO_N "checking japanese dvi file format... $ECHO_C" >&6 ++if test "x$dvi_format" != "xASCII"; then ++ DVIFORMAT=NTT ++else ++ DVIFORMAT=ASCII ++fi ++echo "$as_me:$LINENO: result: $DVIFORMAT" >&5 ++echo "${ECHO_T}$DVIFORMAT" >&6 ++ ++ ++echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 ++echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6 ++if test "${groff_cv_langinfo_codeset+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++#line $LINENO "configure" ++#include "confdefs.h" ++#include ++int ++main () ++{ ++char* cs = nl_langinfo(CODESET); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ++ (eval $ac_link) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ groff_cv_langinfo_codeset=yes ++else ++ echo "$as_me: failed program was:" >&5 ++cat conftest.$ac_ext >&5 ++groff_cv_langinfo_codeset=no ++fi ++rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++ ++fi ++echo "$as_me:$LINENO: result: $groff_cv_langinfo_codeset" >&5 ++echo "${ECHO_T}$groff_cv_langinfo_codeset" >&6 ++ if test $groff_cv_langinfo_codeset = yes; then ++ ++cat >>confdefs.h <<\_ACEOF ++#define HAVE_LANGINFO_CODESET 1 ++_ACEOF ++ ++ fi ++ + ac_config_files="$ac_config_files stamp-h" + + ac_config_files="$ac_config_files Makefile doc/Makefile src/xditview/Imakefile" +@@ -6497,6 +6580,7 @@ + s,@psselect@,$psselect,;t t + s,@make_html@,$make_html,;t t + s,@make_install_html@,$make_install_html,;t t ++s,@DVIFORMAT@,$DVIFORMAT,;t t + s,@LTLIBOBJS@,$LTLIBOBJS,;t t + CEOF + +--- groff-1.18.1.1.orig/Makefile.in ++++ groff-1.18.1.1/Makefile.in +@@ -136,7 +136,11 @@ + # directory will be always added. + # `troffrc' and `troffrc-end' (and `eqnrc') are searched neither in the + # current nor in the home directory. ++ifeq (,$(extratmacdirs)) + tmacpath=$(systemtmacdir):$(localtmacdir):$(tmacdir) ++else ++tmacpath=$(systemtmacdir):$(localtmacdir):$(tmacdir):$(extratmacdirs) ++endif + + # `sys_tmac_prefix' is prefix (if any) for system macro packages. + sys_tmac_prefix=@sys_tmac_prefix@ +@@ -195,6 +199,9 @@ + man7ext=7 + man7dir=$(manroot)/man$(man7ext) + ++# DVI file format. ++DVIFORMAT=@DVIFORMAT@ ++ + # The configure script checks whether all necessary utility programs for + # grohtml are available -- only then we can build the HTML documentation. + make_html=@make_html@ +@@ -261,6 +268,8 @@ + # -DRETSIGTYPE=int if signal handlers return int not void + # -DIS_EBCDIC_HOST if the host's encoding is EBCDIC + # -DPAGEA4 if the the printer's page size is A4 ++# -DENABLE_MULTIBYTE enable multibyte extension ++# -DHAVE_LANGINFO_CODESET if you have nl_langinfo(CODESET) + DEFINES=@DEFS@ + + # Include +@@ -395,7 +404,8 @@ + "PERLPATH=$(PERLPATH)" \ + "SH_SCRIPT_SED_CMD=$(SH_SCRIPT_SED_CMD)" \ + "PURIFY=$(PURIFY)" \ +- "PURIFYCCFLAGS=$(PURIFYCCFLAGS)" ++ "PURIFYCCFLAGS=$(PURIFYCCFLAGS)" \ ++ "DVIFORMAT=$(DVIFORMAT)" + + SHELL=/bin/sh + INCDIRS=src/include +@@ -437,8 +447,10 @@ + font/devhtml + ALLTTYDEVDIRS=\ + font/devascii \ ++ font/devascii8 \ + font/devlatin1 \ + font/devutf8 \ ++ font/devnippon \ + font/devcp1047 + OTHERDIRS=\ + man \ +@@ -483,7 +495,7 @@ + fi + + do=all +-dodirs=$(ALLDIRS) dot ++dodirs=$(DISTDIRS) + # Default target for subdir_Makefile + subdir=src/roff/troff + +--- groff-1.18.1.1.orig/TODO.jp ++++ groff-1.18.1.1/TODO.jp +@@ -0,0 +1,19 @@ ++TODO lists ++ ++- configure ++ nl_langinfo() ++ iconv() ++ ++- font/devdvi ++ G,M -- NTT and/or ASCII ++- src/devices ++ grohtml ++ grodvi ++ grolbp ++ grolj4 ++- src/xditview ++ ++- command line option to specify input/output encoding ++- font code? ++ can we assume wchar code == font code? ++ [to simplify indexing] +--- groff-1.18.1.1.orig/mdate.sh ++++ groff-1.18.1.1/mdate.sh +@@ -2,41 +2,4 @@ + + # Print the modification date of $1 `nicely'. + +-# Don't want foreign dates. +- +-LANGUAGE= +-LC_ALL=C; export LC_ALL +- +- +-(date; +-if ls -L /dev/null 1>/dev/null 2>&1; then ls -L -l $1; else ls -l $1; fi +-) | awk ' +-BEGIN { +- full["Jan"] = "January"; number["Jan"] = 1; +- full["Feb"] = "February"; number["Feb"] = 2; +- full["Mar"] = "March"; number["Mar"] = 3; +- full["Apr"] = "April"; number["Apr"] = 4; +- full["May"] = "May"; number["May"] = 5; +- full["Jun"] = "June"; number["Jun"] = 6; +- full["Jul"] = "July"; number["Jul"] = 7; +- full["Aug"] = "August"; number["Aug"] = 8; +- full["Sep"] = "September"; number["Sep"] = 9; +- full["Oct"] = "October"; number["Oct"] = 10; +- full["Nov"] = "November"; number["Nov"] = 11; +- full["Dec"] = "December"; number["Dec"] = 12; +-} +- +-NR == 1 { +- month = $2; +- year = $NF; +-} +- +-NR == 2 { +- if ($(NF-1) ~ /:/) { +- if (number[$(NF-3)] > number[month]) +- year--; +- } +- else +- year = $(NF-1); +- print $(NF-2), full[$(NF-3)], year +-}' ++perl -MPOSIX -le 'print strftime("%d %B %Y", localtime((stat $ARGV[0])[9]))' $1 +--- groff-1.18.1.1.orig/man/groff_out.man ++++ groff-1.18.1.1/man/groff_out.man +@@ -19,6 +19,10 @@ + A copy of the Free Documentation License is included as a file called + FDL in the main directory of the groff source package. + .. ++.ig ++A copy of the GNU Free Documentation License is also available in this ++Debian package as /usr/share/doc/groff/copyright. ++.. + . + .\" -------------------------------------------------------------------- + .\" Setup +--- groff-1.18.1.1.orig/man/groff_char.man ++++ groff-1.18.1.1/man/groff_char.man +@@ -32,6 +32,10 @@ + A copy of the Free Documentation License is included as a file called + FDL in the main directory of the groff source package. + .. ++.ig ++A copy of the GNU Free Documentation License is also available in this ++Debian package as /usr/share/doc/groff/copyright. ++.. + . + .\" -------------------------------------------------------------------- + .\" Setup Part 1 +--- groff-1.18.1.1.orig/man/groff_tmac.man ++++ groff-1.18.1.1/man/groff_tmac.man +@@ -32,6 +32,10 @@ + A copy of the Free Documentation License is included as a file called + FDL in the main directory of the groff source package. + .. ++.ig ++A copy of the GNU Free Documentation License is also available in this ++Debian package as /usr/share/doc/groff/copyright. ++.. + . + .\" -------------------------------------------------------------------- + .\" Setup +--- groff-1.18.1.1.orig/man/roff.man ++++ groff-1.18.1.1/man/roff.man +@@ -18,6 +18,10 @@ + A copy of the Free Documentation License is included as a file called + FDL in the main directory of the groff source package. + .. ++.ig ++A copy of the GNU Free Documentation License is also available in this ++Debian package as /usr/share/doc/groff/copyright. ++.. + . + .\" -------------------------------------------------------------------- + .\" Setup +--- groff-1.18.1.1.orig/man/ditroff.man ++++ groff-1.18.1.1/man/ditroff.man +@@ -18,6 +18,10 @@ + A copy of the Free Documentation License is included as a file called + FDL in the main directory of the groff source package. + .. ++.ig ++A copy of the GNU Free Documentation License is also available in this ++Debian package as /usr/share/doc/groff/copyright. ++.. + . + .\" -------------------------------------------------------------------- + .\" Setup +--- groff-1.18.1.1.orig/man/groff_diff.man ++++ groff-1.18.1.1/man/groff_diff.man +@@ -23,6 +23,10 @@ + A copy of the Free Documentation License is included as a file called + FDL in the main directory of the groff source package. + .. ++.ig ++A copy of the GNU Free Documentation License is also available in this ++Debian package as /usr/share/doc/groff/copyright. ++.. + . + .\" -------------------------------------------------------------------- + .\" Setup +--- groff-1.18.1.1.orig/man/groff.man ++++ groff-1.18.1.1/man/groff.man +@@ -19,6 +19,10 @@ + A copy of the Free Documentation License is included as a file called + FDL in the main directory of the groff source package. + .. ++.ig ++A copy of the GNU Free Documentation License is also available in this ++Debian package as /usr/share/doc/groff/copyright. ++.. + . + .\" -------------------------------------------------------------------- + .\" Setup diff --git a/base-source/groff-1.18.1.1.tar.gz b/base-source/groff-1.18.1.1.tar.gz new file mode 100644 index 0000000..2fff463 Binary files /dev/null and b/base-source/groff-1.18.1.1.tar.gz differ diff --git a/base-source/grub-0.97.tar.gz b/base-source/grub-0.97.tar.gz new file mode 100644 index 0000000..2cdf71b Binary files /dev/null and b/base-source/grub-0.97.tar.gz differ diff --git a/base-source/gzip-1.3.5-security_fixes-1.patch b/base-source/gzip-1.3.5-security_fixes-1.patch new file mode 100644 index 0000000..7350899 --- /dev/null +++ b/base-source/gzip-1.3.5-security_fixes-1.patch @@ -0,0 +1,63 @@ +Submitted By: Matthew Burgess (matthew at linuxfromscratch dot org) +Origin: http://security.ubuntu.com/ubuntu/pool/main/g/gzip/gzip_1.3.5-9ubuntu3.1.diff.gz +Date: 2005-05-12 +Initial package version: 1.3.5 +Description: Fix two security vulnerabilities in gzip: A path traversal +bug when using the -N option (CAN-2005-1228) and a race condition in the +file permission restore code (CAN-2005-0998). + +diff -Naur gzip-1.3.5.orig/gzip.c gzip-1.3.5/gzip.c +--- gzip-1.3.5.orig/gzip.c 2002-09-28 07:38:43.000000000 +0000 ++++ gzip-1.3.5/gzip.c 2005-05-12 19:15:14.796031360 +0000 +@@ -875,8 +875,11 @@ + } + + close(ifd); +- if (!to_stdout && close(ofd)) { +- write_error(); ++ if (!to_stdout) { ++ /* Copy modes, times, ownership, and remove the input file */ ++ copy_stat(&istat); ++ if (close(ofd)) ++ write_error(); + } + if (method == -1) { + if (!to_stdout) xunlink (ofname); +@@ -896,10 +899,6 @@ + } + fprintf(stderr, "\n"); + } +- /* Copy modes, times, ownership, and remove the input file */ +- if (!to_stdout) { +- copy_stat(&istat); +- } + } + + /* ======================================================================== +@@ -1324,6 +1323,8 @@ + error("corrupted input -- file name too large"); + } + } ++ char *base2 = base_name (base); ++ strcpy(base, base2); + /* If necessary, adapt the name to local OS conventions: */ + if (!list) { + MAKE_LEGAL_NAME(base); +@@ -1725,7 +1726,7 @@ + reset_times(ofname, ifstat); + #endif + /* Copy the protection modes */ +- if (chmod(ofname, ifstat->st_mode & 07777)) { ++ if (fchmod(ofd, ifstat->st_mode & 07777)) { + int e = errno; + WARN((stderr, "%s: ", progname)); + if (!quiet) { +@@ -1734,7 +1735,7 @@ + } + } + #ifndef NO_CHOWN +- chown(ofname, ifstat->st_uid, ifstat->st_gid); /* Copy ownership */ ++ fchown(ofd, ifstat->st_uid, ifstat->st_gid); /* Copy ownership */ + #endif + remove_ofname = 0; + /* It's now safe to remove the input file: */ diff --git a/base-source/gzip-1.3.5.tar.gz b/base-source/gzip-1.3.5.tar.gz new file mode 100644 index 0000000..854026a Binary files /dev/null and b/base-source/gzip-1.3.5.tar.gz differ diff --git a/base-source/hdparm-6.6.tar.gz b/base-source/hdparm-6.6.tar.gz new file mode 100644 index 0000000..7b0aaa7 Binary files /dev/null and b/base-source/hdparm-6.6.tar.gz differ diff --git a/base-source/iana-etc-2.10.tar.bz2 b/base-source/iana-etc-2.10.tar.bz2 new file mode 100644 index 0000000..69ddb7e Binary files /dev/null and b/base-source/iana-etc-2.10.tar.bz2 differ diff --git a/base-source/inetutils-1.4.2-gcc4_fixes-3.patch b/base-source/inetutils-1.4.2-gcc4_fixes-3.patch new file mode 100644 index 0000000..fd7d847 --- /dev/null +++ b/base-source/inetutils-1.4.2-gcc4_fixes-3.patch @@ -0,0 +1,37 @@ +Submitted By: Matthew Burgess +Date: 2005-08-30 +Initial Package Version: 1.4.2 +Upstream Status: From upstream +Origin: Greg Schafer (http://www.diy-linux.org/downloads/patches/GCC4/inetutils-1.4.2-gcc4-fixes-1.patch) +Description: Fix compilation issues with gcc4 + +diff -Naur inetutils-1.4.2.orig/ftp/ftp_var.h inetutils-1.4.2/ftp/ftp_var.h +--- inetutils-1.4.2.orig/ftp/ftp_var.h 2000-07-08 01:00:53.000000000 +0000 ++++ inetutils-1.4.2/ftp/ftp_var.h 2005-08-30 20:25:27.205932304 +0000 +@@ -36,8 +36,6 @@ + #include + #include + +-#include "extern.h" +- + #ifndef FTP_EXTERN + #define FTP_EXTERN extern + #endif +@@ -129,3 +127,5 @@ + FTP_EXTERN int macnum; /* number of defined macros */ + FTP_EXTERN struct macel macros[16]; + FTP_EXTERN char macbuf[4096]; ++ ++#include "extern.h" +diff -Naur inetutils-1.4.2.orig/libinetutils/ttymsg.c inetutils-1.4.2/libinetutils/ttymsg.c +--- inetutils-1.4.2.orig/libinetutils/ttymsg.c 2001-11-01 15:52:19.000000000 +0000 ++++ inetutils-1.4.2/libinetutils/ttymsg.c 2005-08-30 20:24:27.168059448 +0000 +@@ -132,7 +132,7 @@ + } + if (wret) + { +- (char *)iov->iov_base += wret; ++ iov->iov_base = (char *)iov->iov_base + wret; + iov->iov_len -= wret; + } + continue; diff --git a/base-source/inetutils-1.4.2-no_server_man_pages-1.patch b/base-source/inetutils-1.4.2-no_server_man_pages-1.patch new file mode 100644 index 0000000..f7f89ee --- /dev/null +++ b/base-source/inetutils-1.4.2-no_server_man_pages-1.patch @@ -0,0 +1,116 @@ +Submitted By: Greg Schafer +Date: 2003-12-11 +Initial Package Version: 1.4.2 +Origin: Greg Schafer +Description: Prevent installation of unwanted server man pages. + +diff -Naur inetutils-1.4.2.orig/ftpd/Makefile.in inetutils-1.4.2/ftpd/Makefile.in +--- inetutils-1.4.2.orig/ftpd/Makefile.in 2002-12-23 04:30:12.000000000 +0000 ++++ inetutils-1.4.2/ftpd/Makefile.in 2003-12-11 02:21:24.222010104 +0000 +@@ -177,7 +177,6 @@ + + noinst_HEADERS = extern.h + +-man_MANS = ftpd.8 + + INCLUDES = $(PATHDEF_FTPWELCOME) $(PATHDEF_FTPUSERS) \ + $(PATHDEF_FTPLOGINMESG) $(PATHDEF_FTPCHROOT) $(PATHDEF_FTPDPID) \ +diff -Naur inetutils-1.4.2.orig/inetd/Makefile.in inetutils-1.4.2/inetd/Makefile.in +--- inetutils-1.4.2.orig/inetd/Makefile.in 2002-12-23 04:30:13.000000000 +0000 ++++ inetutils-1.4.2/inetd/Makefile.in 2003-12-11 02:21:24.223009952 +0000 +@@ -172,7 +172,6 @@ + + inetd_SOURCES = inetd.c + +-man_MANS = inetd.8 + + INCLUDES = $(PATHDEF_INETDCONF) $(PATHDEF_INETDDIR) -I$(top_builddir)/include + +diff -Naur inetutils-1.4.2.orig/logger/Makefile.in inetutils-1.4.2/logger/Makefile.in +--- inetutils-1.4.2.orig/logger/Makefile.in 2002-12-23 04:30:16.000000000 +0000 ++++ inetutils-1.4.2/logger/Makefile.in 2003-12-11 02:21:24.224009800 +0000 +@@ -175,7 +175,6 @@ + + logger_SOURCES = logger.c + +-man_MANS = logger.1 + + EXTRA_DIST = $(man_MANS) + subdir = logger +diff -Naur inetutils-1.4.2.orig/rexecd/Makefile.in inetutils-1.4.2/rexecd/Makefile.in +--- inetutils-1.4.2.orig/rexecd/Makefile.in 2002-12-23 04:30:17.000000000 +0000 ++++ inetutils-1.4.2/rexecd/Makefile.in 2003-12-11 02:21:24.225009648 +0000 +@@ -173,7 +173,6 @@ + + rexecd_SOURCES = rexecd.c + +-man_MANS = rexecd.8 + + INCLUDES = $(PATHDEF_DEFPATH) $(PATHDEF_BSHELL) -I$(top_builddir)/include + +diff -Naur inetutils-1.4.2.orig/rlogind/Makefile.in inetutils-1.4.2/rlogind/Makefile.in +--- inetutils-1.4.2.orig/rlogind/Makefile.in 2002-12-23 04:30:18.000000000 +0000 ++++ inetutils-1.4.2/rlogind/Makefile.in 2003-12-11 02:21:24.225009648 +0000 +@@ -173,7 +173,6 @@ + + rlogind_SOURCES = rlogind.c + +-man_MANS = rlogind.8 + + INCLUDES = $(PATHDEF_DEV) $(PATHDEF_LOGIN) -I$(top_builddir)/include + +diff -Naur inetutils-1.4.2.orig/rshd/Makefile.in inetutils-1.4.2/rshd/Makefile.in +--- inetutils-1.4.2.orig/rshd/Makefile.in 2002-12-23 04:30:19.000000000 +0000 ++++ inetutils-1.4.2/rshd/Makefile.in 2003-12-11 02:21:24.226009496 +0000 +@@ -172,7 +172,6 @@ + + rshd_SOURCES = rshd.c + +-man_MANS = rshd.8 + + INCLUDES = $(PATHDEF_BSHELL) $(PATHDEF_NOLOGIN) $(PATHDEF_DEFPATH) -I$(top_builddir)/include + +diff -Naur inetutils-1.4.2.orig/syslogd/Makefile.in inetutils-1.4.2/syslogd/Makefile.in +--- inetutils-1.4.2.orig/syslogd/Makefile.in 2002-12-23 04:30:19.000000000 +0000 ++++ inetutils-1.4.2/syslogd/Makefile.in 2003-12-11 02:21:24.226009496 +0000 +@@ -172,7 +172,6 @@ + + syslogd_SOURCES = syslogd.c + +-man_MANS = syslog.conf.5 syslogd.8 + + INCLUDES = $(PATHDEF_LOG) $(PATHDEF_LOGCONF) $(PATHDEF_LOGPID) \ + $(PATHDEF_CONSOLE) -I$(top_builddir)/include +diff -Naur inetutils-1.4.2.orig/talkd/Makefile.in inetutils-1.4.2/talkd/Makefile.in +--- inetutils-1.4.2.orig/talkd/Makefile.in 2002-12-23 04:30:20.000000000 +0000 ++++ inetutils-1.4.2/talkd/Makefile.in 2003-12-11 02:21:24.227009344 +0000 +@@ -180,7 +180,6 @@ + intalkd.h + + +-man_MANS = talkd.8 + + INCLUDES = $(PATHDEF_DEV) -I${top_srcdir}/libinetutils -I$(top_builddir)/include + +diff -Naur inetutils-1.4.2.orig/telnetd/Makefile.in inetutils-1.4.2/telnetd/Makefile.in +--- inetutils-1.4.2.orig/telnetd/Makefile.in 2002-12-23 04:30:21.000000000 +0000 ++++ inetutils-1.4.2/telnetd/Makefile.in 2003-12-11 02:21:24.228009192 +0000 +@@ -176,7 +176,6 @@ + + noinst_HEADERS = telnetd.h + +-man_MANS = telnetd.8 + + INCLUDES = $(PATHDEF_DEV) $(PATHDEF_TTY) $(PATHDEF_LOGIN) -I$(top_builddir)/include \ + -I$(top_srcdir) @INCAUTH@ +diff -Naur inetutils-1.4.2.orig/tftpd/Makefile.in inetutils-1.4.2/tftpd/Makefile.in +--- inetutils-1.4.2.orig/tftpd/Makefile.in 2002-12-23 04:30:22.000000000 +0000 ++++ inetutils-1.4.2/tftpd/Makefile.in 2003-12-11 02:21:24.229009040 +0000 +@@ -174,7 +174,6 @@ + + tftpd_SOURCES = tftpd.c + +-man_MANS = tftpd.8 + + LDADD = -L../libinetutils -linetutils + diff --git a/base-source/inetutils-1.4.2.tar.gz b/base-source/inetutils-1.4.2.tar.gz new file mode 100644 index 0000000..ecb73cc Binary files /dev/null and b/base-source/inetutils-1.4.2.tar.gz differ diff --git a/base-source/iproute2-2.6.16-060323.tar.gz b/base-source/iproute2-2.6.16-060323.tar.gz new file mode 100644 index 0000000..96e4628 Binary files /dev/null and b/base-source/iproute2-2.6.16-060323.tar.gz differ diff --git a/base-source/kbd-1.12-backspace-1.patch b/base-source/kbd-1.12-backspace-1.patch new file mode 100644 index 0000000..8bcbb94 --- /dev/null +++ b/base-source/kbd-1.12-backspace-1.patch @@ -0,0 +1,232 @@ +Submitted By: Alexander E. Patrakov +Date: 2005-05-16 +Initial Package Version: 1.12 +Upstream Status: Not submitted, possibly incomplete +Description: Makes Backspace and Delete keys consistent in all i386 keymaps. +Obsoletes the /etc/kbd/bs-sends-del file for i386. + +diff -urN kbd-1.12.orig/data/keymaps/i386/dvorak/dvorak-l.map kbd-1.12/data/keymaps/i386/dvorak/dvorak-l.map +--- kbd-1.12.orig/data/keymaps/i386/dvorak/dvorak-l.map 2002-10-11 17:08:51.000000000 +0600 ++++ kbd-1.12/data/keymaps/i386/dvorak/dvorak-l.map 2005-05-16 19:54:48.000000000 +0600 +@@ -43,7 +43,7 @@ + keycode 11 = three numbersign + keycode 12 = two at + keycode 13 = one exclam +- keycode 14 = BackSpace Delete ++ keycode 14 = Delete Delete + ! -------------------------------------------------------------------------- + ! Row 3 + ! -------------------------------------------------------------------------- +diff -urN kbd-1.12.orig/data/keymaps/i386/dvorak/dvorak-r.map kbd-1.12/data/keymaps/i386/dvorak/dvorak-r.map +--- kbd-1.12.orig/data/keymaps/i386/dvorak/dvorak-r.map 2002-10-11 17:08:51.000000000 +0600 ++++ kbd-1.12/data/keymaps/i386/dvorak/dvorak-r.map 2005-05-16 19:54:48.000000000 +0600 +@@ -43,7 +43,7 @@ + keycode 11 = slash question + keycode 12 = bracketleft braceleft + keycode 13 = bracketright braceright +- keycode 14 = BackSpace Delete ++ keycode 14 = Delete Delete + ! -------------------------------------------------------------------------- + ! Row 3 + ! -------------------------------------------------------------------------- +diff -urN kbd-1.12.orig/data/keymaps/i386/fgGIod/tr_f-latin5.map kbd-1.12/data/keymaps/i386/fgGIod/tr_f-latin5.map +--- kbd-1.12.orig/data/keymaps/i386/fgGIod/tr_f-latin5.map 2002-10-13 06:21:12.000000000 +0600 ++++ kbd-1.12/data/keymaps/i386/fgGIod/tr_f-latin5.map 2005-05-16 19:54:48.000000000 +0600 +@@ -51,7 +51,7 @@ + alt keycode 12 = Meta_minus + keycode 13 = minus underscore + alt keycode 13 = Meta_equal +-keycode 14 = BackSpace Delete ++keycode 14 = Delete Delete + alt keycode 14 = Meta_Delete + keycode 15 = Tab Tab + alt keycode 15 = Meta_Tab +diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/lt.l4.map kbd-1.12/data/keymaps/i386/qwerty/lt.l4.map +--- kbd-1.12.orig/data/keymaps/i386/qwerty/lt.l4.map 2002-10-13 05:59:51.000000000 +0600 ++++ kbd-1.12/data/keymaps/i386/qwerty/lt.l4.map 2005-05-16 19:54:48.000000000 +0600 +@@ -205,7 +205,7 @@ + # edit this if you want the key above to delete symbols above + # cursor, not before. + keycode 14 = \ +- BackSpace BackSpace BackSpace BackSpace \ ++ Delete Delete Delete Delete \ + Delete Delete Delete Delete \ + Meta_BackSpace Meta_BackSpace Meta_BackSpace Meta_BackSpace \ + Meta_Delete Meta_Delete Meta_Delete Meta_Delete +@@ -506,7 +506,7 @@ + + # Edit this if you want strict VT100 emulation. + string F111 = "\033[3$" +-keycode 111 = Delete F111 Delete F111 \ ++keycode 111 = Remove F111 Remove F111 \ + Remove Remove Remove Remove \ + Meta_Delete Meta_Delete Meta_Delete Meta_Delete \ + Boot Boot Boot Boot +diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/lt.map kbd-1.12/data/keymaps/i386/qwerty/lt.map +--- kbd-1.12.orig/data/keymaps/i386/qwerty/lt.map 2002-10-13 06:00:25.000000000 +0600 ++++ kbd-1.12/data/keymaps/i386/qwerty/lt.map 2005-05-16 19:54:48.000000000 +0600 +@@ -204,7 +204,7 @@ + # edit this if you want the key above to delete symbols above + # cursor, not before. + keycode 14 = \ +- BackSpace BackSpace BackSpace BackSpace \ ++ Delete Delete Delete Delete \ + Delete Delete Delete Delete \ + Meta_BackSpace Meta_BackSpace Meta_BackSpace Meta_BackSpace \ + Meta_Delete Meta_Delete Meta_Delete Meta_Delete +@@ -505,7 +505,7 @@ + + # Edit this if you want strict VT100 emulation. + string F111 = "\033[3$" +-keycode 111 = Delete F111 Delete F111 \ ++keycode 111 = Remove F111 Remove F111 \ + Remove Remove Remove Remove \ + Meta_Delete Meta_Delete Meta_Delete Meta_Delete \ + Boot Boot Boot Boot +diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/no-latin1.map kbd-1.12/data/keymaps/i386/qwerty/no-latin1.map +--- kbd-1.12.orig/data/keymaps/i386/qwerty/no-latin1.map 2002-10-11 17:08:49.000000000 +0600 ++++ kbd-1.12/data/keymaps/i386/qwerty/no-latin1.map 2005-05-16 19:54:48.000000000 +0600 +@@ -3,7 +3,7 @@ + # Send comments to Kjetil T. Homme + include "linux-with-alt-and-altgr" + plain keycode 83 = KP_Comma +- plain keycode 111 = Delete # "Remove" originally, weird... ++ plain keycode 111 = Remove + strings as usual + + keycode 1 = Escape +diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/ru-ms.map kbd-1.12/data/keymaps/i386/qwerty/ru-ms.map +--- kbd-1.12.orig/data/keymaps/i386/qwerty/ru-ms.map 2002-10-13 06:07:05.000000000 +0600 ++++ kbd-1.12/data/keymaps/i386/qwerty/ru-ms.map 2005-05-16 19:54:48.000000000 +0600 +@@ -89,8 +89,8 @@ + altgr alt keycode 13 = Meta_equal + shift alt keycode 13 = Meta_plus + altgr shift alt keycode 13 = Meta_plus +- keycode 14 = BackSpace BackSpace BackSpace BackSpace +-# keycode 14 = Delete Delete Delete Delete ++# keycode 14 = BackSpace BackSpace BackSpace BackSpace ++ keycode 14 = Delete Delete Delete Delete + alt keycode 14 = Meta_Delete + altgr alt keycode 14 = Meta_Delete + keycode 15 = Tab Tab Tab Tab +diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/ru.map kbd-1.12/data/keymaps/i386/qwerty/ru.map +--- kbd-1.12.orig/data/keymaps/i386/qwerty/ru.map 2002-10-13 06:02:19.000000000 +0600 ++++ kbd-1.12/data/keymaps/i386/qwerty/ru.map 2005-05-16 19:56:08.000000000 +0600 +@@ -37,7 +37,7 @@ + alt keycode 12 = Meta_minus + keycode 13 = equal plus equal plus + alt keycode 13 = Meta_equal +- keycode 14 = BackSpace BackSpace BackSpace BackSpace ++ keycode 14 = Delete Delete Delete Delete + alt keycode 14 = Meta_Delete + keycode 15 = Tab Tab Tab Tab + alt keycode 15 = Meta_Tab +diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/ru1.map kbd-1.12/data/keymaps/i386/qwerty/ru1.map +--- kbd-1.12.orig/data/keymaps/i386/qwerty/ru1.map 2002-10-13 06:02:30.000000000 +0600 ++++ kbd-1.12/data/keymaps/i386/qwerty/ru1.map 2005-05-16 19:55:32.000000000 +0600 +@@ -143,8 +143,8 @@ + + # The keycode "0xFF" is too dangerous for many programs (including emacs). + # So let it be bracket instead of Hard Sign. +-# altgr keycode 27 = +0xDF +-# altgr shift keycode 27 = +0xFF ++altgr keycode 27 = +0xDF ++altgr shift keycode 27 = +0xFF + control keycode 27 = Control_bracketright + altgr control keycode 27 = Control_bracketright + alt keycode 27 = Meta_bracketright +diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/ru2.map kbd-1.12/data/keymaps/i386/qwerty/ru2.map +--- kbd-1.12.orig/data/keymaps/i386/qwerty/ru2.map 2002-10-13 06:05:47.000000000 +0600 ++++ kbd-1.12/data/keymaps/i386/qwerty/ru2.map 2005-05-16 19:56:52.000000000 +0600 +@@ -46,7 +46,7 @@ + alt keycode 12 = Meta_minus + keycode 13 = equal plus equal plus + alt keycode 13 = Meta_equal +- keycode 14 = BackSpace BackSpace BackSpace BackSpace ++ keycode 14 = Delete Delete Delete Delete + alt keycode 14 = Meta_Delete + keycode 15 = Tab Tab Tab Tab + alt keycode 15 = Meta_Tab +diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/se-ir209.map kbd-1.12/data/keymaps/i386/qwerty/se-ir209.map +--- kbd-1.12.orig/data/keymaps/i386/qwerty/se-ir209.map 2002-10-13 06:12:48.000000000 +0600 ++++ kbd-1.12/data/keymaps/i386/qwerty/se-ir209.map 2005-05-16 19:54:48.000000000 +0600 +@@ -345,7 +345,7 @@ + keycode 109 = Next Scroll_Forward + keycode 110 = Insert + +- keycode 111 = Delete # "Remove" originally, weird... ++ keycode 111 = Remove + control alt keycode 111 = Boot + control altgr keycode 111 = Boot + +diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/se-lat6.map kbd-1.12/data/keymaps/i386/qwerty/se-lat6.map +--- kbd-1.12.orig/data/keymaps/i386/qwerty/se-lat6.map 2002-10-13 06:13:01.000000000 +0600 ++++ kbd-1.12/data/keymaps/i386/qwerty/se-lat6.map 2005-05-16 19:54:48.000000000 +0600 +@@ -374,6 +374,6 @@ + keycode 109 = Next Scroll_Forward + keycode 110 = Insert + +- keycode 111 = Delete # "Remove" originally, weird... ++ keycode 111 = Remove + control alt keycode 111 = Boot + control altgr keycode 111 = Boot +diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/tr_q-latin5.map kbd-1.12/data/keymaps/i386/qwerty/tr_q-latin5.map +--- kbd-1.12.orig/data/keymaps/i386/qwerty/tr_q-latin5.map 2002-10-11 17:08:49.000000000 +0600 ++++ kbd-1.12/data/keymaps/i386/qwerty/tr_q-latin5.map 2005-05-16 19:54:48.000000000 +0600 +@@ -49,7 +49,7 @@ + alt keycode 12 = Meta_minus + keycode 13 = minus underscore + alt keycode 13 = Meta_equal +-keycode 14 = BackSpace Delete ++keycode 14 = Delete Delete + alt keycode 14 = Meta_Delete + keycode 15 = Tab Tab + alt keycode 15 = Meta_Tab +diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/ua-utf-ws.map kbd-1.12/data/keymaps/i386/qwerty/ua-utf-ws.map +--- kbd-1.12.orig/data/keymaps/i386/qwerty/ua-utf-ws.map 2002-10-13 06:07:56.000000000 +0600 ++++ kbd-1.12/data/keymaps/i386/qwerty/ua-utf-ws.map 2005-05-16 19:54:48.000000000 +0600 +@@ -260,7 +260,7 @@ + shift ctrll ctrlr keycode 13 = plus + alt ctrll ctrlr keycode 13 = Meta_equal + shift alt ctrll ctrlr keycode 13 = Meta_plus +-keycode 14 = BackSpace Delete ++keycode 14 = Delete Delete + control keycode 14 = BackSpace + alt keycode 14 = Meta_Delete + ctrlr keycode 14 = BackSpace +diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/ua-utf.map kbd-1.12/data/keymaps/i386/qwerty/ua-utf.map +--- kbd-1.12.orig/data/keymaps/i386/qwerty/ua-utf.map 2002-10-13 06:08:07.000000000 +0600 ++++ kbd-1.12/data/keymaps/i386/qwerty/ua-utf.map 2005-05-16 19:54:48.000000000 +0600 +@@ -250,7 +250,7 @@ + shift ctrll ctrlr keycode 13 = plus + alt ctrll ctrlr keycode 13 = Meta_equal + shift alt ctrll ctrlr keycode 13 = Meta_plus +-keycode 14 = BackSpace Delete ++keycode 14 = Delete Delete + control keycode 14 = BackSpace + alt keycode 14 = Meta_Delete + ctrlr keycode 14 = BackSpace +diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/ua-ws.map kbd-1.12/data/keymaps/i386/qwerty/ua-ws.map +--- kbd-1.12.orig/data/keymaps/i386/qwerty/ua-ws.map 2002-10-13 06:08:19.000000000 +0600 ++++ kbd-1.12/data/keymaps/i386/qwerty/ua-ws.map 2005-05-16 19:54:48.000000000 +0600 +@@ -260,7 +260,7 @@ + shift ctrll ctrlr keycode 13 = plus + alt ctrll ctrlr keycode 13 = Meta_equal + shift alt ctrll ctrlr keycode 13 = Meta_plus +-keycode 14 = BackSpace Delete ++keycode 14 = Delete Delete + control keycode 14 = BackSpace + alt keycode 14 = Meta_Delete + ctrlr keycode 14 = BackSpace +diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/ua.map kbd-1.12/data/keymaps/i386/qwerty/ua.map +--- kbd-1.12.orig/data/keymaps/i386/qwerty/ua.map 2002-10-13 06:08:31.000000000 +0600 ++++ kbd-1.12/data/keymaps/i386/qwerty/ua.map 2005-05-16 19:54:48.000000000 +0600 +@@ -249,7 +249,7 @@ + shift ctrll ctrlr keycode 13 = plus + alt ctrll ctrlr keycode 13 = Meta_equal + shift alt ctrll ctrlr keycode 13 = Meta_plus +-keycode 14 = BackSpace Delete ++keycode 14 = Delete Delete + control keycode 14 = BackSpace + alt keycode 14 = Meta_Delete + ctrlr keycode 14 = BackSpace diff --git a/base-source/kbd-1.12-gcc4_fixes-1.patch b/base-source/kbd-1.12-gcc4_fixes-1.patch new file mode 100644 index 0000000..ce1d429 --- /dev/null +++ b/base-source/kbd-1.12-gcc4_fixes-1.patch @@ -0,0 +1,54 @@ +Submitted By: Matthew Burgess +Date: 2005-07-28 +Initial Package Version: 1.12 +Upstream Status: Unknown +Origin: http://cvs.fedora.redhat.com/viewcvs/devel/kbd/kbd-1.12-alias.patch?rev=1.2&view=markup +Description: Fix violations of C aliasing rules, triggered by gcc4. + +diff -Naur kbd-1.12.orig/src/psffontop.c kbd-1.12/src/psffontop.c +--- kbd-1.12.orig/src/psffontop.c 2004-01-16 19:45:31.000000000 +0000 ++++ kbd-1.12/src/psffontop.c 2005-07-28 20:33:57.946088984 +0000 +@@ -59,7 +59,6 @@ + + static unsigned int + assemble_ucs2(char **inptr, int cnt) { +- unsigned char **in = (unsigned char **) inptr; + unsigned int u1, u2; + + if (cnt < 2) { +@@ -68,8 +67,8 @@ + exit(EX_DATAERR); + } + +- u1 = *(*in)++; +- u2 = *(*in)++; ++ u1 = (unsigned char)*(*inptr)++; ++ u2 = (unsigned char)*(*inptr)++; + return (u1 | (u2 << 8)); + } + +@@ -110,7 +109,6 @@ + */ + static void + get_uni_entry(char **inptr, char **endptr, struct unicode_list *up, int utf8) { +- unsigned char **in = (unsigned char **) inptr; + unsigned char uc; + unicode unichar; + int inseq = 0; +@@ -126,14 +124,14 @@ + exit(EX_DATAERR); + } + if (utf8) { +- uc = *(*in)++; ++ uc = *(*inptr)++; + if (uc == PSF2_SEPARATOR) + break; + if (uc == PSF2_STARTSEQ) { + inseq = 1; + continue; + } +- --(*in); ++ --(*inptr); + unichar = assemble_utf8(inptr, *endptr - *inptr); + } else { + unichar = assemble_ucs2(inptr, *endptr - *inptr); diff --git a/base-source/kbd-1.12.tar.bz2 b/base-source/kbd-1.12.tar.bz2 new file mode 100644 index 0000000..2359438 Binary files /dev/null and b/base-source/kbd-1.12.tar.bz2 differ diff --git a/base-source/less-394.tar.gz b/base-source/less-394.tar.gz new file mode 100644 index 0000000..da2a9ca Binary files /dev/null and b/base-source/less-394.tar.gz differ diff --git a/base-source/lfs-bootscripts-20060417.tar.bz2 b/base-source/lfs-bootscripts-20060417.tar.bz2 new file mode 100644 index 0000000..7087ec2 Binary files /dev/null and b/base-source/lfs-bootscripts-20060417.tar.bz2 differ diff --git a/base-source/libpcap-0.9.5.tar.gz b/base-source/libpcap-0.9.5.tar.gz new file mode 100644 index 0000000..0d8a47c Binary files /dev/null and b/base-source/libpcap-0.9.5.tar.gz differ diff --git a/base-source/libtool-1.5.22.tar.gz b/base-source/libtool-1.5.22.tar.gz new file mode 100644 index 0000000..ab55b49 Binary files /dev/null and b/base-source/libtool-1.5.22.tar.gz differ diff --git a/base-source/libusb-0.1.12(2).tar.gz b/base-source/libusb-0.1.12(2).tar.gz new file mode 100644 index 0000000..305dddd Binary files /dev/null and b/base-source/libusb-0.1.12(2).tar.gz differ diff --git a/base-source/libusb-0.1.12.tar.gz b/base-source/libusb-0.1.12.tar.gz new file mode 100644 index 0000000..305dddd Binary files /dev/null and b/base-source/libusb-0.1.12.tar.gz differ diff --git a/base-source/linux-2.6.16.19-utf8_input-1.patch b/base-source/linux-2.6.16.19-utf8_input-1.patch new file mode 100644 index 0000000..fe94285 --- /dev/null +++ b/base-source/linux-2.6.16.19-utf8_input-1.patch @@ -0,0 +1,380 @@ +Submitted by: Alexander E. Patrakov +Signed-off-by: Alexander E. Patrakov +Date: 2005-10-18 +Initial Package Version: 2.6.15 +Upstream Status: Rejected: they say it modifies the meaning of an existing ioctl +Origin: http://chris.heathens.co.nz/linux/downloads/patches-2.6.4-cdh1.tar.gz + Porting to linux-2.6.16 by Alexander E. Patrakov +Description: This patch fixes dead keys and copy/paste of non-ASCII characters + in UTF-8 mode on Linux console. + See more details about the original patch at: + http://chris.heathens.co.nz/linux/utf8.html + +diff -ur linux-2.6.15-rc6.orig/drivers/char/consolemap.c linux-2.6.15-rc6.my/drivers/char/consolemap.c +--- linux-2.6.15-rc6.orig/drivers/char/consolemap.c 2005-12-25 10:00:12.000000000 +0500 ++++ linux-2.6.15-rc6.my/drivers/char/consolemap.c 2005-12-25 10:01:22.000000000 +0500 +@@ -178,6 +178,7 @@ + unsigned long refcount; + unsigned long sum; + unsigned char *inverse_translations[4]; ++ u16 *inverse_trans_unicode; + int readonly; + }; + +@@ -208,6 +209,41 @@ + } + } + ++static void set_inverse_trans_unicode(struct vc_data *conp, ++ struct uni_pagedir *p) ++{ ++ int i, j, k, glyph; ++ u16 **p1, *p2; ++ u16 *q; ++ ++ if (!p) return; ++ q = p->inverse_trans_unicode; ++ if (!q) { ++ q = p->inverse_trans_unicode = ++ kmalloc(MAX_GLYPH * sizeof(u16), GFP_KERNEL); ++ if (!q) ++ return; ++ } ++ memset(q, 0, MAX_GLYPH * sizeof(u16)); ++ ++ for (i = 0; i < 32; i++) { ++ p1 = p->uni_pgdir[i]; ++ if (!p1) ++ continue; ++ for (j = 0; j < 32; j++) { ++ p2 = p1[j]; ++ if (!p2) ++ continue; ++ for (k = 0; k < 64; k++) { ++ glyph = p2[k]; ++ if (glyph >= 0 && glyph < MAX_GLYPH ++ && q[glyph] < 32) ++ q[glyph] = (i << 11) + (j << 6) + k; ++ } ++ } ++ } ++} ++ + unsigned short *set_translate(int m, struct vc_data *vc) + { + inv_translate[vc->vc_num] = m; +@@ -218,19 +254,29 @@ + * Inverse translation is impossible for several reasons: + * 1. The font<->character maps are not 1-1. + * 2. The text may have been written while a different translation map +- * was active, or using Unicode. ++ * was active. + * Still, it is now possible to a certain extent to cut and paste non-ASCII. + */ +-unsigned char inverse_translate(struct vc_data *conp, int glyph) ++u16 inverse_translate(struct vc_data *conp, int glyph, int use_unicode) + { + struct uni_pagedir *p; ++ int m; + if (glyph < 0 || glyph >= MAX_GLYPH) + return 0; +- else if (!(p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc) || +- !p->inverse_translations[inv_translate[conp->vc_num]]) ++ else if (!(p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc)) + return glyph; +- else +- return p->inverse_translations[inv_translate[conp->vc_num]][glyph]; ++ else if (use_unicode) { ++ if (!p->inverse_trans_unicode) ++ return glyph; ++ else ++ return p->inverse_trans_unicode[glyph]; ++ } else { ++ m = inv_translate[conp->vc_num]; ++ if (!p->inverse_translations[m]) ++ return glyph; ++ else ++ return p->inverse_translations[m][glyph]; ++ } + } + + static void update_user_maps(void) +@@ -244,6 +290,7 @@ + p = (struct uni_pagedir *)*vc_cons[i].d->vc_uni_pagedir_loc; + if (p && p != q) { + set_inverse_transl(vc_cons[i].d, p, USER_MAP); ++ set_inverse_trans_unicode(vc_cons[i].d, p); + q = p; + } + } +@@ -354,6 +401,10 @@ + kfree(p->inverse_translations[i]); + p->inverse_translations[i] = NULL; + } ++ if (p->inverse_trans_unicode) { ++ kfree(p->inverse_trans_unicode); ++ p->inverse_trans_unicode = NULL; ++ } + } + + void con_free_unimap(struct vc_data *vc) +@@ -512,6 +563,7 @@ + + for (i = 0; i <= 3; i++) + set_inverse_transl(vc, p, i); /* Update all inverse translations */ ++ set_inverse_trans_unicode(vc, p); + + return err; + } +@@ -562,6 +614,7 @@ + + for (i = 0; i <= 3; i++) + set_inverse_transl(vc, p, i); /* Update all inverse translations */ ++ set_inverse_trans_unicode(vc, p); + dflt = p; + return err; + } +@@ -618,6 +671,19 @@ + p->readonly = rdonly; + } + ++/* may be called during an interrupt */ ++u32 conv_8bit_to_uni(unsigned char c) ++{ ++ /* ++ * Always use USER_MAP. This function is used by the keyboard, ++ * which shouldn't be affected by G0/G1 switching, etc. ++ * If the user map still contains default values, i.e. the ++ * direct-to-font mapping, then assume user is using Latin1. ++ */ ++ unsigned short uni = translations[USER_MAP][c]; ++ return uni == (0xf000 | c) ? c : uni; ++} ++ + int + conv_uni_to_pc(struct vc_data *conp, long ucs) + { +diff -ur linux-2.6.15-rc6.orig/drivers/char/keyboard.c linux-2.6.15-rc6.my/drivers/char/keyboard.c +--- linux-2.6.15-rc6.orig/drivers/char/keyboard.c 2005-12-25 10:00:12.000000000 +0500 ++++ linux-2.6.15-rc6.my/drivers/char/keyboard.c 2005-12-25 10:01:22.000000000 +0500 +@@ -34,6 +34,7 @@ + #include + #include + ++#include + #include + #include + #include +@@ -329,10 +330,9 @@ + * Many other routines do put_queue, but I think either + * they produce ASCII, or they produce some user-assigned + * string, and in both cases we might assume that it is +- * in utf-8 already. UTF-8 is defined for words of up to 31 bits, +- * but we need only 16 bits here ++ * in utf-8 already. + */ +-static void to_utf8(struct vc_data *vc, ushort c) ++static void to_utf8(struct vc_data *vc, uint c) + { + if (c < 0x80) + /* 0******* */ +@@ -341,14 +341,33 @@ + /* 110***** 10****** */ + put_queue(vc, 0xc0 | (c >> 6)); + put_queue(vc, 0x80 | (c & 0x3f)); +- } else { ++ } else if (c < 0x10000) { ++ if (c >= 0xD800 && c < 0xE000) ++ return; ++ if (c == 0xFFFF) ++ return; + /* 1110**** 10****** 10****** */ + put_queue(vc, 0xe0 | (c >> 12)); + put_queue(vc, 0x80 | ((c >> 6) & 0x3f)); + put_queue(vc, 0x80 | (c & 0x3f)); ++ } else if (c < 0x110000) { ++ /* 11110*** 10****** 10****** 10****** */ ++ put_queue(vc, 0xf0 | (c >> 18)); ++ put_queue(vc, 0x80 | ((c >> 12) & 0x3f)); ++ put_queue(vc, 0x80 | ((c >> 6) & 0x3f)); ++ put_queue(vc, 0x80 | (c & 0x3f)); + } + } + ++static void put_8bit(struct vc_data *vc, u8 c) ++{ ++ if (kbd->kbdmode != VC_UNICODE || c < 32 || c == 127) ++ /* Don't translate control chars */ ++ put_queue(vc, c); ++ else ++ to_utf8(vc, conv_8bit_to_uni(c)); ++} ++ + /* + * Called after returning from RAW mode or when changing consoles - recompute + * shift_down[] and shift_state from key_down[] maybe called when keymap is +@@ -409,7 +428,7 @@ + if (ch == ' ' || ch == d) + return d; + +- put_queue(vc, d); ++ put_8bit(vc, d); + return ch; + } + +@@ -419,7 +438,7 @@ + static void fn_enter(struct vc_data *vc, struct pt_regs *regs) + { + if (diacr) { +- put_queue(vc, diacr); ++ put_8bit(vc, diacr); + diacr = 0; + } + put_queue(vc, 13); +@@ -628,7 +647,7 @@ + diacr = value; + return; + } +- put_queue(vc, value); ++ put_8bit(vc, value); + } + + /* +@@ -774,7 +793,7 @@ + /* kludge */ + if (up_flag && shift_state != old_state && npadch != -1) { + if (kbd->kbdmode == VC_UNICODE) +- to_utf8(vc, npadch & 0xffff); ++ to_utf8(vc, npadch); + else + put_queue(vc, npadch & 0xff); + npadch = -1; +diff -ur linux-2.6.15-rc6.orig/drivers/char/selection.c linux-2.6.15-rc6.my/drivers/char/selection.c +--- linux-2.6.15-rc6.orig/drivers/char/selection.c 2005-12-25 10:00:12.000000000 +0500 ++++ linux-2.6.15-rc6.my/drivers/char/selection.c 2005-12-25 10:01:22.000000000 +0500 +@@ -20,6 +20,7 @@ + + #include + ++#include + #include + #include + #include +@@ -34,6 +35,7 @@ + /* Variables for selection control. */ + /* Use a dynamic buffer, instead of static (Dec 1994) */ + struct vc_data *sel_cons; /* must not be disallocated */ ++static int use_unicode; + static volatile int sel_start = -1; /* cleared by clear_selection */ + static int sel_end; + static int sel_buffer_lth; +@@ -54,10 +56,11 @@ + complement_pos(sel_cons, where); + } + +-static unsigned char ++static u16 + sel_pos(int n) + { +- return inverse_translate(sel_cons, screen_glyph(sel_cons, n)); ++ return inverse_translate(sel_cons, screen_glyph(sel_cons, n), ++ use_unicode); + } + + /* remove the current selection highlight, if any, +@@ -86,8 +89,8 @@ + 0xFF7FFFFF /* latin-1 accented letters, not division sign */ + }; + +-static inline int inword(const unsigned char c) { +- return ( inwordLut[c>>5] >> (c & 0x1F) ) & 1; ++static inline int inword(const u16 c) { ++ return c > 0xff || (( inwordLut[c>>5] >> (c & 0x1F) ) & 1); + } + + /* set inwordLut contents. Invoked by ioctl(). */ +@@ -108,13 +111,36 @@ + return (v > u) ? u : v; + } + ++/* stores the char in UTF8 and returns the number of bytes used (1-3) */ ++int store_utf8(u16 c, char *p) ++{ ++ if (c < 0x80) { ++ /* 0******* */ ++ p[0] = c; ++ return 1; ++ } else if (c < 0x800) { ++ /* 110***** 10****** */ ++ p[0] = 0xc0 | (c >> 6); ++ p[1] = 0x80 | (c & 0x3f); ++ return 2; ++ } else { ++ /* 1110**** 10****** 10****** */ ++ p[0] = 0xe0 | (c >> 12); ++ p[1] = 0x80 | ((c >> 6) & 0x3f); ++ p[2] = 0x80 | (c & 0x3f); ++ return 3; ++ } ++} ++ + /* set the current selection. Invoked by ioctl() or by kernel code. */ + int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *tty) + { + struct vc_data *vc = vc_cons[fg_console].d; + int sel_mode, new_sel_start, new_sel_end, spc; + char *bp, *obp; +- int i, ps, pe; ++ int i, ps, pe, multiplier; ++ u16 c; ++ struct kbd_struct *kbd = kbd_table + fg_console; + + poke_blanked_console(); + +@@ -158,7 +184,8 @@ + clear_selection(); + sel_cons = vc_cons[fg_console].d; + } +- ++ use_unicode = kbd && kbd->kbdmode == VC_UNICODE; ++ + switch (sel_mode) + { + case TIOCL_SELCHAR: /* character-by-character selection */ +@@ -240,7 +267,8 @@ + sel_end = new_sel_end; + + /* Allocate a new buffer before freeing the old one ... */ +- bp = kmalloc((sel_end-sel_start)/2+1, GFP_KERNEL); ++ multiplier = use_unicode ? 3 : 1; /* chars can take up to 3 bytes */ ++ bp = kmalloc((sel_end-sel_start)/2*multiplier+1, GFP_KERNEL); + if (!bp) { + printk(KERN_WARNING "selection: kmalloc() failed\n"); + clear_selection(); +@@ -251,8 +279,12 @@ + + obp = bp; + for (i = sel_start; i <= sel_end; i += 2) { +- *bp = sel_pos(i); +- if (!isspace(*bp++)) ++ c = sel_pos(i); ++ if (use_unicode) ++ bp += store_utf8(c, bp); ++ else ++ *bp++ = c; ++ if (!isspace(c)) + obp = bp; + if (! ((i + 2) % vc->vc_size_row)) { + /* strip trailing blanks from line and add newline, +diff -ur linux-2.6.15-rc6.orig/include/linux/consolemap.h linux-2.6.15-rc6.my/include/linux/consolemap.h +--- linux-2.6.15-rc6.orig/include/linux/consolemap.h 2005-12-25 10:00:13.000000000 +0500 ++++ linux-2.6.15-rc6.my/include/linux/consolemap.h 2005-12-25 10:01:22.000000000 +0500 +@@ -10,6 +10,7 @@ + + struct vc_data; + +-extern unsigned char inverse_translate(struct vc_data *conp, int glyph); ++extern u16 inverse_translate(struct vc_data *conp, int glyph, int use_unicode); + extern unsigned short *set_translate(int m, struct vc_data *vc); + extern int conv_uni_to_pc(struct vc_data *conp, long ucs); ++extern u32 conv_8bit_to_uni(unsigned char c); diff --git a/base-source/linux-2.6.16.19.tar.bz2 b/base-source/linux-2.6.16.19.tar.bz2 new file mode 100644 index 0000000..1a4c4c0 Binary files /dev/null and b/base-source/linux-2.6.16.19.tar.bz2 differ diff --git a/base-source/linux-libc-headers-2.6.12.0.tar.bz2 b/base-source/linux-libc-headers-2.6.12.0.tar.bz2 new file mode 100644 index 0000000..89ef056 Binary files /dev/null and b/base-source/linux-libc-headers-2.6.12.0.tar.bz2 differ diff --git a/base-source/lsof_4.77.tar.gz b/base-source/lsof_4.77.tar.gz new file mode 100644 index 0000000..48d8f38 Binary files /dev/null and b/base-source/lsof_4.77.tar.gz differ diff --git a/base-source/m4-1.4.4.tar.gz b/base-source/m4-1.4.4.tar.gz new file mode 100644 index 0000000..8b0e6bf Binary files /dev/null and b/base-source/m4-1.4.4.tar.gz differ diff --git a/base-source/make-3.80.tar.bz2 b/base-source/make-3.80.tar.bz2 new file mode 100644 index 0000000..5a09119 Binary files /dev/null and b/base-source/make-3.80.tar.bz2 differ diff --git a/base-source/man-db-2.4.3.tar.gz b/base-source/man-db-2.4.3.tar.gz new file mode 100644 index 0000000..18cca56 Binary files /dev/null and b/base-source/man-db-2.4.3.tar.gz differ diff --git a/base-source/man-pages-2.33.tar.bz2 b/base-source/man-pages-2.33.tar.bz2 new file mode 100644 index 0000000..c476ce8 Binary files /dev/null and b/base-source/man-pages-2.33.tar.bz2 differ diff --git a/base-source/mktemp-1.5-add_tempfile-3.patch b/base-source/mktemp-1.5-add_tempfile-3.patch new file mode 100644 index 0000000..bf6dfbe --- /dev/null +++ b/base-source/mktemp-1.5-add_tempfile-3.patch @@ -0,0 +1,111 @@ +Submitted By: Tushar Teredesai +Date: 2005-07-25 +Initial Package Version: 1.5 +Upstream Status: Sent, no response yet. +Origin: http://archive.linuxfromscratch.org/mail-archives/lfs-dev/2003-April/033602.html + http://archive.linuxfromscratch.org/mail-archives/lfs-dev/2003-June/035234.html + http://linuxfromscratch.org/pipermail/lfs-dev/2005-June/051908.html +Description: Add tempfile wrapper script. Use "make install-tempfile" to install it. + +diff -Naur mktemp-1.5.orig/Makefile.in mktemp-1.5/Makefile.in +--- mktemp-1.5.orig/Makefile.in 2003-03-23 18:09:56.000000000 -0700 ++++ mktemp-1.5/Makefile.in 2005-07-25 11:11:11.000000000 -0600 +@@ -113,6 +113,9 @@ + install-man: + $(INSTALL) -m 0444 $(srcdir)/$(PROG).$(mantype) $(mandir)/man1/$(PROG).1 + ++install-tempfile: $(srcdir)/tempfile ++ $(INSTALL) -m 0555 $(srcdir)/tempfile $(bindir)/tempfile ++ + check: + @echo nothing to check + +diff -Naur mktemp-1.5.orig/tempfile mktemp-1.5/tempfile +--- mktemp-1.5.orig/tempfile 1969-12-31 17:00:00.000000000 -0700 ++++ mktemp-1.5/tempfile 2005-07-25 11:13:41.000000000 -0600 +@@ -0,0 +1,85 @@ ++#!/bin/bash ++# A tempfile wrapper for mktemp ++# Note: If you can, avoid using tempfile and use mktemp instead. ++# This wrapper is provided for compatibility since some scripts use ++# tempfile. If possible, the best solution is to patch the scripts ++# to use mktemp. ++# ++# Copyright (c) Tushar Teredesai ++# ++# Permission to use, copy, modify, and distribute this software for any ++# purpose with or without fee is hereby granted, provided that the above ++# copyright notice and this permission notice appear in all copies. ++# ++# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES ++# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ++# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ++# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ++# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ++# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ++# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++# ++ ++# Usage info ++usage() ++{ ++ echo "Usage: tempfile [OPTION]" ++ echo ++ echo "Create a temporary file in a safe manner." ++ echo "This version is a wrapper that invokes mktemp." ++ echo "NOTE: Do not use tempfile in your scripts." ++ echo " Use mktemp instead." ++ echo ++ echo "[-d|--directory] DIR -> place temporary file in DIR" ++ echo "[-p|--prefix] PREFIX -> ignored" ++ echo "[-s|--suffix] SUFFIX -> ignored" ++ echo "[-n|--name] NAME -> ignored" ++ echo "[-m|--mode] MODE -> ignored" ++ echo "--version -> output version information and exit" ++} ++ ++# parse all arguments ++while [ $# != 0 ] ++do ++ case "$1" in ++ # -d for tempfile is equivalent to -p for mktemp ++ -d|--directory) ++ dir="$2" ++ shift 2 ++ ;; ++ --directory=*) ++ dir="${1#--directory=}" ++ shift 1 ++ ;; ++ -d*) ++ dir="${1#-d}" ++ shift 1 ++ ;; ++ # The following switches are ignored. ++ -p|--prefix|-s|--suffix|-n|--name|-m|--mode) ++ shift 2 ++ ;; ++ -p*|--prefix=*|-s*|--suffix=*|-n*|--name=*|-m*|--mode=*) ++ shift 1 ++ ;; ++ # --version for tempfile is equivalent to -V for mktemp ++ --version) ++ echo "tempfile 1.0 (`mktemp -V 2>/dev/null`)" ++ exit 0 ++ ;; ++ # Unknown switch ++ *) ++ usage ++ exit 1 ++ ;; ++ esac ++done ++ ++# Use the dir if $TMPDIR is not set. ++if [ -z "$TMPDIR" -a ! -z "$dir" ] ++then ++ export TMPDIR="$dir" ++fi ++# Execute mktemp with proper arguments ++# the -t behaviour of mktemp is the default for tempfile ++exec mktemp -t diff --git a/base-source/mktemp-1.5.tar.gz b/base-source/mktemp-1.5.tar.gz new file mode 100644 index 0000000..5227513 Binary files /dev/null and b/base-source/mktemp-1.5.tar.gz differ diff --git a/base-source/module-init-tools-3.2.2.tar.bz2 b/base-source/module-init-tools-3.2.2.tar.bz2 new file mode 100644 index 0000000..3fddf7b Binary files /dev/null and b/base-source/module-init-tools-3.2.2.tar.bz2 differ diff --git a/base-source/nasm-0.98.39.tar.bz2 b/base-source/nasm-0.98.39.tar.bz2 new file mode 100644 index 0000000..9b50251 Binary files /dev/null and b/base-source/nasm-0.98.39.tar.bz2 differ diff --git a/base-source/ncurses-5.5-fixes-1.patch b/base-source/ncurses-5.5-fixes-1.patch new file mode 100644 index 0000000..73e084d --- /dev/null +++ b/base-source/ncurses-5.5-fixes-1.patch @@ -0,0 +1,225 @@ +Submitted by: Alexander E. Patrakov +Date: 2005-12-07 +Initial Package Version: 5.5 +Upstream Status: Backport +Origin: Cherry-picked from ftp://invisible-island.net/ncurses/5.5/*.gz +Description: Fixes the following bugs: + +* memory leak in keyname() +* mishandling of overlapped wide characters, http://bugs.debian.org/316663 +* problems with line-drawing characters on cygwin, http://bugs.debian.org/338234 +* mishandling of EINTR in tcgetattr/tcsetattr, http://bugs.debian.org/339518 +* mishandling of single-column multibyte characters, http://bugs.debian.org/341661 + +--- ncurses-5.5-20051015+/ncurses/base/MKkeyname.awk 2005-04-30 19:26:25.000000000 +0000 ++++ ncurses-5.5-20051022/ncurses/base/MKkeyname.awk 2005-10-22 19:01:23.000000000 +0000 +@@ -97,6 +97,7 @@ + print " break;" + print " }" + print " }" ++ print " free(bound);" + print " if (result != 0)" + print " break;" + print " }" +--- ncurses-5.5-20051022+/ncurses/base/lib_addch.c 2005-03-27 16:52:16.000000000 +0000 ++++ ncurses-5.5-20051029/ncurses/base/lib_addch.c 2005-10-30 00:51:36.000000000 +0000 +@@ -315,7 +315,7 @@ + * setup though. + */ + for (i = 0; i < len; ++i) { +- if (isWidecBase(win->_line[y].text[i])) { ++ if (isWidecBase(win->_line[y].text[x + i])) { + break; + } else if (isWidecExt(win->_line[y].text[x + i])) { + for (j = i; x + j <= win->_maxx; ++j) { +@@ -334,7 +334,9 @@ + for (i = 0; i < len; ++i) { + NCURSES_CH_T value = ch; + SetWidecExt(value, i); +- TR(TRACE_VIRTPUT, ("multicolumn %d:%d", i + 1, len)); ++ TR(TRACE_VIRTPUT, ("multicolumn %d:%d (%d,%d)", ++ i + 1, len, ++ win->_begy + y, win->_begx + x)); + line->text[x] = value; + CHANGED_CELL(line, x); + ++x; +--- ncurses-5.5-20051022+/ncurses/base/lib_bkgd.c 2005-04-16 18:03:48.000000000 +0000 ++++ ncurses-5.5-20051029/ncurses/base/lib_bkgd.c 2005-10-30 00:41:09.000000000 +0000 +@@ -131,11 +131,11 @@ + + for (y = 0; y <= win->_maxy; y++) { + for (x = 0; x <= win->_maxx; x++) { +- if (CharEq(win->_line[y].text[x], old_bkgrnd)) ++ if (CharEq(win->_line[y].text[x], old_bkgrnd)) { + win->_line[y].text[x] = win->_nc_bkgd; +- else { ++ } else { + NCURSES_CH_T wch = win->_line[y].text[x]; +- RemAttr(wch, (~A_ALTCHARSET)); ++ RemAttr(wch, (~(A_ALTCHARSET | A_CHARTEXT))); + win->_line[y].text[x] = _nc_render(win, wch); + } + } +--- ncurses-5.5-20051022+/ncurses/base/lib_erase.c 2001-12-19 01:06:13.000000000 +0000 ++++ ncurses-5.5-20051029/ncurses/base/lib_erase.c 2005-10-30 00:36:36.000000000 +0000 +@@ -58,6 +59,24 @@ + start = win->_line[y].text; + end = &start[win->_maxx]; + ++ /* ++ * If this is a derived window, we have to handle the case where ++ * a multicolumn character extends into the window that we are ++ * erasing. ++ */ ++ if_WIDEC({ ++ if (isWidecExt(start[0])) { ++ int x = (win->_parent != 0) ? (win->_begx) : 0; ++ while (x-- > 0) { ++ if (isWidecBase(start[-1])) { ++ --start; ++ break; ++ } ++ --start; ++ } ++ } ++ }); ++ + for (sp = start; sp <= end; sp++) + *sp = blank; + +--- ncurses-5.5-20051029+/misc/terminfo.src 2005-10-26 23:21:06.000000000 +0000 ++++ ncurses-5.5-20051112/misc/terminfo.src 2005-11-12 23:01:03.000000000 +0000 +@@ -4731,32 +4731,35 @@ + # civis [make cursor invisible] causes everything to stackdump? \E[?25l\E[?1c + # ech [erase characters param] broken \E[%p1%dX + # kcbt [back-tab key] not implemented in cygwin? \E[Z ++# ++# 2005/11/12 -TD ++# Remove cbt since it does not work in current cygwin ++# Add 'mir' and 'in' flags based on tack + cygwin|ansi emulation for Cygwin, +- am, hs, in, msgr, xon, ++ am, hs, mir, msgr, xon, + colors#8, it#8, pairs#64, + acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, +- bel=^G, bold=\E[1m, cbt=\E[Z, clear=\E[H\E[J, cr=^M, +- cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=\E[B, +- cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, +- cuu=\E[%p1%dA, cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P, +- dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K, fsl=^G, +- home=\E[H, hpa=\E[%i%p1%dG, ht=^I, ich=\E[%p1%d@, +- ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m, +- kb2=\E[G, kbs=^H, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, +- kcuu1=\E[A, kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, +- kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, +- kf14=\E[26~, kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, +- kf18=\E[32~, kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, +- kf3=\E[[C, kf4=\E[[D, kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, +- kf8=\E[19~, kf9=\E[20~, khome=\E[1~, kich1=\E[2~, +- knp=\E[6~, kpp=\E[5~, kspd=^Z, nel=^M^J, op=\E[39;49m, +- rc=\E8, rev=\E[7m, ri=\EM, rmacs=\E[10m, +- rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmpch=\E[10m, +- rmso=\E[27m, rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, +- setab=\E[4%p1%dm, setaf=\E[3%p1%dm, ++ bel=^G, bold=\E[1m, clear=\E[H\E[J, cr=^M, cub=\E[%p1%dD, ++ cub1=^H, cud=\E[%p1%dB, cud1=\E[B, cuf=\E[%p1%dC, ++ cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, ++ cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, ++ dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K, fsl=^G, home=\E[H, ++ hpa=\E[%i%p1%dG, ht=^I, ich=\E[%p1%d@, ich1=\E[@, ++ il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G, ++ kbs=^H, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, ++ kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, ++ kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, ++ kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, ++ kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, ++ kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, ++ khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z, ++ nel=^M^J, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, ++ rmacs=\E[10m, rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, ++ rmpch=\E[10m, rmso=\E[27m, rmul=\E[24m, rs1=\Ec\E]R, ++ sc=\E7, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, + sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, +- sgr0=\E[0;10m, smacs=\E11m, smcup=\E7\E[?47h, smir=\E[4h, +- smpch=\E[11m, smso=\E[7m, smul=\E[4m, tsl=\E];, ++ sgr0=\E[0;10m, smacs=\E[11m, smcup=\E7\E[?47h, ++ smir=\E[4h, smpch=\E[11m, smso=\E[7m, smul=\E[4m, tsl=\E];, + u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?6c, u9=\E[c, + vpa=\E[%i%p1%dd, + +--- ncurses-5.5-20051112+/ncurses/tinfo/lib_ttyflags.c 2003-05-17 23:50:37.000000000 +0000 ++++ ncurses-5.5-20051119/ncurses/tinfo/lib_ttyflags.c 2005-11-19 20:36:23.000000000 +0000 +@@ -59,28 +59,51 @@ + NCURSES_EXPORT(int) + _nc_get_tty_mode(TTY * buf) + { +- if (cur_term == 0 +- || GET_TTY(cur_term->Filedes, buf) != 0) { +- memset(buf, 0, sizeof(*buf)); +- return (ERR); ++ int result = OK; ++ ++ if (cur_term == 0) { ++ result = ERR; ++ } else { ++ for (;;) { ++ if (GET_TTY(cur_term->Filedes, buf) != 0) { ++ if (errno == EINTR) ++ continue; ++ result = ERR; ++ } ++ break; ++ } + } ++ ++ if (result == ERR) ++ memset(buf, 0, sizeof(*buf)); ++ + TR(TRACE_BITS, ("_nc_get_tty_mode(%d): %s", + cur_term->Filedes, _nc_trace_ttymode(buf))); +- return (OK); ++ return (result); + } + + NCURSES_EXPORT(int) + _nc_set_tty_mode(TTY * buf) + { +- if (cur_term == 0 +- || SET_TTY(cur_term->Filedes, buf) != 0) { +- if ((errno == ENOTTY) && (SP != 0)) +- SP->_notty = TRUE; +- return (ERR); ++ int result = OK; ++ ++ if (cur_term == 0) { ++ result = ERR; ++ } else { ++ for (;;) { ++ if (SET_TTY(cur_term->Filedes, buf) != 0) { ++ if (errno == EINTR) ++ continue; ++ if ((errno == ENOTTY) && (SP != 0)) ++ SP->_notty = TRUE; ++ result = ERR; ++ } ++ break; ++ } + } + TR(TRACE_BITS, ("_nc_set_tty_mode(%d): %s", + cur_term->Filedes, _nc_trace_ttymode(buf))); +- return (OK); ++ return (result); + } + + NCURSES_EXPORT(int) +--- ncurses-5.5-20051126+/ncurses/widechar/lib_ins_wch.c 2005-09-17 19:25:13.000000000 +0000 ++++ ncurses-5.5-20051203/ncurses/widechar/lib_ins_wch.c 2005-12-03 20:24:19.000000000 +0000 +@@ -117,7 +117,7 @@ + for (cp = wstr; *cp && ((cp - wstr) < n); cp++) { + int len = wcwidth(*cp); + +- if (len != 1) { ++ if (len != 1 || !is8bits(*cp)) { + cchar_t tmp_cchar; + wchar_t tmp_wchar = *cp; + memset(&tmp_cchar, 0, sizeof(tmp_cchar)); diff --git a/base-source/ncurses-5.5.tar.gz b/base-source/ncurses-5.5.tar.gz new file mode 100644 index 0000000..d104cd4 Binary files /dev/null and b/base-source/ncurses-5.5.tar.gz differ diff --git a/base-source/net-tools-1.60-gcc34-3.patch b/base-source/net-tools-1.60-gcc34-3.patch new file mode 100644 index 0000000..e6ec253 --- /dev/null +++ b/base-source/net-tools-1.60-gcc34-3.patch @@ -0,0 +1,86 @@ +Originaly By: Zack Winkles +Submitted By: Jim Gifford +Date: 2004-06-23 +Initial Package Version: 1.60 +Origin: N/A +Upstream Status: N/A +Description: Fix some occurrences of syntax that GCC 3.4 doesn't like. + +diff -Naur net-tools-1.60.orig/hostname.c net-tools-1.60/hostname.c +--- net-tools-1.60.orig/hostname.c 2001-04-08 17:04:23.000000000 +0000 ++++ net-tools-1.60/hostname.c 2004-06-24 06:22:16.913258663 +0000 +@@ -78,6 +78,7 @@ + fprintf(stderr, _("%s: name too long\n"), program_name); + break; + default: ++ ((void)0); + } + exit(1); + } +@@ -98,6 +99,7 @@ + fprintf(stderr, _("%s: name too long\n"), program_name); + break; + default: ++ ((void)0); + } + exit(1); + }; +@@ -117,6 +119,7 @@ + fprintf(stderr, _("%s: name too long\n"), program_name); + break; + default: ++ ((void)0); + } + exit(1); + }; +@@ -174,6 +177,7 @@ + printf("%s\n", hp->h_name); + break; + default: ++ ((void)0); + } + } + +diff -Naur net-tools-1.60.orig/lib/inet_sr.c net-tools-1.60/lib/inet_sr.c +--- net-tools-1.60.orig/lib/inet_sr.c 2000-02-20 21:46:45.000000000 +0000 ++++ net-tools-1.60/lib/inet_sr.c 2004-06-24 06:22:01.967840446 +0000 +@@ -105,6 +105,7 @@ + case 2: + isnet = 0; break; + default: ++ ((void)0); + } + + /* Fill in the other fields. */ +diff -Naur net-tools-1.60.orig/mii-tool.c net-tools-1.60/mii-tool.c +--- net-tools-1.60.orig/mii-tool.c 2000-05-21 14:31:17.000000000 +0000 ++++ net-tools-1.60/mii-tool.c 2004-06-24 06:22:01.971839755 +0000 +@@ -379,17 +379,17 @@ + /*--------------------------------------------------------------------*/ + + const char *usage = +-"usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...] +- -V, --version display version information +- -v, --verbose more verbose output +- -R, --reset reset MII to poweron state +- -r, --restart restart autonegotiation +- -w, --watch monitor for link status changes +- -l, --log with -w, write events to syslog +- -A, --advertise=media,... advertise only specified media +- -F, --force=media force specified media technology +-media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD, +- (to advertise both HD and FD) 100baseTx, 10baseT\n"; ++"usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]\n" ++" -V, --version display version information\n" ++" -v, --verbose more verbose output\n" ++" -R, --reset reset MII to poweron state\n" ++" -r, --restart restart autonegotiation\n" ++" -w, --watch monitor for link status changes\n" ++" -l, --log with -w, write events to syslog\n" ++" -A, --advertise=media,... advertise only specified media\n" ++" -F, --force=media force specified media technology\n" ++"media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,\n" ++" (to advertise both HD and FD) 100baseTx, 10baseT\n"; + + int main(int argc, char **argv) + { diff --git a/base-source/net-tools-1.60-kernel_headers-2.patch b/base-source/net-tools-1.60-kernel_headers-2.patch new file mode 100644 index 0000000..c881537 --- /dev/null +++ b/base-source/net-tools-1.60-kernel_headers-2.patch @@ -0,0 +1,51 @@ +Submitted By: Jim Gifford (jim at linuxfromscratch dot org) +Date: 2004-06-24 +Initial Package Version: 2.6 +Origin: Gentoo and Self +Upstream Status: N/A +Description: Fixes Compile Issues with the 2.6 Kernel + + +diff -Naur net-tools-1.60.orig/hostname.c net-tools-1.60/hostname.c +--- net-tools-1.60.orig/hostname.c 2001-04-08 17:04:23.000000000 +0000 ++++ net-tools-1.60/hostname.c 2004-06-24 06:17:32.517305695 +0000 +@@ -42,10 +42,16 @@ + #include "config.h" + #include "version.h" + #include "../intl.h" ++#include + + #if HAVE_AFDECnet ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) + #include + #endif ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) ++#include ++#endif ++#endif + + char *Release = RELEASE, *Version = "hostname 1.100 (2001-04-14)"; + +diff -Naur net-tools-1.60.orig/lib/x25_sr.c net-tools-1.60/lib/x25_sr.c +--- net-tools-1.60.orig/lib/x25_sr.c 2000-05-20 13:38:10.000000000 +0000 ++++ net-tools-1.60/lib/x25_sr.c 2004-06-24 06:15:45.163773724 +0000 +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -77,7 +78,11 @@ + rt.sigdigits=sigdigits; + + /* x25_route_struct.address isn't type struct sockaddr_x25, Why? */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) + memcpy(&rt.address, &sx25.sx25_addr, sizeof(x25_address)); ++#else ++ memcpy(&rt.address, &sx25.sx25_addr, sizeof(struct x25_address)); ++#endif + + while (*args) { + if (!strcmp(*args,"device") || !strcmp(*args,"dev")) { diff --git a/base-source/net-tools-1.60-mii_ioctl-1.patch b/base-source/net-tools-1.60-mii_ioctl-1.patch new file mode 100644 index 0000000..ca8582d --- /dev/null +++ b/base-source/net-tools-1.60-mii_ioctl-1.patch @@ -0,0 +1,27 @@ +Submitted By: Randy McMurchy +Date: 2004-08-27 +Initial Package Version: 1.60 +Upstream Status: N/A (package is unmaintained) +Origin: From Fedora Core (submitted to LFS-Hackers by Kevin White) +Description: Fixes mii-tool when compiled using Linux-2.6.x + +$LastChangedBy: randy $ +$Date: 2004-08-27 21:04:05 -0600 (Fri, 27 Aug 2004) $ + +--- net-tools-1.60/include/mii.h.bar Tue Jul 31 11:49:39 2001 ++++ net-tools-1.60/include/mii.h Tue Jul 31 11:49:33 2001 +@@ -11,11 +11,9 @@ + + /* network interface ioctl's for MII commands */ + #ifndef SIOCGMIIPHY +-#define SIOCGMIIPHY (SIOCDEVPRIVATE) /* Read from current PHY */ +-#define SIOCGMIIREG (SIOCDEVPRIVATE+1) /* Read any PHY register */ +-#define SIOCSMIIREG (SIOCDEVPRIVATE+2) /* Write any PHY register */ +-#define SIOCGPARAMS (SIOCDEVPRIVATE+3) /* Read operational parameters */ +-#define SIOCSPARAMS (SIOCDEVPRIVATE+4) /* Set operational parameters */ ++#define SIOCGMIIPHY 0x8947 /* Read from current PHY */ ++#define SIOCGMIIREG 0x8948 /* Read any PHY register */ ++#define SIOCSMIIREG 0x8949 /* Write any PHY register */ + #endif + + #include diff --git a/base-source/net-tools-1.60.tar.bz2 b/base-source/net-tools-1.60.tar.bz2 new file mode 100644 index 0000000..2abe517 Binary files /dev/null and b/base-source/net-tools-1.60.tar.bz2 differ diff --git a/base-source/netcat-0.7.1.tar.bz2 b/base-source/netcat-0.7.1.tar.bz2 new file mode 100644 index 0000000..5a4aee8 Binary files /dev/null and b/base-source/netcat-0.7.1.tar.bz2 differ diff --git a/base-source/nmap-4.11.tar.bz2 b/base-source/nmap-4.11.tar.bz2 new file mode 100644 index 0000000..b7f99eb Binary files /dev/null and b/base-source/nmap-4.11.tar.bz2 differ diff --git a/base-source/openssh-4.3p2.tar.gz b/base-source/openssh-4.3p2.tar.gz new file mode 100644 index 0000000..5479dcd Binary files /dev/null and b/base-source/openssh-4.3p2.tar.gz differ diff --git a/base-source/openssl-0.9.8b-fix_manpages-1.patch b/base-source/openssl-0.9.8b-fix_manpages-1.patch new file mode 100644 index 0000000..21cae13 --- /dev/null +++ b/base-source/openssl-0.9.8b-fix_manpages-1.patch @@ -0,0 +1,1888 @@ +Submitted By: Robert Connolly +Date: 2005-11-13 +Initial Package Version: 0.9.8a +Upstream Status: Submitted upstream +Origin: Anderson Lizardo +Description: This patch fixes conflicts between man pages + installed by OpenSSL and those found on other + packages (particulary Shadow, Perl, and + Man-pages). It also fixes syntax errors on some + POD files that generates slightly broken man + pages. + +$LastChangedBy: igor $ +$Date: 2005-04-03 16:54:23 -0600 (Sun, 03 Apr 2005) $ + +diff -Naur openssl-0.9.8a.orig/FAQ openssl-0.9.8a/FAQ +--- openssl-0.9.8a.orig/FAQ 2005-10-11 10:16:06.000000000 +0000 ++++ openssl-0.9.8a/FAQ 2005-11-14 03:59:59.000000000 +0000 +@@ -628,7 +628,7 @@ + file. + + Multi-threaded applications must provide two callback functions to +-OpenSSL. This is described in the threads(3) manpage. ++OpenSSL. This is described in the openssl_threads(3) manpage. + + + * I've compiled a program under Windows and it crashes: why? +diff -Naur openssl-0.9.8a.orig/crypto/rand/md_rand.c openssl-0.9.8a/crypto/rand/md_rand.c +--- openssl-0.9.8a.orig/crypto/rand/md_rand.c 2005-04-07 22:53:35.000000000 +0000 ++++ openssl-0.9.8a/crypto/rand/md_rand.c 2005-11-14 03:59:59.000000000 +0000 +@@ -196,7 +196,7 @@ + int do_not_lock; + + /* +- * (Based on the rand(3) manpage) ++ * (Based on the openssl_rand(3) manpage) + * + * The input is chopped up into units of 20 bytes (or less for + * the last block). Each of these blocks is run through the hash +@@ -351,7 +351,7 @@ + num_ceil = (1 + (num-1)/(MD_DIGEST_LENGTH/2)) * (MD_DIGEST_LENGTH/2); + + /* +- * (Based on the rand(3) manpage:) ++ * (Based on the openssl_rand(3) manpage) + * + * For each group of 10 bytes (or less), we do the following: + * +diff -Naur openssl-0.9.8a.orig/doc/apps/openssl-passwd.pod openssl-0.9.8a/doc/apps/openssl-passwd.pod +--- openssl-0.9.8a.orig/doc/apps/openssl-passwd.pod 1970-01-01 00:00:00.000000000 +0000 ++++ openssl-0.9.8a/doc/apps/openssl-passwd.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -0,0 +1,82 @@ ++=pod ++ ++=head1 NAME ++ ++openssl-passwd - compute password hashes ++ ++=head1 SYNOPSIS ++ ++B ++[B<-crypt>] ++[B<-1>] ++[B<-apr1>] ++[B<-salt> I] ++[B<-in> I] ++[B<-stdin>] ++[B<-noverify>] ++[B<-quiet>] ++[B<-table>] ++{I} ++ ++=head1 DESCRIPTION ++ ++The B command computes the hash of a password typed at ++run-time or the hash of each password in a list. The password list is ++taken from the named file for option B<-in file>, from stdin for ++option B<-stdin>, or from the command line, or from the terminal otherwise. ++The Unix standard algorithm B and the MD5-based BSD password ++algorithm B<1> and its Apache variant B are available. ++ ++=head1 OPTIONS ++ ++=over 4 ++ ++=item B<-crypt> ++ ++Use the B algorithm (default). ++ ++=item B<-1> ++ ++Use the MD5 based BSD password algorithm B<1>. ++ ++=item B<-apr1> ++ ++Use the B algorithm (Apache variant of the BSD algorithm). ++ ++=item B<-salt> I ++ ++Use the specified salt. ++When reading a password from the terminal, this implies B<-noverify>. ++ ++=item B<-in> I ++ ++Read passwords from I. ++ ++=item B<-stdin> ++ ++Read passwords from B. ++ ++=item B<-noverify> ++ ++Don't verify when reading a password from the terminal. ++ ++=item B<-quiet> ++ ++Don't output warnings when passwords given at the command line are truncated. ++ ++=item B<-table> ++ ++In the output list, prepend the cleartext password and a TAB character ++to each password hash. ++ ++=back ++ ++=head1 EXAMPLES ++ ++B prints B. ++ ++B prints B<$1$xxxxxxxx$UYCIxa628.9qXjpQCjM4a.>. ++ ++B prints B<$apr1$xxxxxxxx$dxHfLAsjHkDRmG83UXe8K0>. ++ ++=cut +diff -Naur openssl-0.9.8a.orig/doc/apps/openssl.pod openssl-0.9.8a/doc/apps/openssl.pod +--- openssl-0.9.8a.orig/doc/apps/openssl.pod 2004-01-04 18:59:14.000000000 +0000 ++++ openssl-0.9.8a/doc/apps/openssl.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -125,7 +125,7 @@ + + Online Certificate Status Protocol utility. + +-=item L|passwd(1)> ++=item L|openssl-passwd(1)> + + Generation of hashed passwords. + +@@ -325,7 +325,7 @@ + L, L, L, + L, L, + L, L, L, +-L, ++L, + L, L, L, + L, L, L, + L, L, +diff -Naur openssl-0.9.8a.orig/doc/apps/passwd.pod openssl-0.9.8a/doc/apps/passwd.pod +--- openssl-0.9.8a.orig/doc/apps/passwd.pod 2002-10-04 12:59:00.000000000 +0000 ++++ openssl-0.9.8a/doc/apps/passwd.pod 1970-01-01 00:00:00.000000000 +0000 +@@ -1,82 +0,0 @@ +-=pod +- +-=head1 NAME +- +-passwd - compute password hashes +- +-=head1 SYNOPSIS +- +-B +-[B<-crypt>] +-[B<-1>] +-[B<-apr1>] +-[B<-salt> I] +-[B<-in> I] +-[B<-stdin>] +-[B<-noverify>] +-[B<-quiet>] +-[B<-table>] +-{I} +- +-=head1 DESCRIPTION +- +-The B command computes the hash of a password typed at +-run-time or the hash of each password in a list. The password list is +-taken from the named file for option B<-in file>, from stdin for +-option B<-stdin>, or from the command line, or from the terminal otherwise. +-The Unix standard algorithm B and the MD5-based BSD password +-algorithm B<1> and its Apache variant B are available. +- +-=head1 OPTIONS +- +-=over 4 +- +-=item B<-crypt> +- +-Use the B algorithm (default). +- +-=item B<-1> +- +-Use the MD5 based BSD password algorithm B<1>. +- +-=item B<-apr1> +- +-Use the B algorithm (Apache variant of the BSD algorithm). +- +-=item B<-salt> I +- +-Use the specified salt. +-When reading a password from the terminal, this implies B<-noverify>. +- +-=item B<-in> I +- +-Read passwords from I. +- +-=item B<-stdin> +- +-Read passwords from B. +- +-=item B<-noverify> +- +-Don't verify when reading a password from the terminal. +- +-=item B<-quiet> +- +-Don't output warnings when passwords given at the command line are truncated. +- +-=item B<-table> +- +-In the output list, prepend the cleartext password and a TAB character +-to each password hash. +- +-=back +- +-=head1 EXAMPLES +- +-B prints B. +- +-B prints B<$1$xxxxxxxx$UYCIxa628.9qXjpQCjM4a.>. +- +-B prints B<$apr1$xxxxxxxx$dxHfLAsjHkDRmG83UXe8K0>. +- +-=cut +diff -Naur openssl-0.9.8a.orig/doc/crypto/BN_generate_prime.pod openssl-0.9.8a/doc/crypto/BN_generate_prime.pod +--- openssl-0.9.8a.orig/doc/crypto/BN_generate_prime.pod 2003-01-13 13:18:22.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/BN_generate_prime.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -90,7 +90,7 @@ + + =head1 SEE ALSO + +-L, L, L ++L, L, L + + =head1 HISTORY + +diff -Naur openssl-0.9.8a.orig/doc/crypto/BN_rand.pod openssl-0.9.8a/doc/crypto/BN_rand.pod +--- openssl-0.9.8a.orig/doc/crypto/BN_rand.pod 2002-09-25 13:33:26.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/BN_rand.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -45,7 +45,7 @@ + + =head1 SEE ALSO + +-L, L, L, ++L, L, L, + L, L + + =head1 HISTORY +diff -Naur openssl-0.9.8a.orig/doc/crypto/CONF_modules_free.pod openssl-0.9.8a/doc/crypto/CONF_modules_free.pod +--- openssl-0.9.8a.orig/doc/crypto/CONF_modules_free.pod 2004-03-02 13:31:32.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/CONF_modules_free.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -37,7 +37,7 @@ + =head1 SEE ALSO + + L, L, +-L ++L + + =head1 HISTORY + +diff -Naur openssl-0.9.8a.orig/doc/crypto/CONF_modules_load_file.pod openssl-0.9.8a/doc/crypto/CONF_modules_load_file.pod +--- openssl-0.9.8a.orig/doc/crypto/CONF_modules_load_file.pod 2004-03-02 13:31:32.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/CONF_modules_load_file.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -51,7 +51,7 @@ + =head1 SEE ALSO + + L, L, +-L, L ++L, L + + =head1 HISTORY + +diff -Naur openssl-0.9.8a.orig/doc/crypto/DH_generate_key.pod openssl-0.9.8a/doc/crypto/DH_generate_key.pod +--- openssl-0.9.8a.orig/doc/crypto/DH_generate_key.pod 2002-09-25 13:33:27.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/DH_generate_key.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -40,7 +40,7 @@ + + =head1 SEE ALSO + +-L, L, L, L ++L, L, L, L + + =head1 HISTORY + +diff -Naur openssl-0.9.8a.orig/doc/crypto/DH_generate_parameters.pod openssl-0.9.8a/doc/crypto/DH_generate_parameters.pod +--- openssl-0.9.8a.orig/doc/crypto/DH_generate_parameters.pod 2002-09-25 13:33:27.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/DH_generate_parameters.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -59,7 +59,7 @@ + + =head1 SEE ALSO + +-L, L, L, ++L, L, L, + L + + =head1 HISTORY +diff -Naur openssl-0.9.8a.orig/doc/crypto/DSA_do_sign.pod openssl-0.9.8a/doc/crypto/DSA_do_sign.pod +--- openssl-0.9.8a.orig/doc/crypto/DSA_do_sign.pod 2002-09-25 13:33:27.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/DSA_do_sign.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -36,7 +36,7 @@ + + =head1 SEE ALSO + +-L, L, L, ++L, L, L, + L, + L + +diff -Naur openssl-0.9.8a.orig/doc/crypto/DSA_generate_key.pod openssl-0.9.8a/doc/crypto/DSA_generate_key.pod +--- openssl-0.9.8a.orig/doc/crypto/DSA_generate_key.pod 2002-09-25 13:33:27.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/DSA_generate_key.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -24,7 +24,7 @@ + + =head1 SEE ALSO + +-L, L, L, ++L, L, L, + L + + =head1 HISTORY +diff -Naur openssl-0.9.8a.orig/doc/crypto/DSA_generate_parameters.pod openssl-0.9.8a/doc/crypto/DSA_generate_parameters.pod +--- openssl-0.9.8a.orig/doc/crypto/DSA_generate_parameters.pod 2002-09-25 13:33:27.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/DSA_generate_parameters.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -90,7 +90,7 @@ + + =head1 SEE ALSO + +-L, L, L, ++L, L, L, + L + + =head1 HISTORY +diff -Naur openssl-0.9.8a.orig/doc/crypto/DSA_sign.pod openssl-0.9.8a/doc/crypto/DSA_sign.pod +--- openssl-0.9.8a.orig/doc/crypto/DSA_sign.pod 2002-09-25 13:33:27.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/DSA_sign.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -55,7 +55,7 @@ + + =head1 SEE ALSO + +-L, L, L, ++L, L, L, + L + + =head1 HISTORY +diff -Naur openssl-0.9.8a.orig/doc/crypto/ERR_GET_LIB.pod openssl-0.9.8a/doc/crypto/ERR_GET_LIB.pod +--- openssl-0.9.8a.orig/doc/crypto/ERR_GET_LIB.pod 2000-02-01 01:36:58.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/ERR_GET_LIB.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -41,7 +41,7 @@ + + =head1 SEE ALSO + +-L, L ++L, L + + =head1 HISTORY + +diff -Naur openssl-0.9.8a.orig/doc/crypto/ERR_clear_error.pod openssl-0.9.8a/doc/crypto/ERR_clear_error.pod +--- openssl-0.9.8a.orig/doc/crypto/ERR_clear_error.pod 2000-02-01 01:36:58.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/ERR_clear_error.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -20,7 +20,7 @@ + + =head1 SEE ALSO + +-L, L ++L, L + + =head1 HISTORY + +diff -Naur openssl-0.9.8a.orig/doc/crypto/ERR_error_string.pod openssl-0.9.8a/doc/crypto/ERR_error_string.pod +--- openssl-0.9.8a.orig/doc/crypto/ERR_error_string.pod 2004-11-14 15:11:37.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/ERR_error_string.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -60,7 +60,7 @@ + + =head1 SEE ALSO + +-L, L, ++L, L, + L, + L + L +diff -Naur openssl-0.9.8a.orig/doc/crypto/ERR_get_error.pod openssl-0.9.8a/doc/crypto/ERR_get_error.pod +--- openssl-0.9.8a.orig/doc/crypto/ERR_get_error.pod 2002-11-29 14:21:54.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/ERR_get_error.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -61,7 +61,7 @@ + + =head1 SEE ALSO + +-L, L, ++L, L, + L + + =head1 HISTORY +diff -Naur openssl-0.9.8a.orig/doc/crypto/ERR_load_crypto_strings.pod openssl-0.9.8a/doc/crypto/ERR_load_crypto_strings.pod +--- openssl-0.9.8a.orig/doc/crypto/ERR_load_crypto_strings.pod 2000-02-24 11:55:08.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/ERR_load_crypto_strings.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -35,7 +35,7 @@ + + =head1 SEE ALSO + +-L, L ++L, L + + =head1 HISTORY + +diff -Naur openssl-0.9.8a.orig/doc/crypto/ERR_load_strings.pod openssl-0.9.8a/doc/crypto/ERR_load_strings.pod +--- openssl-0.9.8a.orig/doc/crypto/ERR_load_strings.pod 2000-02-24 11:55:08.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/ERR_load_strings.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -43,7 +43,7 @@ + + =head1 SEE ALSO + +-L, L ++L, L + + =head1 HISTORY + +diff -Naur openssl-0.9.8a.orig/doc/crypto/ERR_print_errors.pod openssl-0.9.8a/doc/crypto/ERR_print_errors.pod +--- openssl-0.9.8a.orig/doc/crypto/ERR_print_errors.pod 2000-02-01 01:36:59.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/ERR_print_errors.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -38,7 +38,7 @@ + + =head1 SEE ALSO + +-L, L, ++L, L, + L, + L, + L +diff -Naur openssl-0.9.8a.orig/doc/crypto/ERR_put_error.pod openssl-0.9.8a/doc/crypto/ERR_put_error.pod +--- openssl-0.9.8a.orig/doc/crypto/ERR_put_error.pod 2000-02-24 11:55:08.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/ERR_put_error.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -34,7 +34,7 @@ + + =head1 SEE ALSO + +-L, L ++L, L + + =head1 HISTORY + +diff -Naur openssl-0.9.8a.orig/doc/crypto/ERR_remove_state.pod openssl-0.9.8a/doc/crypto/ERR_remove_state.pod +--- openssl-0.9.8a.orig/doc/crypto/ERR_remove_state.pod 2000-05-19 07:54:42.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/ERR_remove_state.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -25,7 +25,7 @@ + + =head1 SEE ALSO + +-L ++L + + =head1 HISTORY + +diff -Naur openssl-0.9.8a.orig/doc/crypto/EVP_BytesToKey.pod openssl-0.9.8a/doc/crypto/EVP_BytesToKey.pod +--- openssl-0.9.8a.orig/doc/crypto/EVP_BytesToKey.pod 2004-11-25 17:47:30.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/EVP_BytesToKey.pod 2005-11-14 04:00:45.000000000 +0000 +@@ -59,7 +59,7 @@ + + =head1 SEE ALSO + +-L, L, ++L, L, + L + + =head1 HISTORY +diff -Naur openssl-0.9.8a.orig/doc/crypto/EVP_OpenInit.pod openssl-0.9.8a/doc/crypto/EVP_OpenInit.pod +--- openssl-0.9.8a.orig/doc/crypto/EVP_OpenInit.pod 2000-09-23 07:16:14.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/EVP_OpenInit.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -54,7 +54,7 @@ + + =head1 SEE ALSO + +-L, L, ++L, L, + L, + L + +diff -Naur openssl-0.9.8a.orig/doc/crypto/EVP_SealInit.pod openssl-0.9.8a/doc/crypto/EVP_SealInit.pod +--- openssl-0.9.8a.orig/doc/crypto/EVP_SealInit.pod 2005-03-29 17:50:08.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/EVP_SealInit.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -74,7 +74,7 @@ + + =head1 SEE ALSO + +-L, L, ++L, L, + L, + L + +diff -Naur openssl-0.9.8a.orig/doc/crypto/EVP_SignInit.pod openssl-0.9.8a/doc/crypto/EVP_SignInit.pod +--- openssl-0.9.8a.orig/doc/crypto/EVP_SignInit.pod 2005-03-22 17:55:33.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/EVP_SignInit.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -80,7 +80,7 @@ + =head1 SEE ALSO + + L, +-L, L, ++L, L, + L, L, L, + L, L, L, + L, L +diff -Naur openssl-0.9.8a.orig/doc/crypto/EVP_VerifyInit.pod openssl-0.9.8a/doc/crypto/EVP_VerifyInit.pod +--- openssl-0.9.8a.orig/doc/crypto/EVP_VerifyInit.pod 2002-07-10 19:35:46.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/EVP_VerifyInit.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -71,7 +71,7 @@ + + L, + L, +-L, L, ++L, L, + L, L, L, + L, L, L, + L, L +diff -Naur openssl-0.9.8a.orig/doc/crypto/OPENSSL_config.pod openssl-0.9.8a/doc/crypto/OPENSSL_config.pod +--- openssl-0.9.8a.orig/doc/crypto/OPENSSL_config.pod 2005-06-02 23:17:38.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/OPENSSL_config.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -73,7 +73,7 @@ + =head1 SEE ALSO + + L, L, +-L ++L + + =head1 HISTORY + +diff -Naur openssl-0.9.8a.orig/doc/crypto/RAND_add.pod openssl-0.9.8a/doc/crypto/RAND_add.pod +--- openssl-0.9.8a.orig/doc/crypto/RAND_add.pod 2000-03-22 15:30:03.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/RAND_add.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -65,7 +65,7 @@ + + =head1 SEE ALSO + +-L, L, ++L, L, + L, L + + =head1 HISTORY +diff -Naur openssl-0.9.8a.orig/doc/crypto/RAND_bytes.pod openssl-0.9.8a/doc/crypto/RAND_bytes.pod +--- openssl-0.9.8a.orig/doc/crypto/RAND_bytes.pod 2002-09-25 13:33:27.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/RAND_bytes.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -35,7 +35,7 @@ + + =head1 SEE ALSO + +-L, L, ++L, L, + L + + =head1 HISTORY +diff -Naur openssl-0.9.8a.orig/doc/crypto/RAND_cleanup.pod openssl-0.9.8a/doc/crypto/RAND_cleanup.pod +--- openssl-0.9.8a.orig/doc/crypto/RAND_cleanup.pod 2000-01-27 01:25:06.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/RAND_cleanup.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -20,7 +20,7 @@ + + =head1 SEE ALSO + +-L ++L + + =head1 HISTORY + +diff -Naur openssl-0.9.8a.orig/doc/crypto/RAND_egd.pod openssl-0.9.8a/doc/crypto/RAND_egd.pod +--- openssl-0.9.8a.orig/doc/crypto/RAND_egd.pod 2001-02-10 19:10:36.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/RAND_egd.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -69,7 +69,7 @@ + + =head1 SEE ALSO + +-L, L, ++L, L, + L + + =head1 HISTORY +diff -Naur openssl-0.9.8a.orig/doc/crypto/RAND_load_file.pod openssl-0.9.8a/doc/crypto/RAND_load_file.pod +--- openssl-0.9.8a.orig/doc/crypto/RAND_load_file.pod 2001-03-21 15:25:56.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/RAND_load_file.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -43,7 +43,7 @@ + + =head1 SEE ALSO + +-L, L, L ++L, L, L + + =head1 HISTORY + +diff -Naur openssl-0.9.8a.orig/doc/crypto/RAND_set_rand_method.pod openssl-0.9.8a/doc/crypto/RAND_set_rand_method.pod +--- openssl-0.9.8a.orig/doc/crypto/RAND_set_rand_method.pod 2002-08-05 16:27:01.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/RAND_set_rand_method.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -67,7 +67,7 @@ + + =head1 SEE ALSO + +-L, L ++L, L + + =head1 HISTORY + +diff -Naur openssl-0.9.8a.orig/doc/crypto/RSA_blinding_on.pod openssl-0.9.8a/doc/crypto/RSA_blinding_on.pod +--- openssl-0.9.8a.orig/doc/crypto/RSA_blinding_on.pod 2000-02-24 11:55:10.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/RSA_blinding_on.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -34,7 +34,7 @@ + + =head1 SEE ALSO + +-L, L ++L, L + + =head1 HISTORY + +diff -Naur openssl-0.9.8a.orig/doc/crypto/RSA_generate_key.pod openssl-0.9.8a/doc/crypto/RSA_generate_key.pod +--- openssl-0.9.8a.orig/doc/crypto/RSA_generate_key.pod 2002-09-25 13:33:27.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/RSA_generate_key.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -59,7 +59,7 @@ + + =head1 SEE ALSO + +-L, L, L, ++L, L, L, + L + + =head1 HISTORY +diff -Naur openssl-0.9.8a.orig/doc/crypto/RSA_public_encrypt.pod openssl-0.9.8a/doc/crypto/RSA_public_encrypt.pod +--- openssl-0.9.8a.orig/doc/crypto/RSA_public_encrypt.pod 2004-03-23 21:01:34.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/RSA_public_encrypt.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -73,7 +73,7 @@ + + =head1 SEE ALSO + +-L, L, L, ++L, L, L, + L + + =head1 HISTORY +diff -Naur openssl-0.9.8a.orig/doc/crypto/RSA_sign_ASN1_OCTET_STRING.pod openssl-0.9.8a/doc/crypto/RSA_sign_ASN1_OCTET_STRING.pod +--- openssl-0.9.8a.orig/doc/crypto/RSA_sign_ASN1_OCTET_STRING.pod 2002-09-25 13:33:28.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/RSA_sign_ASN1_OCTET_STRING.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -48,7 +48,7 @@ + =head1 SEE ALSO + + L, L, +-L, L, L, ++L, L, L, + L + + =head1 HISTORY +diff -Naur openssl-0.9.8a.orig/doc/crypto/X509_NAME_ENTRY_get_object.pod openssl-0.9.8a/doc/crypto/X509_NAME_ENTRY_get_object.pod +--- openssl-0.9.8a.orig/doc/crypto/X509_NAME_ENTRY_get_object.pod 2005-03-30 11:50:14.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/X509_NAME_ENTRY_get_object.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -63,7 +63,7 @@ + =head1 SEE ALSO + + L, L, +-L ++L + + =head1 HISTORY + +diff -Naur openssl-0.9.8a.orig/doc/crypto/bn.pod openssl-0.9.8a/doc/crypto/bn.pod +--- openssl-0.9.8a.orig/doc/crypto/bn.pod 2005-04-29 15:07:34.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/bn.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -167,7 +167,7 @@ + =head1 SEE ALSO + + L, +-L, L, L, L, ++L, L, L, L, + L, L, + L, L, L, + L, L, +diff -Naur openssl-0.9.8a.orig/doc/crypto/crypto.pod openssl-0.9.8a/doc/crypto/crypto.pod +--- openssl-0.9.8a.orig/doc/crypto/crypto.pod 2002-10-06 12:59:25.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/crypto.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -46,7 +46,7 @@ + + =item AUXILIARY FUNCTIONS + +-L, L, L, ++L, L, L, + L + + =item INPUT/OUTPUT, DATA ENCODING +diff -Naur openssl-0.9.8a.orig/doc/crypto/des.pod openssl-0.9.8a/doc/crypto/des.pod +--- openssl-0.9.8a.orig/doc/crypto/des.pod 2003-10-01 15:02:45.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/des.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -115,7 +115,7 @@ + the key; it is used to speed the encryption process. + + DES_random_key() generates a random key. The PRNG must be seeded +-prior to using this function (see L). If the PRNG ++prior to using this function (see L). If the PRNG + could not generate a secure key, 0 is returned. + + Before a DES key can be used, it must be converted into the +@@ -317,7 +317,7 @@ + + =head1 SEE ALSO + +-crypt(3), L, L, L ++crypt(3), L, L, L + + =head1 HISTORY + +diff -Naur openssl-0.9.8a.orig/doc/crypto/dh.pod openssl-0.9.8a/doc/crypto/dh.pod +--- openssl-0.9.8a.orig/doc/crypto/dh.pod 2002-08-05 16:27:01.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/dh.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -67,8 +67,8 @@ + + =head1 SEE ALSO + +-L, L, L, L, +-L, L, L, ++L, L, L, L, ++L, L, L, + L, L, + L, + L, +diff -Naur openssl-0.9.8a.orig/doc/crypto/dsa.pod openssl-0.9.8a/doc/crypto/dsa.pod +--- openssl-0.9.8a.orig/doc/crypto/dsa.pod 2002-08-05 16:27:01.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/dsa.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -100,7 +100,7 @@ + + =head1 SEE ALSO + +-L, L, L, L, ++L, L, L, L, + L, L, L, + L, + L, +diff -Naur openssl-0.9.8a.orig/doc/crypto/engine.pod openssl-0.9.8a/doc/crypto/engine.pod +--- openssl-0.9.8a.orig/doc/crypto/engine.pod 2004-06-17 23:40:14.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/engine.pod 2005-11-14 04:01:19.000000000 +0000 +@@ -594,6 +594,6 @@ + + =head1 SEE ALSO + +-L, L, L, L ++L, L, L, L + + =cut +diff -Naur openssl-0.9.8a.orig/doc/crypto/err.pod openssl-0.9.8a/doc/crypto/err.pod +--- openssl-0.9.8a.orig/doc/crypto/err.pod 2002-07-10 19:35:46.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/err.pod 1970-01-01 00:00:00.000000000 +0000 +@@ -1,187 +0,0 @@ +-=pod +- +-=head1 NAME +- +-err - error codes +- +-=head1 SYNOPSIS +- +- #include +- +- unsigned long ERR_get_error(void); +- unsigned long ERR_peek_error(void); +- unsigned long ERR_get_error_line(const char **file, int *line); +- unsigned long ERR_peek_error_line(const char **file, int *line); +- unsigned long ERR_get_error_line_data(const char **file, int *line, +- const char **data, int *flags); +- unsigned long ERR_peek_error_line_data(const char **file, int *line, +- const char **data, int *flags); +- +- int ERR_GET_LIB(unsigned long e); +- int ERR_GET_FUNC(unsigned long e); +- int ERR_GET_REASON(unsigned long e); +- +- void ERR_clear_error(void); +- +- char *ERR_error_string(unsigned long e, char *buf); +- const char *ERR_lib_error_string(unsigned long e); +- const char *ERR_func_error_string(unsigned long e); +- const char *ERR_reason_error_string(unsigned long e); +- +- void ERR_print_errors(BIO *bp); +- void ERR_print_errors_fp(FILE *fp); +- +- void ERR_load_crypto_strings(void); +- void ERR_free_strings(void); +- +- void ERR_remove_state(unsigned long pid); +- +- void ERR_put_error(int lib, int func, int reason, const char *file, +- int line); +- void ERR_add_error_data(int num, ...); +- +- void ERR_load_strings(int lib,ERR_STRING_DATA str[]); +- unsigned long ERR_PACK(int lib, int func, int reason); +- int ERR_get_next_error_library(void); +- +-=head1 DESCRIPTION +- +-When a call to the OpenSSL library fails, this is usually signalled +-by the return value, and an error code is stored in an error queue +-associated with the current thread. The B library provides +-functions to obtain these error codes and textual error messages. +- +-The L manpage describes how to +-access error codes. +- +-Error codes contain information about where the error occurred, and +-what went wrong. L describes how to +-extract this information. A method to obtain human-readable error +-messages is described in L. +- +-L can be used to clear the +-error queue. +- +-Note that L should be used to +-avoid memory leaks when threads are terminated. +- +-=head1 ADDING NEW ERROR CODES TO OPENSSL +- +-See L if you want to record error codes in the +-OpenSSL error system from within your application. +- +-The remainder of this section is of interest only if you want to add +-new error codes to OpenSSL or add error codes from external libraries. +- +-=head2 Reporting errors +- +-Each sub-library has a specific macro XXXerr() that is used to report +-errors. Its first argument is a function code B, the second +-argument is a reason code B. Function codes are derived +-from the function names; reason codes consist of textual error +-descriptions. For example, the function ssl23_read() reports a +-"handshake failure" as follows: +- +- SSLerr(SSL_F_SSL23_READ, SSL_R_SSL_HANDSHAKE_FAILURE); +- +-Function and reason codes should consist of upper case characters, +-numbers and underscores only. The error file generation script translates +-function codes into function names by looking in the header files +-for an appropriate function name, if none is found it just uses +-the capitalized form such as "SSL23_READ" in the above example. +- +-The trailing section of a reason code (after the "_R_") is translated +-into lower case and underscores changed to spaces. +- +-When you are using new function or reason codes, run B. +-The necessary B<#define>s will then automatically be added to the +-sub-library's header file. +- +-Although a library will normally report errors using its own specific +-XXXerr macro, another library's macro can be used. This is normally +-only done when a library wants to include ASN1 code which must use +-the ASN1err() macro. +- +-=head2 Adding new libraries +- +-When adding a new sub-library to OpenSSL, assign it a library number +-B, define a macro XXXerr() (both in B), add its +-name to B (in B), and add +-C to the ERR_load_crypto_strings() function +-(in B). Finally, add an entry +- +- L XXX xxx.h xxx_err.c +- +-to B, and add B to the Makefile. +-Running B will then generate a file B, and +-add all error codes used in the library to B. +- +-Additionally the library include file must have a certain form. +-Typically it will initially look like this: +- +- #ifndef HEADER_XXX_H +- #define HEADER_XXX_H +- +- #ifdef __cplusplus +- extern "C" { +- #endif +- +- /* Include files */ +- +- #include +- #include +- +- /* Macros, structures and function prototypes */ +- +- +- /* BEGIN ERROR CODES */ +- +-The B sequence is used by the error code +-generation script as the point to place new error codes, any text +-after this point will be overwritten when B is run. +-The closing #endif etc will be automatically added by the script. +- +-The generated C error code file B will load the header +-files B, B and B so the +-header file must load any additional header files containing any +-definitions it uses. +- +-=head1 USING ERROR CODES IN EXTERNAL LIBRARIES +- +-It is also possible to use OpenSSL's error code scheme in external +-libraries. The library needs to load its own codes and call the OpenSSL +-error code insertion script B explicitly to add codes to +-the header file and generate the C error code file. This will normally +-be done if the external library needs to generate new ASN1 structures +-but it can also be used to add more general purpose error code handling. +- +-TBA more details +- +-=head1 INTERNALS +- +-The error queues are stored in a hash table with one B +-entry for each pid. ERR_get_state() returns the current thread's +-B. An B can hold up to B error +-codes. When more error codes are added, the old ones are overwritten, +-on the assumption that the most recent errors are most important. +- +-Error strings are also stored in hash table. The hash tables can +-be obtained by calling ERR_get_err_state_table(void) and +-ERR_get_string_table(void) respectively. +- +-=head1 SEE ALSO +- +-L, +-L, +-L, +-L, +-L, +-L, +-L, +-L, +-L, +-L, +-L, +-L +- +-=cut +diff -Naur openssl-0.9.8a.orig/doc/crypto/openssl_err.pod openssl-0.9.8a/doc/crypto/openssl_err.pod +--- openssl-0.9.8a.orig/doc/crypto/openssl_err.pod 1970-01-01 00:00:00.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/openssl_err.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -0,0 +1,187 @@ ++=pod ++ ++=head1 NAME ++ ++openssl_err - error codes ++ ++=head1 SYNOPSIS ++ ++ #include ++ ++ unsigned long ERR_get_error(void); ++ unsigned long ERR_peek_error(void); ++ unsigned long ERR_get_error_line(const char **file, int *line); ++ unsigned long ERR_peek_error_line(const char **file, int *line); ++ unsigned long ERR_get_error_line_data(const char **file, int *line, ++ const char **data, int *flags); ++ unsigned long ERR_peek_error_line_data(const char **file, int *line, ++ const char **data, int *flags); ++ ++ int ERR_GET_LIB(unsigned long e); ++ int ERR_GET_FUNC(unsigned long e); ++ int ERR_GET_REASON(unsigned long e); ++ ++ void ERR_clear_error(void); ++ ++ char *ERR_error_string(unsigned long e, char *buf); ++ const char *ERR_lib_error_string(unsigned long e); ++ const char *ERR_func_error_string(unsigned long e); ++ const char *ERR_reason_error_string(unsigned long e); ++ ++ void ERR_print_errors(BIO *bp); ++ void ERR_print_errors_fp(FILE *fp); ++ ++ void ERR_load_crypto_strings(void); ++ void ERR_free_strings(void); ++ ++ void ERR_remove_state(unsigned long pid); ++ ++ void ERR_put_error(int lib, int func, int reason, const char *file, ++ int line); ++ void ERR_add_error_data(int num, ...); ++ ++ void ERR_load_strings(int lib,ERR_STRING_DATA str[]); ++ unsigned long ERR_PACK(int lib, int func, int reason); ++ int ERR_get_next_error_library(void); ++ ++=head1 DESCRIPTION ++ ++When a call to the OpenSSL library fails, this is usually signalled ++by the return value, and an error code is stored in an error queue ++associated with the current thread. The B library provides ++functions to obtain these error codes and textual error messages. ++ ++The L manpage describes how to ++access error codes. ++ ++Error codes contain information about where the error occurred, and ++what went wrong. L describes how to ++extract this information. A method to obtain human-readable error ++messages is described in L. ++ ++L can be used to clear the ++error queue. ++ ++Note that L should be used to ++avoid memory leaks when threads are terminated. ++ ++=head1 ADDING NEW ERROR CODES TO OPENSSL ++ ++See L if you want to record error codes in the ++OpenSSL error system from within your application. ++ ++The remainder of this section is of interest only if you want to add ++new error codes to OpenSSL or add error codes from external libraries. ++ ++=head2 Reporting errors ++ ++Each sub-library has a specific macro XXXerr() that is used to report ++errors. Its first argument is a function code B, the second ++argument is a reason code B. Function codes are derived ++from the function names; reason codes consist of textual error ++descriptions. For example, the function ssl23_read() reports a ++"handshake failure" as follows: ++ ++ SSLerr(SSL_F_SSL23_READ, SSL_R_SSL_HANDSHAKE_FAILURE); ++ ++Function and reason codes should consist of upper case characters, ++numbers and underscores only. The error file generation script translates ++function codes into function names by looking in the header files ++for an appropriate function name, if none is found it just uses ++the capitalized form such as "SSL23_READ" in the above example. ++ ++The trailing section of a reason code (after the "_R_") is translated ++into lower case and underscores changed to spaces. ++ ++When you are using new function or reason codes, run B. ++The necessary B<#define>s will then automatically be added to the ++sub-library's header file. ++ ++Although a library will normally report errors using its own specific ++XXXerr macro, another library's macro can be used. This is normally ++only done when a library wants to include ASN1 code which must use ++the ASN1err() macro. ++ ++=head2 Adding new libraries ++ ++When adding a new sub-library to OpenSSL, assign it a library number ++B, define a macro XXXerr() (both in B), add its ++name to B (in B), and add ++C to the ERR_load_crypto_strings() function ++(in B). Finally, add an entry ++ ++ L XXX xxx.h xxx_err.c ++ ++to B, and add B to the Makefile. ++Running B will then generate a file B, and ++add all error codes used in the library to B. ++ ++Additionally the library include file must have a certain form. ++Typically it will initially look like this: ++ ++ #ifndef HEADER_XXX_H ++ #define HEADER_XXX_H ++ ++ #ifdef __cplusplus ++ extern "C" { ++ #endif ++ ++ /* Include files */ ++ ++ #include ++ #include ++ ++ /* Macros, structures and function prototypes */ ++ ++ ++ /* BEGIN ERROR CODES */ ++ ++The B sequence is used by the error code ++generation script as the point to place new error codes, any text ++after this point will be overwritten when B is run. ++The closing #endif etc will be automatically added by the script. ++ ++The generated C error code file B will load the header ++files B, B and B so the ++header file must load any additional header files containing any ++definitions it uses. ++ ++=head1 USING ERROR CODES IN EXTERNAL LIBRARIES ++ ++It is also possible to use OpenSSL's error code scheme in external ++libraries. The library needs to load its own codes and call the OpenSSL ++error code insertion script B explicitly to add codes to ++the header file and generate the C error code file. This will normally ++be done if the external library needs to generate new ASN1 structures ++but it can also be used to add more general purpose error code handling. ++ ++TBA more details ++ ++=head1 INTERNALS ++ ++The error queues are stored in a hash table with one B ++entry for each pid. ERR_get_state() returns the current thread's ++B. An B can hold up to B error ++codes. When more error codes are added, the old ones are overwritten, ++on the assumption that the most recent errors are most important. ++ ++Error strings are also stored in hash table. The hash tables can ++be obtained by calling ERR_get_err_state_table(void) and ++ERR_get_string_table(void) respectively. ++ ++=head1 SEE ALSO ++ ++L, ++L, ++L, ++L, ++L, ++L, ++L, ++L, ++L, ++L, ++L, ++L ++ ++=cut +diff -Naur openssl-0.9.8a.orig/doc/crypto/openssl_rand.pod openssl-0.9.8a/doc/crypto/openssl_rand.pod +--- openssl-0.9.8a.orig/doc/crypto/openssl_rand.pod 1970-01-01 00:00:00.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/openssl_rand.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -0,0 +1,175 @@ ++=pod ++ ++=head1 NAME ++ ++openssl_rand - pseudo-random number generator ++ ++=head1 SYNOPSIS ++ ++ #include ++ ++ int RAND_set_rand_engine(ENGINE *engine); ++ ++ int RAND_bytes(unsigned char *buf, int num); ++ int RAND_pseudo_bytes(unsigned char *buf, int num); ++ ++ void RAND_seed(const void *buf, int num); ++ void RAND_add(const void *buf, int num, int entropy); ++ int RAND_status(void); ++ ++ int RAND_load_file(const char *file, long max_bytes); ++ int RAND_write_file(const char *file); ++ const char *RAND_file_name(char *file, size_t num); ++ ++ int RAND_egd(const char *path); ++ ++ void RAND_set_rand_method(const RAND_METHOD *meth); ++ const RAND_METHOD *RAND_get_rand_method(void); ++ RAND_METHOD *RAND_SSLeay(void); ++ ++ void RAND_cleanup(void); ++ ++ /* For Win32 only */ ++ void RAND_screen(void); ++ int RAND_event(UINT, WPARAM, LPARAM); ++ ++=head1 DESCRIPTION ++ ++Since the introduction of the ENGINE API, the recommended way of controlling ++default implementations is by using the ENGINE API functions. The default ++B, as set by RAND_set_rand_method() and returned by ++RAND_get_rand_method(), is only used if no ENGINE has been set as the default ++"rand" implementation. Hence, these two functions are no longer the recommened ++way to control defaults. ++ ++If an alternative B implementation is being used (either set ++directly or as provided by an ENGINE module), then it is entirely responsible ++for the generation and management of a cryptographically secure PRNG stream. The ++mechanisms described below relate solely to the software PRNG implementation ++built in to OpenSSL and used by default. ++ ++These functions implement a cryptographically secure pseudo-random ++number generator (PRNG). It is used by other library functions for ++example to generate random keys, and applications can use it when they ++need randomness. ++ ++A cryptographic PRNG must be seeded with unpredictable data such as ++mouse movements or keys pressed at random by the user. This is ++described in L. Its state can be saved in a seed file ++(see L) to avoid having to go through the ++seeding process whenever the application is started. ++ ++L describes how to obtain random data from the ++PRNG. ++ ++=head1 INTERNALS ++ ++The RAND_SSLeay() method implements a PRNG based on a cryptographic ++hash function. ++ ++The following description of its design is based on the SSLeay ++documentation: ++ ++First up I will state the things I believe I need for a good RNG. ++ ++=over 4 ++ ++=item 1 ++ ++A good hashing algorithm to mix things up and to convert the RNG 'state' ++to random numbers. ++ ++=item 2 ++ ++An initial source of random 'state'. ++ ++=item 3 ++ ++The state should be very large. If the RNG is being used to generate ++4096 bit RSA keys, 2 2048 bit random strings are required (at a minimum). ++If your RNG state only has 128 bits, you are obviously limiting the ++search space to 128 bits, not 2048. I'm probably getting a little ++carried away on this last point but it does indicate that it may not be ++a bad idea to keep quite a lot of RNG state. It should be easier to ++break a cipher than guess the RNG seed data. ++ ++=item 4 ++ ++Any RNG seed data should influence all subsequent random numbers ++generated. This implies that any random seed data entered will have ++an influence on all subsequent random numbers generated. ++ ++=item 5 ++ ++When using data to seed the RNG state, the data used should not be ++extractable from the RNG state. I believe this should be a ++requirement because one possible source of 'secret' semi random ++data would be a private key or a password. This data must ++not be disclosed by either subsequent random numbers or a ++'core' dump left by a program crash. ++ ++=item 6 ++ ++Given the same initial 'state', 2 systems should deviate in their RNG state ++(and hence the random numbers generated) over time if at all possible. ++ ++=item 7 ++ ++Given the random number output stream, it should not be possible to determine ++the RNG state or the next random number. ++ ++=back ++ ++The algorithm is as follows. ++ ++There is global state made up of a 1023 byte buffer (the 'state'), a ++working hash value ('md'), and a counter ('count'). ++ ++Whenever seed data is added, it is inserted into the 'state' as ++follows. ++ ++The input is chopped up into units of 20 bytes (or less for ++the last block). Each of these blocks is run through the hash ++function as follows: The data passed to the hash function ++is the current 'md', the same number of bytes from the 'state' ++(the location determined by in incremented looping index) as ++the current 'block', the new key data 'block', and 'count' ++(which is incremented after each use). ++The result of this is kept in 'md' and also xored into the ++'state' at the same locations that were used as input into the ++hash function. I ++believe this system addresses points 1 (hash function; currently ++SHA-1), 3 (the 'state'), 4 (via the 'md'), 5 (by the use of a hash ++function and xor). ++ ++When bytes are extracted from the RNG, the following process is used. ++For each group of 10 bytes (or less), we do the following: ++ ++Input into the hash function the local 'md' (which is initialized from ++the global 'md' before any bytes are generated), the bytes that are to ++be overwritten by the random bytes, and bytes from the 'state' ++(incrementing looping index). From this digest output (which is kept ++in 'md'), the top (up to) 10 bytes are returned to the caller and the ++bottom 10 bytes are xored into the 'state'. ++ ++Finally, after we have finished 'num' random bytes for the caller, ++'count' (which is incremented) and the local and global 'md' are fed ++into the hash function and the results are kept in the global 'md'. ++ ++I believe the above addressed points 1 (use of SHA-1), 6 (by hashing ++into the 'state' the 'old' data from the caller that is about to be ++overwritten) and 7 (by not using the 10 bytes given to the caller to ++update the 'state', but they are used to update 'md'). ++ ++So of the points raised, only 2 is not addressed (but see ++L). ++ ++=head1 SEE ALSO ++ ++L, L, ++L, L, ++L, ++L, ++L ++ ++=cut +diff -Naur openssl-0.9.8a.orig/doc/crypto/openssl_threads.pod openssl-0.9.8a/doc/crypto/openssl_threads.pod +--- openssl-0.9.8a.orig/doc/crypto/openssl_threads.pod 1970-01-01 00:00:00.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/openssl_threads.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -0,0 +1,175 @@ ++=pod ++ ++=head1 NAME ++ ++CRYPTO_set_locking_callback, CRYPTO_set_id_callback, CRYPTO_num_locks, ++CRYPTO_set_dynlock_create_callback, CRYPTO_set_dynlock_lock_callback, ++CRYPTO_set_dynlock_destroy_callback, CRYPTO_get_new_dynlockid, ++CRYPTO_destroy_dynlockid, CRYPTO_lock - OpenSSL thread support ++ ++=head1 SYNOPSIS ++ ++ #include ++ ++ void CRYPTO_set_locking_callback(void (*locking_function)(int mode, ++ int n, const char *file, int line)); ++ ++ void CRYPTO_set_id_callback(unsigned long (*id_function)(void)); ++ ++ int CRYPTO_num_locks(void); ++ ++ ++ /* struct CRYPTO_dynlock_value needs to be defined by the user */ ++ struct CRYPTO_dynlock_value; ++ ++ void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value * ++ (*dyn_create_function)(char *file, int line)); ++ void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function) ++ (int mode, struct CRYPTO_dynlock_value *l, ++ const char *file, int line)); ++ void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function) ++ (struct CRYPTO_dynlock_value *l, const char *file, int line)); ++ ++ int CRYPTO_get_new_dynlockid(void); ++ ++ void CRYPTO_destroy_dynlockid(int i); ++ ++ void CRYPTO_lock(int mode, int n, const char *file, int line); ++ ++ #define CRYPTO_w_lock(type) \ ++ CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) ++ #define CRYPTO_w_unlock(type) \ ++ CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) ++ #define CRYPTO_r_lock(type) \ ++ CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__) ++ #define CRYPTO_r_unlock(type) \ ++ CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__) ++ #define CRYPTO_add(addr,amount,type) \ ++ CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__) ++ ++=head1 DESCRIPTION ++ ++OpenSSL can safely be used in multi-threaded applications provided ++that at least two callback functions are set. ++ ++locking_function(int mode, int n, const char *file, int line) is ++needed to perform locking on shared data structures. ++(Note that OpenSSL uses a number of global data structures that ++will be implicitly shared whenever multiple threads use OpenSSL.) ++Multi-threaded applications will crash at random if it is not set. ++ ++locking_function() must be able to handle up to CRYPTO_num_locks() ++different mutex locks. It sets the B-th lock if B & ++B, and releases it otherwise. ++ ++B and B are the file number of the function setting the ++lock. They can be useful for debugging. ++ ++id_function(void) is a function that returns a thread ID, for example ++pthread_self() if it returns an integer (see NOTES below). It isn't ++needed on Windows nor on platforms where getpid() returns a different ++ID for each thread (see NOTES below). ++ ++Additionally, OpenSSL supports dynamic locks, and sometimes, some parts ++of OpenSSL need it for better performance. To enable this, the following ++is required: ++ ++=over 4 ++ ++=item * ++Three additional callback function, dyn_create_function, dyn_lock_function ++and dyn_destroy_function. ++ ++=item * ++A structure defined with the data that each lock needs to handle. ++ ++=back ++ ++struct CRYPTO_dynlock_value has to be defined to contain whatever structure ++is needed to handle locks. ++ ++dyn_create_function(const char *file, int line) is needed to create a ++lock. Multi-threaded applications might crash at random if it is not set. ++ ++dyn_lock_function(int mode, CRYPTO_dynlock *l, const char *file, int line) ++is needed to perform locking off dynamic lock numbered n. Multi-threaded ++applications might crash at random if it is not set. ++ ++dyn_destroy_function(CRYPTO_dynlock *l, const char *file, int line) is ++needed to destroy the lock l. Multi-threaded applications might crash at ++random if it is not set. ++ ++CRYPTO_get_new_dynlockid() is used to create locks. It will call ++dyn_create_function for the actual creation. ++ ++CRYPTO_destroy_dynlockid() is used to destroy locks. It will call ++dyn_destroy_function for the actual destruction. ++ ++CRYPTO_lock() is used to lock and unlock the locks. mode is a bitfield ++describing what should be done with the lock. n is the number of the ++lock as returned from CRYPTO_get_new_dynlockid(). mode can be combined ++from the following values. These values are pairwise exclusive, with ++undefined behaviour if misused (for example, CRYPTO_READ and CRYPTO_WRITE ++should not be used together): ++ ++ CRYPTO_LOCK 0x01 ++ CRYPTO_UNLOCK 0x02 ++ CRYPTO_READ 0x04 ++ CRYPTO_WRITE 0x08 ++ ++=head1 RETURN VALUES ++ ++CRYPTO_num_locks() returns the required number of locks. ++ ++CRYPTO_get_new_dynlockid() returns the index to the newly created lock. ++ ++The other functions return no values. ++ ++=head1 NOTES ++ ++You can find out if OpenSSL was configured with thread support: ++ ++ #define OPENSSL_THREAD_DEFINES ++ #include ++ #if defined(OPENSSL_THREADS) ++ // thread support enabled ++ #else ++ // no thread support ++ #endif ++ ++Also, dynamic locks are currently not used internally by OpenSSL, but ++may do so in the future. ++ ++Defining id_function(void) has it's own issues. Generally speaking, ++pthread_self() should be used, even on platforms where getpid() gives ++different answers in each thread, since that may depend on the machine ++the program is run on, not the machine where the program is being ++compiled. For instance, Red Hat 8 Linux and earlier used ++LinuxThreads, whose getpid() returns a different value for each ++thread. Red Hat 9 Linux and later use NPTL, which is ++Posix-conformant, and has a getpid() that returns the same value for ++all threads in a process. A program compiled on Red Hat 8 and run on ++Red Hat 9 will therefore see getpid() returning the same value for ++all threads. ++ ++There is still the issue of platforms where pthread_self() returns ++something other than an integer. This is a bit unusual, and this ++manual has no cookbook solution for that case. ++ ++=head1 EXAMPLES ++ ++B shows examples of the callback functions on ++Solaris, Irix and Win32. ++ ++=head1 HISTORY ++ ++CRYPTO_set_locking_callback() and CRYPTO_set_id_callback() are ++available in all versions of SSLeay and OpenSSL. ++CRYPTO_num_locks() was added in OpenSSL 0.9.4. ++All functions dealing with dynamic locks were added in OpenSSL 0.9.5b-dev. ++ ++=head1 SEE ALSO ++ ++L ++ ++=cut +diff -Naur openssl-0.9.8a.orig/doc/crypto/rand.pod openssl-0.9.8a/doc/crypto/rand.pod +--- openssl-0.9.8a.orig/doc/crypto/rand.pod 2002-08-05 16:27:01.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/rand.pod 1970-01-01 00:00:00.000000000 +0000 +@@ -1,175 +0,0 @@ +-=pod +- +-=head1 NAME +- +-rand - pseudo-random number generator +- +-=head1 SYNOPSIS +- +- #include +- +- int RAND_set_rand_engine(ENGINE *engine); +- +- int RAND_bytes(unsigned char *buf, int num); +- int RAND_pseudo_bytes(unsigned char *buf, int num); +- +- void RAND_seed(const void *buf, int num); +- void RAND_add(const void *buf, int num, int entropy); +- int RAND_status(void); +- +- int RAND_load_file(const char *file, long max_bytes); +- int RAND_write_file(const char *file); +- const char *RAND_file_name(char *file, size_t num); +- +- int RAND_egd(const char *path); +- +- void RAND_set_rand_method(const RAND_METHOD *meth); +- const RAND_METHOD *RAND_get_rand_method(void); +- RAND_METHOD *RAND_SSLeay(void); +- +- void RAND_cleanup(void); +- +- /* For Win32 only */ +- void RAND_screen(void); +- int RAND_event(UINT, WPARAM, LPARAM); +- +-=head1 DESCRIPTION +- +-Since the introduction of the ENGINE API, the recommended way of controlling +-default implementations is by using the ENGINE API functions. The default +-B, as set by RAND_set_rand_method() and returned by +-RAND_get_rand_method(), is only used if no ENGINE has been set as the default +-"rand" implementation. Hence, these two functions are no longer the recommened +-way to control defaults. +- +-If an alternative B implementation is being used (either set +-directly or as provided by an ENGINE module), then it is entirely responsible +-for the generation and management of a cryptographically secure PRNG stream. The +-mechanisms described below relate solely to the software PRNG implementation +-built in to OpenSSL and used by default. +- +-These functions implement a cryptographically secure pseudo-random +-number generator (PRNG). It is used by other library functions for +-example to generate random keys, and applications can use it when they +-need randomness. +- +-A cryptographic PRNG must be seeded with unpredictable data such as +-mouse movements or keys pressed at random by the user. This is +-described in L. Its state can be saved in a seed file +-(see L) to avoid having to go through the +-seeding process whenever the application is started. +- +-L describes how to obtain random data from the +-PRNG. +- +-=head1 INTERNALS +- +-The RAND_SSLeay() method implements a PRNG based on a cryptographic +-hash function. +- +-The following description of its design is based on the SSLeay +-documentation: +- +-First up I will state the things I believe I need for a good RNG. +- +-=over 4 +- +-=item 1 +- +-A good hashing algorithm to mix things up and to convert the RNG 'state' +-to random numbers. +- +-=item 2 +- +-An initial source of random 'state'. +- +-=item 3 +- +-The state should be very large. If the RNG is being used to generate +-4096 bit RSA keys, 2 2048 bit random strings are required (at a minimum). +-If your RNG state only has 128 bits, you are obviously limiting the +-search space to 128 bits, not 2048. I'm probably getting a little +-carried away on this last point but it does indicate that it may not be +-a bad idea to keep quite a lot of RNG state. It should be easier to +-break a cipher than guess the RNG seed data. +- +-=item 4 +- +-Any RNG seed data should influence all subsequent random numbers +-generated. This implies that any random seed data entered will have +-an influence on all subsequent random numbers generated. +- +-=item 5 +- +-When using data to seed the RNG state, the data used should not be +-extractable from the RNG state. I believe this should be a +-requirement because one possible source of 'secret' semi random +-data would be a private key or a password. This data must +-not be disclosed by either subsequent random numbers or a +-'core' dump left by a program crash. +- +-=item 6 +- +-Given the same initial 'state', 2 systems should deviate in their RNG state +-(and hence the random numbers generated) over time if at all possible. +- +-=item 7 +- +-Given the random number output stream, it should not be possible to determine +-the RNG state or the next random number. +- +-=back +- +-The algorithm is as follows. +- +-There is global state made up of a 1023 byte buffer (the 'state'), a +-working hash value ('md'), and a counter ('count'). +- +-Whenever seed data is added, it is inserted into the 'state' as +-follows. +- +-The input is chopped up into units of 20 bytes (or less for +-the last block). Each of these blocks is run through the hash +-function as follows: The data passed to the hash function +-is the current 'md', the same number of bytes from the 'state' +-(the location determined by in incremented looping index) as +-the current 'block', the new key data 'block', and 'count' +-(which is incremented after each use). +-The result of this is kept in 'md' and also xored into the +-'state' at the same locations that were used as input into the +-hash function. I +-believe this system addresses points 1 (hash function; currently +-SHA-1), 3 (the 'state'), 4 (via the 'md'), 5 (by the use of a hash +-function and xor). +- +-When bytes are extracted from the RNG, the following process is used. +-For each group of 10 bytes (or less), we do the following: +- +-Input into the hash function the local 'md' (which is initialized from +-the global 'md' before any bytes are generated), the bytes that are to +-be overwritten by the random bytes, and bytes from the 'state' +-(incrementing looping index). From this digest output (which is kept +-in 'md'), the top (up to) 10 bytes are returned to the caller and the +-bottom 10 bytes are xored into the 'state'. +- +-Finally, after we have finished 'num' random bytes for the caller, +-'count' (which is incremented) and the local and global 'md' are fed +-into the hash function and the results are kept in the global 'md'. +- +-I believe the above addressed points 1 (use of SHA-1), 6 (by hashing +-into the 'state' the 'old' data from the caller that is about to be +-overwritten) and 7 (by not using the 10 bytes given to the caller to +-update the 'state', but they are used to update 'md'). +- +-So of the points raised, only 2 is not addressed (but see +-L). +- +-=head1 SEE ALSO +- +-L, L, +-L, L, +-L, +-L, +-L +- +-=cut +diff -Naur openssl-0.9.8a.orig/doc/crypto/rsa.pod openssl-0.9.8a/doc/crypto/rsa.pod +--- openssl-0.9.8a.orig/doc/crypto/rsa.pod 2002-08-04 21:08:36.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/rsa.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -108,7 +108,7 @@ + =head1 SEE ALSO + + L, L, L, L, +-L, L, L, ++L, L, L, + L, + L, L, + L, +diff -Naur openssl-0.9.8a.orig/doc/crypto/threads.pod openssl-0.9.8a/doc/crypto/threads.pod +--- openssl-0.9.8a.orig/doc/crypto/threads.pod 2005-06-18 05:52:23.000000000 +0000 ++++ openssl-0.9.8a/doc/crypto/threads.pod 1970-01-01 00:00:00.000000000 +0000 +@@ -1,175 +0,0 @@ +-=pod +- +-=head1 NAME +- +-CRYPTO_set_locking_callback, CRYPTO_set_id_callback, CRYPTO_num_locks, +-CRYPTO_set_dynlock_create_callback, CRYPTO_set_dynlock_lock_callback, +-CRYPTO_set_dynlock_destroy_callback, CRYPTO_get_new_dynlockid, +-CRYPTO_destroy_dynlockid, CRYPTO_lock - OpenSSL thread support +- +-=head1 SYNOPSIS +- +- #include +- +- void CRYPTO_set_locking_callback(void (*locking_function)(int mode, +- int n, const char *file, int line)); +- +- void CRYPTO_set_id_callback(unsigned long (*id_function)(void)); +- +- int CRYPTO_num_locks(void); +- +- +- /* struct CRYPTO_dynlock_value needs to be defined by the user */ +- struct CRYPTO_dynlock_value; +- +- void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value * +- (*dyn_create_function)(char *file, int line)); +- void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function) +- (int mode, struct CRYPTO_dynlock_value *l, +- const char *file, int line)); +- void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function) +- (struct CRYPTO_dynlock_value *l, const char *file, int line)); +- +- int CRYPTO_get_new_dynlockid(void); +- +- void CRYPTO_destroy_dynlockid(int i); +- +- void CRYPTO_lock(int mode, int n, const char *file, int line); +- +- #define CRYPTO_w_lock(type) \ +- CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) +- #define CRYPTO_w_unlock(type) \ +- CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) +- #define CRYPTO_r_lock(type) \ +- CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__) +- #define CRYPTO_r_unlock(type) \ +- CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__) +- #define CRYPTO_add(addr,amount,type) \ +- CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__) +- +-=head1 DESCRIPTION +- +-OpenSSL can safely be used in multi-threaded applications provided +-that at least two callback functions are set. +- +-locking_function(int mode, int n, const char *file, int line) is +-needed to perform locking on shared data structures. +-(Note that OpenSSL uses a number of global data structures that +-will be implicitly shared whenever multiple threads use OpenSSL.) +-Multi-threaded applications will crash at random if it is not set. +- +-locking_function() must be able to handle up to CRYPTO_num_locks() +-different mutex locks. It sets the B-th lock if B & +-B, and releases it otherwise. +- +-B and B are the file number of the function setting the +-lock. They can be useful for debugging. +- +-id_function(void) is a function that returns a thread ID, for example +-pthread_self() if it returns an integer (see NOTES below). It isn't +-needed on Windows nor on platforms where getpid() returns a different +-ID for each thread (see NOTES below). +- +-Additionally, OpenSSL supports dynamic locks, and sometimes, some parts +-of OpenSSL need it for better performance. To enable this, the following +-is required: +- +-=over 4 +- +-=item * +-Three additional callback function, dyn_create_function, dyn_lock_function +-and dyn_destroy_function. +- +-=item * +-A structure defined with the data that each lock needs to handle. +- +-=back +- +-struct CRYPTO_dynlock_value has to be defined to contain whatever structure +-is needed to handle locks. +- +-dyn_create_function(const char *file, int line) is needed to create a +-lock. Multi-threaded applications might crash at random if it is not set. +- +-dyn_lock_function(int mode, CRYPTO_dynlock *l, const char *file, int line) +-is needed to perform locking off dynamic lock numbered n. Multi-threaded +-applications might crash at random if it is not set. +- +-dyn_destroy_function(CRYPTO_dynlock *l, const char *file, int line) is +-needed to destroy the lock l. Multi-threaded applications might crash at +-random if it is not set. +- +-CRYPTO_get_new_dynlockid() is used to create locks. It will call +-dyn_create_function for the actual creation. +- +-CRYPTO_destroy_dynlockid() is used to destroy locks. It will call +-dyn_destroy_function for the actual destruction. +- +-CRYPTO_lock() is used to lock and unlock the locks. mode is a bitfield +-describing what should be done with the lock. n is the number of the +-lock as returned from CRYPTO_get_new_dynlockid(). mode can be combined +-from the following values. These values are pairwise exclusive, with +-undefined behaviour if misused (for example, CRYPTO_READ and CRYPTO_WRITE +-should not be used together): +- +- CRYPTO_LOCK 0x01 +- CRYPTO_UNLOCK 0x02 +- CRYPTO_READ 0x04 +- CRYPTO_WRITE 0x08 +- +-=head1 RETURN VALUES +- +-CRYPTO_num_locks() returns the required number of locks. +- +-CRYPTO_get_new_dynlockid() returns the index to the newly created lock. +- +-The other functions return no values. +- +-=head1 NOTES +- +-You can find out if OpenSSL was configured with thread support: +- +- #define OPENSSL_THREAD_DEFINES +- #include +- #if defined(OPENSSL_THREADS) +- // thread support enabled +- #else +- // no thread support +- #endif +- +-Also, dynamic locks are currently not used internally by OpenSSL, but +-may do so in the future. +- +-Defining id_function(void) has it's own issues. Generally speaking, +-pthread_self() should be used, even on platforms where getpid() gives +-different answers in each thread, since that may depend on the machine +-the program is run on, not the machine where the program is being +-compiled. For instance, Red Hat 8 Linux and earlier used +-LinuxThreads, whose getpid() returns a different value for each +-thread. Red Hat 9 Linux and later use NPTL, which is +-Posix-conformant, and has a getpid() that returns the same value for +-all threads in a process. A program compiled on Red Hat 8 and run on +-Red Hat 9 will therefore see getpid() returning the same value for +-all threads. +- +-There is still the issue of platforms where pthread_self() returns +-something other than an integer. This is a bit unusual, and this +-manual has no cookbook solution for that case. +- +-=head1 EXAMPLES +- +-B shows examples of the callback functions on +-Solaris, Irix and Win32. +- +-=head1 HISTORY +- +-CRYPTO_set_locking_callback() and CRYPTO_set_id_callback() are +-available in all versions of SSLeay and OpenSSL. +-CRYPTO_num_locks() was added in OpenSSL 0.9.4. +-All functions dealing with dynamic locks were added in OpenSSL 0.9.5b-dev. +- +-=head1 SEE ALSO +- +-L +- +-=cut +diff -Naur openssl-0.9.8a.orig/doc/ssl/SSL_get_error.pod openssl-0.9.8a/doc/ssl/SSL_get_error.pod +--- openssl-0.9.8a.orig/doc/ssl/SSL_get_error.pod 2005-03-30 11:50:14.000000000 +0000 ++++ openssl-0.9.8a/doc/ssl/SSL_get_error.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -105,7 +105,7 @@ + + =head1 SEE ALSO + +-L, L ++L, L + + =head1 HISTORY + +diff -Naur openssl-0.9.8a.orig/doc/ssl/SSL_want.pod openssl-0.9.8a/doc/ssl/SSL_want.pod +--- openssl-0.9.8a.orig/doc/ssl/SSL_want.pod 2005-03-30 11:50:14.000000000 +0000 ++++ openssl-0.9.8a/doc/ssl/SSL_want.pod 2005-11-14 03:59:59.000000000 +0000 +@@ -72,6 +72,6 @@ + + =head1 SEE ALSO + +-L, L, L ++L, L, L + + =cut diff --git a/base-source/openssl-0.9.8b.tar.gz.tgz b/base-source/openssl-0.9.8b.tar.gz.tgz new file mode 100644 index 0000000..cf7a997 Binary files /dev/null and b/base-source/openssl-0.9.8b.tar.gz.tgz differ diff --git a/base-source/patch-2.5.4.tar.gz b/base-source/patch-2.5.4.tar.gz new file mode 100644 index 0000000..07847eb Binary files /dev/null and b/base-source/patch-2.5.4.tar.gz differ diff --git a/base-source/pciutils-2.2.3.tar.bz2 b/base-source/pciutils-2.2.3.tar.bz2 new file mode 100644 index 0000000..f437bf6 Binary files /dev/null and b/base-source/pciutils-2.2.3.tar.bz2 differ diff --git a/base-source/perl-5.8.8-libc-2.patch b/base-source/perl-5.8.8-libc-2.patch new file mode 100644 index 0000000..f31910b --- /dev/null +++ b/base-source/perl-5.8.8-libc-2.patch @@ -0,0 +1,32 @@ +Submitted By: Anderson Lizardo +Date: 2006-02-15 +Initial Package Version: 5.8.8 +Origin: based on current LFS-BOOK patch (perl-5.8.0-libc-2.patch) +Description: this patch adapts some hard-wired paths to the C library. + It uses the $prefix variable to locate the correct libc. + +diff -Naur perl-5.8.8.orig/hints/linux.sh perl-5.8.8/hints/linux.sh +--- perl-5.8.8.orig/hints/linux.sh 2005-11-18 01:18:45.000000000 +0000 ++++ perl-5.8.8/hints/linux.sh 2006-02-12 12:20:32.000000000 +0000 +@@ -52,9 +52,9 @@ + # We don't use __GLIBC__ and __GLIBC_MINOR__ because they + # are insufficiently precise to distinguish things like + # libc-2.0.6 and libc-2.0.7. +-if test -L /lib/libc.so.6; then +- libc=`ls -l /lib/libc.so.6 | awk '{print $NF}'` +- libc=/lib/$libc ++if test -L ${prefix}/lib/libc.so.6; then ++ libc=`ls -l ${prefix}/lib/libc.so.6 | awk '{print $NF}'` ++ libc=${prefix}/lib/$libc + fi + + # Configure may fail to find lstat() since it's a static/inline +@@ -330,3 +330,8 @@ + libswanted="$*" + ;; + esac ++ ++locincpth="" ++loclibpth="" ++glibpth="${prefix}/lib" ++usrinc="${prefix}/include" diff --git a/base-source/perl-5.8.8.tar.bz2 b/base-source/perl-5.8.8.tar.bz2 new file mode 100644 index 0000000..95d04d0 Binary files /dev/null and b/base-source/perl-5.8.8.tar.bz2 differ diff --git a/base-source/pkg-config-0.20.tar.gz b/base-source/pkg-config-0.20.tar.gz new file mode 100644 index 0000000..573fe1a Binary files /dev/null and b/base-source/pkg-config-0.20.tar.gz differ diff --git a/base-source/procps-3.2.6(2).tar.gz b/base-source/procps-3.2.6(2).tar.gz new file mode 100644 index 0000000..29edcc2 Binary files /dev/null and b/base-source/procps-3.2.6(2).tar.gz differ diff --git a/base-source/procps-3.2.6.tar.gz b/base-source/procps-3.2.6.tar.gz new file mode 100644 index 0000000..29edcc2 Binary files /dev/null and b/base-source/procps-3.2.6.tar.gz differ diff --git a/base-source/proftpd-1.3.0.tar.gz b/base-source/proftpd-1.3.0.tar.gz new file mode 100644 index 0000000..fa206bf Binary files /dev/null and b/base-source/proftpd-1.3.0.tar.gz differ diff --git a/base-source/psmisc-22.2.tar.gz b/base-source/psmisc-22.2.tar.gz new file mode 100644 index 0000000..d04c1a0 Binary files /dev/null and b/base-source/psmisc-22.2.tar.gz differ diff --git a/base-source/readline-5.1-fixes-3.patch b/base-source/readline-5.1-fixes-3.patch new file mode 100644 index 0000000..e0fb875 --- /dev/null +++ b/base-source/readline-5.1-fixes-3.patch @@ -0,0 +1,128 @@ +Submitted By: Matthew Burgess (matthew at linuxfromscratch dot org) +Date: 2006-03-17 +Initial Package Version: 5.1 +Origin: http://ftp.gnu.org/gnu/readline/readline-5.1-patches/ +Upstream Status: From Upstream +Description: Contains Patch 001-004 from Upstream + +diff -Naur readline-5.1.orig/display.c readline-5.1/display.c +--- readline-5.1.orig/display.c 2005-11-30 19:05:02.000000000 +0000 ++++ readline-5.1/display.c 2006-03-17 16:03:09.000000000 +0000 +@@ -1983,11 +1983,15 @@ + int pchar; + { + int len; +- char *pmt; ++ char *pmt, *p; + + rl_save_prompt (); + +- if (saved_local_prompt == 0) ++ /* We've saved the prompt, and can do anything with the various prompt ++ strings we need before they're restored. We want the unexpanded ++ portion of the prompt string after any final newline. */ ++ p = rl_prompt ? strrchr (rl_prompt, '\n') : 0; ++ if (p == 0) + { + len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0; + pmt = (char *)xmalloc (len + 2); +@@ -1998,19 +2002,17 @@ + } + else + { +- len = *saved_local_prompt ? strlen (saved_local_prompt) : 0; ++ p++; ++ len = strlen (p); + pmt = (char *)xmalloc (len + 2); + if (len) +- strcpy (pmt, saved_local_prompt); ++ strcpy (pmt, p); + pmt[len] = pchar; + pmt[len+1] = '\0'; +- local_prompt = savestring (pmt); +- prompt_last_invisible = saved_last_invisible; +- prompt_visible_length = saved_visible_length + 1; +- } ++ } + ++ /* will be overwritten by expand_prompt, called from rl_message */ + prompt_physical_chars = saved_physical_chars + 1; +- + return pmt; + } + +diff -Naur readline-5.1.orig/readline.c readline-5.1/readline.c +--- readline-5.1.orig/readline.c 2005-07-05 02:29:35.000000000 +0000 ++++ readline-5.1/readline.c 2006-03-17 16:03:05.000000000 +0000 +@@ -282,6 +282,7 @@ + { + FREE (rl_prompt); + rl_prompt = prompt ? savestring (prompt) : (char *)NULL; ++ rl_display_prompt = rl_prompt ? rl_prompt : ""; + + rl_visible_prompt_length = rl_expand_prompt (rl_prompt); + return 0; +@@ -714,7 +715,7 @@ + + rl_dispatching = 1; + RL_SETSTATE(RL_STATE_DISPATCHING); +- r = (*map[key].function)(rl_numeric_arg * rl_arg_sign, key); ++ (*map[key].function)(rl_numeric_arg * rl_arg_sign, key); + RL_UNSETSTATE(RL_STATE_DISPATCHING); + rl_dispatching = 0; + +diff -Naur readline-5.1.orig/terminal.c readline-5.1/terminal.c +--- readline-5.1.orig/terminal.c 2005-11-13 01:46:54.000000000 +0000 ++++ readline-5.1/terminal.c 2006-03-17 16:03:02.000000000 +0000 +@@ -122,7 +122,7 @@ + static char *_rl_visible_bell; + + /* Non-zero means the terminal can auto-wrap lines. */ +-int _rl_term_autowrap; ++int _rl_term_autowrap = -1; + + /* Non-zero means that this terminal has a meta key. */ + static int term_has_meta; +@@ -274,6 +274,9 @@ + _rl_set_screen_size (rows, cols) + int rows, cols; + { ++ if (_rl_term_autowrap == -1) ++ _rl_init_terminal_io (rl_terminal_name); ++ + if (rows > 0) + _rl_screenheight = rows; + if (cols > 0) +diff -Naur readline-5.1.orig/text.c readline-5.1/text.c +--- readline-5.1.orig/text.c 2005-09-24 23:06:07.000000000 +0000 ++++ readline-5.1/text.c 2006-03-17 16:02:58.000000000 +0000 +@@ -1071,8 +1071,6 @@ + rl_delete (count, key) + int count, key; + { +- int r; +- + if (count < 0) + return (_rl_rubout_char (-count, key)); + +@@ -1090,17 +1088,17 @@ + else + rl_forward_byte (count, key); + +- r = rl_kill_text (orig_point, rl_point); ++ rl_kill_text (orig_point, rl_point); + rl_point = orig_point; +- return r; + } + else + { + int new_point; + + new_point = MB_NEXTCHAR (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO); +- return (rl_delete_text (rl_point, new_point)); ++ rl_delete_text (rl_point, new_point); + } ++ return 0; + } + + /* Delete the character under the cursor, unless the insertion diff --git a/base-source/readline-5.1.tar.gz b/base-source/readline-5.1.tar.gz new file mode 100644 index 0000000..54db071 Binary files /dev/null and b/base-source/readline-5.1.tar.gz differ diff --git a/base-source/sed-4.1.5.tar.gz b/base-source/sed-4.1.5.tar.gz new file mode 100644 index 0000000..7273f15 Binary files /dev/null and b/base-source/sed-4.1.5.tar.gz differ diff --git a/base-source/setserial-2.17.tar.gz b/base-source/setserial-2.17.tar.gz new file mode 100644 index 0000000..8c3f238 Binary files /dev/null and b/base-source/setserial-2.17.tar.gz differ diff --git a/base-source/shadow-4.0.15.tar.bz2 b/base-source/shadow-4.0.15.tar.bz2 new file mode 100644 index 0000000..1c16169 Binary files /dev/null and b/base-source/shadow-4.0.15.tar.bz2 differ diff --git a/base-source/sshfs-fuse-1.6.tar.gz b/base-source/sshfs-fuse-1.6.tar.gz new file mode 100644 index 0000000..4f14065 Binary files /dev/null and b/base-source/sshfs-fuse-1.6.tar.gz differ diff --git a/base-source/subversion-1.3.2.tar.gz b/base-source/subversion-1.3.2.tar.gz new file mode 100644 index 0000000..e031b53 Binary files /dev/null and b/base-source/subversion-1.3.2.tar.gz differ diff --git a/base-source/sysklogd-1.4.1-8bit-1.patch b/base-source/sysklogd-1.4.1-8bit-1.patch new file mode 100644 index 0000000..de12167 --- /dev/null +++ b/base-source/sysklogd-1.4.1-8bit-1.patch @@ -0,0 +1,23 @@ +Submitted By: Alexander E. Patrakov +Date: 2004-05-09 +Initial Package Version: 1.4.1 +Origin: Alexander E. Patrakov +Upstream status: not submitted yet, probably will not be accepted +Description: Weakens rules for determining whether a character is printable. +Now only bytes < 0x20 and the 0x7f byte are considered to be unprintable. +The original rules were valid for ISO-8859-* and KOI*. + +Without this fix, logging meaningful Russian messages in UTF-8 is impossible. + +diff -u sysklogd-1.4.1/syslogd.c sysklogd-1.4.1.fixed/syslogd.c +--- sysklogd-1.4.1/syslogd.c 2001-03-12 00:40:10.000000000 +0500 ++++ sysklogd-1.4.1.fixed/syslogd.c 2004-05-09 09:05:42.972864104 +0600 +@@ -1449,7 +1449,7 @@ + else if (c < 040) { + *q++ = '^'; + *q++ = c ^ 0100; +- } else if (c == 0177 || (c & 0177) < 040) { ++ } else if (c == 0177) { + *q++ = '\\'; + *q++ = '0' + ((c & 0300) >> 6); + *q++ = '0' + ((c & 0070) >> 3); diff --git a/base-source/sysklogd-1.4.1-fixes-1.patch b/base-source/sysklogd-1.4.1-fixes-1.patch new file mode 100644 index 0000000..68ac87c --- /dev/null +++ b/base-source/sysklogd-1.4.1-fixes-1.patch @@ -0,0 +1,833 @@ +Submitted By: Robert Connolly (ashes) +Date: 2005-01-23 +Initial Package Version: 1.4.1 +Upstream Status: Not submitted +Origin: http://www.infodrom.org/projects/sysklogd/cvs.php3 +Description: This patch is a cvs snapshot update as of 20050123. +Minus the debain and CVS directories. See the CHANGES. + +diff -Naur sysklogd-1.4.1/CHANGES sysklogd-20050123/CHANGES +--- sysklogd-1.4.1/CHANGES 2001-03-11 14:35:51.000000000 -0500 ++++ sysklogd-20050123/CHANGES 2005-01-15 14:14:21.000000000 -0500 +@@ -1,3 +1,42 @@ ++Version 1.4.2 ++ ++ . Dmitry V. Levin ++ - Close file descriptor in FindSymbolFile() in ksym.c in order not to ++ leak file descriptors. ++ . Solar Designer ++ - improve crunch_list() ++ - Prevent potential buffer overflow in reading messages from the ++ kernel log ringbuffer. ++ - Ensure that "len" is not placed in a register, and that the ++ endtty() signal handler is not installed too early which could ++ cause a segmentation fault or worse. ++ . Steve Grubb ++ - fix memory calculation in crunch_list() ++ . Martin Schulze ++ - klogd will reconnect to the logger (mostly syslogd) after it went ++ away ++ - On heavily loaded system syslog will not spit out error messages ++ anymore when recvfrom() results in EAGAIN ++ - Makefile improvements ++ - Local copy of module.h ++ - Improved sysklogd.8 ++ - Always log with syslogd's timezone and locale ++ - Remove trailing newline when forwarding messages ++ . Jon Burgess ++ - Moved the installation of the signal handler up a little bit so it ++ guaranteed to be available when the child is forked, hence, fixing a ++ race condition. This used to create problems with UML and fast ++ machines. ++ . Greg Trounson ++ - Improved README.linux ++ . Ulf Härnhammar ++ - Bondary check for fscanf() in InitKsyms() and CheckMapVersion() ++ . Colin Phipps ++ - Don't block on the network socket in case of package los ++ . Dirk Mueller ++ - Don't crash when filesize limit is reached (e.g. without LFS) ++ ++ + Version 1.4.1 + + . klogd will set the console log level only if `-c' is given on the +@@ -30,3 +69,9 @@ + . Olaf Kirch + - Remove Unix Domain Sockets and switch to Datagram Unix Sockets + . Several bugfixes and improvements, please refer to the .c files ++ ++ ++Local variables: ++mode: indented-text ++fill-column: 72 ++End: +diff -Naur sysklogd-1.4.1/klogd.8 sysklogd-20050123/klogd.8 +--- sysklogd-1.4.1/klogd.8 2001-03-11 14:35:51.000000000 -0500 ++++ sysklogd-20050123/klogd.8 2001-03-11 18:00:51.000000000 -0500 +@@ -321,7 +321,7 @@ + .B klogd + to reload the module symbol information whenever a protection fault + is detected. Caution should be used before invoking the program in +-\'paranoid\' mode. The stability of the kernel and the operating ++\&'paranoid\&' mode. The stability of the kernel and the operating + environment is always under question when a protection fault occurs. + Since the klogd daemon must execute system calls in order to read the + module symbol information there is the possibility that the system may +diff -Naur sysklogd-1.4.1/klogd.c sysklogd-20050123/klogd.c +--- sysklogd-1.4.1/klogd.c 2001-03-11 14:40:10.000000000 -0500 ++++ sysklogd-20050123/klogd.c 2004-04-29 09:29:03.000000000 -0400 +@@ -243,6 +243,9 @@ + * people have submitted patches: Troels Walsted Hansen + * , Wolfgang Oertl + * and Thomas Roessler. ++ * Thu Apr 29 15:24:07 2004: Solar Designer ++ * Prevent potential buffer overflow in reading messages from the ++ * kernel log rinbuffer. + */ + + +@@ -938,7 +941,7 @@ + * messages into this fresh buffer. + */ + memset(log_buffer, '\0', sizeof(log_buffer)); +- if ( (rdcnt = ksyslog(2, log_buffer, sizeof(log_buffer))) < 0 ) ++ if ( (rdcnt = ksyslog(2, log_buffer, sizeof(log_buffer)-1)) < 0 ) + { + if ( errno == EINTR ) + return; +diff -Naur sysklogd-1.4.1/ksym.c sysklogd-20050123/ksym.c +--- sysklogd-1.4.1/ksym.c 2000-09-12 17:53:31.000000000 -0400 ++++ sysklogd-20050123/ksym.c 2004-07-16 02:48:27.000000000 -0400 +@@ -105,6 +105,15 @@ + * + * Tue Sep 12 23:48:12 CEST 2000: Martin Schulze + * Close symbol file in InitKsyms() when an error occurred. ++ * ++ * Thu Apr 29 18:07:16 CEST 2004: Dmitry Levin ++ * Close file descriptor in FindSymbolFile() in order not to leak ++ * file descriptors. ++ * ++ * Fri Jul 16 08:32:49 CEST 2004: Ulf Härnhammar ++ * Added boundary check for fscanf() in InitKsyms() and ++ * CheckMapVersion() to prevent an unintended crash when reading ++ * an incorrect System.map. + */ + + +@@ -236,7 +245,7 @@ + */ + while ( !feof(sym_file) ) + { +- if ( fscanf(sym_file, "%lx %c %s\n", &address, &type, sym) ++ if ( fscanf(sym_file, "%lx %c %511s\n", &address, &type, sym) + != 3 ) + { + Syslog(LOG_ERR, "Error in symbol table input (#1)."); +@@ -344,6 +353,7 @@ + if ( (sym_file = fopen(symfile, "r")) != (FILE *) 0 ) { + if (CheckMapVersion(symfile) == 1) + file = symfile; ++ fclose (sym_file); + } + if (sym_file == (FILE *) 0 || file == (char *) 0) { + sprintf (symfile, "%s", *mf); +@@ -352,6 +362,7 @@ + if ( (sym_file = fopen(symfile, "r")) != (FILE *) 0 ) { + if (CheckMapVersion(symfile) == 1) + file = symfile; ++ fclose (sym_file); + } + } + +@@ -533,7 +544,7 @@ + version = 0; + while ( !feof(sym_file) && (version == 0) ) + { +- if ( fscanf(sym_file, "%lx %c %s\n", &address, \ ++ if ( fscanf(sym_file, "%lx %c %511s\n", &address, \ + &type, sym) != 3 ) + { + Syslog(LOG_ERR, "Error in symbol table input (#2)."); +@@ -899,3 +910,11 @@ + return; + } + #endif ++ ++/* ++ * Local variables: ++ * c-indent-level: 8 ++ * c-basic-offset: 8 ++ * tab-width: 8 ++ * End: ++ */ +diff -Naur sysklogd-1.4.1/ksym_mod.c sysklogd-20050123/ksym_mod.c +--- sysklogd-1.4.1/ksym_mod.c 2000-09-12 17:15:28.000000000 -0400 ++++ sysklogd-20050123/ksym_mod.c 2004-03-31 10:47:08.000000000 -0500 +@@ -78,6 +78,11 @@ + * + * Tue Sep 12 23:11:13 CEST 2000: Martin Schulze + * Changed llseek() to lseek64() in order to skip a libc warning. ++ * ++ * Wed Mar 31 17:35:01 CEST 2004: Martin Schulze ++ * Removed references to since it doesn't work ++ * anymore with its recent content from Linux 2.4/2.6, created ++ * module.h locally instead. + */ + + +@@ -89,11 +94,12 @@ + #include + #include + #include ++#include "module.h" + #if !defined(__GLIBC__) + #include +-#include ++#include + #else /* __GLIBC__ */ +-#include ++#include + extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence)); + extern int get_kernel_syms __P ((struct kernel_sym *__table)); + #endif /* __GLIBC__ */ +@@ -107,7 +113,7 @@ + + #if !defined(__GLIBC__) + /* +- * The following bit uses some kernel/library magic to product what ++ * The following bit uses some kernel/library magic to produce what + * looks like a function call to user level code. This function is + * actually a system call in disguise. The purpose of the getsyms + * call is to return a current copy of the in-kernel symbol table. +diff -Naur sysklogd-1.4.1/Makefile sysklogd-20050123/Makefile +--- sysklogd-1.4.1/Makefile 1998-10-12 16:25:15.000000000 -0400 ++++ sysklogd-20050123/Makefile 2004-04-29 07:04:03.000000000 -0400 +@@ -4,12 +4,15 @@ + #CFLAGS= -g -DSYSV -Wall + #LDFLAGS= -g + CFLAGS= $(RPM_OPT_FLAGS) -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce ++# -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE + LDFLAGS= -s + + # Look where your install program is. + INSTALL = /usr/bin/install +-BINDIR = /usr/sbin +-MANDIR = /usr/man ++ ++# Destination paths, set prefix=/opt if required ++BINDIR = $(prefix)/usr/sbin ++MANDIR = $(prefix)/usr/share/man + + # There is one report that under an all ELF system there may be a need to + # explicilty link with libresolv.a. If linking syslogd fails you may wish +@@ -34,8 +37,9 @@ + # The following define establishes ownership for the man pages. + # Avery tells me that there is a difference between Debian and + # Slackware. Rather than choose sides I am leaving it up to the user. +-MAN_OWNER = root +-# MAN_OWNER = man ++MAN_USER = root ++MAN_GROUP = root ++MAN_PERMS = 644 + + # The following define establishes the name of the pid file for the + # syslogd daemon. The library include file (paths.h) defines the +@@ -116,7 +120,7 @@ + ${INSTALL} -m 500 -s klogd ${BINDIR}/klogd + + install_man: +- ${INSTALL} -o ${MAN_OWNER} -g ${MAN_OWNER} -m 644 sysklogd.8 ${MANDIR}/man8/sysklogd.8 +- ${INSTALL} -o ${MAN_OWNER} -g ${MAN_OWNER} -m 644 syslogd.8 ${MANDIR}/man8/syslogd.8 +- ${INSTALL} -o ${MAN_OWNER} -g ${MAN_OWNER} -m 644 syslog.conf.5 ${MANDIR}/man5/syslog.conf.5 +- ${INSTALL} -o ${MAN_OWNER} -g ${MAN_OWNER} -m 644 klogd.8 ${MANDIR}/man8/klogd.8 ++ ${INSTALL} -o ${MAN_USER} -g ${MAN_GROUP} -m ${MAN_PERMS} sysklogd.8 ${MANDIR}/man8/sysklogd.8 ++ ${INSTALL} -o ${MAN_USER} -g ${MAN_GROUP} -m ${MAN_PERMS} syslogd.8 ${MANDIR}/man8/syslogd.8 ++ ${INSTALL} -o ${MAN_USER} -g ${MAN_GROUP} -m ${MAN_PERMS} syslog.conf.5 ${MANDIR}/man5/syslog.conf.5 ++ ${INSTALL} -o ${MAN_USER} -g ${MAN_GROUP} -m ${MAN_PERMS} klogd.8 ${MANDIR}/man8/klogd.8 +diff -Naur sysklogd-1.4.1/module.h sysklogd-20050123/module.h +--- sysklogd-1.4.1/module.h 1969-12-31 19:00:00.000000000 -0500 ++++ sysklogd-20050123/module.h 2004-07-27 07:36:10.000000000 -0400 +@@ -0,0 +1,90 @@ ++/* ++ module.h - Miscellaneous module definitions ++ Copyright (c) 1996 Richard Henderson ++ Copyright (c) 2004 Martin Schulze ++ ++ This file is part of the sysklogd package. ++ ++ 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., 675 Mass Ave, Cambridge, MA 02139, USA. ++*/ ++ ++/* ChangeLog: ++ * ++ * Wed Mar 31 17:35:01 CEST 2004: Martin Schulze ++ * Created local copy of module.h based on the content of Linux ++ * 2.2 since doesn't work anymore with its ++ * recent content from Linux 2.4/2.6. ++ */ ++ ++#include ++ ++#define MODULE_NAME_LEN 60 ++ ++struct kernel_sym ++{ ++ unsigned long value; ++ char name[MODULE_NAME_LEN]; ++}; ++ ++ ++struct list_head { ++ struct list_head *next, *prev; ++}; ++ ++ ++struct module_info ++{ ++ unsigned long addr; ++ unsigned long size; ++ unsigned long flags; ++ long usecount; ++}; ++ ++ ++struct module ++{ ++ unsigned long size_of_struct; /* == sizeof(module) */ ++ struct module *next; ++ const char *name; ++ unsigned long size; ++ ++ union ++ { ++ int usecount; ++ long pad; ++ } uc; /* Needs to keep its size - so says rth */ ++ ++ unsigned long flags; /* AUTOCLEAN et al */ ++ ++ unsigned nsyms; ++ unsigned ndeps; ++ ++ struct module_symbol *syms; ++ struct module_ref *deps; ++ struct module_ref *refs; ++ int (*init)(void); ++ void (*cleanup)(void); ++ const struct exception_table_entry *ex_table_start; ++ const struct exception_table_entry *ex_table_end; ++#ifdef __alpha__ ++ unsigned long gp; ++#endif ++ /* Members past this point are extensions to the basic ++ module support and are optional. Use mod_opt_member() ++ to examine them. */ ++ const struct module_persist *persist_start; ++ const struct module_persist *persist_end; ++ int (*can_unload)(void); ++}; +diff -Naur sysklogd-1.4.1/pidfile.c sysklogd-20050123/pidfile.c +--- sysklogd-1.4.1/pidfile.c 1998-02-10 17:37:12.000000000 -0500 ++++ sysklogd-20050123/pidfile.c 2003-09-27 22:38:18.000000000 -0400 +@@ -87,7 +87,7 @@ + int fd; + int pid; + +- if ( ((fd = open(pidfile, O_RDWR|O_CREAT, 0644)) == -1) ++ if ( ((fd = open(pidfile, O_RDWR|O_CREAT|O_TRUNC, 0644)) == -1) + || ((f = fdopen(fd, "r+")) == NULL) ) { + fprintf(stderr, "Can't open or create %s.\n", pidfile); + return 0; +diff -Naur sysklogd-1.4.1/README.1st sysklogd-20050123/README.1st +--- sysklogd-1.4.1/README.1st 1997-06-02 13:21:39.000000000 -0400 ++++ sysklogd-20050123/README.1st 2003-09-04 09:22:23.000000000 -0400 +@@ -1,5 +1,5 @@ +-Very important information before using version 1.3 +---------------------------------------------------- ++Important information ++--------------------- + + The included version of syslogd behaves in a slightly different manner + to the one in former releases. Please review the following important +@@ -63,3 +63,10 @@ + these scripts should remove all old .pid files found in /var/run. + This will insure that klogd and syslogd start properly even if prior + executions have been terminated harshly. ++ ++* Large file support, i.e. support to write to log files that are ++ larger than 2 GB is not part of syslogd, but a matter of the Glibc ++ emitting different system calls to the kernel interface. To support ++ large files you'll have to compile syslogd with the compiler defines ++ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE so that glibc adjusts the ++ system calls. +diff -Naur sysklogd-1.4.1/README.linux sysklogd-20050123/README.linux +--- sysklogd-1.4.1/README.linux 1999-01-18 19:09:12.000000000 -0500 ++++ sysklogd-20050123/README.linux 2004-07-09 13:22:29.000000000 -0400 +@@ -40,12 +40,17 @@ + a useful addition to the software gene pool. + + There is a mailing list covering this package and syslog in general. +-The lists address is sysklogd@Infodrom.North.DE . To subscribe send a +-mail to Majordomo@Infodrom.North.DE with a line "subscribe sysklogd" ++The lists address is infodrom-sysklogd@lists.infodrom.org . To subscribe send a ++mail to majordomo@lists.infodrom.org with a line "subscribe infodrom-sysklogd" + in the message body. + +-New versions of this package will be available at Joey's ftp server. +-ftp://ftp.infodrom.north.de/pub/people/joey/sysklogd/ ++A second mailing list exists as infodrom-sysklogd-cvs@lists.infodrom.org. Only ++CVS messages and diffs are distributed there. Whenever new code is added to ++sysklogd, CVS generates a mail from these changes which will be sent to ++this list. Discussions will take place on the first list. ++ ++The latest version of this software can be found at: ++http://www.infodrom.org/projects/sysklogd/download.php3 + + Best regards, + +@@ -67,6 +72,6 @@ + + Martin Schulze + Infodrom Oldenburg +-joey@linux.de ++joey@infodrom.org + +-And a host of bug reporters whose contributions cannot be underestimated. ++And a number of bug reporters whose contributions cannot be underestimated. +diff -Naur sysklogd-1.4.1/sysklogd.8 sysklogd-20050123/sysklogd.8 +--- sysklogd-1.4.1/sysklogd.8 2001-03-11 14:35:51.000000000 -0500 ++++ sysklogd-20050123/sysklogd.8 2004-07-09 13:33:32.000000000 -0400 +@@ -84,7 +84,7 @@ + .B MAXFUNIX + within the syslogd.c source file. An example for a chroot() daemon is + described by the people from OpenBSD at +-http://www.psionic.com/papers/dns.html. ++. + .TP + .B "\-d" + Turns on debug mode. Using this the daemon will not proceed a +@@ -117,7 +117,8 @@ + between two \fI-- MARK --\fR lines is 20 minutes. This can be changed + with this option. Setting the + .I interval +-to zero turns it off entirely. ++to zero turns it off entirely. Depending on other log messages ++generated these lines may not be written consecutively. + .TP + .B "\-n" + Avoid auto-backgrounding. This is needed especially if the +@@ -364,8 +365,10 @@ + + To avoid this in further times no messages that were received from a + remote host are sent out to another (or the same) remote host +-anymore. If there are scenarios where this doesn't make sense, please +-drop me (Joey) a line. ++anymore. If you experience are setup in which this doesn't make ++sense, please use the ++.B \-h ++commandline switch. + + If the remote host is located in the same domain as the host, + .B syslogd +diff -Naur sysklogd-1.4.1/syslog.c sysklogd-20050123/syslog.c +--- sysklogd-1.4.1/syslog.c 2001-03-11 14:35:51.000000000 -0500 ++++ sysklogd-20050123/syslog.c 2003-08-27 11:56:01.000000000 -0400 +@@ -47,6 +47,9 @@ + * Sun Mar 11 20:23:44 CET 2001: Martin Schulze + * Use SOCK_DGRAM for loggin, renables it to work. + * ++ * Wed Aug 27 17:48:16 CEST 2003: Martin Schulze ++ * Improved patch by Michael Pomraning to ++ * reconnect klogd to the logger after it went away. + */ + + #include +@@ -98,6 +101,7 @@ + register char *p; + time_t now; + int fd, saved_errno; ++ int result; + char tbuf[2048], fmt_cpy[1024], *stdp = (char *) 0; + + saved_errno = errno; +@@ -167,7 +171,16 @@ + } + + /* output the message to the local logger */ +- if (write(LogFile, tbuf, cnt + 1) >= 0 || !(LogStat&LOG_CONS)) ++ result = write(LogFile, tbuf, cnt + 1); ++ ++ if (result == -1 ++ && (errno == ECONNRESET || errno == ENOTCONN || errno == ECONNREFUSED)) { ++ closelog(); ++ openlog(LogTag, LogStat | LOG_NDELAY, LogFacility); ++ result = write(LogFile, tbuf, cnt + 1); ++ } ++ ++ if (result >= 0 || !(LogStat&LOG_CONS)) + return; + + /* +diff -Naur sysklogd-1.4.1/syslog.conf.5 sysklogd-20050123/syslog.conf.5 +--- sysklogd-1.4.1/syslog.conf.5 1999-08-21 06:49:14.000000000 -0400 ++++ sysklogd-20050123/syslog.conf.5 2003-05-22 15:31:20.000000000 -0400 +@@ -64,7 +64,7 @@ + The + .I facility + is one of the following keywords: +-.BR auth ", " authpriv ", " cron ", " daemon ", " kern ", " lpr ", " ++.BR auth ", " authpriv ", " cron ", " daemon ", " ftp ", " kern ", " lpr ", " + .BR mail ", " mark ", " news ", " security " (same as " auth "), " + .BR syslog ", " user ", " uucp " and " local0 " through " local7 . + The keyword +@@ -121,12 +121,21 @@ + + This + .BR syslogd (8) +-has a syntax extension to the original BSD source, that makes its use ++has a syntax extension to the original BSD source, which makes its use + more intuitively. You may precede every priority with an equation sign +-(``='') to specify only this single priority and not any of the +-above. You may also (both is valid, too) precede the priority with an +-exclamation mark (``!'') to ignore all that priorities, either exact +-this one or this and any higher priority. If you use both extensions ++(``='') to specify that ++.B syslogd ++should only refer to this single priority and not this priority and ++all higher priorities. ++ ++You may also precide the priority with an exclamation mark (``!'') if ++you want ++.B syslogd ++to ignore this priority and all higher priorities. ++You may even use both, the exclamation mark and the equation sign if ++you want ++.B syslogd ++to ignore only this single priority. If you use both extensions + than the exclamation mark must occur before the equation sign, just + use it intuitively. + +@@ -300,7 +309,7 @@ + .B syslogd + log all messages that come with either the + .BR info " or the " notice +-facility into the file ++priority into the file + .IR /var/log/messages , + except for all messages that use the + .B mail +diff -Naur sysklogd-1.4.1/syslogd.c sysklogd-20050123/syslogd.c +--- sysklogd-1.4.1/syslogd.c 2001-03-11 14:40:10.000000000 -0500 ++++ sysklogd-20050123/syslogd.c 2005-01-15 14:13:08.000000000 -0500 +@@ -441,6 +441,39 @@ + * Don't return a closed fd if `-a' is called with a wrong path. + * Thanks to Bill Nottingham for providing + * a patch. ++ * Thu Apr 13 05:08:10 CEST 2001: Jon Burgess ++ * Moved the installation of the signal handler up a little bit ++ * so it guaranteed to be available when the child is forked, ++ * hence, fixing a race condition. This used to create problems ++ * with UML and fast machines. ++ * ++ * Sat Apr 17 18:03:05 CEST 2004: Steve Grubb ++ * Correct memory allocation for for commandline arguments in ++ * crunch_list(). ++ * ++ * Thu Apr 29 12:38:39 CEST 2004: Solar Designer ++ * Applied Openwall paranoia patches to improve crunch_list(). ++ * ++ * Tue May 4 16:47:30 CEST 2004: Solar Designer ++ * Ensure that "len" is not placed in a register, and that the ++ * endtty() signal handler is not installed too early which could ++ * cause a segmentation fault or worse. ++ * ++ * Tue May 4 16:52:01 CEST 2004: Solar Designer ++ * Adjust the size of a variable to prevent a buffer overflow ++ * should _PATH_DEV ever contain something different than "/dev/". ++ * ++ * Tue Nov 2 20:28:23 CET 2004: Colin Phipps ++ * Don't block on the network socket, in case a packet gets lost ++ * between select and recv. ++ * ++ * Sun Nov 7 12:28:47 CET 2004: Martin Schulze ++ * Discard any timestamp information found in received syslog ++ * messages. This will affect local messages sent from a ++ * different timezone. ++ * ++ * Sun Nov 7 13:47:00 CET 2004: Martin Schulze ++ * Remove trailing newline when forwarding messages. + */ + + +@@ -890,11 +923,11 @@ + dprintf("Checking pidfile.\n"); + if (!check_pid(PidFile)) + { ++ signal (SIGTERM, doexit); + if (fork()) { + /* + * Parent process + */ +- signal (SIGTERM, doexit); + sleep(300); + /* + * Not reached unless something major went wrong. 5 +@@ -992,6 +1025,7 @@ + (void) signal(SIGCHLD, reapchild); + (void) signal(SIGALRM, domark); + (void) signal(SIGUSR1, Debug ? debug_switch : SIG_IGN); ++ (void) signal(SIGXFSZ, SIG_IGN); + (void) alarm(TIMERINTVL); + + /* Create a partial message table for all file descriptors. */ +@@ -1141,13 +1175,13 @@ + */ + printchopped(from, line, \ + i + 2, finet); +- } else if (i < 0 && errno != EINTR) { ++ } else if (i < 0 && errno != EINTR && errno != EAGAIN) { + dprintf("INET socket error: %d = %s.\n", \ + errno, strerror(errno)); + logerror("recvfrom inet"); + /* should be harmless now that we set + * BSDCOMPAT on the socket */ +- sleep(10); ++ sleep(1); + } + } + #endif +@@ -1216,6 +1250,7 @@ + { + int fd, on = 1; + struct sockaddr_in sin; ++ int sockflags; + + fd = socket(AF_INET, SOCK_DGRAM, 0); + if (fd < 0) { +@@ -1241,6 +1276,24 @@ + close(fd); + return -1; + } ++ /* We must not block on the network socket, in case a packet ++ * gets lost between select and recv, otherise the process ++ * will stall until the timeout, and other processes trying to ++ * log will also stall. ++ */ ++ if ((sockflags = fcntl(fd, F_GETFL)) != -1) { ++ sockflags |= O_NONBLOCK; ++ /* ++ * SETFL could fail too, so get it caught by the subsequent ++ * error check. ++ */ ++ sockflags = fcntl(fd, F_SETFL, sockflags); ++ } ++ if (sockflags == -1) { ++ logerror("fcntl(O_NONBLOCK), suspending inet"); ++ close(fd); ++ return -1; ++ } + if (bind(fd, (struct sockaddr *) &sin, sizeof(sin)) < 0) { + logerror("bind, suspending inet"); + close(fd); +@@ -1254,30 +1307,26 @@ + crunch_list(list) + char *list; + { +- int count, i; ++ int i, m, n; + char *p, *q; + char **result = NULL; + + p = list; + + /* strip off trailing delimiters */ +- while (p[strlen(p)-1] == LIST_DELIMITER) { +- count--; ++ while (*p && p[strlen(p)-1] == LIST_DELIMITER) + p[strlen(p)-1] = '\0'; +- } + /* cut off leading delimiters */ +- while (p[0] == LIST_DELIMITER) { +- count--; ++ while (p[0] == LIST_DELIMITER) + p++; +- } + +- /* count delimiters to calculate elements */ +- for (count=i=0; p[i]; i++) +- if (p[i] == LIST_DELIMITER) count++; ++ /* count delimiters to calculate the number of elements */ ++ for (n = i = 0; p[i]; i++) ++ if (p[i] == LIST_DELIMITER) n++; + +- if ((result = (char **)malloc(sizeof(char *) * count+2)) == NULL) { ++ if ((result = (char **)malloc(sizeof(char *) * (n + 2))) == NULL) { + printf ("Sorry, can't get enough memory, exiting.\n"); +- exit(0); ++ exit(1); + } + + /* +@@ -1285,30 +1334,28 @@ + * characters are different from any delimiters, + * so we don't have to care about this. + */ +- count = 0; +- while ((q=strchr(p, LIST_DELIMITER))) { +- result[count] = (char *) malloc((q - p + 1) * sizeof(char)); +- if (result[count] == NULL) { ++ m = 0; ++ while ((q = strchr(p, LIST_DELIMITER)) && m < n) { ++ result[m] = (char *) malloc((q - p + 1) * sizeof(char)); ++ if (result[m] == NULL) { + printf ("Sorry, can't get enough memory, exiting.\n"); +- exit(0); ++ exit(1); + } +- strncpy(result[count], p, q - p); +- result[count][q - p] = '\0'; ++ memcpy(result[m], p, q - p); ++ result[m][q - p] = '\0'; + p = q; p++; +- count++; ++ m++; + } +- if ((result[count] = \ +- (char *)malloc(sizeof(char) * strlen(p) + 1)) == NULL) { ++ if ((result[m] = strdup(p)) == NULL) { + printf ("Sorry, can't get enough memory, exiting.\n"); +- exit(0); ++ exit(1); + } +- strcpy(result[count],p); +- result[++count] = NULL; ++ result[++m] = NULL; + + #if 0 +- count=0; +- while (result[count]) +- dprintf ("#%d: %s\n", count, StripDomains[count++]); ++ m = 0; ++ while (result[m]) ++ dprintf ("#%d: %s\n", m, result[m++]); + #endif + return result; + } +@@ -1548,21 +1595,25 @@ + + /* + * Check to see if msg looks non-standard. ++ * ++ * A message looks like ++ * Nov 17 11:42:33 CRON[ ++ * 01234567890123456 ++ * ^ ^ ^ ^ ^ ++ * ++ * Remote messages are not accompanied by a timestamp. ++ * Local messages are accompanied by a timestamp (program's timezone) + */ + msglen = strlen(msg); +- if (msglen < 16 || msg[3] != ' ' || msg[6] != ' ' || +- msg[9] != ':' || msg[12] != ':' || msg[15] != ' ') +- flags |= ADDDATE; +- +- (void) time(&now); +- if (flags & ADDDATE) +- timestamp = ctime(&now) + 4; +- else { +- timestamp = msg; ++ if (!(msglen < 16 || msg[3] != ' ' || msg[6] != ' ' || ++ msg[9] != ':' || msg[12] != ':' || msg[15] != ' ')) { + msg += 16; + msglen -= 16; + } + ++ (void) time(&now); ++ timestamp = ctime(&now) + 4; ++ + /* extract facility and priority level */ + if (flags & MARK) + fac = LOG_NFACILITIES; +@@ -1771,7 +1822,7 @@ + dprintf("Not sending message to remote.\n"); + else { + f->f_time = now; +- (void) snprintf(line, sizeof(line), "<%d>%s\n", f->f_prevpri, \ ++ (void) snprintf(line, sizeof(line), "<%d>%s", f->f_prevpri, \ + (char *) iov[4].iov_base); + l = strlen(line); + if (l > MAXLINE) +@@ -1815,7 +1866,7 @@ + v->iov_len = 1; + } + again: +- /* f->f_file == -1 is an indicator that the we couldn't ++ /* f->f_file == -1 is an indicator that we couldn't + open the file at startup. */ + if (f->f_file == -1) + break; +@@ -1852,7 +1903,7 @@ + errno = e; + logerror(f->f_un.f_fname); + } +- } else if (f->f_flags & SYNC_FILE) ++ } else if (f->f_type == F_FILE && (f->f_flags & SYNC_FILE)) + (void) fsync(f->f_file); + break; + +@@ -1891,7 +1942,7 @@ + register struct filed *f; + struct iovec *iov; + { +- char p[6 + UNAMESZ]; ++ char p[sizeof (_PATH_DEV) + UNAMESZ]; + register int i; + int ttyf, len; + static int reenter = 0; +@@ -1899,6 +1950,8 @@ + struct utmp *uptr; + char greetings[200]; + ++ (void) &len; ++ + if (reenter++) + return; + +@@ -1913,7 +1966,6 @@ + if (fork() == 0) { + (void) signal(SIGTERM, SIG_DFL); + (void) alarm(0); +- (void) signal(SIGALRM, endtty); + #ifndef SYSV + (void) signal(SIGTTOU, SIG_IGN); + (void) sigsetmask(0); +@@ -1929,7 +1981,7 @@ + /* is this slot used? */ + if (ut.ut_name[0] == '\0') + continue; +- if (ut.ut_type == LOGIN_PROCESS) ++ if (ut.ut_type != USER_PROCESS) + continue; + if (!(strcmp (ut.ut_name,"LOGIN"))) /* paranoia */ + continue; +@@ -1959,6 +2011,7 @@ + iov[1].iov_len = 0; + } + if (setjmp(ttybuf) == 0) { ++ (void) signal(SIGALRM, endtty); + (void) alarm(15); + /* open the terminal */ + ttyf = open(p, O_WRONLY|O_NOCTTY); diff --git a/base-source/sysklogd-1.4.1.tar.gz b/base-source/sysklogd-1.4.1.tar.gz new file mode 100644 index 0000000..45f0364 Binary files /dev/null and b/base-source/sysklogd-1.4.1.tar.gz differ diff --git a/base-source/sysvinit-2.86.tar.gz b/base-source/sysvinit-2.86.tar.gz new file mode 100644 index 0000000..5bdc5d3 Binary files /dev/null and b/base-source/sysvinit-2.86.tar.gz differ diff --git a/base-source/tar-1.15.1-gcc4_fix_tests-1.patch b/base-source/tar-1.15.1-gcc4_fix_tests-1.patch new file mode 100644 index 0000000..5cebec0 --- /dev/null +++ b/base-source/tar-1.15.1-gcc4_fix_tests-1.patch @@ -0,0 +1,25 @@ +Submitted By: Matthew Burgess +Date: 2005-07-15 +Initial Package Version: 1.15.1 +Upstream Status: From Upstream +Origin: Ryan Oliver +Description: Fixes a compilation problem with gcc-4.0.x that results in: + +genfile.c:63: error: static declaration of 'argp_program_version' follows non-static declaration +../lib/argp.h:428: error: previous declaration of 'argp_program_version' was here +genfile.c:64: error: static declaration of 'argp_program_bug_address' follows non-static declaration +../lib/argp.h:444: error: previous declaration of 'argp_program_bug_address' was here + +--- tar-1.15.1/tests/genfile.c-orig 2005-04-25 15:23:47.000000000 +1000 ++++ tar-1.15.1/tests/genfile.c 2005-04-25 15:24:08.000000000 +1000 +@@ -60,8 +60,8 @@ + /* Block buffer for sparse file */ + char *buffer; + +-static const char *argp_program_version = "genfile (" PACKAGE ") " VERSION; +-static const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">"; ++const char *argp_program_version = "genfile (" PACKAGE ") " VERSION; ++const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">"; + static char doc[] = N_("genfile generates data files for GNU paxutils test suite"); + + static struct argp_option options[] = { diff --git a/base-source/tar-1.15.1-security_fixes-1.patch b/base-source/tar-1.15.1-security_fixes-1.patch new file mode 100644 index 0000000..085147e --- /dev/null +++ b/base-source/tar-1.15.1-security_fixes-1.patch @@ -0,0 +1,128 @@ +Submitted By: Ken Moffat +Date: 2006-04-14 +Initial Package Version: 1.15.1 +Origin: gentoo, backported from CVS, rediffed to apply with -p1 +Description: addresses vulnerability CVE-2006-0300 + +diff -Naurp tar-1.15.1-vanilla/src/xheader.c tar-1.15.1/src/xheader.c +--- tar-1.15.1-vanilla/src/xheader.c 2004-09-06 12:31:14.000000000 +0100 ++++ tar-1.15.1/src/xheader.c 2006-04-14 16:26:26.000000000 +0100 +@@ -783,6 +783,32 @@ code_num (uintmax_t value, char const *k + xheader_print (xhdr, keyword, sbuf); + } + ++static bool ++decode_num (uintmax_t *num, char const *arg, uintmax_t maxval, ++ char const *keyword) ++{ ++ uintmax_t u; ++ char *arg_lim; ++ ++ if (! (ISDIGIT (*arg) ++ && (errno = 0, u = strtoumax (arg, &arg_lim, 10), !*arg_lim))) ++ { ++ ERROR ((0, 0, _("Malformed extended header: invalid %s=%s"), ++ keyword, arg)); ++ return false; ++ } ++ ++ if (! (u <= maxval && errno != ERANGE)) ++ { ++ ERROR ((0, 0, _("Extended header %s=%s is out of range"), ++ keyword, arg)); ++ return false; ++ } ++ ++ *num = u; ++ return true; ++} ++ + static void + dummy_coder (struct tar_stat_info const *st __attribute__ ((unused)), + char const *keyword __attribute__ ((unused)), +@@ -821,7 +847,7 @@ static void + gid_decoder (struct tar_stat_info *st, char const *arg) + { + uintmax_t u; +- if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK) ++ if (decode_num (&u, arg, TYPE_MAXIMUM (gid_t), "gid")) + st->stat.st_gid = u; + } + +@@ -903,7 +929,7 @@ static void + size_decoder (struct tar_stat_info *st, char const *arg) + { + uintmax_t u; +- if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK) ++ if (decode_num (&u, arg, TYPE_MAXIMUM (off_t), "size")) + st->archive_file_size = st->stat.st_size = u; + } + +@@ -918,7 +944,7 @@ static void + uid_decoder (struct tar_stat_info *st, char const *arg) + { + uintmax_t u; +- if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK) ++ if (decode_num (&u, arg, TYPE_MAXIMUM (uid_t), "uid")) + st->stat.st_uid = u; + } + +@@ -946,7 +972,7 @@ static void + sparse_size_decoder (struct tar_stat_info *st, char const *arg) + { + uintmax_t u; +- if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK) ++ if (decode_num (&u, arg, TYPE_MAXIMUM (off_t), "GNU.sparse.size")) + st->stat.st_size = u; + } + +@@ -962,10 +988,10 @@ static void + sparse_numblocks_decoder (struct tar_stat_info *st, char const *arg) + { + uintmax_t u; +- if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK) ++ if (decode_num (&u, arg, SIZE_MAX, "GNU.sparse.numblocks")) + { + st->sparse_map_size = u; +- st->sparse_map = calloc(st->sparse_map_size, sizeof(st->sparse_map[0])); ++ st->sparse_map = xcalloc (u, sizeof st->sparse_map[0]); + st->sparse_map_avail = 0; + } + } +@@ -982,8 +1008,14 @@ static void + sparse_offset_decoder (struct tar_stat_info *st, char const *arg) + { + uintmax_t u; +- if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK) ++ if (decode_num (&u, arg, TYPE_MAXIMUM (off_t), "GNU.sparse.offset")) ++ { ++ if (st->sparse_map_avail < st->sparse_map_size) + st->sparse_map[st->sparse_map_avail].offset = u; ++ else ++ ERROR ((0, 0, _("Malformed extended header: excess %s=%s"), ++ "GNU.sparse.offset", arg)); ++ } + } + + static void +@@ -998,15 +1030,13 @@ static void + sparse_numbytes_decoder (struct tar_stat_info *st, char const *arg) + { + uintmax_t u; +- if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK) ++ if (decode_num (&u, arg, SIZE_MAX, "GNU.sparse.numbytes")) + { + if (st->sparse_map_avail == st->sparse_map_size) +- { +- st->sparse_map_size *= 2; +- st->sparse_map = xrealloc (st->sparse_map, +- st->sparse_map_size +- * sizeof st->sparse_map[0]); +- } ++ st->sparse_map = x2nrealloc (st->sparse_map, ++ &st->sparse_map_size, ++ sizeof st->sparse_map[0]); ++ + st->sparse_map[st->sparse_map_avail++].numbytes = u; + } + } diff --git a/base-source/tar-1.15.1-sparse_fix-1.patch b/base-source/tar-1.15.1-sparse_fix-1.patch new file mode 100644 index 0000000..f8a3613 --- /dev/null +++ b/base-source/tar-1.15.1-sparse_fix-1.patch @@ -0,0 +1,26 @@ +Submitted By: Jim Gifford (patches at jg555 dot com) +Date: 2005-03-19 +Initial Package Version: 1.15.1 +Origin: Tar Bug Reports List +Upstream Status: Applied +Description: Fixes large file corruptions using option -S + http://lists.gnu.org/archive/html/bug-tar/2005-03/msg00004.html +--- tar-1.15.1/src/sparse.c.orig 2005-03-20 04:23:34.144506120 +0000 ++++ tar-1.15.1/src/sparse.c 2005-03-20 04:23:56.842055568 +0000 +@@ -1,6 +1,6 @@ + /* Functions for dealing with sparse files + +- Copyright (C) 2003, 2004 Free Software Foundation, Inc. ++ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + + 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 +@@ -182,7 +182,7 @@ + { + static char buffer[BLOCKSIZE]; + size_t count; +- size_t offset = 0; ++ off_t offset = 0; + struct sp_array sp = {0, 0}; + + if (!lseek_or_error (file, 0, SEEK_SET)) diff --git a/base-source/tar-1.15.1.tar.bz2 b/base-source/tar-1.15.1.tar.bz2 new file mode 100644 index 0000000..c80e98d Binary files /dev/null and b/base-source/tar-1.15.1.tar.bz2 differ diff --git a/base-source/tcl8.4.13-src.tar.gz b/base-source/tcl8.4.13-src.tar.gz new file mode 100644 index 0000000..1b86892 Binary files /dev/null and b/base-source/tcl8.4.13-src.tar.gz differ diff --git a/base-source/tcpdump-3.9.5.tar.gz b/base-source/tcpdump-3.9.5.tar.gz new file mode 100644 index 0000000..984febb Binary files /dev/null and b/base-source/tcpdump-3.9.5.tar.gz differ diff --git a/base-source/texinfo-4.8-multibyte-1.patch b/base-source/texinfo-4.8-multibyte-1.patch new file mode 100644 index 0000000..4676a79 --- /dev/null +++ b/base-source/texinfo-4.8-multibyte-1.patch @@ -0,0 +1,44 @@ +Submitted By: Alexander E. Patrakov +Date: 2005-07-12 +Initial Package Version: 4.8 +Upstream Status: Hack, won't submit +Origin: Alexander E. Patrakov +Description: Info assumes that a string width in character cells is the +same as its length in bytes. This patch avoids cases when this assumption +is not true. + +diff -ur texinfo-4.8/info/info.c texinfo-4.8.hacked/info/info.c +--- texinfo-4.8/info/info.c 2004-04-11 23:56:45.000000000 +0600 ++++ texinfo-4.8.hacked/info/info.c 2005-07-12 12:11:34.852485776 +0600 +@@ -154,6 +154,10 @@ + #ifdef HAVE_SETLOCALE + /* Set locale via LC_ALL. */ + setlocale (LC_ALL, ""); ++ /* But don't use translated messages in the case when ++ string width and length can differ */ ++ if (MB_CUR_MAX > 1) ++ setlocale(LC_MESSAGES, "C"); + #endif + + #ifdef ENABLE_NLS +diff -ur texinfo-4.8/info/man.c texinfo-4.8.hacked/info/man.c +--- texinfo-4.8/info/man.c 2004-04-11 23:56:46.000000000 +0600 ++++ texinfo-4.8.hacked/info/man.c 2005-07-12 12:08:40.267026800 +0600 +@@ -325,6 +325,17 @@ + freopen (NULL_DEVICE, "r", stdin); + dup2 (pipes[1], fileno (stdout)); + ++ if (MB_CUR_MAX > 1) ++ { ++ /* Info has trouble wrapping man output if it contains ++ multibyte characters */ ++ setenv("LANGUAGE", "C", 1); ++ setenv("LANG", "C", 1); ++ setenv("LC_MESSAGES", "C", 1); ++ setenv("LC_CTYPE", "C", 1); ++ setenv("LC_ALL", "C", 1); ++ } ++ + execv (formatter_args[0], formatter_args); + + /* If we get here, we couldn't exec, so close out the pipe and diff --git a/base-source/texinfo-4.8-tempfile_fix-2.patch b/base-source/texinfo-4.8-tempfile_fix-2.patch new file mode 100644 index 0000000..0d0b594 --- /dev/null +++ b/base-source/texinfo-4.8-tempfile_fix-2.patch @@ -0,0 +1,80 @@ +Updated By: Bruce Dubbs (bdubbs -aT- linuxfromscratch -DoT- org) +Date: 2005-12-12 +Submitted By: Archaic (archaic -aT- linuxfromscratch -DoT- org) +Date: 2005-10-08 +Initial Package Version: 4.8 +Origin: http://gentoo.kems.net/gentoo-portage/sys-apps/texinfo/files/texinfo-4.8-tempfile.patch +Upstream Status: A few patches are floating around in Debian BZ #328365 of which + upstream hasn't made a full commitment on yet. +Description: (CAN-2005-3011) texindex in texinfo 4.8 and earlier allows local + users to overwrite arbitrary files via a symlink attack on + temporary files. +Update: Changed to not pass a constant string to mktemp(). + +diff -Naur texinfo-4.8.orig/util/texindex.c texinfo-4.8/util/texindex.c +--- texinfo-4.8.orig/util/texindex.c 2005-12-11 23:29:08.000000000 -0600 ++++ texinfo-4.8/util/texindex.c 2005-12-11 23:33:31.000000000 -0600 +@@ -99,6 +99,9 @@ + /* Directory to use for temporary files. On Unix, it ends with a slash. */ + char *tempdir; + ++/* Basename for temp files inside of tempdir. */ ++char *tempbase; ++ + /* Number of last temporary file. */ + int tempcount; + +@@ -153,6 +156,7 @@ + main (int argc, char **argv) + { + int i; ++ char template[]="txidxXXXXXX"; + + tempcount = 0; + last_deleted_tempcount = 0; +@@ -190,6 +194,11 @@ + + decode_command (argc, argv); + ++ /* XXX mkstemp not appropriate, as we need to have somewhat predictable ++ * names. But race condition was fixed, see maketempname. ++ */ ++ tempbase = mktemp (template); ++ + /* Process input files completely, one by one. */ + + for (i = 0; i < num_infiles; i++) +@@ -389,21 +398,21 @@ + static char * + maketempname (int count) + { +- static char *tempbase = NULL; + char tempsuffix[10]; +- +- if (!tempbase) +- { +- int fd; +- tempbase = concat (tempdir, "txidxXXXXXX"); +- +- fd = mkstemp (tempbase); +- if (fd == -1) +- pfatal_with_name (tempbase); +- } ++ char *name, *tmp_name; ++ int fd; + + sprintf (tempsuffix, ".%d", count); +- return concat (tempbase, tempsuffix); ++ tmp_name = concat (tempdir, tempbase); ++ name = concat (tmp_name, tempsuffix); ++ free(tmp_name); ++ ++ fd = open (name, O_CREAT|O_EXCL|O_WRONLY, 0600); ++ if (fd == -1) ++ pfatal_with_name (name); ++ ++ close(fd); ++ return name; + } + + diff --git a/base-source/texinfo-4.8.tar.bz2 b/base-source/texinfo-4.8.tar.bz2 new file mode 100644 index 0000000..4f6d8d9 Binary files /dev/null and b/base-source/texinfo-4.8.tar.bz2 differ diff --git a/base-source/traceroute-1.4a12.tar.gz b/base-source/traceroute-1.4a12.tar.gz new file mode 100644 index 0000000..4409e09 Binary files /dev/null and b/base-source/traceroute-1.4a12.tar.gz differ diff --git a/base-source/udev-092.tar.bz2 b/base-source/udev-092.tar.bz2 new file mode 100644 index 0000000..35ffa3e Binary files /dev/null and b/base-source/udev-092.tar.bz2 differ diff --git a/base-source/udev-config-20060515.tar.bz2 b/base-source/udev-config-20060515.tar.bz2 new file mode 100644 index 0000000..121087e Binary files /dev/null and b/base-source/udev-config-20060515.tar.bz2 differ diff --git a/base-source/unzip552.tar.gz b/base-source/unzip552.tar.gz new file mode 100644 index 0000000..ef39c84 Binary files /dev/null and b/base-source/unzip552.tar.gz differ diff --git a/base-source/usbutils-0.72.tar.gz b/base-source/usbutils-0.72.tar.gz new file mode 100644 index 0000000..a702600 Binary files /dev/null and b/base-source/usbutils-0.72.tar.gz differ diff --git a/base-source/util-linux-2.12r-cramfs-1.patch b/base-source/util-linux-2.12r-cramfs-1.patch new file mode 100644 index 0000000..b8366b3 --- /dev/null +++ b/base-source/util-linux-2.12r-cramfs-1.patch @@ -0,0 +1,93 @@ +Submitted by: Jeremy Utley +Date: 2004-12-25 +Initial Package Version: 2.12p (should apply to versions back to at least k) +Upstream Status: Not Submitted - Test Version +Origin: Alexander Patrakov, adapted from debian build of cramfs utilities +Description: Util-Linux fails in cramfs compilation due to changes in the +linux-libc-headers package 2.6.9 and after. This patch is a proper fix to the +problem, but may in fact not be accepted upstream. + + +diff -Naur util-linux-2.12p/disk-utils/fsck.cramfs.c util-linux-2.12p-new/disk-utils/fsck.cramfs.c +--- util-linux-2.12p/disk-utils/fsck.cramfs.c 2004-12-11 14:53:16.000000000 +0000 ++++ util-linux-2.12p-new/disk-utils/fsck.cramfs.c 2004-12-26 00:53:10.665199086 +0000 +@@ -76,16 +76,7 @@ + + #define PAD_SIZE 512 + +-#include +-#ifdef PAGE_SIZE +-#define PAGE_CACHE_SIZE ((int) PAGE_SIZE) +-#elif defined __ia64__ +-#define PAGE_CACHE_SIZE (16384) +-#elif defined __alpha__ +-#define PAGE_CACHE_SIZE (8192) +-#else +-#define PAGE_CACHE_SIZE (4096) +-#endif ++#define PAGE_CACHE_SIZE page_size + + /* Guarantee access to at least 8kB at a time */ + #define ROMBUFFER_BITS 13 +@@ -95,11 +86,13 @@ + static unsigned long read_buffer_block = ~0UL; + + /* Uncompressing data structures... */ +-static char outbuffer[PAGE_CACHE_SIZE*2]; ++static char *outbuffer; + z_stream stream; + + #endif /* INCLUDE_FS_TESTS */ + ++static size_t page_size; ++ + /* Input status of 0 to print help and exit without an error. */ + static void usage(int status) + { +@@ -464,9 +457,17 @@ + int c; /* for getopt */ + int start = 0; + ++ page_size = sysconf(_SC_PAGESIZE); ++ + if (argc) + progname = argv[0]; + ++ outbuffer = malloc(page_size * 2); ++ if (!outbuffer) { ++ fprintf(stderr, _("failed to allocate outbuffer\n")); ++ exit(8); ++ } ++ + /* command line options */ + while ((c = getopt(argc, argv, "hx:v")) != EOF) { + switch (c) { +diff -Naur util-linux-2.12p/disk-utils/mkfs.cramfs.c util-linux-2.12p-new/disk-utils/mkfs.cramfs.c +--- util-linux-2.12p/disk-utils/mkfs.cramfs.c 2004-12-11 14:56:01.000000000 +0000 ++++ util-linux-2.12p-new/disk-utils/mkfs.cramfs.c 2004-12-26 00:53:10.666198928 +0000 +@@ -46,16 +46,8 @@ + static const char *progname = "mkcramfs"; + static int verbose = 0; + +-#ifdef __ia64__ +-#define PAGE_CACHE_SIZE (16384) +-#elif defined __alpha__ +-#define PAGE_CACHE_SIZE (8192) +-#else +-#define PAGE_CACHE_SIZE (4096) +-#endif +- + /* The kernel assumes PAGE_CACHE_SIZE as block size. */ +-static unsigned int blksize = PAGE_CACHE_SIZE; /* settable via -b option */ ++static unsigned int blksize; /* settable via -b option */ + static long total_blocks = 0, total_nodes = 1; /* pre-count the root node */ + static int image_length = 0; + +@@ -730,6 +722,7 @@ + u32 crc = crc32(0L, Z_NULL, 0); + int c; + ++ blksize = sysconf(_SC_PAGESIZE); + total_blocks = 0; + + if (argc) { diff --git a/base-source/util-linux-2.12r.tar.bz2 b/base-source/util-linux-2.12r.tar.bz2 new file mode 100644 index 0000000..0e8cf78 Binary files /dev/null and b/base-source/util-linux-2.12r.tar.bz2 differ diff --git a/base-source/vim-7.0-fixes-3.patch b/base-source/vim-7.0-fixes-3.patch new file mode 100644 index 0000000..15dc89c --- /dev/null +++ b/base-source/vim-7.0-fixes-3.patch @@ -0,0 +1,614 @@ +Submitted By: Jeremy Huntwork (jhuntwork at linuxfromscratch dot org) +Date: 2006-05-25 +Initial Package Version: 7.0 +Origin: Upstream +Upstream Status: Applied +Description: Contains Patch 001-004 and 006-017 from Upstream + 005 is for the extras and Windows 32 only + +diff -Naur vim70-orig/runtime/autoload/ccomplete.vim vim70/runtime/autoload/ccomplete.vim +--- vim70-orig/runtime/autoload/ccomplete.vim 2006-05-03 10:35:56.000000000 -0400 ++++ vim70/runtime/autoload/ccomplete.vim 2006-05-25 09:13:10.000000000 -0400 +@@ -1,7 +1,7 @@ + " Vim completion script + " Language: C + " Maintainer: Bram Moolenaar +-" Last Change: 2006 May 03 ++" Last Change: 2006 May 08 + + + " This function is used for the 'omnifunc' option. +@@ -458,7 +458,7 @@ + " member. + function! s:StructMembers(typename, items, all) + " Todo: What about local structures? +- let fnames = join(map(tagfiles(), 'escape(v:val, " \\")')) ++ let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")')) + if fnames == '' + return [] + endif +diff -Naur vim70-orig/runtime/autoload/spellfile.vim vim70/runtime/autoload/spellfile.vim +--- vim70-orig/runtime/autoload/spellfile.vim 2006-02-01 07:12:24.000000000 -0500 ++++ vim70/runtime/autoload/spellfile.vim 2006-05-25 09:13:12.000000000 -0400 +@@ -1,9 +1,9 @@ + " Vim script to download a missing spell file + " Maintainer: Bram Moolenaar +-" Last Change: 2006 Feb 01 ++" Last Change: 2006 May 10 + + if !exists('g:spellfile_URL') +- let g:spellfile_URL = 'ftp://ftp.vim.org/pub/vim/unstable/runtime/spell' ++ let g:spellfile_URL = 'ftp://ftp.vim.org/pub/vim/runtime/spell' + endif + let s:spellfile_URL = '' " Start with nothing so that s:donedict is reset. + +@@ -61,13 +61,13 @@ + new + setlocal bin + echo 'Downloading ' . fname . '...' +- exe 'Nread ' g:spellfile_URL . '/' . fname ++ call spellfile#Nread(fname) + if getline(2) !~ 'VIMspell' + " Didn't work, perhaps there is an ASCII one. + g/^/d + let fname = a:lang . '.ascii.spl' + echo 'Could not find it, trying ' . fname . '...' +- exe 'Nread ' g:spellfile_URL . '/' . fname ++ call spellfile#Nread(fname) + if getline(2) !~ 'VIMspell' + echo 'Sorry, downloading failed' + bwipe! +@@ -95,7 +95,7 @@ + g/^/d + let fname = substitute(fname, '\.spl$', '.sug', '') + echo 'Downloading ' . fname . '...' +- exe 'Nread ' g:spellfile_URL . '/' . fname ++ call spellfile#Nread(fname) + if getline(2) !~ 'VIMsug' + echo 'Sorry, downloading failed' + else +@@ -109,3 +109,10 @@ + bwipe + endif + endfunc ++ ++" Read "fname" from the ftp server. ++function! spellfile#Nread(fname) ++ let machine = substitute(g:spellfile_URL, 'ftp://\([^/]*\).*', '\1', '') ++ let dir = substitute(g:spellfile_URL, 'ftp://[^/]*/\(.*\)', '\1', '') ++ exe 'Nread "' . machine . ' anonymous vim7user ' . dir . '/' . a:fname . '"' ++endfunc +diff -Naur vim70-orig/runtime/plugin/matchparen.vim vim70/runtime/plugin/matchparen.vim +--- vim70-orig/runtime/plugin/matchparen.vim 2006-04-27 09:31:26.000000000 -0400 ++++ vim70/runtime/plugin/matchparen.vim 2006-05-25 09:13:12.000000000 -0400 +@@ -1,6 +1,6 @@ + " Vim plugin for showing matching parens + " Maintainer: Bram Moolenaar +-" Last Change: 2006 Apr 27 ++" Last Change: 2006 May 11 + + " Exit quickly when: + " - this plugin was already loaded (or disabled) +@@ -90,7 +90,7 @@ + " Find the match. When it was just before the cursor move it there for a + " moment. + if before > 0 +- let save_cursor = getpos('.') ++ let save_cursor = winsaveview() + call cursor(c_lnum, c_col - before) + endif + +@@ -102,7 +102,7 @@ + let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline) + + if before > 0 +- call setpos('.', save_cursor) ++ call winrestview(save_cursor) + endif + + " If a match is found setup match highlighting. +diff -Naur vim70-orig/src/edit.c vim70/src/edit.c +--- vim70-orig/src/edit.c 2006-05-07 07:48:51.000000000 -0400 ++++ vim70/src/edit.c 2006-05-25 09:13:12.000000000 -0400 +@@ -751,7 +751,7 @@ + continue; + } + +- /* Pressing CTRL-Y selects the current match. Shen ++ /* Pressing CTRL-Y selects the current match. When + * compl_enter_selects is set the Enter key does the same. */ + if (c == Ctrl_Y || (compl_enter_selects + && (c == CAR || c == K_KENTER || c == NL))) +@@ -3046,7 +3046,6 @@ + ins_compl_delete(); + ins_bytes(compl_leader + curwin->w_cursor.col - compl_col); + compl_used_match = FALSE; +- compl_enter_selects = FALSE; + + if (compl_started) + ins_compl_set_original_text(compl_leader); +@@ -3076,6 +3075,7 @@ + compl_restarting = FALSE; + } + ++#if 0 /* disabled, made CTRL-L, BS and typing char jump to original text. */ + if (!compl_used_match) + { + /* Go to the original text, since none of the matches is inserted. */ +@@ -3087,6 +3087,8 @@ + compl_curr_match = compl_shown_match; + compl_shows_dir = compl_direction; + } ++#endif ++ compl_enter_selects = !compl_used_match; + + /* Show the popup menu with a different set of matches. */ + ins_compl_show_pum(); +@@ -3175,10 +3177,32 @@ + char_u *p; + int len = curwin->w_cursor.col - compl_col; + int c; ++ compl_T *cp; + + p = compl_shown_match->cp_str; + if ((int)STRLEN(p) <= len) /* the match is too short */ +- return; ++ { ++ /* When still at the original match use the first entry that matches ++ * the leader. */ ++ if (compl_shown_match->cp_flags & ORIGINAL_TEXT) ++ { ++ p = NULL; ++ for (cp = compl_shown_match->cp_next; cp != NULL ++ && cp != compl_first_match; cp = cp->cp_next) ++ { ++ if (ins_compl_equal(cp, compl_leader, ++ (int)STRLEN(compl_leader))) ++ { ++ p = cp->cp_str; ++ break; ++ } ++ } ++ if (p == NULL || (int)STRLEN(p) <= len) ++ return; ++ } ++ else ++ return; ++ } + p += len; + #ifdef FEAT_MBYTE + c = mb_ptr2char(p); +@@ -4100,6 +4124,21 @@ + && compl_shown_match->cp_next != NULL + && compl_shown_match->cp_next != compl_first_match) + compl_shown_match = compl_shown_match->cp_next; ++ ++ /* If we didn't find it searching forward, and compl_shows_dir is ++ * backward, find the last match. */ ++ if (compl_shows_dir == BACKWARD ++ && !ins_compl_equal(compl_shown_match, ++ compl_leader, (int)STRLEN(compl_leader)) ++ && (compl_shown_match->cp_next == NULL ++ || compl_shown_match->cp_next == compl_first_match)) ++ { ++ while (!ins_compl_equal(compl_shown_match, ++ compl_leader, (int)STRLEN(compl_leader)) ++ && compl_shown_match->cp_prev != NULL ++ && compl_shown_match->cp_prev != compl_first_match) ++ compl_shown_match = compl_shown_match->cp_prev; ++ } + } + + if (allow_get_expansion && insert_match +diff -Naur vim70-orig/src/eval.c vim70/src/eval.c +--- vim70-orig/src/eval.c 2006-05-05 13:15:26.000000000 -0400 ++++ vim70/src/eval.c 2006-05-25 09:13:11.000000000 -0400 +@@ -11372,7 +11372,7 @@ + if (argvars[2].v_type != VAR_UNKNOWN) + { + char_u *xp_name; +- int xp_namelen; ++ int xp_namelen; + long argt; + + rettv->vval.v_string = NULL; +@@ -18963,7 +18963,8 @@ + else if (lead > 0) + { + lead = 3; +- if (eval_fname_sid(lv.ll_exp_name != NULL ? lv.ll_exp_name : *pp)) ++ if ((lv.ll_exp_name != NULL && eval_fname_sid(lv.ll_exp_name)) ++ || eval_fname_sid(*pp)) + { + /* It's "s:" or "" */ + if (current_SID <= 0) +diff -Naur vim70-orig/src/ex_docmd.c vim70/src/ex_docmd.c +--- vim70-orig/src/ex_docmd.c 2006-05-05 12:33:19.000000000 -0400 ++++ vim70/src/ex_docmd.c 2006-05-25 09:13:10.000000000 -0400 +@@ -833,7 +833,7 @@ + * If requested, store and reset the global values controlling the + * exception handling (used when debugging). + */ +- else if (flags & DOCMD_EXCRESET) ++ if (flags & DOCMD_EXCRESET) + save_dbg_stuff(&debug_saved); + + initial_trylevel = trylevel; +diff -Naur vim70-orig/src/gui_at_fs.c vim70/src/gui_at_fs.c +--- vim70-orig/src/gui_at_fs.c 2005-07-09 07:30:17.000000000 -0400 ++++ vim70/src/gui_at_fs.c 2006-05-25 09:13:13.000000000 -0400 +@@ -1861,27 +1861,27 @@ + XtPointer pnew; + { + SFDir *dir; +- int nw; ++ int nw = (int)(long)pnew; + + dir = &(SFdirs[SFdirPtr + (int)(long)n]); + + #ifdef FEAT_GUI_NEXTAW +- if ((int)(long)pnew < 0) ++ if (nw < 0) + { +- if ((int)(long)pnew > -SFvScrollHeight) +- (int)(long)pnew = -1; ++ if (nw > -SFvScrollHeight) ++ nw = -1; + else +- (int)(long)pnew = -SFlistSize; ++ nw = -SFlistSize; + } +- else if ((int)(long)pnew > 0) ++ else if (nw > 0) + { +- if ((int)(long)pnew < SFvScrollHeight) +- (int)(long)pnew = 1; ++ if (nw < SFvScrollHeight) ++ nw = 1; + else +- (int)(long)pnew = SFlistSize; ++ nw = SFlistSize; + } + #endif +- nw = dir->vOrigin + (int)(long)pnew; ++ nw += dir->vOrigin; + + if (nw > dir->nEntries - SFlistSize) + nw = dir->nEntries - SFlistSize; +@@ -1941,27 +1941,27 @@ + XtPointer pnew; + { + SFDir *dir; +- int nw; ++ int nw = (int)(long)pnew; + + dir = &(SFdirs[SFdirPtr + (int)(long)n]); + + #ifdef FEAT_GUI_NEXTAW +- if ((int)(long)pnew < 0) ++ if (nw < 0) + { +- if ((int)(long)pnew > -SFhScrollWidth) +- (int)(long)pnew = -1; ++ if (nw > -SFhScrollWidth) ++ nw = -1; + else +- (int)(long)pnew = -SFcharsPerEntry; ++ nw = -SFcharsPerEntry; + } +- else if ((int)(long)pnew > 0) ++ else if (nw > 0) + { +- if ((int)(long)pnew < SFhScrollWidth) +- (int)(long)pnew = 1; ++ if (nw < SFhScrollWidth) ++ nw = 1; + else +- (int)(long)pnew = SFcharsPerEntry; ++ nw = SFcharsPerEntry; + } + #endif +- nw = dir->hOrigin + (int)(long)pnew; ++ nw += dir->hOrigin; + + if (nw > dir->nChars - SFcharsPerEntry) + nw = dir->nChars - SFcharsPerEntry; +@@ -2038,26 +2038,26 @@ + XtPointer client_data; + XtPointer pnew; + { +- int nw; ++ int nw = (int)(long)pnew; + float f; + + #ifdef FEAT_GUI_NEXTAW +- if ((int)(long)pnew < 0) ++ if (nw < 0) + { +- if ((int)(long)pnew > -SFpathScrollWidth) +- (int)(long)pnew = -1; ++ if (nw > -SFpathScrollWidth) ++ nw = -1; + else +- (int)(long)pnew = -3; ++ nw = -3; + } +- else if ((int)(long)pnew > 0) ++ else if (nw > 0) + { +- if ((int)(long)pnew < SFpathScrollWidth) +- (int)(long)pnew = 1; ++ if (nw < SFpathScrollWidth) ++ nw = 1; + else +- (int)(long)pnew = 3; ++ nw = 3; + } + #endif +- nw = SFdirPtr + (int)(long)pnew; ++ nw += SFdirPtr; + + if (nw > SFdirEnd - 3) + nw = SFdirEnd - 3; +diff -Naur vim70-orig/src/gui.c vim70/src/gui.c +--- vim70-orig/src/gui.c 2006-05-03 07:00:59.000000000 -0400 ++++ vim70/src/gui.c 2006-05-25 09:13:10.000000000 -0400 +@@ -4603,11 +4603,11 @@ + /* Don't move the mouse when it's left or right of the Vim window */ + if (x < 0 || x > Columns * gui.char_width) + return; ++ if (y >= 0 + # ifdef FEAT_WINDOWS +- if (Y_2_ROW(y) >= tabline_height()) +-# else +- if (y >= 0) ++ && Y_2_ROW(y) >= tabline_height() + # endif ++ ) + wp = xy2win(x, y); + if (wp != curwin && wp != NULL) /* If in other than current window */ + { +diff -Naur vim70-orig/src/gui_xmebw.c vim70/src/gui_xmebw.c +--- vim70-orig/src/gui_xmebw.c 2006-04-30 11:32:32.000000000 -0400 ++++ vim70/src/gui_xmebw.c 2006-05-25 09:13:13.000000000 -0400 +@@ -47,13 +47,13 @@ + #include "gui_xmebwp.h" + + /* Provide some missing wrappers, which are missed from the LessTif +- * implementation. ++ * implementation. Also missing in Motif 1.2 and earlier. + * + * We neither use XmeGetPixmapData or _XmGetPixmapData, since with LessTif the + * pixmap will not appear in it's caches properly. We cache the interresting + * values in XmEnhancedButtonPart instead ourself. + */ +-#ifdef LESSTIF_VERSION ++#if defined(LESSTIF_VERSION) || (XmVersion <= 1002) + # ifndef Lab_IsMenupane + # define Lab_IsMenupane(w) (Lab_MenuType(w) == (int)XmMENU_POPUP || \ + Lab_MenuType(w) == (int)XmMENU_PULLDOWN) +@@ -480,7 +480,7 @@ + || (eb->core.height <= 2 * eb->primitive.highlight_thickness)) + return; + +-#ifndef LESSTIF_VERSION ++#if !defined(LESSTIF_VERSION) && (XmVersion > 1002) + { + XmDisplay dpy; + +@@ -641,7 +641,7 @@ + GC tmp_gc = NULL; + Boolean replaceGC = False; + Boolean deadjusted = False; +-#ifndef LESSTIF_VERSION ++#if !defined(LESSTIF_VERSION) && (XmVersion > 1002) + XmDisplay dpy = (XmDisplay)XmGetXmDisplay(XtDisplay(eb)); + Boolean etched_in = dpy->display.enable_etched_in_menu; + #else +@@ -726,7 +726,7 @@ + if ((((ShellWidget) XtParent(XtParent(eb)))->shell.popped_up) + && _XmGetInDragMode((Widget) eb)) + { +-#ifndef LESSTIF_VERSION ++#if !defined(LESSTIF_VERSION) && (XmVersion > 1002) + XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); + Boolean etched_in = dpy->display.enable_etched_in_menu; + #else +@@ -810,7 +810,7 @@ + + if (Lab_IsMenupane(eb)) + { +-#ifndef LESSTIF_VERSION ++#if !defined(LESSTIF_VERSION) && (XmVersion > 1002) + XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); + Boolean etched_in = dpy->display.enable_etched_in_menu; + #else +@@ -1150,7 +1150,7 @@ + Redisplay(Widget w, XEvent *event, Region region) + { + XmEnhancedButtonWidget eb = (XmEnhancedButtonWidget) w; +-#ifndef LESSTIF_VERSION ++#if !defined(LESSTIF_VERSION) && (XmVersion > 1002) + XmDisplay dpy; + XtEnum default_button_emphasis; + #endif +@@ -1162,7 +1162,7 @@ + if (!XtIsRealized((Widget)eb)) + return; + +-#ifndef LESSTIF_VERSION ++#if !defined(LESSTIF_VERSION) && (XmVersion > 1002) + dpy = (XmDisplay)XmGetXmDisplay(XtDisplay(eb)); + default_button_emphasis = dpy->display.default_button_emphasis; + #endif +@@ -1241,7 +1241,7 @@ + { + int adjust = 0; + +-#ifndef LESSTIF_VERSION ++#if !defined(LESSTIF_VERSION) && (XmVersion > 1002) + /* + * NOTE: PushButton has two types of shadows: primitive-shadow and + * default-button-shadow. If pushbutton is in a menu only primitive +@@ -1289,7 +1289,7 @@ + adjust, adjust, rectwidth, rectheight, borderwidth); + } + +-#ifndef LESSTIF_VERSION ++#if !defined(LESSTIF_VERSION) && (XmVersion > 1002) + switch (default_button_emphasis) + { + case XmINTERNAL_HIGHLIGHT: +@@ -1365,7 +1365,7 @@ + default_button_shadow_thickness = + eb->pushbutton.default_button_shadow_thickness; + +-#ifndef LESSTIF_VERSION ++#if !defined(LESSTIF_VERSION) && (XmVersion > 1002) + /* + * Compute location of bounding box to contain the + * defaultButtonShadow. +diff -Naur vim70-orig/src/Makefile vim70/src/Makefile +--- vim70-orig/src/Makefile 2006-05-07 09:25:27.000000000 -0400 ++++ vim70/src/Makefile 2006-05-25 09:13:11.000000000 -0400 +@@ -2177,6 +2177,7 @@ + cd $(SHADOWDIR)/xxd; ln -s ../../xxd/*.[ch] ../../xxd/Make* . + if test -d $(RSRC_DIR); then \ + cd $(SHADOWDIR); \ ++ ln -s ../infplist.xml .; \ + ln -s ../$(RSRC_DIR) ../os_mac.rsr.hqx ../dehqx.py .; \ + fi + mkdir $(SHADOWDIR)/testdir +diff -Naur vim70-orig/src/mbyte.c vim70/src/mbyte.c +--- vim70-orig/src/mbyte.c 2006-04-30 07:51:01.000000000 -0400 ++++ vim70/src/mbyte.c 2006-05-25 09:13:13.000000000 -0400 +@@ -311,7 +311,11 @@ + + #define IDX_MACROMAN 57 + {"macroman", ENC_8BIT + ENC_MACROMAN, 0}, /* Mac OS */ +-#define IDX_COUNT 58 ++#define IDX_DECMCS 58 ++ {"dec-mcs", ENC_8BIT, 0}, /* DEC MCS */ ++#define IDX_HPROMAN8 59 ++ {"hp-roman8", ENC_8BIT, 0}, /* HP Roman8 */ ++#define IDX_COUNT 60 + }; + + /* +@@ -386,6 +390,7 @@ + {"950", IDX_BIG5}, + #endif + {"mac", IDX_MACROMAN}, ++ {"mac-roman", IDX_MACROMAN}, + {NULL, 0} + }; + +diff -Naur vim70-orig/src/message.c vim70/src/message.c +--- vim70-orig/src/message.c 2006-05-06 16:07:37.000000000 -0400 ++++ vim70/src/message.c 2006-05-25 09:13:11.000000000 -0400 +@@ -4175,15 +4175,16 @@ + str_arg_l = 0; + else + { +- /* memchr on HP does not like n > 2^31 !!! */ +- char *q = memchr(str_arg, '\0', ++ /* Don't put the #if inside memchr(), it can be a ++ * macro. */ + #if SIZEOF_INT <= 2 +- precision ++ char *q = memchr(str_arg, '\0', precision); + #else +- precision <= (size_t)0x7fffffffL ? precision +- : (size_t)0x7fffffffL ++ /* memchr on HP does not like n > 2^31 !!! */ ++ char *q = memchr(str_arg, '\0', ++ precision <= (size_t)0x7fffffffL ? precision ++ : (size_t)0x7fffffffL); + #endif +- ); + str_arg_l = (q == NULL) ? precision : q - str_arg; + } + break; +diff -Naur vim70-orig/src/option.c vim70/src/option.c +--- vim70-orig/src/option.c 2006-05-03 13:32:28.000000000 -0400 ++++ vim70/src/option.c 2006-05-25 09:13:12.000000000 -0400 +@@ -2294,7 +2294,7 @@ + {(char_u *)0L, (char_u *)0L} + #endif + }, +- {"spellsuggest", "sps", P_STRING|P_VI_DEF|P_EXPAND|P_SECURE, ++ {"spellsuggest", "sps", P_STRING|P_VI_DEF|P_EXPAND|P_SECURE|P_COMMA, + #ifdef FEAT_SPELL + (char_u *)&p_sps, PV_NONE, + {(char_u *)"best", (char_u *)0L} +@@ -5227,13 +5227,13 @@ + case PV_STL: return &curwin->w_p_stl_flags; + #endif + #ifdef FEAT_EVAL ++# ifdef FEAT_FOLDING + case PV_FDE: return &curwin->w_p_fde_flags; + case PV_FDT: return &curwin->w_p_fdt_flags; ++# endif + # ifdef FEAT_BEVAL + case PV_BEXPR: return &curbuf->b_p_bexpr_flags; + # endif +-#endif +-#if defined(FEAT_EVAL) + # if defined(FEAT_CINDENT) + case PV_INDE: return &curbuf->b_p_inde_flags; + # endif +diff -Naur vim70-orig/src/spell.c vim70/src/spell.c +--- vim70-orig/src/spell.c 2006-05-05 03:49:58.000000000 -0400 ++++ vim70/src/spell.c 2006-05-25 09:13:11.000000000 -0400 +@@ -2108,7 +2108,8 @@ + * possible. */ + STRCPY(buf, line); + if (lnum < wp->w_buffer->b_ml.ml_line_count) +- spell_cat_line(buf + STRLEN(buf), ml_get(lnum + 1), MAXWLEN); ++ spell_cat_line(buf + STRLEN(buf), ++ ml_get_buf(wp->w_buffer, lnum + 1, FALSE), MAXWLEN); + + p = buf + skip; + endp = buf + len; +diff -Naur vim70-orig/src/version.c vim70/src/version.c +--- vim70-orig/src/version.c 2006-05-03 03:50:42.000000000 -0400 ++++ vim70/src/version.c 2006-05-25 09:13:13.000000000 -0400 +@@ -667,6 +667,38 @@ + static int included_patches[] = + { /* Add new patch number below this line */ + /**/ ++ 17, ++/**/ ++ 16, ++/**/ ++ 15, ++/**/ ++ 14, ++/**/ ++ 13, ++/**/ ++ 12, ++/**/ ++ 11, ++/**/ ++ 10, ++/**/ ++ 9, ++/**/ ++ 8, ++/**/ ++ 7, ++/**/ ++ 6, ++/**/ ++ 4, ++/**/ ++ 3, ++/**/ ++ 2, ++/**/ ++ 1, ++/**/ + 0 + }; + diff --git a/base-source/vim-7.0-lang.tar.gz b/base-source/vim-7.0-lang.tar.gz new file mode 100644 index 0000000..4692a2c Binary files /dev/null and b/base-source/vim-7.0-lang.tar.gz differ diff --git a/base-source/vim-7.0-mandir-1.patch b/base-source/vim-7.0-mandir-1.patch new file mode 100644 index 0000000..4038442 --- /dev/null +++ b/base-source/vim-7.0-mandir-1.patch @@ -0,0 +1,82 @@ +Submitted By: Alexander E. Patrakov +Date: 2006-05-27 +Initial Package Version: 7.0 +Upstream status: LFS specific +Description: Adjusts installation of manual pages to meet Man-DB expectations. + + Additional change to explicitly install the man pages into + /usr/share/man instead of /usr/man by Ag Hatzim. + +--- vim70/src/Makefile.orig 2006-05-27 12:49:31.767959808 +0300 ++++ vim70/src/Makefile 2006-05-27 12:49:55.778309680 +0300 +@@ -867,7 +867,7 @@ + # Uncomment the next line to install Vim in "/usr/bin" + #BINDIR = /usr/bin + # Uncomment the next line to install Vim manuals in "/usr/share/man/man1" +-#MANDIR = /usr/share/man ++MANDIR = /usr/share/man + # Uncomment the next line to install Vim help files in "/usr/share/vim" + #DATADIR = /usr/share + +@@ -1325,7 +1325,7 @@ + DEST_MAN_PL = $(DEST_MAN_TOP)/pl$(MAN1DIR) + DEST_MAN_PL_I = $(DEST_MAN_TOP)/pl.ISO8859-2$(MAN1DIR) + DEST_MAN_PL_U = $(DEST_MAN_TOP)/pl.UTF-8$(MAN1DIR) +-DEST_MAN_RU = $(DEST_MAN_TOP)/ru.KOI8-R$(MAN1DIR) ++DEST_MAN_RU = $(DEST_MAN_TOP)/ru$(MAN1DIR) + DEST_MAN_RU_U = $(DEST_MAN_TOP)/ru.UTF-8$(MAN1DIR) + + # BASIC_SRC: files that are always used +@@ -1905,52 +1905,24 @@ + # install the language specific files for tools, if they were unpacked + install-tool-languages: + -$(SHELL) ./installman.sh xxd $(DEST_MAN_FR) "-fr" $(INSTALLMANARGS) +- -$(SHELL) ./installman.sh xxd $(DEST_MAN_FR_I) "-fr" $(INSTALLMANARGS) +- -$(SHELL) ./installman.sh xxd $(DEST_MAN_FR_U) "-fr.UTF-8" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh xxd $(DEST_MAN_IT) "-it" $(INSTALLMANARGS) +- -$(SHELL) ./installman.sh xxd $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS) +- -$(SHELL) ./installman.sh xxd $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh xxd $(DEST_MAN_PL) "-pl" $(INSTALLMANARGS) +- -$(SHELL) ./installman.sh xxd $(DEST_MAN_PL_I) "-pl" $(INSTALLMANARGS) +- -$(SHELL) ./installman.sh xxd $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh xxd $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS) +- -$(SHELL) ./installman.sh xxd $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS) + + # install the language specific files, if they were unpacked + install-languages: languages $(DEST_LANG) $(DEST_KMAP) + -$(SHELL) ./installman.sh install $(DEST_MAN_FR) "-fr" $(INSTALLMANARGS) +- -$(SHELL) ./installman.sh install $(DEST_MAN_FR_I) "-fr" $(INSTALLMANARGS) +- -$(SHELL) ./installman.sh install $(DEST_MAN_FR_U) "-fr.UTF-8" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh install $(DEST_MAN_IT) "-it" $(INSTALLMANARGS) +- -$(SHELL) ./installman.sh install $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS) +- -$(SHELL) ./installman.sh install $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh install $(DEST_MAN_PL) "-pl" $(INSTALLMANARGS) +- -$(SHELL) ./installman.sh install $(DEST_MAN_PL_I) "-pl" $(INSTALLMANARGS) +- -$(SHELL) ./installman.sh install $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh install $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS) +- -$(SHELL) ./installman.sh install $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS) + -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ + $(DEST_MAN_FR) $(INSTALLMLARGS) + -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ +- $(DEST_MAN_FR_I) $(INSTALLMLARGS) +- -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ +- $(DEST_MAN_FR_U) $(INSTALLMLARGS) +- -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ + $(DEST_MAN_IT) $(INSTALLMLARGS) + -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ +- $(DEST_MAN_IT_I) $(INSTALLMLARGS) +- -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ +- $(DEST_MAN_IT_U) $(INSTALLMLARGS) +- -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ + $(DEST_MAN_PL) $(INSTALLMLARGS) + -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ +- $(DEST_MAN_PL_I) $(INSTALLMLARGS) +- -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ +- $(DEST_MAN_PL_U) $(INSTALLMLARGS) +- -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ + $(DEST_MAN_RU) $(INSTALLMLARGS) +- -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ +- $(DEST_MAN_RU_U) $(INSTALLMLARGS) + if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \ + cd $(PODIR); $(MAKE) prefix=$(DESTDIR)$(prefix) LOCALEDIR=$(DEST_LANG) \ + INSTALL_DATA=$(INSTALL_DATA) FILEMOD=$(FILEMOD) install; \ diff --git a/base-source/vim-7.0.tar.bz2 b/base-source/vim-7.0.tar.bz2 new file mode 100644 index 0000000..f1ec10e Binary files /dev/null and b/base-source/vim-7.0.tar.bz2 differ diff --git a/base-source/wget-1.10.2.tar.gz b/base-source/wget-1.10.2.tar.gz new file mode 100644 index 0000000..74a8739 Binary files /dev/null and b/base-source/wget-1.10.2.tar.gz differ diff --git a/base-source/whois_4.7.14.tar.gz b/base-source/whois_4.7.14.tar.gz new file mode 100644 index 0000000..269d194 Binary files /dev/null and b/base-source/whois_4.7.14.tar.gz differ diff --git a/base-source/wireless_tools.28.tar.gz b/base-source/wireless_tools.28.tar.gz new file mode 100644 index 0000000..aaccacd Binary files /dev/null and b/base-source/wireless_tools.28.tar.gz differ diff --git a/base-source/zip231.tar.gz b/base-source/zip231.tar.gz new file mode 100644 index 0000000..0d561d7 Binary files /dev/null and b/base-source/zip231.tar.gz differ diff --git a/base-source/zlib-1.2.3.tar.gz b/base-source/zlib-1.2.3.tar.gz new file mode 100644 index 0000000..c222de1 Binary files /dev/null and b/base-source/zlib-1.2.3.tar.gz differ diff --git a/baseconfig-20060602.tar.bz2 b/baseconfig-20060602.tar.bz2 new file mode 100644 index 0000000..9c2d72e Binary files /dev/null and b/baseconfig-20060602.tar.bz2 differ diff --git a/baseconfig-20060720.tar.bz2 b/baseconfig-20060720.tar.bz2 new file mode 100644 index 0000000..8cce492 Binary files /dev/null and b/baseconfig-20060720.tar.bz2 differ diff --git a/baseconfig-20061012.tar.bz2 b/baseconfig-20061012.tar.bz2 new file mode 100644 index 0000000..ffe24e5 Binary files /dev/null and b/baseconfig-20061012.tar.bz2 differ diff --git a/baseconfig/etc/fstab b/baseconfig/etc/fstab new file mode 100644 index 0000000..e07248e --- /dev/null +++ b/baseconfig/etc/fstab @@ -0,0 +1,9 @@ +# Begin /etc/fstab + +# file system mount-point type options dump fsck +# order + +/dev/ / defaults 1 1 +/dev/ swap swap pri=1 0 0 + +# End /etc/fstab diff --git a/baseconfig/etc/group b/baseconfig/etc/group new file mode 100644 index 0000000..438d9e4 --- /dev/null +++ b/baseconfig/etc/group @@ -0,0 +1,19 @@ +root:x:0: +bin:x:1: +sys:x:2: +kmem:x:3: +tty:x:4: +tape:x:5: +daemon:x:6: +floppy:x:7: +disk:x:8: +lp:x:9: +dialout:x:10: +audio:x:11: +video:x:12: +utmp:x:13: +usb:x:14: +cdrom:x:15: +sshd:x:50: +nobody:x:1001: +nogroup:x:1002: diff --git a/baseconfig/etc/hostname b/baseconfig/etc/hostname new file mode 100644 index 0000000..a624e3d --- /dev/null +++ b/baseconfig/etc/hostname @@ -0,0 +1 @@ +darkstar diff --git a/baseconfig/etc/hosts b/baseconfig/etc/hosts new file mode 100644 index 0000000..f033671 --- /dev/null +++ b/baseconfig/etc/hosts @@ -0,0 +1 @@ +127.0.0.1 localhost darkstar diff --git a/baseconfig/etc/inputrc b/baseconfig/etc/inputrc new file mode 100644 index 0000000..8bb020e --- /dev/null +++ b/baseconfig/etc/inputrc @@ -0,0 +1,43 @@ +# Begin /etc/inputrc +# Modified by Chris Lynn + +# Allow the command prompt to wrap to the next line +set horizontal-scroll-mode Off + +# Enable 8bit input +set meta-flag On +set input-meta On + +# Turns off 8th bit stripping +set convert-meta Off + +# Keep the 8th bit for display +set output-meta On + +# none, visible or audible +set bell-style none + +# All of the following map the escape sequence of the +# value contained inside the 1st argument to the +# readline specific functions + +"\eOd": backward-word +"\eOc": forward-word + +# for linux console +"\e[1~": beginning-of-line +"\e[4~": end-of-line +"\e[5~": beginning-of-history +"\e[6~": end-of-history +"\e[3~": delete-char +"\e[2~": quoted-insert + +# for xterm +"\eOH": beginning-of-line +"\eOF": end-of-line + +# for Konsole +"\e[H": beginning-of-line +"\e[F": end-of-line + +# End /etc/inputrc diff --git a/baseconfig/etc/mtab b/baseconfig/etc/mtab new file mode 100644 index 0000000..e69de29 diff --git a/baseconfig/etc/passwd b/baseconfig/etc/passwd new file mode 100644 index 0000000..0618519 --- /dev/null +++ b/baseconfig/etc/passwd @@ -0,0 +1,2 @@ +root:x:0:0:root:/root:/bin/bash +nobody:x:1001:1001::/home/nobody: diff --git a/baseconfig/etc/profile b/baseconfig/etc/profile new file mode 100644 index 0000000..28186fc --- /dev/null +++ b/baseconfig/etc/profile @@ -0,0 +1,35 @@ +# Begin /etc/profile + +# Set PATH +if [ "`id -u`" -eq 0 ]; then + PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" +else + PATH="/usr/bin:/bin:/usr/local/bin:~/bin:." +fi +export PATH + + +# Set prompt +if [ "$PS1" ]; then + if [ "$BASH" ]; then + PS1='\u@\h:\w\$ ' + else + if [ "`id -u`" -eq 0 ]; then + PS1='# ' + else + PS1='$ ' + fi + fi +fi + + +umask 022 + +export LANG=es_ES@euro +export INPUTRC=/etc/inputrc + +# Aliases +alias ls='ls --color' +alias cd..='cd ..' + +# End /etc/profile diff --git a/baseconfig/var/log/btmp b/baseconfig/var/log/btmp new file mode 100644 index 0000000..e69de29 diff --git a/baseconfig/var/log/lastlog b/baseconfig/var/log/lastlog new file mode 100644 index 0000000..e69de29 diff --git a/baseconfig/var/log/wtmp b/baseconfig/var/log/wtmp new file mode 100644 index 0000000..e69de29 diff --git a/baseconfig/var/run/utmp b/baseconfig/var/run/utmp new file mode 100644 index 0000000..e69de29 diff --git a/blfs-changes.txt b/blfs-changes.txt new file mode 100644 index 0000000..49eb3e3 --- /dev/null +++ b/blfs-changes.txt @@ -0,0 +1,131 @@ +hdparm-6.6.tar.bz2 +pkg-config-0.20.tar.bz2 +gpm-1.20.1.tar.bz2 +jpeg-6b.tar.bz2 +libpng-1.2.8.tar.bz2 +links-2.1pre21.tar.bz2 +libusb-0.1.12.tar.bz2 +openssl-0.9.8b.tar.bz2 +pciacces-20060604.tar.bz2 +wget-1.10.2.tar.bz2 +wireless_tools.28.tar.bz2 +cvs-1.11.21.tar.bz2 +expat-2.0.0.tar.bz2 +freetype-2.1.10.tar.bz2 +fontconfig-2.3.2.tar.bz2 +glib-2.10.3.tar.bz2 +net-tools-1.60.tar.bz2 +mc-4.6.1.tar.bz2 +libdrm-20060604.tar.bz2 +xorg-proto-7.1.tar.bz2 +xorg-util-7.1.tar.bz2 +xorg-lib-7.1.tar.bz2 +xorg-app-7.1.tar.bz2 +xorg-data-7.1.tar.bz2 +xbitmaps-1.0.1.tar.bz2 +luit-1.0.1.tar.bz2 +mesa-20060604.tar.bz2 +xorg-font-7.1.tar.bz2 +xorg-server-1.1.0.tar.bz2 +xorg-driver-input-keyboard-1.1.0.tar.bz2 +xorg-driver-input-mouse-1.1.0.tar.bz2 +xorg-driver-video-ati-6.6.0.tar.bz2 +xorg-driver-video-i810-1.6.0.tar.bz2 +xorg-driver-video-vesa-1.2.0.tar.bz2 +xterm-213.tar.bz2 + +alsa-lib-1.0.11.tar.bz2 +alsa-oss-1.0.11.tar.bz2 +mpg123-0.59r.tar.bz2 +alsa-plugins-1.0.11.tar.bz2 +alsa-utils-1.0.11.tar.bz2 +unzip-5.52.tar.bz2 + + +giflib-4.1.4.tar.bz2 +tiff-3.8.2.tar.bz2 +imlib-1.9.15.tar.bz2 + +icewm-1.2.26.tar.bz2 + + +zip-2.31.tar.bz2 +lesstif-0.94.4.tar.bz2 +mrxvt-0.5.0.tar.bz2 +nedit-5.5.tar.bz2 +gdb-6.4.tar.bz2 +valgrind-3.2.0.tar.bz2 + + +cairo-1.0.4.tar.bz2 +pango-1.12.3.tar.bz2 +atk-1.11.4.tar.bz2 +gtk+-2.8.18.tar.bz2 + + +XML_Parser-2.34.tar.bz2 + +libart_lgpl-2.3.17.tar.bz2 + +gimp-2.2.11.tar.bz2 + +ImageMagick-6.2.8.tar.bz2 + + +xpdf-3.01.tar.bz2 + +libIDL-0.8.6.tar.bz2 + +firefox-1.5.0.3.tar.bz2 + +sylpheed-2.2.6.tar.bz2 + +gqmpeg-0.91.tar.bz2 + + + + +libogg-1.1.3.tar.bz2 +libvorbis-1.1.1.tar.bz2 +libao-0.8.6.tar.bz2 + +curl-7.15.3.tar.bz2 + +vorbis-tools-1.1.1.tar.bz2 + + +libxml2-2.6.24.tar.bz2 + +libglade-2.5.1.tar.bz2 + +audacious-1.0.0.tar.bz2 + + + +gamin-0.1.7.tar.bz2 + + + +openal-0.0.8.tar.bz2 + + + +openssh-4.3p2.tar.bz2 + + +MPlayer-1.0pre7try2.tar.bz2 + + +gftp-2.0.18.tar.bz2 + + + +proftpd-1.3.0.tar.bz2 + + + +pciutils-2.2.3.tar.bz2 +usbutils-0.72.tar.bz2 +setserial-2.17.tar.bz2 + +SDL-1.2.11.tar.bz2 diff --git a/blfs-pkgs/ImageMagick-6.2.8.tar.bz2 b/blfs-pkgs/ImageMagick-6.2.8.tar.bz2 new file mode 100644 index 0000000..29af370 Binary files /dev/null and b/blfs-pkgs/ImageMagick-6.2.8.tar.bz2 differ diff --git a/blfs-pkgs/MPlayer-1.0pre7try2.tar.bz2 b/blfs-pkgs/MPlayer-1.0pre7try2.tar.bz2 new file mode 100644 index 0000000..eef7c03 Binary files /dev/null and b/blfs-pkgs/MPlayer-1.0pre7try2.tar.bz2 differ diff --git a/blfs-pkgs/SDL-1.2.11.tar.bz2 b/blfs-pkgs/SDL-1.2.11.tar.bz2 new file mode 100644 index 0000000..5f34769 Binary files /dev/null and b/blfs-pkgs/SDL-1.2.11.tar.bz2 differ diff --git a/blfs-pkgs/atk-1.11.4.tar.bz2 b/blfs-pkgs/atk-1.11.4.tar.bz2 new file mode 100644 index 0000000..d009798 Binary files /dev/null and b/blfs-pkgs/atk-1.11.4.tar.bz2 differ diff --git a/blfs-pkgs/audacious-1.0.0.tar.bz2 b/blfs-pkgs/audacious-1.0.0.tar.bz2 new file mode 100644 index 0000000..9521628 Binary files /dev/null and b/blfs-pkgs/audacious-1.0.0.tar.bz2 differ diff --git a/blfs-pkgs/cairo-1.0.4.tar.bz2 b/blfs-pkgs/cairo-1.0.4.tar.bz2 new file mode 100644 index 0000000..65fcb70 Binary files /dev/null and b/blfs-pkgs/cairo-1.0.4.tar.bz2 differ diff --git a/blfs-pkgs/curl-7.15.3.tar.bz2 b/blfs-pkgs/curl-7.15.3.tar.bz2 new file mode 100644 index 0000000..fd4eed2 Binary files /dev/null and b/blfs-pkgs/curl-7.15.3.tar.bz2 differ diff --git a/blfs-pkgs/firefox-1.5.0.3.tar.bz2 b/blfs-pkgs/firefox-1.5.0.3.tar.bz2 new file mode 100644 index 0000000..c419ea9 Binary files /dev/null and b/blfs-pkgs/firefox-1.5.0.3.tar.bz2 differ diff --git a/blfs-pkgs/fontconfig-2.3.2.tar.bz2 b/blfs-pkgs/fontconfig-2.3.2.tar.bz2 new file mode 100644 index 0000000..05dc77c Binary files /dev/null and b/blfs-pkgs/fontconfig-2.3.2.tar.bz2 differ diff --git a/blfs-pkgs/freetype-2.1.10.tar.bz2 b/blfs-pkgs/freetype-2.1.10.tar.bz2 new file mode 100644 index 0000000..09af080 Binary files /dev/null and b/blfs-pkgs/freetype-2.1.10.tar.bz2 differ diff --git a/blfs-pkgs/gamin-0.1.7.tar.bz2 b/blfs-pkgs/gamin-0.1.7.tar.bz2 new file mode 100644 index 0000000..4523a62 Binary files /dev/null and b/blfs-pkgs/gamin-0.1.7.tar.bz2 differ diff --git a/blfs-pkgs/gftp-2.0.18.tar.bz2 b/blfs-pkgs/gftp-2.0.18.tar.bz2 new file mode 100644 index 0000000..7c58c91 Binary files /dev/null and b/blfs-pkgs/gftp-2.0.18.tar.bz2 differ diff --git a/blfs-pkgs/giflib-4.1.4.tar.bz2 b/blfs-pkgs/giflib-4.1.4.tar.bz2 new file mode 100644 index 0000000..2efa6ec Binary files /dev/null and b/blfs-pkgs/giflib-4.1.4.tar.bz2 differ diff --git a/blfs-pkgs/gimp-2.2.11.tar.bz2 b/blfs-pkgs/gimp-2.2.11.tar.bz2 new file mode 100644 index 0000000..0f2dc5e Binary files /dev/null and b/blfs-pkgs/gimp-2.2.11.tar.bz2 differ diff --git a/blfs-pkgs/glib-2.10.3.tar.bz2 b/blfs-pkgs/glib-2.10.3.tar.bz2 new file mode 100644 index 0000000..061fd97 Binary files /dev/null and b/blfs-pkgs/glib-2.10.3.tar.bz2 differ diff --git a/blfs-pkgs/gqmpeg-0.91.tar.bz2 b/blfs-pkgs/gqmpeg-0.91.tar.bz2 new file mode 100644 index 0000000..129cedb Binary files /dev/null and b/blfs-pkgs/gqmpeg-0.91.tar.bz2 differ diff --git a/blfs-pkgs/gtk+-2.8.18.tar.bz2 b/blfs-pkgs/gtk+-2.8.18.tar.bz2 new file mode 100644 index 0000000..af2fd06 Binary files /dev/null and b/blfs-pkgs/gtk+-2.8.18.tar.bz2 differ diff --git a/blfs-pkgs/icewm-1.2.26.tar.bz2 b/blfs-pkgs/icewm-1.2.26.tar.bz2 new file mode 100644 index 0000000..b7b4e3c Binary files /dev/null and b/blfs-pkgs/icewm-1.2.26.tar.bz2 differ diff --git a/blfs-pkgs/imlib-1.9.15.tar.bz2 b/blfs-pkgs/imlib-1.9.15.tar.bz2 new file mode 100644 index 0000000..4ba4cd0 Binary files /dev/null and b/blfs-pkgs/imlib-1.9.15.tar.bz2 differ diff --git a/blfs-pkgs/jpeg-6b.tar.bz2 b/blfs-pkgs/jpeg-6b.tar.bz2 new file mode 100644 index 0000000..56c9d64 Binary files /dev/null and b/blfs-pkgs/jpeg-6b.tar.bz2 differ diff --git a/blfs-pkgs/lesstif-0.94.4.tar.bz2 b/blfs-pkgs/lesstif-0.94.4.tar.bz2 new file mode 100644 index 0000000..7c81060 Binary files /dev/null and b/blfs-pkgs/lesstif-0.94.4.tar.bz2 differ diff --git a/blfs-pkgs/libIDL-0.8.6.tar.bz2 b/blfs-pkgs/libIDL-0.8.6.tar.bz2 new file mode 100644 index 0000000..1af308b Binary files /dev/null and b/blfs-pkgs/libIDL-0.8.6.tar.bz2 differ diff --git a/blfs-pkgs/libao-0.8.6.tar.bz2 b/blfs-pkgs/libao-0.8.6.tar.bz2 new file mode 100644 index 0000000..2c1189a Binary files /dev/null and b/blfs-pkgs/libao-0.8.6.tar.bz2 differ diff --git a/blfs-pkgs/libart_lgpl-2.3.17.tar.bz2 b/blfs-pkgs/libart_lgpl-2.3.17.tar.bz2 new file mode 100644 index 0000000..5f22a44 Binary files /dev/null and b/blfs-pkgs/libart_lgpl-2.3.17.tar.bz2 differ diff --git a/blfs-pkgs/libdrm-20060604.tar.bz2 b/blfs-pkgs/libdrm-20060604.tar.bz2 new file mode 100644 index 0000000..fd4eb94 Binary files /dev/null and b/blfs-pkgs/libdrm-20060604.tar.bz2 differ diff --git a/blfs-pkgs/libglade-2.5.1.tar.bz2 b/blfs-pkgs/libglade-2.5.1.tar.bz2 new file mode 100644 index 0000000..e5c7c33 Binary files /dev/null and b/blfs-pkgs/libglade-2.5.1.tar.bz2 differ diff --git a/blfs-pkgs/libogg-1.1.3.tar.bz2 b/blfs-pkgs/libogg-1.1.3.tar.bz2 new file mode 100644 index 0000000..8a575c1 Binary files /dev/null and b/blfs-pkgs/libogg-1.1.3.tar.bz2 differ diff --git a/blfs-pkgs/libpng-1.2.8.tar.bz2 b/blfs-pkgs/libpng-1.2.8.tar.bz2 new file mode 100644 index 0000000..c4714da Binary files /dev/null and b/blfs-pkgs/libpng-1.2.8.tar.bz2 differ diff --git a/blfs-pkgs/libvorbis-1.1.1.tar.bz2 b/blfs-pkgs/libvorbis-1.1.1.tar.bz2 new file mode 100644 index 0000000..eb07088 Binary files /dev/null and b/blfs-pkgs/libvorbis-1.1.1.tar.bz2 differ diff --git a/blfs-pkgs/libxml2-2.6.24.tar.bz2 b/blfs-pkgs/libxml2-2.6.24.tar.bz2 new file mode 100644 index 0000000..9b418c4 Binary files /dev/null and b/blfs-pkgs/libxml2-2.6.24.tar.bz2 differ diff --git a/blfs-pkgs/links-2.1pre21.tar.bz2 b/blfs-pkgs/links-2.1pre21.tar.bz2 new file mode 100644 index 0000000..cf72689 Binary files /dev/null and b/blfs-pkgs/links-2.1pre21.tar.bz2 differ diff --git a/blfs-pkgs/luit-1.0.1.tar.bz2 b/blfs-pkgs/luit-1.0.1.tar.bz2 new file mode 100644 index 0000000..ebc36d7 Binary files /dev/null and b/blfs-pkgs/luit-1.0.1.tar.bz2 differ diff --git a/blfs-pkgs/mc-4.6.1.tar.bz2 b/blfs-pkgs/mc-4.6.1.tar.bz2 new file mode 100644 index 0000000..5aa28ab Binary files /dev/null and b/blfs-pkgs/mc-4.6.1.tar.bz2 differ diff --git a/blfs-pkgs/mesa-20060604.tar.bz2 b/blfs-pkgs/mesa-20060604.tar.bz2 new file mode 100644 index 0000000..5072904 Binary files /dev/null and b/blfs-pkgs/mesa-20060604.tar.bz2 differ diff --git a/blfs-pkgs/mpg123-0.59r.tar.bz2 b/blfs-pkgs/mpg123-0.59r.tar.bz2 new file mode 100644 index 0000000..8e28934 Binary files /dev/null and b/blfs-pkgs/mpg123-0.59r.tar.bz2 differ diff --git a/blfs-pkgs/mpg123-0.61.tar.bz2 b/blfs-pkgs/mpg123-0.61.tar.bz2 new file mode 100644 index 0000000..a04b4c7 Binary files /dev/null and b/blfs-pkgs/mpg123-0.61.tar.bz2 differ diff --git a/blfs-pkgs/mrxvt-0.5.0.tar.bz2 b/blfs-pkgs/mrxvt-0.5.0.tar.bz2 new file mode 100644 index 0000000..10b8e36 Binary files /dev/null and b/blfs-pkgs/mrxvt-0.5.0.tar.bz2 differ diff --git a/blfs-pkgs/nedit-5.5.tar.bz2 b/blfs-pkgs/nedit-5.5.tar.bz2 new file mode 100644 index 0000000..1358d08 Binary files /dev/null and b/blfs-pkgs/nedit-5.5.tar.bz2 differ diff --git a/blfs-pkgs/openal-0.0.8.tar.bz2 b/blfs-pkgs/openal-0.0.8.tar.bz2 new file mode 100644 index 0000000..2fdfb83 Binary files /dev/null and b/blfs-pkgs/openal-0.0.8.tar.bz2 differ diff --git a/blfs-pkgs/pango-1.12.3.tar.bz2 b/blfs-pkgs/pango-1.12.3.tar.bz2 new file mode 100644 index 0000000..adb8289 Binary files /dev/null and b/blfs-pkgs/pango-1.12.3.tar.bz2 differ diff --git a/blfs-pkgs/pciacces-20060604.tar.bz2 b/blfs-pkgs/pciacces-20060604.tar.bz2 new file mode 100644 index 0000000..8c6ff1d Binary files /dev/null and b/blfs-pkgs/pciacces-20060604.tar.bz2 differ diff --git a/blfs-pkgs/sylpheed-2.2.6.tar.bz2 b/blfs-pkgs/sylpheed-2.2.6.tar.bz2 new file mode 100644 index 0000000..d8bade3 Binary files /dev/null and b/blfs-pkgs/sylpheed-2.2.6.tar.bz2 differ diff --git a/blfs-pkgs/tiff-3.8.2.tar.bz2 b/blfs-pkgs/tiff-3.8.2.tar.bz2 new file mode 100644 index 0000000..61d2aab Binary files /dev/null and b/blfs-pkgs/tiff-3.8.2.tar.bz2 differ diff --git a/blfs-pkgs/valgrind-3.2.0.tar.bz2 b/blfs-pkgs/valgrind-3.2.0.tar.bz2 new file mode 100644 index 0000000..b9d4a15 Binary files /dev/null and b/blfs-pkgs/valgrind-3.2.0.tar.bz2 differ diff --git a/blfs-pkgs/vorbis-tools-1.1.1.tar.bz2 b/blfs-pkgs/vorbis-tools-1.1.1.tar.bz2 new file mode 100644 index 0000000..5be7684 Binary files /dev/null and b/blfs-pkgs/vorbis-tools-1.1.1.tar.bz2 differ diff --git a/blfs-pkgs/xbitmaps-1.0.1.tar.bz2 b/blfs-pkgs/xbitmaps-1.0.1.tar.bz2 new file mode 100644 index 0000000..6d13cd1 Binary files /dev/null and b/blfs-pkgs/xbitmaps-1.0.1.tar.bz2 differ diff --git a/blfs-pkgs/xorg-app-7.1.tar.bz2 b/blfs-pkgs/xorg-app-7.1.tar.bz2 new file mode 100644 index 0000000..e96669b Binary files /dev/null and b/blfs-pkgs/xorg-app-7.1.tar.bz2 differ diff --git a/blfs-pkgs/xorg-data-7.1.tar.bz2 b/blfs-pkgs/xorg-data-7.1.tar.bz2 new file mode 100644 index 0000000..61c8f8a Binary files /dev/null and b/blfs-pkgs/xorg-data-7.1.tar.bz2 differ diff --git a/blfs-pkgs/xorg-driver-input-keyboard-1.1.0.tar.bz2 b/blfs-pkgs/xorg-driver-input-keyboard-1.1.0.tar.bz2 new file mode 100644 index 0000000..9bd5ef6 Binary files /dev/null and b/blfs-pkgs/xorg-driver-input-keyboard-1.1.0.tar.bz2 differ diff --git a/blfs-pkgs/xorg-driver-input-mouse-1.1.0.tar.bz2 b/blfs-pkgs/xorg-driver-input-mouse-1.1.0.tar.bz2 new file mode 100644 index 0000000..060c3f8 Binary files /dev/null and b/blfs-pkgs/xorg-driver-input-mouse-1.1.0.tar.bz2 differ diff --git a/blfs-pkgs/xorg-driver-video-ati-6.6.0.tar.bz2 b/blfs-pkgs/xorg-driver-video-ati-6.6.0.tar.bz2 new file mode 100644 index 0000000..15fa17c Binary files /dev/null and b/blfs-pkgs/xorg-driver-video-ati-6.6.0.tar.bz2 differ diff --git a/blfs-pkgs/xorg-driver-video-i810-1.6.0.tar.bz2 b/blfs-pkgs/xorg-driver-video-i810-1.6.0.tar.bz2 new file mode 100644 index 0000000..362edf8 Binary files /dev/null and b/blfs-pkgs/xorg-driver-video-i810-1.6.0.tar.bz2 differ diff --git a/blfs-pkgs/xorg-driver-video-vesa-1.2.0.tar.bz2 b/blfs-pkgs/xorg-driver-video-vesa-1.2.0.tar.bz2 new file mode 100644 index 0000000..f02eca5 Binary files /dev/null and b/blfs-pkgs/xorg-driver-video-vesa-1.2.0.tar.bz2 differ diff --git a/blfs-pkgs/xorg-font-7.1.tar.bz2 b/blfs-pkgs/xorg-font-7.1.tar.bz2 new file mode 100644 index 0000000..718c8a7 Binary files /dev/null and b/blfs-pkgs/xorg-font-7.1.tar.bz2 differ diff --git a/blfs-pkgs/xorg-lib-7.1.tar.bz2 b/blfs-pkgs/xorg-lib-7.1.tar.bz2 new file mode 100644 index 0000000..9b8725f Binary files /dev/null and b/blfs-pkgs/xorg-lib-7.1.tar.bz2 differ diff --git a/blfs-pkgs/xorg-proto-7.1.tar.bz2 b/blfs-pkgs/xorg-proto-7.1.tar.bz2 new file mode 100644 index 0000000..c71c534 Binary files /dev/null and b/blfs-pkgs/xorg-proto-7.1.tar.bz2 differ diff --git a/blfs-pkgs/xorg-server-1.1.0.tar.bz2 b/blfs-pkgs/xorg-server-1.1.0.tar.bz2 new file mode 100644 index 0000000..bc9205c Binary files /dev/null and b/blfs-pkgs/xorg-server-1.1.0.tar.bz2 differ diff --git a/blfs-pkgs/xorg-util-7.1.tar.bz2 b/blfs-pkgs/xorg-util-7.1.tar.bz2 new file mode 100644 index 0000000..a863a60 Binary files /dev/null and b/blfs-pkgs/xorg-util-7.1.tar.bz2 differ diff --git a/blfs-pkgs/xpdf-3.01.tar.bz2 b/blfs-pkgs/xpdf-3.01.tar.bz2 new file mode 100644 index 0000000..ba3dda0 Binary files /dev/null and b/blfs-pkgs/xpdf-3.01.tar.bz2 differ diff --git a/blfs-pkgs/xterm-213.tar.bz2 b/blfs-pkgs/xterm-213.tar.bz2 new file mode 100644 index 0000000..cdcffaa Binary files /dev/null and b/blfs-pkgs/xterm-213.tar.bz2 differ diff --git a/blfs-sources/ImageMagick-6.2.8-0.tar.bz2 b/blfs-sources/ImageMagick-6.2.8-0.tar.bz2 new file mode 100644 index 0000000..f588d27 Binary files /dev/null and b/blfs-sources/ImageMagick-6.2.8-0.tar.bz2 differ diff --git a/blfs-sources/MPlayer-1.0pre7try2-gcc4-1.patch b/blfs-sources/MPlayer-1.0pre7try2-gcc4-1.patch new file mode 100644 index 0000000..d958349 --- /dev/null +++ b/blfs-sources/MPlayer-1.0pre7try2-gcc4-1.patch @@ -0,0 +1,199 @@ +Submitted By: Randy McMurchy +Date: 2005-09-06 +Initial Package Version: 1.0pre7 +Upstream Status: Unknown +Origin: Gentoo development + http://dev.gentoo.org/~halcy0n/mplayer-1.0_pre7-gcc4.patch +Description: Fixes GCC-4.0.x compilation problems + +$LastChangedBy: igor $ +$Date: 2005-10-23 16:40:25 -0500 (Sun, 23 Oct 2005) $ + + +diff -Naur MPlayer-1.0pre7-orig/configure MPlayer-1.0pre7/configure +--- MPlayer-1.0pre7-orig/configure 2005-04-13 11:46:35.000000000 +0000 ++++ MPlayer-1.0pre7/configure 2005-08-30 06:47:45.000000000 +0000 +@@ -605,7 +605,7 @@ + cc_version="v. ?.??, bad" + cc_verc_fail=yes + ;; +- 2.95.[2-9]|2.95.[2-9][-.]*|3.[0-9]|3.[0-9].[0-9]) ++ 2.95.[2-9]|2.95.[2-9][-.]*|3.[0-9]|3.[0-9].[0-9]|4.*) + _cc_major=`echo $cc_version | cut -d '.' -f 1` + _cc_minor=`echo $cc_version | cut -d '.' -f 2` + _cc_mini=`echo $cc_version | cut -d '.' -f 3` +diff -Naur MPlayer-1.0pre7-orig/liba52/imdct.c MPlayer-1.0pre7/liba52/imdct.c +--- MPlayer-1.0pre7-orig/liba52/imdct.c 2005-03-22 23:27:18.000000000 +0000 ++++ MPlayer-1.0pre7/liba52/imdct.c 2005-08-30 06:47:45.000000000 +0000 +@@ -937,7 +937,8 @@ + /* 4-7. iterations */ + for (m=3; m < 7; m++) { + two_m = (1 << m); +- two_m_plus_one = two_m<<1; ++ int two_m_plus_four=two_m<<4; ++ complex_t* buf_plus_128=buf+128; + asm volatile( + "movl %0, %%esi \n\t" + ".balign 16 \n\t" +@@ -963,7 +964,7 @@ + "addl %2, %%esi \n\t" + "cmpl %1, %%esi \n\t" + " jb 1b \n\t" +- :: "g" (buf), "m" (buf+128), "m" (two_m_plus_one<<3), "r" (two_m<<3), ++ :: "g" (buf), "m" (buf_plus_128), "m" (two_m_plus_four), "r" (two_m<<3), + "r" (sseW[m]) + : "%esi", "%edi", "%edx" + ); +diff -Naur MPlayer-1.0pre7-orig/libavcodec/libpostproc/postprocess_template.c MPlayer-1.0pre7/libavcodec/libpostproc/postprocess_template.c +--- MPlayer-1.0pre7-orig/libavcodec/libpostproc/postprocess_template.c 2005-04-16 20:41:13.000000000 +0000 ++++ MPlayer-1.0pre7/libavcodec/libpostproc/postprocess_template.c 2005-08-30 06:47:45.000000000 +0000 +@@ -2648,6 +2648,8 @@ + static always_inline void RENAME(do_a_deblock)(uint8_t *src, int step, int stride, PPContext *c){ + int64_t dc_mask, eq_mask; + int64_t sums[10*8*2]; ++ int64_t dc_and_eq_mask; ++ + src+= step*3; // src points to begin of the 8x8 Block + //START_TIMER + asm volatile( +@@ -2754,8 +2756,9 @@ + : "r" (src), "r" ((long)step), "m" (c->pQPb), "m"(c->ppMode.flatnessThreshold) + : "%"REG_a + ); ++ dc_and_eq_mask=dc_mask & eq_mask; + +- if(dc_mask & eq_mask){ ++ if(dc_and_eq_mask){ + long offset= -8*step; + int64_t *temp_sums= sums; + +@@ -2930,7 +2933,7 @@ + " js 1b \n\t" + + : "+r"(offset), "+r"(temp_sums) +- : "r" ((long)step), "r"(src - offset), "m"(dc_mask & eq_mask) ++ : "r" ((long)step), "r"(src - offset), "m"(dc_and_eq_mask) + ); + }else + src+= step; // src points to begin of the 8x8 Block +diff -Naur MPlayer-1.0pre7-orig/libmpdemux/frequencies.h MPlayer-1.0pre7/libmpdemux/frequencies.h +--- MPlayer-1.0pre7-orig/libmpdemux/frequencies.h 2001-11-16 22:06:48.000000000 +0000 ++++ MPlayer-1.0pre7/libmpdemux/frequencies.h 2005-08-30 06:47:45.000000000 +0000 +@@ -104,7 +104,7 @@ + /* --------------------------------------------------------------------- */ + + extern struct CHANLISTS chanlists[]; +-extern struct STRTAB chanlist_names[]; ++/* extern struct STRTAB chanlist_names[]; */ + + extern int chantab; + extern struct CHANLIST *chanlist; +diff -Naur MPlayer-1.0pre7-orig/libvo/aclib_template.c MPlayer-1.0pre7/libvo/aclib_template.c +--- MPlayer-1.0pre7-orig/libvo/aclib_template.c 2005-01-21 21:11:35.000000000 +0000 ++++ MPlayer-1.0pre7/libvo/aclib_template.c 2005-08-30 06:47:45.000000000 +0000 +@@ -249,8 +249,8 @@ + MOVNTQ" %%mm6, 48(%1)\n" + MOVNTQ" %%mm7, 56(%1)\n" + :: "r" (from), "r" (to) : "memory"); +- ((const unsigned char *)from)+=64; +- ((unsigned char *)to)+=64; ++ from+=64; ++ to+=64; + } + + // printf(" %d %d\n", (int)from&1023, (int)to&1023); +@@ -338,8 +338,8 @@ + MOVNTQ" %%mm6, 48(%1)\n" + MOVNTQ" %%mm7, 56(%1)\n" + :: "r" (from), "r" (to) : "memory"); +- ((const unsigned char *)from)+=64; +- ((unsigned char *)to)+=64; ++ from+=64; ++ to+=64; + } + + #endif /* Have SSE */ +diff -Naur MPlayer-1.0pre7-orig/mmx.h MPlayer-1.0pre7/mmx.h +--- MPlayer-1.0pre7-orig/mmx.h 2001-10-28 11:47:21.000000000 +0000 ++++ MPlayer-1.0pre7/mmx.h 2005-08-30 06:47:45.000000000 +0000 +@@ -353,11 +353,11 @@ + #define mmx_m2r(op, mem, reg) \ + __asm__ __volatile__ (#op " %0, %%" #reg \ + : /* nothing */ \ +- : "X" (mem)) ++ : "m" (mem)) + + #define mmx_r2m(op, reg, mem) \ + __asm__ __volatile__ (#op " %%" #reg ", %0" \ +- : "=X" (mem) \ ++ : "=m" (mem) \ + : /* nothing */ ) + + #define mmx_r2r(op, regs, regd) \ +@@ -367,8 +367,8 @@ + __asm__ __volatile__ ("movq %0, %%mm0\n\t" \ + #op " %1, %%mm0\n\t" \ + "movq %%mm0, %0" \ +- : "=X" (memd) \ +- : "X" (mems)) ++ : "=m" (memd) \ ++ : "m" (mems)) + + #endif + +diff -Naur MPlayer-1.0pre7-orig/postproc/swscale_template.c MPlayer-1.0pre7/postproc/swscale_template.c +--- MPlayer-1.0pre7-orig/postproc/swscale_template.c 2005-02-16 23:47:00.000000000 +0000 ++++ MPlayer-1.0pre7/postproc/swscale_template.c 2005-08-30 06:47:45.000000000 +0000 +@@ -2136,6 +2136,7 @@ + else + { + long counter= -2*dstW; ++ uint8_t* ptr=src+filterSize; + // filter-= counter*filterSize/2; + filterPos-= counter/2; + dst-= counter/2; +@@ -2177,7 +2178,7 @@ + " jnc 1b \n\t" + + : "+r" (counter), "+r" (filter) +- : "m" (filterPos), "m" (dst), "m"(src+filterSize), ++ : "m" (filterPos), "m" (dst), "m"(ptr), + "m" (src), "r" ((long)filterSize*2) + : "%"REG_b, "%"REG_a, "%"REG_c + ); +@@ -2320,6 +2321,8 @@ + { + #endif + //NO MMX just normal asm ... ++ int xInc_hi=xInc>>16; ++ int xInc_lo=xInc&0xffff; + asm volatile( + "xor %%"REG_a", %%"REG_a" \n\t" // i + "xor %%"REG_b", %%"REG_b" \n\t" // xx +@@ -2356,7 +2359,7 @@ + " jb 1b \n\t" + + +- :: "r" (src), "m" (dst), "m" (dstWidth), "m" (xInc>>16), "m" (xInc&0xFFFF) ++ :: "r" (src), "m" (dst), "m" (dstWidth), "m" (xInc_hi), "m" (xInc_lo) + : "%"REG_a, "%"REG_b, "%ecx", "%"REG_D, "%esi" + ); + #ifdef HAVE_MMX2 +@@ -2515,6 +2518,8 @@ + else + { + #endif ++ int xInc_hi=xInc>>16; ++ int xInc_lo=xInc&0xffff; + asm volatile( + "xor %%"REG_a", %%"REG_a" \n\t" // i + "xor %%"REG_b", %%"REG_b" \n\t" // xx +@@ -2548,7 +2553,7 @@ + "cmp %2, %%"REG_a" \n\t" + " jb 1b \n\t" + +- :: "m" (src1), "m" (dst), "m" ((long)dstWidth), "m" ((long)(xInc>>16)), "m" ((xInc&0xFFFF)), ++ :: "m" (src1), "m" (dst), "m" ((long)dstWidth), "m" ((long)(xInc_hi)), "m" ((xInc_lo)), + "r" (src2) + : "%"REG_a, "%"REG_b, "%ecx", "%"REG_D, "%esi" + ); diff --git a/blfs-sources/MPlayer-1.0pre7try2-jack_fixes-1.patch b/blfs-sources/MPlayer-1.0pre7try2-jack_fixes-1.patch new file mode 100644 index 0000000..c60b1a6 --- /dev/null +++ b/blfs-sources/MPlayer-1.0pre7try2-jack_fixes-1.patch @@ -0,0 +1,571 @@ +Submitted By: Randy McMurchy +Date: 2006-01-10 +Initial Package Version: 1.0pre7try2 +Upstream Status: From upstream +Origin: Upstream CVS +Description: Fixes Jack build issues (notes say that bioJack is + no longer required, but this is not confirmed) + + +diff -Naur MPlayer-1.0pre7try2-orig/libao2/ao_jack.c MPlayer-1.0pre7try2/libao2/ao_jack.c +--- MPlayer-1.0pre7try2-orig/libao2/ao_jack.c 2005-03-25 15:11:13.000000000 +0000 ++++ MPlayer-1.0pre7try2/libao2/ao_jack.c 2006-01-11 04:52:30.000000000 +0000 +@@ -1,258 +1,345 @@ +-/* +- * ao_jack - JACK audio output driver for MPlayer ++/* ++ * ao_jack.c - libao2 JACK Audio Output Driver for MPlayer + * +- * Kamil Strzelecki < esack at browarek.net > +- * +- * This driver is distribuited under terms of GPL +- * +- * It uses bio2jack (http://bio2jack.sf.net/). ++ * This driver is under the same license as MPlayer. ++ * (http://www.mplayerhq.hu) + * ++ * Copyleft 2001 by Felix Bünemann (atmosfear@users.sf.net) ++ * and Reimar Döffinger (Reimar.Doeffinger@stud.uni-karlsruhe.de) + */ + + #include +-#include ++#include ++#include + + #include "config.h" ++#include "mp_msg.h" ++#include "help_mp.h" ++ + #include "audio_out.h" + #include "audio_out_internal.h" + #include "libaf/af_format.h" +-#include "mp_msg.h" ++#include "osdep/timer.h" ++#include "subopt-helper.h" + +-//#include "bio2jack.h" +- +-static int driver = 0; +-long latency = 0; +-long approx_bytes_in_jackd = 0; +- +-//bio2jack stuff: +-#define ERR_SUCCESS 0 +-#define ERR_OPENING_JACK 1 +-#define ERR_RATE_MISMATCH 2 +-#define ERR_BYTES_PER_FRAME_INVALID 3 +-enum status_enum { PLAYING, PAUSED, STOPPED, CLOSED, RESET }; +-void JACK_Init(void); +-int JACK_Open(int* deviceID, unsigned int bits_per_sample, unsigned long *rate, int channels); +-int JACK_Close(int deviceID); /* return 0 for success */ +-void JACK_Reset(int deviceID); /* free all buffered data and reset several values in the device */ +-long JACK_Write(int deviceID, char *data, unsigned long bytes); /* returns the number of bytes written */ +-long JACK_GetJackLatency(int deviceID); /* return the latency in milliseconds of jack */ +-int JACK_SetState(int deviceID, enum status_enum state); /* playing, paused, stopped */ +-int JACK_SetAllVolume(int deviceID, unsigned int volume); +-int JACK_SetVolumeForChannel(int deviceID, unsigned int channel, unsigned int volume); +-void JACK_GetVolumeForChannel(int deviceID, unsigned int channel, unsigned int *volume); +-// ++#include "libvo/fastmemcpy.h" + ++#include + +-static ao_info_t info = ++static ao_info_t info = + { +- "JACK audio output", +- "jack", +- "Kamil Strzelecki ", +- "" ++ "JACK audio output", ++ "jack", ++ "Reimar Döffinger ", ++ "based on ao_sdl.c" + }; + +- + LIBAO_EXTERN(jack) + +- +-static int control(int cmd, void *arg) +-{ +- switch(cmd) { +- case AOCONTROL_GET_VOLUME: +- { +- ao_control_vol_t *vol = (ao_control_vol_t *)arg; +- unsigned int l, r; +- +- JACK_GetVolumeForChannel(driver, 0, &l); +- JACK_GetVolumeForChannel(driver, 1, &r); +- vol->left = (float )l; +- vol->right = (float )r; +- +- return CONTROL_OK; +- } +- case AOCONTROL_SET_VOLUME: +- { +- ao_control_vol_t *vol = (ao_control_vol_t *)arg; +- unsigned int l = (int )vol->left, +- r = (int )vol->right, +- avg_vol = (l + r) / 2, +- err = 0; +- +- switch (ao_data.channels) { +- case 6: +- if((err = JACK_SetVolumeForChannel(driver, 5, avg_vol))) { +- mp_msg(MSGT_AO, MSGL_ERR, +- "AO: [Jack] Setting lfe volume failed, error %d\n",err); +- return CONTROL_ERROR; +- } +- case 5: +- if((err = JACK_SetVolumeForChannel(driver, 4, avg_vol))) { +- mp_msg(MSGT_AO, MSGL_ERR, +- "AO: [Jack] Setting center volume failed, error %d\n",err); +- return CONTROL_ERROR; +- } +- case 4: +- if((err = JACK_SetVolumeForChannel(driver, 3, r))) { +- mp_msg(MSGT_AO, MSGL_ERR, +- "AO: [Jack] Setting rear right volume failed, error %d\n",err); +- return CONTROL_ERROR; +- } +- case 3: +- if((err = JACK_SetVolumeForChannel(driver, 2, l))) { +- mp_msg(MSGT_AO, MSGL_ERR, +- "AO: [Jack] Setting rear left volume failed, error %d\n",err); +- return CONTROL_ERROR; +- } +- case 2: +- if((err = JACK_SetVolumeForChannel(driver, 1, r))) { +- mp_msg(MSGT_AO, MSGL_ERR, +- "AO: [Jack] Setting right volume failed, error %d\n",err); +- return CONTROL_ERROR; +- } +- case 1: +- if((err = JACK_SetVolumeForChannel(driver, 0, l))) { +- mp_msg(MSGT_AO, MSGL_ERR, +- "AO: [Jack] Setting left volume failed, error %d\n",err); +- return CONTROL_ERROR; +- } +- } +- +- return CONTROL_OK; +- } +- } +- +- return(CONTROL_UNKNOWN); ++//! maximum number of channels supported, avoids lots of mallocs ++#define MAX_CHANS 6 ++static jack_port_t *ports[MAX_CHANS]; ++static int num_ports; ///< Number of used ports == number of channels ++static jack_client_t *client; ++static volatile int paused = 0; ///< set if paused ++static volatile int underrun = 0; ///< signals if an underrun occured ++ ++//! If this is defined try to make a more precise delay estimation. Will be slower. ++#undef JACK_ESTIMATE_DELAY ++#ifdef JACK_ESTIMATE_DELAY ++static volatile int callback_samples = 0; ++static volatile unsigned int callback_time = 0; ++#endif ++ ++//! size of one chunk, if this is too small MPlayer will start to "stutter" ++//! after a short time of playback ++#define CHUNK_SIZE (16 * 1024) ++//! number of "virtual" chunks the buffer consists of ++#define NUM_CHUNKS 8 ++// This type of ring buffer may never fill up completely, at least ++// one byte must always be unused. ++// For performance reasons (alignment etc.) one whole chunk always stays ++// empty, not only one byte. ++#define BUFFSIZE ((NUM_CHUNKS + 1) * CHUNK_SIZE) ++ ++//! buffer for audio data ++static unsigned char *buffer = NULL; ++ ++//! buffer read position, may only be modified by playback thread or while it is stopped ++static volatile int read_pos; ++//! buffer write position, may only be modified by MPlayer's thread ++static volatile int write_pos; ++ ++/** ++ * \brief get the number of free bytes in the buffer ++ * \return number of free bytes in buffer ++ * ++ * may only be called by MPlayer's thread ++ * return value may change between immediately following two calls, ++ * and the real number of free bytes might be larger! ++ */ ++static int buf_free() { ++ int free = read_pos - write_pos - CHUNK_SIZE; ++ if (free < 0) free += BUFFSIZE; ++ return free; + } + ++/** ++ * \brief get amount of data available in the buffer ++ * \return number of bytes available in buffer ++ * ++ * may only be called by the playback thread ++ * return value may change between immediately following two calls, ++ * and the real number of buffered bytes might be larger! ++ */ ++static int buf_used() { ++ int used = write_pos - read_pos; ++ if (used < 0) used += BUFFSIZE; ++ return used; ++} + +-static int init(int rate_hz, int channels, int format, int flags) +-{ +- int err, m, frag_spec; +- unsigned long rate; +- unsigned int bits_per_sample; +- +- unsigned long jack_port_flags=JackPortIsPhysical; +- unsigned int jack_port_name_count=0; +- const char *jack_port_name=NULL; +- +- mp_msg(MSGT_AO, MSGL_INFO, "AO: [Jack] Initialising library.\n"); +- JACK_Init(); +- +- if (ao_subdevice) { +- jack_port_flags = 0; +- jack_port_name_count = 1; +- jack_port_name = ao_subdevice; +- mp_msg(MSGT_AO, MSGL_INFO, "AO: [Jack] Trying to use jack device:%s.\n", ao_subdevice); +- } +- +- switch (format) { +- case AF_FORMAT_U8: +- case AF_FORMAT_S8: +- format = AF_FORMAT_U8; +- bits_per_sample = 8; +- m = 1; +- break; +- default: +- format = AF_FORMAT_S16_NE; +- bits_per_sample = 16; +- m = 2; +- break; +- } +- +- rate = rate_hz; +- +- err = JACK_OpenEx(&driver, bits_per_sample, &rate, channels, channels, +- &jack_port_name, jack_port_name_count, jack_port_flags); +- +- /* if sample rates doesn't match try to open device with jack's rate and +- * let mplayer convert it (rate now contains that which jackd use) */ +- if(err == ERR_RATE_MISMATCH) { +- mp_msg(MSGT_AO, MSGL_INFO, +- "AO: [Jack] Sample rate mismatch, trying to resample.\n"); +- +- err = JACK_OpenEx(&driver, bits_per_sample, &rate, channels, channels, +- &jack_port_name, jack_port_name_count, jack_port_flags); +- } +- +- /* any other error */ +- if(err != ERR_SUCCESS) { +- mp_msg(MSGT_AO, MSGL_ERR, +- "AO: [Jack] JACK_Open() failed, error %d\n", err); +- return 0; +- } +- +- err = JACK_SetAllVolume(driver, 100); +- if(err != ERR_SUCCESS) { +- // This is not fatal, but would be peculiar... +- mp_msg(MSGT_AO, MSGL_ERR, +- "AO: [Jack] JACK_SetAllVolume() failed, error %d\n", err); +- } +- +- latency = JACK_GetJackLatency(driver); +- +- ao_data.format = format; +- ao_data.channels = channels; +- ao_data.samplerate = rate; +- ao_data.bps = ( rate * channels * m ); +- +- // Rather rough way to find out the rough number of bytes buffered +- approx_bytes_in_jackd = JACK_GetJackBufferedBytes(driver) * 2; +- +- mp_msg(MSGT_AO, MSGL_INFO, +- "AO: [Jack] OK. I'm ready to go (%d Hz/%d channels/%d bit)\n", +- ao_data.samplerate, ao_data.channels, bits_per_sample); ++/** ++ * \brief insert len bytes into buffer ++ * \param data data to insert ++ * \param len length of data ++ * \return number of bytes inserted into buffer ++ * ++ * If there is not enough room, the buffer is filled up ++ */ ++static int write_buffer(unsigned char* data, int len) { ++ int first_len = BUFFSIZE - write_pos; ++ int free = buf_free(); ++ if (len > free) len = free; ++ if (first_len > len) first_len = len; ++ // till end of buffer ++ memcpy (&buffer[write_pos], data, first_len); ++ if (len > first_len) { // we have to wrap around ++ // remaining part from beginning of buffer ++ memcpy (buffer, &data[first_len], len - first_len); ++ } ++ write_pos = (write_pos + len) % BUFFSIZE; ++ return len; ++} + +- return 1; ++/** ++ * \brief read data from buffer and splitting it into channels ++ * \param bufs num_bufs float buffers, each will contain the data of one channel ++ * \param cnt number of samples to read per channel ++ * \param num_bufs number of channels to split the data into ++ * \return number of samples read per channel, equals cnt unless there was too ++ * little data in the buffer ++ * ++ * Assumes the data in the buffer is of type float, the number of bytes ++ * read is res * num_bufs * sizeof(float), where res is the return value. ++ */ ++static int read_buffer(float **bufs, int cnt, int num_bufs) { ++ int first_len = BUFFSIZE - read_pos; ++ int buffered = buf_used(); ++ int i, j; ++ if (cnt * sizeof(float) * num_bufs > buffered) ++ cnt = buffered / sizeof(float) / num_bufs; ++ for (i = 0; i < cnt; i++) { ++ for (j = 0; j < num_bufs; j++) { ++ bufs[j][i] = *((float *)(&buffer[read_pos])); ++ read_pos = (read_pos + sizeof(float)) % BUFFSIZE; ++ } ++ } ++ return cnt; + } + ++// end ring buffer stuff + +-static void uninit(int immed) +-{ +- int errval = 0; +- +- if((errval = JACK_Close(driver))) +- mp_msg(MSGT_AO, MSGL_ERR, +- "AO: [Jack] error closing device, error %d\n", errval); ++static int control(int cmd, void *arg) { ++ return CONTROL_UNKNOWN; + } + +- +-static int play(void* data,int len,int flags) +-{ +- return JACK_Write(driver, data, len); ++/** ++ * \brief fill the buffers with silence ++ * \param bufs num_bufs float buffers, each will contain the data of one channel ++ * \param cnt number of samples in each buffer ++ * \param num_bufs number of buffers ++ */ ++static void silence(float **bufs, int cnt, int num_bufs) { ++ int i, j; ++ for (i = 0; i < cnt; i++) ++ for (j = 0; j < num_bufs; j++) ++ bufs[j][i] = 0; + } + ++/** ++ * \brief JACK Callback function ++ * \param nframes number of frames to fill into buffers ++ * \param arg unused ++ * \return currently always 0 ++ * ++ * Write silence into buffers if paused or an underrun occured ++ */ ++static int outputaudio(jack_nframes_t nframes, void *arg) { ++ float *bufs[MAX_CHANS]; ++ int i; ++ for (i = 0; i < num_ports; i++) ++ bufs[i] = jack_port_get_buffer(ports[i], nframes); ++ if (!paused && !underrun) ++ if (read_buffer(bufs, nframes, num_ports) < nframes) ++ underrun = 1; ++ if (paused || underrun) ++ silence(bufs, nframes, num_ports); ++#ifdef JACK_ESTIMATE_DELAY ++ callback_samples = nframes; ++ callback_time = GetTimer(); ++#endif ++ return 0; ++} + +-static void audio_pause() ++/** ++ * \brief print suboption usage help ++ */ ++static void print_help () + { +- JACK_SetState(driver, PAUSED); ++ mp_msg (MSGT_AO, MSGL_FATAL, ++ "\n-ao jack commandline help:\n" ++ "Example: mplayer -ao jack:port=myout\n" ++ " connects MPlayer to the jack ports named myout\n" ++ "\nOptions:\n" ++ " port=\n" ++ " Connects to the given ports instead of the default physical ones\n"); + } + ++static int init(int rate, int channels, int format, int flags) { ++ const char **matching_ports = NULL; ++ char *port_name = NULL; ++ opt_t subopts[] = { ++ {"port", OPT_ARG_MSTRZ, &port_name, NULL}, ++ {NULL} ++ }; ++ int port_flags = JackPortIsInput; ++ int i; ++ if (subopt_parse(ao_subdevice, subopts) != 0) { ++ print_help(); ++ return 0; ++ } ++ if (channels > MAX_CHANS) { ++ mp_msg(MSGT_AO, MSGL_FATAL, "[JACK] Invalid number of channels: %i\n", channels); ++ goto err_out; ++ } ++ client = jack_client_new("MPlayer"); ++ if (!client) { ++ mp_msg(MSGT_AO, MSGL_FATAL, "[JACK] cannot open server\n"); ++ goto err_out; ++ } ++ jack_set_process_callback(client, outputaudio, 0); ++ ++ // list matching ports ++ if (!port_name) ++ port_flags |= JackPortIsPhysical; ++ matching_ports = jack_get_ports(client, port_name, NULL, port_flags); ++ for (num_ports = 0; matching_ports && matching_ports[num_ports]; num_ports++) ; ++ if (!num_ports) { ++ mp_msg(MSGT_AO, MSGL_FATAL, "[JACK] no physical ports available\n"); ++ goto err_out; ++ } ++ if (channels > num_ports) channels = num_ports; ++ num_ports = channels; ++ ++ // create out output ports ++ for (i = 0; i < num_ports; i++) { ++ char pname[30]; ++ snprintf(pname, 30, "out_%d", i); ++ ports[i] = jack_port_register(client, pname, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0); ++ if (!ports[i]) { ++ mp_msg(MSGT_AO, MSGL_FATAL, "[JACK] not enough ports available\n"); ++ goto err_out; ++ } ++ } ++ if (jack_activate(client)) { ++ mp_msg(MSGT_AO, MSGL_FATAL, "[JACK] activate failed\n"); ++ goto err_out; ++ } ++ for (i = 0; i < num_ports; i++) { ++ if (jack_connect(client, jack_port_name(ports[i]), matching_ports[i])) { ++ mp_msg(MSGT_AO, MSGL_FATAL, "[JACK] connecting failed\n"); ++ goto err_out; ++ } ++ } ++ buffer = (unsigned char *) malloc(BUFFSIZE); ++ ++ ao_data.channels = channels; ++ ao_data.samplerate = rate = jack_get_sample_rate(client); ++ ao_data.format = AF_FORMAT_FLOAT_NE; ++ ao_data.bps = channels * rate * sizeof(float); ++ ao_data.buffersize = jack_port_get_total_latency(client, ports[0]) * channels; ++ ao_data.outburst = CHUNK_SIZE; ++ free(matching_ports); ++ free(port_name); ++ return 1; ++ ++err_out: ++ free(matching_ports); ++ free(port_name); ++ if (client) ++ jack_client_close(client); ++ free(buffer); ++ buffer = NULL; ++ return 0; ++} + +-static void audio_resume() +-{ +- JACK_SetState(driver, PLAYING); ++// close audio device ++static void uninit(int immed) { ++ if (!immed) ++ usec_sleep(get_delay() * 1000 * 1000); ++ // HACK, make sure jack doesn't loop-output dirty buffers ++ paused = 1; ++ usec_sleep(100 * 1000); ++ jack_client_close(client); ++ free(buffer); ++ buffer = NULL; + } + ++/** ++ * \brief stop playing and empty buffers (for seeking/pause) ++ */ ++static void reset() { ++ paused = 1; ++ read_pos = 0; ++ write_pos = 0; ++ paused = 0; ++} + +-static void reset() +-{ +- JACK_Reset(driver); +- latency = JACK_GetJackLatency(driver); +- // Rather rough way to find out the rough number of bytes buffered +- approx_bytes_in_jackd = JACK_GetJackBufferedBytes(driver) * 2; ++/** ++ * \brief stop playing, keep buffers (for pause) ++ */ ++static void audio_pause() { ++ paused = 1; + } + ++/** ++ * \brief resume playing, after audio_pause() ++ */ ++static void audio_resume() { ++ paused = 0; ++} + +-static int get_space() +-{ +- return JACK_GetBytesFreeSpace(driver); ++static int get_space() { ++ return buf_free(); + } + ++/** ++ * \brief write data into buffer and reset underrun flag ++ */ ++static int play(void *data, int len, int flags) { ++ len -= len % ao_data.outburst; ++ underrun = 0; ++ return write_buffer(data, len); ++} + +-static float get_delay() +-{ +- float ret = 0; +- ret = (JACK_GetBytesStored(driver) + approx_bytes_in_jackd + latency) / (float)ao_data.bps; +- return ret; ++static float get_delay() { ++ int buffered = BUFFSIZE - CHUNK_SIZE - buf_free(); // could be less ++ float in_jack = (float)ao_data.buffersize / (float)ao_data.bps; ++#ifdef JACK_ESTIMATE_DELAY ++ unsigned int elapsed = GetTimer() - callback_time; ++ in_jack += (float)callback_samples / (float)ao_data.samplerate - (float)elapsed / 1000.0 / 1000.0; ++ if (in_jack < 0) in_jack = 0; ++#endif ++ return (float)buffered / (float)ao_data.bps + in_jack; + } + diff --git a/blfs-sources/MPlayer-1.0pre7try2-kernel_2.6-1.patch b/blfs-sources/MPlayer-1.0pre7try2-kernel_2.6-1.patch new file mode 100644 index 0000000..029522c --- /dev/null +++ b/blfs-sources/MPlayer-1.0pre7try2-kernel_2.6-1.patch @@ -0,0 +1,23 @@ +Submitted By: Jim Gifford (jim at linuxfromscratch dot org) +Date: 2004-04-29 +Initial Package Version: 1.0pre4 +Origin: Jim Gifford +Upstream Status: Sent +Description: Fixes Compile Issues with the 2.6 Kernel + +$LastChangedBy: igor $ +$Date: 2005-10-23 16:40:25 -0500 (Sun, 23 Oct 2005) $ + +diff -Naur MPlayer-1.0pre4.orig/osdep/kerneltwosix.h MPlayer-1.0pre4/osdep/kerneltwosix.h +--- MPlayer-1.0pre4.orig/osdep/kerneltwosix.h 2004-01-10 09:48:15.000000000 +0000 ++++ MPlayer-1.0pre4/osdep/kerneltwosix.h 2004-04-30 02:10:54.429252761 +0000 +@@ -1,9 +1,3 @@ + #include +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,70) +-#define __KERNEL__ +-#include +-#include +-#undef __KERNEL__ +-#endif + + diff --git a/blfs-sources/MPlayer-1.0pre7try2-round_function_fix-1.patch b/blfs-sources/MPlayer-1.0pre7try2-round_function_fix-1.patch new file mode 100644 index 0000000..7527bd9 --- /dev/null +++ b/blfs-sources/MPlayer-1.0pre7try2-round_function_fix-1.patch @@ -0,0 +1,65 @@ +Submitted By: Randy McMurchy +Date: 2006-05-24 +Initial Package Version: 1.0pre7try2 +Upstream Status: In upstream CVS +Origin: Upstream CVS +Description: Fixes a build issue because the round function is not defined + +$Id: MPlayer-1.0pre7try2-round_function_fix-1.patch 1541 2006-05-24 16:11:58Z randy $ + + +--- MPlayer-1.0pre7try2-orig/configure 2006-05-24 10:51:27.000000000 -0500 ++++ MPlayer-1.0pre7try2/configure 2006-05-24 09:56:33.000000000 -0500 +@@ -2393,6 +2393,19 @@ + fi + echores "$_lrintf" + ++echocheck "round" ++cat > $TMPC << EOF ++#include ++int main(void) { (void) round(0.0); return 0; } ++EOF ++_round=no ++cc_check $_ld_lm && _round=yes ++if test "$_round" = yes ; then ++ _def_round="#define HAVE_ROUND 1" ++else ++ _def_round="#undef HAVE_ROUND" ++fi ++echores "$_round" + + echocheck "nanosleep" + # also check for nanosleep +@@ -7310,6 +7323,9 @@ + /* C99 lrintf function available */ + $_def_lrintf + ++/* round function is available */ ++$_def_round ++ + /* yes, we have inttypes.h */ + #define HAVE_INTTYPES_H 1 + +--- MPlayer-1.0pre7try2-orig/libvo/gtf.c 2002-08-22 18:03:50.000000000 -0500 ++++ MPlayer-1.0pre7try2/libvo/gtf.c 2006-05-24 09:46:42.000000000 -0500 +@@ -9,6 +9,7 @@ + */ + + //Version 0.4 ++#include "config.h" + #include + #include + #include +@@ -24,10 +25,12 @@ + + static GTF_constants GTF_given_constants = { 3.0,550.0,1,8,1.8,8,40,20,128,600 }; + ++#ifndef HAVE_ROUND + static double round(double v) + { + return floor(v + 0.5); + } ++#endif + + static void GetRoundedConstants(GTF_constants *c) + { diff --git a/blfs-sources/MPlayer-1.0pre7try2-x264_fixes-1.patch b/blfs-sources/MPlayer-1.0pre7try2-x264_fixes-1.patch new file mode 100644 index 0000000..8ecfc7f --- /dev/null +++ b/blfs-sources/MPlayer-1.0pre7try2-x264_fixes-1.patch @@ -0,0 +1,112 @@ +Submitted By: Randy McMurchy +Date: 2006-01-10 +Initial Package Version: 1.0pre7try2 +Upstream Status: From upstream CVS +Origin: Upstream CVS +Description: Fixes x264 codec build issues + + +diff -Naur MPlayer-1.0pre7try2-orig/configure MPlayer-1.0pre7try2/configure +--- MPlayer-1.0pre7try2-orig/configure 2005-04-13 11:46:35.000000000 +0000 ++++ MPlayer-1.0pre7try2/configure 2006-01-10 20:26:01.000000000 +0000 +@@ -5940,7 +5940,7 @@ + #endif + int main(void) { x264_encoder_open((void*)0); return 0; } + EOF +-_ld_x264="$_ld_x264 -lx264 $_ld_lm" ++_ld_x264="$_ld_x264 -lx264 -lpthread $_ld_lm" + if test "$_x264" != no && cc_check $_inc_x264 $_ld_x264 ; then + _x264=yes + _def_x264='#define HAVE_X264 1' + +diff -Naur MPlayer-1.0pre7try2-orig/libmpcodecs/ve_x264.c MPlayer-1.0pre7try2/libmpcodecs/ve_x264.c +--- MPlayer-1.0pre7try2-orig/libmpcodecs/ve_x264.c 2005-04-13 19:10:29.000000000 +0000 ++++ MPlayer-1.0pre7try2/libmpcodecs/ve_x264.c 2006-01-10 20:26:01.000000000 +0000 +@@ -62,7 +62,7 @@ + static int qp_constant = 26; + static int frame_ref = 1; + static int keyint_max = 250; +-static int keyint_min = -1; ++static int keyint_min = 25; + static int scenecut_threshold = 40; + static int bframe = 0; + static int bframe_adaptive = 1; +@@ -81,12 +81,14 @@ + static int chroma_qp_offset = 0; + static float ip_factor = 1.4; + static float pb_factor = 1.3; +-static int rc_buffer_size = -1; +-static float rc_init_buffer = 0.25; +-static int rc_sens = 4; ++static float ratetol = 1.0; ++static int vbv_maxrate = 0; ++static int vbv_bufsize = 0; ++static float vbv_init = 0.9; ++ + static int qp_min = 10; + static int qp_max = 51; +-static int qp_step = 1; ++static int qp_step = 2; + static int pass = 0; + static float qcomp = 0.6; + static float qblur = 0.5; +@@ -130,9 +132,10 @@ + {"chroma_qp_offset", &chroma_qp_offset, CONF_TYPE_INT, CONF_RANGE, -12, 12, NULL}, + {"ip_factor", &ip_factor, CONF_TYPE_FLOAT, CONF_RANGE, -10.0, 10.0, NULL}, + {"pb_factor", &pb_factor, CONF_TYPE_FLOAT, CONF_RANGE, -10.0, 10.0, NULL}, +- {"rc_buffer_size", &rc_buffer_size, CONF_TYPE_INT, CONF_RANGE, 0, 24000000, NULL}, +- {"rc_init_buffer", &rc_init_buffer, CONF_TYPE_FLOAT, CONF_RANGE, 0, 24000000, NULL}, +- {"rc_sens", &rc_sens, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL}, ++ {"ratetol", &ratetol, CONF_TYPE_FLOAT, CONF_RANGE, 0.1, 100.0, NULL}, ++ {"vbv_maxrate", &vbv_maxrate, CONF_TYPE_INT, CONF_RANGE, 0, 24000000, NULL}, ++ {"vbv_bufsize", &vbv_bufsize, CONF_TYPE_INT, CONF_RANGE, 0, 24000000, NULL}, ++ {"vbv_init", &vbv_init, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 1.0, NULL}, + {"qp_min", &qp_min, CONF_TYPE_INT, CONF_RANGE, 1, 51, NULL}, + {"qp_max", &qp_max, CONF_TYPE_INT, CONF_RANGE, 1, 51, NULL}, + {"qp_step", &qp_step, CONF_TYPE_INT, CONF_RANGE, 1, 50, NULL}, +@@ -161,7 +164,7 @@ + x264_param_default(&mod->param); + mod->param.i_frame_reference = frame_ref; + mod->param.i_keyint_max = keyint_max; +- mod->param.i_keyint_min = keyint_min > 0 ? keyint_min : keyint_max * 2 / 5; ++ mod->param.i_keyint_min = keyint_min; + mod->param.i_scenecut_threshold = scenecut_threshold; + mod->param.i_bframe = bframe; + mod->param.b_bframe_adaptive = bframe_adaptive; +@@ -185,6 +188,7 @@ + mod->param.rc.f_qblur = qblur; + mod->param.rc.f_complexity_blur = complexity_blur; + mod->param.analyse.i_subpel_refine = subq; ++ mod->param.analyse.i_me_method = subq==1 ? X264_ME_DIA : X264_ME_HEX; + mod->param.rc.psz_stat_out = passtmpfile; + mod->param.rc.psz_stat_in = passtmpfile; + if((pass & 2) && bitrate <= 0) +@@ -212,16 +216,17 @@ + break; + } + if(bitrate > 0) { +- if(rc_buffer_size <= 0) +- rc_buffer_size = bitrate; +- mod->param.rc.b_cbr = 1; +- mod->param.rc.i_bitrate = bitrate; +- mod->param.rc.i_rc_buffer_size = rc_buffer_size; +- if(rc_init_buffer > 1) +- mod->param.rc.i_rc_init_buffer = rc_init_buffer; +- else +- mod->param.rc.i_rc_init_buffer = rc_buffer_size * rc_init_buffer; +- mod->param.rc.i_rc_sens = rc_sens; ++ if((vbv_maxrate > 0) != (vbv_bufsize > 0)) { ++ mp_msg(MSGT_MENCODER, MSGL_ERR, ++ "VBV requires both vbv_maxrate and vbv_bufsize.\n"); ++ return 0; ++ } ++ mod->param.rc.b_cbr = 1; ++ mod->param.rc.i_bitrate = bitrate; ++ mod->param.rc.f_rate_tolerance = ratetol; ++ mod->param.rc.i_vbv_max_bitrate = vbv_maxrate; ++ mod->param.rc.i_vbv_buffer_size = vbv_bufsize; ++ mod->param.rc.f_vbv_buffer_init = vbv_init; + } + mod->param.rc.f_ip_factor = ip_factor; + mod->param.rc.f_pb_factor = pb_factor; + diff --git a/blfs-sources/MPlayer-1.0pre7try2.tar.bz2 b/blfs-sources/MPlayer-1.0pre7try2.tar.bz2 new file mode 100644 index 0000000..d55fee5 Binary files /dev/null and b/blfs-sources/MPlayer-1.0pre7try2.tar.bz2 differ diff --git a/blfs-sources/SDL-1.2.11.tar.gz b/blfs-sources/SDL-1.2.11.tar.gz new file mode 100644 index 0000000..d7a3b69 Binary files /dev/null and b/blfs-sources/SDL-1.2.11.tar.gz differ diff --git a/blfs-sources/atk-1.11.4.tar.bz2 b/blfs-sources/atk-1.11.4.tar.bz2 new file mode 100644 index 0000000..a201513 Binary files /dev/null and b/blfs-sources/atk-1.11.4.tar.bz2 differ diff --git a/blfs-sources/audacious-1.0.0.tgz b/blfs-sources/audacious-1.0.0.tgz new file mode 100644 index 0000000..80c5cfe Binary files /dev/null and b/blfs-sources/audacious-1.0.0.tgz differ diff --git a/blfs-sources/cairo-1.0.4.tar.gz b/blfs-sources/cairo-1.0.4.tar.gz new file mode 100644 index 0000000..1bd45da Binary files /dev/null and b/blfs-sources/cairo-1.0.4.tar.gz differ diff --git a/blfs-sources/curl-7.15.3.tar.bz2 b/blfs-sources/curl-7.15.3.tar.bz2 new file mode 100644 index 0000000..6dcbc92 Binary files /dev/null and b/blfs-sources/curl-7.15.3.tar.bz2 differ diff --git a/blfs-sources/drm-20061011.tar.bz2 b/blfs-sources/drm-20061011.tar.bz2 new file mode 100644 index 0000000..689d75c Binary files /dev/null and b/blfs-sources/drm-20061011.tar.bz2 differ diff --git a/blfs-sources/drm-git20061015.tar.bz2 b/blfs-sources/drm-git20061015.tar.bz2 new file mode 100644 index 0000000..acf8133 Binary files /dev/null and b/blfs-sources/drm-git20061015.tar.bz2 differ diff --git a/blfs-sources/firefox-1.5.0.3-source.tar.bz2 b/blfs-sources/firefox-1.5.0.3-source.tar.bz2 new file mode 100644 index 0000000..faade92 Binary files /dev/null and b/blfs-sources/firefox-1.5.0.3-source.tar.bz2 differ diff --git a/blfs-sources/fontconfig-2.3.2.tar.gz b/blfs-sources/fontconfig-2.3.2.tar.gz new file mode 100644 index 0000000..f760720 Binary files /dev/null and b/blfs-sources/fontconfig-2.3.2.tar.gz differ diff --git a/blfs-sources/freetype-2.1.10.tar.bz2 b/blfs-sources/freetype-2.1.10.tar.bz2 new file mode 100644 index 0000000..10839f8 Binary files /dev/null and b/blfs-sources/freetype-2.1.10.tar.bz2 differ diff --git a/blfs-sources/gamin-0.1.7.tar.gz b/blfs-sources/gamin-0.1.7.tar.gz new file mode 100644 index 0000000..f35687b Binary files /dev/null and b/blfs-sources/gamin-0.1.7.tar.gz differ diff --git a/blfs-sources/gftp-2.0.18.tar.bz2 b/blfs-sources/gftp-2.0.18.tar.bz2 new file mode 100644 index 0000000..d0b1ee3 Binary files /dev/null and b/blfs-sources/gftp-2.0.18.tar.bz2 differ diff --git a/blfs-sources/giflib-4.1.4.tar.bz2 b/blfs-sources/giflib-4.1.4.tar.bz2 new file mode 100644 index 0000000..b83ecc6 Binary files /dev/null and b/blfs-sources/giflib-4.1.4.tar.bz2 differ diff --git a/blfs-sources/gimp-2.2.11.tar.bz2 b/blfs-sources/gimp-2.2.11.tar.bz2 new file mode 100644 index 0000000..eb2095a Binary files /dev/null and b/blfs-sources/gimp-2.2.11.tar.bz2 differ diff --git a/blfs-sources/glib-2.10.3.tar.bz2 b/blfs-sources/glib-2.10.3.tar.bz2 new file mode 100644 index 0000000..a268d7e Binary files /dev/null and b/blfs-sources/glib-2.10.3.tar.bz2 differ diff --git a/blfs-sources/gqmpeg-0.91.1.tar.gz b/blfs-sources/gqmpeg-0.91.1.tar.gz new file mode 100644 index 0000000..d8e850f Binary files /dev/null and b/blfs-sources/gqmpeg-0.91.1.tar.gz differ diff --git a/blfs-sources/gtk+-2.8.18.tar.bz2 b/blfs-sources/gtk+-2.8.18.tar.bz2 new file mode 100644 index 0000000..7609825 Binary files /dev/null and b/blfs-sources/gtk+-2.8.18.tar.bz2 differ diff --git a/blfs-sources/icewm-1.2.26.tar.gz b/blfs-sources/icewm-1.2.26.tar.gz new file mode 100644 index 0000000..ea22a66 Binary files /dev/null and b/blfs-sources/icewm-1.2.26.tar.gz differ diff --git a/blfs-sources/ieee80211-1.1.13.tgz b/blfs-sources/ieee80211-1.1.13.tgz new file mode 100644 index 0000000..038fa48 Binary files /dev/null and b/blfs-sources/ieee80211-1.1.13.tgz differ diff --git a/blfs-sources/imlib-1.9.15.tar.bz2 b/blfs-sources/imlib-1.9.15.tar.bz2 new file mode 100644 index 0000000..74683c4 Binary files /dev/null and b/blfs-sources/imlib-1.9.15.tar.bz2 differ diff --git a/blfs-sources/jpegsrc.v6b.tar.gz b/blfs-sources/jpegsrc.v6b.tar.gz new file mode 100644 index 0000000..b80f2f3 Binary files /dev/null and b/blfs-sources/jpegsrc.v6b.tar.gz differ diff --git a/blfs-sources/lesstif-0.94.4-testsuite_fix-1.patch b/blfs-sources/lesstif-0.94.4-testsuite_fix-1.patch new file mode 100644 index 0000000..177e47b --- /dev/null +++ b/blfs-sources/lesstif-0.94.4-testsuite_fix-1.patch @@ -0,0 +1,162 @@ +Submitted By: Randy McMurchy +Date: 2005-04-16 +Initial Package Version: 0.94.4 +Upstream Status: Not submitted (LFS specific) +Origin: Randy McMurchy +Description: Add minor changes to the testsuite so that something + meaningful can be made by running the tests + +$LastChangedBy: randy $ +$Date: 2005-04-17 16:02:50 -0500 (Sun, 17 Apr 2005) $ + +diff -Naur lesstif-0.94.4-orig/test/Xm/failed.known lesstif-0.94.4/test/Xm/failed.known +--- lesstif-0.94.4-orig/test/Xm/failed.known 1970-01-01 00:00:00.000000000 +0000 ++++ lesstif-0.94.4/test/Xm/failed.known 2005-04-16 22:19:30.000000000 +0000 +@@ -0,0 +1,100 @@ ++ ++bulletinboard/test1 1 ++bulletinboard/test2 1 ++bulletinboard/test4 1 ++cascadebutton/test2 1 ++cascadebutton/test7 1 ++cascadebuttong/test3 78 ++cascadebuttong/test4 1 ++cascadebuttong/test7 1 ++drawnbutton/test10 1 ++drawnbutton/test6 78 ++filesb/test1 1 ++filesb/test10 1 ++filesb/test13 30 ++filesb/test2 1 ++filesb/test20 1 ++filesb/test3 1 ++filesb/test4 1 ++filesb/test6 1 ++filesb/test8 1 ++filesb/test9 1 ++form/test4 1 ++form/test50 1 ++form/test53 8 ++form/test56 1 ++form/test58 1 ++form/test6 1 ++frame/test10 1 ++frame/test8 2 ++frame/test9 1 ++label/test1 1 ++label/test10 1 ++label/test3 1 ++label/test4 1 ++labelg/test2 1 ++labelg/test4 78 ++list/test16 1 ++list/test21 3 ++mainw/test12 2 ++mainw/test13 1 ++mainw/test17 1 ++mainw/test9 1 ++menushell/test9 1 ++messagebox/test12 1 ++messagebox/test19 2 ++messagebox/test8 1 ++misc/test8 1 ++panedw/test1 1 ++panedw/test6 1 ++panedw/test7 3 ++panedw/test8 1 ++pushbg/test2 1 ++pushbg/test5 1 ++pushbg/test6 1 ++pushbg/test7 1 ++pushbg/test9 78 ++pushbutton/test13 1 ++pushbutton/test2 1 ++pushbutton/test6 1 ++pushbutton/test7 1 ++reptype/test1 2 ++resconvert/test2 139 ++rowcolumn/test18 1 ++rowcolumn/test50 7 ++rowcolumn/test51 100 ++rowcolumn/test58 1 ++rowcolumn/test60 1 ++rowcolumn/test62 1 ++rowcolumn/test63 2 ++rowcolumn/test65 1 ++scale/test17 78 ++scrolledwindow/test1 1 ++scrolledwindow/test13 1 ++scrolledwindow/test19 1 ++scrolledwindow/test20 1 ++scrolledwindow/test21 1 ++selectionbox/test11 1 ++selectionbox/test13 1 ++selectionbox/test9 145 ++text/test1 1 ++text/test10 1 ++text/test13 1 ++text/test16 55 ++text/test2 1 ++text/test22 1 ++text/test23 1 ++text/test7 1 ++text/test8 1 ++textf/test15 1 ++textf/test17 139 ++textf/test2 1 ++textf/test3 1 ++textf/test7 1 ++togglebg/test2 78 ++togglebutton/test7 78 ++tracking/test1 1 ++traversal/test1 1 ++traversal/test4 1 ++vendor/test5 1 ++xmstring/test8 139 + +diff -Naur lesstif-0.94.4-orig/test/testall.in lesstif-0.94.4/test/testall.in +--- lesstif-0.94.4-orig/test/testall.in 2001-11-21 12:55:04.000000000 +0000 ++++ lesstif-0.94.4/test/testall.in 2005-04-16 22:43:17.000000000 +0000 +@@ -127,7 +127,7 @@ + if [ $status -ne 0 ] + then + echo "failed $status" +- echo "status" >>failed ++ echo "$dir/$file $status" >>../failed + FAILED=`expr $FAILED + 1` + else + echo "okay" +@@ -156,7 +156,7 @@ + echo "" + diff failed failed.known + else +- echo "No change in the tests" ++ echo "All failed tests were expected" + fi + + # Exiting. Return number of broken tests (?!) + +diff -Naur lesstif-0.94.4-orig/test/Xm/fonts/test3.c lesstif-0.94.4/test/Xm/fonts/test3.c +--- lesstif-0.94.4-orig/test/Xm/fonts/test3.c 2003-08-24 12:55:45.000000000 +0000 ++++ lesstif-0.94.4/test/Xm/fonts/test3.c 2005-04-17 02:27:15.000000000 +0000 +@@ -33,7 +33,7 @@ + + XtRealizeWidget(toplevel); + +- for (i=0; i<100; i++) { ++ for (i=0; i<50; i++) { + fontlist = _XmGetDefaultFontList(label, XmBUTTON_FONTLIST); + XmFontListFree(fontlist); + sleep(1); + +diff -Naur lesstif-0.94.4-orig/test/Xm/pushbutton/test18.c lesstif-0.94.4/test/Xm/pushbutton/test18.c +--- lesstif-0.94.4-orig/test/Xm/pushbutton/test18.c 2004-10-03 13:26:50.000000000 +0000 ++++ lesstif-0.94.4/test/Xm/pushbutton/test18.c 2005-04-17 02:27:58.000000000 +0000 +@@ -72,6 +72,6 @@ + /* End */ + fprintf(stderr, "Finishing up\n"); + +- sleep(300); ++ sleep(10); + exit(0); + } diff --git a/blfs-sources/lesstif-0.94.4.tar.bz2 b/blfs-sources/lesstif-0.94.4.tar.bz2 new file mode 100644 index 0000000..aa31932 Binary files /dev/null and b/blfs-sources/lesstif-0.94.4.tar.bz2 differ diff --git a/blfs-sources/libIDL-0.8.6.tar.bz2 b/blfs-sources/libIDL-0.8.6.tar.bz2 new file mode 100644 index 0000000..96af197 Binary files /dev/null and b/blfs-sources/libIDL-0.8.6.tar.bz2 differ diff --git a/blfs-sources/libao-0.8.6.tar.gz b/blfs-sources/libao-0.8.6.tar.gz new file mode 100644 index 0000000..e958986 Binary files /dev/null and b/blfs-sources/libao-0.8.6.tar.gz differ diff --git a/blfs-sources/libart_lgpl-2.3.17.tar.bz2 b/blfs-sources/libart_lgpl-2.3.17.tar.bz2 new file mode 100644 index 0000000..b77979d Binary files /dev/null and b/blfs-sources/libart_lgpl-2.3.17.tar.bz2 differ diff --git a/blfs-sources/libglade-2.5.1.tar.bz2 b/blfs-sources/libglade-2.5.1.tar.bz2 new file mode 100644 index 0000000..2ef6c71 Binary files /dev/null and b/blfs-sources/libglade-2.5.1.tar.bz2 differ diff --git a/blfs-sources/libogg-1.1.3.tar.gz b/blfs-sources/libogg-1.1.3.tar.gz new file mode 100644 index 0000000..2f05968 Binary files /dev/null and b/blfs-sources/libogg-1.1.3.tar.gz differ diff --git a/blfs-sources/libpng-1.2.8-link_to_proper_libs-1.patch b/blfs-sources/libpng-1.2.8-link_to_proper_libs-1.patch new file mode 100644 index 0000000..0349ad2 --- /dev/null +++ b/blfs-sources/libpng-1.2.8-link_to_proper_libs-1.patch @@ -0,0 +1,58 @@ +Submitted By: Bruce Dubbs +Date: 2004-08-05 +Initial Package Version: 1.2.6 +Origin: http://blfs-bugs.linuxfromscratch.org/show_bug.cgi?id=644 +Description: libpng is not linked against libz and libm. This causes + problems for packages that try to link against libpng + without including "-lz -lm" in the linker flags. + +$LastChangedBy: igor $ +$Date: 2005-01-04 14:22:27 -0600 (Tue, 04 Jan 2005) $ + +--- libpng-1.2.8/scripts/libpng.pc.in.orig 2005-01-04 14:06:54.182100728 +0000 ++++ libpng-1.2.8/scripts/libpng.pc.in 2005-01-04 14:07:19.108311368 +0000 +@@ -7,5 +7,5 @@ + Name: libpng12 + Description: Loads and saves PNG files + Version: 1.2.8 +-Libs: -L${libdir} -lpng12 -lz -lm ++Libs: -L${libdir} -lpng12 + Cflags: -I${includedir}/libpng12 +--- libpng-1.2.8/scripts/makefile.linux.orig 2005-01-04 14:07:37.875458328 +0000 ++++ libpng-1.2.8/scripts/makefile.linux 2005-01-04 14:11:03.918135080 +0000 +@@ -34,8 +34,9 @@ + CFLAGS=-I$(ZLIBINC) -Wall -O3 -funroll-loops \ + $(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5 + +-LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng12 -lz -lm +-LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm ++LIBS=-lz -lm ++LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng12 ++LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a $(LIBS) + + RANLIB=ranlib + #RANLIB=echo +@@ -86,7 +87,7 @@ + echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ + echo L_opts=\"-L$(LIBPATH)\"; \ + echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \ +- echo libs=\"-lpng12 -lz -lm\"; \ ++ echo libs=\"-lpng12\"; \ + cat scripts/libpng-config-body.in ) > libpng-config + chmod +x libpng-config + +@@ -99,12 +100,12 @@ + $(LIBNAME).so.$(PNGVER): $(OBJSDLL) + $(CC) -shared -Wl,-soname,$(LIBNAME).so.$(PNGMAJ) \ + -o $(LIBNAME).so.$(PNGVER) \ +- $(OBJSDLL) ++ $(OBJSDLL) $(LIBS) + + libpng.so.3.$(PNGMIN): $(OBJSDLL) + $(CC) -shared -Wl,-soname,libpng.so.3 \ + -o libpng.so.3.$(PNGMIN) \ +- $(OBJSDLL) ++ $(OBJSDLL) $(LIBS) + + pngtest: pngtest.o $(LIBNAME).so + $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) diff --git a/blfs-sources/libpng-1.2.8.tar.bz2 b/blfs-sources/libpng-1.2.8.tar.bz2 new file mode 100644 index 0000000..c463c30 Binary files /dev/null and b/blfs-sources/libpng-1.2.8.tar.bz2 differ diff --git a/blfs-sources/libvorbis-1.1.2.tar.gz b/blfs-sources/libvorbis-1.1.2.tar.gz new file mode 100644 index 0000000..9ff75eb Binary files /dev/null and b/blfs-sources/libvorbis-1.1.2.tar.gz differ diff --git a/blfs-sources/libxml2-2.6.24.tar.gz b/blfs-sources/libxml2-2.6.24.tar.gz new file mode 100644 index 0000000..7d6c69c Binary files /dev/null and b/blfs-sources/libxml2-2.6.24.tar.gz differ diff --git a/blfs-sources/links-2.1pre21.tar.bz2 b/blfs-sources/links-2.1pre21.tar.bz2 new file mode 100644 index 0000000..29187c5 Binary files /dev/null and b/blfs-sources/links-2.1pre21.tar.bz2 differ diff --git a/blfs-sources/luit-1.0.1-race-1.patch b/blfs-sources/luit-1.0.1-race-1.patch new file mode 100644 index 0000000..8a9f569 --- /dev/null +++ b/blfs-sources/luit-1.0.1-race-1.patch @@ -0,0 +1,88 @@ +Submitted By: DJ Lucas +Date: 2006-03-03 +Initial Package Version: 6.8.2 +Origin: https://bugs.freedesktop.org/show_bug.cgi?id=1400 +Upstream Status: unclear, see below +Description: prevents the race condition and deadlock in luit. Should +apply both to XOrg and XFree86. Rediffed from xorg_6.8.2-luit_race-1.patch + +diff -Naur luit-X11R7.0-1.0.1-old/luit.c luit-X11R7.0-1.0.1/luit.c +--- luit-X11R7.0-1.0.1-old/luit.c 2004-04-23 14:54:35.000000000 -0500 ++++ luit-X11R7.0-1.0.1/luit.c 2006-02-28 20:06:14.000000000 -0600 +@@ -45,6 +45,8 @@ + #include "charset.h" + #include "iso2022.h" + ++static int p2c_waitpipe[2]; ++static int c2p_waitpipe[2]; + static Iso2022Ptr inputState = NULL, outputState = NULL; + + static char *child_argv0 = NULL; +@@ -462,6 +464,8 @@ + exit(1); + } + ++ pipe(p2c_waitpipe); ++ pipe(c2p_waitpipe); + pid = fork(); + if(pid < 0) { + perror("Couldn't fork"); +@@ -470,8 +474,12 @@ + + if(pid == 0) { + close(pty); ++ close(p2c_waitpipe[1]); ++ close(c2p_waitpipe[0]); + child(line, path, child_argv); + } else { ++ close(p2c_waitpipe[0]); ++ close(c2p_waitpipe[1]); + free(child_argv); + free(path); + free(line); +@@ -486,6 +494,7 @@ + { + int tty; + int pgrp; ++ char tmp[10]; + + close(0); + close(1); +@@ -501,6 +510,7 @@ + kill(getppid(), SIGABRT); + exit(1); + } ++ write(c2p_waitpipe[1],"1",1); + + if(tty != 0) + dup2(tty, 0); +@@ -512,6 +522,9 @@ + if(tty > 2) + close(tty); + ++ read(p2c_waitpipe[0],tmp,1); ++ close(c2p_waitpipe[1]); ++ close(p2c_waitpipe[0]); + execvp(path, argv); + perror("Couldn't exec"); + exit(1); +@@ -535,7 +548,9 @@ + int i; + int val; + int rc; ++ char tmp[10]; + ++ read(c2p_waitpipe[0],tmp,1); + if(verbose) { + reportIso2022(outputState); + } +@@ -564,6 +579,9 @@ + + setWindowSize(0, pty); + ++ write(p2c_waitpipe[1],"1",1); ++ close(c2p_waitpipe[0]); ++ close(p2c_waitpipe[1]); + for(;;) { + rc = waitForInput(0, pty); + diff --git a/blfs-sources/luit-1.0.1.tar.bz2 b/blfs-sources/luit-1.0.1.tar.bz2 new file mode 100644 index 0000000..684b550 Binary files /dev/null and b/blfs-sources/luit-1.0.1.tar.bz2 differ diff --git a/blfs-sources/mc-4.6.1.tar.gz b/blfs-sources/mc-4.6.1.tar.gz new file mode 100644 index 0000000..15f9911 Binary files /dev/null and b/blfs-sources/mc-4.6.1.tar.gz differ diff --git a/blfs-sources/mpg123-0.59r-security-1.patch b/blfs-sources/mpg123-0.59r-security-1.patch new file mode 100644 index 0000000..8d2547d --- /dev/null +++ b/blfs-sources/mpg123-0.59r-security-1.patch @@ -0,0 +1,25 @@ +Submitted By: David Jensen (djensen at linuxfromscratch dot org) +Date: 2005-07-23 +Initial Package Version: 0.59r +Origin: Debian +Upstream Status: not maintained +Description: Fixes buffer overflow vulnerablity (CAN-2004-0805) + +$LastChangedBy: djensen $ +$Date: 2005-07-26 21:17:28 -0600 (Tue, 26 Jul 2005) $ + +diff -Naur mpg123-0.59r.orig/layer2.c mpg123-0.59r/layer2.c +--- mpg123-0.59r.orig/layer2.c 1999-02-10 06:13:06.000000000 -0600 ++++ mpg123-0.59r/layer2.c 2005-07-23 16:44:07.000000000 -0500 +@@ -265,6 +265,11 @@ + fr->jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? + (fr->mode_ext<<2)+4 : fr->II_sblimit; + ++ if (fr->jsbound > fr->II_sblimit) { ++ fprintf(stderr, "Truncating stereo boundary to sideband limit.\n"); ++ fr->jsbound=fr->II_sblimit; ++ } ++ + if(stereo == 1 || single == 3) + single = 0; + diff --git a/blfs-sources/mpg123-0.59r.tar.gz b/blfs-sources/mpg123-0.59r.tar.gz new file mode 100644 index 0000000..410c228 Binary files /dev/null and b/blfs-sources/mpg123-0.59r.tar.gz differ diff --git a/blfs-sources/mpg123-0.61.tar.bz2 b/blfs-sources/mpg123-0.61.tar.bz2 new file mode 100644 index 0000000..3215907 Binary files /dev/null and b/blfs-sources/mpg123-0.61.tar.bz2 differ diff --git a/blfs-sources/mrxvt-0.5.0.tar.gz b/blfs-sources/mrxvt-0.5.0.tar.gz new file mode 100644 index 0000000..43428e5 Binary files /dev/null and b/blfs-sources/mrxvt-0.5.0.tar.gz differ diff --git a/blfs-sources/nedit-5.5-src.tar.bz2 b/blfs-sources/nedit-5.5-src.tar.bz2 new file mode 100644 index 0000000..dc620b9 Binary files /dev/null and b/blfs-sources/nedit-5.5-src.tar.bz2 differ diff --git a/blfs-sources/openal-0.0.8.tar.gz b/blfs-sources/openal-0.0.8.tar.gz new file mode 100644 index 0000000..fdbec3e Binary files /dev/null and b/blfs-sources/openal-0.0.8.tar.gz differ diff --git a/blfs-sources/pango-1.12.3.tar.bz2 b/blfs-sources/pango-1.12.3.tar.bz2 new file mode 100644 index 0000000..2ef1aca Binary files /dev/null and b/blfs-sources/pango-1.12.3.tar.bz2 differ diff --git a/blfs-sources/sylpheed-2.2.6.tar.bz2 b/blfs-sources/sylpheed-2.2.6.tar.bz2 new file mode 100644 index 0000000..2f32534 Binary files /dev/null and b/blfs-sources/sylpheed-2.2.6.tar.bz2 differ diff --git a/blfs-sources/tiff-3.8.2.tar.gz b/blfs-sources/tiff-3.8.2.tar.gz new file mode 100644 index 0000000..9320dbf Binary files /dev/null and b/blfs-sources/tiff-3.8.2.tar.gz differ diff --git a/blfs-sources/valgrind-3.2.0.tar.bz2 b/blfs-sources/valgrind-3.2.0.tar.bz2 new file mode 100644 index 0000000..c411c74 Binary files /dev/null and b/blfs-sources/valgrind-3.2.0.tar.bz2 differ diff --git a/blfs-sources/vorbis-tools-1.1.1.tar.gz b/blfs-sources/vorbis-tools-1.1.1.tar.gz new file mode 100644 index 0000000..939e91e Binary files /dev/null and b/blfs-sources/vorbis-tools-1.1.1.tar.gz differ diff --git a/blfs-sources/xbitmaps-1.0.1.tar.bz2 b/blfs-sources/xbitmaps-1.0.1.tar.bz2 new file mode 100644 index 0000000..dacc976 Binary files /dev/null and b/blfs-sources/xbitmaps-1.0.1.tar.bz2 differ diff --git a/blfs-sources/xorg-server-1.1.0.tar.bz2 b/blfs-sources/xorg-server-1.1.0.tar.bz2 new file mode 100644 index 0000000..03d3d24 Binary files /dev/null and b/blfs-sources/xorg-server-1.1.0.tar.bz2 differ diff --git a/blfs-sources/xpdf-3.01.tar.gz b/blfs-sources/xpdf-3.01.tar.gz new file mode 100644 index 0000000..fa64138 Binary files /dev/null and b/blfs-sources/xpdf-3.01.tar.gz differ diff --git a/blfs-sources/xpdf-3.01pl2.patch b/blfs-sources/xpdf-3.01pl2.patch new file mode 100644 index 0000000..3ea3cb8 --- /dev/null +++ b/blfs-sources/xpdf-3.01pl2.patch @@ -0,0 +1,471 @@ +diff -cr xpdf-3.01.orig/goo/gmem.c xpdf-3.01/goo/gmem.c +*** xpdf-3.01.orig/goo/gmem.c Tue Aug 16 22:34:30 2005 +--- xpdf-3.01/goo/gmem.c Tue Jan 17 17:03:57 2006 +*************** +*** 11,16 **** +--- 11,17 ---- + #include + #include + #include ++ #include + #include "gmem.h" + + #ifdef DEBUG_MEM +*************** +*** 63,69 **** + int lst; + unsigned long *trl, *p; + +! if (size == 0) + return NULL; + size1 = gMemDataSize(size); + if (!(mem = (char *)malloc(size1 + gMemHdrSize + gMemTrlSize))) { +--- 64,70 ---- + int lst; + unsigned long *trl, *p; + +! if (size <= 0) + return NULL; + size1 = gMemDataSize(size); + if (!(mem = (char *)malloc(size1 + gMemHdrSize + gMemTrlSize))) { +*************** +*** 86,92 **** + #else + void *p; + +! if (size == 0) + return NULL; + if (!(p = malloc(size))) { + fprintf(stderr, "Out of memory\n"); +--- 87,93 ---- + #else + void *p; + +! if (size <= 0) + return NULL; + if (!(p = malloc(size))) { + fprintf(stderr, "Out of memory\n"); +*************** +*** 102,108 **** + void *q; + int oldSize; + +! if (size == 0) { + if (p) + gfree(p); + return NULL; +--- 103,109 ---- + void *q; + int oldSize; + +! if (size <= 0) { + if (p) + gfree(p); + return NULL; +*************** +*** 120,126 **** + #else + void *q; + +! if (size == 0) { + if (p) + free(p); + return NULL; +--- 121,127 ---- + #else + void *q; + +! if (size <= 0) { + if (p) + free(p); + return NULL; +*************** +*** 140,147 **** + void *gmallocn(int nObjs, int objSize) { + int n; + + n = nObjs * objSize; +! if (objSize == 0 || n / objSize != nObjs) { + fprintf(stderr, "Bogus memory allocation size\n"); + exit(1); + } +--- 141,151 ---- + void *gmallocn(int nObjs, int objSize) { + int n; + ++ if (nObjs == 0) { ++ return NULL; ++ } + n = nObjs * objSize; +! if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) { + fprintf(stderr, "Bogus memory allocation size\n"); + exit(1); + } +*************** +*** 151,158 **** + void *greallocn(void *p, int nObjs, int objSize) { + int n; + + n = nObjs * objSize; +! if (objSize == 0 || n / objSize != nObjs) { + fprintf(stderr, "Bogus memory allocation size\n"); + exit(1); + } +--- 155,168 ---- + void *greallocn(void *p, int nObjs, int objSize) { + int n; + ++ if (nObjs == 0) { ++ if (p) { ++ gfree(p); ++ } ++ return NULL; ++ } + n = nObjs * objSize; +! if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) { + fprintf(stderr, "Bogus memory allocation size\n"); + exit(1); + } +diff -cr xpdf-3.01.orig/xpdf/JBIG2Stream.cc xpdf-3.01/xpdf/JBIG2Stream.cc +*** xpdf-3.01.orig/xpdf/JBIG2Stream.cc Tue Aug 16 22:34:31 2005 +--- xpdf-3.01/xpdf/JBIG2Stream.cc Tue Jan 17 17:29:46 2006 +*************** +*** 13,18 **** +--- 13,19 ---- + #endif + + #include ++ #include + #include "GList.h" + #include "Error.h" + #include "JArithmeticDecoder.h" +*************** +*** 681,686 **** +--- 682,691 ---- + w = wA; + h = hA; + line = (wA + 7) >> 3; ++ if (w <= 0 || h <= 0 || line <= 0 || h >= (INT_MAX - 1) / line) { ++ data = NULL; ++ return; ++ } + // need to allocate one extra guard byte for use in combine() + data = (Guchar *)gmalloc(h * line + 1); + data[h * line] = 0; +*************** +*** 692,697 **** +--- 697,706 ---- + w = bitmap->w; + h = bitmap->h; + line = bitmap->line; ++ if (w <= 0 || h <= 0 || line <= 0 || h >= (INT_MAX - 1) / line) { ++ data = NULL; ++ return; ++ } + // need to allocate one extra guard byte for use in combine() + data = (Guchar *)gmalloc(h * line + 1); + memcpy(data, bitmap->data, h * line); +*************** +*** 720,726 **** + } + + void JBIG2Bitmap::expand(int newH, Guint pixel) { +! if (newH <= h) { + return; + } + // need to allocate one extra guard byte for use in combine() +--- 729,735 ---- + } + + void JBIG2Bitmap::expand(int newH, Guint pixel) { +! if (newH <= h || line <= 0 || newH >= (INT_MAX - 1) / line) { + return; + } + // need to allocate one extra guard byte for use in combine() +*************** +*** 2294,2299 **** +--- 2303,2316 ---- + !readUWord(&stepX) || !readUWord(&stepY)) { + goto eofError; + } ++ if (w == 0 || h == 0 || w >= INT_MAX / h) { ++ error(getPos(), "Bad bitmap size in JBIG2 halftone segment"); ++ return; ++ } ++ if (gridH == 0 || gridW >= INT_MAX / gridH) { ++ error(getPos(), "Bad grid size in JBIG2 halftone segment"); ++ return; ++ } + + // get pattern dictionary + if (nRefSegs != 1) { +diff -cr xpdf-3.01.orig/xpdf/JPXStream.cc xpdf-3.01/xpdf/JPXStream.cc +*** xpdf-3.01.orig/xpdf/JPXStream.cc Tue Aug 16 22:34:31 2005 +--- xpdf-3.01/xpdf/JPXStream.cc Tue Jan 17 17:14:06 2006 +*************** +*** 12,17 **** +--- 12,18 ---- + #pragma implementation + #endif + ++ #include + #include "gmem.h" + #include "Error.h" + #include "JArithmeticDecoder.h" +*************** +*** 818,823 **** +--- 819,830 ---- + / img.xTileSize; + img.nYTiles = (img.ySize - img.yTileOffset + img.yTileSize - 1) + / img.yTileSize; ++ // check for overflow before allocating memory ++ if (img.nXTiles <= 0 || img.nYTiles <= 0 || ++ img.nXTiles >= INT_MAX / img.nYTiles) { ++ error(getPos(), "Bad tile count in JPX SIZ marker segment"); ++ return gFalse; ++ } + img.tiles = (JPXTile *)gmallocn(img.nXTiles * img.nYTiles, + sizeof(JPXTile)); + for (i = 0; i < img.nXTiles * img.nYTiles; ++i) { +diff -cr xpdf-3.01.orig/xpdf/Stream.cc xpdf-3.01/xpdf/Stream.cc +*** xpdf-3.01.orig/xpdf/Stream.cc Tue Aug 16 22:34:31 2005 +--- xpdf-3.01/xpdf/Stream.cc Tue Jan 17 17:31:52 2006 +*************** +*** 15,20 **** +--- 15,21 ---- + #include + #include + #include ++ #include + #ifndef WIN32 + #include + #endif +*************** +*** 406,418 **** +--- 407,432 ---- + width = widthA; + nComps = nCompsA; + nBits = nBitsA; ++ predLine = NULL; ++ ok = gFalse; + + nVals = width * nComps; ++ if (width <= 0 || nComps <= 0 || nBits <= 0 || ++ nComps >= INT_MAX / nBits || ++ width >= INT_MAX / nComps / nBits || ++ nVals * nBits + 7 < 0) { ++ return; ++ } + pixBytes = (nComps * nBits + 7) >> 3; + rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes; ++ if (rowBytes <= 0) { ++ return; ++ } + predLine = (Guchar *)gmalloc(rowBytes); + memset(predLine, 0, rowBytes); + predIdx = rowBytes; ++ ++ ok = gTrue; + } + + StreamPredictor::~StreamPredictor() { +*************** +*** 1004,1009 **** +--- 1018,1027 ---- + FilterStream(strA) { + if (predictor != 1) { + pred = new StreamPredictor(this, predictor, columns, colors, bits); ++ if (!pred->isOk()) { ++ delete pred; ++ pred = NULL; ++ } + } else { + pred = NULL; + } +*************** +*** 1259,1264 **** +--- 1277,1285 ---- + if (columns < 1) { + columns = 1; + } ++ if (columns + 4 <= 0) { ++ columns = INT_MAX - 4; ++ } + rows = rowsA; + endOfBlock = endOfBlockA; + black = blackA; +*************** +*** 2899,2904 **** +--- 2920,2930 ---- + height = read16(); + width = read16(); + numComps = str->getChar(); ++ if (numComps <= 0 || numComps > 4) { ++ error(getPos(), "Bad number of components in DCT stream"); ++ numComps = 0; ++ return gFalse; ++ } + if (prec != 8) { + error(getPos(), "Bad DCT precision %d", prec); + return gFalse; +*************** +*** 2925,2930 **** +--- 2951,2961 ---- + height = read16(); + width = read16(); + numComps = str->getChar(); ++ if (numComps <= 0 || numComps > 4) { ++ error(getPos(), "Bad number of components in DCT stream"); ++ numComps = 0; ++ return gFalse; ++ } + if (prec != 8) { + error(getPos(), "Bad DCT precision %d", prec); + return gFalse; +*************** +*** 2947,2952 **** +--- 2978,2988 ---- + + length = read16() - 2; + scanInfo.numComps = str->getChar(); ++ if (scanInfo.numComps <= 0 || scanInfo.numComps > 4) { ++ error(getPos(), "Bad number of components in DCT stream"); ++ scanInfo.numComps = 0; ++ return gFalse; ++ } + --length; + if (length != 2 * scanInfo.numComps + 3) { + error(getPos(), "Bad DCT scan info block"); +*************** +*** 3041,3046 **** +--- 3077,3083 ---- + numACHuffTables = index+1; + tbl = &acHuffTables[index]; + } else { ++ index &= 0x0f; + if (index >= numDCHuffTables) + numDCHuffTables = index+1; + tbl = &dcHuffTables[index]; +*************** +*** 3827,3832 **** +--- 3864,3873 ---- + FilterStream(strA) { + if (predictor != 1) { + pred = new StreamPredictor(this, predictor, columns, colors, bits); ++ if (!pred->isOk()) { ++ delete pred; ++ pred = NULL; ++ } + } else { + pred = NULL; + } +diff -cr xpdf-3.01.orig/xpdf/Stream.h xpdf-3.01/xpdf/Stream.h +*** xpdf-3.01.orig/xpdf/Stream.h Tue Aug 16 22:34:31 2005 +--- xpdf-3.01/xpdf/Stream.h Tue Jan 17 17:19:54 2006 +*************** +*** 232,237 **** +--- 232,239 ---- + + ~StreamPredictor(); + ++ GBool isOk() { return ok; } ++ + int lookChar(); + int getChar(); + +*************** +*** 249,254 **** +--- 251,257 ---- + int rowBytes; // bytes per line + Guchar *predLine; // line buffer + int predIdx; // current index in predLine ++ GBool ok; + }; + + //------------------------------------------------------------------------ +*************** +*** 527,533 **** + short getWhiteCode(); + short getBlackCode(); + short lookBits(int n); +! void eatBits(int n) { inputBits -= n; } + }; + + //------------------------------------------------------------------------ +--- 530,536 ---- + short getWhiteCode(); + short getBlackCode(); + short lookBits(int n); +! void eatBits(int n) { if ((inputBits -= n) < 0) inputBits = 0; } + }; + + //------------------------------------------------------------------------ +diff -cr xpdf-3.01.orig/splash/SplashXPathScanner.cc xpdf-3.01/splash/SplashXPathScanner.cc +*** xpdf-3.01.orig/splash/SplashXPathScanner.cc Tue Aug 16 22:34:31 2005 +--- xpdf-3.01/splash/SplashXPathScanner.cc Wed Feb 1 17:01:14 2006 +*************** +*** 186,192 **** + } + + void SplashXPathScanner::computeIntersections(int y) { +! SplashCoord ySegMin, ySegMax, xx0, xx1; + SplashXPathSeg *seg; + int i, j; + +--- 186,192 ---- + } + + void SplashXPathScanner::computeIntersections(int y) { +! SplashCoord xSegMin, xSegMax, ySegMin, ySegMax, xx0, xx1; + SplashXPathSeg *seg; + int i, j; + +*************** +*** 236,254 **** + } else if (seg->flags & splashXPathVert) { + xx0 = xx1 = seg->x0; + } else { +! if (ySegMin <= y) { +! // intersection with top edge +! xx0 = seg->x0 + ((SplashCoord)y - seg->y0) * seg->dxdy; + } else { +! // x coord of segment endpoint with min y coord +! xx0 = (seg->flags & splashXPathFlip) ? seg->x1 : seg->x0; + } +! if (ySegMax >= y + 1) { +! // intersection with bottom edge +! xx1 = seg->x0 + ((SplashCoord)y + 1 - seg->y0) * seg->dxdy; +! } else { +! // x coord of segment endpoint with max y coord +! xx1 = (seg->flags & splashXPathFlip) ? seg->x0 : seg->x1; + } + } + if (xx0 < xx1) { +--- 236,262 ---- + } else if (seg->flags & splashXPathVert) { + xx0 = xx1 = seg->x0; + } else { +! if (seg->x0 < seg->x1) { +! xSegMin = seg->x0; +! xSegMax = seg->x1; + } else { +! xSegMin = seg->x1; +! xSegMax = seg->x0; + } +! // intersection with top edge +! xx0 = seg->x0 + ((SplashCoord)y - seg->y0) * seg->dxdy; +! // intersection with bottom edge +! xx1 = seg->x0 + ((SplashCoord)y + 1 - seg->y0) * seg->dxdy; +! // the segment may not actually extend to the top and/or bottom edges +! if (xx0 < xSegMin) { +! xx0 = xSegMin; +! } else if (xx0 > xSegMax) { +! xx0 = xSegMax; +! } +! if (xx1 < xSegMin) { +! xx1 = xSegMin; +! } else if (xx1 > xSegMax) { +! xx1 = xSegMax; + } + } + if (xx0 < xx1) { diff --git a/blfs-sources/xterm-213.tgz b/blfs-sources/xterm-213.tgz new file mode 100644 index 0000000..3356e25 Binary files /dev/null and b/blfs-sources/xterm-213.tgz differ diff --git a/bsd-bootscripts-20060602.tar.bz2 b/bsd-bootscripts-20060602.tar.bz2 new file mode 100644 index 0000000..0265fe5 Binary files /dev/null and b/bsd-bootscripts-20060602.tar.bz2 differ diff --git a/bsd-bootscripts-20060720.tar.bz2 b/bsd-bootscripts-20060720.tar.bz2 new file mode 100644 index 0000000..c51d76d Binary files /dev/null and b/bsd-bootscripts-20060720.tar.bz2 differ diff --git a/bsd-bootscripts-20061012.tar.bz2 b/bsd-bootscripts-20061012.tar.bz2 new file mode 100644 index 0000000..a9ac5f9 Binary files /dev/null and b/bsd-bootscripts-20061012.tar.bz2 differ diff --git a/bsd-bootscripts/etc/inittab b/bsd-bootscripts/etc/inittab new file mode 100644 index 0000000..3d33728 --- /dev/null +++ b/bsd-bootscripts/etc/inittab @@ -0,0 +1,22 @@ +id:2:initdefault: + +si:S:sysinit:/etc/rc.d/rc.sysinit + +l0:0:wait:/etc/rc.d/rc.0 +l1:1:wait:/etc/rc.d/rc.1 +l2:2:wait:/etc/rc.d/rc.2 +l3:3:wait:/etc/rc.d/rc.3 +l4:4:wait:/etc/rc.d/rc.4 +l5:5:wait:/etc/rc.d/rc.5 +l6:6:wait:/etc/rc.d/rc.6 + +ca:12345:ctrlaltdel:/sbin/shutdown -t1 -r now + +su:S1:respawn:/sbin/sulogin + +c1:2345:respawn:/sbin/agetty tty1 38400 linux +c2:2345:respawn:/sbin/agetty tty2 38400 linux +c3:2345:respawn:/sbin/agetty tty3 38400 linux +c4:2345:respawn:/sbin/agetty tty4 38400 linux +c5:2345:respawn:/sbin/agetty tty5 38400 linux +c6:2345:respawn:/sbin/agetty tty6 38400 linux diff --git a/bsd-bootscripts/etc/rc.d/functions b/bsd-bootscripts/etc/rc.d/functions new file mode 100644 index 0000000..6bfa37e --- /dev/null +++ b/bsd-bootscripts/etc/rc.d/functions @@ -0,0 +1,36 @@ +#!/bin/sh +# Environmental setup +umask 022 +export PATH="/bin:/usr/bin:/sbin:/usr/sbin" + +# Color definitions +NORMAL="\\033[0;39m" +GREEN="\\033[1;32m" +YELLOW="\\033[1;33m" +RED="\\033[1;31m" +CYAN="\\033[1;36m" +BLUE="\\033[1;34m" + +msg_red() +{ + echo -e "${RED}${1}${NORMAL}" +} +msg_green() +{ + echo -e "${GREEN}${1}${NORMAL}" +} + +msg_blue() +{ + echo -e "${BLUE}${1}${NORMAL}" +} +msg_yellow() +{ + echo -e "${YELLOW}${1}${NORMAL}" +} +msg_cyan() +{ + echo -e "${CYAN}${1}${NORMAL}" +} + + diff --git a/bsd-bootscripts/etc/rc.d/rc.0 b/bsd-bootscripts/etc/rc.d/rc.0 new file mode 100644 index 0000000..9ba3fa2 --- /dev/null +++ b/bsd-bootscripts/etc/rc.d/rc.0 @@ -0,0 +1,70 @@ +#!/bin/sh + + +######################################### +######## HALT or REBOOT ################# +######################################### + +#import functions +. /etc/rc.d/functions + +msg_green "Sending all processes the TERM signal..." +/sbin/killall5 -15 +sleep 1 + +msg_green "Sending all processes the KILL signal..." +/sbin/killall5 -9 +sleep 1 + +msg_green "Deactivating swap partitions..." +/sbin/swapoff -a + +msg_green "Saving random seed to a temporary file..." +/bin/dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2>/dev/null + + +msg_green "Saving mixer settings..." +/usr/sbin/alsactl store + + +msg_green "Saving the system time to hardware clock..." +# For UTC +#/sbin/hwclock --systohc --utc +# For localtime +/sbin/hwclock --systohc --localtime + + + + + +case "$0" in + *6) + /sbin/reboot -w + ;; + + *0) + /sbin/halt -w + ;; +esac + +msg_green "Flushing filesystem buffers..." +/bin/sync + +msg_green "Remounting root filesystem read-only..." +/bin/mount -n -o remount,ro / + +msg_green "Unmounting local filesystems..." +/bin/umount -a -tnonfs + +case "$0" in + *6) + msg_green "Please stand by while rebooting..." + /sbin/reboot -d -f -i + ;; + + *0) + msg_green "Bye..." + /sbin/halt -d -f -p + ;; +esac + diff --git a/bsd-bootscripts/etc/rc.d/rc.1 b/bsd-bootscripts/etc/rc.d/rc.1 new file mode 100644 index 0000000..eb7d5cb --- /dev/null +++ b/bsd-bootscripts/etc/rc.d/rc.1 @@ -0,0 +1,23 @@ +#!/bin/sh + + + +######################################### +######## SINGLE USER #################### +######################################### + +#import functions +. /etc/rc.d/functions + + +msg_green "Sending all processes the TERM signal..." +/sbin/killall5 -15 +sleep 1 + + + +msg_green "Sending all processes the KILL signal..." +/sbin/killall5 -9 + + +# inittab takes care of the rest diff --git a/bsd-bootscripts/etc/rc.d/rc.2 b/bsd-bootscripts/etc/rc.d/rc.2 new file mode 100644 index 0000000..392dbb9 --- /dev/null +++ b/bsd-bootscripts/etc/rc.d/rc.2 @@ -0,0 +1,27 @@ +#!/bin/sh + +#import functions +. /etc/rc.d/functions + +#echo 1 > /proc/sys/net/ipv4/ip_forward # enable IP forwarding +#echo 1 > /proc/sys/net/ipv4/tcp_syncookies # defend against SYN flood + +msg_green "Setting up loopback networking..." +ifconfig lo 127.0.0.1 netmask 255.0.0.0 + +msg_green "Setting up eth0 " +ifconfig eth0 192.168.1.20 netmask 255.255.255.0 + +#msg_green "Setting up eth1 " +#ifconfig eth1 192.168.0.20 netmask 255.255.255.0 + + + +msg_green "Setting default route" +#ip route add default via 192.168.0.1 scope link metric 1 dev eth0 +route add default gw 192.168.1.1 + + +if [ -x /etc/rc.d/rc.local ]; then + /etc/rc.d/rc.local +fi diff --git a/bsd-bootscripts/etc/rc.d/rc.3 b/bsd-bootscripts/etc/rc.d/rc.3 new file mode 120000 index 0000000..373b963 --- /dev/null +++ b/bsd-bootscripts/etc/rc.d/rc.3 @@ -0,0 +1 @@ +../../../../../../media/hdc1/Kable-distro/bsd-bootscripts/etc/rc.d/rc.2 \ No newline at end of file diff --git a/bsd-bootscripts/etc/rc.d/rc.4 b/bsd-bootscripts/etc/rc.d/rc.4 new file mode 120000 index 0000000..373b963 --- /dev/null +++ b/bsd-bootscripts/etc/rc.d/rc.4 @@ -0,0 +1 @@ +../../../../../../media/hdc1/Kable-distro/bsd-bootscripts/etc/rc.d/rc.2 \ No newline at end of file diff --git a/bsd-bootscripts/etc/rc.d/rc.5 b/bsd-bootscripts/etc/rc.d/rc.5 new file mode 100644 index 0000000..7f335f2 --- /dev/null +++ b/bsd-bootscripts/etc/rc.d/rc.5 @@ -0,0 +1,8 @@ +#!/bin/sh + +#import functions +. /etc/rc.d/functions + +if [ -x /etc/rc.d/rc.local ]; then + /etc/rc.d/rc.local +fi diff --git a/bsd-bootscripts/etc/rc.d/rc.6 b/bsd-bootscripts/etc/rc.d/rc.6 new file mode 120000 index 0000000..45f1ae6 --- /dev/null +++ b/bsd-bootscripts/etc/rc.d/rc.6 @@ -0,0 +1 @@ +../../../../../../media/hdc1/Kable-distro/bsd-bootscripts/etc/rc.d/rc.0 \ No newline at end of file diff --git a/bsd-bootscripts/etc/rc.d/rc.daemons b/bsd-bootscripts/etc/rc.d/rc.daemons new file mode 100644 index 0000000..cca80eb --- /dev/null +++ b/bsd-bootscripts/etc/rc.d/rc.daemons @@ -0,0 +1,6 @@ +#!/bin/sh + +#import functions +. /etc/rc.d/functions + + diff --git a/bsd-bootscripts/etc/rc.d/rc.local b/bsd-bootscripts/etc/rc.d/rc.local new file mode 100644 index 0000000..11df31b --- /dev/null +++ b/bsd-bootscripts/etc/rc.d/rc.local @@ -0,0 +1,5 @@ +#!/bin/sh + +#import functions +. /etc/rc.d/functions + diff --git a/bsd-bootscripts/etc/rc.d/rc.sysinit b/bsd-bootscripts/etc/rc.d/rc.sysinit new file mode 100644 index 0000000..a4cd5de --- /dev/null +++ b/bsd-bootscripts/etc/rc.d/rc.sysinit @@ -0,0 +1,132 @@ +#!/bin/sh + +#################################### +####### SYSINIT #################### +#################################### + + +#import functions +. /etc/rc.d/functions + + +msg_green "Remounting root device read-write..." +/bin/mount -n -v -o remount,rw / + +msg_green "Mounting kernel-based file systems..." +mount -n -t proc proc /proc +mount -n -t sysfs sysfs /sys +mount -n -t tmpfs tmpfs /dev -o mode=755 +mkdir /dev/pts +mkdir /dev/shm +mount -n -t devpts devpts /dev/pts -o gid=4,mode=620 +mount -n -t tmpfs tmpfs /dev/shm + +msg_green "Starting UDEV..." + +# Avoid other binarys reciving kernel events +echo > /proc/sys/kernel/hotplug + +# Copy static device nodes to /dev +cp -a /lib/udev/devices/* /dev + +/sbin/udevd --daemon +/sbin/udevtrigger +/sbin/udevsettle + +msg_green "Setting HD params" +hdparm -d1 -c1 -u1 -m16 /dev/hda + +msg_green "Starting system and kernel log daemons...." +/usr/sbin/syslogd +/usr/sbin/klogd -c3 + + +msg_green "Initializing swap partitions..." +/sbin/swapon -a + +# Creaning mtab +echo "" >/etc/mtab +/bin/mount -f -o remount,rw / + + + +msg_green "Mounting other local filesystems..." +/bin/mount -a -v -tnonfs + + + +msg_green "Setting up hostname..." +/bin/hostname `cat /etc/hostname |cut -d . -f1` + + + + + + +if [ -f "/etc/random-seed" ]; then + msg_green "Initializing random number generator..." + /bin/cat /etc/random-seed >/dev/urandom + rm -f /etc/random-seed +fi + + + +msg_green "restoring mixer settings..." +/usr/sbin/alsactl restore + + +# removing stale PID files is good, too +msg_green "Removing stale PID files..." +/bin/rm /var/run/*.pid &> /dev/null +/bin/rm /etc/dhcpc/*.pid &> /dev/null + + + +msg_green "Loading keymap..." +/bin/loadkeys es &> /dev/null + + +msg_green "Setting console font..." +/usr/bin/setfont lat9u-12.psfu.g + + +msg_green "Setting keyboard rate (30) and delay (250)..." +/usr/bin/kbdrate -r 30 -d 250 + + +msg_green "Setting up Mouse(gpm)..." +gpm -m /dev/input/mice -t imps2 + + +### mplayer likes this... +msg_green "Configuring RTC..." +echo 1024 > /proc/sys/dev/rtc/max-user-freq + + +msg_green "Setting system time from hardware clock..." +# For UTC +#/sbin/hwclock --hctosys --utc +# For Localtime +/sbin/hwclock --hctosys --localtime + + + +### Use modules? If yes, uncomment this: +# echo "Updating module dependencies..." +# /sbin/depmod -a + +# Load Modules +if [ -f "/etc/modules" ]; then + msg_green "Loading modules..." + for i in $(cat /etc/modules) + do + modprobe $i + done +fi + + +### You may find this useful when you have some (non-networking) daemons +### and an extra .rc-file for them: +if [ -x /etc/rc.d/rc.daemons ]; then + /etc/rc.d/rc.daemons +fi diff --git a/extra-pkgs/DejaVuLGC-font-2.10.tar.bz2 b/extra-pkgs/DejaVuLGC-font-2.10.tar.bz2 new file mode 100644 index 0000000..a88153b Binary files /dev/null and b/extra-pkgs/DejaVuLGC-font-2.10.tar.bz2 differ diff --git a/extra-pkgs/PyOpenGL-2.0.2.01.tar.bz2 b/extra-pkgs/PyOpenGL-2.0.2.01.tar.bz2 new file mode 100644 index 0000000..0a8b725 Binary files /dev/null and b/extra-pkgs/PyOpenGL-2.0.2.01.tar.bz2 differ diff --git a/extra-pkgs/SDL_gfx-2.0.13.tar.bz2 b/extra-pkgs/SDL_gfx-2.0.13.tar.bz2 new file mode 100644 index 0000000..0aade81 Binary files /dev/null and b/extra-pkgs/SDL_gfx-2.0.13.tar.bz2 differ diff --git a/extra-pkgs/SDL_image-1.2.5.tar.bz2 b/extra-pkgs/SDL_image-1.2.5.tar.bz2 new file mode 100644 index 0000000..d77e66a Binary files /dev/null and b/extra-pkgs/SDL_image-1.2.5.tar.bz2 differ diff --git a/extra-pkgs/SDL_mixer-1.2.7.tar.bz2 b/extra-pkgs/SDL_mixer-1.2.7.tar.bz2 new file mode 100644 index 0000000..2c0fee6 Binary files /dev/null and b/extra-pkgs/SDL_mixer-1.2.7.tar.bz2 differ diff --git a/extra-pkgs/SDL_net-1.2.6.tar.bz2 b/extra-pkgs/SDL_net-1.2.6.tar.bz2 new file mode 100644 index 0000000..146b432 Binary files /dev/null and b/extra-pkgs/SDL_net-1.2.6.tar.bz2 differ diff --git a/extra-pkgs/SDL_ttf-2.0.8.tar.bz2 b/extra-pkgs/SDL_ttf-2.0.8.tar.bz2 new file mode 100644 index 0000000..c81b48e Binary files /dev/null and b/extra-pkgs/SDL_ttf-2.0.8.tar.bz2 differ diff --git a/extra-pkgs/URI-1.35.tar.bz2 b/extra-pkgs/URI-1.35.tar.bz2 new file mode 100644 index 0000000..998c5fe Binary files /dev/null and b/extra-pkgs/URI-1.35.tar.bz2 differ diff --git a/extra-pkgs/abiword-2.4.6.tar.bz2 b/extra-pkgs/abiword-2.4.6.tar.bz2 new file mode 100644 index 0000000..3dad6e7 Binary files /dev/null and b/extra-pkgs/abiword-2.4.6.tar.bz2 differ diff --git a/extra-pkgs/aircrack-ng-0.6.2.tar.bz2 b/extra-pkgs/aircrack-ng-0.6.2.tar.bz2 new file mode 100644 index 0000000..70180bb Binary files /dev/null and b/extra-pkgs/aircrack-ng-0.6.2.tar.bz2 differ diff --git a/extra-pkgs/aspell-0.60.4.tar.bz2 b/extra-pkgs/aspell-0.60.4.tar.bz2 new file mode 100644 index 0000000..8e269c7 Binary files /dev/null and b/extra-pkgs/aspell-0.60.4.tar.bz2 differ diff --git a/extra-pkgs/aspell-en-0.51-1.tar.bz2 b/extra-pkgs/aspell-en-0.51-1.tar.bz2 new file mode 100644 index 0000000..543672d Binary files /dev/null and b/extra-pkgs/aspell-en-0.51-1.tar.bz2 differ diff --git a/extra-pkgs/aspell-es-0.50-2.tar.bz2 b/extra-pkgs/aspell-es-0.50-2.tar.bz2 new file mode 100644 index 0000000..3437d30 Binary files /dev/null and b/extra-pkgs/aspell-es-0.50-2.tar.bz2 differ diff --git a/extra-pkgs/ati-driver-8.27.10.tar.bz2 b/extra-pkgs/ati-driver-8.27.10.tar.bz2 new file mode 100644 index 0000000..3c428ee Binary files /dev/null and b/extra-pkgs/ati-driver-8.27.10.tar.bz2 differ diff --git a/extra-pkgs/ati-driver-8.29.6.tar.bz2 b/extra-pkgs/ati-driver-8.29.6.tar.bz2 new file mode 100644 index 0000000..e40c0e8 Binary files /dev/null and b/extra-pkgs/ati-driver-8.29.6.tar.bz2 differ diff --git a/extra-pkgs/cal3d-0.11.0.tar.bz2 b/extra-pkgs/cal3d-0.11.0.tar.bz2 new file mode 100644 index 0000000..ed0f063 Binary files /dev/null and b/extra-pkgs/cal3d-0.11.0.tar.bz2 differ diff --git a/extra-pkgs/cdrtools-2.01.tar.bz2 b/extra-pkgs/cdrtools-2.01.tar.bz2 new file mode 100644 index 0000000..abc947d Binary files /dev/null and b/extra-pkgs/cdrtools-2.01.tar.bz2 differ diff --git a/extra-pkgs/cegui-0.5.0.tar.bz2 b/extra-pkgs/cegui-0.5.0.tar.bz2 new file mode 100644 index 0000000..b93a535 Binary files /dev/null and b/extra-pkgs/cegui-0.5.0.tar.bz2 differ diff --git a/extra-pkgs/clamav-0.88.7.tar.bz2 b/extra-pkgs/clamav-0.88.7.tar.bz2 new file mode 100644 index 0000000..2f50890 Binary files /dev/null and b/extra-pkgs/clamav-0.88.7.tar.bz2 differ diff --git a/extra-pkgs/dvd+rw-tools-6.1.tar.bz2 b/extra-pkgs/dvd+rw-tools-6.1.tar.bz2 new file mode 100644 index 0000000..a0b0cbe Binary files /dev/null and b/extra-pkgs/dvd+rw-tools-6.1.tar.bz2 differ diff --git a/extra-pkgs/emacs-20070210.tar.bz2 b/extra-pkgs/emacs-20070210.tar.bz2 new file mode 100644 index 0000000..3c2882a Binary files /dev/null and b/extra-pkgs/emacs-20070210.tar.bz2 differ diff --git a/extra-pkgs/enchant-1.3.0.tar.bz2 b/extra-pkgs/enchant-1.3.0.tar.bz2 new file mode 100644 index 0000000..6a1d3ef Binary files /dev/null and b/extra-pkgs/enchant-1.3.0.tar.bz2 differ diff --git a/extra-pkgs/fox-1.4.34.tar.bz2 b/extra-pkgs/fox-1.4.34.tar.bz2 new file mode 100644 index 0000000..4c48b32 Binary files /dev/null and b/extra-pkgs/fox-1.4.34.tar.bz2 differ diff --git a/extra-pkgs/fribidi-0.10.7.tar.bz2 b/extra-pkgs/fribidi-0.10.7.tar.bz2 new file mode 100644 index 0000000..001fffc Binary files /dev/null and b/extra-pkgs/fribidi-0.10.7.tar.bz2 differ diff --git a/extra-pkgs/gkrellm-2.2.9.tar.bz2 b/extra-pkgs/gkrellm-2.2.9.tar.bz2 new file mode 100644 index 0000000..7891bf8 Binary files /dev/null and b/extra-pkgs/gkrellm-2.2.9.tar.bz2 differ diff --git a/extra-pkgs/gnome-icon-theme-2.14.2.tar.bz2 b/extra-pkgs/gnome-icon-theme-2.14.2.tar.bz2 new file mode 100644 index 0000000..71bffae Binary files /dev/null and b/extra-pkgs/gnome-icon-theme-2.14.2.tar.bz2 differ diff --git a/extra-pkgs/gqview-2.0.1.tar.bz2 b/extra-pkgs/gqview-2.0.1.tar.bz2 new file mode 100644 index 0000000..1101e6f Binary files /dev/null and b/extra-pkgs/gqview-2.0.1.tar.bz2 differ diff --git a/extra-pkgs/hexedit-1.2.12.tar.bz2 b/extra-pkgs/hexedit-1.2.12.tar.bz2 new file mode 100644 index 0000000..50ff929 Binary files /dev/null and b/extra-pkgs/hexedit-1.2.12.tar.bz2 differ diff --git a/extra-pkgs/hicolor-icon-theme-0.9.tar.bz2 b/extra-pkgs/hicolor-icon-theme-0.9.tar.bz2 new file mode 100644 index 0000000..85a5a99 Binary files /dev/null and b/extra-pkgs/hicolor-icon-theme-0.9.tar.bz2 differ diff --git a/extra-pkgs/intltool-0.35.0.tar.bz2 b/extra-pkgs/intltool-0.35.0.tar.bz2 new file mode 100644 index 0000000..150edbf Binary files /dev/null and b/extra-pkgs/intltool-0.35.0.tar.bz2 differ diff --git a/extra-pkgs/jam-2.5.tar.bz2 b/extra-pkgs/jam-2.5.tar.bz2 new file mode 100644 index 0000000..96abfdd Binary files /dev/null and b/extra-pkgs/jam-2.5.tar.bz2 differ diff --git a/extra-pkgs/kismet-2006-04-R1.tar.bz2 b/extra-pkgs/kismet-2006-04-R1.tar.bz2 new file mode 100644 index 0000000..b0ae33e Binary files /dev/null and b/extra-pkgs/kismet-2006-04-R1.tar.bz2 differ diff --git a/extra-pkgs/libgnomecanvas-2.14.0.tar.bz2 b/extra-pkgs/libgnomecanvas-2.14.0.tar.bz2 new file mode 100644 index 0000000..2c20dd4 Binary files /dev/null and b/extra-pkgs/libgnomecanvas-2.14.0.tar.bz2 differ diff --git a/extra-pkgs/libgnomeprint-2.12.1.tar.bz2 b/extra-pkgs/libgnomeprint-2.12.1.tar.bz2 new file mode 100644 index 0000000..b0138f0 Binary files /dev/null and b/extra-pkgs/libgnomeprint-2.12.1.tar.bz2 differ diff --git a/extra-pkgs/libgnomeprintui-2.12.1.tar.bz2 b/extra-pkgs/libgnomeprintui-2.12.1.tar.bz2 new file mode 100644 index 0000000..a3bebb2 Binary files /dev/null and b/extra-pkgs/libgnomeprintui-2.12.1.tar.bz2 differ diff --git a/extra-pkgs/lua-5.1.1.tar.bz2 b/extra-pkgs/lua-5.1.1.tar.bz2 new file mode 100644 index 0000000..c632dbb Binary files /dev/null and b/extra-pkgs/lua-5.1.1.tar.bz2 differ diff --git a/extra-pkgs/mhwaveedit-1.4.10.tar.bz2 b/extra-pkgs/mhwaveedit-1.4.10.tar.bz2 new file mode 100644 index 0000000..b8ecee0 Binary files /dev/null and b/extra-pkgs/mhwaveedit-1.4.10.tar.bz2 differ diff --git a/extra-pkgs/mysql-5.0.21.tar.bz2 b/extra-pkgs/mysql-5.0.21.tar.bz2 new file mode 100644 index 0000000..6d31c46 Binary files /dev/null and b/extra-pkgs/mysql-5.0.21.tar.bz2 differ diff --git a/extra-pkgs/p7zip_4.43.tar.bz2 b/extra-pkgs/p7zip_4.43.tar.bz2 new file mode 100644 index 0000000..c6352dc Binary files /dev/null and b/extra-pkgs/p7zip_4.43.tar.bz2 differ diff --git a/extra-pkgs/pcre-6.7.tar.bz2 b/extra-pkgs/pcre-6.7.tar.bz2 new file mode 100644 index 0000000..3f49921 Binary files /dev/null and b/extra-pkgs/pcre-6.7.tar.bz2 differ diff --git a/extra-pkgs/physfs-1.1.0.tar.bz2 b/extra-pkgs/physfs-1.1.0.tar.bz2 new file mode 100644 index 0000000..66cb08c Binary files /dev/null and b/extra-pkgs/physfs-1.1.0.tar.bz2 differ diff --git a/extra-pkgs/popt-1.7.tar.bz2 b/extra-pkgs/popt-1.7.tar.bz2 new file mode 100644 index 0000000..dc9e858 Binary files /dev/null and b/extra-pkgs/popt-1.7.tar.bz2 differ diff --git a/extra-pkgs/pure-ftpd-1.0.21.tar.bz2 b/extra-pkgs/pure-ftpd-1.0.21.tar.bz2 new file mode 100644 index 0000000..1e838fd Binary files /dev/null and b/extra-pkgs/pure-ftpd-1.0.21.tar.bz2 differ diff --git a/extra-pkgs/pygame-1.7.1.tar.bz2 b/extra-pkgs/pygame-1.7.1.tar.bz2 new file mode 100644 index 0000000..b3e2a6e Binary files /dev/null and b/extra-pkgs/pygame-1.7.1.tar.bz2 differ diff --git a/extra-pkgs/python_PIL-1.1.5.tar.bz2 b/extra-pkgs/python_PIL-1.1.5.tar.bz2 new file mode 100644 index 0000000..426c73f Binary files /dev/null and b/extra-pkgs/python_PIL-1.1.5.tar.bz2 differ diff --git a/extra-pkgs/rpm2targz.tar.bz2 b/extra-pkgs/rpm2targz.tar.bz2 new file mode 100644 index 0000000..1e86ce2 Binary files /dev/null and b/extra-pkgs/rpm2targz.tar.bz2 differ diff --git a/extra-pkgs/tcl8.4.13.tar.bz2 b/extra-pkgs/tcl8.4.13.tar.bz2 new file mode 100644 index 0000000..f554fb4 Binary files /dev/null and b/extra-pkgs/tcl8.4.13.tar.bz2 differ diff --git a/extra-pkgs/thttpd-2.25b.tar.bz2 b/extra-pkgs/thttpd-2.25b.tar.bz2 new file mode 100644 index 0000000..0dfaf97 Binary files /dev/null and b/extra-pkgs/thttpd-2.25b.tar.bz2 differ diff --git a/extra-pkgs/tk8.4.13.tar.bz2 b/extra-pkgs/tk8.4.13.tar.bz2 new file mode 100644 index 0000000..ca1bc61 Binary files /dev/null and b/extra-pkgs/tk8.4.13.tar.bz2 differ diff --git a/extra-pkgs/transmission-0.6.1.tar.bz2 b/extra-pkgs/transmission-0.6.1.tar.bz2 new file mode 100644 index 0000000..da45b4c Binary files /dev/null and b/extra-pkgs/transmission-0.6.1.tar.bz2 differ diff --git a/extra-pkgs/vte-0.12.2.tar.bz2 b/extra-pkgs/vte-0.12.2.tar.bz2 new file mode 100644 index 0000000..d8e8dc9 Binary files /dev/null and b/extra-pkgs/vte-0.12.2.tar.bz2 differ diff --git a/extra-pkgs/which-2.16.tar.bz2 b/extra-pkgs/which-2.16.tar.bz2 new file mode 100644 index 0000000..7f115de Binary files /dev/null and b/extra-pkgs/which-2.16.tar.bz2 differ diff --git a/extra-pkgs/wine-0.9.19.tar.bz2 b/extra-pkgs/wine-0.9.19.tar.bz2 new file mode 100644 index 0000000..2e22319 Binary files /dev/null and b/extra-pkgs/wine-0.9.19.tar.bz2 differ diff --git a/extra-pkgs/xfe-0.88.tar.bz2 b/extra-pkgs/xfe-0.88.tar.bz2 new file mode 100644 index 0000000..04505f8 Binary files /dev/null and b/extra-pkgs/xfe-0.88.tar.bz2 differ diff --git a/extra-sources/CEGUI-0.5.0b.tar.gz b/extra-sources/CEGUI-0.5.0b.tar.gz new file mode 100644 index 0000000..5e74172 Binary files /dev/null and b/extra-sources/CEGUI-0.5.0b.tar.gz differ diff --git a/extra-sources/PyOpenGL-2.0.2.01.tar.gz b/extra-sources/PyOpenGL-2.0.2.01.tar.gz new file mode 100644 index 0000000..fe41571 Binary files /dev/null and b/extra-sources/PyOpenGL-2.0.2.01.tar.gz differ diff --git a/extra-sources/SDL_gfx-2.0.13.tar.gz b/extra-sources/SDL_gfx-2.0.13.tar.gz new file mode 100644 index 0000000..b775d8c Binary files /dev/null and b/extra-sources/SDL_gfx-2.0.13.tar.gz differ diff --git a/extra-sources/SDL_image-1.2.5.tar.gz b/extra-sources/SDL_image-1.2.5.tar.gz new file mode 100644 index 0000000..3d6954b Binary files /dev/null and b/extra-sources/SDL_image-1.2.5.tar.gz differ diff --git a/extra-sources/SDL_mixer-1.2.7.tar.gz b/extra-sources/SDL_mixer-1.2.7.tar.gz new file mode 100644 index 0000000..012faaa Binary files /dev/null and b/extra-sources/SDL_mixer-1.2.7.tar.gz differ diff --git a/extra-sources/SDL_net-1.2.6.tar.gz b/extra-sources/SDL_net-1.2.6.tar.gz new file mode 100644 index 0000000..5201f9a Binary files /dev/null and b/extra-sources/SDL_net-1.2.6.tar.gz differ diff --git a/extra-sources/SDL_ttf-2.0.8.tar.gz b/extra-sources/SDL_ttf-2.0.8.tar.gz new file mode 100644 index 0000000..abbbbd8 Binary files /dev/null and b/extra-sources/SDL_ttf-2.0.8.tar.gz differ diff --git a/extra-sources/Transmission-0.6.1.tar.gz b/extra-sources/Transmission-0.6.1.tar.gz new file mode 100644 index 0000000..977ce3e Binary files /dev/null and b/extra-sources/Transmission-0.6.1.tar.gz differ diff --git a/extra-sources/URI-1.35.tar.gz b/extra-sources/URI-1.35.tar.gz new file mode 100644 index 0000000..30cec67 Binary files /dev/null and b/extra-sources/URI-1.35.tar.gz differ diff --git a/extra-sources/abiword-2.4.6.tar.gz b/extra-sources/abiword-2.4.6.tar.gz new file mode 100644 index 0000000..11756fe Binary files /dev/null and b/extra-sources/abiword-2.4.6.tar.gz differ diff --git a/extra-sources/aircrack-ng-0.6.2.tar.gz b/extra-sources/aircrack-ng-0.6.2.tar.gz new file mode 100644 index 0000000..7dc70aa Binary files /dev/null and b/extra-sources/aircrack-ng-0.6.2.tar.gz differ diff --git a/extra-sources/aspell-0.60.4.tar.gz b/extra-sources/aspell-0.60.4.tar.gz new file mode 100644 index 0000000..b4e8fcf Binary files /dev/null and b/extra-sources/aspell-0.60.4.tar.gz differ diff --git a/extra-sources/aspell-en-0.51-1.tar.bz2 b/extra-sources/aspell-en-0.51-1.tar.bz2 new file mode 100644 index 0000000..42b4d8e Binary files /dev/null and b/extra-sources/aspell-en-0.51-1.tar.bz2 differ diff --git a/extra-sources/aspell-es-0.50-2.tar.bz2 b/extra-sources/aspell-es-0.50-2.tar.bz2 new file mode 100644 index 0000000..39d9d96 Binary files /dev/null and b/extra-sources/aspell-es-0.50-2.tar.bz2 differ diff --git a/extra-sources/cal3d-0.11.0.tar.gz b/extra-sources/cal3d-0.11.0.tar.gz new file mode 100644 index 0000000..37de9f5 Binary files /dev/null and b/extra-sources/cal3d-0.11.0.tar.gz differ diff --git a/extra-sources/cdrkit-1.0pre3.tar.gz b/extra-sources/cdrkit-1.0pre3.tar.gz new file mode 100644 index 0000000..55a243d Binary files /dev/null and b/extra-sources/cdrkit-1.0pre3.tar.gz differ diff --git a/extra-sources/cdrtools-2.01-ascii-2.patch b/extra-sources/cdrtools-2.01-ascii-2.patch new file mode 100644 index 0000000..6b6f22f --- /dev/null +++ b/extra-sources/cdrtools-2.01-ascii-2.patch @@ -0,0 +1,139 @@ +Submitted By: Alexander E. Patrakov +Date: 2006-06-05 +Initial Package Version: 2.01 +Upstream Status: Knows about a similar RedHat patch, ignores the issue +Origin: Alexander E. Patrakov; RedHat does something very similar + Modified by Andy Benton to fix an issue with it not applying properly +Description: Replaces hard-coded ISO-8859-1 with ASCII approximations +To regenerate: + +for F in cdrecord/cdrecord.c cdrecord/diskid.c cdrecord/sector.c \ + readcd/readcd.c scgcheck/scgcheck.c scgskeleton/skel.c ; do + LC_ALL=de_DE iconv -f ISO-8859-1 -t US-ASCII//TRANSLIT $F >tmp + mv tmp $F +done + +and remove hunks that modify comments. + +RedHat converts to UTF-8 instead, but this is unacceptable for LFS because +not everyone uses UTF-8 based locales. + +$Id: cdrtools-2.01-ascii-2.patch 1553 2006-06-05 12:05:57Z randy $ + + +diff -urN cdrtools-2.01.orig/cdrecord/cdrecord.c cdrtools-2.01/cdrecord/cdrecord.c +--- cdrtools-2.01.orig/cdrecord/cdrecord.c 2004-09-08 23:26:35.000000000 +0600 ++++ cdrtools-2.01/cdrecord/cdrecord.c 2006-02-13 10:17:29.000000000 +0500 +@@ -297,7 +297,7 @@ + * + * Warning: you are not allowed to modify or to remove the + * Copyright and version printing code below! +- * See also GPL § 2 subclause c) ++ * See also GPL paragraph 2 subclause c) + * + * If you modify cdrecord you need to include additional version + * printing code that: +@@ -349,7 +349,7 @@ + # define CLONE_TITLE "" + #endif + if ((flags & F_MSINFO) == 0 || lverbose || flags & F_VERSION) { +- printf("Cdrecord%s%s %s (%s-%s-%s) Copyright (C) 1995-2004 Jörg Schilling\n", ++ printf("Cdrecord%s%s %s (%s-%s-%s) Copyright (C) 1995-2004 Joerg Schilling\n", + PRODVD_TITLE, + CLONE_TITLE, + cdr_version, +@@ -1651,7 +1651,7 @@ + error("\t-xamix Subsequent tracks are CD-ROM XA mode 2 form 1/2 - 2332 bytes\n"); + error("\t-cdi Subsequent tracks are CDI tracks\n"); + error("\t-isosize Use iso9660 file system size for next data track\n"); +- error("\t-preemp Audio tracks are mastered with 50/15 µs preemphasis\n"); ++ error("\t-preemp Audio tracks are mastered with 50/15 us preemphasis\n"); + error("\t-nopreemp Audio tracks are mastered with no preemphasis (default)\n"); + error("\t-copy Audio tracks have unlimited copy permission\n"); + error("\t-nocopy Audio tracks may only be copied once for personal use (default)\n"); +diff -urN cdrtools-2.01.orig/cdrecord/diskid.c cdrtools-2.01/cdrecord/diskid.c +--- cdrtools-2.01.orig/cdrecord/diskid.c 2004-03-02 06:14:38.000000000 +0500 ++++ cdrtools-2.01/cdrecord/diskid.c 2006-02-13 10:17:35.000000000 +0500 +@@ -112,8 +112,8 @@ + LOCAL char m_grandadv[] = "Grand Advance Technology Ltd."; + LOCAL char m_digitalstor[] = "DIGITAL STORAGE TECHNOLOGY CO.,LTD"; + LOCAL char m_matsushita[] = "Matsushita Electric Industrial Co.,Ltd."; +-LOCAL char m_albrechts[] = "CDA Datenträger Albrechts GmbH."; +-LOCAL char m_xalbrechts[] = "??? CDA Datenträger Albrechts GmbH."; ++LOCAL char m_albrechts[] = "CDA Datentraeger Albrechts GmbH."; ++LOCAL char m_xalbrechts[] = "??? CDA Datentraeger Albrechts GmbH."; + + LOCAL char m_prodisc[] = "Prodisc Technology Inc."; + LOCAL char m_postech[] = "POSTECH Corporation"; +@@ -150,7 +150,7 @@ + {{97, 27, 00}, 81, "ILLEGAL OLD CODE: Old Ritek Co.???" }, + {{97, 27, 25}, 0, m_ill }, + {{97, 30, 00}, 0, m_ill }, +- {{97, 33, 00}, 82, "ILLEGAL OLD CODE: Old CDA Datenträger Albrechts GmbH." }, ++ {{97, 33, 00}, 82, "ILLEGAL OLD CODE: Old CDA Datentraeger Albrechts GmbH." }, + {{97, 35, 44}, 0, m_ill }, + {{97, 39, 00}, 0, m_ill }, + {{97, 45, 36}, 83, "ILLEGAL OLD CODE: Old Kodak Photo CD" }, + +diff -urN cdrtools-2.01.orig/cdrecord/sector.c cdrtools-2.01/cdrecord/sector.c +--- cdrtools-2.01.orig/cdrecord/sector.c 2004-03-01 14:19:13.000000000 +0500 ++++ cdrtools-2.01/cdrecord/sector.c 2006-02-13 10:17:36.000000000 +0500 +@@ -125,7 +125,7 @@ + break; + } + if (be_verbose) { +- printf("Encoding speed : %dx (%d sectors/s) for libedc from Heiko Eißfeldt\n", ++ printf("Encoding speed : %dx (%d sectors/s) for libedc from Heiko Eissfeldt\n", + (i+74)/75, i); + } + return ((i+74)/75); +diff -urN cdrtools-2.01.orig/readcd/readcd.c cdrtools-2.01/readcd/readcd.c +--- cdrtools-2.01.orig/readcd/readcd.c 2004-09-08 23:24:14.000000000 +0600 ++++ cdrtools-2.01/readcd/readcd.c 2006-02-13 10:17:37.000000000 +0500 +@@ -296,7 +296,7 @@ + if (help) + usage(0); + if (pversion) { +- printf("readcd %s (%s-%s-%s) Copyright (C) 1987, 1995-2003 Jörg Schilling\n", ++ printf("readcd %s (%s-%s-%s) Copyright (C) 1987, 1995-2003 Joerg Schilling\n", + cdr_version, + HOST_CPU, HOST_VENDOR, HOST_OS); + exit(0); +diff -urN cdrtools-2.01.orig/scgcheck/scgcheck.c cdrtools-2.01/scgcheck/scgcheck.c +--- cdrtools-2.01.orig/scgcheck/scgcheck.c 2004-09-08 23:49:48.000000000 +0600 ++++ cdrtools-2.01/scgcheck/scgcheck.c 2006-02-13 10:17:38.000000000 +0500 +@@ -129,7 +129,7 @@ + if (help) + usage(0); + if (pversion) { +- printf("scgckeck %s (%s-%s-%s) Copyright (C) 1998-2002 Jörg Schilling\n", ++ printf("scgckeck %s (%s-%s-%s) Copyright (C) 1998-2002 Joerg Schilling\n", + scgc_version, + HOST_CPU, HOST_VENDOR, HOST_OS); + exit(0); +@@ -153,11 +153,11 @@ + comerr("Cannot open logfile.\n"); + + printf("Scgcheck %s (%s-%s-%s) SCSI user level transport library ABI checker.\n\ +-Copyright (C) 1998,2001 Jörg Schilling\n", ++Copyright (C) 1998,2001 Joerg Schilling\n", + scgc_version, + HOST_CPU, HOST_VENDOR, HOST_OS); + fprintf(logfile, "Scgcheck %s (%s-%s-%s) SCSI user level transport library ABI checker.\n\ +-Copyright (C) 1998,2001 Jörg Schilling\n", ++Copyright (C) 1998,2001 Joerg Schilling\n", + scgc_version, + HOST_CPU, HOST_VENDOR, HOST_OS); + /* +diff -urN cdrtools-2.01.orig/scgskeleton/skel.c cdrtools-2.01/scgskeleton/skel.c +--- cdrtools-2.01.orig/scgskeleton/skel.c 2004-07-11 04:57:27.000000000 +0600 ++++ cdrtools-2.01/scgskeleton/skel.c 2006-02-13 10:17:39.000000000 +0500 +@@ -155,7 +155,7 @@ + if (help) + usage(0); + if (pversion) { +- printf("scgskeleton %s (%s-%s-%s) Copyright (C) 1987, 1995-2003 Jörg Schilling\n", ++ printf("scgskeleton %s (%s-%s-%s) Copyright (C) 1987, 1995-2003 Joerg Schilling\n", + skel_version, + HOST_CPU, HOST_VENDOR, HOST_OS); + exit(0); diff --git a/extra-sources/cdrtools-2.01-mkisofs_iconv-1.patch b/extra-sources/cdrtools-2.01-mkisofs_iconv-1.patch new file mode 100644 index 0000000..4f47533 --- /dev/null +++ b/extra-sources/cdrtools-2.01-mkisofs_iconv-1.patch @@ -0,0 +1,629 @@ +Submitted By: Alexander E. Patrakov +Date: 2005-09-30 +Initial Package Version: 2.01 +Origin: RedHat (but maybe they initially obtained the patch from elsewhere) +Upstream Status: Not applied +Description: Allows one to specify any glibc-supported source charset +for Joliet filenames, instead of the very limited choice offered by mkisofs +itself. Required for writing Windows-readable data CDs in UTF-8 locales when +filenames contain national characters. + +diff -urN --exclude-from=- cdrtools-2.01/include/unls.h cdrtools-2.01-jh/include/unls.h +--- cdrtools-2.01/include/unls.h 2003-06-16 00:41:23.000000000 +0300 ++++ cdrtools-2.01-jh/include/unls.h 2004-02-02 18:31:22.000000000 +0200 +@@ -30,6 +30,10 @@ + #include + #endif + ++#ifdef USE_ICONV ++#include ++#endif ++ + #ifdef __cplusplus + extern "C" { + #endif +@@ -43,6 +47,9 @@ + char *charset; + unsigned char **page_uni2charset; + struct nls_unicode *charset2uni; ++#ifdef USE_ICONV ++ iconv_t iconv_d; ++#endif + + void (*inc_use_count) __PR((void)); + void (*dec_use_count) __PR((void)); +@@ -58,6 +65,9 @@ + extern void unload_nls __PR((struct nls_table *)); + extern struct nls_table *load_nls_default __PR((void)); + extern int init_nls_file __PR((char * name)); ++#ifdef USE_ICONV ++extern int init_nls_iconv __PR((char * name)); ++#endif + + #ifdef __cplusplus + } +diff -urN --exclude-from=- cdrtools-2.01/libunls/libunls.mk cdrtools-2.01-jh/libunls/libunls.mk +--- cdrtools-2.01/libunls/libunls.mk 2000-03-25 14:51:56.000000000 +0200 ++++ cdrtools-2.01-jh/libunls/libunls.mk 2004-02-02 18:31:22.000000000 +0200 +@@ -8,6 +8,7 @@ + INSDIR= lib + TARGETLIB= unls + #CPPOPTS += -Istdio ++CPPOPTS += -DUSE_ICONV + include Targets + LIBS= + +diff -urN --exclude-from=- cdrtools-2.01/libunls/nls.h cdrtools-2.01-jh/libunls/nls.h +--- cdrtools-2.01/libunls/nls.h 2002-12-03 02:34:27.000000000 +0200 ++++ cdrtools-2.01-jh/libunls/nls.h 2004-02-02 18:31:22.000000000 +0200 +@@ -111,5 +111,8 @@ + extern int init_nls_cp10079 __PR((void)); + extern int init_nls_cp10081 __PR((void)); + extern int init_nls_file __PR((char * name)); ++#ifdef USE_ICONV ++extern int init_nls_iconv __PR((char * name)); ++#endif + + #endif /* _NLS_H */ +diff -urN --exclude-from=- cdrtools-2.01/libunls/nls_iconv.c cdrtools-2.01-jh/libunls/nls_iconv.c +--- cdrtools-2.01/libunls/nls_iconv.c 1970-01-01 02:00:00.000000000 +0200 ++++ cdrtools-2.01-jh/libunls/nls_iconv.c 2004-02-02 18:31:22.000000000 +0200 +@@ -0,0 +1,96 @@ ++/* @(#)nls_iconv.c 1.0 02/04/20 2002 J. Schilling */ ++#ifndef lint ++static char sccsid[] = ++ "@(#)nls_iconv.c 1.0 02/01/20 2002 J. Schilling"; ++#endif ++/* ++ * 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; see the file COPYING. If not, write to ++ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. ++ */ ++/* ++ * Modifications to make the code portable Copyright (c) 2000 J. Schilling ++ * ++ * nls_iconv: create a pseudo-charset table to use iconv() provided by C ++ * library or libiconv by Bruno Haible ++ * The Unicode to charset table has only exact mappings. ++ * ++ * ++ * Jungshik Shin (jshin@mailaps.org) 04-Feb-2002 ++ */ ++ ++#ifdef USE_ICONV ++#include ++#include ++#include ++#include ++#include "nls.h" ++#include ++ ++static void inc_use_count __PR((void)); ++static void dec_use_count __PR((void)); ++ ++ ++static void ++inc_use_count() ++{ ++ MOD_INC_USE_COUNT; ++} ++ ++static void ++dec_use_count() ++{ ++ MOD_DEC_USE_COUNT; ++} ++ ++int ++init_nls_iconv(charset) ++ char *charset; ++{ ++ iconv_t iconv_d; /* iconv conversion descriptor */ ++ struct nls_table *table; ++ ++ /* give up if no charset is given */ ++ if (charset == NULL) ++ return -1; ++ ++ /* see if we already have a table with this name - built in tables ++ have precedence over iconv() - i.e. can't have the name of an ++ existing table. Also, we may have already registered this file ++ table */ ++ if (find_nls(charset) != NULL) ++ return -1; ++ ++ if ((iconv_d = iconv_open("UCS-2BE", charset)) == (iconv_t) -1) ++ return -1; ++ ++ ++ /* set up the table */ ++ if ((table = (struct nls_table *)malloc(sizeof (struct nls_table))) ++ == NULL) { ++ return -1; ++ } ++ ++ /* give the table the file name, so we can find it again if needed */ ++ table->charset = strdup(charset); ++ table->iconv_d = iconv_d; ++ table->page_uni2charset = NULL; ++ table->charset2uni = NULL; ++ table->inc_use_count = inc_use_count; ++ table->dec_use_count = dec_use_count; ++ table->next = NULL; ++ ++ /* register the table */ ++ return register_nls(table); ++} ++#endif +diff -urN --exclude-from=- cdrtools-2.01/libunls/Targets cdrtools-2.01-jh/libunls/Targets +--- cdrtools-2.01/libunls/Targets 2002-12-03 02:34:27.000000000 +0200 ++++ cdrtools-2.01-jh/libunls/Targets 2004-02-02 18:31:22.000000000 +0200 +@@ -39,4 +39,5 @@ + nls_cp10029.c \ + nls_cp10079.c \ + nls_cp10081.c \ +- nls_file.c ++ nls_file.c \ ++ nls_iconv.c +diff -urN --exclude-from=- cdrtools-2.01/mkisofs/joliet.c cdrtools-2.01-jh/mkisofs/joliet.c +--- cdrtools-2.01/mkisofs/joliet.c 2003-04-28 01:36:08.000000000 +0300 ++++ cdrtools-2.01-jh/mkisofs/joliet.c 2004-02-03 14:15:17.000000000 +0200 +@@ -90,6 +90,11 @@ + #include /* For UNICODE translation */ + #include + ++#ifdef USE_ICONV ++#include ++#include ++#endif ++ + static Uint jpath_table_index; + static struct directory **jpathlist; + static int next_jpath_index = 1; +@@ -103,13 +108,23 @@ + }; + + #ifdef UDF +- void convert_to_unicode __PR((unsigned char *buffer, ++# ifdef USE_ICONV ++ size_t ++# else ++ void ++# endif ++ convert_to_unicode __PR((unsigned char *buffer, + int size, char *source, struct nls_table *inls)); +- int joliet_strlen __PR((const char *string)); ++ int joliet_strlen __PR((const char *string, struct nls_table *inls)); + #else +-static void convert_to_unicode __PR((unsigned char *buffer, ++# ifdef USE_ICONV ++ static size_t ++# else ++ static void ++#endif ++ convert_to_unicode __PR((unsigned char *buffer, + int size, char *source, struct nls_table *inls)); +-static int joliet_strlen __PR((const char *string)); ++static int joliet_strlen __PR((const char *string, struct nls_table *inls)); + #endif + static void get_joliet_vol_desc __PR((struct iso_primary_descriptor *jvol_desc)); + static void assign_joliet_directory_addresses __PR((struct directory *node)); +@@ -161,6 +176,20 @@ + if (inls == onls) + return (c); + ++#ifdef USE_ICONV ++ if(inls->charset2uni == NULL || onls->page_uni2charset == NULL) { ++ /* ++ * This shouldn't be reached ++ */ ++ static BOOL iconv_warned = FALSE; ++ if(!iconv_warned) { ++ error("Warning: Iconv conversion not supported in conv_charset.\n"); ++ iconv_warned = TRUE; ++ } ++ return (c); ++ } ++#endif ++ + /* get high and low UNICODE bytes */ + uh = inls->charset2uni[c].uni2; + ul = inls->charset2uni[c].uni1; +@@ -186,10 +215,18 @@ + * + * Notes: + */ +-#ifdef UDF +-void ++#ifdef USE_ICONV ++# if UDF ++size_t ++# else ++static size_t ++# endif + #else ++# if UDF ++void ++# else + static void ++# endif + #endif + convert_to_unicode(buffer, size, source, inls) + unsigned char *buffer; +@@ -216,6 +253,51 @@ + tmpbuf = (Uchar *) source; + } + ++#ifdef USE_ICONV ++ if (inls->iconv_d && inls->charset2uni==NULL && ++ inls->page_uni2charset==NULL) { ++ char *inptr = tmpbuf; ++ char *outptr = buffer; ++ size_t inleft = strlen(tmpbuf); ++ size_t inlen = inleft; ++ size_t outleft = size; ++ ++ iconv(inls->iconv_d, NULL, NULL, NULL, NULL); ++ if(iconv(inls->iconv_d, &inptr, &inleft, &outptr, &outleft) == ++ (size_t)-1 && errno == EILSEQ) { ++ fprintf(stderr, "Incorrectly encoded string (%s) " ++ "encountered.\nPossibly creating an invalid " ++ "Joliet extension. Aborting.\n", source); ++ exit(1); ++ } ++ ++ for (i = 0; (i + 1) < size - outleft; i += 2) { /* Size may be odd!!!*/ ++ if (buffer[i]=='\0') { ++ switch (buffer[i+1]) { /* Invalid characters for Joliet */ ++ case '*': ++ case '/': ++ case ':': ++ case ';': ++ case '?': ++ case '\\': ++ buffer[i+1]='_'; ++ default: ++ if (buffer[i+1] == 0x7f || ++ buffer[i+1] < 0x20) ++ buffer[i+1]='_'; ++ } ++ } ++ } ++ if (size & 1) { /* beautification */ ++ buffer[size - 1] = 0; ++ } ++ if (source == NULL) { ++ free(tmpbuf); ++ } ++ return (inlen - inleft); ++ } ++#endif ++ + /* + * Now start copying characters. If the size was specified to be 0, + * then assume the input was 0 terminated. +@@ -271,6 +353,9 @@ + if (source == NULL) { + free(tmpbuf); + } ++#ifdef USE_ICONV ++ return j; ++#endif + } + + /* +@@ -287,12 +372,50 @@ + #else + static int + #endif +-joliet_strlen(string) ++joliet_strlen(string, inls) + const char *string; ++ struct nls_table *inls; + { + int rtn; + ++#ifdef USE_ICONV ++ if (inls->iconv_d && inls->charset2uni==NULL && ++ inls->page_uni2charset==NULL) { ++ /* ++ * we const-cast since we're sure iconv won't change ++ * the string itself ++ */ ++ char *string_ptr = (char *)string; ++ size_t string_len = strlen(string); ++ ++ /* ++ * iconv has no way of finding out the required size ++ * in the target ++ */ ++ ++ char *tmp, *tmp_ptr; ++ /* we assume that the maximum length is 2 * jlen */ ++ size_t tmp_len = (size_t)jlen * 2 + 1; ++ tmp = e_malloc(tmp_len); ++ tmp_ptr = tmp; ++ ++ iconv(inls->iconv_d, NULL, NULL, NULL, NULL); ++ iconv(inls->iconv_d, &string_ptr, &string_len, &tmp_ptr, ++ &tmp_len); ++ ++ /* ++ * iconv advanced the tmp pointer with as many chars ++ * as it has written to it, so we add up the delta ++ */ ++ rtn = (tmp_ptr - tmp); ++ ++ free(tmp); ++ } else { ++ rtn = strlen(string) << 1; ++ } ++#else + rtn = strlen(string) << 1; ++#endif + + /* + * We do clamp the maximum length of a Joliet string to be the +@@ -480,16 +603,33 @@ + /* compare the Unicode names */ + + while (*rpnt && *lpnt) { ++#ifdef USE_ICONV ++ size_t ri, li; ++ ++ ri = convert_to_unicode(rtmp, 2, rpnt, rinls); ++ li = convert_to_unicode(ltmp, 2, lpnt, linls); ++ rpnt += ri; ++ lpnt += li; ++ if(!ri && !li) ++ return (0); ++ else if(ri && !li) ++ return (1); ++ else if(!ri && li) ++ return (-1); ++#else + convert_to_unicode(rtmp, 2, rpnt, rinls); + convert_to_unicode(ltmp, 2, lpnt, linls); ++#endif + + if (a_to_u_2_byte(rtmp) < a_to_u_2_byte(ltmp)) + return (-1); + if (a_to_u_2_byte(rtmp) > a_to_u_2_byte(ltmp)) + return (1); + ++#ifndef USE_ICONV + rpnt++; + lpnt++; ++#endif + } + + if (*rpnt) +@@ -574,10 +714,10 @@ + } + #ifdef APPLE_HYB + if (USE_MAC_NAME(de)) +- namelen = joliet_strlen(de->hfs_ent->name); ++ namelen = joliet_strlen(de->hfs_ent->name, hfs_inls); + else + #endif /* APPLE_HYB */ +- namelen = joliet_strlen(de->name); ++ namelen = joliet_strlen(de->name, in_nls); + + if (dpnt == root) { + jpath_table_l[jpath_table_index] = 1; +@@ -742,10 +882,10 @@ + #ifdef APPLE_HYB + /* Use the HFS name if it exists */ + if (USE_MAC_NAME(s_entry1)) +- cvt_len = joliet_strlen(s_entry1->hfs_ent->name); ++ cvt_len = joliet_strlen(s_entry1->hfs_ent->name, hfs_inls); + else + #endif /* APPLE_HYB */ +- cvt_len = joliet_strlen(s_entry1->name); ++ cvt_len = joliet_strlen(s_entry1->name, in_nls); + + /* + * Fix the record length +@@ -891,12 +1031,12 @@ + if (USE_MAC_NAME(s_entry)) + /* Use the HFS name if it exists */ + jpath_table_size += +- joliet_strlen(s_entry->hfs_ent->name) + ++ joliet_strlen(s_entry->hfs_ent->name, hfs_inls) + + offsetof(struct iso_path_table, name[0]); + else + #endif /* APPLE_HYB */ + jpath_table_size += +- joliet_strlen(s_entry->name) + ++ joliet_strlen(s_entry->name, in_nls) + + offsetof(struct iso_path_table, name[0]); + if (jpath_table_size & 1) { + jpath_table_size++; +@@ -918,13 +1058,13 @@ + /* Use the HFS name if it exists */ + s_entry->jreclen = + offsetof(struct iso_directory_record, name[0]) +- + joliet_strlen(s_entry->hfs_ent->name) ++ + joliet_strlen(s_entry->hfs_ent->name, hfs_inls) + + 1; + else + #endif /* APPLE_HYB */ + s_entry->jreclen = + offsetof(struct iso_directory_record, name[0]) +- + joliet_strlen(s_entry->name) ++ + joliet_strlen(s_entry->name, in_nls) + + 1; + } else { + /* +@@ -1072,6 +1212,9 @@ + #endif + + while (*rpnt && *lpnt) { ++#ifdef USE_ICONV ++ size_t ri, li; ++#endif + if (*rpnt == ';' && *lpnt != ';') + return (-1); + if (*rpnt != ';' && *lpnt == ';') +@@ -1092,16 +1235,32 @@ + return (1); + #endif + ++#ifdef USE_ICONV ++ ++ ri = convert_to_unicode(rtmp, 2, rpnt, rinls); ++ li = convert_to_unicode(ltmp, 2, lpnt, linls); ++ rpnt += ri; ++ lpnt += li; ++ if(!ri && !li) ++ return (0); ++ else if(ri && !li) ++ return (1); ++ else if(!ri && li) ++ return (-1); ++#else + convert_to_unicode(rtmp, 2, rpnt, rinls); + convert_to_unicode(ltmp, 2, lpnt, linls); ++#endif + + if (a_to_u_2_byte(rtmp) < a_to_u_2_byte(ltmp)) + return (-1); + if (a_to_u_2_byte(rtmp) > a_to_u_2_byte(ltmp)) + return (1); + ++#ifndef USE_ICONV + rpnt++; + lpnt++; ++#endif + } + if (*rpnt) + return (1); +diff -urN --exclude-from=- cdrtools-2.01/mkisofs/Makefile cdrtools-2.01-jh/mkisofs/Makefile +--- cdrtools-2.01/mkisofs/Makefile 2004-01-02 17:23:32.000000000 +0200 ++++ cdrtools-2.01-jh/mkisofs/Makefile 2004-02-02 18:31:22.000000000 +0200 +@@ -32,6 +32,7 @@ + CPPOPTS += -DUDF + CPPOPTS += -DDVD_VIDEO + CPPOPTS += -DSORTING ++CPPOPTS += -DUSE_ICONV + CPPOPTS += -I../libhfs_iso/ + CPPOPTS += -DHAVE_CONFIG_H -DUSE_LIBSCHILY -DUSE_SCG \ + '-DAPPID_DEFAULT="MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING"' \ +diff -urN --exclude-from=- cdrtools-2.01/mkisofs/mkisofs.c cdrtools-2.01-jh/mkisofs/mkisofs.c +--- cdrtools-2.01/mkisofs/mkisofs.c 2004-01-07 01:23:46.000000000 +0200 ++++ cdrtools-2.01-jh/mkisofs/mkisofs.c 2004-02-02 18:31:22.000000000 +0200 +@@ -59,6 +59,11 @@ + #endif + #endif /* no_more_needed */ + ++#ifdef USE_ICONV ++#include ++#include ++#endif ++ + struct directory *root = NULL; + int path_ind; + +@@ -223,6 +228,10 @@ + int do_sort = 0; /* sort file data */ + #endif /* SORTING */ + ++#ifdef USE_ICONV ++int iconv_possible; ++#endif ++ + struct nls_table *in_nls = NULL; /* input UNICODE conversion table */ + struct nls_table *out_nls = NULL; /* output UNICODE conversion table */ + #ifdef APPLE_HYB +@@ -2235,6 +2244,37 @@ + init_nls_file(hfs_ocharset); + #endif /* APPLE_HYB */ + ++#ifdef USE_ICONV ++ iconv_possible = !(iso9660_level >= 4 || ((ocharset && ++ strcmp(ocharset, icharset ? icharset : "")) && ++ use_RockRidge) || apple_ext || apple_hyb); ++ ++ setlocale(LC_CTYPE, ""); ++ ++ if (icharset == NULL && iconv_possible) { ++ char *charset = nl_langinfo(CODESET); ++ /* set to detected value but only if it is not pure US-ASCII */ ++ if(strcmp(charset, "ANSI_X3.4-1968") != 0) ++ icharset = charset; ++ ++ if(icharset && verbose > 0) ++ fprintf(stderr, "INFO:\t" ++ "%s character encoding detected by locale settings." ++ "\n\tAssuming %s encoded filenames on source " ++ "filesystem,\n" ++ "\tuse -input-charset to override.\n", ++ icharset, icharset); ++ } ++ ++ if(iconv_possible) { ++ /* ++ * don't care if initialization fails ++ */ ++ init_nls_iconv(icharset); ++ init_nls_iconv(ocharset); ++ } ++#endif ++ + if (icharset == NULL) { + #if (defined(__CYGWIN32__) || defined(__CYGWIN__)) && !defined(IS_CYGWIN_1) + in_nls = load_nls("cp437"); +@@ -2262,6 +2302,12 @@ + if (in_nls == NULL || out_nls == NULL) { /* Unknown charset specified */ + fprintf(stderr, "Unknown charset\nKnown charsets are:\n"); + list_nls(); /* List all known charset names */ ++#ifdef USE_ICONV ++ if(!iconv_possible) ++ fprintf(stderr, "Iconv charsets cannot be used with " ++ "Apple extension, HFS, ISO9660 version 2 or\n" ++ "Rock Ridge.\n"); ++#endif + exit(1); + } + +diff -urN --exclude-from=- cdrtools-2.01/mkisofs/mkisofs.h cdrtools-2.01-jh/mkisofs/mkisofs.h +--- cdrtools-2.01/mkisofs/mkisofs.h 2003-12-28 15:38:51.000000000 +0200 ++++ cdrtools-2.01-jh/mkisofs/mkisofs.h 2004-02-02 18:31:22.000000000 +0200 +@@ -501,9 +501,14 @@ + + /* joliet.c */ + #ifdef UDF ++# ifdef USE_ICONV ++extern size_t convert_to_unicode __PR((unsigned char *buffer, ++ int size, char *source, struct nls_table *inls)); ++# else + extern void convert_to_unicode __PR((unsigned char *buffer, + int size, char *source, struct nls_table *inls)); +-extern int joliet_strlen __PR((const char *string)); ++# endif ++extern int joliet_strlen __PR((const char *string, struct nls_table *inls)); + #endif + extern unsigned char conv_charset __PR((unsigned char, struct nls_table *, + struct nls_table *)); +diff -urN --exclude-from=- cdrtools-2.01/mkisofs/udf.c cdrtools-2.01-jh/mkisofs/udf.c +--- cdrtools-2.01/mkisofs/udf.c 2003-04-28 01:34:52.000000000 +0300 ++++ cdrtools-2.01-jh/mkisofs/udf.c 2004-02-02 18:31:22.000000000 +0200 +@@ -442,7 +442,7 @@ + int i; + int expanded_length; + +- expanded_length = joliet_strlen(src); ++ expanded_length = joliet_strlen(src, in_nls); + if (expanded_length > 1024) + expanded_length = 1024; + if (expanded_length > (dst_size-1)*2) diff --git a/extra-sources/cdrtools-2.01.tar.bz2 b/extra-sources/cdrtools-2.01.tar.bz2 new file mode 100644 index 0000000..59c70e2 Binary files /dev/null and b/extra-sources/cdrtools-2.01.tar.bz2 differ diff --git a/extra-sources/clamav-0.88.7.tar.gz b/extra-sources/clamav-0.88.7.tar.gz new file mode 100644 index 0000000..c5b88f9 Binary files /dev/null and b/extra-sources/clamav-0.88.7.tar.gz differ diff --git a/extra-sources/dejavu-lgc-ttf-2.10.tar.gz b/extra-sources/dejavu-lgc-ttf-2.10.tar.gz new file mode 100644 index 0000000..9a600fa Binary files /dev/null and b/extra-sources/dejavu-lgc-ttf-2.10.tar.gz differ diff --git a/extra-sources/dvd+rw-tools-6.1.tar.gz b/extra-sources/dvd+rw-tools-6.1.tar.gz new file mode 100644 index 0000000..1881535 Binary files /dev/null and b/extra-sources/dvd+rw-tools-6.1.tar.gz differ diff --git a/extra-sources/dvd+rw-tools-6.1/LICENSE b/extra-sources/dvd+rw-tools-6.1/LICENSE new file mode 100644 index 0000000..a43ea21 --- /dev/null +++ b/extra-sources/dvd+rw-tools-6.1/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, 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 + + Appendix: 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., 675 Mass Ave, Cambridge, MA 02139, 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. diff --git a/extra-sources/dvd+rw-tools-6.1/Makefile b/extra-sources/dvd+rw-tools-6.1/Makefile new file mode 100644 index 0000000..bf63efa --- /dev/null +++ b/extra-sources/dvd+rw-tools-6.1/Makefile @@ -0,0 +1,43 @@ +all: + @(m4 -DOS=`uname -s` Makefile.m4 | $(MAKE) -f - dvd+rw-tools) +install:# BSD make doesn't support wild-card targets:-( + @(m4 -DOS=`uname -s` Makefile.m4 | $(MAKE) -f - $@) +nothing:# dumb target +.%: # don't mess with Solaris .INIT/.DONE, ... +%: # ... but the rest just passes through + @(m4 -DOS=`uname -s` Makefile.m4 | $(MAKE) -f - $@) + +CHAIN=growisofs dvd+rw-format dvd+rw-booktype dvd+rw-mediainfo dvd-ram-control +clean: + -(rm *.o $(CHAIN) rpl8 btcflash; exit 0) < /dev/null > /dev/null 2>&1 + +VER=6.1 +DIST=dvd+rw-tools-$(VER) + +pkg: + [ -h $(DIST) ] || ln -s . $(DIST) + tar chf dvd+rw-tools-$(VER).tar \ + --owner=bin --group=bin \ + $(DIST)/Makefile \ + $(DIST)/Makefile.m4 \ + $(DIST)/dvd+rw-tools.spec \ + $(DIST)/growisofs.1 \ + $(DIST)/transport.hxx \ + $(DIST)/mp.h \ + $(DIST)/win32err.h \ + $(DIST)/growisofs.c \ + $(DIST)/growisofs_mmc.cpp \ + $(DIST)/dvd+rw-format.cpp \ + $(DIST)/dvd+rw-mediainfo.cpp \ + $(DIST)/dvd+rw-booktype.cpp \ + $(DIST)/dvd-ram-control.cpp \ + $(DIST)/rpl8.cpp \ + $(DIST)/btcflash.cpp \ + $(DIST)/LICENSE + if [ -f index.html ]; then \ + tar rhf dvd+rw-tools-$(VER).tar \ + --owner=bin --group=bin \ + $(DIST)/index.html; \ + fi + gzip -f dvd+rw-tools-$(VER).tar + rm $(DIST) diff --git a/extra-sources/dvd+rw-tools-6.1/Makefile.m4 b/extra-sources/dvd+rw-tools-6.1/Makefile.m4 new file mode 100644 index 0000000..061dfab --- /dev/null +++ b/extra-sources/dvd+rw-tools-6.1/Makefile.m4 @@ -0,0 +1,218 @@ +# OBS! M4 processed! +changequote([, ]) +[ +CHAIN=growisofs dvd+rw-format dvd+rw-booktype dvd+rw-mediainfo dvd-ram-control + +dvd+rw-tools: $(CHAIN) + +WARN=#-Wall # developers are welcomed to build with `make WARN=-Wall' +] + +# fix-up OS macro +ifelse(substr(OS,0,7),[CYGWIN_],[define([OS],[MINGW32])]) +ifelse(substr(OS,0,7),[MINGW32],[define([OS],[MINGW32])]) +ifelse(OS,NetBSD,[define([OS],[BSD])CXXFLAGS+=-D__unix]) +ifelse(OS,OpenBSD,[define([OS],[BSD])]) +ifelse(OS,FreeBSD,[define([OS],[BSD])LDLIBS=-lcam]) +ifelse(OS,IRIX64,[define([OS],[IRIX])]) + +ifelse(OS,MINGW32,[ +# +# MINGW section +# +CC =gcc +CFLAGS +=$(WARN) -mno-cygwin -O2 +CXX =g++ +CXXFLAGS+=$(WARN) -mno-cygwin -O2 -fno-exceptions +LINK.o =$(LINK.cc) +]) + +ifelse(OS,BSD,[ +# +# OpenBSD/NetBSD/FreeBSD section +# +CC ?=gcc +CFLAGS +=$(WARN) -O2 -pthread -D_THREAD_SAFE -D_REENTRANT +CXX ?=g++ +CXXFLAGS+=$(WARN) -O2 -fno-exceptions -pthread -D_THREAS_SAFE -D_REENTRANT + +.SUFFIXES: .c .cpp .o + +.c.o: + $(CC) $(CFLAGS) -c -o $@ $< +.cpp.o: + $(CXX) $(CXXFLAGS) -c -o $@ $< +.o: # try to please both BSD vv&vv GNU make at the same time... + $(CXX) $(CXXFLAGS) -o $@ $> $^ $(LDFLAGS) $(LDLIBS) + +# yes, default is set-root-uid, `make BIN_MODE=0755 install' to override... +BIN_MODE?=04755 +install: dvd+rw-tools + install -o root -m $(BIN_MODE) $(CHAIN) /usr/local/bin + install -o root -m 0644 growisofs.1 /usr/local/man/man1 +]) + +ifelse(OS,SunOS,[ +# +# Solaris section +# +.SUFFIXES: .c .cpp .o + +# check for WorkShop C++ +syscmd([(CC -flags) > /dev/null 2>&1]) +ifelse(sysval,0,[ +CC =cc +CFLAGS =-O -xstrconst -w -D_REENTRANT +CXX =CC +CXXFLAGS=-O -features=no%except,conststrings -w -D_REENTRANT +],[ +CC =gcc +CFLAGS =$(WARN) -O2 -D_REENTRANT +CXX =g++ +CXXFLAGS=$(WARN) -O2 -fno-exceptions -D_REENTRANT +]) + +LDLIBS=-lvolmgt -lrt -lpthread + +.c.o: + $(CC) $(CFLAGS) -c -o $@ $< +.cpp.o: + $(CXX) $(CXXFLAGS) -c -o $@ $< +%: %.o + $(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) + +install: dvd+rw-tools + install -o root -m 04755 $(CHAIN) /usr/local/bin + install -o root -m 0644 growisofs.1 /usr/local/man/man1 +]) + +ifelse(OS,HP-UX,[ +# +# HP-UX section +# +.SUFFIXES: .c .cpp .o + +# check for HP C++ +syscmd([(aCC -E /dev/null) > /dev/null 2>&1]) +ifelse(sysval,0,[ +# run `make TARGET_ARCH=+DD64' for 64-bit build... +# ... or should we check for `getconf KERNEL_BITS' and/or CPU_VERSION? +# syscmd([([ `getconf KERNEL_BITS` -eq 64 ]) > /dev/null 2>&1]) +CC =cc +CFLAGS =$(TARGET_ARCH) -O -D_REENTRANT +CXX =aCC +CXXFLAGS=$(TARGET_ARCH) -O +noeh -D_REENTRANT +],[ +CC =gcc +CFLAGS =$(WARN) -O2 -D_REENTRANT +CXX =g++ +CXXFLAGS=$(WARN) -O2 -fno-exceptions -D_REENTRANT +]) +LDLIBS=-lrt -lpthread + +.c.o: + $(CC) $(CFLAGS) \ + -DSCTL_MAJOR=`/usr/sbin/lsdev -h -d sctl | awk '{print$$1}'` \ + -c -o $@ $< +.cpp.o: + $(CXX) $(CXXFLAGS) -c -o $@ $< +.o: # try to please both BSD vv&vv GNU make at the same time... + $(CXX) $(CXXFLAGS) -o $@ $> $^ $(LDFLAGS) $(LDLIBS) + +install: dvd+rw-tools + /usr/sbin/install -o -f /usr/local/bin $(CHAIN) + /usr/sbin/install -o -f /usr/local/man/man1 growisofs.1 +]) + +ifelse(OS,IRIX,[ +# +# IRIX section +# +.SUFFIXES: .c .cpp .o + +# check for MIPSpro compiler +syscmd([(CC -version) > /dev/null 2>&1]) +ifelse(sysval,0,[ +CC =cc +CFLAGS =$(WARN) -O -use_readonly_const -D_SGI_MP_SOURCE +CXX =CC +CXXFLAGS=$(WARN) -O -OPT:Olimit=0 -use_readonly_const -LANG:exceptions=OFF -D_SGI_MP_SOURCE + +],[ +CC =gcc +CFLAGS =$(WARN) -O2 -D_SGI_MP_SOURCE +CXX =g++ +CXXFLAGS=$(WARN) -O2 -fno-exceptions -D_SGI_MP_SOURCE +]) + +LDLIBS=-lmediad -lpthread +LDFLAGS=-dont_warn_unused + +.c.o: + $(CC) $(CFLAGS) -c -o $@ $< +.cpp.o: + $(CXX) $(CXXFLAGS) -c -o $@ $< +.o: + $(CXX) $(CXXFLAGS) -o $@ $> $^ $(LDFLAGS) $(LDLIBS) + +BIN_MODE=04755 # set-root-uid +install: dvd+rw-tools + /sbin/install -u root -m $(BIN_MODE) $(CHAIN) /usr/local/bin + /sbin/install -u root -m 0644 growisofs.1 /usr/local/man/man1 +]) + +ifelse(OS,Linux,[ +# +# Linux section +# +CC =gcc +CFLAGS +=$(WARN) -O2 -D_REENTRANT +CXX =g++ +CXXFLAGS+=$(WARN) -O2 -fno-exceptions -D_REENTRANT +LDLIBS =-lpthread +LINK.o =$(LINK.cc) + +prefix?=/usr/local +manprefix?=$(shell case $(prefix) in (*/usr/?*) echo $(prefix)/man ;; (*) echo $(prefix)/share/man ;; esac) + +bin_mode?=0755 # yes, default is *no* set-uid +minus_o:=$(shell [[ `id -u` == 0 ]] && echo "-o root") + +install: dvd+rw-tools + [[ -d $(prefix)/bin ]] || mkdir -p $(prefix)/bin + install $(minus_o) -m $(bin_mode) $(CHAIN) $(prefix)/bin + [[ -d $(manprefix)/man1 ]] || mkdir -p $(manprefix)/man1 + install $(minus_o) -m 0644 growisofs.1 $(manprefix)/man1 + [[ -f rpl8 ]] && \ + install $(minus_o) -m $(bin_mode) rpl8 $(prefix)/bin + [[ -f btcflash ]] && \ + install $(minus_o) -m $(bin_mode) btcflash $(prefix)/bin +]) + +# common section +[ +growisofs: growisofs_mmc.o growisofs.o +growisofs.o: growisofs.c mp.h +growisofs_mmc.o: growisofs_mmc.cpp transport.hxx + +dvd+rw-format: dvd+rw-format.o +dvd+rw-format.o: dvd+rw-format.cpp transport.hxx + +dvd+rw-mediainfo: dvd+rw-mediainfo.o +dvd+rw-mediainfo.o: dvd+rw-mediainfo.cpp transport.hxx + +dvd+rw-booktype: dvd+rw-booktype.o +dvd+rw-booktype.o: dvd+rw-booktype.cpp transport.hxx + +dvd-ram-control: dvd-ram-control.o +dvd-ram-control.o: dvd-ram-control.cpp transport.hxx + +rpl8: rpl8.o +rpl8.o: rpl8.cpp transport.hxx ++rpl8: rpl8 +#so that I can invoke `make +rpl8' to build rpl8... +btcflash: btcflash.o +btcflash.o: btcflash.cpp transport.hxx ++btcflash: btcflash +#so that I can invoke `make +btcflash' to build btcflash... +] diff --git a/extra-sources/dvd+rw-tools-6.1/btcflash.cpp b/extra-sources/dvd+rw-tools-6.1/btcflash.cpp new file mode 100644 index 0000000..2fcdc8e --- /dev/null +++ b/extra-sources/dvd+rw-tools-6.1/btcflash.cpp @@ -0,0 +1,326 @@ +/* + * Firmware flash utility for BTC DRW1008 DVD+/-RW recorder + * Version 2004/04/29 + * By David Huang + * This work is dedicated to the public domain + * + * This utility may also work with other BTC DVD recorders, such as + * the DRW1004 and DRW1108, but they have not been tested. + * + * USE AT YOUR OWN RISK! + * btcflash is provided AS IS, with NO WARRANTY, either expressed or implied. + * + * Requires "transport.hxx" from Andy Polyakov's DVD+RW tools: + * http://fy.chalmers.se/~appro/linux/DVD+RW/tools/ + * If obtained as part of dvd+rw-tools it can be built with + * 'make +btcflash'. + * + * Firmware files may be obtained by running BTC's Windows flash + * utility, then searching in the WINDOWS\TEMP or WINNT\TEMP directory + * for a *.HEX file. It will probably be in a subdirectory named + * PAC*.tmp.DIR, and the HEX file will be named Vnnnn.HEX, where nnnn + * is the firmware version number. You'll also find IDEFLASH.EXE or + * BTCFLASH.EXE in the same directory. + * + * This utility will also accept firmware files in ".BIN" format. + */ + +#include +#include +#include +#include + +#include "transport.hxx" + +const unsigned int FLASHSIZE = 0x100000; /* BTC flash is 1MB */ + +unsigned char *loadfirmware(const char *); +int getbyte(char *&); +unsigned short calcsum(unsigned char *); + +unsigned char * +loadfirmware(const char *firmware) +{ + FILE *f; + char line[80], *p; + unsigned char *fwbuf; + int bank, length, offset, type, hexsum; + int i, b; + + fwbuf = new unsigned char[FLASHSIZE]; + if (!fwbuf) { + fprintf(stderr, "Could not allocate memory for firmware\n"); + return NULL; + } + + f = fopen(firmware, "r"); + if (!f) { + fprintf(stderr, "%s: Unable to open: ", firmware); + perror(NULL); + return NULL; + } + + // Get length of file. If it's exactly FLASHSIZE, assume it's a + // .bin file. Otherwise, try to read it as a .hex file. + fseek(f, 0, SEEK_END); + if (ftell(f) == FLASHSIZE) { + rewind(f); + if (fread(fwbuf, 1, FLASHSIZE, f) != FLASHSIZE) { + fprintf(stderr, "%s: Short read\n", firmware); + return NULL; + } + fclose(f); + return fwbuf; + } + + rewind(f); + memset(fwbuf, 0xff, FLASHSIZE); + + bank = 0; + while (fgets(line, sizeof(line), f)) { + if (line[0] != ':') + continue; + + p = line + 1; + + length = getbyte(p); + offset = getbyte(p) << 8 | getbyte(p); + type = getbyte(p); + if (length < 0 || offset < 0 || type < 0 || + (type != 0 && length != 0)) { + fprintf(stderr, "Malformed line: %s", line); + return NULL; + } else if (length == 0) { + if (strncmp(line, ":00000155AA", 11) == 0) { + if (++bank >= 16) { + fprintf(stderr, + "Firmware file larger than 1MB\n"); + return NULL; + } + continue; + } else if (strncmp(line, ":00000001FF", 11) == 0) + break; + else { + fprintf(stderr, "Malformed line: %s", line); + return NULL; + } + } + + hexsum = (length + (offset >> 8) + (offset & 0xff)) & 0xff; + for (i = 0; i < length; i++, offset++) { + b = getbyte(p); + hexsum = (hexsum + b) & 0xff; + if (b < 0) { + fprintf(stderr, "Short line: %s", line); + return NULL; + } + fwbuf[(bank << 16) | offset] = (char)b; + } + hexsum = (0x100 - hexsum) & 0xff; + if (hexsum != getbyte(p)) { + fprintf(stderr, "Checksum mismatch: %s", line); + return NULL; + } + + } + + fclose(f); + + if (bank != 15) { + fprintf(stderr, "Firmware file too small\n"); + return NULL; + } + + return fwbuf; +} + +int +getbyte(char *&p) +{ + int h, l; + + h = *p; + if (h >= '0' && h <= '9') + h -= '0'; + else if (h >= 'A' && h <= 'F') + h -= 'A' - 10; + else if (h >= 'a' && h <= 'f') + h -= 'a' - 10; + else + return -1; + + l = *(p+1); + if (l >= '0' && l <= '9') + l -= '0'; + else if (l >= 'A' && l <= 'F') + l -= 'A' - 10; + else if (l >= 'a' && l <= 'f') + l -= 'a' - 10; + else + return -1; + + p += 2; + return (h << 4) | l; +} + +unsigned short +calcsum(unsigned char *fwbuf) +{ + unsigned int flashsum, i; + + for(flashsum = 0, i = 0; i < FLASHSIZE; i++) + flashsum += fwbuf[i]; + + return (flashsum & 0xffff); +} + +int main(int argc, char *argv[]) +{ + const char *fwfile; + char confirm[5]; + unsigned char *fwbuf, inq[128], csbuf[32]; + unsigned short checksum; + Scsi_Command cmd; + int err; + unsigned int offset; + + if (argc < 3) { + fprintf(stderr, "Usage: %s /dev/cdrom firmware\n", + argv[0]); + return 1; + } + + printf("BTC DVD+/-RW firmware flash utility 2004/04/29\n"); + printf("USE AT YOUR OWN RISK!\n\n"); + + if (!cmd.associate(argv[1])) { + fprintf(stderr, "%s: unable to open: ", argv[1]); + perror (NULL); + return 1; + } + + fwfile = argv[2]; + + if (!(fwbuf = loadfirmware(fwfile))) + return 1; + + checksum = calcsum(fwbuf); + + printf("Loaded firmware from %s\nFirmware checksum is %04X\n", + fwfile, checksum); + + cmd[0] = 0x12; // INQUIRY + cmd[4] = 36; + cmd[5] = 0; + if (err = cmd.transport(READ, inq, 36)) { + sperror("INQUIRY", err); + return 1; + } + + printf("Drive is currently: [%.8s][%.16s][%.4s]\n", + inq+8, inq+16, inq+32); + printf("Firmware appears to be: [%.8s][%.16s][%.4s]\n\n", + fwbuf+0x40bc, fwbuf+0x40c4, fwbuf+0x40d4); + + if (strncmp((char*)inq + 8, (char*)fwbuf + 0x40bc, 24) != 0) + printf( + "***********************************************" + "***********\n" + "WARNING! THIS FIRMWARE DOES NOT SEEM TO BE FOR " + "THIS DRIVE!\n" + "***********************************************" + "***********\n"); + + printf("Type \"YES\" to proceed with flash: "); + fflush(stdout); + fgets(confirm, sizeof(confirm), stdin); + if (strcmp(confirm, "YES\n") != 0) { + printf("\nFlash canceled.\n"); + return 0; + } + + printf("\nUploading firmware...\n"); + + // Upload firmware + for (offset = 0; offset < FLASHSIZE; offset += 0x1000) { + cmd[0] = 0x3B; // WRITE BUFFER + cmd[1] = 6; // Download Microcode with Offsets + cmd[2] = 0; // Buffer ID 0 + cmd[3] = (offset >> 16) & 0xff; + cmd[4] = (offset >> 8) & 0xff; + cmd[5] = 0x20; + cmd[6] = 0; // Length 0x1000 + cmd[7] = 0x10; + cmd[8] = 0; + cmd[9] = 0; + if (err = cmd.transport(WRITE, fwbuf + offset, 0x1000)) { + sperror("WRITE BUFFER[1]", err); + return 1; + } + } + + // Upload checksum + memset(csbuf, 0, 32); + csbuf[30] = (checksum >> 8); + csbuf[31] = (checksum & 0xff); + cmd[0] = 0x3B; // WRITE BUFFER + cmd[1] = 6; // Download Microcode with Offsets + cmd[2] = 0; // Buffer ID 0 + cmd[3] = 0; // Offset 0 + cmd[4] = 0; + cmd[5] = 0; + cmd[6] = 0; // Length 0x20 + cmd[7] = 0; + cmd[8] = 0x20; + cmd[9] = 0; + if (err = cmd.transport(WRITE, csbuf, 0x20)) { + sperror("WRITE BUFFER[2]", err); + return 1; + } + + printf("Flashing drive...\n"); + + // Firmware uploaded; now flash it! + cmd[0] = 0x3B; // WRITE BUFFER + cmd[1] = 7; // Download Microcode with Offsets and Save + cmd[2] = 0; // Buffer ID 0 + cmd[3] = 0; // Offset 0 + cmd[4] = 0; + cmd[5] = 0; + cmd[6] = 0; // Length 0 + cmd[7] = 0; + cmd[8] = 0; + cmd[9] = 0; + if (err = cmd.transport()) { + sperror("WRITE BUFFER[3]", err); + return 1; + } + + sleep(50); // Let drive sit for a while before bothering it + + while (1) { + sleep(1); + cmd[0] = 0; // TEST UNIT READY + cmd[5] = 0; + err = cmd.transport(); + + // Wait until it returns either ready or + // not ready/medium not present + if ((err == 0) || (SK(err) == 2 && ASC(err) == 0x3A)) + break; + } + + cmd[0] = 0x12; // INQUIRY + cmd[4] = 36; + cmd[5] = 0; + if (err = cmd.transport(READ, inq, 36)) { + sperror("INQUIRY[2]", err); + return 1; + } + + printf("Drive is now: [%.8s][%.16s][%.4s]\n\n", + inq+8, inq+16, inq+32); + printf("Please reboot before using the drive.\n"); + + return 0; +} diff --git a/extra-sources/dvd+rw-tools-6.1/dvd+rw-booktype b/extra-sources/dvd+rw-tools-6.1/dvd+rw-booktype new file mode 100644 index 0000000..93d19db Binary files /dev/null and b/extra-sources/dvd+rw-tools-6.1/dvd+rw-booktype differ diff --git a/extra-sources/dvd+rw-tools-6.1/dvd+rw-booktype.cpp b/extra-sources/dvd+rw-tools-6.1/dvd+rw-booktype.cpp new file mode 100644 index 0000000..8454c59 --- /dev/null +++ b/extra-sources/dvd+rw-tools-6.1/dvd+rw-booktype.cpp @@ -0,0 +1,831 @@ +#if 0 +# +# Utility for manipulating Book Type Field of Physical Format Descriptor +# located in lead-in of DVD+RW media. This is 9th version. 2nd version +# added initial support for 2nd generation DVD+RW drives. 3rd version +# adds support for DVD+R unit settings. 4th version checks if the unit +# is of RICOH design and reliably recognizes drive generation. 5th +# version adds support for Benq derivatives. 6th version fixes problem +# with USB connected units? 7th version adds support for BTC units. +# 8th version fixes typos in BTC support, adds support for fraudulent +# NEC firmwares and Lite-On based units. 9th version adds support for +# LG, Plextor and dual-format and double-layer Benq units. Keep in mind +# that booktyping support might appear in certain firmware revisions, +# not necessarily all. +# +# The code is in public domain. +# +# See http://www.dvdplusrw.org/resources/bitsettings.html +# for further details. +# +/bin/sh << EOS +MODNAME=\`expr "/$0" : '\(.*[^/]\)/*$' : '.*/\(..*\)' : '\(.*\)\..*$'\` +case "`uname -s`" in +SunOS) (set -x; g++ -fno-exceptions -O -o \$MODNAME "$0" -lvolmgt) ;; +*) (set -x; g++ -fno-exceptions -O -o \$MODNAME "$0") ;; +esac +EOS +exit +#endif + +#include +#include +#include +#include + +#include "transport.hxx" + +#define OPT_MEDIA 0x01 +#define OPT_UNIT 0x02 +#define OPT_UNITRW 0x03 +#define OPT_UNITR 0x04 +#define OPT_MASK 0x0F +#define OPT_INQ 0x10 +#define INTERNAL_RELOAD 0x20 + +unsigned short profile; +const char *dev; + +const char *bookname (unsigned char book,char *unknown=NULL) +{ const char *ret; + + switch(book&0xF0) + { case 0x00: ret="-ROM"; break; + case 0x10: ret="-RAM"; break; + case 0x20: ret="-R"; break; + case 0x30: ret="-RW"; break; + case 0x90: ret="+RW"; break; + case 0xA0: ret="+R"; break; + case 0xE0: ret="+R DL"; break; + default: ret=NULL; + if (unknown) sprintf (unknown,"?%02X",book&0xFF); + break; + } + + return ret; +} + +int mediainfo (Scsi_Command &cmd) +{ unsigned char buf[8],book; + const char *brand; + int err; + + cmd[0]=0xAD; // READ DVD STRUCTURE + cmd[9]=sizeof(buf); + cmd[11]=0; + if ((err=cmd.transport(READ,buf,sizeof(buf)))) + { sperror ("READ DVD STRUCTURE#0",err); + return 1; + } + + book=buf[4]; + brand=bookname (book); + + printf ("Current media Book Type Field is %02xh: ",book); + if (brand) printf ("DVD%s specification [revision %d]\n", + brand,book&0xF); + else printf ("unrecognized value\n"); + + return 0; +} + +int ricoh (Scsi_Command &cmd,int action,int book,int gen=2) +{ int err,cnt=0; + unsigned char buf[6]; + const char *brand; + char unknown [16]="?unknown"; + + switch (action) + { case OPT_INQ|OPT_MEDIA: + break; + case OPT_INQ: + case OPT_INQ|OPT_UNIT: + if (gen==1) goto inq_unitrw; + cmd[0]=0xFA; + cmd[1]=0x10; + cmd[8]=sizeof(buf); + cmd[11]=0; + if (!cmd.transport(READ,buf,sizeof(buf))) + { brand = bookname (buf[4],unknown), + printf ("The unit will brand DVD+R media as DVD%s\n", + brand?brand:unknown), + cnt++; + } + case OPT_INQ|OPT_UNITRW: + inq_unitrw: + cmd[0]=0xFA; + cmd[1]=0x00; + cmd[8]=sizeof(buf); + cmd[11]=0; + if (!cmd.transport(READ,buf,sizeof(buf))) + { brand = bookname (buf[4],unknown), + printf ("The unit will format DVD+RW media as DVD%s\n", + brand?brand:unknown), + cnt++; + } + if (cnt==0) + printf ("Unable to determine unit settings. " + "Default settings vary from\n" + "firmware to firmware. Set " + "explicitly to be certain.\n"); + break; + case OPT_INQ|OPT_UNITR: + if (gen==1) + { fprintf (stderr,":-( not applicable to 1st gen unit\n"); + return 1; + } + cmd[0]=0xFA; + cmd[1]=0x10; + cmd[8]=sizeof(buf); + cmd[11]=0; + if (!cmd.transport(READ,buf,sizeof(buf))) + { brand = bookname (buf[4],unknown), + printf ("The unit will brand DVD+R media as DVD%s\n", + brand?brand:unknown); + } + break; + case OPT_MEDIA: + if (profile!=0x1A) + { fprintf (stderr,":-( action is applicable to DVD+RW only\n"); + break; + } + if (book != 0x92 && book != 0x01) + { fprintf (stderr,":-( BookType#%02x is not applicable\n",book); + break; + } + cmd[0]=0xF9; + cmd[1]=0x02; + cmd[2]=book; + cmd[3]=(gen==1?0:0xFF); + cmd[11]=0; + if ((err=cmd.transport())) + return sperror("RICOH_F9h(2)",err),1; + else + return mediainfo(cmd); + break; + case OPT_UNIT: + if (profile==0x1B || profile==0x2B) goto set_unitr; + case OPT_UNITRW: + if (book != 0x92 && book != 0x01) + { fprintf (stderr,":-( BookType#%02x is not applicable\n",book); + break; + } + cmd[0]=0xF9; + cmd[1]=(gen==1?0x01:0x0C); + cmd[2]=book; + cmd[3]=(gen==1?0:0xFF); + cmd[11]=0; + if ((err=cmd.transport())) + sperror (gen==1?"RICOH(1)":"RICOH(0Ch)",err); + else + printf ("Unit was instructed to format DVD+RW as DVD%s\n", + book==0x01?"-ROM":"+RW"); + break; + case OPT_UNITR: + set_unitr: + if (gen==1) + { fprintf (stderr,":-( not applicable to 1st gen unit\n"); + return 1; + } + if (book != 0xA1 && book != 0x01) + { fprintf (stderr,":-( BookType#%02x is not applicable\n",book); + break; + } + cmd[0]=0xF9; + cmd[1]=0x14; + cmd[2]=book; + cmd[3]=0xFF; + cmd[11]=0; + if ((err=cmd.transport())) + sperror ("RICOH(14h)",err); + else + printf ("Unit was instructed to brand DVD+R as DVD%s\n", + book==0x01?"-ROM":"+R"); + break; + default: + break; + } + + return 0; +} + +int benq (Scsi_Command &cmd,int action,int book,int gen=2) +{ int err; + unsigned char word[2]; + const char *brand; + char unknown [16]="?unknown"; + + switch (action) + { case OPT_INQ|OPT_MEDIA: + break; + case OPT_INQ: + case OPT_INQ|OPT_UNIT: + cmd[0]=0xFF; + cmd[1]=0x10; + cmd[11]=0; + if ((err=cmd.transport(READ,word,sizeof(word)))) + sperror ("BENQ_FFh(10h)",err); + else + { brand = bookname (word[0],unknown), + printf ("The unit will brand DVD+R media as DVD%s\n", + brand?brand:unknown); + } + case OPT_INQ|OPT_UNITRW: + cmd[0]=0xFF; + cmd[1]=0x00; + cmd[11]=0; + if ((err=cmd.transport(READ,word,sizeof(word)))) + sperror ("BENQ_FFh(00h)",err); + else + { brand = bookname (word[0],unknown), + printf ("The unit will format DVD+RW media as DVD%s\n", + brand?brand:unknown); + } + break; + case OPT_INQ|OPT_UNITR: + cmd[0]=0xFF; + cmd[1]=0x10; + cmd[11]=0; + if ((err=cmd.transport(READ,word,sizeof(word)))) + sperror ("BENQ_FFh(10h)",err); + else + { brand = bookname (word[0],unknown), + printf ("The unit will brand DVD+R media as DVD%s\n", + brand?brand:unknown); + } + + if (gen<3) break; + + cmd[0]=0xFF; + cmd[1]=0x10; + cmd[2]=0x01; + cmd[11]=0; + if ((err=cmd.transport(READ,word,sizeof(word)))) + sperror ("BENQ_FFh(10h,1)",err); + else + { brand = bookname (word[0],unknown), + printf ("The unit will brand DVD+R DL meda as DVD%s\n", + brand?brand:unknown); + } + break; + case OPT_MEDIA: + if (profile!=0x1A) + { fprintf (stderr,":-( action is applicable to DVD+RW only\n"); + break; + } + if (book != 0x92 && book != 0x01) + { fprintf (stderr,":-( BookType#%02x is not applicable\n",book); + break; + } +#if 0 + cmd[0]=0x1E; // PREVENT/ALLOW MEDIA REMOVAL + cmd[4]=1; // "Prevent" + cmd[5]=0; + if ((err=cmd.transport())) + { sperror ("PREVENT MEDIA REMOVAL",err); + break; + } +#endif + cmd[0]=0xFE; + cmd[1]=2; + cmd[2]=book; + cmd[11]=0; + if ((err=cmd.transport())) + sperror ("BENQ_FEh(2)",err); + else + action = INTERNAL_RELOAD; + break; + case OPT_UNIT: + if (profile==0x1B || profile==0x2B) goto set_unitr; + case OPT_UNITRW: + if (book != 0x92 && book != 0x01) + { fprintf (stderr,":-( BookType#%02x is not applicable\n",book); + break; + } + cmd[0]=0xFE; + cmd[1]=4; + cmd[2]=book; + cmd[11]=0; + if ((err=cmd.transport())) + sperror ("BENQ_FEh(4)",err); + else + printf ("Unit was instructed to format DVD+RW as DVD%s\n", + book==0x01?"-ROM":"+RW"); + break; + case OPT_UNITR: + set_unitr: + if (book != 0xA1 && book != 0x01) + { fprintf (stderr,":-( BookType#%02x is not applicable\n",book); + break; + } + cmd[0]=0xFE; + cmd[1]=5; + cmd[2]=book; + cmd[11]=0; + if ((err=cmd.transport())) + sperror ("BENQ_FEh(5)",err); + else + printf ("Unit was instructed to brand DVD+R as DVD%s\n", + book==0x01?"-ROM":"+R"); + + if (gen<3) break; + + cmd[0]=0xFE; + cmd[0]=5; + cmd[2]=book==0x01?0x01:0xE1; + cmd[3]=1; + cmd[11]=0; + if ((err=cmd.transport())) + sperror ("BENQ_FEh(5,1)",err); + else + printf ("Unit was instructed to brand DVD+R DL as DVD%s\n", + book==0x01?"-ROM":"+R DL"); + break; + default: + break; + } + + cmd[0]=0xFD; + cmd[1]=0xF2; + cmd[2]='B'; + cmd[3]='E'; + cmd[4]='N'; + cmd[5]='Q'; + cmd[11]=0; + if ((err=cmd.transport())) + sperror ("BENQ_FDh(F2h)",err); + + if (action!=INTERNAL_RELOAD) + return 0; + + cmd[0]=0x1E; // PREVENT/ALLOW MEDIA REMOVAL + cmd[5]=0; + if ((err=cmd.transport())) + return sperror ("ALLOW MEDIA REMOVAL",err),1; + + cmd[0]=0x1B; // START/STOP UNIT + cmd[4]=0x2; // "Eject" + cmd[5]=0; + if ((err=cmd.transport())) + return sperror ("EJECT",err),1; + + cmd[0]=0x1B; // START/STOP UNIT + cmd[4]=0x3; // "Load" + cmd[5]=0; + if ((err=cmd.transport())) + return sperror ("LOAD TRAY",err),1; + + if (wait_for_unit (cmd)) return 1; + + return mediainfo (cmd); +} + +int btc (Scsi_Command &cmd,int action,int book,int gen=0) +{ int err,obligatory=0; + const char *brand=""; + + switch (action) + { case OPT_INQ|OPT_MEDIA: + break; + case OPT_INQ: + case OPT_INQ|OPT_UNIT: + case OPT_INQ|OPT_UNITRW: + case OPT_INQ|OPT_UNITR: + fprintf (stderr,":-( Can't inquiry unit settings, " + "you have to set booktype prior every " + "recording to be sure.\n"); + return 1; + break; + case OPT_MEDIA: + if (profile!=0x1A && profile!=0x14 && profile!=13) + { fprintf (stderr,":-( action is applicable to DVD±RW only\n"); + break; + } + + obligatory = (profile==0x1A)?0x92:0x32; + if (book!=obligatory && book!=0x01) + { fprintf (stderr,":-( BookType#%02x is not applicable\n",book); + break; + } + + cmd[0]=0x1E; // PREVENT/ALLOW MEDIA REMOVAL + cmd[4]=1; // "Prevent" + cmd[5]=0; + if ((err=cmd.transport())) + { sperror ("PREVENT MEDIA REMOVAL",err); + break; + } + + cmd[0]=0xFA; + cmd[2]=book; + cmd[10]=0xAA; + cmd[11]=0xFF; + if ((err=cmd.transport())) + sperror ("BTC_FAh[2]",err); + else + wait_for_unit (cmd); + + cmd[0]=0x1E; // PREVENT/ALLOW MEDIA REMOVAL + cmd[5]=0; + if ((err=cmd.transport())) + return sperror ("ALLOW MEDIA REMOVAL",err),1; + + break; + case OPT_UNIT: + if (profile==0x1B || profile==0x2B || profile==0x11) + goto set_unitr; + case OPT_UNITRW: + fprintf (stderr,":-( Can't set RW unit settings, " + "manipulate media.\n"); + return 1; + break; + case OPT_UNITR: + set_unitr: + // unit requires media in, so we can rely on profile... + if (profile==0x1B) obligatory=0xA1, brand="+R"; + else if (profile==0x2B) obligatory=0xE1, brand="+R DL"; + else obligatory=0x20, brand="-R"; + + if (book!=obligatory && book!=0x01) + { fprintf (stderr,":-( BookType#%02x is not applicable\n",book); + return 1; + } + + cmd[0]=0xFA; + cmd[3]=book; + cmd[4]=book==0x01?0:1; + cmd[10]=0xAA; + cmd[11]=0xFF; + if ((err=cmd.transport())) + return sperror ("BTC_FAh[3]",err),1; + else + printf ("Unit was instructed to brand DVD%s as DVD%s\n", + brand,book==0x01?"-ROM":brand); + return 0; + break; + default: + break; + } + + return mediainfo (cmd); +} + +int liteon (Scsi_Command &cmd,int action,int book,unsigned char *buf=NULL) +{ int err; + + switch (action) + { case OPT_INQ|OPT_MEDIA: + break; + case OPT_INQ: + case OPT_INQ|OPT_UNIT: + case OPT_INQ|OPT_UNITRW: + case OPT_INQ|OPT_UNITR: + if (buf==NULL || buf[0]==0) + { printf ("Unit will brand DVD+plus media with " + "corresponding booktype, e.g. DVD+R as DVD+R...\n"); + return buf==NULL?1:0; + } + if (buf[0]==1) + printf ("Unit will brand DVD+plus media as DVD-ROM\n"); + else if (buf[0]==2) + printf ("Unit will format DVD+RW media as DVD+RW\n"); + else + fprintf (stderr,":-? Insane unit setting %02x\n",buf[0]); + return buf[0]==1?0:1; + break; + case OPT_MEDIA: + fprintf (stderr,":-( Direct DVD+RW media manipulations " + "are not supported.\n" + " Use -unit flag instead and apply " + "-dvd-compat recordinging procedure.\n"); + return 1; + break; + case OPT_UNIT: + case OPT_UNITRW: + case OPT_UNITR: + cmd[0]=0xDF; + cmd[2]=0x0F; + cmd[3]=1; + cmd[4]=book==0x01?1:0; + cmd[11]=0; + if ((err=cmd.transport())) + return sperror ("LITEON_DFh[1]",err),1; + + if (book==0x01) + printf ("Unit was instructed to brand DVD+plus media " + "as DVD-ROM\n"); + else + printf ("Unit was instructed to brand DVD+plus media with " + "corresponding booktype, e.g. DVD+R as DVD+R...\n"); + return 0; + break; + default: + break; + } + + return mediainfo (cmd); +} + +// As per http://www-user.tu-chemnitz.de/~noe/Bitsetting/ +int plextor (Scsi_Command &cmd,int action,int book,int gen=2) +{ int err; + unsigned char vector[8]; + + switch (action) + { case OPT_INQ|OPT_MEDIA: + break; + case OPT_INQ|OPT_UNITRW: + case OPT_UNITRW: + case OPT_MEDIA: + fprintf (stderr,":-( DVD+RW booktyping is not supported\n"); + return 1; + break; + case OPT_INQ: + case OPT_INQ|OPT_UNIT: + case OPT_INQ|OPT_UNITR: + cmd[0] = 0xE9; + cmd[2] = 0x22; + cmd[3] = 0x0A; + cmd[9] = sizeof(vector); + cmd[11] = 0; + if ((err=cmd.transport(READ,vector,sizeof(vector)))) + return sperror ("PLEXTOR_E9h(A)",err),1; + + printf ("Unit will brand DVD+R media as DVD%s\n", + vector[2]?"-ROM":"+R"); + + if (gen<3) return 0; + + cmd[0] = 0xE9; + cmd[2] = 0x22; + cmd[3] = 0x0E; + cmd[9] = sizeof(vector); + cmd[11] = 0; + if ((err=cmd.transport(READ,vector,sizeof(vector)))) + return sperror ("PLEXTOR_E9h(E)",err),1; + + printf ("Unit will brand DVD+R DL media as DVD%s\n", + vector[2]?"-ROM":"+R DL"); + + return 0; + break; + case OPT_UNIT: + case OPT_UNITR: + cmd[0] = 0xE9; + cmd[1] = 0x10; + cmd[2] = 0x22; + cmd[3] = 0x0A; + cmd[5] = book&0xF0?0:1; + cmd[9] = sizeof(vector); + cmd[11] = 0; + if ((err=cmd.transport(READ,vector,sizeof(vector)))) + return sperror ("PLEXTOR_E9h(A)",err),1; + + printf ("Unit was instruction to brand DVD+R media as DVD%s\n", + book&0xF0?"+R":"-ROM"); + + if (gen<3) return 0; + + cmd[0] = 0xE9; + cmd[1] = 0x10; + cmd[2] = 0x22; + cmd[3] = 0x0E; + cmd[5] = book&0xF0?0:1; + cmd[9] = sizeof(vector); + cmd[11] = 0; + if ((err=cmd.transport(READ,vector,sizeof(vector)))) + return sperror ("PLEXTOR_E9h(E)",err),1; + + printf ("Unit was instruction to brand DVD+R DL media as DVD%s\n", + book&0xF0?"+R DL":"-ROM"); + + return 0; + break; + default: + break; + } + + return mediainfo (cmd); +} + +int lg (Scsi_Command &cmd,int action,int book) +{ int err; + unsigned char vector[4]; + + switch (action) + { case OPT_INQ|OPT_MEDIA: + break; + case OPT_INQ|OPT_UNITRW: + case OPT_UNITRW: + case OPT_MEDIA: + fprintf (stderr,":-( DVD+RW booktyping is not supported\n"); + return 1; + break; + case OPT_INQ: + case OPT_INQ|OPT_UNIT: + case OPT_INQ|OPT_UNITR: + cmd[0] = 0xFA; + cmd[8] = sizeof(vector); + cmd[9] = 0; + if ((err=cmd.transport(READ,vector,sizeof(vector)))) + return sperror ("LG_FAh",err),1; + + printf ("Unit will brand DVD+R media as DVD%s\n", + vector[0]&0xF0?"+R":"-ROM"); + printf ("Unit will brand DVD+R DL media as DVD%s\n", + vector[1]&0xF0?"+R DL":"-ROM"); + return 0; + break; + case OPT_UNIT: + case OPT_UNITR: + memset (vector,0,sizeof(vector)); + if (book&0xF0) + vector[0] = 0xA0, // DVD+R + vector[1] = 0xE0; // DVD+R DL + + cmd[0] = 0xFC; + cmd[2] = '+'; + cmd[3] = 'R'; + cmd[4] = 'T'; + cmd[5] = 'B'; + cmd[8] = sizeof(vector); + cmd[9] = 0; + if ((err=cmd.transport(WRITE,vector,sizeof(vector)))) + return sperror ("LG_FCh",err),1; + + printf ("Unit was instruction to brand DVD+R media as DVD%s\n", + book&0xF0?"+R":"-ROM"); + return 0; + break; + default: + break; + } + + return mediainfo (cmd); +} + +int main(int argc,char *argv[]) +{ Scsi_Command cmd; + unsigned char buf[128]; + int book=0,action=0; + int plusgeneration=0,dashcapable=0,ramcapable=0; + int i,err,hp=0,plx=0; + + for(dev=NULL,i=1;i264) + { fprintf (stderr,":-( insane profile list length [%d]\n",len); + return 1; + } + unsigned char *list=new unsigned char[len]; + + cmd[0]=0x46; // GET CONFIGURATION + cmd[1]=2; + cmd[7]=len>>8; + cmd[8]=len; + cmd[9]=0; + if ((err=cmd.transport(READ,list,len))) + return sperror("GET CONFIGURATION",err),1; + + for (plusgeneration=1,i=12;i. + * + * Use-it-on-your-own-risk, GPL bless... + * + * For further details see http://fy.chalmers.se/~appro/linux/DVD+RW/. + * + * Revision history: + * + * 2.0: + * - deploy "IMMED" bit in "FORMAT UNIT"; + * 2.1: + * - LP64 fix; + * - USB workaround; + * 3.0: + * - C++-fication for better portability; + * - SYSV signals for better portability; + * - -lead-out option for improved DVD+RW compatibility; + * - tested with SONY DRU-500A; + * 4.0: + * - support for DVD-RW formatting and blanking, tool name becomes + * overloaded... + * 4.1: + * - re-make it work under Linux 2.2 kernel; + * 4.2: + * - attempt to make DVD-RW Quick Format truly quick, upon release + * is verified to work with Pioneer DVR-x05; + * - media reload is moved to growisofs where is actually belongs; + * 4.3: + * - -blank to imply -force; + * - reject -blank in DVD+RW context and -lead-out in DVD-RW; + * 4.4: + * - support for -force=full in DVD-RW context; + * - ask unit to perform OPC if READ DISC INFORMATION doesn't return + * any OPC descriptors; + * 4.5: + * - increase timeout for OPC, NEC multi-format derivatives might + * require more time to fulfill the OPC procedure; + * 4.6: + * - -force to ignore error from READ DISC INFORMATION; + * - -force was failing under FreeBSD with 'unable to unmount'; + * - undocumented -gui flag to ease progress indicator parsing for + * GUI front-ends; + * 4.7: + * - when formatting DVD+RW, Pioneer DVR-x06 remained unaccessible for + * over 2 minutes after dvd+rw-format exited and user was frustrated + * to poll the unit himself, now dvd+rw-format does it for user; + * 4.8: + * - DVD-RW format fails if preceeded by dummy recording; + * - make sure we talk to MMC unit, be less intrusive; + * - unify error reporting; + * - permit for -lead-out even for blank DVD+RW, needed(?) for SANYO + * derivatives; + * 4.9: + * - permit for DVD-RW blank even if format descriptors are not present; + * 4.10: + * - add support for DVD-RAM; + * 6.0: + * - versioning harmonization; + * - WIN32 port; + * - Initial DVD+RW Double Layer support; + * - Ignore "WRITE PROTECTED" error in OPC; + * 6.1: + * - ± localization; + * - Treat only x73xx OPC errors as fatal; + */ +#include +#include +#include + +#if defined(__unix) || defined(__unix__) +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +#include "transport.hxx" + +static void usage (char *prog) +{ fprintf (stderr,"- usage: %s [-force[=full]] [-lead-out|-blank[=full]]\n" + " [-ssa[=none|default|max]] /dev/dvd\n",prog), + exit(1); +} + +#ifdef _WIN32 +#include + +# if defined(__GNUC__) +# define __shared__ __attribute__((section(".shared"),shared)) +# elif defined(_MSC_VER) +# define __shared__ +# pragma data_seg(".shared") +# pragma comment(linker,"/section:.shared,rws") +# endif +static volatile int shared_progress_indicator __shared__ = 0; +# if defined(_MSC_VER) +# pragma data_seg() +# endif + +static volatile int *progress = &shared_progress_indicator; +static HANDLE Process = NULL; + +BOOL WINAPI GoBackground (DWORD code) +{ if (*progress) + { FreeConsole(); /* detach from console upon ctrl-c or window close */ + return TRUE; + } + return FALSE; +} + +void KillForeground (void) +{ fprintf(stderr,"\n"); + TerminateProcess(Process,0); +} +#else +static volatile int *progress; +#endif + +static const char *gui_action=NULL; +static const char *str = "|/-\\",*backspaces="\b\b\b\b\b\b\b\b\b\b"; + +#if defined(__unix) || defined(__unix__) +extern "C" void alarm_handler (int no) +{ static int i=0,len=1,old_progress=0; + int new_progress = *progress; + + if (gui_action) + { fprintf (stderr,"* %s %.1f%%\n",gui_action, + 100.0*new_progress/65536.0); + alarm(3); + return; + } + + if (new_progress != old_progress) + len = fprintf (stderr,"%.*s%.1f%%",len,backspaces, + 100.0*new_progress/65536.0) - len, + old_progress = new_progress; + else + fprintf (stderr,"\b%c",str[i]), + i++, i&=3; + + alarm(1); +} +#endif + +int main (int argc, char *argv[]) +{ Scsi_Command cmd; + unsigned char formats[260],dinfo[32],inq[128]; + char *dev=NULL,*p; + unsigned int capacity,lead_out,mmc_profile,err; + int force=0,full=0,compat=0,blank=0,ssa=0,do_opc=0,gui=0,len,i; +#if defined(__unix) || defined(__unix__) + pid_t pid; +#endif + +#ifdef _WIN32 + DWORD ppid; + char filename[MAX_PATH],*progname; + + /* + * Foreground process spawns itself and simply waits for shared + * progress indicator to increment... + */ + if (sscanf(argv[0],":%u:",&ppid) != 1) + { int i=0,len=1,old_progress=0,new_progress; + + sprintf (filename,":%u:",GetCurrentProcessId()); + progname = argv[0]; + argv[0] = filename; + Process = (HANDLE)_spawnv (_P_NOWAIT,progname,argv); + if (Process == (HANDLE)-1) + perror("_spawnv"), ExitProcess(errno); + + while(1) + { if (WaitForSingleObject(Process,1000) == WAIT_OBJECT_0) + { ppid = 0; /* borrow DWORD variable */ + GetExitCodeProcess(Process,&ppid); + ExitProcess(ppid); + } + + new_progress = *progress; + if (new_progress != old_progress) + len = fprintf (stderr,"%.*s%.1f%%",len,backspaces, + 100.0*new_progress/65536.0) - len, + old_progress = new_progress; + else if (new_progress) + fprintf (stderr,"\b%c",str[i]), + i++, i&=3; + } + } + + /* + * ... while background process does *all* the job... + */ + Process = OpenProcess (PROCESS_TERMINATE,FALSE,ppid); + if (Process == NULL) + perror("OpenProcess"), ExitProcess(errno); + + atexit (KillForeground); + SetConsoleCtrlHandler (GoBackground,TRUE); + + GetModuleFileName (NULL,filename,sizeof(filename)); + progname = strrchr(filename,'\\'); + if (progname) argv[0] = progname+1; + else argv[0] = filename; +#endif + + fprintf (stderr,"* DVD%sRW/-RAM format utility by , " + "version 6.1.\n",plusminus_locale()); + + for (i=1;i>8; // now with real length... + cmd[8] = (4+len)&0xFF; + cmd[9] = 0; + if ((err=cmd.transport(READ,formats,4+len))) + sperror ("READ FORMAT CAPACITIES",err), exit (1); + + if (len != formats[3]) + fprintf (stderr,":-( parameter length inconsistency\n"), + exit(1); + + if (mmc_profile==0x1A || mmc_profile==0x2A) // DVD+RW + { for (i=8;i>2) == 0x26) break; + } + else if (mmc_profile==0x12) // DVD-RAM + { unsigned int v,ref; + unsigned char *f,descr=0x01; + int j; + + switch (ssa) + { case -1: // no ssa + for (ref=0,i=len,j=8;j>2) == 0x00) + { v=f[0]<<24|f[1]<<16|f[2]<<8|f[3]; + if (v>ref) ref=v,i=j; + } + } + break; + case 0: + i=8; // just grab the first descriptor? + break; + case 1: // first ssa + for (i=8;i>2) == 0x01) break; + break; + case 2: // default ssa + descr=0x00; + case 3: // max ssa + for (ref=0xFFFFFFFF,i=len,j=8;j>2) == descr) + { v=f[0]<<24|f[1]<<16|f[2]<<8|f[3]; + if (v>2) == descr) break; + if (descr==0x15 && i==len) + { fprintf (stderr,":-( failed to locate \"Quick Format\" descriptor.\n"); + for (i=8;i>2) == 0x10) break; + } + } + + if (i==len) + { fprintf (stderr,":-( can't locate appropriate format descriptor\n"); + if (blank) i=0; + else exit(1); + } + + capacity = 0; + capacity |= formats[4+i+0], capacity <<= 8; + capacity |= formats[4+i+1], capacity <<= 8; + capacity |= formats[4+i+2], capacity <<= 8; + capacity |= formats[4+i+3]; + + if (mmc_profile==0x1A || mmc_profile==0x2A) // DVD+RW + fprintf (stderr,"* %.1fGB DVD+RW media detected.\n", + 2048.0*capacity/1e9); + else if (mmc_profile==0x12) // DVD-RAM + fprintf (stderr,"* %.1fGB DVD-RAM media detected.\n", + 2048.0*capacity/1e9); + else // DVD-RW + fprintf (stderr,"* %.1fGB DVD-RW media in %s mode detected.\n", + 2048.0*capacity/1e9, + mmc_profile==0x13?"Restricted Overwrite":"Sequential"); + + lead_out = 0; + lead_out |= formats[4+0], lead_out <<= 8; + lead_out |= formats[4+1], lead_out <<= 8; + lead_out |= formats[4+2], lead_out <<= 8; + lead_out |= formats[4+3]; + + cmd[0] = 0x51; // READ DISC INFORMATION + cmd[8] = sizeof(dinfo); + cmd[9] = 0; + if ((err=cmd.transport(READ,dinfo,sizeof(dinfo)))) + { sperror ("READ DISC INFORMATION",err); + if (!force) exit(1); + memset (dinfo,0xff,sizeof(dinfo)); + cmd[0] = 0x35; + cmd[9] = 0; + cmd.transport(); + } + + do_opc = ((dinfo[0]<<8|dinfo[1])<=0x20); + + if (dinfo[2]&3) // non-blank media + { if (!force) + { if (mmc_profile==0x1A || mmc_profile==0x2A || mmc_profile==0x13 || mmc_profile==0x12) + fprintf (stderr,"- media is already formatted, lead-out is currently at\n" + " %d KiB which is %.1f%% of total capacity.\n", + lead_out*2,(100.0*lead_out)/capacity); + else + fprintf (stderr,"- media is not blank\n"); + offer_options: + if (mmc_profile == 0x1A || mmc_profile == 0x2A) + fprintf (stderr,"- you have the option to re-run %s with:\n" + " -lead-out to elicit lead-out relocation for better\n" + " DVD-ROM compatibility, data is not affected;\n" + " -force to enforce new format (not recommended)\n" + " and wipe the data.\n", + argv[0]); + else if (mmc_profile == 0x12) + fprintf (stderr,"- you have the option to re-run %s with:\n" + " -format=full to perform full (lengthy) reformat;\n" + " -ssa[=none|default|max]\n" + " to grow, eliminate, reset to default or\n" + " maximize Supplementary Spare Area.\n", + argv[0]); + else + { fprintf (stderr,"- you have the option to re-run %s with:\n", + argv[0]); + if (i) fprintf (stderr, + " -force[=full] to enforce new format or mode transition\n" + " and wipe the data;\n"); + fprintf (stderr," -blank[=full] to change to Sequential mode.\n"); + } + exit (0); + } + else if (cmd.umount()) + perror (errno==EBUSY ? ":-( unable to proceed with format" : + ":-( unable to umount"), + exit (1); + } + else + { if (mmc_profile==0x14 && blank==0 && !force) + { fprintf (stderr,"- media is blank\n"); + fprintf (stderr,"- given the time to apply full blanking procedure I've chosen\n" + " to insist on -force option upon mode transition.\n"); + exit (0); + } + force = 0; + } + + if (((mmc_profile == 0x1A || mmc_profile == 0x2A) && blank) + || (mmc_profile != 0x1A && compat) + || (mmc_profile != 0x12 && ssa) ) + { fprintf (stderr,"- illegal command-line option for this media.\n"); + goto offer_options; + } + else if ((mmc_profile == 0x1A || mmc_profile == 0x2A) && full) + { fprintf (stderr,"- unimplemented command-line option for this media.\n"); + goto offer_options; + } + +#if defined(__unix) || defined(__unix__) + { int fd; + char *s; + + if ((fd=mkstemp (s=strdup("/tmp/dvd+rw.XXXXXX"))) < 0) + fprintf (stderr,":-( unable to mkstemp(\"%s\")",s), + exit(1); + + ftruncate(fd,sizeof(*progress)); + unlink(s); + + progress = (int *)mmap(NULL,sizeof(*progress),PROT_READ|PROT_WRITE, + MAP_SHARED,fd,0); + close (fd); + if (progress == MAP_FAILED) + perror (":-( unable to mmap anonymously"), + exit(1); + } + *progress = 0; + + if ((pid=fork()) == (pid_t)-1) + perror (":-( unable to fork()"), + exit(1); + + if (pid) + { struct sigaction sa; + const char *str; + + cmd.~Scsi_Command(); + if (compat && force) str="relocating lead-out"; + else if (blank) str="blanking"; + else str="formatting"; + if (gui) gui_action=str; + else fprintf (stderr,"* %s .",str); + + sigaction (SIGALRM,NULL,&sa); + sa.sa_flags &= ~SA_RESETHAND; + sa.sa_flags |= SA_RESTART; + sa.sa_handler = alarm_handler; + sigaction (SIGALRM,&sa,NULL); + alarm(1); + while ((waitpid(pid,&i,0) != pid) && !WIFEXITED(i)) ; + if (WEXITSTATUS(i) == 0) fprintf (stderr,"\n"); + exit (0); + } + + /* + * You can suspend, terminate, etc. the parent. We will keep on + * working in background... + */ + setsid(); + signal(SIGHUP,SIG_IGN); + signal(SIGINT,SIG_IGN); + signal(SIGTERM,SIG_IGN); +#else + if (compat && force) str="relocating lead-out"; + else if (blank) str="blanking"; + else str="formatting"; + if (gui) gui_action=str; + else fprintf (stderr,"* %s .",str); +#endif + + *progress = 1; + + // formats[i] becomes "Format Unit Parameter List" + formats[i+0] = 0; // "Reserved" + formats[i+1] = 2; // "IMMED" flag + formats[i+2] = 0; // "Descriptor Length" (MSB) + formats[i+3] = 8; // "Descriptor Length" (LSB) + + handle_events(cmd); + + if (mmc_profile==0x1A || mmc_profile==0x2A) // DVD+RW + { if (compat && force && (dinfo[2]&3)) + formats[i+4+0]=formats[i+4+1]=formats[i+4+2]=formats[i+4+3]=0, + formats[i+4+7] = 1; // "Restart format" + + cmd[0] = 0x04; // FORMAT UNIT + cmd[1] = 0x11; // "FmtData" and "Format Code" + cmd[5] = 0; + if ((err=cmd.transport(WRITE,formats+i,12))) + sperror ("FORMAT UNIT",err), exit(1); + + if (wait_for_unit (cmd,progress)) exit (1); + + if (!compat) + { cmd[0] = 0x5B; // CLOSE TRACK/SESSION + cmd[1] = 1; // "IMMED" flag on + cmd[2] = 0; // "Stop De-Icing" + cmd[9] = 0; + if ((err=cmd.transport())) + sperror ("STOP DE-ICING",err), exit(1); + + if (wait_for_unit (cmd,progress)) exit (1); + } + + cmd[0] = 0x5B; // CLOSE TRACK/SESSION + cmd[1] = 1; // "IMMED" flag on + cmd[2] = 2; // "Close Session" + cmd[9] = 0; + if ((err=cmd.transport())) + sperror ("CLOSE SESSION",err), exit(1); + + if (wait_for_unit (cmd,progress)) exit (1); + } + else if (mmc_profile==0x12) // DVD-RAM + { cmd[0] = 0x04; // FORMAT UNIT + if ((formats[i+4+4]>>2) == 0x01) + formats[i+1] = 0, + cmd[1] = 0x11; // "FmtData"|"Format Code" + else if (full) + formats[i+1] = 0x82,// "FOV"|"IMMED" + cmd[1] = 0x11; // "FmtData"|"Format Code" + else + formats[i+1] = 0xA2,// "FOV"|"DCRT"|"IMMED" + cmd[1] = 0x19; // "FmtData"|"CmpLst"|"Format Code" + cmd[5] = 0; + if ((err=cmd.transport(WRITE,formats+i,12))) + sperror ("FORMAT UNIT",err), exit(1); + + if (wait_for_unit (cmd,progress)) exit(1); + } + else // DVD-RW + { page05_setup (cmd,mmc_profile); + + if (do_opc) + { cmd[0] = 0x54; // SEND OPC INFORMATION + cmd[1] = 1; // "Perform OPC" + cmd[9] = 0; + cmd.timeout(120); // NEC units can be slooo...w + if ((err=cmd.transport())) + { if (err==0x17301) // "POWER CALIBRATION AREA ALMOST FULL" + fprintf (stderr,":-! WARNING: Power Calibration Area " + "is almost full\n"); + else + { sperror ("PERFORM OPC",err); + if ((err&0x0FF00)==0x07300) exit (1); + /* The rest of errors are ignored, see groisofs_mmc.cpp + * for further details... */ + } + } + } + + if (blank) // DVD-RW blanking procedure + { cmd[0] = 0xA1; // BLANK + cmd[1] = blank; + cmd[11] = 0; + if ((err=cmd.transport())) + sperror ("BLANK",err), exit(1); + + if (wait_for_unit (cmd,progress)) exit (1); + } + else // DVD-RW format + { if ((formats[i+4+4]>>2)==0x15) // make it really quick + formats[i+4+0]=formats[i+4+1]=formats[i+4+2]=formats[i+4+3]=0; + + cmd[0] = 0x04; // FORMAT UNIT + cmd[1] = 0x11; // "FmtData" and "Format Code" + cmd[5] = 0; + if ((err=cmd.transport(WRITE,formats+i,12))) + sperror ("FORMAT UNIT",err), exit(1); + + if (wait_for_unit (cmd,progress)) exit (1); + + cmd[0] = 0x35; // FLUSH CACHE + cmd[9] = 0; + cmd.transport (); + } + } + + pioneer_stop (cmd,progress); + +#if 0 + cmd[0] = 0x1E; // ALLOW MEDIA REMOVAL + cmd[5] = 0; + if (cmd.transport ()) return 1; + + cmd[0] = 0x1B; // START/STOP UNIT + cmd[4] = 0x2; // "Eject" + cmd[5] = 0; + if (cmd.transport()) return 1; + + cmd[0] = 0x1B; // START/STOP UNIT + cmd[1] = 0x1; // "IMMED" + cmd[4] = 0x3; // "Load" + cmd[5] = 0; + cmd.transport (); +#endif + + return 0; +} diff --git a/extra-sources/dvd+rw-tools-6.1/dvd+rw-format.o b/extra-sources/dvd+rw-tools-6.1/dvd+rw-format.o new file mode 100644 index 0000000..9123981 Binary files /dev/null and b/extra-sources/dvd+rw-tools-6.1/dvd+rw-format.o differ diff --git a/extra-sources/dvd+rw-tools-6.1/dvd+rw-mediainfo b/extra-sources/dvd+rw-tools-6.1/dvd+rw-mediainfo new file mode 100644 index 0000000..efbdb11 Binary files /dev/null and b/extra-sources/dvd+rw-tools-6.1/dvd+rw-mediainfo differ diff --git a/extra-sources/dvd+rw-tools-6.1/dvd+rw-mediainfo.cpp b/extra-sources/dvd+rw-tools-6.1/dvd+rw-mediainfo.cpp new file mode 100644 index 0000000..c02ac4f --- /dev/null +++ b/extra-sources/dvd+rw-tools-6.1/dvd+rw-mediainfo.cpp @@ -0,0 +1,988 @@ +/* + * DVD Media Info utility by Andy Polyakov . + * + * This code is in public domain. + */ + +#include +#include +#include +#include + +#include "transport.hxx" + +#ifdef _WIN32 +#define LLU "I64u" +#else +#define LLU "llu" +#endif + +int main(int argc,char *argv[]) +{ Scsi_Command cmd; + unsigned char header[48],inq[128],*page2A=NULL; + char cmdname[64]; + int i,j,ntracks,err,dvd_dash=0,dvd_plus=0, + plus_mediaid_printed=0,page2A_printed=0,dvd_ram_spare=0; + unsigned short profile,dvd_0E=0,dvd_10=0,dvd_11=0,dvd_0A=0,dvd_C0=0; + + if (argc<2) + fprintf (stderr,"usage: %s /dev/dvd\n",argv[0]), + exit (FATAL_START(EINVAL)); + + if (!cmd.associate(argv[1])) + fprintf (stderr,"%s: unable to open: ",argv[1]), + perror (NULL), + exit (FATAL_START(errno)); + + cmd[0] = 0x12; // INQUIRY + cmd[4] = 36; + cmd[5] = 0; + if ((err=cmd.transport(READ,inq,36))) + sperror ("INQUIRY",err), + exit (FATAL_START(errno)); + + if ((inq[0]&0x1F) != 5) + fprintf (stderr,":-( not an MMC unit!\n"), + exit (FATAL_START(EINVAL)); + + if (argc>1) + printf ("INQUIRY: [%.8s][%.16s][%.4s]\n", + inq+8,inq+16,inq+32); + +#if 0 + wait_for_unit(cmd); +#else + // consume sense data, most commonly "MEDIUM MAY HAVE CHANGED"... + cmd[0] = 0; // TEST UNIT READY + cmd[5] = 0; + if ((err=cmd.transport()) == -1) + sperror ("TEST UNIT READY",err), + exit (FATAL_START(errno)); +#endif + + if (argc>2) do + { unsigned char *pages; + int len,n; + static int pagecode=0x3F; + + printf ("MODE SENSE[#%02Xh]:\n",pagecode); + + cmd[0] = 0x5A; // MODE SENSE + cmd[1] = 0x08; // "Disable Block Descriptors" + cmd[2] = pagecode; // initially "All Pages" + cmd[8] = 12; + cmd[9] = 0; + if ((err=cmd.transport(READ,header,12))) + sprintf (cmdname,"MODE SENSE#%02X",pagecode), + sperror (cmdname,err), + exit(errno); + + if (header[6]<<8|header[7]) + fprintf (stderr,":-( \"DBD\" is not respected\n"), + exit(errno); + + len=(header[0]<<8|header[1])+2; + + if (len < (8+2+header[9])) + { if (pagecode == 0x3F) + { pagecode = 0x5; + continue; + } + len = 8+2+header[9]; + } + + if (!(pages=(unsigned char *)malloc(len))) exit(1); + + cmd[0] = 0x5A; + cmd[1] = 0x08; + cmd[2] = pagecode; + cmd[7] = len>>8; + cmd[8] = len; + cmd[9] = 0; + cmd.transport(READ,pages,len); + + for(i=8+(pages[6]<<8|pages[7]);i>8; + cmd[8] = len; + cmd[9] = 0; + if ((err=cmd.transport(READ,page2A,len))) + sperror ("MODE SENSE#2A",err), + exit (errno); + + if (page2A[6]<<8|page2A[7]) + fprintf (stderr,":-( \"DBD\" is not respected\n"); + else if (len<((page2A[0]<<8|page2A[1])+2) || len<(8+2+page2A[9])) + { len=(page2A[0]<<8|page2A[1])+2; + if (len < (8+2+page2A[9])) + len = 8+2+page2A[9]; + page2A=(unsigned char *)malloc(len); + continue; + } + + if (!(page2A[8+(page2A[6]<<8|page2A[7])+2]&8)) + fprintf (stderr,":-( not a DVD unit\n"), + exit (FATAL_START(EINVAL)); + + if (page2A==header) page2A=NULL; + else if (argc>2 && !page2A_printed) + { printf("MODE SENSE[#2A]:\n"); + for(i=8+(page2A[6]<<8|page2A[7]);i2) + sperror ("READ DVD STRUCTURE#FF",err); + break; + } + + len = (header[0]<<8|header[1]) + 2; + if (!(p = (unsigned char *)malloc(len))) break; + + cmd[0] = 0xAD; + cmd[7] = 0xFF; + cmd[8] = len>>8; + cmd[9] = len; + cmd[11] = 0; + if ((err=cmd.transport(READ,p,len))) + break; + + for (j=4;j2) + { unsigned char *profiles; + int len,n; + + len=header[2]<<8|header[3]; + len+=4; + + if (!(profiles=(unsigned char *)malloc(len))) exit(1); + + cmd[0] = 0x46; + cmd[1] = 1; + cmd[6] = len>>16; + cmd[7] = len>>8; + cmd[8] = len; + cmd[9] = 0; + cmd.transport(READ,profiles,len); + + printf ("GET [CURRENT] CONFIGURATION:\n"); + + for(i=8;i2) + sprintf (cmdname,"READ DVD STRUCTURE#%02x",format), + sperror (cmdname,cmd.sense()); + break; + } + + len = (header[0]<<8|header[1]) + 2; + if (len>sizeof(dvd)) len=sizeof(dvd); + + cmd[0] = 0xAD; + cmd[7] = format; + cmd[8] = len>>8; + cmd[9] = len; + cmd[11] = 0; + if ((err=cmd.transport(READ,&dvd,len))) + break; + + if (argc>2) + { printf ("READ DVD STRUCTURE[#%02xh]:",format); + for (j=0,i=dvd_dash?sizeof(dvd._e):sizeof(dvd._11);j=(hlen+32)) + { n = (p[30]<<8|p[31])*4; + for (i=0;i2) + sperror ("GET CURRENT PERFORMACE",err); + break; + } + + len = (d[0]<<24|d[1]<<16|d[2]<<8|d[3])-4; + + if (len%16) // insane length + { if (argc>2) + fprintf (stderr,":-( insane GET PERFORMANCE length %u\n",len); + break; + } + + len+=8; + if (len < sizeof(d)) + { if (argc>2) + fprintf (stderr,":-( empty GET CURRENT PERFORMACE descriptor\n"); + break; + } + if (len == sizeof(d)) + p = d; + else // ever happens? + { unsigned int n=(len-8)/16; + + p = (unsigned char *)malloc(len); // will leak... + + cmd[0]=0xAC; // GET PERFORMANCE + cmd[1]=4; // ask for "Overall Write Performance" + cmd[8]=n>>8; + cmd[9]=n; // real number of descriptors + cmd[10]=0; // ask for descriptor in effect + cmd[11]=0; + if ((err=cmd.transport(READ,p,len))) + { sperror ("GET CURRENT PERFORMANCE",err); + break; + } + } + + if (argc>2) + { printf ("GET CURRENT PERFORMANCE:\t"); + for (i=4;i %u]\n", + i==0?"Write Performance:":"", + rv/1385.0,rv, + p[0]<<24|p[1]<<16|p[2]<<8 |p[3], + p[8]<<24|p[9]<<16|p[10]<<8|p[11]); + else + printf (" %-23s%.1fx1385=%uKB/s@%u -> %.1fx1385=%uKB/s@%u\n", + i==0?"Write Performance:":"", + rv/1385.0,rv,p[0]<<24|p[1]<<16|p[2]<<8 |p[3], + wv/1385.0,wv,p[8]<<24|p[9]<<16|p[10]<<8|p[11]); + } + } while (0); + + do + { unsigned char d[8+16],*p; + unsigned int len,rv,wv,i; + + cmd[0]=0xAC; // GET PERFORMANCE + cmd[9]=1; // start with one descriptor + cmd[10]=0x3; // ask for "Write Speed Descriptor" + cmd[11]=0; + if ((err=cmd.transport(READ,d,sizeof(d)))) + { if (argc>2) + sperror ("GET PERFORMACE",err); + break; + } + + len = (d[0]<<24|d[1]<<16|d[2]<<8|d[3])-4; + + if (len%16) // insage length + { if (argc>2) + fprintf (stderr,":-( insane GET PERFORMANCE length %u\n",len); + break; + } + + len+=8; + if (len < sizeof(d)) + { fprintf (stderr,":-( empty GET PERFORMACE descriptor\n"); + break; + } + if (len == sizeof(d)) + p = d; + else + { unsigned int n=(len-8)/16; + + p = (unsigned char *)malloc(len); // will leak... + + cmd[0]=0xAC; // GET PERFORMANCE + cmd[8]=n>>8; + cmd[9]=n; // real number of descriptors + cmd[10]=0x3; // ask for "Write Speed Descriptor" + cmd[11]=0; + if ((err=cmd.transport(READ,p,len))) + { sperror ("GET PERFORMANCE",err); + break; + } + } + + if (argc>2) + { printf ("GET PERFORMANCE:\t"); + for (i=8;i2) + sprintf (cmdname,"READ DVD STRUCTURE#%X",dvd_dash), + sperror (cmdname,cmd.sense()); + } + else do + { unsigned char book=header[4]; + const char *brand; + unsigned int phys_start,phys_end; + + printf("READ DVD STRUCTURE[#%Xh]:",dvd_dash<0?0:dvd_dash); + if (argc>2) + for (j=0;j<20-4;j++) printf("%c%02x",j?' ':'\t',header[4+j]); + printf("\n"); + switch(book&0xF0) + { case 0x00: brand="-ROM"; break; + case 0x10: brand="-RAM"; break; + case 0x20: brand="-R"; break; + case 0x30: brand="-RW"; break; + case 0x90: brand="+RW"; break; + case 0xA0: brand="+R"; break; + case 0xE0: brand="+R DL"; break; + default: brand=NULL; break; + } + printf (" Media Book Type: %02Xh, ",book); + if (brand) printf ("DVD%s book [revision %d]\n", + brand,book&0xF); + else printf ("unrecognized value\n"); + + if (header[4+1]&0xF0) dvd_ram_spare=5120; + else dvd_ram_spare=12800; + + if (dvd_plus && !plus_mediaid_printed) + printf (" Media ID: %.8s/%.3s\n",header+23,header+31); + + phys_start = header[4+5]<<16, + phys_start |= header[4+6]<<8, + phys_start |= header[4+7]; + if ((header[4+2]&0x60)==0) // single-layer + phys_end = header[4+9]<<16, + phys_end |= header[4+10]<<8, + phys_end |= header[4+11]; + else + phys_end = header[4+13]<<16, + phys_end |= header[4+14]<<8, + phys_end |= header[4+15]; + if (phys_end>0) phys_end -= phys_start; + if (phys_end>0) phys_end += 1; + + printf (" %s %u*2KB=%"LLU"\n", + dvd_dash>=0?"Legacy lead-out at:":"Last border-out at:", + phys_end,phys_end*2048LL); + + if (dvd_dash<=0) break; + + cmd[0] = 0xAD; + cmd[7] = 0; dvd_dash=-1; + cmd[9] = 20; + cmd[11] = 0; + if ((err=cmd.transport(READ,header,20))) + { sperror ("READ DVD-R STRUCTURE",err); + break; + } + } while (1); + + if (profile==0x10 && (header[4]&0xF0==0)) + printf ("DVD-ROM media detected, exiting...\n"), + exit(0); + + if (profile==0x2B) do + { unsigned char s[4+8]; + + cmd[0] = 0xAD; // READ DVD STRUCTURE + cmd[7] = 0x20; // "DVD+R Double Layer Boundary Information" + cmd[9] = sizeof(s); + cmd[11] = 0; + if ((err=cmd.transport(READ,s,sizeof(s)))) + { sperror ("READ LAYER BOUNDARY INFORMATION",err); + break; + } + + if ((s[0]<<8|s[1]) < 10) + { fprintf (stderr,":-( insane LBI structure length\n"); + break; + } + + printf ("DVD+R DOUBLE LAYER BOUNDARY INFORMATION:\n"); + printf (" L0 Data Zone Capacity: %u*2KB, can %s be set\n", + s[8]<<24|s[9]<<16|s[10]<<8|s[11], + s[4]&0x80?"no longer":"still"); + } while (0); + + if (profile==0x16) do + { unsigned char s[4+8]; + + // Layer Jump specific structures. Note that growisofs doesn't + // perform Layer Jump recordings, see web-page for details... + + cmd[0] = 0xAD; // READ DVD STRUCTURE + cmd[7] = 0x21; // "DVD-R DL Shifted Middle Area Start Address" + cmd[9] = sizeof(s); + cmd[11] = 0; + if ((err=cmd.transport(READ,s,sizeof(s)))) + argc>2 ? sperror ("READ SHIFTED MIDDLE AREA START ADDRESS",err) : (void)0; + else if ((s[0]<<8|s[1]) < 10) + fprintf (stderr,":-( insane SMASA structure length\n"); + else { + printf ("DVD-R DL SHIFTED MIDDLE AREA START ADDRESS:\n"); + printf (" Shifted Middle Area: %u*2KB, can %s be set\n", + s[8]<<24|s[9]<<16|s[10]<<8|s[11], + s[4]&0x80?"no longer":"still"); + } + + cmd[0] = 0xAD; // READ DVD STRUCTURE + cmd[7] = 0x22; // "DVD-R DL Jump Interval Size" + cmd[9] = sizeof(s); + cmd[11] = 0; + if ((err=cmd.transport(READ,s,sizeof(s)))) + argc>2 ? sperror ("READ JUMP INTERVAL SIZE",err) : (void)0; + else if ((s[0]<<8|s[1]) < 10) + fprintf (stderr,":-( insane JIS structure length\n"); + else { + printf ("DVD-R DL JUMP INTERVAL SIZE:\n"); + printf (" Jump Interval Size: %u*2KB\n", + s[8]<<24|s[9]<<16|s[10]<<8|s[11]); + } + + cmd[0] = 0xAD; // READ DVD STRUCTURE + cmd[7] = 0x23; // "DVD-R DL Manual Layer Jump Address" + cmd[9] = sizeof(s); + cmd[11] = 0; + if ((err=cmd.transport(READ,s,sizeof(s)))) + argc>2 ? sperror ("READ MANUAL LAYER JUMP ADDRESS",err) : (void)0; + else if ((s[0]<<8|s[1]) < 10) + fprintf (stderr,":-( insane MLJA structure length\n"); + else { + printf ("DVD-R DL MANUAL LAYER JUMP ADDRESS:\n"); + printf (" Manual Layer Jump: %u*2KB\n", + s[8]<<24|s[9]<<16|s[10]<<8|s[11]); + } + + cmd[0] = 0xAD; // READ DVD STRUCTURE + cmd[7] = 0x24; // "DVD-R DL Remapping Address" + cmd[9] = sizeof(s); + cmd[11] = 0; + if ((err=cmd.transport(READ,s,sizeof(s)))) + argc>2 ? sperror ("READ REMAPPING ADDRESS",err) : (void)0; + else if ((s[0]<<8|s[1]) < 10) + fprintf (stderr,":-( insane RA structure length\n"); + else { + printf ("DVD-R DL REMAPPING ADDRESS:\n"); + printf (" Remapping Jump: %u*2KB\n", + s[8]<<24|s[9]<<16|s[10]<<8|s[11]); + } + } while (0); + + if (profile==0x12 && dvd_0A) do + { unsigned char s[16]; + unsigned int a,b; + + if (dvd_0A>sizeof(s)) dvd_0A=sizeof(s); + + cmd[0] = 0xAD; // READ DVD STRUCTURE + cmd[7] = 0x0A; // "DVD-RAM Spare Area Information" + cmd[8] = dvd_0A>>8; + cmd[9] = dvd_0A; + cmd[11] = 0; + if ((err=cmd.transport(READ,s,dvd_0A))) + { sperror ("READ DVD-RAM SPARE INFORMATION",err); + break; + } + + if (dvd_0A<8) break; + printf ("DVD-RAM SPARE AREA INFORMATION:\n"); + a = s[ 4]<<24|s[ 5]<<16|s[ 6]<<8|s[ 7]; + b = dvd_ram_spare; + printf (" Primary SA: %u/%u=%.1f%% free\n",a,b,(a*100.0)/b); + if (dvd_0A<16) break; + a = s[ 8]<<24|s[ 9]<<16|s[10]<<8|s[11]; + b = s[12]<<24|s[13]<<16|s[14]<<8|s[15]; + printf (" Supplementary SA: %u/%u=%.1f%% free\n",a,b,(a*100.0)/b); + } while (0); + + if (profile==0x12 && dvd_C0) do + { unsigned char s[8]; + + if (dvd_C0>sizeof(s)) dvd_C0=sizeof(s); + + cmd[0] = 0xAD; // READ DVD STRUCTURE + cmd[7] = 0xC0; // "Write Protection Status" + cmd[8] = dvd_C0>>8; + cmd[9] = dvd_C0; + cmd[11] = 0; + if ((err=cmd.transport(READ,s,dvd_C0))) + { sperror ("READ WRITE PROTECTION STATUS",err); + break; + } + + if (dvd_C0<8) break; + printf ("DVD-RAM WRITE PROTECTION STATUS:\n"); + if (s[4]&0x04) + printf (" Write protect tab on cartridge is set to protected\n"); + if (s[4]&0x01) + printf (" Software Write Protection until Power down is on\n"); + printf (" Persistent Write Protection is %s\n",s[4]&0x02?"on":"off"); + } while (0); + + cmd[0] = 0x51; // READ DISC INFORMATION + cmd[8] = 32; + cmd[9] = 0; + if ((err=cmd.transport(READ,header,32))) + sperror ("READ DISC INFORMATION",cmd.sense()), + exit (errno); + + { static const char + *session_state[]={ "empty", "incomplete", + "reserved/damaged","complete" }, + *disc_status[]={ "blank", "appendable", + "complete", "other" }, + *bg_format[]={ "blank", "suspended", + "in progress", "complete" }; + + printf ("READ DISC INFORMATION:"); + if (argc>2) + for (j=0;j<16;j++) printf("%c%02x",j?' ':'\t',header[j]); + printf ("\n"); + printf (" Disc status: %s\n",disc_status[header[2]&3]); + printf (" Number of Sessions: %d\n",header[9]<<8|header[4]); + printf (" State of Last Session: %s\n",session_state[(header[2]>>2)&3]); + if (header[2]&3!=2) + printf (" \"Next\" Track: %d\n",header[10]<<8|header[5]); + printf (" Number of Tracks: %d",ntracks=header[11]<<8|header[6]); + if (header[7]&3) + printf ("\n BG Format Status: %s",bg_format[header[7]&3]); + if ((header[7]&3) == 2) + { unsigned char sense[18]; + + cmd[0] = 0x03; // REQUEST SENSE + cmd[4] = sizeof(sense); + cmd[5] = 0; + if (!cmd.transport (READ,sense,sizeof(sense)) && sense[15]&0x80) + printf (", %.1f%% complete",(sense[16]<<8|sense[17])/655.36); + } + printf ("\n"); + + while (header[2]&0x10 && (profile==0x12 || argc>2)) + { unsigned char formats[260]; + int len; + unsigned int capacity,blocksize; + static const char *type[] = { "reserved", "unformatted", + "formatted", "no media" }; + + printf ("READ FORMAT CAPACITIES:\n"); + + cmd[0] = 0x23; // READ FORMAT CAPACITIES + cmd[8] = 12; + cmd[9] = 0; + if ((err=cmd.transport(READ,formats,12))) + { sperror ("READ FORMAT CAPACITIES",err); + break; + } + + len = formats[3]; + if (len&7 || len<16) + { fprintf (stderr,":-( allocation length isn't sane %d\n",len); + break; + } + + cmd[0] = 0x23; // READ FORMAT CAPACITIES + cmd[7] = (4+len)>>8; // now with real length... + cmd[8] = (4+len)&0xFF; + cmd[9] = 0; + if ((err=cmd.transport(READ,formats,4+len))) + { sperror ("READ FORMAT CAPACITIES",err); + break; + } + + if (len != formats[3]) + { fprintf (stderr,":-( parameter length inconsistency\n"); + break; + } + + printf(" %s:\t\t%u*%u=",type[formats[8]&3], + capacity=formats[4]<<24|formats[5]<<16|formats[6]<<8|formats[7], + blocksize=formats[9]<<16|formats[10]<<8|formats[11]); + printf("%"LLU"\n",(unsigned long long)capacity*blocksize); + + for(i=12;i>24; + cmd[3] = i>>16; + cmd[4] = i>>8; + cmd[5] = i; + cmd[8] = len; + cmd[9] = 0; + if ((err=cmd.transport(READ,header,len))) + { if (i=38) + { if (len==32) { len=40; continue; } + else { break; } + } + else if ((profile==0x15 || profile==0x16) && + (header[5]&0xC0) && (header[0]<<8|header[1])>=46) + { if (len==32) { len=48; continue; } + else { break; } + } + + len = 0; + } + + printf ("READ TRACK INFORMATION[#%d]:",i); + if (argc>2) + for (j=0;j<16;j++) printf("%c%02x",j?' ':'\t',header[j]); + printf ("\n"); + if ((profile&0x0F)==0x0B) // DVD+R + { + printf (" Track State: %s\n", + plus_track_state[header[6]>>6]); + } + else + { + printf (" Track State: %s%s", + ((header[6]>>5)==1 && (header[7]&1))?"in":"", + dash_track_state[header[6]>>5]); + if (header[5]&0x20) printf(",damaged"); + printf ("\n"); + } + printf (" Track Start Address: %u*2KB\n", + header[8]<<24|header[9]<<16|header[10]<<8|header[11]); + if (header[7]&1) + printf (" Next Writable Address: %u*2KB\n", + header[12]<<24|header[13]<<16|header[14]<<8|header[15]); + printf (" Free Blocks: %u*2KB\n", + header[16]<<24|header[17]<<16|header[18]<<8|header[19]); + if (header[6]&0x10) + printf (" Fixed Packet Size: %u*2KB\n", + header[20]<<24|header[21]<<16|header[22]<<8|header[23]); + printf (header[5]&0x40? // check upon LJ bit + " Zone End Address: %u*2KB\n": + " Track Size: %u*2KB\n", + header[24]<<24|header[25]<<16|header[26]<<8|header[27]); + if (header[7]&2) + printf (" Last Recorded Address: %u*2KB\n", + header[28]<<24|header[29]<<16|header[30]<<8|header[31]); + if (len>=40) + printf (" ROM Compatibility LBA: %u\n", + header[36]<<24|header[37]<<16|header[38]<<8|header[39]); + if (len>=48 && header[5]&0xC0) // check upon LJRS bits + printf (" LJRS field: %u\n",header[5]>>6), + printf (" Next Layer Jump: %u\n", + header[40]<<24|header[41]<<16|header[42]<<8|header[43]), + printf (" Last Layer Jump: %u\n", + header[44]<<24|header[45]<<16|header[46]<<8|header[47]); + } + + do + { unsigned char *toc,*p; + int len,sony; + + cmd[0] = 0x43; // READ TOC + cmd[6] = 1; + cmd[8] = 12; + cmd[9] = 0; + if ((err=cmd.transport (READ,header,12))) + { if (argc>2) + sperror ("READ TOC",err); + break; + } + + len = (header[0]<<8|header[1])+2; + toc = (unsigned char *)malloc (len); + + printf ("FABRICATED TOC:"); + if (argc>2) + printf ("\t\t%u %x %x",header[0]<<8|header[1],header[2],header[3]); + printf ("\n"); + + cmd[0] = 0x43; // READ TOC + cmd[6] = header[2]; // "First Track Number" + cmd[7] = len>>8; + cmd[8] = len; + cmd[9] = 0; + if ((err=cmd.transport (READ,toc,len))) + { sperror ("READ TOC",err); + break; + } + + for (p=toc+4,i=4;i2) + sperror ("GET SESSION INFO",err); + break; + } + + len = header[4+4]<<24|header[4+5]<<16|header[4+6]<<8|header[4+7]; + printf (" Multi-session Info: #%u@%u\n",header[4+2],len); + + cmd[0] = 0x43; // READ TOC + cmd[8] = 12; + cmd[9] = 0x40; // "SONY Vendor bit" + if ((err=cmd.transport (READ,header,12))) + { if (argc>2) + sperror ("GET SONY SESSION INFO",err); + break; + } + + sony = header[4+4]<<24|header[4+5]<<16|header[4+6]<<8|header[4+7]; + if (len != sony) + printf (" SONY Session Info: #%u@%u\n",header[4+2],sony); + + } while (0); + + do { + unsigned int ccity,bsize; + cmd[0] = 0x25; // READ CAPACITY + cmd[9] = 0; + if ((err=cmd.transport (READ,header,8))) + { if (argc>2) + sperror ("READ CAPACITY",err); + break; + } + + ccity = header[0]<<24|header[1]<<16|header[2]<<8|header[3]; + if (ccity) ccity++; + bsize = header[4]<<24|header[5]<<16|header[6]<<8|header[7]; + + printf ("READ CAPACITY: %u*%u=%"LLU"\n", + ccity,bsize, + (unsigned long long)ccity*bsize); + } while (0); + + return 0; +} diff --git a/extra-sources/dvd+rw-tools-6.1/dvd+rw-mediainfo.o b/extra-sources/dvd+rw-tools-6.1/dvd+rw-mediainfo.o new file mode 100644 index 0000000..7b74bd7 Binary files /dev/null and b/extra-sources/dvd+rw-tools-6.1/dvd+rw-mediainfo.o differ diff --git a/extra-sources/dvd+rw-tools-6.1/dvd+rw-tools.spec b/extra-sources/dvd+rw-tools-6.1/dvd+rw-tools.spec new file mode 100644 index 0000000..a9e3bf0 --- /dev/null +++ b/extra-sources/dvd+rw-tools-6.1/dvd+rw-tools.spec @@ -0,0 +1,409 @@ +Summary: Toolchain for mastering recordable DVD media +Name: dvd+rw-tools +Version: 6.1 +Release: 1 +License: GPL +Group: Applications/Multimedia +Source: http://fy.chalmers.se/~appro/linux/DVD+RW/tools/dvd+rw-tools-%{version}.tar.gz +URL: http://fy.chalmers.se/~appro/linux/DVD+RW/ +Requires: mkisofs >= 1.10 +BuildRoot: %{_tmppath}/%{name}-root +BuildRequires: kernel-headers wget + +%description +Collection of tools to master DVD+RW/+R/-R/-RW media. For further +information see http://fy.chalmers.se/~appro/linux/DVD+RW/. + +%prep +%setup -q + +%build +make +[ -f index.html ] || wget -nd http://fy.chalmers.se/~appro/linux/DVD+RW/ + +%install +[ %{buildroot} == / ] || rm -rf %{buildroot} +cd %{_builddir}/%{name}-%{version} +make prefix=%{buildroot}%{_prefix} manprefix=%{buildroot}%{_mandir} install +mkdir -p %{buildroot}%{_docdir}/%{name}-%{version}-%{release} +cp -a index.html %{buildroot}%{_docdir}/%{name}-%{version}-%{release} + +%clean +[ %{buildroot} == / ] || rm -rf %{buildroot} + +%files +%defattr(-,root,root) +%{_prefix}/bin/* +%doc %{_docdir}/%{name}-%{version}-%{release} +%doc %{_mandir}/man1/* + +%changelog +* Sun Jan 29 2006 Andy Polyakov +- 6.1 release; +* Thu Jan 26 2006 Andy Polyakov +- permit tracksize to be not divisible by 32KB in DAO mode; +* Wed Jan 25 2006 Andy Polyakov +- Linux: utilize O_EXCL flag [but do see commentary in source code!]; +- Treat only x73xx OPC errors as fatal; +- Fix typo in -speed scaling code; +* Fri Jan 20 2006 Andy Polyakov +- ± localization; +* Thu Jan 19 2006 Andy Polyakov +- Linux: default rlimit for locked pages is way too small [note + that in order to allocate ring buffer larger than default 32MB + through command line option, you have to increase memorylocked + limit accordingly prior application start]; +- make -use-the-force-luke=noload, which leaves tray open, work; +- DEFAULT_BUF_SIZE_MB is a macro, which can be redefined at + compile time with 'make WARN=-DDEFAULT_BUF_SIZE_MB=[16|64]' to + change the default ring buffer size; +* Tue Jan 17 2006 Andy Polyakov +- FreeBSD: improve backward binary compatibility; +* Mon Jan 16 2006 Andy Polyakov +- 6.0 release; +* Fri Jan 13 2006 Andy Polyakov +- -use-the-force-luke=noopc to skip OPC altogether; +- implement 50% check for DVD-R DL; +- demote failure to change speed to warning; +* Sun Jan 8 2006 Andy Polyakov +- refine Pioneer strategies; +- write procedure to recognize "IN PROCESS OF BECOMING READY" + [observed on newer Lite-On 1693S firmware and NEC]; +- allow for more intuitive interpretation of -speed factor with + units returning minimal velocity other than 1x; +* Fri Jan 6 2006 Andy Polyakov +- multi-threaded design; +- asynchronous ring buffer implementation; +- Win32/Mingw32 port; +* Mon Dec 5 2005 Andy Polyakov +- version harmonization in preparation for 6.0 release; +* Sun Nov 28 2004 Andy Polyakov +- DVD-R Dual Layer DAO and Incremental support; +* Sun Sep 26 2004 Andy Polyakov +- fix for DVD+R recordings in Samsung TS-H542A; +* Sat Aug 28 2004 Andy Polyakov +- 5.21.4.10.8 release; +* Wed Aug 25 2004 Andy Polyakov +- Linux: fix for kernel version 2.6>=8, 2.6.8 itself is deficient, + but the problem can be worked around by installing this version + set-root-uid; +* Thu Jul 15 2004 Andy Polyakov +- growisofs 5.20.4.10.8 release; +* Tue Jul 13 2004 Andy Polyakov +- Layer Break position sanity check with respect to dataset size; +- #if directive to get rid of sudo check at compile time with + 'make WARN=-DI_KNOW_ALL_ABOUT_SUDO'; +* Mon Jul 12 2004 Andy Polyakov +- speed verification issue with 8x AccessTek derivatives addressed; +- -use-the-force-luke=noload to leave tray ejected at the end; +- allow to resume incomplete sessions recorded with -M option; +* Sat Jul 3 2004 Andy Polyakov +- -use-the-force-luke=break:size to set Layer Break position for + Double Layer recordings; +* Fri Jun 25 2004 Andy Polyakov +- handle non-fatal OPC errors; +- DVD+R Double Layer support; +- -use-the-force-luke=4gms to allow ISO9660 directory structures + to cross 4GB boundary, the option is effective only with DVD+R DL + and for data to be accessible under Linux isofs kernel patch is + required; +* Wed May 26 2004 Andy Polyakov +- HP-UX: inconsistency between /dev/rdsk and /dev/rscsi names; +* Wed Apr 21 2004 Andy Polyakov +- growisofs 5.19-1 hotfix to address "flushing cache takes forever; +* Sat Apr 18 2004 Andy Polyakov +- DVD-RAM reload if recorded with -poor-man; +- -use-the-force-luke=wrvfy for WRITE AND VERIFY(10); +- "flushing cache" takes forever; +- dvd+rw-format 4.10: add support for DVD-RAM; +* Sat Apr 10 2004 Andy Polyakov +- 5.19.4.9.7 release; +* Sun Apr 4 2004 Andy Polyakov +- LG GSA-4081B fails to "SET STREAMING" with "LBA OUT OF RANGE" for + DVD+RW media, but not e.g. DVD-R; +- dvd+rw-booktype: BTC support; +* Sat Apr 3 2004 Andy Polyakov +- make DVD-RAM work in "poor-man" mode; +- average write speed report at the end of recording; +* Fri Apr 2 2004 Andy Polyakov +- dvd+rw-format 4.9: permit for DVD-RW blank even if format descriptors + are not present; +* Thu Apr 1 2004 Andy Polyakov +- Solaris: get rid of media reload, which made it possible to improve + volume manager experience as well; +- address speed verification issues with NEC ND-2500 and Plextor + PX-708A; +* Mon Mar 22 2004 Andy Polyakov +- dvd+rw-tools-5.18.4.8.6: www.software.hp.com release; +* Sat Mar 20 2004 Andy Polyakov +- IRIX: IRIX 6.x port is added; +* Wed Feb 11 2004 Andy Polyakov +- minimize amount of compiler warnings on 64-bit platforms; +- skip count-down if no_tty_check is set; +- -use-the-force-luke=tracksize:size option by suggestion from K3b; +- Linux: fix for "Bad file descriptor" with DVD+RW kernel patch; +* Tue Jan 20 2004 Andy Polyakov +- refuse to run if ${SUDO_COMMAND} is set; +* Wed Jan 14 2004 Andy Polyakov +- growisofs 5.17: fix for COMMAND SEQUENCE ERROR in the beginning of + DVD-recording; +- drop privileges prior mkisofs -version; +* Tue Jan 13 2004 Andy Polyakov +- the last speed change required adaptations for Pioneer and LG units, + which don't/fail to provide current write speed through GET + PERFORMANCE despite the fact that the command is mandatory; +- HP-UX: retain root privileges in setup_fds, SIOC_IO requires them; +* Sun Jan 4 2004 Andy Polyakov +- switch to GET PERFORMANCE even for current write speed (most + notably required for NEC and derivatives); +* Tue Dec 30 2003 Andy Polyakov +- Linux: fix for /proc/sys/dev/cdrom/check_media set to 1; +- HP-UX: INQUIRY buffer is required to be 128 bytes, well, "required" + is wrong word in this context, as it's apparently a kernel bug + addressed in PHKL_30038 (HPUX 11.11) and PHKL_30039 (HPUX 11.23); +* Fri Dec 26 2003 Andy Polyakov +- growisofs 5.16: brown-bag bug in "LONG WRITE IN PROGRESS" code path; +* Mon Dec 22 2003 Andy Polyakov +- growisofs 5.15: confusing output when DAO mode is manually engaged + and DVD-RW media is minimally blanked; +- complement -use-the-force-luke=dao[:size] to arrange for piping + non-iso images in DAO mode (size is to be expressed in 2KB chunks); +- Pioneer DVR-x06 apparently needs larger timeout to avoid "the LUN + appears to be stuck" message in the beginning of DAO recording; +- HP-UX: fix-up umount code; +- HP-UX: make sure user doesn't pass /dev/rscsi/cXtYlZ, they should + stick to /dev/rdsk/cXtYdZ; +- implement -use-the-force-luke=seek:N -Z /dev/dvd=image to arrange + for 'builtin_dd if=image of=/dev/dvd obs=32k seek=N/16' (note that + N is expected to be expressed in 2KB chunks); +- skip overwrite check for blank media to avoid read errors at start, + which reportedly may cause bus reset in some configurations; +- make get_mmc_profile load media, explicit media load used to be on + per platform basis, while it doesn't have to; +- postpone handle_events till after dry-run checkpoint; +- error reporting revised; +- Optorite seems to insist on resuming suspended DVD+RW format, at + least it's apparently the only way to get *reliable* results + (formally this contradicts specification, which explicitly states + that format is to be resumed automatically and transparently); +- FreeBSD: FreeBSD 5-CURRENT since 2003-08-24, including 5.2 fails + to pull sense data automatically, at least for ATAPI transport, + so I reach for it myself (it's apparently a kernel bug, which + eventually will be fixed, but I keep the workaround code just in + case); +- -speed option in DVD+ context is enabled, upon release tested with + Plextor PX-708A; +- make builtin_dd print amount of transferred data, together with + -use-the-force-luke=seek:N it's easier to maintain "tar-formatted" + rewritable media; +- dvd+rw-format 4.8: DVD-RW format fails if preceeded by dummy + recording; +- make sure we talk to MMC unit, be less intrusive; +- unify error reporting; +- permit for -lead-out even for blank DVD+RW, needed(?) for SANYO + derivatives; +- dvd+rw-booktype 5: support for Benq derivatives; +* Tue Dec 2 2003 Andy Polyakov +- growisofs 5.14: TEAC DV-W50D and Lite-On LDW-811S failed to set + recording velocity, deploy GET PERFORMANCE/SET STREAMING commands; +- Lite-On LDW-811S returns 0s in Write Speed descriptors in page 2A, + this would cause a problem if DVD+ speed control was implemented; +* Thu Nov 20 2003 Andy Polyakov +- Solaris: use large-file API in setup_fds; +- HP-UX: HP-UX support is contributed by HP; +- block signals in the beginning of recording, formally it shouldn't + be necessary, but is apparently needed for some units (is it?); +- prepare code for -speed even in DVD+ context, need a test-case... +* Sun Nov 2 2003 Andy Polyakov +- progress indicator process was orphaned if -Z /dev/cdrom=file.iso + terminated prematurely; +- -overburn -Z /dev/cdrom=file.iso printed two "ignored" messages; +* Thu Oct 23 2003 Andy Polyakov +- '| growisofs -Z /dev/cdrom=/dev/fd/0' failed with + "already carries isofs" even when running interactively, so I check + on /dev/tty instead of isatty(0); +- error output was confusing when overburn condition was raised in + dry-run mode; +- more sane default drain buffer size to minimize system load when + unit fails to return usable buffer utilization statistics under + "LONG WRITE IN PROGRESS" condition; +* Wed Oct 1 2003 Andy Polyakov +- LG GSA-4040B fails to auto-format DVD+RW blanks; +* Mon Sep 15 2003 Andy Polyakov +- growisofs 5.13: support for Panasonic/MATSUSHITA DVD-RAM LF-D310; +* Sat Sep 6 2003 Andy Polyakov +- RPM build fix-ups, no version change; +* Fri Aug 31 2003 Andy Polyakov +- growisofs 5.12: [major] issue with MODE SENSE/SELECT on SANYO + derivatives, such as Optorite, is addressed; +- Linux can't open(2) a socket by /dev/fd/N, replace it with dup(2); +- more relaxed command line option parsing and simultaneously a + zealous check to make sure that no mkisofs options are passed + along with -[ZM] /dev/cdrom=image; +- report I/O error if input stream was less than 64K; +- -M /dev/cdrom=/dev/zero didn't relocate the lead-out in DVD-RW + Restricted Overwrite; +* Fri Aug 15 2003 Andy Polyakov +- single Pioneer DVR-x06 user reported that very small fraction of + his recordings get terminted with "LONG WRITE IN PROGRESS," even + though growisofs explicitly reserves for this condition... It + turned out that at those rare occasions unit reported a lot of free + buffer space, which growisofs treated as error condition. It's not + clear if it's firmware deficiency, but growisofs reserves even for + this apparently rare condition now. +- dvd+rw-format 4.7: when formatting DVD+RW, Pioneer DVR-x06 remained + unaccessible for over 2 minutes after dvd+rw-format exited and user + was frustrated to poll the unit himself, now dvd+rw-format does it for + user; +* Sun Aug 3 2003 Andy Polyakov +- growisofs 5.11: authorship statement in -version output; +- make speed_factor floating point and print "Current Write Speed" + factor for informational purposes; +- Pioneer DVR-x06 exhibited degraded performance when recording DVD+; +- Pioneer DVR-x06 failed to complete DVD+ recording gracefully; +- alter set-root-uid behaviour under Linux from "PAM-junky" to more + conservative one; +- dvd+rw-format 4.6: -force to ignore error from READ DISC INFORMATION; +- -force was failing under FreeBSD with 'unable to unmount'; +- undocumented -gui flag to ease progress indicator parsing for + GUI front-ends; +* Fri Jul 14 2003 Andy Polyakov +- dvd+rw-format 4.5: increase timeout for OPC, NEC multi-format + derivatives might require more time to fulfill the OPC procedure; +- growisofs 5.10: increase timeout for OPC, NEC multi-format + derivatives might require more time to fulfill the OPC procedure; +- extended syntax for -use-the-force-luke option, it's now possible + to engage DVD-R[W] dummy mode by -use-the-force-luke=[tty,]dummy + for example, where "tty" substitutes for the original non-extended + option meaning, see the source for more easter eggs; +- FreeBSD: compile-time option to pass -M /dev/fd/0 to mkisofs to + make life easier for those who mount devfs, but not fdescfs; +- eliminate potential race conditions; +- avoid end-less loop if no media was in upon tray load; +- interpret value of MKISOFS environment variable as absolute path + to mkisofs binary; +- to facilitate for GUI front-ends return different exit codes, most + notably exit value of 128|errno denotes a fatal error upon program + startup [messages worth popping up in a separate modal dialog + perhaps?], errno - fatal error during recording and 1 - warnings + at exit; +- to facilitate for GUI front-ends auto-format blank DVD+RW media; +- Linux: fix for failure to copy volume descriptors when DVD-RW + Restricted Overwrite procedure is applied to patched kernel; +- FreeBSD: growisofs didn't close tray upon startup nor did the rest + of the tools work with open tray; +- bark at -o option and terminate execution, the "problem" was that + users seem to misspell -overburn once in a while, in which case it + was passed down to mkisofs and an iso-image was dumped to current + working directory instead of media; +- generalize -M /dev/cdrom=file.iso option, but if file.iso is not + /dev/zero, insist on sane -C argument to be passed prior -M and + double-verify the track starting address; +* Tue Jun 20 2003 Andy Polyakov +- growisofs 5.9: some [SONY] firmwares make it impossible to tell + apart minimally and fully blanked media, so we need a way to engage + DAO manually [in DVD-RW]... let's treat multiple -dvd-compat options + as "cry" for DAO; +- refuse to finalize even DVD-R media with -M flag (advise to fill + it up with -M /dev/cdrom=/dev/zero too), apparently DVD-units + [or is it just SONY?] also "misplace" legacy lead-out in the same + manner as DVD+units; +- oops! DAO hung at >4MB buffer because of sign overflow; +- couple of human-readable error messages in poor_mans_pwrite64; +- work around Plextor firmware deficiency which [also] manifests as + end-less loop upon startup; +* Wed Jun 14 2003 Andy Polyakov +- growisofs 5.8: elder Ricoh firmwares seem to report events + differently, which triggered growisofs and dvd+rw-format to + end-less loop at startup [event handling was introduced in 5.6 + for debugging purposes]; +- int ioctl_fd is transformed to void *ioctl_handle to facilitate + port to FreeBSD; +- FreeBSD support contributed by Matthew Dillon; +- volume descriptors from second session were discarded in + Restricted Overwrite since 5.6; +* Sun Jun 8 2003 Andy Polyakov +- growisofs 5.7: Solaris 2.x USB workaround; +- 15 min timeout for FLUSH CACHE in DVD-RW DAO; +- revalidate recording speed; +- load media upon start-up (Linux used to auto-close tray upon open, + but not the others, which is why this functionality is added so + late); +- dvd+rw-mediainfo: DVD-R[W] MediaID should be printed now; +* Sat May 31 2003 Andy Polyakov +- Solaris support is merged; +* Mon May 26 2003 Andy Polyakov +- growisofs 5.6: unconditional exit in set-root-uid assistant, mostly + for aesthetic reasons; +- support for DVD-RW DAO recordings (whenever Pioneer-ish Quick + Format is not an option, DAO should fill in for it, as it's the + only recording strategy applicable after *minimal* blanking + procedure); +- support for SG_IO pass-through interface, or in other words + support for Linux 2>=5; +- 'growisofs -M /dev/cdrom=/dev/zero', this is basically a counter- + intuitive kludge assigned to fill up multi-session write-once + media for better compatibility with DVD-ROM/-Video units, to keep + it mountable [in the burner unit] volume descriptors from previous + session are copied to the new session; +- disable -dvd-compat with -M option and DVD+R, advice to fill up + the media as above instead; +- postpone Write Page setup all the way till after dry_run check; +- if recording to write-once media is terminated by external event, + leave the session opened, so that the recording can be resumed + (though no promises about final results are made, it's just that + leaving it open makes more sense than to close the session); +- ask unit to perform OPC if READ DISC INFORMATION doesn't return + any OPC descriptors; +- get rid of redundant Quick Grow in Restricted Overwrite; +- dvd+rw-formwat 4.4: support for -force=full in DVD-RW context; +- ask unit to perform OPC if READ DISC INFORMATION doesn't return + any OPC descriptors; +- new dvd+rw-mediainfo utility for debugging purposes; +* Thu May 1 2003 Andy Polyakov +- growisofs 5.5: fix for ENOENT at unmount, I should have called myself + with execlp, not execl; +- security: chdir to / in set-root-uid assistant; +- use /proc/mounts instead of MOUNTED (a.k.a. /etc/mtab) in Linux + umount code; +- changed to 'all' target in Makefile to keep NetBSD people happy; +* Sun Apr 20 2003 Andy Polyakov +- growisofs 5.4: setup_fds is introduced to assist ports to another + platforms; +- set-root-uid assistant code directly at entry point (see main()); +- OpenBSD/NetBSD port added; +* Thu Mar 27 2003 Andy Polyakov +- growisofs 5.4: split first write to avoid "empty DMA table?" in + kernel log; +- dvd+rw-format 4.3: natural command-line restrictions; +* Thu Mar 20 2003 Andy Polyakov +- growisofs 5.3: refuse to burn if session starts close to or beyond + the 4GB limit (due to limitation of Linux isofs implementation). +- media reload is moved to growisofs from dvd+rw-format. +- dry_run check is postponed all the way till the first write. +* Sat Mar 15 2003 Andy Polyakov +- growisofs 5.3/dvd+rw-format 4.2: support for DVD-RW Quick Format, + upon release tested with Pioneer DVR-x05. +- bug in DVD+RW overburn protection code fixed. +* Thu Feb 27 2003 Andy Polyakov +- growisofs 5.2: brown-bag bug in "LONG WRITE IN PROGRESS" handling + code fixed. +* Mon Feb 1 2003 Andy Polyakov +- code to protect against overburns. +- progress indicator to display recording velocity. +- re-make it work under Linux 2.2 kernel. +* Tue Jan 14 2003 Andy Polyakov +- growisofs 5.1: support for DVD-R[W] writing speed control. +- dvd+rw-booktype 4: see the source. +* Tue Nov 26 2002 Andy Polyakov +- growisofs 5.0: support for DVD-R[W]. +- dvd+rw-format 4.0: support for DVD-RW. +- growisofs 4.2: workaround for broken DVD+R firmwares (didn't make + public by itself). +* Thu Nov 4 2002 Andy Polyakov +- Minor growisofs update. Uninitialized errno at exit when + -Z /dev/scd0=image.iso is used. +* Thu Nov 3 2002 Andy Polyakov +- Initial packaging. Package version is derived from growisofs, + dvd+rw-format and dvd+rw-booktype version. 4.0.3.0.3 means + growisofs 4.0, dvd+rw-format 3.0 dvd+rw-booktype 3. diff --git a/extra-sources/dvd+rw-tools-6.1/dvd-ram-control b/extra-sources/dvd+rw-tools-6.1/dvd-ram-control new file mode 100644 index 0000000..fe9140a Binary files /dev/null and b/extra-sources/dvd+rw-tools-6.1/dvd-ram-control differ diff --git a/extra-sources/dvd+rw-tools-6.1/dvd-ram-control.cpp b/extra-sources/dvd+rw-tools-6.1/dvd-ram-control.cpp new file mode 100644 index 0000000..c33d755 --- /dev/null +++ b/extra-sources/dvd+rw-tools-6.1/dvd-ram-control.cpp @@ -0,0 +1,143 @@ +#include "transport.hxx" + +int main (int argc,char *argv[]) +{ Scsi_Command cmd; + unsigned char buf[128],erb=0; + int err,i,rdonly=0; + const char *dev=NULL; + + for (i=1;i0 && (dvd_C0[4]&0x02)) + { printf ("The disc is write protected already.\n"); + break; + } + else if (rdonly<0 && !(dvd_C0[4]&0x02)) + { printf ("The disc is unprotected already.\n"); + break; + } + + memset (dvd_C0,0,sizeof(dvd_C0)); + dvd_C0[1]=6; + if (rdonly>0) dvd_C0[4]|=2; // "PWP" on + else dvd_C0[4]&=~2; // "PWP" off + + cmd[0]=0xBF; // SEND DVD STRUCTURE + cmd[7]=0xC0; + cmd[9]=sizeof(dvd_C0); + cmd[11]=0; + if ((err=cmd.transport(WRITE,dvd_C0,sizeof(dvd_C0)))) + { sperror("SEND DVD STRUCTURE#C0",err); return 1; } + + // Verify... + cmd[0]=0xAD; // READ DVD STRUCTURE + cmd[7]=0xC0; + cmd[9]=sizeof(dvd_C0); + cmd[11]=0; + if ((err=cmd.transport(READ,dvd_C0,sizeof(dvd_C0)))) + { sperror("READ DVD STRUCTURE#C0",err); return 1; } + + printf ("Persistent Write Protection is %s\n", + dvd_C0[4]&0x02 ? "on" : "off"); + + } while (0); + + return 0; +} diff --git a/extra-sources/dvd+rw-tools-6.1/dvd-ram-control.o b/extra-sources/dvd+rw-tools-6.1/dvd-ram-control.o new file mode 100644 index 0000000..ba211c2 Binary files /dev/null and b/extra-sources/dvd+rw-tools-6.1/dvd-ram-control.o differ diff --git a/extra-sources/dvd+rw-tools-6.1/growisofs b/extra-sources/dvd+rw-tools-6.1/growisofs new file mode 100644 index 0000000..0890ae9 Binary files /dev/null and b/extra-sources/dvd+rw-tools-6.1/growisofs differ diff --git a/extra-sources/dvd+rw-tools-6.1/growisofs.1 b/extra-sources/dvd+rw-tools-6.1/growisofs.1 new file mode 100644 index 0000000..4baf147 --- /dev/null +++ b/extra-sources/dvd+rw-tools-6.1/growisofs.1 @@ -0,0 +1,219 @@ +.TH GROWISOFS 1m "13 Dec 2005" "growisofs 6.0" +.SH NAME +growisofs \- combined mkisofs frontend/DVD recording program. +.SH SYNOPSIS +.B growisofs +[\fB\-dry\-run\fP] +[\fB\-dvd\-compat\fP] +[\fB\-overburn\fP] +[\fB\-speed=1\fP] +\-[\fBZ|M\fP] +.I /dev/dvd +.I + +.SH DESCRIPTION +\fBgrowisofs\fP was originally designed as a frontend to \fBmkisofs\fP +to facilitate appending of data to ISO9660 volumes residing on +random-access media such as DVD+RW, DVD\-RAM, plain files, hard disk +partitions. In the course of development general purpose DVD recording +support was implemented, and as of now \fBgrowisofs\fP supports not +only random-access media, but even mastering of multi-session DVD media +such as DVD+R and DVD\-R/\-RW. In addition \fBgrowisofs\fP supports +first-/single-session recording of \fIarbitrary pre-mastered image\fP +(formatted as UDF, ISO9660 or any other file system, if formatted at +all) to all supported DVD media types. + +.SH OPTIONS +.TP +.BI \-Z\ /dev/dvd +Burn an initial session to the selected device. A special form of this +option is recognized to support burning of pre-mastered images. See +EXAMPLES section for further details. +.TP +.BI \-M\ /dev/dvd +Merge a new session to an existing one. +.TP +.BI \-version +Print version information and invoke \fBmkisofs\fP, also with \-version +option. +.TP +.BI \-dvd\-compat +Provide maximum media compatibility with DVD\-ROM/\-Video. In write-once +context (DVD+R and DVD\-R) this results in unappendable recording +(closed disk). In DVD+RW context it instructs the logical unit to +explicitly burn [otherwise optional] lead\-out. +.TP +.BI \-dry\-run +At dry\-run \fBgrowisofs\fP performs all the steps till, but not +including the first write operation. Most notably check for "overburn" +condition is performed, which implies that mkisofs is invoked and +terminated prematurely. +.TP +.BI \-overburn +Normally DVD media can accommodate up to approximately 4.700.000.000 +bytes (in marketing speech 4.7GB). In other words a DVD can contain +about 4.377 GiB or 4482 MiB. Growisofs won't start without this option, +if "overburn" condition appears to be unavoidable. +.TP +.BI \-speed=N +An option to control recording velocity. Most commonly you'll use +\fB\-speed=1\fP with "no\-name" media, if default speed settings messes +up the media. Keep in mind that \fBN\fP essentially denotes speed +\fIclosest\fP to N*1385KBps among those offered by unit for currently +mounted media. The list can be found in \fBdvd+rw\-mediainfo\fP output. +.TP +.BI +More options can be found in the manpage for \fBmkisofs\fP. + +.P +There are several undocumented options commonly denoted with +\fB\-use\-the\-force\-luke\fP prefix. Some of them serve debugging +purposes. Some require certain knowledge about recording process or +even OS kernel internals and as being such can induce confusing +behaviour. Some are to be used in very specific situations better +recognized by front-ends or automated scripts. Rationale behind leaving +these options undocumented is that those few users who would actually +need to use them directly can as well consult the source code or obtain +specific instructions elsewhere. + +.SH DIFFERENCES WITH RUNNING MKISOFS DIRECTLY +.P +When using growisofs you may not use the +.B \-o +option for an output file. +.B growisofs +dumps the image directly to the media; +.P +You don't have to specify the +.B \-C +option to create a higher level session on a multi session disk, +.B growisofs +will construct one for you; +.P +Otherwise everything that applies to +.I [multi-session] +mastering with +.B mkisofs +applies to +.B growisofs +as well. +.B growisofs +needs at least +.B mkisofs +version 1.14, version 2.0 is required for multi-session write-once +recordings. + +.SH EXAMPLES +Actual device names vary from one operating system to another. We use +\fI/dev/dvd\fP as a collective name or as symbolic link to the actual +device if you wish. Under Linux it will most likely be an ide\-scsi +device such as "/dev/scd0." Under NetBSD/OpenBSD it has to be a +\fIcharacter\fP SCSI CD\-ROM device such as "/dev/rcd0c." Under Solaris +it also has to be a \fIcharacter\fP SCSI/ATAPI CD\-ROM device, e.g. +"/dev/rdsk/c0t1d0s2" or "/vol/dev/aliases/cdrom0." And likewise in +HP\-UX and IRIX... + +To master and burn an ISO9660 volume with Joliet and Rock\-Ridge +extensions on a DVD: + + growisofs \fB\-Z\fP /dev/dvd \fB\-R \-J\fP /some/files + +To append more data to same DVD: + + growisofs \fB\-M\fP /dev/dvd \fB\-R \-J\fP /more/files + +Make sure to use \fIthe same options\fP for both initial burning and +when appending data. + +To finalize the multi-session DVD maintaining maximum compatibility: + + growisofs \fB\-M\fP /dev/dvd\fB=\fP/dev/zero + +To use \fBgrowisofs\fP to write a pre-mastered ISO-image to a DVD: + + growisofs \-dvd\-compat \-Z /dev/dvd\fB=\fPimage.iso + +where image.iso represents an arbitrary object in the filesystem, such +as file, named pipe or device entry. Nothing is growing here and +command name is not intuitive in this context. + +.SH NOTES +If executed under sudo(8) growisofs refuses to start. This is done for +the following reason. Naturally growisofs has to access the data set to +be recorded to DVD media, either indirectly by letting mkisofs generate +ISO9660 layout on-the-fly or directly if a pre-mastered image is to be +recorded. Being executed under sudo(8), growisofs effectively grants +sudoers read access to \fIany\fP file in the file system. The situation +is intensified by the fact that growisofs parses MKISOFS environment +variable in order to determine alternative path to mkisofs executable +image. This means that being executed under sudo(8), growisofs +effectively grants sudoers right to execute program of their choice +with elevated privileges. If you for any reason still find the above +acceptable and are willing to take the consequences, then consider +running following wrapper script under sudo(8) in place for real +growisofs binary. + +.nf + #!/bin/ksh + unset SUDO_COMMAND + export MKISOFS=/path/to/trusted/mkisofs + exec growisofs "$@" +.fi + +But note that the recommended alternative to the above "workaround" is +actually to install growisofs set\-root\-uid, in which case it will drop +privileges prior accessing data or executing mkisofs in order to +preclude unauthorized access to the data. + +If the media already carries isofs and \fBgrowisofs\fP is invoked with +\fB\-Z\fP option non-interactively, e.g. through cron, it shall fail +with "FATAL: /dev/dvd already carries isofs!" Note that only ISO9660 is +recognized, you can perfectly zap e.g. an UDF filesystem +non-interactively. Recommendation is to prepare media for unattended +usage by re-formatting or nullifying first 64KB in advance. + +"Overburn" protection in pre-mastered image context works only with +plain files and ISO9660 formatted volumes. E.g. [given that /dev/root +is an ext2 formatted file system larger than 4.7GB] /dev/dvd=/dev/root is +bound to produce corrupted recording. + +Note that DVD+RW re-formatting procedure does not substitute for +blanking. If you want to nullify the media, e.g. for privacy reasons, +do it explicitly with 'growisofs \-Z /dev/dvd\fB=/dev/zero\fP'. + +Playback of re-writable DVD media, both DVD+RW and DVD\-RW, might be +limited in legacy DVD\-ROM/\-Video units. In most cases this is due +to lower reflectivity of such media. + +Even though growisofs supports it, playback of multi-session write-once +DVD might be limited to the first session for two reasons: + +.TP +\(bu +not all DVD\-ROM players are capable of multi-border DVD\-R playback, +even less are aware of DVD+R multi-sessioning, burner unit therefore +might be the only one in your vicinity capable of accessing files +written at different occasions; +.TP +\(bu +OS might fail to mount multi-session DVD for various reasons; +.PP +The above is not applicable to DVD+RW, DVD\-RW Restricted Overwrite or +DVD\-RAM, as volumes are grown within a single session. + +.SH SEE ALSO +Most up-to-date information on dvd+rw\-tools is available at +http://fy.chalmers.se/~appro/linux/DVD+RW/. +.PP +The manpage for \fBmkisofs\fP. + +.SH AUTHORS +Andy Polyakov stands for programming and on-line +information. + +This manpage is currently maintained by Huub Reuver +. + +.SH LICENSE +\fBgrowisofs\fP is distributed under GNU GPL. + diff --git a/extra-sources/dvd+rw-tools-6.1/growisofs.c b/extra-sources/dvd+rw-tools-6.1/growisofs.c new file mode 100644 index 0000000..fd9125d --- /dev/null +++ b/extra-sources/dvd+rw-tools-6.1/growisofs.c @@ -0,0 +1,2956 @@ +/* + * growisofs 6.1 by Andy Polyakov . + * + * Version 6.0 is dedicated to all personal friends of mine! The code + * was initially intended to be a 2006 New Year gift to them, but it + * didn't happen:-( But it doesn't change the fact that I think of + * you, guys! Cheers! + * + * Use-it-on-your-own-risk, GPL bless... + * + * This front-end to mkisofs(8) was originally developed to facilitate + * appending of data to ISO9660 volumes residing on random write access + * DVD media such as DVD+RW, DVD-RAM, as well as plain files/iso images. + * At later stages even support for multi-session recording to DVD + * write-once media such as DVD+R and DVD-R was added. + * + * As for growing random access volumes. The idea is very simple. The + * program appends new data as it was added to a multisession media and + * then copies the new volume descriptor(s) to the beginning of media + * thus effectively updating the root catalog reference... + * + * For further details see http://fy.chalmers.se/~appro/linux/DVD+RW/. + * + * Revision history: + * + * 1.1: + * - flush cache before copying volume descriptors; + * 2.0: + * - support for /dev/raw*; + * - support for set-root-uid operation (needed for /dev/raw*); + * - support for first "session" burning (needed for "poor-man"); + * - "poor-man" support for those who don't want to recompile the + * kernel; + * 2.1: + * - mkisofs_pid typo; + * 2.2: + * - uninitialized in_device variable; + * - -help option; + * 3.0: + * - support for DVD+R; + * 3.1: + * - -Z fails if a file system is present and stdin is not a tty; + * 3.2: + * - support for image burning (needed for DVD+R as you can't use dd); + * 3.3: + * - 'growisofs -Z /dev/scdN image.iso' is too confusing, implement + * 'growisofs -Z /dev/scdN=image.iso' instead; + * 4.0: + * - transport C++-fication for better portability; + * - support for -dvd-compat option (improved DVD+R/RW compatibility); + * - -dvd-video implies -dvd-compat; + * - support for SONY DRU-500A; + * - progress indicator for -Z /dev/scdN=image.iso; + * - agressive -poor-man-ing; + * 4.1: + * - uninitialized errno at exit from -Z /dev/scdN=image.iso; + * 4.2: + * - don't print initial bogus progress indicator values; + * - apparently some firmwares exhibit ambiguity in DVD+R disc + * finalizing code; + * 5.0: + * - enforced 32K write strategy (needed for DVD-R[W]); + * - support for DVD-RW Restricted Overwrite Mode; + * - support for DVD-R[W] Sequential Mode; + * 5.1: + * - support for writing speed control; + * 5.2: + * - re-make it work under Linux 2.2 kernel; + * - progress indicator to display recording velocity; + * - code to protect against overburns; + * - undocumented -use-the-force-luke flag to overwrite the media + * none interactively; + * - brown-bag bug in "LONG WRITE IN PROGRESS" handling code fixed; + * 5.3: + * - Pioneer workarounds/fix-ups, most notably DVR-x05 doesn't seem + * to digest immediate "SYNC CACHE"; + * - support for DVD-RW Quick Format, upon release verified to work + * with Pioneer DVR-x05; + * - bug in DVD+RW overburn "protection" code fixed; + * - media reload is moved here from dvd+rw-format; + * - refuse to burn if session starts close to or beyond 4GB limit + * (limitation of Linux isofs implementation); + * - dry_run check is postponed all the way till the first write; + * 5.4: + * - split first write to two to avoid "empty DMA table?" in kernel log; + * - setup_fds is introduced to assist ports to another platforms; + * - set-root-uid assistant code directly at entry point (see main()); + * - OpenBSD/NetBSD support added, it's worth noting that unlike 3.3 + * port by Maarten Hofman, it's /dev/rcd?c which is expected to be + * passed as argument, not /dev/cd?c. + * 5.5: + * - fix for ENOENT at unmount, I should have called myself with execlp, + * not execl; + * - security: chdir("/") in set-root-uid assistant; + * - use /proc/mounts instead of MOUNTED (a.k.a. /etc/mtab) in Linux + * umount code; + * 5.6: + * - unconditional exit in set-root-uid assistant, mostly for aesthetic + * reasons; + * - support for DVD-RW DAO recordings (whenever Pioneer-ish Quick + * Format is not an option, DAO should fill in for it, as it's the + * only recording strategy applicable after *minimal* blanking + * procedure); + * - support for SG_IO pass-through interface, or in other words + * support for Linux 2>=5; + * - 'growisofs -M /dev/cdrom=/dev/zero', this is basically a counter- + * intuitive kludge assigned to fill up multi-session write-once + * media for better compatibility with DVD-ROM/-Video units, to keep + * it mountable [in the burner unit] volume descriptors from previous + * session are copied to the new session; + * - disable -dvd-compat with -M option and DVD+R, advice to fill up + * the media as above instead; + * - postpone Write Page setup all the way till after dry_run check; + * - if recording to write-once media is terminated by external event, + * leave the session opened, so that the recording can be resumed + * (though no promises about final results are made, it's just that + * leaving it open makes more sense than to close the session); + * - ask unit to perform OPC if READ DISC INFORMATION doesn't return + * any OPC descriptors; + * - get rid of redundant Quick Grow in Restricted Overwrite; + * - Solaris 2.x support is merged, it's volume manager aware, i.e. + * you can run it with or without volume manager; + * 5.7: + * - Solaris USB workaround; + * - 15 min timeout for FLUSH CACHE in DVD-RW DAO; + * - revalidate recording speed; + * - load media upon start-up (Linux used to auto-close tray upon open, + * but not the others, which is why this functionality is added so + * late); + * 5.8: + * - elder Ricoh firmwares seem to report events differently, which + * triggered growisofs and dvd+rw-format to end-less loop at startup + * [event handling was introduced in 5.6 for debugging purposes]; + * - int ioctl_fd is transformed to void *ioctl_handle to facilitate + * port to FreeBSD; + * - FreeBSD support contributed by Matthew Dillon; + * - volume descriptors from second session were discarded in + * Restricted Overwrite since 5.6; + * 5.9: + * - some [SONY] firmwares make it impossible to tell apart minimally + * and fully blanked media, so we need a way to engage DAO manually + * [in DVD-RW]... let's treat multiple -dvd-compat options as "cry" + * for DAO; + * - refuse to finalize even DVD-R media with -M flag (advise to fill + * it up with -M /dev/cdrom=/dev/zero too), apparently DVD-units + * [or is it just SONY?] also "misplace" legacy lead-out in the same + * manner as DVD+units; + * - oops! DAO hung at >4MB buffer because of sign overflow; + * - couple of human-readable error messages in poor_mans_pwrite64; + * - work around Plextor firmware deficiency which [also] manifests as + * end-less loop upon startup; + * 5.10: + * - increase timeout for OPC, NEC multi-format derivatives might + * require more time to fulfill the OPC procedure; + * - extended syntax for -use-the-force-luke option, it's now possible + * to engage DVD-R[W] dummy mode by -use-the-force-luke=[tty,]dummy + * for example, where "tty" substitutes for the original non-extended + * option meaning, see the source for more easter eggs; + * - FreeBSD: compile-time option to pass -M /dev/fd/0 to mkisofs to + * make life easier for those who mount devfs, but not fdescfs; + * - eliminate potential race conditions; + * - avoid end-less loop if no media was in upon tray load; + * - interpret value of MKISOFS environment variable as absolute path + * to mkisofs binary; + * - to facilitate for GUI front-ends return different exit codes, most + * notably exit value of 128|errno denotes a fatal error upon program + * startup [messages worth popping up in a separate modal dialog + * perhaps?], errno - fatal error during recording and 1 - warnings + * at exit; + * - to facilitate for GUI front-ends auto-format blank DVD+RW media; + * - Linux: fix for failure to copy volume descriptors when DVD-RW + * Restricted Overwrite procedure is applied to patched kernel; + * - FreeBSD: growisofs didn't close tray upon startup nor did the rest + * of the tools work with open tray; + * - bark at -o option and terminate execution, the "problem" was that + * users seem to misspell -overburn once in a while, in which case it + * was passed down to mkisofs and an iso-image was dumped to current + * working directory instead of media; + * - generalize -M /dev/cdrom=file.iso option, but if file.iso is not + * /dev/zero, insist on sane -C argument to be passed prior -M and + * double-verify the track starting address; + * 5.11: + * - authorship statement in -version output; + * - make speed_factor floating point and print "Current Write Speed" + * factor for informational purposes; + * - Pioneer DVR-x06 exhibited degraded performance when recording DVD+; + * - Pioneer DVR-x06 failed to complete DVD+ recording gracefully; + * - alter set-root-uid behaviour under Linux from "PAM-junky" to more + * conservative one; + * 5.12: + * - single Pioneer DVR-x06 user reported that very small fraction of + * his recordings get terminted with "LONG WRITE IN PROGRESS," even + * though growisofs explicitly reserves for this condition... It + * turned out that at those rare occasions unit reported a lot of free + * buffer space, which growisofs treated as error condition. It's not + * clear if it's firmware deficiency, but growisofs reserves even for + * this apparently rare condition now. + * - [major] issue with MODE SENSE/SELECT on SANYO derivatives, such as + * Optorite, is addressed; + * - Linux can't open(2) a socket by /dev/fd/N, replace it with dup(2); + * - more relaxed command line option parsing and simultaneously a + * zealous check to make sure that no mkisofs options are passed + * along with -[ZM] /dev/cdrom=image; + * - report I/O error if input stream was less than 64K; + * - -M /dev/cdrom=/dev/zero didn't relocate the lead-out in DVD-RW + * Restricted Overwrite; + * 5.13: + * - workarounds for Panasonic/MATSUSHITA DVD-RAM LF-D310; + * - Solaris: media load upon start-up; + * 5.14: + * - LG GSA-4040B failed to auto-format DVD+RW blanks; + * - '| growisofs -Z /dev/cdrom=/dev/fd/0' failed with "already carries + * isofs" even when running interactively, so I check on /dev/tty + * instead of isatty(0); + * - error output was confusing when overburn condition was raised in + * dry-run mode; + * - more sane default drain buffer size to minimize system load when + * unit fails to return usable buffer utilization statistics under + * "LONG WRITE IN PROGRESS" condition; + * - progress indicator process was orphaned if -Z /dev/cdrom=file.iso + * terminated prematurely; + * - -overburn -Z /dev/cdrom=file.iso printed two "ignored" messages; + * - Solaris: use large-file API in setup_fds; + * - HP-UX: HP-UX support is contributed by HP; + * - block signals in the beginning of recording, formally it shouldn't + * be necessary, but is apparently needed for some units (is it?); + * - prepare code for -speed even in DVD+ context, need a test-case... + * - TEAC DV-W50D and Lite-On LDW-811S failed to set recording velocity, + * deploy GET PERFORMANCE/SET STREAMING commands; + * - Lite-On LDW-811S returns 0s in Write Speed descriptors in page 2A, + * this would cause a problem if DVD+ speed control was implemented; + * 5.15: + * - confusing output when DAO mode is manually engaged and DVD-RW media + * is minimally blanked; + * - complement -use-the-force-luke=dao[:size] to arrange for piping + * non-iso images in DAO mode (size is to be expressed in 2KB chunks); + * - Pioneer DVR-x06 apparently needs larger timeout to avoid "the LUN + * appears to be stuck" message in the beginning of DAO recording; + * - HP-UX: fix-up umount code; + * - HP-UX: make sure user doesn't pass /dev/rscsi/cXtYlZ, they should + * stick to /dev/rdsk/cXtYdZ; + * - implement -use-the-force-luke=seek:N -Z /dev/dvd=image to arrange + * for 'builtin_dd if=image of=/dev/dvd obs=32k seek=N/16' (note that + * N is expected to be expressed in 2KB chunks); + * - skip overwrite check for blank media to avoid read errors at start, + * which reportedly may cause bus reset in some configurations; + * - make get_mmc_profile load media, explicit media load used to be on + * per platform basis, while it doesn't have to; + * - postpone handle_events till after dry-run checkpoint; + * - error reporting revised; + * - Optorite seems to insist on resuming suspended DVD+RW format, at + * least it's apparently the only way to get *reliable* results + * (formally this contradicts specification, which explicitly states + * that format is to be resumed automatically and transparently); + * - FreeBSD: FreeBSD 5-CURRENT since 2003-08-24, including 5.2 fails + * to pull sense data automatically, at least for ATAPI transport, + * so I reach for it myself (it's apparently a kernel bug, which + * eventually will be fixed, but I keep the workaround code just in + * case); + * - -speed option in DVD+ context is enabled, upon release tested with + * Plextor PX-708A; + * - make builtin_dd print amount of transferred data, together with + * -use-the-force-luke=seek:N it's easier to maintain "tar-formatted" + * rewritable media; + * 5.16: + * - brown-bag bug in "LONG WRITE IN PROGRESS" code path; + * 5.17: + * - Linux: fix for /proc/sys/dev/cdrom/check_media set to 1; + * - HP-UX: INQUIRY buffer is required to be 128 bytes. Well, "required" + * is wrong word in this context, as it's apparently a kernel bug + * addressed in PHKL_30038 (HPUX 11.11) and PHKL_30039 (HPUX 11.23). + * This "change" affects all dvd+rw-tools, but I don't bump their + * version numbers for this, as it's an "ugly" workaround for an + * *external* problem; + * - switch to GET PERFORMANCE even for current write speed (most + * notably required for NEC and derivatives); + * - the above change required adaptations for Pioneer and LG units, + * which don't/fail to provide current write speed through GET + * PERFORMANCE despite the fact that the command is mandatory; + * - HP-UX: retain root privileges in setup_fds, SIOC_IO requires them; + * - fix for COMMAND SEQUENCE ERROR in the beginning of DVD-recording; + * - drop privileges prior mkisofs -version; + * 5.18: + * - refuse to run if ${SUDO_COMMAND} is set; + * - minimize amount of compiler warnings on 64-bit platforms; + * - skip count-down if no_tty_check is set; + * - -use-the-force-luke=tracksize:size option by suggestion from K3b; + * - Linux: fix for "Bad file descriptor" with DVD+RW kernel patch; + * 5.19: + * - IRIX: IRIX 6.x port is added; + * - Solaris: get rid of media reload, which made it possible to improve + * volume manager experience as well; + * - address speed verification issues with NEC ND-2500 and Plextor + * PX-708A; + * - make DVD-RAM work in "poor-man" mode; + * - average write speed report at the end of recording; + * - LG GSA-4081B fails to "SET STREAMING" with "LBA OUT OF RANGE" for + * DVD+RW media, but not e.g. DVD-R; + * 5.20: + * - DVD-RAM reload if recorded with -poor-man; + * - -use-the-force-luke=wrvfy for WRITE AND VERIFY(10); + * - "flushing cache" takes forever, from 5.19-1; + * - HP-UX: inconsistency between /dev/rdsk and /dev/rscsi names; + * - handle non-fatal OPC errors; + * - DVD+R Double Layer support; + * - -use-the-force-luke=4gms to allow ISO9660 directory structures + * to cross 4GB boundary, the option is effective only with DVD+R DL + * and for data to be accessible under Linux isofs a kernel patch is + * required; + * - more sane sanity check for -use-the-force-luke=tracksize:N; + * - -use-the-force-luke=break:size to set Layer Break position for + * Double Layer recordings; + * - speed verification issue with 8x AccessTek derivatives addressed; + * - -use-the-force-luke=noload to leave tray ejected at the end; + * - allow to resume incomplete sessions recorded with -M option; + * - Layer Break position sanity check with respect to dataset size; + * - #if directive to get rid of sudo check at compile time with + * 'make WARN=-DI_KNOW_ALL_ABOUT_SUDO'; + * 5.21: + * - Linux: fix for kernel version 2.6>=8, 2.6.8 itself is deficient, + * but the problem can be worked around by installing this version + * set-root-uid; + * 6.0: + * - fix for DVD+R recordings in Samsung TS-H542A; + * - DVD-R Dual Layer DAO and Incremental support; + * - versioning harmonization; + * - multi-threaded(*) design; + * *) apparently strace-ing NPTL processes can disrupt synchroni- + * zation between threads and cause a deadlock condition. If + * you ought to strace growisofs, make sure it's started with + * LD_ASSUME_KERNEL environment variable set to 2.4. + * - asynchronous ring buffer implementation; + * - Win32/Mingw32 port [for platform-specific notes see + * http://fy.chalmers.se/~appro/linux/DVD+RW/tools/win32/]; + * - refine Pioneer strategies; + * - WRITE procedure to recognize "IN PROCESS OF BECOMING READY" + * [observed on newer Lite-On 1693S firmware and NEC]; + * - allow for more intuitive interpretation of -speed factor with + * units returning minimal velocity other than 1x; + * - -use-the-force-luke=noopc to skip OPC altogether; + * - implement 50% check for DVD-R DL; + * - demote failure to change speed to warning; + * 6.1: + * - FreeBSD: improve backward binary compatibility; + * - Linux: default rlimit for locked pages is way too small [note + * that in order to allocate ring buffer larger than default 32MB + * through command line option, you have to increase memorylocked + * limit accordingly prior application start]; + * - make -use-the-force-luke=noload, which leaves tray open, work; + * - DEFAULT_BUF_SIZE_MB is a macro, which can be redefined at + * compile time with 'make WARN=-DDEFAULT_BUF_SIZE_MB=[16|64]' to + * change the default ring buffer size; + * - ± localization; + * - Linux: utilize O_EXCL flag [but do see commentary below!]; + * - Treat only x73xx OPC errors as fatal; + * - Fix typo in -speed scaling code; + * - permit tracksize to be not divisible by 32KB in DAO mode; + */ +#define PRINT_VERSION(cmd) do { \ + char *s=strrchr((cmd),'/'); \ + s ? s++ : (s=(cmd)); \ + printf ("* %.*sgrowisofs by ,"\ + " version 6.1,\n",(int)(s-(cmd)),(cmd)); \ +} while (0) + +#define _LARGEFILE_SOURCE +#define _LARGEFILE64_SOURCE +#define _FILE_OFFSET_BITS 64 + +#if defined(__linux) +/* ... and "engage" glibc large file support */ +# ifndef _GNU_SOURCE +# define _GNU_SOURCE +# endif +#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) +# define off64_t off_t +# define stat64 stat +# define fstat64 fstat +# define open64 open +# define pread64 pread +# define pwrite64 pwrite +# define lseek64 lseek +# ifndef __unix +# define __unix +# endif +#elif defined(_WIN32) +# undef _WIN32_WINNT +# define _WIN32_WINNT 0x0500 +# define off64_t __int64 +# define stat64 _stati64 +# define fstat64 _fstati64 +# define lseek64 _lseeki64 +# define ssize_t LONG_PTR +# define perror _mask_perror +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include "mp.h" + +#if defined(__unix) || defined(__unix__) +# include +# include +# include +# include +# include +# include +# include + +# include +# define set_errno(e) (errno=(e)) +# define FATAL_START(e) (0x80|(e)) +# define FATAL_MASK 0x7F + +#ifdef __FreeBSD__ +# include +# ifndef SYS_mlockall +# define SYS_mlockall 324 +# endif +#endif + +#elif defined(_WIN32) + +#include "win32err.h" +# include +# include +# ifndef F_OK +# define F_OK 0 +# endif +# ifndef S_ISREG +# define S_ISREG(m) (((m)&_S_IFMT)==_S_IFREG) +# endif +static ssize_t pread64(int,void *,size_t,off64_t); +static ssize_t pwrite64(int,const void *,size_t,off64_t); +# define poll(a,b,t) Sleep(t) +# define LLD "I64d" + +#endif + +#ifndef EMEDIUMTYPE +#define EMEDIUMTYPE EINVAL +#endif +#ifndef ENOMEDIUM +#define ENOMEDIUM ENODEV +#endif + +#ifndef LLD +#define LLD "lld" +#endif + +#ifndef DEFAULT_BUF_SIZE_MB +/* (!) default is 32MB, which is somewhat wasteful for 4x recording + * speed and somewhat close to the "edge" for 16x:-) */ +#define DEFAULT_BUF_SIZE_MB 32 +#endif + +typedef ssize_t (*pwrite64_t)(int,const void *,size_t,off64_t); + +/* + * Symbols from growisofs_mmc.cpp + */ +/* + * These may terminate the program if error appears fatal. + * The return value is therefore is always sane and suitable + * for assignment. + */ +int get_mmc_profile (void *fd); +int plusminus_r_C_parm (void *fd,char *C_parm); +pwrite64_t poor_mans_setup (void *fd,off64_t leadout); +char *plusminus_locale (); +/* + * These never terminate the program. + * Pay attention to the return value. + */ +int media_reload (char *file,struct stat *ref); +int fumount (int fd); +off64_t get_capacity (void *fd); +int poor_man_rewritable (void *fd,void *buf); + +/* simplified */ +struct iso_primary_descriptor { + unsigned char type [1]; + unsigned char id [5]; + unsigned char void1 [80-5-1]; + unsigned char volume_space_size [8]; + unsigned char void2 [2048-80-8]; +}; + +#define CD_BLOCK ((off64_t)2048) +#define VOLDESC_OFF 16 +#define DVD_BLOCK (32*1024) +#define MAX_IVDs 16 + +static struct iso_primary_descriptor saved_descriptors[MAX_IVDs]; + +static pwrite64_t pwrite64_method = pwrite64; + +/* + * Page-aligned ring buffer... + */ +static char *the_buffer; +static unsigned int the_buffer_size=DEFAULT_BUF_SIZE_MB*1024*1024; + +/* + * Synchronization objects + */ +static volatile unsigned int highest_ecc_block,reader_exit; +static void *the_ring_semaphore; +static volatile struct { time_t zero; off64_t current,final; } progress; + +/* + * in_fd is passed to mkisofs, out_fd - to pwrite and ioctl_fd - to ioctl. + */ +static int in_fd=-1,out_fd=-1; + +#ifndef INVALID_HANDLE +#define INVALID_HANDLE ((void *)-1) +#endif +static void *ioctl_handle=INVALID_HANDLE; +#define ioctl_fd ((long)ioctl_handle) + +static int poor_man=-1, zero_image=0, quiet=1, + overburn=0, no_tty_check=0, dry_run=0, dao_size=0, + no_4gb_check=0, layer_break=0; + +int dvd_compat=0, test_write=0, no_reload=0, mmc_profile=0, + wrvfy=0, no_opc=0; +double speed_factor=0.0; +char *ioctl_device; +int _argc; +char **_argv; + + +#if defined(__linux) + +#include +#include +#include +#include +#include +#ifndef _LINUX_WAIT_H +#define _LINUX_WAIT_H /* linux headers are impaired */ +#endif +#include + +#if 0 +int dev_open(const char *pathname,int flags); +int dev_open_patched(); + +int open64_wrapper(const char *pathname,int flags,...) +{ struct stat64 sb; + + if (stat64(pathname,&sb)==0 && S_ISBLK(sb.st_mode) && dev_open_patched()) + { poor_man = 1; + return dev_open(pathname,flags|O_LARGEFILE); + } + + return open64(pathname,flags); +} +#endif + +char *find_raw_device(struct stat64 *sb) +{ int i,rawctl; + dev_t dev_major,dev_minor; + char *ret=NULL; + struct raw_config_request req; + static char rawdevname[24] = ""; + + if (!S_ISBLK(sb->st_mode)) return NULL; + + dev_major = major (sb->st_rdev); + dev_minor = minor (sb->st_rdev); + + if ((rawctl=open ("/dev/rawctl",O_RDONLY)) < 0) return NULL; + + for (i=1;i<256;i++) + { req.raw_minor = i; + if (ioctl(rawctl,RAW_GETBIND,&req) < 0) break; + if (req.block_major == dev_major && req.block_minor == dev_minor) + { sprintf (rawdevname,"/dev/raw/raw%d",i); + ret = rawdevname; + break; + } + } + close (rawctl); + + return ret; +} + +char *setup_fds (char *device) +{ char *odevice; + uid_t uid=getuid(); + struct stat64 sb,sc; + int fd; + + /* + * I ignore return values from set{re}uid calls because if + * they fail we have no privileges to care about and should + * just proceed anyway... + */ +#if 0 +#define GET_REAL + /* + * Get real, but preserve saved uid. I count that user is + * logged on console and therefore owns the 'device' [this + * is a PAM's resposibility to arrange]. + */ + setreuid ((uid_t)-1,uid); +#else + /* + * More "traditional" set-root-uid behaviour. I assume that if + * administrator has installed growisofs set-root-uid, then + * [s]he consciously wanted to grant access to /dev/scdN to + * everybody, not just console user. + */ +#endif + + if ((in_fd = open64 (device,O_RDONLY)) < 0) + if (!(errno == ENOMEDIUM || errno == EMEDIUMTYPE) || + (in_fd = open64 (device,O_RDONLY|O_NONBLOCK)) < 0) + fprintf (stderr,":-( unable to open64(\"%s\",O_RDONLY): ",device), + perror (NULL), exit (FATAL_START(errno)); + +#ifdef GET_REAL + setreuid ((uid_t)-1,uid); +#endif + + if (fstat64(in_fd,&sb) < 0) + fprintf (stderr,":-( unable to stat64(\"%s\"): ",device), + perror (NULL), exit (FATAL_START(errno)); + + if (!S_ISBLK(sb.st_mode)) + { setuid(uid); /* drop all privileges */ + close (in_fd); /* reopen as mortal */ + if ((in_fd = open64 (device,O_RDONLY)) < 0) + fprintf (stderr,":-( unable to re-open64(\"%s\",O_RDONLY): ", + device), + perror (NULL), exit (FATAL_START(errno)); + open_rw: + if ((out_fd = open64 (device,O_RDWR)) < 0) + fprintf (stderr,":-( unable to open64(\"%s\",O_RDWR): ",device), + perror (NULL), exit (FATAL_START(errno)); + if (fstat64(out_fd,&sc) < 0) + fprintf (stderr,":-( unable to stat64(\"%s\"): ",device), + perror (NULL), exit (FATAL_START(errno)); + if (sb.st_dev!=sc.st_dev || sb.st_ino!=sc.st_ino) + fprintf (stderr,":-( %s: race condition detected!\n",device), + exit(FATAL_START(EPERM)); + opened_rw: + poor_man = 0; + if (ioctl_handle!=INVALID_HANDLE) + close (ioctl_fd), ioctl_handle = INVALID_HANDLE; + setuid (uid); /* drop all privileges */ + return device; + } + + /* + * O_RDWR is expected to provide for none set-root-uid + * execution under Linux kernel 2.6[.8]. If it fails + * [as under 2.6.8], CAP_SYS_RAWIO in combination + * with set-root-uid should fill in for the kernel + * deficiency... + */ + if ((fd = open64 (device,O_RDWR|O_NONBLOCK)) >= 0) + { if (fstat64 (fd,&sc) < 0) + fprintf (stderr,":-( unable to stat64(\"%s\"): ",device), + perror (NULL), exit (FATAL_START(errno)); + + if (sc.st_rdev != sb.st_rdev) + fprintf (stderr,":-( %s: race condition detected!\n",device), + exit(FATAL_START(EPERM)); + + ioctl_handle=(void *)(long)fd; + } + else + ioctl_handle=(void *)(long)dup(in_fd); + + /* + * get_mmc_profile terminates the program if ioctl_handle is + * not an MMC unit... + */ + mmc_profile = get_mmc_profile (ioctl_handle); + + /* Consume media_changed flag */ + if (ioctl (ioctl_fd,CDROM_MEDIA_CHANGED,CDSL_CURRENT) < 0) + { fprintf (stderr,":-( %s: CD_ROM_MEDIA_CHANGED ioctl failed: ", + device), + perror (NULL), exit (FATAL_START(errno)); + } + + switch (mmc_profile&0xFFFF) + { case 0x11: /* DVD-R */ + case 0x13: /* DVD-RW Restricted Overwrite */ + case 0x14: /* DVD-RW Sequential */ + case 0x15: /* DVD-R Dual Layer Sequential */ + case 0x16: /* DVD-R Dual Layer Jump */ + case 0x1B: /* DVD+R */ + case 0x2B: /* DVD+R Double Layer */ + open_poor_man: + poor_man = 1; + out_fd = dup(ioctl_fd); +#if defined(PR_SET_KEEPCAPS) + if (prctl(PR_SET_KEEPCAPS,1) == 0) do { +#if defined(_LINUX_CAPABILITY_VERSION) && defined(CAP_SYS_RAWIO) && defined(SYS_capset) + struct __user_cap_header_struct h; + struct __user_cap_data_struct d; + + h.version = _LINUX_CAPABILITY_VERSION; + h.pid = 0; + d.effective = 0; + d.permitted = 1<0) goto open_poor_man; + break; + default: + fprintf (stderr,":-( %s: media is not recognized as " + "recordable DVD: %X\n",device,mmc_profile); + exit (FATAL_START(EMEDIUMTYPE)); + } + + /* + * Attempt to locate /dev/raw/raw* + */ +#ifdef GET_REAL +#undef GET_REAL + setreuid((uid_t)-1,0); /* get root for a /dev/raw sake */ +#endif + if ((odevice=find_raw_device (&sb))) /* /dev/raw */ + { if ((out_fd=open64 (odevice,O_RDWR)) < 0) + { if (errno == EROFS) /* must be unpatched kernel */ + goto open_poor_man; + else + fprintf (stderr,":-( unable to open64(\"%s\",O_RDWR): ", + odevice), + perror (NULL), exit (FATAL_START(errno)); + } + device=odevice; + goto opened_rw; + } + if ((mmc_profile&0xFFFF) == 0x12) goto open_rw; /* DVD-RAM */ + else goto open_poor_man; +} + +#elif defined(__OpenBSD__) || defined(__NetBSD__) + +char *setup_fds (char *device) +{ uid_t uid=getuid(); + struct stat sb,sc; + + /* + * We might be entering as euid=root! + */ + if ((in_fd = open (device,O_RDONLY)) < 0) + fprintf (stderr,":-( unable to open(\"%s\",O_RDONLY): ",device), + perror (NULL), exit (FATAL_START(errno)); + + if (fstat (in_fd,&sb) < 0) + fprintf (stderr,":-( unable to stat(\"%s\"): ",device), + perror (NULL), exit (FATAL_START(errno)); + + if (!S_ISCHR(sb.st_mode)) + { if (S_ISBLK(sb.st_mode) && !strncmp (device,"/dev/cd",7)) + { fprintf (stderr,":-) you most likely want to use /dev/r%s instead!\n", + device+5); + if (isatty(0) && !dry_run) poll(NULL,0,5000); + } + setuid(uid); /* drop all privileges */ + close (in_fd); /* reopen as mortal */ + if ((in_fd = open (device,O_RDONLY)) < 0) + fprintf (stderr,":-( unable to reopen(\"%s\",O_RDONLY): ",device), + perror (NULL), exit (FATAL_START(errno)); + open_rw: + if ((out_fd = open (device,O_RDWR)) < 0) + fprintf (stderr,":-( unable to open(\"%s\",O_RDWR): ",device), + perror (NULL), exit (FATAL_START(errno)); + opened_rw: + poor_man = 0; + close (ioctl_fd); + ioctl_handle = INVALID_HANDLE; + setuid (uid); /* drop all privileges */ + return device; + } + + /* + * Still as euid=root! But note that get_mmc_profile makes sure it's + * an MMC device, as it terminates the program if the unit doesn't + * reply to GET CONFIGURATON. In combination with following switch + * this means that if installed set-root-uid, growisofs grants + * access to DVD burner(s), but not to any other device. + */ + ioctl_handle = (void *)(long)open (device,O_RDWR); /* O_RDWR is a must for SCIOCCOMMAND */ + if (ioctl_handle == INVALID_HANDLE) + { fprintf (stderr,":-( unable to open(\"%s\",O_RDWR): ",device), + perror (NULL); + if (errno == EBUSY) + fprintf (stderr," is its block counterpart mounted?\n"); + exit (FATAL_START(errno)); + } + if (fstat(ioctl_fd,&sc) < 0) + fprintf (stderr,":-( unable to stat(\"%s\"): ",device), + perror (NULL), exit (FATAL_START(errno)); + if (sb.st_dev!=sc.st_dev || sb.st_ino!=sc.st_ino) + fprintf (stderr,":-( %s: race condition detected!\n",device), + exit(FATAL_START(EPERM)); + + mmc_profile = get_mmc_profile (ioctl_handle); + switch (mmc_profile&0xFFFF) + { case 0x11: /* DVD-R */ + case 0x13: /* DVD-RW Restricted Overwrite */ + case 0x14: /* DVD-RW Sequential */ + case 0x15: /* DVD-R Dual Layer Sequential */ + case 0x16: /* DVD-R Dual Layer Jump */ + case 0x1A: /* DVD+RW */ + case 0x1B: /* DVD+R */ + case 0x2A: /* DVD+RW Double Layer */ + case 0x2B: /* DVD+R Double Layer */ + open_poor_man: + poor_man = 1; + out_fd = dup(ioctl_fd); + setuid (uid); /* drop all privileges */ + return ioctl_device=device; + case 0x12: /* DVD-RAM */ + if (poor_man>0) goto open_poor_man; + out_fd = dup(ioctl_fd); + goto opened_rw; + default: + fprintf (stderr,":-( %s: media is not recognized as " + "recordable DVD: %X\n",device,mmc_profile); + exit (FATAL_START(EMEDIUMTYPE)); + } + /* not actually reached */ + setuid(uid); + goto open_rw; +} + +#elif defined(__FreeBSD__) + +#include +#include +#include + +#undef ioctl_fd +#define ioctl_fd (((struct cam_device *)ioctl_handle)->fd) + +#define PASS_STDIN_TO_MKISOFS + +char *setup_fds (char *device) +{ uid_t uid=getuid(); + struct stat sb,sc; + union ccb ccb; + char pass[32]; /* periph_name is 16 chars long */ + struct cam_device *cam; + int once=1; + + /* + * We might be entering as euid=root! + */ + if ((in_fd = open (device,O_RDONLY)) < 0) + fprintf (stderr,":-( unable to open(\"%s\",O_RDONLY): ",device), + perror (NULL), exit (FATAL_START(errno)); + + if (fstat (in_fd,&sb) < 0) + fprintf (stderr,":-( unable to stat(\"%s\"): ",device), + perror (NULL), exit (FATAL_START(errno)); + + if (!S_ISCHR(sb.st_mode)) + { setuid(uid); /* drop all privileges */ + close (in_fd); /* reopen as mortal */ + if ((in_fd = open (device,O_RDONLY)) < 0) + fprintf (stderr,":-( unable to reopen(\"%s\",O_RDONLY): ",device), + perror (NULL), exit (FATAL_START(errno)); + open_rw: + if ((out_fd = open (device,O_RDWR)) < 0) + fprintf (stderr,":-( unable to open(\"%s\",O_RDWR): ",device), + perror (NULL), exit (FATAL_START(errno)); + if (fstat(out_fd,&sc) < 0) + fprintf (stderr,":-( unable to stat(\"%s\"): ",device), + perror (NULL), exit (FATAL_START(errno)); + if (sb.st_dev!=sc.st_dev || sb.st_ino!=sc.st_ino) + fprintf (stderr,":-( %s: race condition detected!\n",device), + exit(FATAL_START(EPERM)); + opened_rw: + poor_man = 0; + if (ioctl_handle && ioctl_handle != INVALID_HANDLE) + cam_close_device (ioctl_handle); + ioctl_handle = INVALID_HANDLE; + setuid (uid); /* drop all privileges */ + return device; + } + + /* + * Still as euid=root! But note that get_mmc_profile makes sure it's + * an MMC device, as it terminates the program if the unit doesn't + * reply to GET CONFIGURATON. In combination with following switch + * this means that if installed set-root-uid, growisofs grants + * access to DVD burner(s), but not to any other device. + */ + + for (once=1;1;once--) + { memset (&ccb,0,sizeof(ccb)); + ccb.ccb_h.func_code = XPT_GDEVLIST; + if (ioctl (in_fd,CAMGETPASSTHRU,&ccb) < 0) + { if (errno==ENXIO && once) + { if (ioctl (in_fd,CDIOCCLOSE)==0) continue; } + fprintf (stderr,":-( unable to CAMGETPASSTHRU for %s: ",device), + perror (NULL), exit (FATAL_START(errno)); + } + break; + } + + sprintf (pass,"/dev/%.15s%u",ccb.cgdl.periph_name,ccb.cgdl.unit_number); + cam = cam_open_pass (pass,O_RDWR,NULL); + if (cam == NULL) + { fprintf (stderr,":-( unable to cam_open_pass(\"%s\",O_RDWR): ",pass), + perror (NULL); + exit (FATAL_START(errno)); + } + + ioctl_handle = (void *)cam; + + mmc_profile = get_mmc_profile (ioctl_handle); + switch (mmc_profile&0xFFFF) + { case 0x11: /* DVD-R */ + case 0x13: /* DVD-RW Restricted Overwrite */ + case 0x14: /* DVD-RW Sequential */ + case 0x15: /* DVD-R Dual Layer Sequential */ + case 0x16: /* DVD-R Dual Layer Jump */ + case 0x1A: /* DVD+RW */ + case 0x1B: /* DVD+R */ + case 0x2A: /* DVD+RW Double Layer */ + case 0x2B: /* DVD+R Double Layer */ + open_poor_man: + poor_man = 1; + out_fd = dup(in_fd); /* it's ignored in poor_man ... */ + setuid (uid); /* drop all privileges */ + return ioctl_device=cam->device_path; + case 0x12: /* DVD-RAM */ + if (poor_man>0) goto open_poor_man; + break; + default: + fprintf (stderr,":-( %s: media is not recognized as " + "recordable DVD: %X\n",device,mmc_profile); + exit (FATAL_START(EMEDIUMTYPE)); + } + setuid(uid); + goto open_rw; +} + +#elif defined(__sun) || defined(sun) + +#include +#include + +char *setup_fds (char *device) +{ uid_t uid=getuid(); + struct stat64 sb,sc; + int v; + + if ((v=volmgt_running())) + { char *file=NULL,*volname; + + /* + * I leak some memory here, but I don't care... + */ + if ((volname=volmgt_symname (device))) + file=media_findname (volname); + else + file=media_findname (device); + + if (file) device=file; + else v=0; + } + + /* + * We might be entering as euid=root! + */ + if ((in_fd = open64 (device,O_RDONLY)) < 0) + if (errno != ENXIO || + (in_fd = open64 (device,O_RDONLY|O_NONBLOCK)) < 0) + fprintf (stderr,":-( unable to open(\"%s\",O_RDONLY): ",device), + perror (NULL), exit (FATAL_START(errno)); + + if (fstat64 (in_fd,&sb) < 0) + fprintf (stderr,":-( unable to stat(\"%s\"): ",device), + perror (NULL), exit (FATAL_START(errno)); + + if (!S_ISCHR(sb.st_mode)) + { char *s; + if (S_ISBLK(sb.st_mode) && (s=strstr (device,"/dsk/"))) + { fprintf (stderr,":-) you most likely want to use %.*s/r%s instead!\n", + (int)(s-device),device,s+1); + if (isatty(0) && !dry_run) poll(NULL,0,5000); + } + setuid(uid); /* drop all privileges */ + close (in_fd); /* reopen as mortal */ + if ((in_fd = open64 (device,O_RDONLY)) < 0) + fprintf (stderr,":-( unable to reopen(\"%s\",O_RDONLY): ",device), + perror (NULL), exit (FATAL_START(errno)); + open_rw: + if ((out_fd = open64 (device,O_RDWR)) < 0) + fprintf (stderr,":-( unable to open(\"%s\",O_RDWR): ",device), + perror (NULL), exit (FATAL_START(errno)); + if (fstat64(out_fd,&sc) < 0) + fprintf (stderr,":-( unable to stat(\"%s\"): ",device), + perror (NULL), exit (FATAL_START(errno)); + if (sb.st_dev!=sc.st_dev || sb.st_ino!=sc.st_ino) + fprintf (stderr,":-( %s: race condition detected!\n",device), + exit(FATAL_START(EPERM)); + poor_man = 0; + close (ioctl_fd); + ioctl_handle = INVALID_HANDLE; + setuid (uid); /* drop all privileges */ + return device; + } + + /* + * Still as euid=root! But note that get_mmc_profile makes sure it's + * an MMC device, as it terminates the program if the unit doesn't + * reply to GET CONFIGURATON. In combination with following switch + * this means that if installed set-root-uid, growisofs grants + * access to DVD burner(s), but not to any other device. + */ + ioctl_handle = (void *)(long)dup (in_fd); + +#if 0 + if (ioctl(ioctl_handle,CDROMSTART)<0 && errno==ENXIO) + media_load(ioctl_handle); +#endif + + mmc_profile = get_mmc_profile (ioctl_handle); + switch (mmc_profile&0xFFFF) + { case 0x11: /* DVD-R */ + case 0x12: /* DVD-RAM */ + case 0x13: /* DVD-RW Restricted Overwrite */ + case 0x14: /* DVD-RW Sequential */ + case 0x15: /* DVD-R Dual Layer Sequential */ + case 0x16: /* DVD-R Dual Layer Jump */ + case 0x1A: /* DVD+RW */ + case 0x1B: /* DVD+R */ + case 0x2A: /* DVD+RW Double Layer */ + case 0x2B: /* DVD+R Double Layer */ + poor_man = 1; + out_fd = dup(ioctl_fd); +#if 0 /* 'man uscsi' maintains that root privileges are required upon + * issue of USCSI ioctl, we therefore can't drop them... + */ + setuid (uid); /* drop all privileges */ +#endif + return ioctl_device=device; + default: + fprintf (stderr,":-( %s: media is not recognized as " + "recordable DVD: %X\n",device,mmc_profile); + exit (FATAL_START(EMEDIUMTYPE)); + } + setuid(uid); + goto open_rw; +} + +#elif defined(__hpux) + +#ifdef SCTL_MAJOR +# define SCTL_SANITY_CHECK SCTL_MAJOR-1 +# if SCTL_SANITY_CHECK<=0 +# undef SCTL_MAJOR +# endif +# undef SCTL_SANITY_CHECK +#endif + +#ifndef SCTL_MAJOR +#error "SCTL_MAJOR is undefined or not sane." +#endif + +#include +#include + +#define seteuid(x) setreuid((uid_t)-1,x) + +#if 1 +#define CANNOT_PASS_DEV_FD_N_TO_MKISOFS +#elif 0 +--- ./multi.c.orig Wed Dec 25 15:15:24 2002 ++++ ./multi.c Tue Nov 11 17:12:27 2003 +@@ -1067,3 +1067,13 @@ + open_merge_image(path) + char *path; + { ++ int fd; ++ ++ if (sscanf (path,"/dev/fd/%u",&fd) == 1) { ++ int fdd = dup(fd); /* validate file descriptor */ ++ if (fdd < 0) return -1; ++ close (fdd); ++ in_image = fdopen (fd,"rb"); ++ return in_image ? 0 : -1; ++ } ++ +#endif + +#ifdef CANNOT_PASS_DEV_FD_N_TO_MKISOFS +char *get_M_parm (int fd, char *device) +{ struct stat sb; + dev_t m; + char *ret=device; + static char ctl[16]; + + if (fstat (fd,&sb)==0 && S_ISCHR(sb.st_mode)) + { m = minor (sb.st_rdev); + sprintf (ctl,"%d,%d,%d",(m>>16)&0xFF,(m>>12)&0xF,(m>>8)&0xF); + ret = ctl; + } + + return ret; +} +#endif + +char *setup_fds (char *device) +{ uid_t uid=getuid(); + struct stat64 sb,sc; + dev_t m; + static char rscsi [32]; + disk_describe_type ddt; + + /* + * We might be entering as euid=root! + */ + if ((in_fd = open64 (device,O_RDONLY)) < 0) + fprintf (stderr,":-( unable to open(\"%s\",O_RDONLY): ",device), + perror (NULL), exit (FATAL_START(errno)); + + if (fstat64 (in_fd,&sb) < 0) + fprintf (stderr,":-( unable to stat(\"%s\"): ",device), + perror (NULL), exit (FATAL_START(errno)); + + if (!S_ISCHR(sb.st_mode)) + { char *s; + if (S_ISBLK(sb.st_mode) && (s=strstr (device,"/dsk/"))) + { fprintf (stderr,":-) you most likely want to use %.*s/r%s instead!\n", + (int)(s-device),device,s+1); + if (isatty(0) && !dry_run) poll(NULL,0,5000); + } + setuid(uid); /* drop all privileges */ + close (in_fd); /* reopen as mortal */ + if ((in_fd = open64 (device,O_RDONLY)) < 0) + fprintf (stderr,":-( unable to reopen(\"%s\",O_RDONLY): ",device), + perror (NULL), exit (FATAL_START(errno)); + open_rw: + if ((out_fd = open64 (device,O_RDWR)) < 0) + fprintf (stderr,":-( unable to open(\"%s\",O_RDWR): ",device), + perror (NULL), exit (FATAL_START(errno)); + if (fstat64(out_fd,&sc) < 0) + fprintf (stderr,":-( unable to stat(\"%s\"): ",device), + perror (NULL), exit (FATAL_START(errno)); + if (sb.st_dev!=sc.st_dev || sb.st_ino!=sc.st_ino) + fprintf (stderr,":-( %s: race condition detected!\n",device), + exit(FATAL_START(EPERM)); + poor_man = 0; + close (ioctl_fd); + ioctl_handle = INVALID_HANDLE; + setuid (uid); /* drop all privileges */ + return device; + } + + /* + * Still as euid=root! But note that get_mmc_profile makes sure it's + * an MMC device, as it terminates the program if the unit doesn't + * reply to GET CONFIGURATON. In combination with following switch + * this means that if installed set-root-uid, growisofs grants + * access to DVD burner(s), but not to any other device. + */ + + m=minor(sb.st_rdev); + + /* Make sure user isn't using /dev/rscsi/cXtYlZ... */ +#if 1 + if (ioctl (in_fd,DIOC_DESCRIBE,&ddt) != 0) +#else + if (major(sb.st_rdev) == SCTL_MAJOR) +#endif + fprintf (stderr,":-( stick to /dev/rdsk/c%ut%u%c%x!\n", + (m>>16)&0xFF,(m>>12)&0xF,'d',(m>>8)&0xF), + exit(FATAL_START(EINVAL)); + + /* + * Even though /dev/rdsk/cXtYdZ accepts SIOC_IO as well, we have to + * use /dev/rscsi/cXtYlZ for pass-through access in order to avoid + * command replay by upper "class" driver... + */ + sprintf (rscsi,"/dev/rscsi/c%ut%u%c%x", + (m>>16)&0xFF,(m>>12)&0xF,'l',(m>>8)&0xF); + ioctl_handle = (void *)(long)open64 (rscsi,O_RDONLY); + if (ioctl_handle == INVALID_HANDLE) + { fprintf (stderr,":-( unable to open(\"%s\",O_RDONLY): ",rscsi), + perror (NULL); + if (errno == ENOENT) + fprintf (stderr,":-! consider " + "'mknod %s c %d 0x%06x; chmod 0600 %s'\n", + rscsi,SCTL_MAJOR,(m&0xFFFF00)|2,rscsi); + exit (FATAL_START(errno)); + } + if (fstat64 (ioctl_fd,&sc) < 0) + fprintf (stderr,":-( unable to stat(\"%s\"): ",rscsi), + perror (NULL), exit (FATAL_START(errno)); + /* Make sure we land on same SCSI ID... */ + if ((m&0xFFFF00) != (minor(sc.st_rdev)&0xFFFF00)) + fprintf (stderr,":-( SCSI ID mismatch: %06x!=%06x\n", + m,minor(sc.st_rdev)), + exit(FATAL_START(EPERM)); + + mmc_profile = get_mmc_profile (ioctl_handle); + switch (mmc_profile&0xFFFF) + { case 0x11: /* DVD-R */ + case 0x12: /* DVD-RAM */ + case 0x13: /* DVD-RW Restricted Overwrite */ + case 0x14: /* DVD-RW Sequential */ + case 0x15: /* DVD-R Dual Layer Sequential */ + case 0x16: /* DVD-R Dual Layer Jump */ + case 0x1A: /* DVD+RW */ + case 0x1B: /* DVD+R */ + case 0x2A: /* DVD+RW Double Layer */ + case 0x2B: /* DVD+R Double Layer */ + poor_man = 1; + out_fd = dup(ioctl_fd); +#if 0 /* HP-UX requires root privileges upon SIOC_IO ioctl */ + setuid (uid); /* drop all privileges */ +#endif + return ioctl_device=rscsi; + default: + fprintf (stderr,":-( %s: media is not recognized as " + "recordable DVD: %X\n",device,mmc_profile); + exit (FATAL_START(EMEDIUMTYPE)); + } + setuid(uid); + goto open_rw; +} + +/* + * PA-RISC HP-UX doesn't have /dev/zero:-( + */ +static fd_set _dev_zero; + +static int open64_zero(const char *pathname, int flags) +{ int fd; + if (strcmp(pathname,"/dev/zero")) + return open64 (pathname,flags); + else if ((fd=open ("/dev/null",flags)) >= 0) + FD_SET (fd,&_dev_zero); + return fd; +} + +static ssize_t read_zero (int fd, void *buf, size_t count) +{ if (!FD_ISSET(fd,&_dev_zero)) return read (fd,buf,count); + memset (buf,0,count); return count; +} + +static int close_zero (int fd) +{ int ret=close (fd); + if (ret>=0 && FD_ISSET(fd,&_dev_zero)) FD_CLR (fd,&_dev_zero); + return ret; +} + +static int dup2_zero (int oldfd, int newfd) +{ int ret; + ret = dup2 (oldfd,newfd); + if (ret >= 0) + { FD_CLR (newfd,&_dev_zero); + if (FD_ISSET(oldfd,&_dev_zero)) FD_SET (ret,&_dev_zero); + else FD_CLR (ret,&_dev_zero); + } + return ret; +} +#define open64 open64_zero +#define read read_zero +#define close close_zero +#define dup2 dup2_zero + +#elif defined(__sgi) + +#include +#include +#include + +char *setup_fds (char *device) +{ uid_t uid=getuid(); + struct stat64 sb,sc; + char hw_path[MAXPATHLEN],*s; + int hw_len=sizeof(hw_path)-1; + int bus=0,tgt=4,lun=0; /* default config for O2 */ + static char rscsi[64]; + + /* + * We might be entering as euid=root! + */ + if ((in_fd = open64 (device,O_RDONLY)) < 0) + { if (errno==EIO) goto tray_might_be_open; + fprintf (stderr,":-( unable to open(\"%s\",O_RDONLY): ",device), + perror (NULL), exit (FATAL_START(errno)); + } + + if (fstat64 (in_fd,&sb) < 0) + fprintf (stderr,":-( unable to stat(\"%s\"): ",device), + perror (NULL), exit (FATAL_START(errno)); + + if (!S_ISCHR(sb.st_mode)) + { if (S_ISBLK(sb.st_mode) && !strncmp (device,"/dev/dsk",7)) + { fprintf (stderr,":-) you most likely want to use " + "/dev/r%s instead!\n",device+5); + if (isatty(0) && !dry_run) poll(NULL,0,5000); + } + open_rw: + setuid(uid); /* drop all privileges */ + close (in_fd); /* reopen as mortal */ + if ((in_fd = open64 (device,O_RDONLY)) < 0) + fprintf (stderr,":-( unable to reopen(\"%s\",O_RDONLY): ",device), + perror (NULL), exit (FATAL_START(errno)); + if ((out_fd = open64 (device,O_RDWR)) < 0) + fprintf (stderr,":-( unable to open(\"%s\",O_RDWR): ",device), + perror (NULL), exit (FATAL_START(errno)); + opened_rw: + poor_man = 0; + close (ioctl_fd); + ioctl_handle = INVALID_HANDLE; + setuid (uid); /* drop all privileges */ + return device; + } + + /* + * Still as euid=root! But note that get_mmc_profile makes sure it's + * an MMC device, as it terminates the program if the unit doesn't + * reply to GET CONFIGURATON. In combination with following switch + * this means that if installed set-root-uid, growisofs grants + * access to DVD burner(s), but not to any other device. + */ + + tray_might_be_open: + + if ((in_fd<0) ? attr_get (device,"_devname",hw_path,&hw_len,0) : + attr_getf (in_fd,"_devname",hw_path,&hw_len,0) ) + fprintf (stderr,":-( unable to obtain hw_path for \"%s\": ",device), + perror (NULL), exit (FATAL_START(errno)); + if (hw_len>=sizeof(hw_path)) hw_len=sizeof(hw_path)-1; /* paranoia */ + hw_path[hw_len]='\0'; + + if ((s=strstr(hw_path,"/scsi_ctlr/"))) + sscanf (s,"/scsi_ctlr/%d/target/%d/lun/%d/",&bus,&tgt,&lun); + + /* Make sure user is using /dev/rdsk/dksXdYlZvol... */ + if ((s=strstr(hw_path,"/disk/volume/char"))==NULL) + { if (lun) + fprintf (stderr,":-( stick to /dev/rdsk/dks%dd%dl%dvol!\n", + bus,tgt,lun); + else + fprintf (stderr,":-( stick to /dev/rdsk/dks%dd%dvol!\n", + bus,tgt); + exit(FATAL_START(EINVAL)); + } + + memcpy (s,"/scsi",6); + ioctl_handle = (void *)(long)open64 (hw_path,O_RDWR); + if (ioctl_handle == INVALID_HANDLE) + fprintf (stderr,":-( unable to open(\"%s\",O_RDWR): ",hw_path), + perror (NULL), exit (FATAL_START(errno)); + if (fstat64 (ioctl_fd,&sc) < 0) + fprintf (stderr,":-( unable to stat(\"%s\"): ",hw_path), + perror (NULL), exit (FATAL_START(errno)); + memcpy (s,"/disk/volume/char",6); + + mmc_profile = get_mmc_profile (ioctl_handle); + switch (mmc_profile&0xFFFF) + { case 0x11: /* DVD-R */ + case 0x13: /* DVD-RW Restricted Overwrite */ + case 0x14: /* DVD-RW Sequential */ + case 0x15: /* DVD-R Dual Layer Sequential */ + case 0x16: /* DVD-R Dual Layer Jump */ + case 0x1A: /* DVD+RW */ + case 0x1B: /* DVD+R */ + case 0x2A: /* DVD+RW Double Layer */ + case 0x2B: /* DVD+R Double Layer */ + open_poor_man: + poor_man = 1; + out_fd = dup (ioctl_fd); + if (in_fd<0 && (in_fd=open64 (hw_path,O_RDONLY))<0) + /* hope for the best? */ ; + setuid (uid); /* drop all privileges */ + mediad_get_exclusiveuse (hw_path,"growisofs"); + if (mediad_last_error ()==RMED_NOERROR) + putenv ("MEDIAD_GOT_EXCLUSIVEUSE="); /* kludge... */ + sprintf (rscsi,"/dev/scsi/sc%dd%dl%d",bus,tgt,lun); + return ioctl_device=rscsi; /* might be bogus... */ + case 0x12: /* DVD-RAM */ + /* Some of latest tentative IRIX releases seem to + * implement DVD-RAM writing at dksc level, but I'm + * not sure which one. So I just fall down to poor-man, + * at least for now... */ + goto open_poor_man; + break; + default: + fprintf (stderr,":-( %s: media is not recognized as " + "recordable DVD: %X\n",device,mmc_profile); + exit (FATAL_START(EMEDIUMTYPE)); + } + /* not actually reached */ + setuid(uid); + goto open_rw; +} + +#elif defined(_WIN32) + +#define CANNOT_PASS_DEV_FD_N_TO_MKISOFS +#define PASS_STDIN_TO_MKISOFS + +static ssize_t pread64 (int fd,void *p,size_t sz,off64_t off) +{ HANDLE h = (HANDLE)_get_osfhandle(fd); + OVERLAPPED ov; + DWORD br=0; /* bytes read */ + + if (h==INVALID_HANDLE_VALUE) return -1; + memset (&ov,0,sizeof(ov)); + ov.Offset = (DWORD)(off&0xFFFFFFFF); + ov.OffsetHigh = (DWORD)(off>>32); + + return ReadFile (h,p,sz,&br,&ov) ? br : -1; +} + +static ssize_t pwrite64 (int fd,const void *p,size_t sz,off64_t off) +{ HANDLE h = (HANDLE)_get_osfhandle(fd); + OVERLAPPED ov; + DWORD bw=0; /* bytes written */ + + if (h==INVALID_HANDLE_VALUE) return -1; + memset (&ov,0,sizeof(ov)); + ov.Offset = (DWORD)(off&0xFFFFFFFF); + ov.OffsetHigh = (DWORD)(off>>32); + + return WriteFile (h,p,sz,&bw,&ov) ? bw : -1; +} + +static struct { + unsigned long fds_bits[512/sizeof(unsigned long)]; + } _dev_zero; +#define NFDBITS (sizeof(unsigned long)*8) +#define _FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1UL << ((n) % NFDBITS))) +#define _FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1UL << ((n) % NFDBITS))) +#define _FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1UL << ((n) % NFDBITS))) + +/* + * This subroutine is trimmed for particular growisofs needs! + */ +static int open64_zero(const char *pathname, int flags) +{ HANDLE h; + int fd,zero=0; + DWORD access=GENERIC_READ; + + if (!strcmp (pathname,"/dev/null")) pathname="NUL:", zero=0; + else if (!strcmp (pathname,"/dev/zero")) pathname="NUL:", zero=1; + + if (flags & O_RDONLY) access=GENERIC_READ; + else if (flags & O_WRONLY) access=GENERIC_WRITE; + else if (flags & O_RDWR) access=GENERIC_READ|GENERIC_WRITE; + + h = CreateFile(pathname,access, + /* always share for write as I commonly open same + * file twice: with O_RDONLY and with O_WRONLY... */ + FILE_SHARE_READ|FILE_SHARE_WRITE, + NULL, /* don't inherit */ + OPEN_EXISTING, /* and never create any files */ + FILE_FLAG_NO_BUFFERING| /* bypass file system cache */ + (flags&O_WRONLY)?FILE_FLAG_WRITE_THROUGH:0, + NULL); + if (h == INVALID_HANDLE_VALUE) return -1; + + flags &= ~_O_TEXT; + flags |= _O_BINARY|_O_NOINHERIT; + fd = _open_osfhandle((size_t)h,flags); + if (fd>=0 && zero) _FD_SET (fd,&_dev_zero); + + return fd; +} + +static ssize_t read_zero (int fd, void *buf, size_t count) +{ if (!_FD_ISSET(fd,&_dev_zero)) return _read (fd,buf,count); + memset (buf,0,count); return count; +} + +static int close_zero (int fd) +{ int ret=_close (fd); + if (ret>=0 && _FD_ISSET(fd,&_dev_zero)) FD_CLR (fd,&_dev_zero); + return ret; +} + +static int dup2_zero (int oldfd, int newfd) +{ int ret; + ret = _dup2 (oldfd,newfd); + if (ret >= 0) + { _FD_CLR (newfd,&_dev_zero); + if (_FD_ISSET(oldfd,&_dev_zero))_FD_SET (ret,&_dev_zero); + else _FD_CLR (ret,&_dev_zero); + } + return ret; +} + +#define open64 open64_zero +#define read read_zero +#define close close_zero +#define dup2 dup2_zero + +char *setup_fds (char *device) +{ char dev[32]; + HANDLE h; + + if (device[1] != ':' || device[2] != '\0') + { if ((in_fd = open64 (device,O_RDONLY)) < 0) + fprintf (stderr,":-( unable to open(\"%s\",O_RDONLY): ",device), + perror (NULL), exit (FATAL_START(errno)); + if ((out_fd = open64 (device,O_RDWR)) < 0) + fprintf (stderr,":-( unable to open(\"%s\",O_RDWR): ",device), + perror (NULL), exit (FATAL_START(errno)); + poor_man = 0; + ioctl_handle = INVALID_HANDLE; + + return device; + } + + sprintf(dev,"%.*s\\",sizeof(dev)-2,device); + if (GetDriveType(dev)!=DRIVE_CDROM) + fprintf (stderr,":-( %s is not a CDROM device\n",dev), + exit (FATAL_START(EINVAL)); + + sprintf(dev,"\\\\.\\%.*s",sizeof(dev)-5,device); + h = CreateFile (dev,GENERIC_WRITE|GENERIC_READ, + FILE_SHARE_READ|FILE_SHARE_WRITE, + NULL,OPEN_EXISTING,0,NULL); + if (h==INVALID_HANDLE_VALUE) + fprintf (stderr,":-( unable to open %s: ",dev), + perror (NULL), exit(FATAL_START(errno)); + + ioctl_handle = h; + out_fd = _open_osfhandle((size_t)h,O_RDWR); + /* + * Unfortunately we're forced to pass read-write handle down to + * mkisofs, because we are going to FSCTL_LOCK_VOLUME out_fd and + * then we can't have other handles open. + */ + in_fd = out_fd; + + mmc_profile = get_mmc_profile (ioctl_handle); + switch (mmc_profile&0xFFFF) + { case 0x11: /* DVD-R */ + case 0x12: /* DVD-RAM */ + case 0x13: /* DVD-RW Restricted Overwrite */ + case 0x14: /* DVD-RW Sequential */ + case 0x15: /* DVD-R Dual Layer Sequential */ + case 0x16: /* DVD-R Dual Layer Jump */ + case 0x1A: /* DVD+RW */ + case 0x1B: /* DVD+R */ + case 0x2A: /* DVD+RW Double Layer */ + case 0x2B: /* DVD+R Double Layer */ + poor_man = 1; + return ioctl_device=strdup(dev); + default: + fprintf (stderr,":-( %s: media is not recognized as " + "recordable DVD: %X\n",device,mmc_profile); + exit (FATAL_START(EMEDIUMTYPE)); + } + /* not reached */ +} + +#else +#error "Unsupported OS" +#endif + +#if defined(__unix) || defined(__unix__) + +static double this_very_moment() +{ struct timeval tv; + gettimeofday (&tv,NULL); + return tv.tv_usec/1e6+tv.tv_sec; +} + +static int signals_blocked; +static void (*signal_handler)(void); + +void sigs_mask (int mask) +{ sigset_t set; + + if (signals_blocked == mask) return; + + sigemptyset (&set); + sigaddset (&set,SIGHUP), sigaddset (&set,SIGINT), + sigaddset (&set,SIGTERM), sigaddset (&set,SIGPIPE); + + sigprocmask ((signals_blocked=mask)?SIG_BLOCK:SIG_UNBLOCK,&set,NULL); +} + +static void common_handler(int sig) +{ if (!signals_blocked) + { progress.zero = 0; + (*signal_handler)(); + } +} + +#define sigit(SIG) do { \ + sigaction (SIG,NULL,&sa); \ + sa.sa_mask = mask; \ + sa.sa_handler = common_handler; \ + sa.sa_flags &= ~SA_NODEFER; \ + sa.sa_flags |= SA_RESETHAND; \ + sigaction (SIG,&sa,NULL); \ +} while (0) + +void atsignals(void(*func)(void)) +{ sigset_t mask; + struct sigaction sa; + + signal_handler = func; + + sigemptyset (&mask); + sigaddset (&mask,SIGHUP), sigaddset (&mask,SIGINT), + sigaddset (&mask,SIGTERM), sigaddset (&mask,SIGPIPE); + + sigit (SIGHUP); sigit (SIGINT); + sigit (SIGTERM); sigit (SIGPIPE); +} +#undef sigit + +#elif defined(_WIN32) + +static double this_very_moment() +{ LARGE_INTEGER t; + GetSystemTimeAsFileTime((FILETIME *)&t); + return t.QuadPart/1e7; +} + +static BOOL signals_blocked; +static void (*signal_handler)(void); +static HANDLE signal_thread; + +void sigs_mask (int mask) { signals_blocked = mask; } + +static BOOL WINAPI ctrl_handler (DWORD code) +{ if (!signals_blocked) + { progress.zero = 0; + SuspendThread (signal_thread); + (*signal_handler)(); + } + return TRUE; +} + +void atsignals (void(*func)(void)) +{ signal_handler = func; + + signal_thread = OpenThread (THREAD_SUSPEND_RESUME,FALSE,GetCurrentThreadId()); + if (signal_thread == NULL) + perror (":-( unable to OpenThread"), + _exit (FATAL_START(errno)); + + if (!SetConsoleCtrlHandler (ctrl_handler,TRUE)) + perror (":-( unable to SetConsoleCtrlHandler"), + _exit (FATAL_START(errno)); +} + +#endif + +static unsigned int from_733 (unsigned char *s) +{ unsigned int ret=0; + ret |= s[0]; + ret |= s[1]<<8; + ret |= s[2]<<16; + ret |= s[3]<<24; + return ret; +} + +static void to_733 (unsigned char *s,unsigned int val) +{ s[0] = (val) & 0xFF; + s[1] = (val>>8) & 0xFF; + s[2] = (val>>16) & 0xFF; + s[3] = (val>>24) & 0xFF; + s[4] = (val>>24) & 0xFF; + s[5] = (val>>16) & 0xFF; + s[6] = (val>>8) & 0xFF; + s[7] = (val) & 0xFF; +} + +static int setup_C_parm (char *C_parm,struct iso_primary_descriptor *descr) +{ int next_session=-1,profile=mmc_profile&0xFFFF; + + if (!poor_man || profile==0x1A || profile==0x2A || + profile==0x13 || profile==0x12) + { next_session = from_733(descr->volume_space_size); + /* pad to closest 32K boundary */ + next_session += 15; + next_session /= 16; + next_session *= 16; + sprintf (C_parm,"16,%u",next_session); + } + else if ( profile==0x2B || profile==0x1B || + profile==0x11 || profile==0x14 || + profile==0x15 || profile==0x16) + next_session=plusminus_r_C_parm (ioctl_handle,C_parm); + + return next_session; +} + +/* + * Threads workers + */ +THR_TYPE progress_print (void *arg) +{ double ratio,velocity,slept; + int delta,rbu,nfirst=0; + off64_t outoff=*(off64_t *)arg; + off64_t lastcurrent=outoff,current; +#if defined(__unix) || defined(__unix__) + sigset_t set; + + sigfillset (&set); + pthread_sigmask (SIG_SETMASK,&set,NULL); +#endif + + while (1) + { slept = this_very_moment(); + lastcurrent = progress.current; + poll (NULL,0,3333); + slept -= this_very_moment(); + if (progress.zero==0 || !nfirst++) continue; + if ((current = progress.current) > outoff) + { delta = time (NULL) - progress.zero; + ratio = (double)(progress.final-outoff) / + (double)(current-outoff); + delta *= ratio - 1.0; + velocity=(current-lastcurrent)/(-slept*1024*1385); + rbu = (int)((current - outoff)/DVD_BLOCK); + rbu = highest_ecc_block - rbu; + fprintf (stdout,"%10"LLD"/%"LLD" (%4.1f%%) @%.1fx, " + "remaining %d:%02d " + "RBU %.1f%%\n", /* ring buffer utilization */ + current,progress.final,100.0/ratio, + velocity,delta/60,delta%60, + (100.0*rbu*DVD_BLOCK)/the_buffer_size); + lastcurrent=current; + } + else + { rbu = (int)((current - outoff)/DVD_BLOCK); + rbu = highest_ecc_block - rbu; + fprintf (stdout,"%10"LLD"/%"LLD" (%4.1f%%) @0x, " + "remaining ??:?? " + "RBU %.1f%%\n", /* ring buffer utilization */ + current,progress.final,0.0, + (100.0*rbu*DVD_BLOCK)/the_buffer_size); + } + fflush (stdout); + } +} + +/* + * Synchronization between reader() and builtin_dd() threads is done + * through a semaphore enumerating available ECC blocks in the ring + * buffer and a volatile 32-bit variable denoting highest available + * block. Special note about the synchronization on this variable. + * Most would argue that access to this variable should be serialized + * by a mutex, but is it really required? Being aligned at natural + * processor word boundary [compiler does it!], both read and write + * operations per se are atomic [hardware does it!] and the point is + * that builtin_dd() thread only reads it, while only reader() thread + * updates it. In this case of distinct and atomic reader and writer + * a spin-lock upon given condition for variable in question is more + * than sufficient. The spin-lock is complemented with quantum yield + * in the loop body. This scheme is chosen in order to ensure maximum + * responsiveness upon moment the first data block is available in + * previously exhausted ring buffer, yet give the reader() thread + * every opportunity to put the data there. One might argue that one + * could take a nap in the spin-lock loop body, but the trouble is + * that this is likely to incur undesired effects, because system + * interval timer accuracy is commonly not less and sometimes even + * much larger than characteristic time for recording of a single ECC + * block at ever increasing burning velocity. Some OSes do offer + * adequate interval timer resolution, but there're quite a few among + * them which arrange it by looping in kernel mode for instrumented + * amount of spins. This means that "yielding" spin-lock in user-land + * is as appropriate for all practical reasons. Hibernating would be + * due if a "catastrophic" event, LUN buffer underrun, is a known + * fact, in which case one can afford falling asleep for coarse + * interval ["coarse" refers to OS interval timer resolution in + * comparison to characteristic ECC block recording time]. + */ + +THR_TYPE reader (void *arg) +{ int n,infd=(size_t)arg; + unsigned int off,mask=(the_buffer_size/DVD_BLOCK)-1; + char *block; +#if defined(__unix) || defined(__unix__) + sigset_t set; + + sigfillset (&set); + pthread_sigmask (SIG_SETMASK,&set,NULL); +#endif + + while (1) + { if (!__semaphore_wait(the_ring_semaphore)) { +#if defined(__unix) || defined(__unix__) + if (errno==EINTR) continue; +#endif + return (reader_exit = errno); + } + block = the_buffer + (highest_ecc_block & mask)*DVD_BLOCK; + off = 0; + eintr: + while ((n=read (infd,block+off,DVD_BLOCK-off)) > 0) + { off += n; + if (off == DVD_BLOCK) + { highest_ecc_block++; + break; + } + } + if (n<0) { +#if defined(__unix) || defined(__unix__) + if (errno==EINTR) goto eintr; +#endif + return (reader_exit = errno); + } + if (n==0) + { if (off) memset (block+off,0,DVD_BLOCK-off), + highest_ecc_block++; + break; + } + } + + return (reader_exit = (unsigned int)-1); +} + +/* + * This is executed in main thread context + */ +int builtin_dd (int infd,int outfd,off64_t outoff) +{ char *block; + int n; + unsigned int off,mask; + struct stat64 sb; + off64_t capacity=0,tracksize=0,startoff=outoff; + + if (fstat64 (infd,&sb)) +#ifdef _WIN32 + memset (&sb,0,sizeof(sb)), sb.st_mode = (~_S_IFREG)&_S_IFMT; +#else + perror (":-( unable to fstat64"), exit(FATAL_START(errno)); +#endif + + if (ioctl_handle!=INVALID_HANDLE) + capacity = get_capacity (ioctl_handle); + + progress.zero=0; + progress.current=outoff; + if (dao_size || S_ISREG(sb.st_mode)) + { tracksize = dao_size ? (dao_size*CD_BLOCK) : sb.st_size; + progress.final=outoff+tracksize; + if (capacity && progress.final > capacity) + { fprintf (stderr,":-( %s: %"LLD" blocks are free, " + "%"LLD" to be written!\n", + ioctl_device, + (capacity-outoff)/2048,tracksize/2048); + if (overburn) + fprintf (stderr,":-! ignoring...\n"); + else + close(infd), close(outfd), + exit (FATAL_START(ENOSPC)); + } + } + else progress.final=0; + + /* suck in first 64K and examine ISO9660 Primary Descriptor if present */ + off = 0; + while ((n=read (infd,the_buffer+off,2*DVD_BLOCK-off)) > 0) + { off += n; + if (off == 2*DVD_BLOCK) + { if (!memcmp(the_buffer+DVD_BLOCK,"\1CD001",6)) + { struct iso_primary_descriptor *descr = saved_descriptors; + + /* + * Save descriptor set for use at the end of recording! + */ + memcpy (saved_descriptors,the_buffer+DVD_BLOCK,DVD_BLOCK); + + if (!zero_image) + { if (tracksize==0) + { tracksize=from_733(descr->volume_space_size)*CD_BLOCK; + if (capacity && (outoff+tracksize) > capacity) + { fprintf (stderr,":-( %s: %"LLD" blocks are free, " + "%"LLD" to be written!\n", + ioctl_device, + (capacity-outoff)/2048, + tracksize/2048); + if (overburn) + fprintf (stderr,":-! ignoring...\n"); + else + { n = -1; set_errno(FATAL_START(ENOSPC)); + goto out; + } + } + } + /* else already checked for overburn condition */ + + /* layer_break is meaningful only for -Z recording */ + if (layer_break>0 && !outoff) + { if (tracksize > layer_break*CD_BLOCK*2) + { fprintf (stderr,":-( insane Layer Break position " + "with respect to dataset size\n"); + n = -1; set_errno(FATAL_START(EINVAL)); + goto out; + } + if (!progress.final) progress.final = tracksize; + tracksize = layer_break*CD_BLOCK*2; + } + } + else if (capacity > outoff) + { int i=0; + unsigned int ts = (tracksize=capacity-outoff)/2048; + + while (i<16 && descr->type[0] != (unsigned char)255) + to_733 (descr->volume_space_size,ts), + descr++, i++; + } + else + { fprintf (stderr,":-( capacity is undefined or insane?\n"); + n = -1; set_errno(FATAL_START(EINVAL));/* ... or whatever */ + goto out; + } + } + else if (outoff && zero_image) + { fprintf (stderr,":-( no volume descriptors found " + "in previous session?\n"); + n = -1; set_errno(FATAL_START(ENOTDIR)); /* kludge! */ + goto out; + } + break; + } + } + if (n<=0) goto out; + + if (dry_run) close(infd), close(outfd), exit(0); + + if (quiet<=0) __thread_create(progress_print,&outoff); + + /* yeah, really kludgy, shuffling file descriptor like that... */ + if (zero_image) + close(infd), infd=open64 ("/dev/zero",O_RDONLY); + + highest_ecc_block = off/DVD_BLOCK; + assert (highest_ecc_block==2); + /* Fill the_buffer up to the_buffer_size */ + while ((n=read (infd,the_buffer+off,the_buffer_size-off)) > 0) + { off += n; + if (off == the_buffer_size) + break; + } + if (n<0) goto out; + + highest_ecc_block = (off+DVD_BLOCK-1)/DVD_BLOCK; + + if (off==the_buffer_size) + { the_ring_semaphore = __semaphore_create(the_buffer_size/DVD_BLOCK); + if (the_ring_semaphore == NULL) + perror(":-( failed to create semaphore"), exit(FATAL_START(errno)); + if (__thread_create(reader,(void *)(size_t)infd) == NULL) + perror(":-( failed to create thread"), exit(FATAL_START(errno)); + reader_exit = 0; + } + else + { memset (the_buffer+off,0,the_buffer_size-off); + reader_exit = (unsigned int)-1; /* reader "exited" already */ + } + + if (poor_man) + /* + * See commentary section in growisofs_mmc.cpp for + * further details on poor_mans_setup + */ + pwrite64_method = poor_mans_setup (ioctl_handle, + outoff+tracksize); + + if (!progress.final) + { if (tracksize) progress.final = outoff+tracksize; + else progress.final = capacity; + } + if (capacity && progress.final>capacity) + progress.final = capacity; + + progress.zero=time(NULL); + + off = 0; /* off is now used as written ECC block counter!!! */ + mask = (the_buffer_size/DVD_BLOCK)-1; + while (1) + { /* "yielding" spin-lock */ + while (!reader_exit && (off == highest_ecc_block)) + __thread_yield(); + + if (off == highest_ecc_block) break; /* no more data */ + + block = the_buffer + (off & mask)*DVD_BLOCK; + if ((n=(*pwrite64_method) (outfd,block,DVD_BLOCK,outoff)) != DVD_BLOCK) + { if (n>0) set_errno(EIO); + else if (n==0) set_errno(ENOSPC); + n = -1; + goto out; + } + if (the_ring_semaphore) __semaphore_post(the_ring_semaphore); + off++; + outoff += DVD_BLOCK; + progress.current=outoff; + } + if (n<=0) goto out; + + printf ("builtin_dd: %"LLD"*2KB out @ average %.1fx1385KBps\n", + (outoff-startoff)/2048, + ((outoff-startoff)/(1024.0*1385.0))/(time(NULL)-progress.zero)); +out: + if (quiet<=0) progress.zero=0; /* shut the progress_print thread up */ + + { int saved_errno=errno; + + if (dry_run) close(infd), close(outfd), exit(errno); + + set_errno(outoff ? saved_errno : (n--?saved_errno:FATAL_START(EIO))); + } + + return n; +} + +/* + * Setup pipe to mkisofs and start it + */ +#if defined(__unix) || defined(__unix__) + +void pipe_mkisofs_up (char *mkisofs_argv[],int infd,int outfd,off64_t outoff) +{ pid_t mkisofs_pid; + int fildes[2],ret,n; + + if (pipe (fildes) < 0) + perror (":-( unable to create pipe"), exit(FATAL_START(errno)); + + if ((mkisofs_pid=fork ()) == (pid_t)-1) + perror (":-( unable to fork mkisofs"), exit(FATAL_START(errno)); + else if (mkisofs_pid == 0) + { dup2 (fildes[1],1); + close (fildes[0]); + close (fildes[1]); + close (outfd); /* redundant:-) */ + +#ifdef PASS_STDIN_TO_MKISOFS + dup2(infd,0); + close(infd); + infd=0; +#endif + if ((n=fcntl (infd,F_GETFD))<0) n=0; + fcntl (infd,F_SETFD,n&~FD_CLOEXEC); + /* + * If platform-specific setup_fds did not drop privileges, + * do it now. I ignore return value because if it fails, + * then privileges were dropped already. + */ + setuid(getuid()); + execvp (mkisofs_argv[0],mkisofs_argv); + fprintf (stderr,":-( unable to execute %s: ",mkisofs_argv[0]), + perror (NULL), exit (FATAL_START(errno)); + } + + close (fildes[1]); + + n=builtin_dd(fildes[0],outfd,outoff); + + if (n==0) /* mkisofs must have finished, consume the exit code */ + { if ((waitpid (mkisofs_pid,&ret,0)) == -1) + perror (":-( waitpid failed"), exit (errno); + + if (!WIFEXITED(ret) || WEXITSTATUS(ret)!=0) + fprintf (stderr,":-( mkisofs has failed: %d\n",WEXITSTATUS(ret)), + exit (1); + } + else if (n<0) + { int err = errno; + errno = err&FATAL_MASK; /* they might be passing FATAL_START */ + perror (":-( write failed"), exit (err); + } +} + +#elif defined(_WIN32) + +void pipe_mkisofs_up (char *mkisofs_argv[],int infd,int outfd,off64_t outoff) +{ STARTUPINFO si; + PROCESS_INFORMATION pi; + HANDLE hRead; + int n; + char *cmd = (char *)saved_descriptors; /* borrow it */ + + memset (&si,0,sizeof(si)); + si.cb = sizeof(si); + si.dwFlags = STARTF_USESTDHANDLES; + + if (!CreatePipe (&hRead,&si.hStdOutput,NULL,0)) + perror (":-( unable to create pipe"), exit (FATAL_START(errno)); + SetHandleInformation (si.hStdOutput,HANDLE_FLAG_INHERIT,HANDLE_FLAG_INHERIT); + + si.hStdInput = (HANDLE)_get_osfhandle (infd); + SetHandleInformation (si.hStdInput,HANDLE_FLAG_INHERIT,HANDLE_FLAG_INHERIT); + + si.hStdError = GetStdHandle (STD_ERROR_HANDLE); + SetHandleInformation (si.hStdError,HANDLE_FLAG_INHERIT,HANDLE_FLAG_INHERIT); + + { char **argv,*arg; + size_t len0; + size_t cmdsz = sizeof(saved_descriptors); + + if (cmdsz>32*1024) cmdsz = 32*1024; + + if ((arg=strrchr(mkisofs_argv[0],'\\')))arg++; + else arg = mkisofs_argv[0]; + + cmdsz--; + assert ((len0=strlen (arg)) < cmdsz); + + strcpy (cmd,arg), cmd[len0++] = ' ', cmdsz -= len0; + + for (argv=mkisofs_argv+1;*argv;argv++) + { size_t len1 = strlen (*argv); + int quot = 0; + + if (strchr (*argv,' ') && (*argv)[0]!='"' && (*argv)[len1-1]!='"') + quot = 2; + assert ((len1 + quot) < cmdsz); + + if (quot) cmd[len0++] = '"',cmdsz--; + strcpy (cmd+len0,*argv), cmdsz-=len1, len0+=len1; + if (quot) cmd[len0++] = '"',cmdsz--; + cmd[len0++] = ' '; + } + + if (cmd[len0-1] == ' ') cmd[len0-1] = '\0'; + else cmd[len0] = '\0'; + } + + if (!CreateProcess (mkisofs_argv[0],cmd,NULL,NULL, + HANDLE_FLAG_INHERIT, + 0,NULL,NULL,&si,&pi)) + fprintf (stderr,":-( unable to execute %s: ", mkisofs_argv[0]), + perror(NULL), exit (FATAL_START(errno)); + + memset (saved_descriptors,0,sizeof(saved_descriptors)); + CloseHandle (si.hStdOutput); + CloseHandle (pi.hThread); + + n=builtin_dd(_open_osfhandle((size_t)hRead,O_RDONLY),outfd,outoff); + + if (n==0) /* mkisofs must have finished, consume the exit code */ + { DWORD ret; + + if (GetExitCodeProcess (pi.hProcess,&ret) && ret) + fprintf (stderr,":-( mkisofs has failed: %d\n",ret), + exit (1); + else + perror (":-( GetExitCodeProcess failed"), exit(errno); + } + else if (n<0) + { int err = errno; + set_errno(err&FATAL_MASK); /* they might be passing FATAL_START */ + perror (":-( write failed"), exit (err); + } +} + +#endif + +int main (int argc, char *argv[]) +{ int imgfd=-1; + char *in_device=NULL,*out_device=NULL,*in_image=NULL,*env; + char dev_found; + int i,n,warn_for_isofs=0; + char **mkisofs_argv,C_parm[24],M_parm_[16],*M_parm=M_parm_; + int mkisofs_argc,growisofs_argc; + int next_session=-1,alleged_next_session=-1; + unsigned int new_size; + +#if defined(__unix) || defined(__unix__) +#if !defined(I_KNOW_ALL_ABOUT_SUDO) + if (getenv ("SUDO_COMMAND")) + { fprintf (stderr,":-( %s is being executed under sudo, " + "aborting!\n",argv[0]); + fprintf (stderr," See NOTES paragraph in growisofs " + "manual page for further details.\n"); + exit(FATAL_START(EACCES)); + } +#endif + /* + * This is a set-root-uid "entry point" for listed operations. User + * can't trick this code to unmount arbitrary file system, as [s]he + * has to pass opened file descriptor to the mounted device. As for + * file descriptor passed by this program itself, I rely upon the + * fact that it was appropriately audited at open time in platform- + * specific setup_fds above... + */ + if (*argv[0] == '-') + { int fd; + struct stat fdst; + + chdir ("/"); + if (argc != 3) exit (EINVAL); + fd=atoi (argv[1]); + if (!strcmp(argv[0],"-umount")) + { if (fumount (fd)) exit (errno); + exit (0); + } + else if ( (!strcmp(argv[0],"-reload") && (no_reload=0,1)) || + (!strcmp(argv[0],"-eject") && (no_reload=-1,1)) ) + { if (fstat (fd,&fdst) < 0) + perror (":-( unable to fstat"), exit (1); + + close (fd); + + if (media_reload (argv[2],&fdst)) + perror (":-( unable to reload tray"), exit (1); + exit (0); + } + exit(1); + } + + /* + * Ignore return values as we might be running as mortals + */ + nice(-20); + /* I'd rather do it right after I allocate ring buffer and fire off + * threads, but I'm likely to be running without extra privileges + * by then:-( */ + do { +# ifdef RLIMIT_MEMLOCK + struct rlimit rlim; + + if (getrlimit(RLIMIT_MEMLOCK,&rlim)) break; + + /* those who want to increase beyond DEFAULT_BUF_SIZE_MB have + * to 'limit memorylocked unlimited' or whatever appropriate + * at command prompt or in wrapper script */ + if (rlim.rlim_cur < (DEFAULT_BUF_SIZE_MB+4)*1024*1024) + { rlim.rlim_cur = (DEFAULT_BUF_SIZE_MB+4)*1024*1024; + if (rlim.rlim_max < rlim.rlim_cur) rlim.rlim_max = rlim.rlim_cur; + if (setrlimit(RLIMIT_MEMLOCK,&rlim)) break; + } +# endif +# ifdef __FreeBSD__ + syscall(SYS_mlockall,3); +# else + mlockall(MCL_CURRENT|MCL_FUTURE); +# endif + } while (0); +#endif + + mkisofs_argv = malloc ((argc+3)*sizeof(char *)); + if (mkisofs_argv == NULL) + fprintf (stderr,":-( unable to allocate %lu bytes: ", + (unsigned long)((argc+3)*sizeof(char *))), + perror (NULL), exit (FATAL_START(errno)); + +#if defined(__unix) || defined(__unix__) + env = getenv ("MKISOFS"); + mkisofs_argv[0] = (env?env:"mkisofs"); +#elif defined(_WIN32) + /* + * On Windows I insist on mkisofs.exe to reside in very same + * directory as growisofs.exe. Unlike Unix that is... + */ + { char *backslash,*borrow = (char *)saved_descriptors; + + GetModuleFileName (NULL,borrow,sizeof(saved_descriptors)); + backslash = strrchr(borrow,'\\'); + if (backslash) backslash++; + else backslash = borrow; + strcpy (backslash,"mkisofs.exe"); + mkisofs_argv[0] = strdup(borrow); + memset (saved_descriptors,0,sizeof(saved_descriptors)); + } +#endif + + mkisofs_argc = 1; + growisofs_argc=0; + + _argc=argc, _argv=argv; + + for (i=1;i 2) in_device = argv[i]+2; + else in_device = argv[++i]; + dev_found = 'M'; + } + else if (!strncmp(opt,"-prev-session",13)) + { if (len > 13) in_device = opt+13; + else in_device = argv[++i]; + dev_found = 'M'; + } + else if (argv[i][1] == 'Z') + { if (len > 2) in_device = argv[i]+2; + else in_device = argv[++i]; + dev_found = 'Z'; + } + else if (!strncmp(opt,"-zero-session",13)) + { if (len > 13) in_device = opt+13; + else in_device = argv[++i]; + dev_found = 'Z'; + } + else if (!strcmp(opt,"-poor-man")) + { if (poor_man<0) poor_man = 1; + continue; + } + else if (!strncmp(opt,"-speed",6)) + { char *s; + if (len>6) (s=strchr(opt,'='))?s++:s; + else s=argv[++i]; + if (s) speed_factor=atof(s); + if (speed_factor<=0) + fprintf (stderr,"-speed=%.1f: insane speed factor.\n", + speed_factor), + exit(FATAL_START(EINVAL)); + continue; + } + else if (!strcmp(opt,"-dvd-compat")) + { if (poor_man<0) poor_man = 1; + dvd_compat++; + continue; + } + else if (!strcmp(opt,"-overburn")) + { overburn = 1; + continue; + } + else if (argv[i][1] == 'o') + { if (!strchr(argv[i]+2,'-')) /* somewhat opportunistic... */ + fprintf (stderr,"%s: -o[utput] option " + "is not permitted.\n",argv[0]), + exit(FATAL_START(EINVAL)); + } + else if (!strncmp(opt,"-use-the-force-luke",19)) + { char *s=strchr (opt,'='),*o; + + if (s == NULL) /* backward compatibility */ + no_tty_check = 1; + else + { s++; + if (strstr(s,"tty")) no_tty_check = 1; + if (strstr(s,"dummy")) test_write = 1; + if (strstr(s,"notray")) no_reload = 1; + if (strstr(s,"noload")) no_reload = -1; + if (strstr(s,"wrvfy")) wrvfy = 1; + if (strstr(s,"4gms")) no_4gb_check = 1; + if (strstr(s,"noopc")) no_opc = 1; + if (strstr(s,"moi")) + { quiet=-1; mkisofs_argv[mkisofs_argc++] = "-quiet"; } + if ((o=strstr(s,"dao"))) + { dvd_compat += 256; + /* vvvvvvvvvvv tracksize option takes precedence! */ + if (dao_size==0 && (o[3]==':' || o[3]=='=')) + { dao_size=strtol(o+4,0,0); + if (dao_size<=0) + fprintf (stderr,":-( insane dao%c%d option\n", + o[3],dao_size), + exit(FATAL_START(EINVAL)); + } + } + if ((o=strstr(s,"tracksize"))) + { if (o[9]==':' || o[9]=='=') + { dao_size=strtol(o+10,0,0); + if (dao_size<=0) + fprintf (stderr,":-( insane tracksize%c%d option\n", + o[9],dao_size), + exit(FATAL_START(EINVAL)); + } + } + if ((o=strstr(s,"break"))) + { if (o[5]==':' || o[5]=='=') + { layer_break=strtol(o+6,0,0); + if (layer_break<=0 || layer_break%16) + fprintf (stderr,":-( insane break%c%d option\n", + o[5],layer_break), + exit(FATAL_START(EINVAL)); + } + } + if ((o=strstr(s,"seek")) && next_session<0) + { if (o[4]==':' || o[4]=='=') + { next_session=strtol(o+5,0,0); + if (next_session<0 || next_session%16) + fprintf (stderr,":-( insane seek%c%d option\n", + o[4],next_session), + exit(FATAL_START(EINVAL)); + } + } + if ((o=strstr(s,"bufsize"))) + { if (o[7]==':' || o[7]=='=') + { the_buffer_size=strtol(o+8,&o,0); + if (*o=='M' || *o=='m') + the_buffer_size*=1024*1024; + else if (*o=='K' || *o=='k') + the_buffer_size*=1024; + } + } + } + continue; + } + else if (!strcmp(opt,"-dvd-video")) + { if (poor_man<0) poor_man = 1; + dvd_compat++, growisofs_argc++; + } + else if (!strcmp(opt,"-quiet")) + quiet++, growisofs_argc++; + else if (argv[i][1] == 'C' || !strncmp(opt,"-cdrecord-params",16)) + { char *s=argv[i+1]; + int i1,i2; + if (argv[i][1]=='C' && len>2) s=argv[i]+2; + else i++; + if (sscanf (s,"%d,%d",&i1,&i2) == 2) + alleged_next_session=i2; + continue; + } + else if (argv[i][1] == '#' || !strcmp(opt,"-dry-run")) + { dry_run = 1; + continue; + } + else if (argv[i][1] == '?' || !strcmp(opt,"-help")) + { PRINT_VERSION (argv[0]); + printf ("- usage: %s [-dvd-compat] [-overburn] [-speed=1] \\\n" + " -[ZM] /dev/dvd \n",argv[0]); + printf (" for see 'mkisofs %s'\n",opt); + exit (FATAL_START(EINVAL)); + } + else if (strstr (opt,"-version")) + { PRINT_VERSION (argv[0]); + printf (" front-ending to %s: ",mkisofs_argv[0]); + fflush (stdout); +#if defined(__unix) || defined(__unix__) + setuid(getuid()); + execlp (mkisofs_argv[0],mkisofs_argv[0],"-version",NULL); +#elif defined(_WIN32) + if (_spawnl (_P_WAIT,mkisofs_argv[0], + "mkisofs.exe","-version",NULL) != -1) + exit(0); +#endif + fprintf (stderr,"\n- unable to execute %s: ", + mkisofs_argv[0]), + perror (NULL), exit (FATAL_START(errno)); + } + } + + if (dev_found && in_device) + { if (*in_device == '=') in_device++; + + if (1 || dev_found == 'Z') + { if ((in_image = strchr(in_device,'='))) + { +#if defined(__unix) || defined(__unix__) + uid_t euid=geteuid(); + seteuid (getuid()); /* get real for parsing -[ZM] a=b */ +#endif + while (in_image) + { *in_image='\0'; + set_errno(0); +#ifdef _WIN32 /* have to treat d:=image.iso separately:-( */ + if (in_image[-1] == ':') break; +#endif + if (access (in_device,F_OK)==0 || errno!=ENOENT) + break; + *in_image='=', + in_image=strchr(in_image+1,'='); + } + + if (errno) + fprintf (stderr,":-( \"%s\": unexpected errno:", + in_device), + perror (NULL), exit (FATAL_START(errno)); + + if (in_image) + { in_image++; + + if (sscanf(in_image,"/dev/fd/%u",&imgfd) == 1) + imgfd = dup (imgfd); /* validate descriptor */ +#ifdef O_DIRECT + else if ((imgfd = open64(in_image,O_RDONLY|O_DIRECT))<0) +#else + else +#endif + imgfd = open64(in_image,O_RDONLY); + + if (imgfd < 0) + fprintf (stderr,":-( unable to open64(\"%s\"," + "O_RDONLY): ",in_image), + perror (NULL), exit(FATAL_START(errno)); + + if (!strcmp(in_image,"/dev/zero")) + zero_image=1; + } +#if defined(__unix) || defined(__unix__) + seteuid (euid); /* revert to saved [set-]uid */ +#endif + } + } + + /* + * Sets up in_fd, out_fd, ioctl_handle and poor_man variable. + * This procedure is platform-specific. If the program + * has to be installed set-root-uid, then this procedure + * is the one to drop privileges [if appropriate]. + */ + out_device=setup_fds (in_device); + + *(long *)saved_descriptors[0].type = 0; /* redundant:-) */ + if (mmc_profile&0x10000) /* blank media */ + n=0, set_errno(EIO); + else + { n=pread64 (in_fd,saved_descriptors,2048,VOLDESC_OFF*CD_BLOCK); + if (n==0) set_errno(EIO); /* end-of-file reached? */ + } + if (n!=2048 && dev_found=='M') + perror (":-( unable to pread64(2) primary volume descriptor"), + fprintf (stderr," you most likely want to use -Z option.\n"), + exit (FATAL_START(errno)); + + if (dev_found == 'M') + { if (memcmp (saved_descriptors[0].type,"\1CD001",6)) + fprintf (stderr,":-( %s doesn't look like isofs...\n", + in_device), exit(FATAL_START(EMEDIUMTYPE)); + + next_session=setup_C_parm(C_parm,saved_descriptors); + + if (imgfd>=0) + { if (zero_image) + { off64_t off=(atoi(C_parm)-16)*CD_BLOCK; + + dup2(in_fd,imgfd); /* kludge! */ + if (lseek64 (imgfd,off,SEEK_SET) == (off64_t)-1) + fprintf (stderr,":-( %s: unable to lseek(%"LLD"): ", + in_device,off), + perror (NULL), exit(FATAL_START(errno)); + } else if (alleged_next_session!=next_session) + fprintf (stderr,"%s: -C argument is %s.\n", + argv[0],alleged_next_session>=0? + "insane":"undefined"), + exit(FATAL_START(EINVAL)); + } + else if (next_session > (0x200000-0x5000)) /* 4GB/2K-40MB/2K */ + if ((mmc_profile&0xFFFF)!=0x2B || !no_4gb_check) + fprintf (stderr,":-( next session would cross 4GB " + "boundary, aborting...\n"), + exit (FATAL_START(ENOSPC)); + + mkisofs_argv[mkisofs_argc++] = "-C"; + mkisofs_argv[mkisofs_argc++] = C_parm; +#ifdef CANNOT_PASS_DEV_FD_N_TO_MKISOFS +# ifdef PASS_STDIN_TO_MKISOFS + M_parm = "-"; +# else + M_parm = get_M_parm (in_fd,in_device); +# endif +#else +# ifdef PASS_STDIN_TO_MKISOFS + M_parm = "/dev/fd/0"; +# else + sprintf (M_parm,"/dev/fd/%d",in_fd); +# endif +#endif + mkisofs_argv[mkisofs_argc++] = "-M"; + mkisofs_argv[mkisofs_argc++] = M_parm; + len = 3 + strlen(C_parm) + 3 + strlen(M_parm); + growisofs_argc += 4; + } + else + { if (!memcmp (saved_descriptors[0].type,"\1CD001",6)) + warn_for_isofs = 1; + if (next_session<0) next_session = 0; + continue; + } + *(long *)saved_descriptors[0].type = 0; + } + else + { mkisofs_argv[mkisofs_argc++] = argv[i]; } + } + + if (in_device == NULL) + fprintf (stderr,"%s: previous \"session\" device is not specified, " + "do use -M or -Z option\n",argv[0]), + exit (FATAL_START(EINVAL)); + + if (imgfd<0) + { if (mkisofs_argc==1) + fprintf (stderr,"%s: no mkisofs options specified, " + "aborting...\n",argv[0]), + exit (FATAL_START(EINVAL)); + } + else if ((mkisofs_argc-growisofs_argc)>1) + fprintf (stderr,"%s: no mkisofs options are permitted with =, " + "aborting...\n",argv[0]), + exit (FATAL_START(EINVAL)); + + mkisofs_argv[mkisofs_argc] = NULL; + + assert (next_session!=-1); + assert (in_fd!=-1); + assert (out_fd!=-1); + + /* + * ensure highest_ecc_block is properly aligned + * to ensure access atomicity + */ + assert ((((size_t)&highest_ecc_block)&(sizeof(highest_ecc_block)-1))==0); + + /* + * Ensure the_buffer_size is degree of 2 + */ + { unsigned int shift=0,sz=the_buffer_size; + + while (sz>>=1) shift++; + if (shift<20) shift=20; /* 1MB is minumum */ + sz = 1<0 && + (profile==0x2B || profile==0x1B || + profile==0x11 || profile==0x15 || profile==0x16)) + dvd_compat=0; + /* ... except when filling the media up:-) */ + if (next_session>0 && zero_image) dvd_compat=1; + } + + if (warn_for_isofs) + { int fd=-1; +#if defined(__unix) || defined(__unix__) + fd=open("/dev/tty",O_RDONLY); +#elif defined(_WIN32) + fd=_open("CONIN$",O_RDONLY); +#endif + if (fd>=0) + { if (isatty (fd)) warn_for_isofs |= 2; + close (fd); + } + else if (isatty (0)) warn_for_isofs |= 2; + + if (no_tty_check || (warn_for_isofs&2)) + fprintf (stderr,"WARNING: %s already carries isofs!\n",in_device), + printf ("About to execute '"); + else + fprintf (stderr,"FATAL: %s already carries isofs!\n",in_device), + exit(FATAL_START(EBUSY)); + } + else + printf ("Executing '"); + + if (imgfd>=0) + printf ("builtin_dd if=%s of=%s obs=32k seek=%u", + in_image,out_device,next_session/16); + else + { for (i=0;i=0) do { int f; \ + if ((f=fcntl ((fd),F_GETFD)) < 0) f=0; \ + fcntl ((fd),F_SETFD,f|FD_CLOEXEC); } while (0) + + CLOSEONEXEC(in_fd); + CLOSEONEXEC(out_fd); + CLOSEONEXEC(ioctl_fd); +#undef CLOSEONEXEC + +#endif + + if (!dry_run && (poor_man || next_session==0)) /* unmount media */ +#if defined(__unix) || defined(__unix__) + { pid_t rpid,pid; + int rval; + + if ((pid=fork()) == (pid_t)-1) + perror (":-( unable to fork -umount"), exit (FATAL_START(errno)); + + /* pass through set-root-uid if any */ + if (pid == 0) + { char str[12]; + + if ((rval=fcntl (in_fd,F_GETFD))<0) rval=0; + fcntl (in_fd,F_SETFD,rval&~FD_CLOEXEC); + + sprintf (str,"%d",in_fd); + execlp (argv[0],"-umount",str,in_device,NULL); + exit (FATAL_START(errno)); + } + while (1) + { rpid = waitpid (pid,&rval,0); + if (rpid == (pid_t)-1 || (rpid != pid && (errno=ECHILD,1))) + { if (errno==EINTR) continue; + else perror (":-( waipid failed"), + exit(FATAL_START(errno)); + } + if (WIFSTOPPED(rval)) continue; + errno=0; + if (WIFEXITED(rval)) errno=WEXITSTATUS(rval); + else errno=ECHILD; + break; + } + set_errno(errno&FATAL_MASK); + if (errno) + { if (errno==EBUSY) + fprintf (stderr,":-( %s: unable to proceed with recording: ", + in_device), +#ifdef __hpux + fprintf (stderr,"device is mounted\n"), +#else + fprintf (stderr,"unable to unmount\n"), +#endif + exit (FATAL_START(errno)); + else + fprintf (stderr,":-( unable to umount %s: ",in_device); + perror (""), exit (FATAL_START(errno)); + } +#ifdef __linux + /* + * Linux 2.6 kernel allows to claim O_EXCL on block device. + * However! It does not really exclude the possibility for + * another application to interfere with ongoing recording, + * because kernel serializes *only* O_EXCL calls and lets + * through those without. And the trouble naturally is that + * there are automounting/autoplaying facilities, which + * don't adhere to O_EXCL. Note that mount(2) system call + * does acquire such exclusive lock at kernel level all by + * itself, but most commonly it's user-land file system + * detection subroutines, those determining 3rd argument + * for mount(2) call, which turn to be the culprit. E.g. + * among examined mount(8) and submountd(8) both were found + * needing patching. Once mount(8) is patched, one can allow + * autofs to handle DVD recorder [because automount deploys + * mount(8)]. And once submountd(8) is patched it would be + * possible to exempt subfs mount point from umount method + * in transport.hxx. Keep in mind that this "list" is not + * by any means complete... + */ + for (rval=3;rval>=0;rval--) /* reuse rval as retry count */ + { /* + * For reference, I can't do it earlier as exclusive lock + * could have been granted to mounted file system, the one + * we've tried to unmount just a moment ago... + */ + int fd = open64 (ioctl_device,O_RDONLY|O_NONBLOCK|O_EXCL); + struct stat64 sb,sc; + + if (fd<0) + { if (errno==EBUSY) + { if (rval==0) + fprintf (stderr,":-( unable to O_EXCL %s: some" + "one was in time to remount?\n", + ioctl_device), + exit (FATAL_START(errno)); + + poll(NULL,0,157); /* retry... */ + } + else break; /* running under 2.4? */ + } + else + { if (fstat64 (ioctl_fd,&sb) || fstat64 (fd,&sc) || + sc.st_rdev != sc.st_rdev) + fprintf (stderr,":-( %s: race condition detected!\n", + ioctl_device), + exit(FATAL_START(EPERM)); + /* + * Note that I effectively leak this file descriptor, + * but as it's meant to be closed at the very end, I + * might as well let kernel clean it up automagically + * upon process termination... + */ + break; + } + } +#endif + } +#elif defined(_WIN32) + { if (fumount (ioctl_fd)) + fprintf (stderr,":-( unable to umount %s: ",in_device), + perror (NULL), exit (FATAL_START(errno)); + } +#else + { } +#endif + + if (poor_man) + { out_device=in_device; + if (!ioctl_device) ioctl_device=out_device; + + switch (mmc_profile&0xFFFF) + { case 0x11: /* DVD-R Sequential */ + case 0x12: /* DVD-RAM */ + case 0x13: /* DVD-RW Restricted Overwrite */ + case 0x14: /* DVD-RW Sequential */ + case 0x15: /* DVD-R Dual Layer Sequential */ +#if 0 /* reserved for now... */ + case 0x16: /* DVD-R Dual Layer Jump */ +#endif + case 0x1A: /* DVD+RW */ + case 0x1B: /* DVD+R */ + case 0x2A: /* DVD+RW Double Layer */ + case 0x2B: /* DVD+R Double Layer */ + break; + default: + fprintf (stderr,":-( %s: mounted media doesn't appear to be " + "[supported] DVD%sRW or DVD%sR\n", + out_device,plusminus_locale(),plusminus_locale()), + exit(FATAL_START(EMEDIUMTYPE)); + break; + } + } + + if (imgfd>=0) + { quiet--; + if (builtin_dd (imgfd,out_fd,next_session*CD_BLOCK) < 0) + { int err = errno; + set_errno(err&FATAL_MASK); /* they might be passing FATAL_START */ + perror (":-( write failed"), exit (err); + } + set_errno(0); + exit (0); + /* NOT REACHED */ + } + + pipe_mkisofs_up (mkisofs_argv,in_fd,out_fd,next_session*CD_BLOCK); + + /* + * Recall that second 32KB written in this session can be found + * in saved_descriptors[]! And now note that poor_man_rewritable() + * fills the first 32KB of the_buffer with volume descriptor set + * from the beginning of the volume, if appropriate that is! The + * latter is a workaround hook for DVD-RW Restricted Overwrite + * interfering with DVD+RW kernel patch... Is this mode ugly or + * is it ugly? G-r-r-r... + */ + if (next_session!=0 && + (!poor_man || poor_man_rewritable (ioctl_handle,the_buffer))) + { struct iso_primary_descriptor *descr = + (struct iso_primary_descriptor *)the_buffer; + + if (memcmp (saved_descriptors[0].type,"\1CD001",6)) + fprintf (stderr,":-( %s:%d doesn't look like isofs!\n", + out_device,next_session), + exit (set_errno(EMEDIUMTYPE)); + + fprintf (stderr,"%s: copying volume descriptor(s)\n", + poor_man?ioctl_device:out_device); + + new_size = from_733(saved_descriptors[0].volume_space_size) + + next_session; + + if (!poor_man && (set_errno(0), pread64 (out_fd,descr,DVD_BLOCK, + VOLDESC_OFF*CD_BLOCK)) != DVD_BLOCK) + set_errno(errno?errno:EIO), + perror (":-( unable to pread64(2) volume descriptors set"), + exit (errno); + + memcpy (descr+0,&saved_descriptors[0],sizeof(*descr)); + to_733(descr[0].volume_space_size,new_size); + + /* + * copy secondary volume descriptor(s) which are expected to + * appear in the very same order. + */ + for (i=1;i +#include + +#define SIGS_BLOCK 1 +#define SIGS_UNBLOCK 0 +extern "C" void sigs_mask (int); +extern "C" void atsignals (void (*)(void)); + +#define ONEX 1352 // 1385 * 1000 / 1024 + +static int media_written=0,next_track=1, + is_dao=0,quickgrown=0,do_reload=1; +static unsigned int stdnap=(256*1000)/ONEX, // measured in milliseconds + buf_size=512; // measured in KBs +static class __velocity__ { + private: + int value; + public: + int operator=(int v) { if (v>=ONEX) stdnap=(buf_size*500)/v; + else stdnap=(buf_size*500)/ONEX; + return value = v; + } + operator int() { return value; } +} velocity; + +static void *ioctl_handle=(void *)-1; +#ifndef ioctl_fd +#define ioctl_fd ((long)ioctl_handle) +#endif + +static unsigned int next_wr_addr=1; // it starts as boolean +static unsigned int dao_blocks=0; +static unsigned char formats[260],disc_info[32]; + +extern "C" { +extern int dvd_compat,test_write,no_reload,mmc_profile,_argc, + wrvfy,no_opc; +extern double speed_factor; +extern char *ioctl_device,**_argv; +} + +extern "C" +int fumount (int fd) +{ Scsi_Command cmd; + return cmd.umount(fd); +} + +extern "C" +int media_reload (char *name=NULL,struct stat *sb=NULL) +{ if (name==NULL) + { Scsi_Command cmd(ioctl_handle); + + pioneer_stop (cmd); + +#if defined(RELOAD_NEVER_NEEDED) +#undef RELOAD_NEVER_NEEDED +#define RELOAD_NEVER_NEEDED 1 +#else +#define RELOAD_NEVER_NEEDED 0 +#endif + if (RELOAD_NEVER_NEEDED || no_reload>0) + { cmd[0] = 0x1E; // ALLOW MEDIA REMOVAL + cmd[5] = 0; + cmd.transport (); + + return (errno=0); + } +#if !RELOAD_NEVER_NEEDED + + char str[12]; + int n; + + if ((n=fcntl (ioctl_fd,F_GETFD))<0) n=0; + fcntl (ioctl_fd,F_SETFD,n&~FD_CLOEXEC); + + sprintf (str,"%ld",ioctl_fd); + execlp(_argv[0],no_reload<0?"-eject":"-reload", + str,ioctl_device,(void *)NULL); + } + else + { + { Scsi_Command cmd; + + if (!cmd.associate (name,sb)) return 1; + + if (cmd.is_reload_needed()) + { fprintf (stderr,"%s: reloading tray\n",name); + cmd[0] = 0x1E; // ALLOW MEDIA REMOVAL + cmd[5] = 0; + if (cmd.transport ()) return 1; + + while (1) // Pioneer DVR-x05 needs this... + { cmd[0] = 0x1B; // START/STOP UNIT + cmd[1] = 0x1; // "IMMED" + cmd[4] = 0x2; // "Eject" + cmd[5] = 0; + if (cmd.transport() == 0x20407) // "OP IN PROGRESS" + { poll (NULL,0,333); + continue; + } + break; + } + // yes, once again, non-"IMMED"... + cmd[0] = 0x1B; // START/STOP UNIT + cmd[4] = 0x2; // "Eject" + cmd[5] = 0; + if (cmd.transport()) return 1; + } +#if defined(__sun) || defined(sun) + else if (volmgt_running()) + { setuid(getuid()); + execl("/usr/bin/volrmmount","volrmmount","-i",name,(void*)NULL); + return 0; // not normally reached + } +#endif + else return 0; // m-m-m-m! patched kernel:-) + } + if (no_reload>=0) + { Scsi_Command cmd; + if (cmd.associate (name,sb)) + { cmd[0] = 0x1B; // START/STOP UNIT + cmd[1] = 0x1; // "IMMED" + cmd[4] = 0x3; // "Load" + cmd[5] = 0; + cmd.transport (); + } + errno=0; // ignore all errors on load + } + return 0; +#endif + } + + return 1; +} + +extern "C" +int get_mmc_profile (void *fd) +{ Scsi_Command cmd(fd); + unsigned char buf[8],inq[128]; + int profile=0,once=1,blank=0,err; + unsigned int len; + + // INQUIRY is considered to be "non-intrusive" in a sense that + // it won't interfere with any other operation nor clear sense + // data, which might be important to retain for security reasons. + + cmd[0] = 0x12; // INQUIRY + cmd[4] = 36; + cmd[5] = 0; + if ((err=cmd.transport(READ,inq,36))) + sperror ("INQUIRY",err), + exit (FATAL_START(errno)); + + // make sure we're talking to MMC unit, for security reasons... + if ((inq[0]&0x1F) != 5) + fprintf (stderr,":-( not an MMC unit!\n"), + exit (FATAL_START(EINVAL)); + + do { + cmd[0] = 0x46; + cmd[8] = sizeof(buf); + cmd[9] = 0; + if ((err=cmd.transport(READ,buf,sizeof(buf)))) + sperror ("GET CONFIGURATION",err), + fprintf (stderr,":-( non-MMC unit?\n"), + exit (FATAL_START(errno)); + + if ((profile = buf[6]<<8|buf[7]) || !once) break; + + // no media? + cmd[0] = 0; // TEST UNIT READY + cmd[5] = 0; + if ((cmd.transport()&0xFFF00) != 0x23A00) break; + + // try to load tray... + cmd[0] = 0x1B; // START/STOP UNIT + cmd[4] = 0x3; // "Load" + cmd[5] = 0; + if ((err=cmd.transport ())) + sperror ("LOAD TRAY",err), + exit (FATAL_START(errno)); + +#if 1 + wait_for_unit (cmd); +#else + // consume sense data, most likely "MEDIA MAY HAVE CHANGED" + cmd[0] = 0; // TEST UNIT READY + cmd[5] = 0; + if ((err=cmd.transport ()) == -1) + sperror ("TEST UNIT READY",err), + exit (FATAL_START(errno)); +#endif + } while (once--); + + if (profile==0 || (profile&0x30)==0) // no or non-DVD media... + return profile; + + cmd[0] = 0x51; // READ DISC INFORMATION + cmd[8] = sizeof(disc_info); + cmd[9] = 0; + if ((err=cmd.transport (READ,disc_info,sizeof(disc_info)))) + sperror ("READ DISC INFORMATION",err), + exit (FATAL_START(errno)); + + // see if it's blank media + if ((disc_info[2]&3) == 0) blank=0x10000; + + if (profile != 0x1A && profile != 0x13 && profile != 0x12) + return blank|profile; + + cmd[0] = 0x23; // READ FORMAT CAPACITIES + cmd[8] = 12; + cmd[9] = 0; + if ((err=cmd.transport (READ,formats,12))) + sperror ("READ FORMAT CAPACITIES",err), + exit (FATAL_START(errno)); + + len = formats[3]; + if (len&7 || len<16) + fprintf (stderr,":-( FORMAT allocaion length isn't sane"), + exit (FATAL_START(EINVAL)); + + cmd[0] = 0x23; // READ FORMAT CAPACITIES + cmd[7] = (4+len)>>8; + cmd[8] = (4+len)&0xFF; + cmd[9] = 0; + if ((err=cmd.transport (READ,formats,4+len))) + sperror ("READ FORMAT CAPACITIES",err), + exit (FATAL_START(errno)); + + if (len != formats[3]) + fprintf (stderr,":-( parameter length inconsistency\n"), + exit(FATAL_START(EINVAL)); + + // see if it's not formatted + if ((formats[8]&3) != 2) blank = 0x10000; + + return blank|profile; +} + +static unsigned int get_2k_capacity (Scsi_Command &cmd) +{ unsigned char buf[32]; + unsigned int ret=0; + unsigned int nwa,free_blocks; + int i,obligatory,len,err; + + obligatory=0x00; + switch (mmc_profile&0xFFFF) + { case 0x1A: // DVD+RW + obligatory=0x26; + case 0x13: // DVD-RW Restricted Overwrite + for (i=8,len=formats[3];i>2) == obligatory) break; + + if (i==len) + { fprintf (stderr,":-( can't locate obligatory format descriptor\n"); + return 0; + } + + ret = formats[4+i+0]<<24; + ret |= formats[4+i+1]<<16; + ret |= formats[4+i+2]<<8; + ret |= formats[4+i+3]; + nwa = formats[4+5]<<16|formats[4+6]<<8|formats[4+7]; + if (nwa>2048) ret *= nwa/2048; + else if (nwa<2048) ret /= 2048/nwa; + break; + + case 0x12: // DVD-RAM + // As for the moment of this writing I don't format DVD-RAM. + // Therefore I just pull formatted capacity for now... + ret = formats[4+0]<<24; + ret |= formats[4+1]<<16; + ret |= formats[4+2]<<8; + ret |= formats[4+3]; + nwa = formats[4+5]<<16|formats[4+6]<<8|formats[4+7]; + if (nwa>2048) ret *= nwa/2048; + else if (nwa<2048) ret /= 2048/nwa; + break; + + case 0x11: // DVD-R + case 0x14: // DVD-RW Sequential + case 0x15: // DVD-R Dual Layer Sequential + case 0x16: // DVD-R Dual Layer Jump + case 0x1B: // DVD+R + case 0x2B: // DVD+R Double Layer + cmd[0] = 0x52; // READ TRACK INFORMATION + cmd[1] = 1; + cmd[4] = next_track>>8; + cmd[5] = next_track&0xFF; // last track, set up earlier + cmd[8] = sizeof(buf); + cmd[9] = 0; + if ((err=cmd.transport (READ,buf,sizeof(buf)))) + { sperror ("READ TRACK INFORMATION",err); + return 0; + } + + nwa = 0; + if (buf[7]&1) // NWA_V + { nwa = buf[12]<<24; + nwa |= buf[13]<<16; + nwa |= buf[14]<<8; + nwa |= buf[15]; + } + free_blocks = buf[16]<<24; + free_blocks |= buf[17]<<16; + free_blocks |= buf[18]<<8; + free_blocks |= buf[19]; + ret = nwa + free_blocks; + break; + + default: + break; + } + + return ret; +} + +extern "C" +off64_t get_capacity (void *fd) +{ Scsi_Command cmd(fd); + return (off64_t)get_2k_capacity(cmd)*2048; +} + +extern "C" +double get_buffer_stats (void *fd) +{ Scsi_Command cmd(fd); + unsigned char bcap[12]; + unsigned int bsize,bfree; + + cmd[0] = 0x5C; // READ BUFFER CAPACITY + cmd[8] = sizeof(bcap); + cmd[9] = 0; + if (cmd.transport (READ,bcap,sizeof(bcap))) + return 0.0; + + bsize = bcap[4]<<24|bcap[5]<<16|bcap[6]<<8|bcap[7]; + bfree = bcap[8]<<24|bcap[9]<<16|bcap[10]<<8|bcap[11]; + + return (1.0 - (double)bfree/(double)bsize); +} + +ssize_t poor_mans_pwrite64 (int fd,const void *_buff,size_t size,off64_t foff) +{ Scsi_Command cmd(ioctl_handle); /* screw first argument */ + unsigned char bcap[12]; + const unsigned char *buff=(const unsigned char *)_buff; + unsigned int lba,nbl,bsize,bfree; + int retries=0,errcode; + static int dao_toggle=-1; + + if (foff&0x7FFF || size&0x7FFF) // 32K block size + return (errno=EINVAL,-1); + + lba = foff>>11; + nbl = size>>11; + + if (!media_written && next_wr_addr) + { if ((lba+nbl) <= next_wr_addr) + return size; + else if (next_wr_addr > lba) + nbl -= (next_wr_addr-lba), + size -= (next_wr_addr-lba)<<11, + buff += (next_wr_addr-lba)<<11, + lba = next_wr_addr; + } +#if defined(__sun) || defined(sun) + else next_wr_addr = lba; +#endif + + if (dao_toggle<0) dao_toggle=is_dao; + + { static unsigned int first_wr_addr=0; + + if (!media_written) + { sigs_mask (SIGS_BLOCK); first_wr_addr = lba; } + else if (lba >= (first_wr_addr+buf_size/2)) // measured in 2KBs! + { sigs_mask (SIGS_UNBLOCK); } + } + + if (dao_blocks!=0 && (lba+nbl)>dao_blocks) + nbl = dao_blocks-lba; + + while (1) + { cmd[0] = wrvfy?0x2E:0x2A; // WRITE [AND VERIFY] (10) + cmd[2] = (lba>>24)&0xff; // Logical Block Addrss + cmd[3] = (lba>>16)&0xff; + cmd[4] = (lba>>8)&0xff; + cmd[5] = lba&0xff; + cmd[7] = (nbl>>8)&0xff; + cmd[8] = nbl&0xff; + cmd[9] = 0; +#if 0 + cmd[0] = 0xAA; // WRITE(12) + cmd[2] = (lba>>24)&0xff; // Logical Block Addrss + cmd[3] = (lba>>16)&0xff; + cmd[4] = (lba>>8)&0xff; + cmd[5] = lba&0xff; + cmd[8] = (nbl>>8)&0xff; + cmd[9] = nbl&0xff; + cmd[10] = 0x80; // "Streaming" + cmd[11] = 0; +#endif + // + // First writes can be long, especially in DAO mode... + // I wish I could complement this with "if (lba==0)," + // but some units might choose to fill the buffer before + // they take the first nap... + // + cmd.timeout(dao_toggle?180:60); + // + // It should also be noted that under Linux these values + // (if actually respected by kernel!) can turn out bogus. + // The problem is that I scale them to milliseconds as + // documentation requires/implies, while kernel treats + // them as "jiffies." I could/should have used HZ macro + // (or sysconf(_SC_CLK_TCK)), but recent kernels maintain + // own higher HZ value and disrespects the user-land one. + // Sending them down as milliseconds is just safer... + // + if (!(errcode=cmd.transport (WRITE,(void *)buff,size))) + break; + + //--- WRITE failed ---// +#if defined(__sun) || defined(sun) + // + // Solaris can slice USB WRITEs to multiple ones. Here I try + // to find out which slice has failed. I expect we get here + // only when we re-enter the loop... + // + if (lba==next_wr_addr && + errcode==0x52102) // "INVALID ADDRESS FOR WRITE" + { unsigned char track[32]; + + cmd[0] = 0x52; // READ TRACK INFORMATION + cmd[1] = 1; + cmd[4] = next_track>>8; + cmd[5] = next_track&0xFF; + cmd[8] = sizeof(track); + cmd[9] = 0; + if (!cmd.transport (READ,track,sizeof(track))) + { if (track[7]&1) // NWA_V + { next_wr_addr = track[12]<<24; + next_wr_addr |= track[13]<<16; + next_wr_addr |= track[14]<<8; + next_wr_addr |= track[15]; + if (lbanext_wr_addr) + { nbl -= next_wr_addr-lba, + size -= (next_wr_addr-lba)<<11, + buff += (next_wr_addr-lba)<<11, + lba = next_wr_addr; + continue; + } + } + } + } +#endif + + if (errcode==0x20408) // "LONG WRITE IN PROGRESS" + { // Apparently only Pioneer units do this... + if (velocity == 0) + { if (handle_events(cmd) & (1<<6)) + continue; + goto sync_cache; + } + + cmd[0] = 0x5C; // READ BUFFER CAPACITY + cmd[8] = sizeof(bcap); + cmd[9] = 0; + if (cmd.transport (READ,bcap,sizeof(bcap))) + bfree=0, bsize=buf_size; + else + { bsize = bcap[4]<<24|bcap[5]<<16|bcap[6]<<8|bcap[7]; + bfree = bcap[8]<<24|bcap[9]<<16|bcap[10]<<8|bcap[11]; + bsize /= 1024, bfree /= 1024; // xlate to KB + } + // check for sanity and drain 1/2 of the buffer + if (bsize < buf_size/2) bsize = buf_size/2; + else bsize /= 2; + if (bfree > bsize) bfree = bsize; + + int msecs=0; + + if ((msecs=(bsize-bfree)*1000) > velocity) + { msecs /= velocity; + retries++; + if (dao_toggle) dao_toggle=-1; + } + else // lots of free buffer reported? + { if (dao_toggle) + { dao_toggle=-1; + if ((handle_events(cmd) & (1<<6))) + continue; + msecs = bsize*1000; + msecs /= velocity; + } + else if (!retries++) continue; + // Pioneer units seem to return bogus values at high + // velocities now and then... I reserve for 4 ECC + // blocks, which is ~6 ms at 16x. But note that some + // OSes, Linux 2.4 among then, will nap for 10 or 20. + msecs = (4*32*1000)/velocity; + } + + // Retry values were increased because high-speed units + // start recordings at only portion of velocity and it + // takes more retries to write lead-in... Another common + // reason for stucks are recalibrations at zone edges... + if (retries > (dao_toggle?768:192)) + fprintf (stderr,":-? the LUN appears to be stuck " + "writing LBA=%xh, keep retrying in %dms\n", + lba,msecs), + retries=1; + + if (msecs>=0) + { poll (NULL,0,msecs); + continue; + } + + lba |= 0x80000000; // signal insane bfree... + } + else if (lba==0 && errcode==0x20401) // "IN PROCESS OF BECOMING READY" + { if ((handle_events(cmd) & (1<<6))) + continue; + if (++retries > 3) + { fprintf (stderr,":-! the LUN is still in process of becoming ready, " + "retrying in 5 secs...\n"), + retries=0; + sigs_mask (SIGS_UNBLOCK); + poll (NULL,0,5000); + } + else + sigs_mask (SIGS_UNBLOCK), + poll (NULL,0,stdnap); + continue; + } + else if (errcode==0x20404 || // "FORMAT IN PROGRESS" + errcode==0x20407 || // "OPERATION IN PROGRESS" + errcode==0x52C00) // "COMMAND SEQUENCE ERROR" + { // Happens under automounter control? In general I recommend + // to disable it! This code is a tribute to users who disregard + // the instructions... + sync_cache: + cmd[0] = 0x35; // SYNC CACHE + cmd[9] = 0; + if (!cmd.transport()) + { if (++retries > 1) + { fprintf (stderr,":-! the LUN appears to be stuck at %xh, " + "retrying in 5 secs...\n",lba), + retries=0; + sigs_mask (SIGS_UNBLOCK); + poll (NULL,0,5000); + } + else if (errcode==0x52C00) + fprintf (stderr,":-! \"COMMAND SEQUENCE ERROR\"@LBA=%xh. " + "Is media being read?\n",lba); + continue; + } + lba |= 0x40000000; // signal "can't SYNC CACHE" + } + { char cmdname[64]; + sprintf (cmdname,"WRITE@LBA=%xh",lba), + sperror (cmdname,errcode); + } + if (lba==0) + { if (ASC(errcode)==0x30) + fprintf (stderr,":-( media is not formatted or unsupported.\n"); + else if ((mmc_profile&0xFFFF)==0x14 /*&& ASC(errcode)==0x64*/) + fprintf (stderr,":-( attempt to re-run with " + "-dvd-compat -dvd-compat to engage DAO or " + "apply full blanking procedure\n"); + } +#if 1 // safety net: leave DL sessions open and resumable... + if ((mmc_profile&0xFFFF)==0x2B && errcode!=0x52100) media_written=0; +#endif + return -1; + } + + next_wr_addr = lba+nbl; + media_written = 1; + + if (dao_toggle<0) dao_toggle=0; + + return size; +} + +static void plus_rw_format (Scsi_Command &cmd) +{ int err,i,len; + unsigned char descr[12]; + + if ((formats[4+4]&3) == 1) // Unformatted media + { fprintf (stderr,"%s: pre-formatting blank DVD+RW...\n",ioctl_device); + + for (i=8,len=formats[3];i>2) == 0x26) break; + + if (i==len) + fprintf (stderr,":-( can't locate DVD+RW format descriptor\n"), + exit(FATAL_START(EMEDIUMTYPE)); + + memset (descr,0,sizeof(descr)); + descr[1]=0x02; // "IMMED" flag + descr[3]=0x08; // "Descriptor Length" (LSB) + memcpy (descr+4,formats+4+i,4); + descr[8]=0x26<<2; // "Format type" 0x26 + + cmd[0] = 0x04; // FORMAT UNIT + cmd[1] = 0x11; // "FmtData" and "Format Code" + cmd[5] = 0; + if ((err=cmd.transport(WRITE,descr,sizeof(descr)))) + sperror ("FORMAT UNIT",err), + exit(FATAL_START(errno)); + + wait_for_unit (cmd); + + cmd[0] = 0x35; // FLUSH CACHE + cmd[9] = 0; + if ((err=cmd.transport())) + sperror ("FLUSH CACHE",err), + exit(FATAL_START(errno)); + } +} + +static int plus_rw_restart_format (Scsi_Command &cmd, off64_t size) +{ unsigned char descr[12]; + unsigned int lead_out,blocks; + int err,i,len; + + if (!dvd_compat && size!=0) + { blocks = size/2048; + blocks += 15, blocks &= ~15; + + lead_out = 0; + lead_out |= formats[4+0], lead_out <<= 8; + lead_out |= formats[4+1], lead_out <<= 8; + lead_out |= formats[4+2], lead_out <<= 8; + lead_out |= formats[4+3]; + + if (blocks<=lead_out) // no need to resume format... + return 0; + } + + fprintf (stderr,"%s: restarting DVD+RW format...\n",ioctl_device); + + for (i=8,len=formats[3];i>2) == 0x26) break; + + if (i==len) + fprintf (stderr,":-( can't locate DVD+RW format descriptor\n"), + exit(FATAL_START(EMEDIUMTYPE)); + + memset (descr,0,sizeof(descr)); + descr[1]=0x02; // "IMMED" flag + descr[3]=0x08; // "Descriptor Length" (LSB) +#if 1 + memcpy (descr+4,formats+4+i,4); +#else + memset (descr+4,-1,4); +#endif + descr[8]=0x26<<2; // "Format type" 0x26 + descr[11]=1; // "Restart Format" + + cmd[0] = 0x04; // FORMAT UNIT + cmd[1] = 0x11; // "FmtData" and "Format Code" + cmd[5] = 0; + if ((err=cmd.transport(WRITE,descr,sizeof(descr)))) + { sperror ("RESTART FORMAT",err); + return 1; + } + + wait_for_unit(cmd); + + return 0; +} + +extern "C" +int plusminus_r_C_parm (void *fd,char *C_parm) +{ unsigned int next_session, prev_session,err; + Scsi_Command cmd(fd); + unsigned char buf[36]; + + if ((disc_info[2]&3) != 1) + fprintf (stderr,":-( media is not appendable\n"), + exit(FATAL_START(EMEDIUMTYPE)); + + // allow to resume even --v-- incomplete sessions // + if (((disc_info[2]>>2)&3) > 1) + fprintf (stderr,":-( last session is not empty\n"), + exit(FATAL_START(EMEDIUMTYPE)); + + next_track = disc_info[5]|disc_info[10]<<8; + + cmd[0] = 0x52; // READ TRACK INFORMATION + cmd[1] = 1; + cmd[4] = next_track>>8; + cmd[5] = next_track; // ask for last track + cmd[8] = sizeof(buf); + cmd[9] = 0; + if ((err=cmd.transport (READ,buf,sizeof(buf)))) + { sperror ("READ TRACK INFORMATION",err); + if (ASC(err)==0x24) // hp dvd200i returns 24 if media is full + fprintf (stderr,":-( media must be full already\n"); + exit (FATAL_START(errno)); + } + +#if 0 + if (buf[7]&1) // NWA_V + { next_session = buf[12]<<24; + next_session |= buf[13]<<16; + next_session |= buf[14]<<8; + next_session |= buf[15]; + } + else + fprintf (stderr,":-( Next Writable Address is invalid\n"), + exit(FATAL_START(EMEDIUMTYPE)); +#else + next_session = buf[8]<<24; // Track Start Address + next_session |= buf[9]<<16; + next_session |= buf[10]<<8; + next_session |= buf[11]; +#endif + + // + // All manuals say the data is fabricated, presumably implying + // that one should use another command. But we stick to this one + // because kernel uses this very command to mount multi-session + // discs. + // + cmd[0] = 0x43; // READ TOC + cmd[2] = 1; // "Session info" + cmd[8] = 12; + cmd[9] = 0; + if ((err=cmd.transport (READ,buf,12))) + sperror ("READ SESSION INFO",err), + exit (FATAL_START(errno)); + + prev_session = buf[8]<<24; + prev_session |= buf[9]<<16; + prev_session |= buf[10]<<8; + prev_session |= buf[11]; + + sprintf (C_parm,"%d,%d",prev_session+16,next_session); + + return next_session; +} + +static unsigned char *pull_page2A (Scsi_Command &cmd) +{ unsigned char *page2A,header[12]; + unsigned int len,bdlen; + int err; + + cmd[0] = 0x5A; // MODE SENSE + cmd[1] = 0x08; // "Disable Block Descriptors" + cmd[2] = 0x2A; // "Capabilities and Mechanical Status" + cmd[8] = sizeof(header); // header only to start with + cmd[9] = 0; + if ((err=cmd.transport(READ,header,sizeof(header)))) + sperror ("MODE SENSE#2A",err), exit(FATAL_START(errno)); + + len = (header[0]<<8|header[1])+2; + bdlen = header[6]<<8|header[7]; + + if (bdlen) // should never happen as we set "DBD" above + { if (len < (8+bdlen+30)) + fprintf (stderr,":-( LUN is impossible to bear with...\n"), + exit(FATAL_START(EINVAL)); + } + else if (len < (8+2+(unsigned int)header[9]))// SANYO does this. + len = 8+2+header[9]; + + page2A = (unsigned char *)malloc(len); + if (page2A == NULL) + fprintf (stderr,":-( memory exhausted\n"), exit(FATAL_START(ENOMEM)); + + cmd[0] = 0x5A; // MODE SENSE + cmd[1] = 0x08; // "Disable Block Descriptors" + cmd[2] = 0x2A; // "Capabilities and Mechanical Status" + cmd[7] = len>>8; + cmd[8] = len; // real length this time + cmd[9] = 0; + if ((err=cmd.transport(READ,page2A,len))) + sperror ("MODE SENSE#2A",err), + exit(FATAL_START(errno)); + + len -= 2; + if (len < ((unsigned int)page2A[0]<<8|page2A[1])) // paranoia:-) + page2A[0] = len>>8, page2A[1] = len; + + return page2A; +} + +static int pull_velocity (Scsi_Command &cmd,unsigned char *d) +{ unsigned int len; + int v,err; + class autofree perf; + +#if 0 // 8x AccessTek derivatives, such as OptoRite DD0405 + if ((d[4]&2) == 0) return -1; +#endif + + len = (d[0]<<24|d[1]<<16|d[2]<<8|d[3])-4; + if (len%16) return -1; + if (len==0) return -1; // LG GCA-4040N:-( + + len += 8; + if (len == (8+16)) + { velocity = d[8+ 4]<<24|d[8+ 5]<<16|d[8+ 6]<<8|d[8+ 7]; + v = d[8+12]<<24|d[8+13]<<16|d[8+14]<<8|d[8+15]; + if (v>velocity) velocity=v; // CAV? + } + else // ZCLV + { unsigned int n = (len-8)/16; + unsigned char *p; + + perf = (unsigned char *)malloc (len); + if (perf == NULL) + fprintf (stderr,":-( memory exhausted\n"), + exit(FATAL_START(ENOMEM)); + + cmd[0]=0xAC; // GET PERFORMANCE + cmd[1]=4; // ask for "Overall Write Performance" + cmd[8]=n>>8; + cmd[9]=n; // real number of descriptors + cmd[10]=0; // ask for descriptor in effect + cmd[11]=0; + if ((err=cmd.transport(READ,perf,len))) + sperror ("GET CURRENT PERFORMANCE",err), + exit (FATAL_START(errno)); + + // Pick the highest speed... + for (p=perf+8,len-=8;len;p+=16,len-=16) + { v=p[ 4]<<24|p[ 5]<<16|p[ 6]<<8|p[ 7]; + if (v > velocity) velocity = v; + v=p[12]<<24|p[13]<<16|p[14]<<8|p[15]; + if (v > velocity) velocity = v; // ZCAV? + } + } + + return 0; +} + +static int set_speed_B6h (Scsi_Command &cmd,unsigned int dvddash, + unsigned char *page2A) +{ unsigned int len; + int err; + unsigned char d[8+16]; + class autofree perf; + + cmd[0]=0xAC; // GET PERFORMACE + cmd[9]=1; // start with one descriptor + cmd[10]=0x3; // ask for "Write Speed Descriptor" + cmd[11]=0; + if ((err=cmd.transport(READ,d,sizeof(d)))) + { sperror ("GET PERFORMANCE",err); + fprintf (stderr,":-( falling down to SET CD SPEED\n"); + return -1; + } + + len = (d[0]<<24|d[1]<<16|d[2]<<8|d[3])-4; + + if (len%16) // insane length + { fprintf (stderr,":-( GET PERFORMANCE: insane Performance Data Length\n"); + return -1; + } + + perf = (unsigned char *)malloc(len+=8); + if (perf == NULL) + fprintf (stderr,":-( memory exhausted\n"), + exit(FATAL_START(ENOMEM)); + + if (len == sizeof(d)) + memcpy (perf,d,sizeof(d)); + else + { unsigned int n=(len-8)/16; + + cmd[0]=0xAC; // GET PERFORMANCE + cmd[8]=n>>8; + cmd[9]=n; // real number of descriptors + cmd[10]=0x3; // ask for "Write Speed Descriptor" + cmd[11]=0; + if ((err=cmd.transport(READ,perf,len))) + sperror ("GET PERFORMANCE",err), + exit (FATAL_START(errno)); + } + + int targetv=0,errp=0; + do { + memset (d,0,sizeof(d)); + cmd[0]=0xAC; // GET PERFORMANCE + cmd[1]=4; // ask for "Overall Write performance" + cmd[9]=1; + cmd[10]=0; // ask for descriptor in effect + cmd[11]=0; + if (errp || (errp=cmd.transport(READ,d,sizeof(d)))) +#if 0 + sperror ("GET CURRENT PERFORMANCE",errp), + exit (FATAL_START(errno)); // well, if it passed above, we + // expect it to pass this too... +#else // Pioneer doesn't report current speed through GET PERFORMANCE:-( + { emulated_err: + + if (page2A == NULL) return -1; + + unsigned int plen,hlen; + + plen = (page2A[0]<<8|page2A[1]) + 2; + hlen = 8 + (page2A[6]<<8|page2A[7]); + + unsigned char * const p = page2A + hlen; + + if (plen<(hlen+32) || p[1]<(32-2)) + return -1; // well, SET CD SPEED wouldn't work... + + velocity = p[28]<<8|p[29]; + } +#endif + else if ((errp = pull_velocity (cmd,d)) < 0) + goto emulated_err; + + if (speed_factor != 0.0) + { int i,j=len-8,v,v0,v1,minv,closesti,closestv=0; + unsigned char *wsdp=perf+8; + + for (minv=0x7fffffff,i=0;i(15*ONEX)) speed_factor /= 16.0; + else if (minv>(11*ONEX)) speed_factor /= 12.0; + else if (minv>(7*ONEX)) speed_factor /= 8.0; + else if (minv>(5*ONEX)) speed_factor /= 6.0; + else if (minv>(3*ONEX)) speed_factor /= 4.0; + else if (!dvddash && minv>(2*ONEX)) + // 2.4x is like 1x for DVD+, but it turned out that there're + // units, most notably "DVDRW IDE1004," burning DVD+ at + // lower speed, so I have to watch out for it... + speed_factor /= 2.4; + else if (minv>=(2*ONEX)) + speed_factor /= 2.0; + + v0=(int)(speed_factor*minv + 0.5); + for (closesti=0,minv=0x7fffffff,i=0;i>24; + pd[9]=cap>>16; + pd[10]=cap>>8; + pd[11]=cap; +#endif + memcpy(pd+12,wsdp+closesti+8,4); // copy "Read Speed" + memcpy(pd+20,wsdp+closesti+12,4); // copy "Write Speed" + pd[18]=pd[26]=1000>>8; // set both "Read Time" and + pd[19]=pd[27]=1000&0xFF; // "Write Time" to 1000ms + + cmd[0]=0xB6; // SET STREAMING + cmd[10]=sizeof(pd); + cmd[11]=0; + if ((err=cmd.transport (WRITE,pd,sizeof(pd)))) + sperror ("SET STREAMING",err), + exit (FATAL_START(errno)); + + // I pull the Page 2A in either case, because unit might + // have provided irrelevant information (Plextor). Not to + // mention cases when it simply failed to reply to GET + // CURRENT PERFORMANCE (Pioneer, LG). + + unsigned int plen = (page2A[0]<<8|page2A[1]) + 2; + + cmd[0] = 0x5A; // MODE SENSE + cmd[1] = 0x08; // "Disable Block Descriptors" + cmd[2] = 0x2A; // "Capabilities and Mechanical Status" + cmd[7] = plen>>8; + cmd[8] = plen; // real length this time + cmd[9] = 0; + if ((err=cmd.transport(READ,page2A,plen))) + sperror ("MODE SENSE#2A",err), + exit(FATAL_START(errno)); + } + else if (targetv) + { if (targetv!=velocity) + { if (errp==0) // check Page 2A for speed then... + { errp=-1; continue; } + if (velocity==0 || velocity>=ONEX) + { fprintf(stderr,":-? Failed to change write speed: %d->%d\n", + (int)velocity,targetv); + if (velocity%d\n", + (int)velocity,targetv); + exit (FATAL_START(EINVAL)); + } + } + break; + } + } while (targetv); + + return targetv; +} + +static int set_speed_BBh (Scsi_Command &cmd,unsigned char *page2A) +{ unsigned int plen,hlen; + int err; + + plen = (page2A[0]<<8|page2A[1]) + 2; + hlen = 8 + (page2A[6]<<8|page2A[7]); + + unsigned char * const p = page2A + hlen; + + if (plen<(hlen+32) || p[1]<(32-2)) + return -1; + + int targetv=0; + do { + velocity = p[28]<<8|p[29]; + + if (speed_factor != 0.0) + { int i,j,v,v0,v1,minv,closesti,closestv=0; + unsigned char *wsdp=p+32; + + j=(p[30]<<8|p[31])*4; + for (minv=0x7fffffff,i=0;i>8; + cmd[8] = plen; // real length this time + cmd[9] = 0; + if ((err=cmd.transport(READ,page2A,plen))) + sperror ("MODE SENSE#2A",err), + exit(FATAL_START(errno)); + } + else if (targetv) + { if (targetv!=velocity) + fprintf (stderr,":-( Failed to change write speed: %d->%d\n", + (int)velocity,targetv), + exit (FATAL_START(EINVAL)); + break; + } + } while (targetv); + + return targetv; +} + +static int plusminus_pages_setup (Scsi_Command &cmd,int profile) +{ unsigned int plen,hlen,dvddash; + unsigned char header[16],p32; + int err; + class autofree page2A; + + switch (profile) + { case 0x1A: // DVD+RW + p32 = 0; + dvddash = 0; + break; + case 0x1B: // DVD+R + // + // Even though MMC-4 draft explicitely exempts DVD+RW/+R media + // from those being affected by Page 05h settings, some + // firmwares apparently pay attention to Multi-session flag + // when finalizing DVD+R media. Well, we probably can't blame + // vendors as specification is still a work in progress, not to + // mention that it was published after DVD+R was introduced to + // the market. + // + p32 = dvd_compat?0x02:0xC0; + dvddash = 0; + break; + case 0x13: // DVD-RW Restricted Overwrite + p32 = 0xC0; // NB! Test Write in not option here + dvddash = 1; + break; + case 0x11: // DVD-R Sequential + case 0x14: // DVD-RW Sequential + case 0x15: // DVD-R Dual Layer Sequential + p32 = 0xC0; + if (next_track==1) do + { if (dvd_compat >= (profile==0x14?2:256)) + { is_dao = 1, + fprintf (stderr,"%s: engaging DVD-%s DAO upon user request...\n", + ioctl_device,profile==0x14?"RW":"R"); + break; + } + + // Try to figure out if we have to go for DAO... + cmd[0] = 0x46; // GET CONFIGURATION + cmd[1] = 2; // ask for the only feature... + cmd[3] = 0x21; // the "Incremental Streaming Writable" one + cmd[8] = 16; // The feature should be there, right? + cmd[9] = 0; + if ((err=cmd.transport (READ,header,16))) + sperror ("GET FEATURE 21h",err), + exit(FATAL_START(errno)); + + hlen = header[0]<<24|header[1]<<16|header[2]<<8|header[3]; + // See if Feature 21h is "current," if not, engage DAO... + if (hlen>=12 && (header[8+2]&1)==0) + { is_dao = dvd_compat = 1; + fprintf (stderr,"%s: FEATURE 21h is not on, engaging DAO...\n", + ioctl_device); + break; + } + } while (0); + + if (is_dao) p32 |=2; // DAO + + if (profile==0x15 || // DVD-R DL Seq has no notion of multi-session + dvd_compat) p32 &= 0x3F; // Single-session + + if (test_write) + p32 |= 0x10; // Test Write for debugging purposes + + dvddash=1; + break; + case 0x16: // DVD-R Dual Layer Jump + p32 = 0xC0; + p32 |= 4; // Jump + if (test_write) + p32 |= 0x10; // Test Write for debugging purposes + + dvddash=1; + break; + default: + p32 = 0; + dvddash = 0; + break; + } + + if (dvddash || p32) page05_setup (cmd,profile,p32); + + page2A = pull_page2A (cmd); + + plen = (page2A[0]<<8|page2A[1]) + 2; + hlen = 8 + (page2A[6]<<8|page2A[7]); + + unsigned char * const p = page2A + hlen; + + if (plen<(hlen+14) || p[1]<(14-2)) // no "Buffer Size Supported" + buf_size = 512; // bogus value + else + buf_size = (p[12]<<8|p[13]); + if (buf_size<512) // bogus value + buf_size = 512; + + // GET PERFORMANCE/SET STREAMING are listed as mandatory, so that + // this is actually the most likely path... + if (set_speed_B6h (cmd,dvddash,page2A) >= 0) + goto opc; + + if (plen<(hlen+30) || p[1]<(30-2)) // no "Current Write Speed" present + { if (dvddash) + { fprintf (stderr,":-( \"Current Write Speed\" descriptor " + "is not present, faking 1x...\n"), + velocity = ONEX; + speed_factor = 0.0; + } + else + velocity = 0; + } + else do + { velocity = p[28]<<8|p[29]; + + // Some units, most notably NEC and derivatives, were observed + // to report CD-R descriptors... + if (velocity < ONEX) // must be bogus + { velocity=0; + break; + } + + if (plen<(hlen+32) || p[1]<(32-2)) // no write descriptors + break; + + int n = p[30]<<8|p[31],minv=1<<16; + unsigned char *p_= p+32; + for (;n--;p_+=4) + { int v=p_[2]<<8|p_[3]; + if (v==0) continue; // Lite-On returns zeros here... + if (v2*ONEX) + // See corresponding comment in set_speed_B6h() + speed_factor /= 2.4; + + } while (0); + + if (speed_factor != 0.0 && + (velocity==0 || set_speed_BBh (cmd,page2A)<0) ) + fprintf (stderr,":-( can't control writing velocity, " + "-speed option is ignored\n"); +opc: + + if (!dvddash || test_write || no_opc) return 0; + + // See if OPC is required... + cmd[0] = 0x51; // READ DISC INFORMATION + cmd[8] = 8; + cmd[9] = 0; + if ((err=cmd.transport (READ,header,8))) + sperror ("READ DISC INFORMATION",err), + exit(FATAL_START(errno)); + + if ((header[0]<<8|header[1]) <= 0x20) + { cmd[0] = 0x54; // SEND OPC INFORMATION + cmd[1] = 1; // "Perform OPC" + cmd[9] = 0; + cmd.timeout(120); // NEC units can be slooo...w + if ((err=cmd.transport())) do + { if (err==0x17301) // "POWER CALIBRATION AREA ALMOST FULL" + { fprintf (stderr,":-! WARNING: Power Calibration Area " + "is almost full\n"); + break; + } + sperror ("PERFORM OPC",err); + if ((err&0x0FF00)==0x07300) exit(FATAL_START(errno)); + /* + * Th rest of errors are ignored, most notably observed: + * 0x52000, "INVALID COMMAND" Panasonic LD-F321 + * 0x52700, "WRITE PROTECTED" Plextor PX-712A + * 0x52C00, "COMMAND SEQUENCE ERROR" Plextor PX-716UF + * 0x53002, "MEDIA NOT SUPPORTED" Toshiba TS-H542A + */ + } while (0); + } + + handle_events(cmd); + + return 0; +} + +static int minus_rw_quickgrow (Scsi_Command &cmd,off64_t size) +{ unsigned char format[12]; + unsigned int lead_out,blocks,type; + int i,len,err; + + type = formats[4+4]&3; + + if (type==2 && size!=0) + { blocks = size/2048; + blocks += 15, blocks &= ~15; + + lead_out = 0; + lead_out |= formats[4+0], lead_out <<= 8; + lead_out |= formats[4+1], lead_out <<= 8; + lead_out |= formats[4+2], lead_out <<= 8; + lead_out |= formats[4+3]; + + if (blocks<=lead_out) // no need to grow the session... + return 0; + } + + // look for Quick Grow descriptor... + for (i=8,len=formats[3];i>2) == 0x13) break; + + if (i==len) // no Quick Grow descriptor + { if (type != 2) + quickgrown=1; // in reality quick formatted... + return 0; + } + else + { blocks = 0; + blocks |= formats[i+0], blocks <<= 8; + blocks |= formats[i+1], blocks <<= 8; + blocks |= formats[i+2], blocks <<= 8; + blocks |= formats[i+3]; + if (type==2 && blocks==0) // nowhere no grow... + return 0; + } + + quickgrown=1; + fprintf (stderr,"%s: \"Quick Grow\" session...\n",ioctl_device); + + memset (format,0,sizeof(format)); + format [1] = 2; // "IMMED" + format [3] = 8; // "Length" + format [8] = 0x13<<2; // "Quick Grow" + format [11] = 16; + + cmd[0] = 0x4; // FORMAT UNIT + cmd[1] = 0x11; + cmd[5] = 0; + if ((err=cmd.transport (WRITE,format,sizeof(format)))) + { sperror ("QUICK GROW",err); + return 1; + } + + return wait_for_unit (cmd); +} + +static int minus_r_reserve_track (Scsi_Command &cmd,off64_t size) +{ int err; + unsigned int blocks; + + blocks = size/2048; + if (is_dao) dao_blocks = blocks; + else blocks += 15, blocks &= ~15; + + fprintf (stderr,"%s: reserving %u blocks",ioctl_device,blocks); + if (is_dao && blocks<380000) + fprintf (stderr,"\b, warning for short DAO recording"), + poll (NULL,0,5000); + fprintf (stderr,"\n"); + + + cmd[0] = 0x53; // RESERVE TRACK + cmd[5] = blocks>>24; + cmd[6] = blocks>>16; + cmd[7] = blocks>>8; + cmd[8] = blocks; + cmd[9] = 0; + if ((err=cmd.transport ())) + { sperror ("RESERVE TRACK",err); + return 1; + } + + return 0; +} + +static void plus_r_dl_split (Scsi_Command &cmd,off64_t size) +{ int err; + unsigned int blocks,split; + unsigned char dvd_20[4+8]; + + cmd[0] = 0xAD; // READ DVD STRUCTURE + cmd[7] = 0x20; // "DVD+R Double Layer Boundary Information" + cmd[9] = sizeof(dvd_20); + cmd[11] = 0; + if ((err=cmd.transport(READ,dvd_20,sizeof(dvd_20)))) + sperror ("READ DVD+R DL BOUNDARY INFORMATION",err), + exit (FATAL_START(errno)); + + if ((dvd_20[0]<<8|dvd_20[1]) < 10) + fprintf (stderr,":-( insane DVD+R DL BI structure length\n"), + exit (FATAL_START(EINVAL)); + + if (dvd_20[4]&0x80) + { fprintf (stderr,":-? L0 Data Zone Capacity is set already\n"); + return; + } + + split = dvd_20[8]<<24|dvd_20[9]<<16|dvd_20[10]<<8|dvd_20[11]; + + blocks = size/2048; + blocks += 15, blocks &= ~15; + + if (blocks <= split) + fprintf (stderr,":-( more than 50%% of space will be *wasted*!\n" + " use single layer media for this recording\n"), + exit (FATAL_START(EMEDIUMTYPE)); + + blocks /= 16; + blocks += 1; + blocks /= 2; + blocks *= 16; + + fprintf (stderr,"%s: splitting layers at %u blocks\n", + ioctl_device,blocks); + + memset (dvd_20,0,sizeof(dvd_20)); + dvd_20[1] = sizeof(dvd_20)-2; + dvd_20[8] = blocks>>24; + dvd_20[9] = blocks>>16; + dvd_20[10] = blocks>>8; + dvd_20[11] = blocks; + + cmd[0] = 0xBF; // SEND DVD STRUCTURE + cmd[7] = 0x20; // "DVD+R Double Layer Recording Information" + cmd[9] = sizeof(dvd_20); + cmd[11] = 0; + if ((err=cmd.transport(WRITE,dvd_20,sizeof(dvd_20)))) + sperror ("SEND DVD+R DOUBLE LAYER RECORDING INFORMATION",err), + exit (FATAL_START(errno)); + +} + +static int flush_cache (Scsi_Command &cmd, int even_sync=1) +{ int err; + + cmd[0] = 0x35; // FLUSH CACHE + cmd[1] = 0x02; // "IMMED" + cmd[9] = 0; + if (!(err=cmd.transport())) + wait_for_unit (cmd); + else + sperror ("FLUSH CACHE",err); + + if (even_sync) // Pioneer apparently needs this, + { // non-IMMED FLUSH that is... + cmd[0] = 0x35; // FLUSH CACHE + cmd[9] = 0; + if (is_dao) cmd.timeout (15*60); + if ((err=cmd.transport())) + { sperror ("SYNCHRONOUS FLUSH CACHE",err); + return err; + } + } + + return 0; +} + +// +// atexit/signal handlers +// +extern "C" +void no_r_finalize () +{ while (media_written) + { Scsi_Command cmd(ioctl_handle); + + fprintf (stderr,"%s: flushing cache\n",ioctl_device); + if (flush_cache (cmd)) break; + + pioneer_stop (cmd); + + media_written = 0; + errno = 0; + } + _exit (errno); +} + +extern "C" +void plus_rw_finalize () +{ sigs_mask(SIGS_BLOCK); + while (media_written) + { Scsi_Command cmd(ioctl_handle); + int err; + + fprintf (stderr,"%s: flushing cache\n",ioctl_device); + if (flush_cache (cmd)) break; + + if (!dvd_compat) + { fprintf (stderr,"%s: stopping de-icing\n",ioctl_device); + cmd[0] = 0x5B; // CLOSE TRACK/SESSION + cmd[1] = 0x01; // "IMMED" + cmd[2] = 0; // "Stop De-Icing" + cmd[9] = 0; + if ((err=cmd.transport())) + sperror ("STOP DE-ICING",err); + + if (wait_for_unit (cmd)) break; + } + + fprintf (stderr,"%s: writing lead-out\n",ioctl_device); + cmd[0] = 0x5B; // CLOSE TRACK/SESSION + cmd[1] = 0x01; // "IMMED" + cmd[2] = 0x02; // "Close session" + cmd[9] = 0; + if ((err=cmd.transport())) + sperror ("CLOSE SESSION",err); + + if (wait_for_unit (cmd)) break; + + media_written = 0; + next_wr_addr = 0; + errno = 0; + + if (do_reload && media_reload()) + perror (":-( unable to reload tray");// not actually reached + } + _exit (errno); +} + +extern "C" +void plus_r_finalize () +{ sigs_mask(SIGS_BLOCK); + while (media_written) + { Scsi_Command cmd(ioctl_handle); + int mode,err; + + fprintf (stderr,"%s: flushing cache\n",ioctl_device); + if (flush_cache(cmd)) break; + + fprintf (stderr,"%s: closing track\n",ioctl_device); + cmd[0] = 0x5B; // CLOSE TRACK/SESSION + cmd[1] = 0x01; // "IMMED" + cmd[2] = 0x01; // "Close Track" + cmd[4] = next_track>>8; + cmd[5] = next_track; + cmd[9] = 0; + if ((err=cmd.transport())) + sperror ("CLOSE TRACK",err); + + if (wait_for_unit (cmd)) break; + + if (dvd_compat) + // HP dvd520n insists on "finalize with minimum radius" + // with DVD+R DL ---------------vv + mode = ((mmc_profile&0xFFFF)==0x2B)?0x05:0x06, + fprintf (stderr,"%s: closing disc\n",ioctl_device); + else + mode = 0x02, + fprintf (stderr,"%s: closing session\n",ioctl_device); + + while (1) // Pioneer DVR-K04RA + { cmd[0] = 0x5B; // CLOSE TRACK/SESSION + cmd[1] = 0x01; // "IMMED" + cmd[2] = mode; // "Close session" + cmd[9] = 0; + err = cmd.transport(); + if (err == 0x20407) // "OP IN PROGRESS" + { poll (NULL,0,stdnap); + continue; + } + else if (err) + sperror (dvd_compat?"CLOSE DISC":"CLOSE SESSION",err); + break; + } + + if (wait_for_unit (cmd)) break; + + media_written = 0; + errno = 0; + + if (do_reload && media_reload()) + perror (":-( unable to reload tray");// not actually reached + } + _exit (errno); +} + +extern "C" +void minus_rw_finalize () +{ sigs_mask(SIGS_BLOCK); + while (media_written) + { Scsi_Command cmd(ioctl_handle); + int err; + + fprintf (stderr,"%s: flushing cache\n",ioctl_device); + if (flush_cache(cmd)) break; + + if (quickgrown) + { fprintf (stderr,"%s: writing lead-out\n",ioctl_device); + cmd[0] = 0x5B; // CLOSE TRACK/SESSION + cmd[1] = 0x01; // "IMMED" + cmd[2] = 0x02; // "Close Session" + cmd[9] = 0; + if ((err=cmd.transport())) + sperror ("CLOSE SESSION",err); + + if (wait_for_unit (cmd)) break; + + quickgrown=0; + } + + media_written = 0; + next_wr_addr = 0; + errno = 0; + + if (do_reload) + { if (media_reload()) + perror (":-( unable to reload tray");// not actually reached + } + else return; // Restricted Overwrite is just ugly! + } + _exit (errno); +} + +extern "C" +void minus_r_finalize () +{ sigs_mask(SIGS_BLOCK); + while (media_written) + { Scsi_Command cmd(ioctl_handle); + int err; + + fprintf (stderr,"%s: flushing cache\n",ioctl_device); + if (flush_cache(cmd,!is_dao)) break; + + if (!is_dao) + { fprintf (stderr,"%s: updating RMA\n",ioctl_device); + cmd[0] = 0x5B; // CLOSE TRACK/SESSION + cmd[1] = 0x01; // "IMMED" + cmd[2] = 0x01; // "Close Track" + cmd[4] = next_track>>8; + cmd[5] = next_track; + cmd[9] = 0; + if ((err=cmd.transport())) + sperror ("CLOSE TRACK",err); + + if (wait_for_unit (cmd)) break; + + fprintf (stderr,"%s: closing %s\n",ioctl_device, + dvd_compat?"disc":"session"); + + while (1) // Pioneer DVR-K04RA + { cmd[0] = 0x5B; // CLOSE TRACK/SESSION + cmd[1] = 0x01; // "IMMED" + cmd[2] = 0x02; // "Close Session" + cmd[9] = 0; + err = cmd.transport(); + if (err == 0x20407) // "OP IN PROGRESS" + { poll (NULL,0,stdnap); + continue; + } + else if (err) + sperror (dvd_compat?"CLOSE DISC":"CLOSE SESSION",err); + break; + } + + if (wait_for_unit (cmd)) break; + } + + media_written = 0; + errno = 0; + + if (do_reload && media_reload()) + perror (":-( unable to reload tray");// not actually reached + } + _exit (errno); +} + +extern "C" +void ram_reload () +{ sigs_mask(SIGS_BLOCK); + if (media_written && do_reload) media_reload(); + _exit (errno); +} + +// +// poor_mans_setup takes care of a lot of things. +// It's invoked right before first write and if necessary/applicable +// prepares Page 05, reserves track, sets up atexit and signal handlers. +// + +typedef ssize_t (*pwrite64_t)(int,const void *,size_t,off64_t); + +extern "C" +pwrite64_t poor_mans_setup (void *fd,off64_t leadout) +{ Scsi_Command cmd(ioctl_handle=fd); + int err,profile=mmc_profile&0xFFFF; + + // We might have loaded media ourselves, in which case we + // should lock the door... + cmd[0] = 0x1E; // PREVENT/ALLOW MEDIA REMOVAL + cmd[4] = 1; // "Prevent" + cmd[5] = 0; + if ((err=cmd.transport ())) + sperror ("PREVENT MEDIA REMOVAL",err), + exit (FATAL_START(errno)); + + handle_events(cmd); + + switch (profile) + { case 0x1A: // DVD+RW + switch (disc_info[7]&3) // Background formatting + { case 0: // blank + plus_rw_format (cmd); + break; + case 1: // suspended + plus_rw_restart_format (cmd,leadout); + break; + case 2: // in progress + case 3: // complete + break; + } + + plusminus_pages_setup (cmd,profile); + atexit (plus_rw_finalize); + atsignals (plus_rw_finalize); + break; + case 0x1B: // DVD+R + case 0x2B: // DVD+R Double Layer + plusminus_pages_setup(cmd,profile); + if (profile==0x2B && next_track==1 && dvd_compat && leadout) + plus_r_dl_split (cmd,leadout); + atexit (plus_r_finalize); + if (next_wr_addr) + { atsignals (no_r_finalize); + next_wr_addr=(unsigned int)-1; + } + else atsignals (plus_r_finalize); + break; + case 0x13: // DVD-RW Restricted Overwrite + plusminus_pages_setup (cmd,profile); + // + // A side note. Quick Grow can't be performed earlier, + // as then reading is not possible. + // + minus_rw_quickgrow (cmd,leadout); + atexit (minus_rw_finalize); + atsignals (minus_rw_finalize); + break; + case 0x11: // DVD-R Sequential + case 0x14: // DVD-RW Sequential + case 0x15: // DVD-R Dual Layer Sequential + plusminus_pages_setup (cmd,profile); + if ((profile==0x15) && leadout) + { unsigned char dvd_10[4+16]; + unsigned int layer_size,data_size=leadout/2048; + + cmd[0] = 0xAD; // READ DVD STRUCTURE + cmd[7] = 0x10; + cmd[9] = sizeof(dvd_10); + cmd[11] = 0; + if ((err=cmd.transport(READ,dvd_10,sizeof(dvd_10)))) + sperror("READ DVD STRUCTURE #10h",err), + exit(FATAL_START(errno)); + + layer_size = dvd_10[4+13]<<16, + layer_size |= dvd_10[4+14]<<8, + layer_size |= dvd_10[4+15]; + + if (data_size <= layer_size) + fprintf (stderr,":-( more than 50%% of space will be *wasted*!\n" + " use single layer media for this recording\n"), + exit(FATAL_START(EMEDIUMTYPE)); + } + if (is_dao && leadout) + minus_r_reserve_track(cmd,leadout); + atexit (minus_r_finalize); + if (next_wr_addr) + { atsignals (no_r_finalize); + next_wr_addr=(unsigned int)-1; + } + else atsignals (minus_r_finalize); + break; + case 0x12: // DVD-RAM + // exclusively for speed settings... + plusminus_pages_setup (cmd,profile); + atexit (ram_reload); + atsignals (ram_reload); + break; + case 0x16: // DVD-R Dual Layer Jump not supported for reasons + // discussed at web-page... + default: + fprintf (stderr,":-( mounted media[%X] is not supported\n",profile), + exit(FATAL_START(EMEDIUMTYPE)); + break; + } + + if (velocity) + fprintf (stderr,"%s: \"Current Write Speed\" is %.1fx1385KBps.\n", + ioctl_device,velocity/(double)ONEX); + + if (next_wr_addr==(unsigned int)-1) do + { unsigned char track[32]; + + next_wr_addr = 0; + + cmd[0] = 0x52; // READ TRACK INFORMATION + cmd[1] = 1; + cmd[4] = next_track>>8; + cmd[5] = next_track&0xFF; // last track, set up earlier + cmd[8] = sizeof(track); + cmd[9] = 0; + if (cmd.transport (READ,track,sizeof(track))) + break; + + if (track[7]&1) // NWA_V + { next_wr_addr = track[12]<<24; + next_wr_addr |= track[13]<<16; + next_wr_addr |= track[14]<<8; + next_wr_addr |= track[15]; + } + + if (next_wr_addr != // track start + (unsigned int)(track[8]<<24|track[9]<<16|track[10]<<8|track[11])) + fprintf (stderr,":-? resuming track#%d from LBA#%d\n", + next_track,next_wr_addr); + + } while (0); + else next_wr_addr = 0; + + return poor_mans_pwrite64; +} + +extern "C" +int poor_man_rewritable (void *fd, void *buf) +{ Scsi_Command cmd(fd); + int err,profile=mmc_profile&0xFFFF; + + if (profile!=0x13 && // not DVD-RW Restricted Overwrite + profile!=0x12 && // nor DVD-RAM + profile!=0x1A && // nor DVD+RW + profile!=0x2A) // nor DVD+RW Double Layer + return 0; + + if (profile==0x13) // DVD-RW Restricted Overwrite + { // Yet another restriction of Restricted Overwrite mode? + // Pioneer DVR-x05 can't read a bit otherwise... + do_reload=0; + minus_rw_finalize (); // with do_reload==0! + do_reload=1; + } + else if (profile==0x1A || // DVD+RW + profile==0x2A) // DVD+RW Double Layer + { fprintf (stderr,"%s: flushing cache\n",ioctl_device); + if (flush_cache(cmd)) exit (errno); + } + + cmd[0] = 0x28; // READ(10) + cmd[5] = 16; // LBA#16, volume descriptor set + cmd[8] = 16; // 32KB + cmd[9] = 0; + if ((err=cmd.transport (READ,buf,16*2048))) + sperror ("READ@LBA=10h",err), + exit(errno); + + return 1; +} diff --git a/extra-sources/dvd+rw-tools-6.1/growisofs_mmc.o b/extra-sources/dvd+rw-tools-6.1/growisofs_mmc.o new file mode 100644 index 0000000..6b4c417 Binary files /dev/null and b/extra-sources/dvd+rw-tools-6.1/growisofs_mmc.o differ diff --git a/extra-sources/dvd+rw-tools-6.1/index.html b/extra-sources/dvd+rw-tools-6.1/index.html new file mode 100644 index 0000000..e9ae088 --- /dev/null +++ b/extra-sources/dvd+rw-tools-6.1/index.html @@ -0,0 +1,1308 @@ + + + + +DVD+RW/+R/-R[W] for Linux + + + + + + + + + +


+ +
+

DVD+RW/+R/-R[W] for Linux

+
by <appro@fy.chalmers.se>, +January 2006
+
Japanese +
+


+ +

+ + + + +
Q. What is this page (not) about?
A.  + Maybe to your disappointment it is not about + video(*). The scope of this page is primarily + computer storage applications of DVD±RW/±R, + things like backup, archiving, data exchange... The + downloadable files are an optional Linux 2.4 kernel DVD+RW patch and a + couple of user-land utilities dubbed as dvd+rw-tools. + +

+ + +
(*) + Though it doesn't mean that you can't burn + DVD-Video discs with dvd+rw-tools. [Unlike Video-CD] DVD-Video + is "molded" in an ordinary data file system and + therefore no explicit support by the burning program is + actually required. In other words it is the DVD-Video + content preparation which is beyond the scope of this + page.
+

+ +

+ + + + +
Q. Kernel patch? This sounds too complicated + already! Can't I just use [vanilla] cdrecord? + +
A. It should be explicitly noted that the user-land + utilities, dvd+rw-tools, do suffice for DVD recording + without explicit kernel support. So if they fulfill your requirements, then + patching the kernel is by all means optional. As + for cdrecord, DVD recording strategies are somewhat different + from the one supported by [vanilla] cdrecord, so it simply + doesn't work (nor does dvdrecord, despite + what RedHat + 7.3 Release Notes say). On additional note Linux kernel + version 2.6.10 is equipped with packet + writing driver which supports even DVD rewritable media, + but I haven't tested it myself, so don't ask:-)
+ +

+ + + +
Q. What is the kernel patch good for then? +
A. DVD+RW (but not DVD+R nor any DVD-dash) is a true random + write access media and therefore is suitable for housing of an + arbitrary file system, e.g. udf, vfat, ext2, etc. This, + and this alone, qualifies DVD+RW support for kernel + implementation. However, I have to recommend to + deploy it with caution, see tutorial + for further details. Also note that not all OEMs seem to live + up to the promise of true random write access. As for the + moment of this writing apparenly only 2nd generation + Ricoh-based units (see dvdplusrw.org for + generation listings) equipped with later firmware can sustain + I/O fragmentation (see Technical Ramblings below for further + details) and perform reliably. +
+ +

+ + + + +
Q. What are the dvd+rw-tools for?
A. As implied/already mentioned - to master the DVD media, + both +RW/+R and -R[W]. I could simply + refer to the tutorial below, but figured that couple of words + about the [original] design ideas behind growisofs, the + principal burning utility, wouldn't harm. Even though a + modified kernel can let you put for example an ext2 file system + on DVD+RW, it's probably not very practical, because you most + likely want to access the data on an arbitrary computer. + Or in other words you most likely want ISO9660. The trouble is + that you might as well want to add data now and then. + And what options do you have in the lack of multiple sessions + (no, DVD+RW has no notion of multiple sessions)? Complete + re-mastering which takes more and more time as data set grows? + Well, yes, unless you employ growisofs! Growisofs + provides the way to both lay down and grow an ISO9660 + file system on (as well as to burn an arbitrary pre-mastered + image to) all supported DVD media.
+ +

+ + + + +
Q. But if they support both + and - recording + strategies, why are they called dvd+rw-tools?
A. For historical/nostalgical reasons, as originally they did + support exclusively DVD+plus. On the other hand now, when the + vast majority of DVD burners that are being introduced to the + market today are DVD+capable, the name most likely refers to + your unit in either case. And you can always consider the plus + in the name as notion of some unique quality, such as + "seamless" multi-sessioning, not as reference to some + particular format:-)
+ +

+ + + + +
Q. Do I still need cdrtools? +
A. Yes. It should be explicitly noted that growisofs is a + front-end to mkisofs, i.e. invokes mkisofs to perform the + actual ISO9660 file system layout. Secondly, the DVD burners + available on the market can burn even CD-R[W] media and + cdrecord is the tool for this job [and this job only].
+ + + +

+ + + + +
Q. Does it work with my DVD burner? +
A. If your unit is MMC compliant, + then the answer is "most likely it + just does." Well, as the probability of your unit being + non-MMC compliant is virtually zero, the answer in practice is + unconditionally "most likely." + The [core] tools were reported to work with a wide range of + drives, including [but not limited to] HP + dvd[12345]x0i, Ricoh MP512x, Philips + DVDRW[248]xx, SONY DRU-[157]x0, NEC + ND-[123]xx0, TDK indiDVD 4x0N, + Plextor PX-[57]xx, Benq DW[48]00A, + OptoRite DD0[24]0x, Lite-On LDW-[48]x1S, + as well as nonplus units such as + Pioneer DVR-x0[4567], LG GxA-40[248]x, + Toshiba SD-R[56]112, Panasonic UJ-811 + and LF-D[35]1x...
+ +

+ + + + +
Q. Is there a GUI front-end available for + dvd+rw-tools? +
A. K3b, version 0.10 + and later, and nautilus-cd-burner, + version 0.5.1 and later, are both hiding growisofs behind their + pretty buttons and menus:-) Keep in mind that those are not + directly related to dvd+rw-tools development + effort and GUI users should turn elsewhere for end-user + support. Oh! dvd+rw-tools 5.10.x is a minimum requirement for + GUI frontends...
+ +

+ + + + +
Q. I don't run Linux. What are my options? +
A. Version 5.4 adds support for OpenBSD/NetBSD. + Version 5.6 adds support for Solaris 2.x [commercial licensing + terms for distribution on Solaris are to be settled with Inserve Technology]. + Version 5.8 features FreeBSD + port contributed by Matthew Dillon, FreeBSD Development Team + alumnus. Hewlett-Packard Company has donated + HP-UX 11 support for + 5.14(*). IRIX 6.x support appears in + 5.19, while Win32 one - in + 6.0. + +

+ + + + + + +
¡ + Common usage tip! Whenever + separately available [and unless stated otherwise], do use + character-type device entry with dvd+rw-tools, + e.g. OpenBSD/NetBSD users should stick to /dev/rcdXc.
(*) + As of 5.14 HP-UX support was classified as + "initial." Version 5.18 in turn is the one which has + undergone HP quality assurance testing + and is delivered on HP + software depot.
+

+ +


+ +

Foreword/Disclaimer

+ +

Given the absolute lack of initial support from +vendor(s) dvd+rw-tools arose from guesswork. There still is a couple of +fatal failures indicated by vendor-specific error codes (see Technical +Ramblings) and I haven't yet figured out the way around them in +kernel. User-land utilities on the other hand are +considered matured enough to be deployed in "production +environment." + +

As of May 2003 I've decided to advise users to +turn to <cdwrite@other.debian.org> +on support matters. It's an open list, meaning that you don't have +to be subscribed to post +a problem report. List archives can be found at both subscribe page and mail-archive.com. +When submitting report, provide versioning information, exact +command line, exact output generated by the program and +complement it with dvd+rw-mediainfo output for +resulting recording. Do check couple of last archived months, as the +issue might have been discussed recently. If you've chosen to +contact me personally and haven't heard back within a week or so, then +you most likely overlooked something on this page. Please read it more +attentively... + +

Special thanks for hardware donations [in +chronological order]:
+ +  + +  + +  + +


+ +

Tutorial

+ +


+ +
    + +

  • If your burner unit is managed by some +Linux(*) removable media +automounting/autoplaying facility, such as autofs, supermount, +subfs/submount, magicdev, autorun or similar, take it out of its +control! I can't help you with the latter, check your system +documentation (such as google perhaps:-) for specific instructions. +Failure to take your unit out of +Linux(*) automounting/autoplaying facility +control can result in busted recording, a coaster! At the +very least you have to make sure your unit is not automounted during +recordings. + + + + +
    (*) +dvd+rw-tools support Solaris volume manager and +IRIX mediad in more gracious manner and it's safe to leave recorder +under their control.
    + +

  • Remember to consult Hardware Compatibility Notes for possible +caveats or vendor-specific instructions for your unit. Well, such +reminder belongs at the end of tutorial, but I consider it important +enough to bring it up already here:-) + +

  • If you have an IDE unit and run 2.4.x +kernel, you most likely want to "route" it through ide-scsi +emulation layer by either: + +

      +
    • passing "hdX=ide-scsi" +argument to kernel; +
    • appending following lines to your /etc/modules.conf: +
      +
      options ide-cd ignore=hdX
      +pre-install sg modprobe ide-scsi
      +pre-install sr_mod modprobe ide-scsi
      +pre-install ide-scsi modprobe ide-cd
      +
      +
    + +

    Keep in mind that once hdX +is routed through ide-scsi, you can no longer refer to /dev/hdX(*), but to corresponding +/dev/scdN only. + +

    + + +
    (*) +well, except as in hdparm -d [0|1] /dev/hdX. As for DMA settings. Several users of +NEC[-based] units have reported that their systems crash during DVD +recording. The problem appears to be related to DMA settings, at least +switching it off reportedly helps. The problem might be specific to +some IDE chipsets... +
    + +

  • If you have an external unit, just get +it working as CD-ROM first. I myself have no personal experience +whatsoever with USB or IEEE1394/Firewire storage devices +of any kind and have to direct you elsewhere for specific instructions. +I however am confident that if you manage to get your drive working +reliably as CD-ROM and CD-R[W] +burner, then you won't have any troubles with DVD recording part. USB +connected drives were reported to be working fine since eternity. +Firewire connected drives in turn were reported to fail miserably under +2.4.18. The failure didn't seem to be DVD+RW related as it reportedly +failed burning even CD-R media. Firewire support was substantially +revamped in 2.4.19, and dvd+rw-tools were reported to work with this +and later kernels. + +

  • If you're running 2.4.19 or .20, consider +applying this drivers/scsi/sg.c patch. +The bug is fixed in .21. I write "consider" and not +"do" for the following reasons: + +

      +
    • dvd+rw-tools are not affected by this bug (as they don't use SG_IO +interface), cdrecord [potentially] is; +
    • I however haven't actually experienced the problem with cdrecord +(maybe yet, kernel could have managed to keep buffers neatly aligned +while talking to cdrecord those times I tried), it was VMware that has +failed miserably on me; +
    + +

    As of version 5.6 dvd+rw-tools add support for SG_IO +pass-through or in other words support for Linux 2>=5[.43], +where "generic" SCSI interface can be bypassed by issuing +SG_IO ioctl directly against block device, such as /dev/hdX. I wish it worked without need for interim +patches #1 and #2, (the latter is relative to +2.5.69-75, the 1st problem is addressed in .71, 2nd one - .75-bk3 in +"last +minute" prior first 2.6 cut. As for 2.6 in more general sense. +As you can imagine this new interface renders ide-scsi layer +superfluous and "the[ir] official plan™" is to scrap +it. I'm not really fond of the idea, but not for /dev/sg* account. I +mean I [personally] would prefer to keep ide-scsi and use SG_IO +pass-through with /dev/scdN, rather than with +/dev/hdX:-) + +

    If you have to make dvd+rw-tools work under Linux +kernel 2.6.8, then upgrade the tool-chain to 5.21.x or later and +manually reward the installed binaries with set-root-uid flag. But the +"supported" recommendation is to just stay away from this +particular kernel version. As for 2.6>8, dvd+rw-tools 5.21.x is +requirement. Oh! dvd+rw-booktype utility would require set-root-uid +privilege then. Given its semi-official status and the fact that this +utility works only with limited number of units, installation procedure +abstains from installing dvd+rw-booktype set-root-uid, leaving +this security sensitive choice to the end-user. + +

  • Download, unpack and compile the the tool-chain. To build the thing do pick the +.tar.gz archive, which contains Makefile as well as .spec file. You +will need both C and C++ compilers installed. Separate +source code files found in the download catalog +are provided mainly for on-line reference purposes (such as revision history:-). + +

    If your Linux kernel supports multiple ABIs (e.g. +Linux-sparc64 can run even 32-bit Linux-sparc applications, as well as +Linux-x86_64 can execute legacy 32-bit i386 binaries), make sure you +compile for native 64-bit ABI (which can normally be done with +'make TARGET_ARCH=-m64'). The problem here is that 64-bit +kernel has to explicitly convert ioctl structures passed by 32-bit +applications and apparently it does really lousy job when it comes to +CDROM_SEND_PACKET ioctl deployed by dvd+rw-tools. + +

  • If you have 1st generation drive (Ricoh +MP5120A and derivatives, see dvdplusrw.org for generation +listings), do consider upgrading your firmware (see Ricoh +page for latest version information). Fixed bug descriptions are vague, +but at the very least after upgrade to 1.34 I could no longer reproduce +infrequent "random positioning errors" when reading a +file system with a lot of small files. 1.34 adds support for Verbatim +media and 1.37 apparently for Memorex. Version 1.37 also implements a +secret vendor-specific command which reportedly +improves compatibility with a number of DVD-ROM drives (more about +this matter in Technical Ramblings). + +

    Several 2nd generation unit (Ricoh +MP5125A and derivatives) users have reported that their systems +lock up the while recording DVD+R, but not DVD+RW. I myself have never +experienced anything similar, but firmware upgrade did help those who +has suffered from this. So that apparently even 2nd generation users +should be considering firmware upgrade. Firmware upgrade is actually +required if you want to burn 4x media in your 2nd generation unit. +Well, it will still burn it at 2.4x, but without firmware upgrade you +should expect deplorable results. + +

    As new media products and brands are being +introduced to the market all the time, it apparently pays off to +periodically check for firmware updates. It's not as +simple as "1st" vs. "2nd generation" units anymore, +so turn to your vendor to be sure. Special note for HP users. HP no +longer posts firmware updates on a web-page. Instead they let some +Windows auto-update gizmo to pick firmware updates among +dvd[1-4]00*.exe files in their FTP +directory, so that readers of this page tend to miss them... + +

  • Formatting the DVD+RW media. Virgin +DVD+RW media needs to be initally formatted prior usage. Once again, +only virgin DVD+RW media needs to be formatted. As of version +5.10 growisofs detects blanks and applies initial formatting procedure +automatically. Otherwise same effect can be achieved by passing the +device name, e.g. /dev/scd0, as an argument to dvd+rw-format. To make formatting +process reasonably fast, less than 1 minute, the media gets formatted +only partially, as you can notice by observing a progress indicator +displayed by dvd+rw-format. The final indicator value varies from +firmware to firmware, values as low as 1.6% were observed. But it does +not mean that you can only write that little. The unit keeps formatting +transparently, as you add more data. Oh! Do keep in mind that +DVD capacity of 4.7GB are salesman's GB, i.e. 10003 and +not 10243. + +

    It was observed that excessive reformats can render +media unusable already after 10-20 reformats. It appears to be a +firmware deficiency, not some common media defect [at least it was +perfectly possible to salvage the media in a unit of different brand], +but I don't recommend [enforced] reformat in either case. Note that +DVD+RW re-formatting procedure does not substitute for blanking. +If you want to nullify the media, e.g. for privacy reasons, do it +explicitly with 'growisofs -Z /dev/scdN=/dev/zero'. Otherwise just write over +previous recording as it simply wasn't there, no re-formatting is +required. + +

    DVD+R media does not require any formatting +procedure applied and is ready to use out-of-the-box. Apparently, a +reminder that 1st generation units (Ricoh MP5120A and derivatives) +are not capable of burning DVD+R is needed. + +

  • Burning with growisofs. There is hardly a need for +manual for growisofs. In a nutshell growisofs just passes all command +line arguments to mkisofs and dumps its output directly onto the media. +The first part means that you basically can [well, should] +consult mkisofs manual page and +accompanying reference documentation (including multi-session related +section[s]) and the second part means that you shouldn't expect an +ISO-image on the standard output (nor make sure you have enough free +temporary storage:-). Differences from mkisofs command line +are: + +

      +
    • you may not use -o option; +
    • you don't have to specify -C option, growisofs will construct one +for you; +
    • there is internal -Z option for initial session recording, this +substitutes for originally suggested 'mkisofs | dd of=/dev/scd0'; +
    + +

    Otherwise everything that applies to +[multi-session] mastering with mkisofs applies to growisofs as well. For +example just like with mkisofs you should make a note on which options +you used to master the initial "session" with and stick to +them, e.g.: + +

    +growisofs -Z /dev/scd0 -R -J /some/files
    +growisofs -M /dev/scd0 -R -J /more/files
    +
    + +

    Oh! Do make sure you have at least mkisofs 1.14 on your $PATH (mkisofs 1.14 is part of cdrtools +1.10). If you consider passing /same/files as argument, or in +other words consider deploying growisofs for incremental +multi-session backups, then you shall find this '-old-root' extension to +mkisofs 2.0-2.01 simply indispensable. +The idea and implementation by Patrick Ohly is to +"graft" recording sessions as separate directories. Each +backup increment/directory is ment to contain both updated files and +references to previously backed up ones, which facilitates +comparison between increments as well as fine-graded restore. + +

    Number of users asked about opposite to +multi-sessioning: multi-volume support. Being essentially a recording +program growisofs does not support multiple volumes by itself. There're +couple of front-ends I can recommend that arrange for this: scdbackup and +shunt. But back to +growisofs... + +

    In addition to intuitive -Z interpretation, +growisofs [version 3.3 and later] recognizes special form of -Z command +line option which permits burning of arbitrary pre-mastered images. The +"magic" command is: + +

    +growisofs -Z /dev/scd0=image.iso
    +
    + +

    where image.iso represents an arbitrary +object in the file system, such as file, named pipe or device +entry. No, nothing is "growing" here and command name is +counter-intuitive in this particular context. And here is even less +intuitive:-) If you wish to burn down output generated by an +arbitrary program, you can use: + +

    +dumpsomething | growisofs -Z /dev/scd0=/dev/fd/0
    +
    + +

    Burning DVD±R implies extra limitations: + +

      + +
    • Needless to say that you have only one shot with -Z +option:-) + + + +
    • Unlike DVD+RW, DVD±R media does have notion of multiple +sessions. However! Not all legacy units can "see" +beyond the first one. Few DVD-ROM units are capable of DVD-R +multi-border playback, even fewer support DVD+R multi-sessioning. In +other words your DVD burner might be the only unit in your vicinity +capable to access data added at different occasions. + +
    • Even if your DVD unit does "sense" multiple sessions, +Linux kernel [2.4] sometimes fails to pull that information from the +drive:-( Till the problem is looked into and resolved you can +work it around by reloading corresponding driver, most likely +'rmmod sr_mod'. + +
    • Linux kernel 2.6<10 users might experience problems +mounting multi-session media with last session starting beyond +2.2GB boundary. As fast-acting remedy I can suggest to route your unit +through ide-scsi, the way it was under 2.4. Even though it's declared +unsupported it actually still works in 2.6 (I for one still use it). + +
    • If you go for DVD±R multi-sessioning, you have to use +mkisofs from cdrtools-2.0 +or later or apply this patch. + +
    • And when it comes to DVD+R Double Layer and DVD-R +Dual Layer recordings, growisofs applies yet another limitation, +purely artificial. Taking into consideration Double Layer media prices +growisofs is programmed to refuse to perform unappendable +recordings which are less than 1/2 of blank capacity and to advice +to use single layer media instead. + +
    • DVD-R Dual Layer multi-sessioning is not supported for a reason +discussed on the -RW companion page. Once +again, as of the moment of this writing DVD-R Dual Layer +recordings come out unappendable and can not be grown. +
    + + +

    And once again, do keep in mind that 4.7GB are +salesman's GB, i.e. 10003 and not 10243. If +translated to "real" GB, DVD±R[W] +capacity is not larger than 4.4GB! It should also be noted that earlier +growisofs versions did not check if there is enough space on media to +accommodate the data set to be burned, meaning that it was your sole +responsibility to make sure "overburn" condition is not +raised. As of version 5.2 growisofs performs the necessary checks +for you and refuses to start recording if "overburn" +condition appears to be unavoidable. This behaviour can be overridden +with -overburn command-line option. + +

  • If you're satisfied with growisofs, then you +should just proceed to the next chapter +and abstain from applying the optional 2.4.x kernel patch. If +you haven't stopped reading beyond this line, download the patch, apply it, rebuild the +kernel or modules and re-install (kernel or cdrom.o and sr_mod.o +modules, whichever appropriate), but don't ask me how. As you could +have noticed, patch targets SCSI CD-ROM module. This means that you +have to "route" your IDE unit through ide-scsi to get this one +working. To see it in action, insert formatted DVD+RW media and try to +access it, 'dd if=/dev/scdN count=0' +would do. Then verify that kernel logs "srN: mmc-3 profile: 1Ah". You should now be +able to 'mkisofs -pad . | dd of=/dev/scdN +obs=32k' or even 'mke2fs -b 2048 /dev/scdN' and observe kernel logging "srN: dirty DVD+RW media." + + + +

    Linux 2.6 DVD+RW kernel support is planned in +line with DVD+MRW kernel support. This [unfortunately] means that +industry has to deliver a DVD+MRW capable unit first. Yes, the last +sentence means that despite all the promises, there are no such units +available on the market yet. As of the 1st of August 2003, Ricoh MP5240A, +Philips DVDRW416K or BenQ DW400A do not actually implement +Mt.Rainier/EasyWrite support. It remains to be seen if they will offer +it in form of firmware upgrade. In either case, the [original] project +goal is not only read-write support for DVD+[M]RW capable units +themselves, but even playback of DVD+MRW formatted media in legacy +DVD-ROM units (when defect list will be read and interpreted by OS +software in opposite to Mt.Rainier firmware). + +

  • Even though kernel now +permits to build and mount arbitrary file system, there is one thing you +must keep in mind before you just proceed, no matter how +tempting it might appear. + +

    As you might know DVD+RW media can sustain only +around 1000 overwrites. The thing about fully fledged file systems +is that every read [or tight bunch of 'em] is accompanied by +corresponding i-node update or in other words a write! Now, let's say +you lookup the mount point (e.g. ls /mnt/dvd) ten times a day. This +gives you a 100 days lifetime on your mountpoint and therefore media. +Not really much, huh? So do use noatime mount option with +DVD+RW media or have it mounted read-only most of the time. However! +Every read-write mount "costs" a super-block update. So that +if you remount the media say 3 times a day, it would last for about a +year [supermount +would exhaust the "budget" way sooner]... Defect management +[in firmware, a.k.a. Mt.Rainier, +or at file system level] would improve the situation, but ideally +file system driver should definitely refrain from modifying the +super-block [marking it dirty] if nothing was actually written since +last mount. Given the development status of Linux UDF the +chances for seeing the latter implemented [for UDF] are more than just +conceivable. The request is already filed and even possible solution is +being discussed. But why not give UDF a shot already then? By default +UDF write support is unfortunately disabled and you might have to +reconfigure the kernel and rebuild modules. Alternatively [my preferred +option actually] fetch the code at SourceForge and +build the module separately. Of course you will have to fetch and build +udftools as well. But once it's done just type: + +

    +mkudffs --spartable=2 --media-type=cdrw /dev/scdN
    +mount -o rw,noatime /dev/scdN /mnt/cdrom
    +
    + +

    mkudffs command line options were suggested +by UDF maintainer, Ben Fennema. + +

  • Performance optimization. This paragraph +applies only if you've patched the kernel. As some of you might +remember the original recommendation was "do use obs=32k +for optimal performance." Well, it was rather naive of me to say +so, as common block device layer completely reorganizes the +stream so that '>/dev/scd0' is as good as '|dd +of=/dev/scd0 obs=32k'. It should also be noted that dumping to +/dev/scd0 puts quite a pressure on VM subsystem, as the data passes +through block buffer cache. To minimize the pressure and improve +overall system performance bind the cdrom device to a raw device, e.g. +'raw /dev/raw/raw1 /dev/scd0', growisofs will locate and use +it automatically. obs=32k makes perfect sense with /dev/raw devices, +but dd (as well as most other programs, e.g. tar) won't work as +/dev/raw expects specifically aligned buffer... As temporary +workaround, just to get you going so that you can start figuring things +out, consider this +"hacklet"... + +

+ +


+ +

Compatibility: caveat lector

+ +


+ +

This paragraph discusses "DVD-ROM +compatibility," or playability of already recorded media in legacy +units. Blank media compatibility issues, or cases such as failure to +start or fulfill recording because of poor media support by burner +firmware, are beyond the current scope. Turn to your vendor for list of +supported media and/or to the public to share your +experience. + +

In order to optimize seek times DVD[-ROM] players +calibrate their mechanics every time the media is loaded by sliding +the optical head some place, picking up the signal and noting the +physical block address underneath the lens. In order for this procedure +to work with re-writable/recordable media, that particular spot has to +be written to [or de-iced in DVD+RW terms]. Some units slide the head to +30mm [radial] to calibrate, some to 35mm. In order to keep such players +"happy," make sure that at least 1GB is written [before you +attempt to mount it in DVD-ROM unit]. + +

Other units attempt to seek to lead-out [or vicinity +of it] for calibration purposes. Now the catch is that it's perfectly +possible to produce a DVD+RW disc without lead-out. Most notably media +initially formatted with dvd+rw-format [apparently] +doesn't have any lead-out, not to mention that practically whole +surface remains virgin. If you fail to mount/play DVD+RW media, attempt +to + +

dvd+rw-format -lead-out /dev/scdN
+ +

which relocates the lead-out next to outermost +written sector as well as makes sure there is no virgin surface before +it. Previously written data is not affected by this operation. + + +

Then non-finalized DVD+R and Sequential +DVD-R[W] discs don't have lead-out either(*). +If you fail to mount/play DVD+R media and wish to sacrifice the +remaining space for immediate compatibility, just fill the media +up(**). Alternatively if you master volume in a single take +and don't plan to use it for multi-sessioning(***), you have +the option to invoke growisofs with -dvd-compat option and cut +the real lead-out directly after the first session. + +

+ + + + + + + + + +
(*) +Well, there are lead-outs at the session edges, but +the problem is that "End Physical Sector Number of Data Area" +field in "Control Data Zone" of the lead-in contains address +of the largest media sector, which makes affected DVD[-ROM] players +calibrate at the outermost edge instead of the first session. Actually +I fail to understand why don't they burn the address of last sector of +the first session in the lead-in even on multi-session discs... +
(**) +But beware the 4GB limit! +If 4GB is already an issue, or if you don't feel like throwing +unrelated data on the media in question, then invoke 'growisofs +-M /dev/scd0=/dev/zero' (supported by 5.6 and later). +Alternative is to re-master the whole volume, naturally with +-dvd-compat option. +
(***) +E.g. when mastering DVD-Video disc:-) Note that +-dvd-video option [passed to mkisofs] engages +-dvd-compat automatically.
+ +


+ +

Then we have logical format compatibility +issue(s). Probably the very ground for all the controversy around +DVD+RW, rather around DVD+RW media not being playable in a whole range +of players. DVD+RW Alliance was keen to blame on DVD-ROM vendors, even +claiming that they deliberately block playback. But the fact is that +format specifications don't explicitly say that unrecognized format +[designated by "Book Type" field in "Control Data +Zone" of the lead-in] should be treated as DVD-ROM +and [in my opinion] it was rather naive of them to claim and expect +that the media will be playable in "virtually all players." +This deficiency was recognized by practically all DVD+RW vendors [well, +apparently by "traditional" DVD+RW vendors and not +"latest generation" vendors such as Sony, NEC, TDK...] and a +secret vendor-specific command +manipulating this "Book Type" field was implemented. So if +you fail to mount/play DVD+RW media, you might have an option to + +

dvd+rw-booktype -dvd-rom -media /dev/scdN
+ +

Once again. Not all vendors support this and you +can't expect this utility to work with all recorders. + +

It's naturally not possible to manipulate the +"Book Type" field on DVD+R media, that is not after the +lead-in is written [which takes place at the moment the first session +gets closed]. But it might be possible to control how it [lead-in] is +going to be branded by programming the drive in advance: + +

dvd+rw-booktype -dvd-rom -unit+r /dev/scdN
+ +

Meaning that if you fail to play DVD+R media, you +can attempt to burn another disc with more appropriate unit settings. +For more background information about dvd+rw-booktype, see "Compatibility +Bitsettings" article at dvdplusrw.org. + +

There [potentially] are other logical +DVD+RW(*) format incompatibilities, but the "Book +Type" issue discussed above is the only one "officially" +recognized. Well, it's actually understandable as it's the only one +that can be recognized and addressed by a DVD+RW vendor alone. +Recognition of other incompatibilities would require cooperation from +DVD[-ROM] player vendors and that's something they +apparently are not willing to show referring to the fact that DVD+RW +format is not approved [and apparently never will be] by DVD Forum(**). + +

+ + + + + +
(*) +Finalized DVD+R media branded with +DVD-ROM "Book Type" is virtually identical to +DVD-ROM.
(**) +To which I say "so what?" DVD Forum is an +alliance of manufacturers just like DVD+RW Alliance is. It [or any +other party for that matter] has no authority to deny a technology +development initiative.
+ +


+ +

Finally there is a physical incompatibility issue. +They claim that there are optical pick-ups out there not being capable +to decode the track because of low reflectivity of DVD+RW media +surface. I write "they claim," because in the lack of +cooperation from DVD[-ROM] vendors it's not possible to +distinguish physical from logical format incompatibility, which I find +important to tell apart in order to make sure at least logical format +incompatibility issues don't persist over time. It might be as trivial +as following. As you surely know [already], DVD+RW has same +reflectivity as dual-layer DVD-ROM. Now the catch is that +the linear pit density in turn is same as of single-layer one. Meaning +that if player makes assumptions about linear pit density based on +reflectivity, then it won't be able to trace the track... But either +way, there is very little you can do about this one, but to try another +player... + +


+ +

Technical Ramblings

+ +


+ +

+ +

As for multi-session ISO9660 [DVD] +recordings! Unfortunately, Linux ISOFS implementation has certain +deficiency which limits interoperability of such recordings. In order +to understand it, have a look at sample ISO9660 layout to the right... +Now, the problem is that isofs i-nodes(*) are 32 bits wide +(on a 32-bit Linux) and represent offsets of corresponding directory +entries (light-greens), byte offsets from the beginning of media. This +means that no directory (green areas) may cross 4GB boundary without +being effectively corrupted:-( It should be noted that in +reality it's a bit better than it looks on the picture, as mkisofs +collects all the directories in the beginning of any particular session +(there normally are no blues between greens). The first session +is therefore never subject to i-node wrap-around, but not the +subsequent ones! Once again, files +themselves may reside beyond the 4GB +boundary, but not the directories, in +particular not in further sessions. Having noted that directory entries +are actually specified to start at even offsets, I figured that +it's perfectly possible to +"stretch" the limit to 8GB. But in order to assure the +maximum interoperability, you should not let any session +start past 4GB minus space required for directory +structures, e.g. if the last session is to fill the media up, it +has to be >400MB. As of version 5.3 growisofs refuses to append +a new session beyond 4GB-40MB limit(**), where 40MB is +pretty much arbitrary chosen large value, large for directory catalogs +that is. Yet it doesn't actually guarantee that you can't suffer +from i-node wrap-around. Interim fs/isofs +kernel patch was addressed to those who have actually ran into the +problem and have to salvage the data. Even though permanent solution +for this problem appears in Linux kernel 2.6.8 (thanks to Paul Serice +effort), growisofs keeps checking for this 4GB limit in order to ensure +broader compatibility of final recordings. + + + + + + +
(*) +i-node is a number uniquely identifying a single +file in a file system +
(**) +well, as DVD+R Double Layer support was introduced +in 5.20, -use-the-force-luke=4gms option was added to override +this behaviour (naturally recommended for Linux kernel 2.6>=8 users and +kernel developers only;-) +
+ +


+ +

Why media reload is performed after every +recording with growisofs? Well, it's performed only if you didn't +patch the kernel:-) But no, I'm not insisting on patching the kernel! +All I'm saying is that in the lack of kernel support, media reload is +performed for the following reason. In order to optimize file access +kernel maintains so called block cache, so that repetitive requests for +same data are met directly from memory and don't result in multiple +physical I/O. Now the catch is that block cache layer remains totally +unaware of growisofs activities, growisofs bypasses the block +cache. This means that block cache inevitably becomes out of sync, +which in turn might appear to you as corrupted data. Media reload is +performed to flush/resync the block cache. + +


+ +

What does [kernel] "DVD+RW support" +really mean? Even though DVD+RW has no notion of [multiple] +sessions, to ensure compatibility with DVD-ROM it's essential to issue +"CLOSE TRACK/SESSION (5Bh)" MMC command to +terminate/suspend background formatting (if any in progress) whenever +you intend to eject the media or simply stop writing and want better +read performance (e.g. remount file system read-only). This is what the +patch is basically about: noting when/if media was written to and +"finalizing" at unlock door. + +

Secondly, whenever you employ fully fledged +file system, I/O requests get inevitably fragmented. +"Fragmented" means following. Even though you can address the +data with 2KB granularity, it [data] is physically laid out in 32KB +chunks. This in turn means that for example writing of 2KB block +involves reading of 32KB chunk, replacing corresponding 2KB and writing +down of modified 32KB chunk. "Fragmented requests" are those +that are smaller than 32KB or/and cross the modulus 32KB boundaries. In +order to optimize the process certain caching algorithm is implemented +in unit's firmware. Obviously it can't adequately meet all possible +situations. And so in such unfortunate situations the drive apparently +stops processing I/O requests returning "COMMAND SEQUENCE ERROR +(2Ch)" ASC. This is the second essential of "DVD+RW +support," namely injecting of "SYNCHRONIZE CACHE (35h)" +MMC command in reply to the error condition in question. The command +flushes the cached buffers which makes it possible to resume the data +flow. + +

Unfortunately the above paragraph doesn't +seem to apply to the 1st generation drives, Ricoh MP5120A and +derivatives:-( "SYNCHRONIZE CACHE (35h)" doesn't +seem to be sufficient and the unit keeps replying with "COMMAND +SEQUENCE ERROR (2Ch)" going into end-less loop. This makes it +impossible to deploy arbitrary file system. I'm open for +suggestions... Meanwhile the I've chosen to simply suspend I/O till the +media is unmounted. Even 2nd gen unit were reported to exhibit similar +[but not the same] behaviour under apparently extremely rare +circumstances. At least I failed to reproduce the problem... The problem +reportedly disappears with firmware upgrade... + +

Then some [most?] of post-2nd gen units, from +most vendors, seem to not bother about complying with +DVD+RW specification, "true random write with 2KB +granularity" part in particular. Instead they apparently expect +host to apply procedure pretty much equivalent to DVD-RW +Restricted Overwrite. To be more specific host seems to be expected to +coalesce 2KB requests and perform aligned writes at native DVD ECC +blocksize, which is 32KB. Formally this should not be required, but +it's the reality of marketplace:-( + +

This one really beats me. Sometimes the unit +simply stops writing signaling a vendor specific positioning error, +03h/15h/82h to be specific. Especially if the media is newly formatted. +Couple of work theories. One is that block buffer cache reorders +requests so that they are not sequential anymore, "FLUSH +CACHE" might do the trick. Another one is that under +"underrun" condition background formatting kicks off and has +to be explicitly stopped. "Underrun" is in quotes because +the unit is supposed to handle temporary data stream outages +gracefully. If you run into this (you most likely will), try to +complement growisofs command line with [undocumented] +-poor-man option (which has to be first in the command line). +This option eliminates request reorders and minimizes possibility for +"underrun" condition (by releasing the pressure off VM +subsystem). + +


+ +

The original idea was to implement DVD+RW support in +drivers/cdrom/cdrom.c. Unfortunately SCSI layer maintains private +"writeable" flag controlling the ability to issue WRITE +commands. The flag is impossible to reach for from the Unified CD-ROM +driver. But why am I talking about SCSI when there are only IDE units +out there (at least for the time being)? Well, as you most likely want +to occasionally burn even CD-R[W] with cdrecord you want it to go +through ide-scsi emulation layer anyway. So I figured that SCSI CD-ROM +driver is the one to aim for even for DVD+RW. + +

Unfortunately it was not possible to implement it +completely in sr_mod.o:-( Minor drivers/cdrom/cdrom.c +modification was required to sense the media before decision about +whether or not to permit write open. That's because DVD+RW drives are +morphing their behaviour after currently mounted media and it's +essential to identify newly inserted media. + +

Special comment about "what a dirty +hack!!!" To my great surprise it turned out that time-out value you +pass in cdrom_generic_command is simply ignored and time-out is set to +pre-compiled value of 30 seconds. Unfortunately it's way too low for +formatting purposes and I had to do something about it. Alternative to +"the dirty hack" was to add another argument to sr_do_ioctl +and modify all the calls to it... I've chosen to take over those 31 +unused bits from the "quiet" argument instead of modifying +all the calls (too boring). + +

But even if time-out value passed down to kernel +(with either CDROM_SEND_PACKET or SG_IO ioctl) is taken into +consideration, it's apparently not interpreted as user-land code +expects it to. As I figured... There is no documentation on +CDROM_SEND_PACKET, but following the common sense most programmers +(including myself:-) expect it to be interpreted in at least +platform-independent manner, such as milliseconds maybe? SG_IO timeout +in turn is documented +to be measured in milliseconds... Neither of this holds true! Kernel +treats these values as "jiffies," which is a +platform-dependent value representing time elapsed between timer +interrupts. But if we attempt to send down "jiffies," it +might turn out wrong too [at least for the moment of this writing]. The +catch is that [IA-32] kernel developers figured it's cool to shorten +"jiffy," but didn't care to provide user-land with actual +value (well, not of actual interest, too much legacy code to deal with) +nor scale timeouts +accordingly in respect to the legacy value of 10ms. + +

There is another kernel "deficiency" I ran +into while working on the (original version of) dvd+rw-format utility. +The drive provides background formatting progress status, but +unfortunately it's impossible to access it. That's because progress +counter is returned [in reply to "TEST UNIT READY"] as +"NO SENSE/LOGICAL UNIT NOT READY/FORMAT IN PROGRESS" sense +bytes but with "GOOD" status. Apparently any sense data with +"GOOD" status is discarded by the common SCSI layer. + + + +

It was pointed out to me that DVD+RW units work with +Acard SCSI to +IDE bridges. + +


+ +

What does plus in DVD+RW/+R +stand for? Originally this paragraph started as following: + +

The key feature of DVD+RW/+R media is +high [spatial] frequency wobbled [pre-]groove with addressing +information modulated into it. This makes it possible to resume +interrupted [or deliberately suspended] burning process with accuracy +high enough for DVD[-ROM] player not to "notice" anything at +playback time. Recovery from buffer underrun condition in DVD-RW/-R +case in turn is way less accurate procedure, and the problem is that +the provided accuracy is very much what average player can tolerate. +Now given that both provided and tolerated inaccuracies are +proportional to respectively writing and reading velocities there +basically no guarantee that DVD-RW/-R recording that suffered from +buffer underrun will be universally playable.

+ +

Well, it turned out that I was wrong about one +thing. I failed to recognize that DVD-R[W] +groove also provides for adequately accurate recovery from +buffer underrun condition/lossless linking. Not as accurate as DVD+RW, +but accurate enough for splices to be playable in virtually any +DVD-ROM/-Video unit. Yet! When it comes to DVD-R[W] recording +specificaton apparently insists that you choose between + +

    +
  • buffer underrun protection and +
  • full DVD-ROM/-Video compatibility. +
+ +

The specification asserts that the latter is +achieved only in Disc-at-once recording mode and only if data-stream +was maintained uninterrupted throughout whole recording. Once again. +Even though most vendors implement lossless linking in DAO +mode(*), full DVD-ROM/-Video compatibility is +guaranteed only if recording didn't suffer from buffer underruns. The +problem is that "offended" sectors are denoted with certain +linking chunk appearing as degraded user data, few bytes, which +are supposed to be "corrected away" by ECC +procedure(**). DVD+ splices are in turn only few bits large +and are "accounted" to sync patterns, not to user data +area. So that even if suffered from buffer underrun, DVD+ sector is +logically indistiguishable from DVD-ROM. Which is why it's commonly +referred to that DVD+RW/+R combine DVD-ROM/-Video compatibility with +[unconditional] buffer underrun protection. + +

As already mentioned, DVD+ groove has +"addressing information modulated into it," ADIP (ADress In +Pre-groove). This gives you an advantage of writing DVD+RW in truly +arbitrary order, even to virgin surface and practically instantly +(after ~40 seconds long initial format procedure). In addition, DVD+RW +can be conveniently written to with 2KB granularity(***). +DVD-RW in turn can only be overwritten in arbitrary order. +Meaning that it either has to be completely formatted first (it takes +an hour to format 1x media), or initially written to in a sequential +manner. And it should also be noted that block overwrite is +never an option if DVD-RW media was recorded in [compatible] +Disc-at-once or even Incremental mode, only whole disc blanking is. + +

Unlike DVD-R[W], DVD+R[W] recordings can be +suspended at any time without any side effects. Consider following +scenario. You have a lot of data coming in [at lower rate], which is to +be recorded into one file. Meanwhile it turns out that you have to +retrieve previously recorded data. This would naturally require +suspention of recording. Most notably in DVD-R [and naturally DVD-RW +Sequential] case it would result in a hole in the file being recorded. +So called linking area, most commonly 32KB gap, has to be introduced. +So that you either have to wait till the file is complete or figure out +how to deal with holey files. Thanks to ADIP, DVD+R recording is +resumed from the very point it was suspended at. In DVD-RW Restricted +Overwrite case no gaps are introduced, but if the media was formatted +only minimally, suspension/resuming procedure has to be applied and it +takes ~40 seconds to perform one. In DVD+RW case, suspension/resuming +is instant regardless media state. + +

What does all of the above mean in practice? Well, I +was actually hoping that readers would [be able to] figure it out by +themselves. Apparently a couple of "guiding" words are +needed... It means that it's trivial to employ DVD+RW for housing of +live and arbitrary file system, no special modifications to target file +system driver are required... Real-time VBR (Variable Bit Rate) Video +recordings are children's game... + +

Sometimes DVD+RW/+R recording strategy is referred +to as packet writing. I myself am reluctant to call it so (or +TAO/SAO/DAO) for the following reason. Despite the fact that DVD-R[W] +provides for lossless linking (within a packet/extent only), +packets/extents are still denoted with certain linking information +which distinguishes it (recording mode in question) from e.g. +Disc-at-once. Now the point is that written DVD+RW/+R media, rather its +Data Zone, does not contain any linking information and is +logically indistinguishable from one written in DVD-R[W] Disc-at-once +mode (or DVD-ROM for that matter). + +

It's maintained that signal from DVD+ groove (the +one essential for recording, not reading) is much stronger, which makes +it quite resistant to dust, scratches, etc. + +

Now we can also discuss differences between +Double/Dual Layer implementations. DVD+R Double Layer permits for +arbitrary layer break positioning yet maintaining contiguous logical +block addressing. In other words address of the block following the +break is always address of the block preceding one plus 1, even for +arbitrarily positioned break. DVD-R Dual Layer on the +other hand implies unconditionally disjoint logical block addressing +[for arbitrarily positioned layer break that is]. This is because block +addresses as recorded by unit are pre-defined by DVD-dash +groove structure. In practice it means that file system layout has to +effectively have a hole, which "covers" twice the space between chosen +layer break position and outermost edge of the recordable area. And in +even more practical terms this means that mastering programs have to be +explicitly adapted for DVD-R layer break positioning. +Unlike DVD+plus that is. + +

+ + + + + + + +
(*) +According to Mt. Fuji draft +buffer underrun protection is not even an option in DVD-R DAO: "If a +buffer under-run occurs, the logical unit shall stop +writing immediately and the logical unit shall start +writing of Lead-out." Protection is defined in Incremental Sequential +mode and DVD-RW context. By the way, note that this draft also +discusses DVD+RW. You should be aware that they refer to abandoned +version which has very little to do with DVD+RW/+R implementation being +discussed here.
(**) +ECC redundancy does permit for more degradation, +more that this linking chunk that is, so that it hadly affects the +playability.
(***) +DVD "native" block size is 32KB, and 2KB +granularity is nothing but a trick, but you're excused from playing it, +i.e. reading 32KB, replacing corresponding 2KB and writing 32KB +back.
+ +


+ + + + + diff --git a/extra-sources/dvd+rw-tools-6.1/mp.h b/extra-sources/dvd+rw-tools-6.1/mp.h new file mode 100644 index 0000000..ece06de --- /dev/null +++ b/extra-sources/dvd+rw-tools-6.1/mp.h @@ -0,0 +1,66 @@ +#ifdef _WIN32 + +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0400 +#endif + +#include + +#define THR_TYPE DWORD WINAPI + +static void *__thread_create(DWORD (WINAPI *func)(PVOID),void *arg) +{ return (void *)CreateThread(NULL,64*1024,func,arg,0,NULL); } +static void __thread_yield(void) { (void)SwitchToThread(); } +static int __thread_wait(void *h) +{ DWORD ret; + if (WaitForSingleObject(h,INFINITE)==WAIT_OBJECT_0 && + GetExitCodeThread(h,&ret)) + { CloseHandle(h); + return ret; + } + return -1; +} +static void *__semaphore_create(int max){ return CreateSemaphore(NULL,0,max,NULL); } +static int __semaphore_wait(void *h) { return WaitForSingleObject(h,INFINITE)!=WAIT_FAILED; } +static int __semaphore_post(void *h) { return ReleaseSemaphore(h,1,NULL); } +static void __semaphore_close(void *h) { CloseHandle(h); } + +#else + +#include +#include +#include +#include + +#define THR_TYPE int + +static void *__thread_create(int (*func)(void *),void *arg) +{ pthread_t h; + pthread_attr_t attr; + + if (pthread_attr_init(&attr)==0 && + pthread_attr_setstacksize(&attr,64*1024)==0 && + pthread_attr_setscope(&attr,PTHREAD_SCOPE_SYSTEM)==0 && + pthread_create(&h,&attr,(void *(*)(void *))func,arg)==0 ) + return (void *)h; + + return NULL; +} +static void __thread_yield(void) { (void)sched_yield(); } +static int __thread_wait(void *h) +{ void *ret; + if (pthread_join((pthread_t)((size_t)h),&ret)==0) + return (int)ret; + return -1; +} +static void *__semaphore_create(int max) +{ sem_t *h = calloc(1,sizeof(sem_t)); + if (h==NULL) return h; + if (sem_init(h,0,0)<0) { free(h); return NULL; } + return h; +} +static int __semaphore_wait(void *h) { return sem_wait(h)==0; } +static int __semaphore_post(void *h) { return sem_post(h)==0; } +static void __semaphore_close(void *h) { sem_destroy(h), free(h); } + +#endif diff --git a/extra-sources/dvd+rw-tools-6.1/rpl8.cpp b/extra-sources/dvd+rw-tools-6.1/rpl8.cpp new file mode 100644 index 0000000..b0da238 --- /dev/null +++ b/extra-sources/dvd+rw-tools-6.1/rpl8.cpp @@ -0,0 +1,350 @@ +#if 0 +# +# The code is in public domain, May-September 2002. +# +# RICOH Program Loader 8 (primarily DVD+RW units) for Linux 2.4 and +# upwards. So far has been tested with: +# - HP dvd100i +# - Ricoh MP5120A +# - Philips DVDRW208 +# - HP dvd200i +# +# This is second version adding support for Program Loader 9 and +# firmware consistency check. +# +# The program never updates Program Loader code so that you should +# always be able to downgrade your firmware in case something goes +# wrong. +# +# - make sure you have no media in drive, optionally go to single user +# mode; +# - run 'rpl8 /dev/cdrom firmware.image.bin'; +# - observe the program backing up your current firmware and uploading +# new one; +# - take system down and cycle the power; +# +# There is -dump-only option which only backs up firmware. Note that +# you might have to cycle the power even after -dump-only. +# +# "ide-scsi: Strange, packet command initiated yet DRQ isn't asserted" +# surrounded by other nasty messages logged on console is "normal." +# +/bin/sh << EOS +MODNAME=\`expr "/$0" : '\(.*[^/]\)/*$' : '.*/\(..*\)' : '\(.*\)\..*$'\` +case "`uname -s`" in +SunOS) (set -x; g++ -fno-exceptions -O -o \$MODNAME "$0" -lvolmgt) ;; +*) (set -x; g++ -fno-exceptions -O -o \$MODNAME "$0") ;; +esac +EOS +exit +#endif + +#if defined(__linux) +#define _XOPEN_SOURCE 500 +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "transport.hxx" + +#define BUFFER_BLOCK (16*1024) +#define FIRMWARE_SIZE (1024*1024) +#define MAGIC_OFFSET (32*1024) +#if FIRMWARE_SIZE%BUFFER_BLOCK!=0 +#error "Invalid BUFFER_BLOCK" +#endif +#if MAGIC_OFFSET%BUFFER_BLOCK!=0 +#error "Invalid BUFFER_BLOCK" +#endif + +int main (int argc,char *argv[]) +{ int fd,in,out,off,j; + struct stat sb; + char dump[64],*meaning; + unsigned char *buffer,*firmware,sigfile[6],sigunit[6],ascq='\xFF'; + struct { + unsigned char type,skip[7]; + char vendor[8],ident[16],revision[4]; + } inq; + Scsi_Command cmd; + unsigned char *sense=cmd.sense(); + + if (argc<3) + { fprintf (stderr,"usage: %s /dev/cdrom " + "[-[dump-only]|firmware.bin]\n",argv[0]); + return 1; + } + + if ((fd=open ("/dev/zero",O_RDWR)) < 0) + { fprintf (stderr,"unable to open(\"/dev/zero\"): "), perror(NULL); + return 1; + } + + buffer = (unsigned char *)mmap(NULL,BUFFER_BLOCK,PROT_READ|PROT_WRITE, + MAP_PRIVATE,fd,0); + if (buffer==MAP_FAILED) + { fprintf (stderr,"unable to anonymously mmap %d bytes: ",BUFFER_BLOCK), + perror (NULL); + return 1; + } + close (fd); + + if (!cmd.associate(argv[1])) + { fprintf (stderr,"%s: unable to open: ",argv[1]), perror (NULL); + return 1; + } + + cmd[0]=0x12; // INQUIRY + cmd[4]=sizeof(inq); + cmd[5]=0; + if (cmd.transport(READ,(unsigned char *)&inq,sizeof(inq))) + { perror("unable to INQUIRY, examine /var/log/message"); + return 1; + } + + if ((inq.type&0x1F) != 5) + { fprintf (stderr,"\"%s\" is not a CD-ROM device\n",argv[1]); + return 1; + } + + cmd[0]=0x00; // TEST UNIT READY + cmd[5]=0x80; + if (!cmd.transport()) + { fprintf (stderr,"\"%s\" is ready, is media present?\n",argv[1]); + return 1; + } + + if (sense[12] != 0x3A) // should reply with "NO MEDIA" + { fprintf (stderr,"\"%s\": unexpected ASC=%02xh/ASCQ=%02xh\n", + argv[1],sense[12],sense[13]); + return 1; + } + + sprintf (dump,"%.8s%.16s%.4s.bin",inq.vendor,inq.ident,inq.revision); + for(j=0;dump[j];j++) if (dump[j]==' ') dump[j]='_'; + + in=-1, firmware=NULL; + if (argv[2][0] != '-') + { unsigned short cksum; + int i; + + if ((in=open(argv[2],O_RDONLY)) < 0) + { fprintf (stderr,"unable to open(\"%s\"): ",argv[2]), perror (NULL); + return 1; + } + if (fstat(in,&sb) < 0) + { fprintf (stderr,"unable to stat(\"%s\"): ",argv[2]), perror (NULL); + return 1; + } + + if (sb.st_size != FIRMWARE_SIZE) + { fprintf (stderr,"\"%s\": size is insane\n",argv[2]); + return 1; + } + + firmware=(unsigned char *)mmap(NULL,FIRMWARE_SIZE,PROT_READ, + MAP_PRIVATE,in,0); + if (firmware==MAP_FAILED) + { fprintf (stderr,"unable to mmap(\"%s\"): ",argv[2]), perror (NULL); + return 1; + } + + close (in); + + memcpy(sigfile,firmware+MAGIC_OFFSET+4,6); + if (memcmp(sigfile,"MMP5",4)) + { fprintf (stderr,"\"%s\": signature is insane\n",argv[2]); + return 1; + } + + for (cksum=0,i=MAGIC_OFFSET;i>8) != firmware[FIRMWARE_SIZE-2] + ) + { fprintf (stderr,"\"%s\" is corrupted or encrypted\n",argv[2]); + return 1; + } + } + + if ((out=open(dump,O_WRONLY|O_CREAT|O_EXCL,0666)) < 0) + { fprintf (stderr,"unable to creat(\"%s\"): ",dump), perror (NULL); + return 1; + } + + cmd[0]=0xE4; // INVOKE PROGRAM LOADER + cmd[9]=(1<<6)&0x40; + if (cmd.transport()) + { fprintf (stderr,"\"%s\": unable to invoke RICOH Program Loader " + "[ASC=%02xh/ASCQ=%02xh]\n", + argv[1],sense[12],sense[13]); + return 1; + } + + do { // not really a loop, just a way to get rid of goto's... + poll(NULL,0,250); + + cmd[0]=0xE4; // INVOKE PROGRAM LOADER + cmd[9]=(1<<6)&0x40; + if (cmd.transport()) + { fprintf (stderr,"\"%s\"[E4]: unexpected ASC=%02xh/ASCQ=%02xh\n", + argv[1],sense[12],sense[13]); + break; + } + + poll(NULL,0,250); + + cmd[0]=0x12; // INQUIRY + cmd[4]=sizeof(inq); + cmd[5]=0; + if (cmd.transport(READ,(unsigned char *)&inq,sizeof(inq))) + { perror("unable to INQUIRY, examine /var/log/message"); + break; + } + + if (memcmp(&inq.vendor,"RICOH Program Loader 8",24) && + memcmp(&inq.vendor,"RICOH Program Loader 9",24) ) + { fprintf (stderr,"\"%s\": unknown Program Loader " + "%.8s|%.16s|%.4s\n", + argv[1],inq.vendor,inq.ident,inq.revision); + break; + } + + fprintf (stderr,"\"%s\": dumping firmware image to \"%s\" ", + argv[1],dump); + for (off=0;off>24)&0xFF; + cmd[3]=(off>>16)&0xFF; + cmd[4]=(off>>8)&0xFF; + cmd[5]=(off)&0xFF; + cmd[7]=(BUFFER_BLOCK>>8)&0xFF; + cmd[8]=(BUFFER_BLOCK)&0xFF; + cmd[9]=0; + if (cmd.transport(READ,buffer,BUFFER_BLOCK)) + { fprintf (stderr,"\"%s\"[E3]: unexpected " + "ASC=%02xh/ASCQ=%02xh\n", + argv[1],sense[12],sense[13]); + in=-1; + break; + } + if (write(out,buffer,BUFFER_BLOCK) != BUFFER_BLOCK) + { fprintf (stderr,"unable to write(\"%s\"): ",dump), + perror(NULL); + in=-1; + break; + } + fprintf (stderr,"."); + if (off==MAGIC_OFFSET) { memcpy(sigunit,buffer+4,6); } + } + fprintf (stderr,"\n"); + + if (in==-1) break; /* dump only or we failed to backup */ + +#if 1 + if (memcmp(sigunit,sigfile,6)) + { fprintf (stderr,"\"%s\": firmware signature mismatch " + "[%.6s|%.6s]\n", + argv[1],sigunit,sigfile); + break; + } +#endif + + fprintf (stderr,"\"%s\": uploading firmware image",argv[1]); + for (off=0;off>16)&0xFF; + cmd[6]=(BUFFER_BLOCK>>8)&0xFF; + cmd[7]=(BUFFER_BLOCK)&0xFF; + cmd[11]=0; + if (cmd.transport(WRITE,firmware+off,BUFFER_BLOCK)) + { fprintf (stderr,"\"%s\"[E2]: unexpected " + "ASC=%02xh/ASCQ=%02xh\n", + argv[1],sense[12],sense[13]); + in=-1; + break; + } + fprintf (stderr,"."); + } + fprintf (stderr,"\n"); + + if (in==-1) break; /* failed to upload */ + + fprintf (stderr,"\"%s\": unlocking firmware\n",argv[1]); + cmd[0]=0xE0; // UNLOCK FIRMWARE + cmd[3]=0; + cmd[9]=0; + if (cmd.transport()) + { fprintf (stderr,"\"%s\"[E0]: unexpected " + "ASC=%02xh/ASCQ=%02xh\n", + argv[1],sense[12],sense[13]); + break; + } + + fprintf (stderr,"\"%s\": ¡POINT OF NO RETURN!\n",argv[1]); + poll(NULL,0,3000); + signal (SIGINT,SIG_IGN); + signal (SIGTERM,SIG_IGN); + + cmd[0]=0xE1; // FIRE IT UP + // -----v----- don't update the Program Loader code + cmd[9]=(0<<6)&0x40; + if (cmd.transport()) + { fprintf (stderr,"\"%s\"[E1]: unexpected " + "ASC=%02xh/ASCQ=%02xh\n", + argv[1],sense[12],sense[13]); + break; + } + + while(1) + { poll(NULL,0,250); + cmd[0]=0x00; // TEST UNIT READY + cmd[5]=0x80; + if (!cmd.transport()) continue; // never happens? + if (sense[12] == 0xF7) + { if (ascq != sense[13]) + { switch (ascq=sense[13]) + { case 0: meaning="preparing"; break; + case 1: meaning="erasing contents"; break; + case 2: meaning="writing contents"; break; + case 3: meaning="verifying contents"; break; + default:meaning="unknown meaning"; break; + } + fprintf (stderr,"\"%s\": %s\n",argv[1],meaning); + } + } + else if (sense[12] == 0x3A) /* no media */ + { fprintf (stderr,"\"%s\": firmware upgrade succeeded:-)\n", + argv[1]), + fprintf (stderr,"\"%s\": " + "¡CYCLE THE POWER BEFORE PROCEEDING!\n", + argv[1]); + break; + } + else + { fprintf (stderr,"\"%s\"[0]: unexpected " + "ASC=%02xh/ASCQ=%02xh\n", + argv[1],sense[12],sense[13]); + in=-1; + break; + } + } + } while (0); + + cmd[0]=0xE4; // TERMINATE PROGRAM LOADER + cmd[9]=(0<<6)&0x40; + if (cmd.transport()) + { fprintf (stderr,"\"%s\": unexpected ASC=%02xh/ASCQ=%02xh\n", + argv[1],sense[12],sense[13]); + return 1; + } + + return in<0; +} diff --git a/extra-sources/dvd+rw-tools-6.1/transport.hxx b/extra-sources/dvd+rw-tools-6.1/transport.hxx new file mode 100644 index 0000000..9a6510d --- /dev/null +++ b/extra-sources/dvd+rw-tools-6.1/transport.hxx @@ -0,0 +1,1719 @@ +// +// This is part of dvd+rw-tools by Andy Polyakov +// +// Use-it-on-your-own-risk, GPL bless... +// +// For further details see http://fy.chalmers.se/~appro/linux/DVD+RW/ +// + +#if defined(__unix) || defined(__unix__) +#include +#include +#include +#include +#include +#include +#include +#include +#include + +inline long getmsecs() +{ struct timeval tv; + gettimeofday (&tv,NULL); + return tv.tv_sec*1000+tv.tv_usec/1000; +} + +#include + +#ifndef EMEDIUMTYPE +#define EMEDIUMTYPE EINVAL +#endif +#ifndef ENOMEDIUM +#define ENOMEDIUM ENODEV +#endif + +#include +#define ENV_LOCALE "" + +#elif defined(_WIN32) +#include +#include +#include +#include +#define ssize_t LONG_PTR +#define off64_t __int64 + +#include "win32err.h" + +#define poll(a,b,t) Sleep(t) +#define getmsecs() GetTickCount() + +#include +#define ENV_LOCALE ".OCP" +#endif + +#define CREAM_ON_ERRNO_NAKED(s) \ + switch ((s)[12]) \ + { case 0x04: errno=EAGAIN; break; \ + case 0x20: errno=ENODEV; break; \ + case 0x21: if ((s)[13]==0) errno=ENOSPC; \ + else errno=EINVAL; \ + break; \ + case 0x30: errno=EMEDIUMTYPE; break; \ + case 0x3A: errno=ENOMEDIUM; break; \ + } +#define CREAM_ON_ERRNO(s) do { CREAM_ON_ERRNO_NAKED(s) } while(0) + +#ifndef FATAL_START +#define FATAL_START(er) (0x80|(er)) +#endif +#define ERRCODE(s) ((((s)[2]&0x0F)<<16)|((s)[12]<<8)|((s)[13])) +#define SK(errcode) (((errcode)>>16)&0xF) +#define ASC(errcode) (((errcode)>>8)&0xFF) +#define ASCQ(errcode) ((errcode)&0xFF) + +static void sperror (const char *cmd,int err) +{ int saved_errno=errno; + + if (err==-1) + fprintf (stderr,":-( unable to %s: ",cmd); + else + fprintf (stderr,":-[ %s failed with SK=%Xh/ASC=%02Xh/ACQ=%02Xh]: ", + cmd,SK(err),ASC(err),ASCQ(err)); + errno=saved_errno, perror (NULL); +} + +static void sperror (const char *cmd,unsigned char *sense) +{ int saved_errno=errno; + int err=ERRCODE(sense); + + if (err==0) + fprintf (stderr,":-( unable to %s: ",cmd); + else + { if ((err==0x20407 || err==0x20408) && sense[15]&0x80) + fprintf (stderr,":-[ %s failed with SK=%Xh/ASC=%02Xh/ACQ=%02Xh@%.1f%%]: ", + cmd,SK(err),ASC(err),ASCQ(err), + 100.0*(sense[16]<<8|sense[17])/65536.0); + else + fprintf (stderr,":-[ %s failed with SK=%Xh/ASC=%02Xh/ACQ=%02Xh]: ", + cmd,SK(err),ASC(err),ASCQ(err)); + } + errno=saved_errno, perror (NULL); +} + +class autofree { + private: + unsigned char *ptr; + public: + autofree() { ptr=NULL; } + ~autofree() { if (ptr) free(ptr); } + unsigned char *operator=(unsigned char *str) + { return ptr=str; } + operator unsigned char *() { return ptr; } +}; + +extern "C" char *plusminus_locale() +{ static class __plusminus { + private: + char str[4]; + public: + __plusminus() { setlocale(LC_CTYPE,ENV_LOCALE); + int l = wctomb(str,(wchar_t)(unsigned char)'±'); + if (l>0) str[l]='\0'; + else str[0]='±',str[1]='\0'; + } + ~__plusminus() { } + operator char*(){ return str; } + } plusminus; + + return plusminus; +} + +#if defined(__linux) + +#include +#include +#include +#include +#include +#include +#if !defined(SG_FLAG_LUN_INHIBIT) +# if defined(SG_FLAG_UNUSED_LUN_INHIBIT) +# define SG_FLAG_LUN_INHIBIT SG_FLAG_UNUSED_LUN_INHIBIT +# else +# define SG_FLAG_LUN_INHIBIT 0 +# endif +#endif +#ifndef CHECK_CONDITION +#define CHECK_CONDITION 0x01 +#endif + +typedef enum { NONE=CGC_DATA_NONE, // 3 + READ=CGC_DATA_READ, // 2 + WRITE=CGC_DATA_WRITE // 1 + } Direction; +#ifdef SG_IO +static const int Dir_xlate [4] = { // should have been defined + // private in USE_SG_IO scope, + // but it appears to be too + 0, // implementation-dependent... + SG_DXFER_TO_DEV, // 1,CGC_DATA_WRITE + SG_DXFER_FROM_DEV, // 2,CGC_DATA_READ + SG_DXFER_NONE }; // 3,CGC_DATA_NONE +static const class USE_SG_IO { +private: + int yes_or_no; +public: + USE_SG_IO() { struct utsname buf; + uname (&buf); + // was CDROM_SEND_PACKET declared dead in 2.5? + yes_or_no=(strcmp(buf.release,"2.5.43")>=0); + } + ~USE_SG_IO(){} + operator int() const { return yes_or_no; } + int operator[] (Direction dir) const { return Dir_xlate[dir]; } +} use_sg_io; +#endif + +#if 0 +#include + +static union dl_rsm_open_device { + void *p; + int (*f)(const char *,int,...); + + dl_rsm_open_device(){ void *h; + if ((h=dlopen("libresmgr.so.1",RTLD_LAZY))==NULL || + (p=dlsym(h,"rsm_open_device"))==NULL) + f = open; + } + ~dl_rsm_open_device(){} +} rsm_open_device; + +extern "C" int dev_open(const char *pathname,int flags) +{ return rsm_open_device.f(pathname,flags); } +extern "C" int dev_open_patched() +{ return rsm_open_device.f!=open; } +#endif + +class Scsi_Command { +private: + int fd,autoclose; + char *filename; + struct cdrom_generic_command cgc; + union { + struct request_sense s; + unsigned char u[18]; + } _sense; +#ifdef SG_IO + struct sg_io_hdr sg_io; +#else + struct { int cmd_len,timeout; } sg_io; +#endif +public: + Scsi_Command() { fd=-1, autoclose=1; filename=NULL; } + Scsi_Command(int f) { fd=f, autoclose=0; filename=NULL; } + Scsi_Command(void*f){ fd=(long)f, autoclose=0; filename=NULL; } + ~Scsi_Command() { if (fd>=0 && autoclose) close(fd),fd=-1; + if (filename) free(filename),filename=NULL; + } + int associate (const char *file,const struct stat *ref=NULL) + { struct stat sb; + + /* + * O_RDWR is expected to provide for none set-root-uid + * execution under Linux kernel 2.6[.8]. Under 2.4 it + * falls down to O_RDONLY... + */ + if ((fd=open (file,O_RDWR|O_NONBLOCK)) < 0 && + (fd=open (file,O_RDONLY|O_NONBLOCK)) < 0) return 0; + if (fstat(fd,&sb) < 0) return 0; + if (!S_ISBLK(sb.st_mode)) { errno=ENOTBLK;return 0; } + + if (ref && (!S_ISBLK(ref->st_mode) || ref->st_rdev!=sb.st_rdev)) + { errno=ENXIO; return 0; } + + filename=strdup(file); + + return 1; + } + unsigned char &operator[] (size_t i) + { if (i==0) + { memset(&cgc,0,sizeof(cgc)), memset(&_sense,0,sizeof(_sense)); + cgc.quiet = 1; + cgc.sense = &_sense.s; +#ifdef SG_IO + if (use_sg_io) + { memset(&sg_io,0,sizeof(sg_io)); + sg_io.interface_id= 'S'; + sg_io.mx_sb_len = sizeof(_sense); + sg_io.cmdp = cgc.cmd; + sg_io.sbp = _sense.u; + sg_io.flags = SG_FLAG_LUN_INHIBIT|SG_FLAG_DIRECT_IO; + } +#endif + } + sg_io.cmd_len = i+1; + return cgc.cmd[i]; + } + unsigned char &operator()(size_t i) { return _sense.u[i]; } + unsigned char *sense() { return _sense.u; } + void timeout(int i) { cgc.timeout=sg_io.timeout=i*1000; } +#ifdef SG_IO + size_t residue() { return use_sg_io?sg_io.resid:0; } +#else + size_t residue() { return 0; } +#endif + int transport(Direction dir=NONE,void *buf=NULL,size_t sz=0) + { int ret = 0; + +#ifdef SG_IO +#define KERNEL_BROKEN 0 + if (use_sg_io) + { sg_io.dxferp = buf; + sg_io.dxfer_len = sz; + sg_io.dxfer_direction = use_sg_io[dir]; + if (ioctl (fd,SG_IO,&sg_io)) return -1; + +#if !KERNEL_BROKEN + if ((sg_io.info&SG_INFO_OK_MASK) != SG_INFO_OK) +#else + if (sg_io.status) +#endif + { errno=EIO; ret=-1; +#if !KERNEL_BROKEN + if (sg_io.masked_status&CHECK_CONDITION) +#endif + { ret = ERRCODE(sg_io.sbp); + if (ret==0) ret=-1; + else CREAM_ON_ERRNO(sg_io.sbp); + } + } + return ret; + } + else +#undef KERNEL_BROKEN +#endif + { cgc.buffer = (unsigned char *)buf; + cgc.buflen = sz; + cgc.data_direction = dir; + if (ioctl (fd,CDROM_SEND_PACKET,&cgc)) + { ret = ERRCODE(_sense.u); + if (ret==0) ret=-1; + } + } + return ret; + } + int umount(int f=-1) + { struct stat fsb,msb; + struct mntent *mb; + FILE *fp; + pid_t pid,rpid; + int ret=0,rval; + + if (f==-1) f=fd; + if (fstat (f,&fsb) < 0) return -1; + if ((fp=setmntent ("/proc/mounts","r"))==NULL) return -1; + + while ((mb=getmntent (fp))!=NULL) + { if (stat (mb->mnt_fsname,&msb) < 0) continue; // corrupted line? +#ifdef I_HAVE_PATCHED_SUBMOUNTD // see O_EXCL commentary in growisofs.c + if (!strcmp (mb->mnt_type,"subfs")) continue; +#endif + if (msb.st_rdev == fsb.st_rdev) + { ret = -1; + if ((pid = fork()) == (pid_t)-1) break; + if (pid == 0) execl ("/bin/umount","umount",mb->mnt_dir,(void*)NULL); + while (1) + { rpid = waitpid (pid,&rval,0); + if (rpid == (pid_t)-1) + { if (errno==EINTR) continue; + else break; + } + else if (rpid != pid) + { errno = ECHILD; + break; + } + if (WIFEXITED(rval)) + { if (WEXITSTATUS(rval) == 0) ret=0; + else errno=EBUSY; // most likely + break; + } + else + { errno = ENOLINK; // some phony errno + break; + } + } + break; + } + } + endmntent (fp); + + return ret; + } + int is_reload_needed () + { return ioctl (fd,CDROM_MEDIA_CHANGED,CDSL_CURRENT) == 0; } +}; + +#elif defined(__OpenBSD__) || defined(__NetBSD__) + +#include +#include +#include +#include +#include + +typedef off_t off64_t; +#define stat64 stat +#define fstat64 fstat +#define open64 open +#define pread64 pread +#define pwrite64 pwrite +#define lseek64 lseek + +typedef enum { NONE=0, + READ=SCCMD_READ, + WRITE=SCCMD_WRITE + } Direction; + +class Scsi_Command { +private: + int fd,autoclose; + char *filename; + scsireq_t req; +public: + Scsi_Command() { fd=-1, autoclose=1; filename=NULL; } + Scsi_Command(int f) { fd=f, autoclose=0; filename=NULL; } + Scsi_Command(void*f){ fd=(long)f, autoclose=0; filename=NULL; } + ~Scsi_Command() { if (fd>=0 && autoclose) close(fd),fd=-1; + if (filename) free(filename),filename=NULL; + } + int associate (const char *file,const struct stat *ref=NULL) + { struct stat sb; + + fd=open(file,O_RDWR|O_NONBLOCK); + // this is --^^^^^^-- why we have to run set-root-uid... + + if (fd < 0) return 0; + if (fstat(fd,&sb) < 0) return 0; + if (!S_ISCHR(sb.st_mode)) { errno=EINVAL; return 0; } + + if (ref && (!S_ISCHR(ref->st_mode) || ref->st_rdev!=sb.st_rdev)) + { errno=ENXIO; return 0; } + + filename=strdup(file); + + return 1; + } + unsigned char &operator[] (size_t i) + { if (i==0) + { memset(&req,0,sizeof(req)); + req.flags = SCCMD_ESCAPE; + req.timeout = 30000; + req.senselen = 18; //sizeof(req.sense); + } + req.cmdlen = i+1; + return req.cmd[i]; + } + unsigned char &operator()(size_t i) { return req.sense[i]; } + unsigned char *sense() { return req.sense; } + void timeout(int i) { req.timeout=i*1000; } + size_t residue() { return req.datalen-req.datalen_used; } + int transport(Direction dir=NONE,void *buf=NULL,size_t sz=0) + { int ret=0; + + req.databuf = (caddr_t)buf; + req.datalen = sz; + req.flags |= dir; + if (ioctl (fd,SCIOCCOMMAND,&req) < 0) return -1; + if (req.retsts==SCCMD_OK) return 0; + + errno=EIO; ret=-1; + if (req.retsts==SCCMD_SENSE) + { ret = ERRCODE(req.sense); + if (ret==0) ret=-1; + else CREAM_ON_ERRNO(req.sense); + } + return ret; + } + // this code is basically redundant... indeed, we normally want to + // open device O_RDWR, but we can't do that as long as it's mounted. + // in other words, whenever this routine is invoked, device is not + // mounted, so that it could as well just return 0; + int umount(int f=-1) + { struct stat fsb,msb; + struct statfs *mntbuf; + int ret=0,mntsize,i; + + if (f==-1) f=fd; + + if (fstat (f,&fsb) < 0) return -1; + if ((mntsize=getmntinfo(&mntbuf,MNT_NOWAIT))==0)return -1; + + for (i=0;i +#include +#include +#include +#include +#include +#include +#include + +typedef off_t off64_t; +#define stat64 stat +#define fstat64 fstat +#define open64 open +#define pread64 pread +#define pwrite64 pwrite +#define lseek64 lseek + +#define ioctl_fd (((struct cam_device *)ioctl_handle)->fd) + +typedef enum { NONE=CAM_DIR_NONE, + READ=CAM_DIR_IN, + WRITE=CAM_DIR_OUT + } Direction; + +class Scsi_Command { +private: + int fd,autoclose; + char *filename; + struct cam_device *cam; + union ccb ccb; +public: + Scsi_Command() + { cam=NULL, fd=-1, autoclose=1; filename=NULL; } + Scsi_Command(int f) + { char pass[32]; // periph_name is 16 chars long + + cam=NULL, fd=-1, autoclose=1, filename=NULL; + + memset (&ccb,0,sizeof(ccb)); + ccb.ccb_h.func_code = XPT_GDEVLIST; + if (ioctl (f,CAMGETPASSTHRU,&ccb) < 0) return; + + sprintf (pass,"/dev/%.15s%u",ccb.cgdl.periph_name,ccb.cgdl.unit_number); + cam=cam_open_pass (pass,O_RDWR,NULL); + } + Scsi_Command(void *f) + { cam=(struct cam_device *)f, autoclose=0; fd=-1; filename=NULL; } + ~Scsi_Command() + { if (cam && autoclose) cam_close_device(cam), cam=NULL; + if (fd>=0) close(fd); + if (filename) free(filename), filename=NULL; + } + + int associate (const char *file,const struct stat *ref=NULL) + { struct stat sb; + char pass[32]; // periph_name is 16 chars long + + fd=open(file,O_RDONLY|O_NONBLOCK); + + // all if (ref) code is actually redundant, it never runs + // as long as RELOAD_NEVER_NEEDED... + if (ref && fd<0 && errno==EPERM) + { // expectedly we would get here if file is /dev/passN + if (stat(file,&sb) < 0) return 0; + if (!S_ISCHR(ref->st_mode) || ref->st_rdev!=sb.st_rdev) + return (errno=ENXIO,0); + fd=open(file,O_RDWR); + } + + if (fd < 0) return 0; + if (fstat(fd,&sb) < 0) return 0; + if (!S_ISCHR(sb.st_mode)) return (errno=EINVAL,0); + + if (ref && (!S_ISCHR(ref->st_mode) || ref->st_rdev!=sb.st_rdev)) + return (errno=ENXIO,0); + + memset (&ccb,0,sizeof(ccb)); + ccb.ccb_h.func_code = XPT_GDEVLIST; + if (ioctl(fd,CAMGETPASSTHRU,&ccb)<0) return (close(fd),fd=-1,0); + + sprintf (pass,"/dev/%.15s%u",ccb.cgdl.periph_name,ccb.cgdl.unit_number); + cam=cam_open_pass (pass,O_RDWR,NULL); + if (cam==NULL) return (close(fd),fd=-1,0); + + filename=strdup(file); + + return 1; + } + unsigned char &operator[] (size_t i) + { if (i==0) + { memset(&ccb,0,sizeof(ccb)); + ccb.ccb_h.path_id = cam->path_id; + ccb.ccb_h.target_id = cam->target_id; + ccb.ccb_h.target_lun = cam->target_lun; + cam_fill_csio (&(ccb.csio), + 1, // retries + NULL, // cbfncp + CAM_DEV_QFRZDIS, // flags + MSG_SIMPLE_Q_TAG, // tag_action + NULL, // data_ptr + 0, // dxfer_len + sizeof(ccb.csio.sense_data), // sense_len + 0, // cdb_len + 30*1000); // timeout + } + ccb.csio.cdb_len = i+1; + return ccb.csio.cdb_io.cdb_bytes[i]; + } + unsigned char &operator()(size_t i) + { return ((unsigned char *)&ccb.csio.sense_data)[i]; } + unsigned char *sense() + { return (unsigned char*)&ccb.csio.sense_data; } + void timeout(int i) { ccb.ccb_h.timeout=i*1000; } + size_t residue() { return ccb.csio.resid; } + int transport(Direction dir=NONE,void *buf=NULL,size_t sz=0) + { int ret=0; + + ccb.csio.ccb_h.flags |= dir; + ccb.csio.data_ptr = (u_int8_t *)buf; + ccb.csio.dxfer_len = sz; + + if ((ret = cam_send_ccb(cam, &ccb)) < 0) + return -1; + + if ((ccb.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) + return 0; + + unsigned char *sense=(unsigned char *)&ccb.csio.sense_data; + + errno = EIO; + // FreeBSD 5-CURRENT since 2003-08-24, including 5.2 fails to + // pull sense data automatically, at least for ATAPI transport, + // so I reach for it myself... + if ((ccb.csio.scsi_status==SCSI_STATUS_CHECK_COND) && + !(ccb.ccb_h.status&CAM_AUTOSNS_VALID)) + { u_int8_t _sense[18]; + u_int32_t resid=ccb.csio.resid; + + memset(_sense,0,sizeof(_sense)); + + operator[](0) = 0x03; // REQUEST SENSE + ccb.csio.cdb_io.cdb_bytes[4] = sizeof(_sense); + ccb.csio.cdb_len = 6; + ccb.csio.ccb_h.flags |= CAM_DIR_IN|CAM_DIS_AUTOSENSE; + ccb.csio.data_ptr = _sense; + ccb.csio.dxfer_len = sizeof(_sense); + ccb.csio.sense_len = 0; + ret = cam_send_ccb(cam, &ccb); + + ccb.csio.resid = resid; + if (ret<0) return -1; + if ((ccb.ccb_h.status&CAM_STATUS_MASK) != CAM_REQ_CMP) + return errno=EIO,-1; + + memcpy(sense,_sense,sizeof(_sense)); + } + + ret = ERRCODE(sense); + if (ret == 0) ret = -1; + else CREAM_ON_ERRNO(sense); + + return ret; + } + int umount(int f=-1) + { struct stat fsb,msb; + struct statfs *mntbuf; + int ret=0,mntsize,i; + + if (f==-1) f=fd; + + if (fstat (f,&fsb) < 0) return -1; + if ((mntsize=getmntinfo(&mntbuf,MNT_NOWAIT))==0)return -1; + + for (i=0;i +extern "C" int _dev_unmount(char *); // VolMgt ON Consolidation Private API +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef enum { NONE=0, + READ=USCSI_READ, + WRITE=USCSI_WRITE + } Direction; + +class Scsi_Command { +private: + int fd,autoclose; + char *filename; + struct uscsi_cmd ucmd; + unsigned char cdb[16], _sense[18]; +public: + Scsi_Command() { fd=-1, autoclose=1; filename=NULL; } + Scsi_Command(int f) { fd=f, autoclose=0; filename=NULL; } + Scsi_Command(void*f){ fd=(long)f, autoclose=0; filename=NULL; } + ~Scsi_Command() { if (fd>=0 && autoclose) close(fd),fd=-1; + if (filename) free(filename),filename=NULL; + } + int associate (const char *file,const struct stat *ref=NULL) + { class autofree { + private: + char *ptr; + public: + autofree() { ptr=NULL; } + ~autofree() { if (ptr) free(ptr); } + char *operator=(char *str) { return ptr=str; } + operator char *() { return ptr; } + } volname,device; + struct stat sb; + int v; + + if ((v=volmgt_running())) + { if ((volname=volmgt_symname ((char *)file))) + { if ((device=media_findname (volname)) == NULL) + return 0; + } + else if ((device=media_findname ((char *)file))==NULL) + return 0; + } + else device=strdup(file); + + fd=open (device,O_RDONLY|O_NONBLOCK); + if (fd<0) return 0; + if (fstat(fd,&sb) < 0) return 0; + if (!S_ISCHR(sb.st_mode)) { errno=ENOTTY; return 0; } + + if (ref && (!S_ISCHR(ref->st_mode) || ref->st_rdev!=sb.st_rdev)) + { errno=ENXIO; return 0; } + + filename=strdup(device); + + return 1; + } + unsigned char &operator[] (size_t i) + { if (i==0) + { memset (&ucmd,0,sizeof(ucmd)); + memset (cdb,0,sizeof(cdb)); + memset (_sense,0,sizeof(_sense)); + ucmd.uscsi_cdb = (caddr_t)cdb; + ucmd.uscsi_rqbuf = (caddr_t)_sense; + ucmd.uscsi_rqlen = sizeof(_sense); + ucmd.uscsi_flags = USCSI_SILENT | USCSI_DIAGNOSE | + USCSI_ISOLATE | USCSI_RQENABLE; + ucmd.uscsi_timeout= 60; + } + ucmd.uscsi_cdblen = i+1; + return cdb[i]; + } + unsigned char &operator()(size_t i) { return _sense[i]; } + unsigned char *sense() { return _sense; } + void timeout(int i) { ucmd.uscsi_timeout=i; } + size_t residue() { return ucmd.uscsi_resid; } + int transport(Direction dir=NONE,void *buf=NULL,size_t sz=0) + { int ret=0; + + ucmd.uscsi_bufaddr = (caddr_t)buf; + ucmd.uscsi_buflen = sz; + ucmd.uscsi_flags |= dir; + if (ioctl(fd,USCSICMD,&ucmd)) + { if (errno==EIO && _sense[0]==0) // USB seems to be broken... + { size_t residue=ucmd.uscsi_resid; + memset(cdb,0,sizeof(cdb)); + cdb[0]=0x03; // REQUEST SENSE + cdb[4]=sizeof(_sense); + ucmd.uscsi_cdblen = 6; + ucmd.uscsi_bufaddr = (caddr_t)_sense; + ucmd.uscsi_buflen = sizeof(_sense); + ucmd.uscsi_flags = USCSI_SILENT | USCSI_DIAGNOSE | + USCSI_ISOLATE | USCSI_READ; + ucmd.uscsi_timeout = 1; + ret = ioctl(fd,USCSICMD,&ucmd); + ucmd.uscsi_resid = residue; + if (ret) return -1; + } + ret = ERRCODE(_sense); + if (ret==0) ret=-1; + //else CREAM_ON_ERRNO(_sense); + } + return ret; + } + // mimics umount(2), therefore inconsistent return values + int umount(int f=-1) + { struct stat fsb,msb; + struct mnttab mb; + FILE *fp; + pid_t pid,rpid; + int ret=0,i,rval; + + if (f==-1) f=fd; + + if (fstat (f,&fsb) < 0) return -1; + if ((fp=fopen (MNTTAB,"r")) == NULL) return -1; + + while ((i=getmntent (fp,&mb)) != -1) + { if (i != 0) continue; // ignore corrupted lines + if (stat (mb.mnt_special,&msb) < 0) continue; // also corrupted? + if (msb.st_rdev == fsb.st_rdev) + { if (_dev_unmount (mb.mnt_special)) break; + { struct utsname uts; + if (uname (&uts)>=0 && strcmp(uts.release,"5.8")>=0) + { // M-m-m-m-m! Solaris 8 or later... + ret = ::umount (mb.mnt_special); + break; + } + } + ret = -1; + if ((pid = fork()) == (pid_t)-1) break; + if (pid == 0) execl ("/usr/sbin/umount","umount",mb.mnt_mountp,(void*)NULL); + while (1) + { rpid = waitpid (pid,&rval,0); + if (rpid == (pid_t)-1) + { if (errno==EINTR) continue; + else break; + } + else if (rpid != pid) + { errno = ECHILD; + break; + } + if (WIFEXITED(rval)) + { if (WEXITSTATUS(rval) == 0) ret=0; + else errno=EBUSY; // most likely + break; + } + else if (WIFSTOPPED(rval) || WIFCONTINUED(rval)) + continue; + else + { errno = ENOLINK; // some phony errno + break; + } + } + break; + } + } + fclose (fp); + + return ret; + } + int is_reload_needed () + { struct dk_minfo mi; + struct dk_allmap pt; + + if (ioctl (fd,DKIOCGMEDIAINFO,&mi) < 0) return 1; + + memset (&pt,0,sizeof(pt)); + pt.dka_map[2].dkl_nblk = mi.dki_capacity*(mi.dki_lbsize/DEV_BSIZE); + pt.dka_map[0] = pt.dka_map[2]; + if (ioctl (fd,DKIOCSAPART,&pt) < 0) return 1; + + return 0; + } +}; + +#elif defined(__hpux) +// +// Copyright (C) 2003 Hewlett-Packard Development Company, L.P. +// +// 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 +// +// ===================================================================== +// +// The code targets 11i/11.11 and later, but it might just work on +// 11.0 as well. For further information contact following HP office +// +// Hewlett-Packard Company +// 3404 E Harmony Road +// Fort Collins, CO 80528 USA +// +#include +#include +#include +#include + +typedef enum { NONE=0, + READ=SCTL_READ, + WRITE=0 + } Direction; + +class Scsi_Command { +private: + int fd; + int autoclose; + char *filename; + struct sctl_io cmd; +public: + Scsi_Command() { fd=-1, autoclose=1; filename=NULL; } + Scsi_Command(int f) { fd=f, autoclose=0; filename=NULL; } + Scsi_Command(void*f){ fd=(long)f, autoclose=0; filename=NULL; } + ~Scsi_Command() { if (fd>=0 && autoclose) close(fd),fd=-1; + if (filename) free(filename),filename=NULL; + } + int associate (const char *file,const struct stat *ref=NULL) + { struct stat sb; + + fd=open (file,O_RDONLY|O_NONBLOCK); + + if (fd < 0) return 0; + if (fstat(fd,&sb) < 0) return 0; + if (!S_ISCHR(sb.st_mode)) { errno=EINVAL; return 0; } + + // shall we check for DIOC_DESCRIBE here? + + if (ref && (!S_ISCHR(ref->st_mode) || ref->st_rdev!=sb.st_rdev)) + { errno=ENXIO; return 0; } + + filename=strdup(file); + + return 1; + } + unsigned char &operator[] (size_t i) + { if (i==0) + { bzero (&cmd,sizeof(struct sctl_io)); + cmd.max_msecs=30*1000; + } + cmd.cdb_length = i+1; + return cmd.cdb[i]; + } + unsigned char &sense(size_t i) { return cmd.sense[i]; } + unsigned char *sense() { return cmd.sense; } + void timeout(int i) { cmd.max_msecs=i*1000; } + size_t residue() { return cmd.data_length-cmd.data_xfer; } + int transport(Direction dir=NONE,void *buf=NULL,size_t sz=0) + { const char *err = NULL; + + cmd.data = buf; + cmd.data_length = sz; + cmd.flags = dir; + + if (ioctl (fd,SIOC_IO,&cmd) != 0) return -1; + + if (cmd.cdb_status == S_GOOD) return 0; + + errno = EIO; + switch (cmd.cdb_status) + { case SCTL_INVALID_REQUEST: err = "SCTL_INVALID_REQUEST"; break; + case SCTL_SELECT_TIMEOUT: err = "SCTL_SELECT_TIMEOUT"; break; + case SCTL_INCOMPLETE: err = "SCTL_INCOMPLETE"; break; + case SCTL_POWERFAIL: err = "SCTL_POWERFAIL"; break; + default: err = NULL; break; + } + if (err != NULL) + { fprintf (stderr,":-( FAIL: command failed with %s.\n",err); + return -1; + } + + switch (cmd.cdb_status & 0xff) + { case S_CHECK_CONDITION: + if (cmd.sense_status==S_GOOD && cmd.sense_xfer!=0) + { CREAM_ON_ERRNO_NAKED(cmd.sense) // CREAM_ON_ERRNO + // provokes PA-RISC + // compiler bug... + return ERRCODE(cmd.sense); + } + else + fprintf (stderr,":-( FAIL: S_CHECK_CONDITION status, " + "but no sense data?\n"); + break; + case S_BUSY: + fprintf (stderr,":-( FAIL: S_BUSY condition?\n"); + errno = EAGAIN; + break; + default: + fprintf (stderr,":-( FAIL: unknown cdb_status=0x%x\n", + cmd.cdb_status); + break; + } + + return -1; + } + // for now we only detect if media is mounted... + int umount(int f=-1) + { struct stat fsb,msb; + struct mntent *mb; + FILE *fp; + int ret=0; + char bdev[32]; + dev_t m; + + if (f==-1) f=fd; + + if (fstat (f,&fsb) < 0) return -1; + if ((fp=setmntent (MNT_MNTTAB,"r")) == NULL) return -1; + + m=minor(fsb.st_rdev); + sprintf(bdev,"/dev/dsk/c%ut%ud%x",(m>>16)&0xFF,(m>>12)&0xF,(m>>8)&0xF); + if (stat (bdev,&fsb) < 0) return -1; + + while ((mb=getmntent (fp))!=NULL) + { if (stat (mb->mnt_fsname,&msb) < 0) continue; // corrupted line? + if (msb.st_rdev == fsb.st_rdev) + { errno=EBUSY; ret=-1; break; } + } + endmntent (fp); + + return ret; + } + int is_reload_needed () + { return 1; } +}; + +#elif defined(__sgi) +// +// Not necessarily relevant IRIX notes. +// +// Information about UDF support seems to be contradictory. Some manuals +// maintain that UDF writing is supported for DVD-RAM and hard disk, but +// the only mention of UDF in IRIX release notes is "6.5.18 introduces +// read-only support for the UDF filesystems format." If UDF writing is +// supported, then it was implemented presumably in 6.5.21. DVD-RAM +// writing at block device level was most likely introduced by then too. +// +// IRIX doesn't provide access to files larger than 2GB on ISO9660. +// That's because ISO9660 is implemented as NFSv2 user-land server, +// and 2GB limit is implied by NFSv2 protocol. +// + +#ifdef PRIVATE +#undef PRIVATE // conflicts with ? +#endif +#include +#ifdef PRIVATE +#undef PRIVATE // conflicts with ? +#endif +#include +#include +#include +#include +#include +#include + +typedef enum { NONE=0, + READ=DSRQ_READ, + WRITE=DSRQ_WRITE + } Direction; + +class Scsi_Command { +private: + int fd,autoclose; + char *filename; + dsreq_t req; + unsigned char cdb[16], _sense[18]; +public: + Scsi_Command() { fd=-1, autoclose=1; filename=NULL; } + Scsi_Command(int f) { fd=f, autoclose=0; filename=NULL; } + Scsi_Command(void*f){ fd=(long)f, autoclose=0; filename=NULL; } + ~Scsi_Command() { if (fd>=0 && autoclose) close(fd),fd=-1; + if (filename) free(filename),filename=NULL; + } + int associate (const char *file,const struct stat *ref=NULL) + { struct stat sb; + char hw_path[MAXPATHLEN]; + int hw_len=sizeof(hw_path)-1; + + if (attr_get(file,"_devname",hw_path,&hw_len,0)) return 0; + if (hw_len>=sizeof(hw_path)) hw_len=sizeof(hw_path)-1; // paranoia + hw_path[hw_len]='\0'; + + if (ref) + { // hw_path is maintained by kernel through hwgfs and + // I assume it's not subject to race conditions... + if (stat(hw_path,&sb)) return 0; + if (!S_ISCHR(ref->st_mode) || ref->st_rdev!=sb.st_rdev) + { errno=ENXIO; return 0; } + } + + if (strcmp(hw_path+strlen(hw_path)-5,"/scsi")) + { char *s=strstr(hw_path,"/disk/"); + if (s==NULL) { errno=EINVAL; return 0; } + strcpy (s,"/scsi"); + } + fd=open (hw_path,O_RDONLY|O_NONBLOCK); + if (fd<0) return 0; + if (fstat(fd,&sb) < 0) return 0; + if (!S_ISCHR(sb.st_mode)) { errno=ENOTTY; return 0; } + + filename=strdup(file); + + return 1; + } + unsigned char &operator[] (size_t i) + { if (i==0) + { memset (&req,0,sizeof(req)); + memset (cdb,0,sizeof(cdb)); + memset (_sense,0,sizeof(_sense)); + req.ds_cmdbuf = (caddr_t)cdb; + req.ds_sensebuf = (caddr_t)_sense; + req.ds_senselen = sizeof(_sense); + req.ds_flags = DSRQ_SENSE; + req.ds_time = 60*1000; + } + req.ds_cmdlen = i+1; + return cdb[i]; + } + unsigned char &operator()(size_t i) { return _sense[i]; } + unsigned char *sense() { return _sense; } + void timeout(int i) { req.ds_time=i*1000; } + size_t residue() { return req.ds_datalen-req.ds_datasent; } + int transport(Direction dir=NONE,void *buf=NULL,size_t sz=0) + { int ret=0,retries=3; + + req.ds_databuf = (caddr_t)buf; + req.ds_datalen = sz; + req.ds_flags |= dir; + + // I personally don't understand why do we need to loop, but + // /usr/share/src/irix/examples/scsi/lib/src/dslib.c is looping... + while (retries--) + { if (ioctl(fd,DS_ENTER,&req) < 0) return -1; + if (req.ds_status==STA_GOOD) return 0; + + if (req.ds_ret==DSRT_NOSEL) continue; + if (req.ds_status==STA_BUSY || req.ds_status==STA_RESERV) + { poll(NULL,0,500); continue; } + + break; + } + + errno=EIO; ret=-1; + if (req.ds_status==STA_CHECK && req.ds_sensesent>=14) + { ret = ERRCODE(_sense); + if (ret==0) ret=-1; + else CREAM_ON_ERRNO(_sense); + } + return ret; + } + // mimics umount(2), therefore inconsistent return values + int umount(int f=-1) + { struct stat fsb,msb; + struct mntent *mb; + FILE *fp; + pid_t pid,rpid; + int ret=0,rval; + char hw_path[MAXPATHLEN]; + int hw_len=sizeof(hw_path)-1; + + if (f==-1) f=fd; + + if (fstat (f,&fsb) < 0) return -1; + + if (!getenv("MEDIAD_GOT_EXCLUSIVEUSE")) + { if (attr_getf (f,"_devname",hw_path,&hw_len,0)) return -1; + if (hw_len>=sizeof(hw_path)) hw_len=sizeof(hw_path)-1;// paranoia + hw_path[hw_len]='\0'; + + // mediad even unmounts removable volumes. However! The + // locks are "granted" even for unmanaged devices, so + // it's not possible to tell if device is ignored through + // /etc/config/mediad.config or actually managed. Therefore + // I have to pass through own unmount code in either case... + + mediad_get_exclusiveuse(hw_path,"dvd+rw-tools"); + switch (mediad_last_error()) + { case RMED_NOERROR: break; + case RMED_EACCESS: + case RMED_ECANTUMOUNT: errno=EBUSY; return -1; + case RMED_ENOMEDIAD: break; + case -1: if(errno==ECONNREFUSED) break; // no mediad... + else return -1; + default: errno=ENOTTY; return -1; + } + } + + if ((fp=setmntent (MOUNTED,"r"))==NULL) return -1; + + while ((mb=getmntent (fp))!=NULL) + { if (stat (mb->mnt_fsname,&msb) < 0) continue; // corrupted line? + // Following effectively catches only /dev/rdsk/dksXdYvol, + // which is sufficient for iso9660 volumes, but not for e.g. + // EFS formatted media. I mean code might have to be more + // versatile... Wait for feedback... + if (msb.st_rdev == fsb.st_rdev) + { ret = -1; + if ((pid = fork()) == (pid_t)-1) break; + if (pid == 0) execl ("/sbin/umount","umount",mb->mnt_dir,(void*)NULL); + while (1) + { rpid = waitpid (pid,&rval,0); + if (rpid == (pid_t)-1) + { if (errno==EINTR) continue; + else break; + } + else if (rpid != pid) + { errno = ECHILD; + break; + } + if (WIFEXITED(rval)) + { if (WEXITSTATUS(rval) == 0) ret=0; + else errno=EBUSY; // most likely + break; + } + else if (WIFSTOPPED(rval) || WIFCONTINUED(rval)) + continue; + else + { errno = ENOLINK; // some phony errno + break; + } + } + break; + } + } + endmntent (fp); + + return ret; + } +#if 0 // for now just an idea to test... +#define RELOAD_NEVER_NEEDED + int is_reload_needed () + { return 0; } +#else + int is_reload_needed () + { return 1; } +#endif +}; + +#elif defined(_WIN32) + +#if defined(__MINGW32__) +#include +#define FSCTL_LOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM,6,METHOD_BUFFERED,FILE_ANY_ACCESS) +#define FSCTL_UNLOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM,7,METHOD_BUFFERED,FILE_ANY_ACCESS) +#define FSCTL_DISMOUNT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM,8,METHOD_BUFFERED,FILE_ANY_ACCESS) +#else +#include +#include +#endif + +typedef enum { NONE=SCSI_IOCTL_DATA_UNSPECIFIED, + READ=SCSI_IOCTL_DATA_IN, + WRITE=SCSI_IOCTL_DATA_OUT + } Direction; + +typedef struct { + SCSI_PASS_THROUGH_DIRECT spt; + unsigned char sense[18]; +} SPKG; + +class Scsi_Command { +private: + HANDLE fd; + int autoclose; + char *filename; + SPKG p; +public: + Scsi_Command() { fd=INVALID_HANDLE_VALUE; autoclose=1; filename=NULL; } + Scsi_Command(void*f){ fd=f, autoclose=0; filename=NULL; } + ~Scsi_Command() { DWORD junk; + if (fd!=INVALID_HANDLE_VALUE && autoclose) + { if (autoclose>1) + DeviceIoControl(fd,FSCTL_UNLOCK_VOLUME, + NULL,0,NULL,0,&junk,NULL); + CloseHandle (fd),fd=INVALID_HANDLE_VALUE; + } + if (filename) free(filename),filename=NULL; + } + int associate (const char *file,const struct stat *ref=NULL) + { char dev[32]; + sprintf(dev,"%.*s\\",sizeof(dev)-2,file); + if (GetDriveType(dev)!=DRIVE_CDROM) + return errno=EINVAL,0; + sprintf(dev,"\\\\.\\%.*s",sizeof(dev)-5,file); + fd=CreateFile (dev,GENERIC_WRITE|GENERIC_READ, + FILE_SHARE_READ|FILE_SHARE_WRITE, + NULL,OPEN_EXISTING,0,NULL); + if (fd!=INVALID_HANDLE_VALUE) + filename=strdup(dev); + return fd!=INVALID_HANDLE_VALUE; + } + unsigned char &operator[] (size_t i) + { if (i==0) + { memset(&p,0,sizeof(p)); + p.spt.Length = sizeof(p.spt); + p.spt.DataIn = SCSI_IOCTL_DATA_UNSPECIFIED; + p.spt.TimeOutValue = 30; + p.spt.SenseInfoLength = sizeof(p.sense); + p.spt.SenseInfoOffset = offsetof(SPKG,sense); + } + p.spt.CdbLength = i+1; + return p.spt.Cdb[i]; + } + unsigned char &operator()(size_t i) { return p.sense[i]; } + unsigned char *sense() { return p.sense; } + void timeout(int i) { p.spt.TimeOutValue=i; } + size_t residue() { return 0; } // bogus + int transport(Direction dir=NONE,void *buf=NULL,size_t sz=0) + { DWORD bytes; + int ret=0; + + p.spt.DataBuffer = buf; + p.spt.DataTransferLength = sz; + p.spt.DataIn = dir; + + if (DeviceIoControl (fd,IOCTL_SCSI_PASS_THROUGH_DIRECT, + &p,sizeof(p.spt), + &p,sizeof(p), + &bytes,FALSE) == 0) return -1; + + if (p.sense[0]&0x70) + { SetLastError (ERROR_GEN_FAILURE); + ret = ERRCODE(p.sense); + if (ret==0) ret=-1; + else CREAM_ON_ERRNO(p.sense); + } +#if 0 + else if (p.spt.Cdb[0] == 0x00) // TEST UNIT READY + { unsigned char _sense[18]; + + operator[](0) = 0x03; // REQUEST SENSE + p.spt.Cdb[4] = sizeof(_sense); + p.spt.CdbLength = 6; + + p.spt.DataBuffer = _sense; + p.spt.DataTransferLength = sizeof(_sense); + p.spt.DataIn = READ; + + if (DeviceIoControl (fd,IOCTL_SCSI_PASS_THROUGH_DIRECT, + &p,sizeof(p.spt), + &p,sizeof(p), + &bytes,FALSE) == 0) return -1; + + if ((ret = ERRCODE(_sense))) CREAM_ON_ERRNO(_sense); + } +#endif + return ret; + } + int umount (int f=-1) + { DWORD junk; + HANDLE h = (f==-1) ? fd : (HANDLE)f; + + if (DeviceIoControl(h,FSCTL_LOCK_VOLUME,NULL,0,NULL,0,&junk,NULL) && + DeviceIoControl(h,FSCTL_DISMOUNT_VOLUME,NULL,0,NULL,0,&junk,NULL)) + { if (h==fd) autoclose++; + return 0; + } + return -1; + } +#define RELOAD_NEVER_NEEDED + int is_reload_needed () { return 0; } +}; + +#else +#error "Unsupported OS" +#endif + +#define DUMP_EVENTS 0 +static int handle_events (Scsi_Command &cmd) +{ unsigned char event[8]; + unsigned short profile=0,started=0; + int err,ret=0; + unsigned int descr; + static unsigned char events=0xFF; // "All events" + + while (events) + { cmd[0] = 0x4A; // GET EVENT + cmd[1] = 1; // "Polled" + cmd[4] = events; + cmd[8] = sizeof(event); + cmd[9] = 0; + if ((err=cmd.transport(READ,event,sizeof(event)))) + { events=0; + sperror ("GET EVENT",err); + return ret; + } + + events = event[3]; + + if ((event[2]&7) == 0 || + (event[0]<<8|event[1]) == 2 || + (event[4]&0xF) == 0 ) // No Changes + return ret; + + descr = event[4]<<24|event[5]<<16|event[6]<<8|event[7]; +#if DUMP_EVENTS + fprintf(stderr,"< %d[%08x],%x >\n",event[2],descr,events); +#endif + + switch(event[2]&7) + { case 0: return ret; // No [supported] events + case 1: ret |= 1<<1; // Operational Change + if ((descr&0xFFFF) < 3) + goto read_profile; + start_unit: + if (!started) + { cmd[0]=0x1B; // START STOP UNIT + cmd[4]=1; // "Start" + cmd[5]=0; + if ((err=cmd.transport()) && err!=0x62800) + sperror ("START UNIT",err); + started=1, profile=0; + } + read_profile: + if (!profile) + { cmd[0] = 0x46; // GET CONFIGURATION + cmd[8] = sizeof(event); + cmd[9] = 0; + if (!cmd.transport(READ,event,sizeof(event))) + profile=event[6]<<8|event[7]; + } + break; + case 2: ret |= 1<<2; // Power Management + if (event[5]>1) // State is other than Active + goto start_unit; + break; + case 3: ret |= 1<<3; break; // External Request + case 4: ret |= 1<<4; // Media + if (event[5]&2) // Media in + goto start_unit; + break; + case 5: ret |= 1<<5; break; // Multiple Initiators + case 6: // Device Busy + if ((event[4]&0xF)==1 && // Timeout occured + (event[5]&0x3)!=0) + { poll(NULL,0,(descr&0xFFFF)*100+100); + cmd[0] = 0; // TEST UNIT READY + cmd[5] = 0; + if ((err=cmd.transport())) + sperror("TEST UNIT READY",err); + ret |= 1<<6; + } + break; + case 7: ret |= 1<<7; break; // Reserved + } + } + + return ret; +} +#undef DUMP_EVENTS + +static int wait_for_unit (Scsi_Command &cmd,volatile int *progress=NULL) +{ unsigned char *sense=cmd.sense(),sensebuf[18]; + int err; + long msecs=1000; + + while (1) + { if (msecs > 0) poll(NULL,0,msecs); + msecs = getmsecs(); + cmd[0] = 0; // TEST UNIT READY + cmd[5] = 0; + if (!(err=cmd.transport ())) break; + // I wish I could test just for sense.valid, but (at least) + // hp dvd100i returns 0 in valid bit at this point:-( So I + // check for all bits... + if ((sense[0]&0x70)==0) + { perror (":-( unable to TEST UNIT READY"); + return -1; + } + else if (sense[12]==0x3A) // doesn't get any further than "no media" + return err; + + while (progress) + { if (sense[15]&0x80) + { *progress = sense[16]<<8|sense[17]; + break; + } + // MMC-3 (draft) specification says that the unit should + // return progress indicator in key specific bytes even + // in reply to TEST UNIT READY. I.e. as above! But (at + // least) hp dvd100i doesn't do that and I have to fetch + // it separately:-( + cmd[0] = 0x03; // REQUEST SENSE + cmd[4] = sizeof(sensebuf); + cmd[5] = 0; + if ((err=cmd.transport (READ,sensebuf,sizeof(sensebuf)))) + { sperror ("REQUEST SENSE",err); + return err; + } + if (sensebuf[15]&0x80) + *progress = sensebuf[16]<<8|sensebuf[17]; + break; + } + msecs = 1000 - (getmsecs() - msecs); + } + + return 0; +} + +static int pioneer_stop(Scsi_Command &cmd,volatile int *progress=NULL) +{ int err; + unsigned char *sense=cmd.sense(); + + // Pioneer units tend to just fall through wait_for_unit() and + // report "OP IN PROGRESS" on next non-TEST UNIT READY command. + // This behaviour is explicitly discouraged in MMC, but what one + // can do? Well, whenever appropriate one can deploy STOP UNIT + // as "barrier" command with all units... + while (1) + { cmd[0] = 0x1B; // START/STOP UNIT + cmd[1] = 0x1; // "IMMED" + cmd[4] = 0; // "Stop" + cmd[5] = 0; + if ((err=cmd.transport()) == 0x20407) // "OP IN PROGRESS" + { if (progress && sense[15]&0x80) + *progress = sense[16]<<8|sense[17]; + poll (NULL,0,333); + continue; + } + break; + } + + return err; +} + + +#define FEATURE21_BROKEN 1 +static void page05_setup (Scsi_Command &cmd, unsigned short profile=0, + unsigned char p32=0xC0) + // 5 least significant bits of p32 go to p[2], Test Write&Write Type + // 2 most significant bits go to p[3], Multi-session field + // 0xC0 means "Multi-session, no Test Write, Incremental" +{ unsigned int len,bdlen; + unsigned char header[12],track[32],*p; +#if !FEATURE21_BROKEN + unsigned char feature21[24]; +#endif + int err; + class autofree page05; + + if (profile==0) + { unsigned char prof[8]; + + cmd[0] = 0x46; // GET CONFIGURATION + cmd[8] = sizeof(prof); + cmd[9] = 0; + if ((err=cmd.transport(READ,prof,sizeof(prof)))) + sperror ("GET CONFIGURATION",err), exit(FATAL_START(errno)); + + profile = prof[6]<<8|prof[7]; + } + +#if !FEATURE21_BROKEN + if (profile==0x11 || profile==0x14) + { cmd[0] = 0x46; // GET CONFIGURATION + cmd[1] = 2; // ask for the only feature... + cmd[3] = 0x21; // the "Incremental Streaming Writable" one + cmd[8] = 8; // read the header only to start with + cmd[9] = 0; + if ((err=cmd.transport(READ,feature21,8))) + sperror ("GET CONFIGURATION",err), exit(FATAL_START(errno)); + + len = feature21[0]<<24|feature21[1]<<16|feature21[2]<<8|feature21[3]; + len += 4; + if (len>sizeof(feature21)) + len = sizeof(feature21); + else if (len<(8+8)) + fprintf (stderr,":-( READ FEATURE DESCRIPTOR 0021h: insane length\n"), + exit(FATAL_START(EINVAL)); + + cmd[0] = 0x46; // GET CONFIGURATION + cmd[1] = 2; // ask for the only feature... + cmd[3] = 0x21; // the "Incremental Streaming Writable" one + cmd[8] = len; // this time with real length + cmd[9] = 0; + if ((err=cmd.transport(READ,feature21,len))) + sperror ("READ FEATURE DESCRIPTOR 0021h",err), + exit(FATAL_START(errno)); + + if ((feature21[8+2]&1)==0) + fprintf (stderr,":-( FEATURE 0021h is not in effect\n"), + exit(FATAL_START(EMEDIUMTYPE)); + } + else + feature21[8+2]=0; +#endif + + cmd[0] = 0x52; // READ TRACK INFORMATION + cmd[1] = 1; // TRACK INFORMATION + cmd[5] = 1; // track#1, in DVD context it's safe to assume + // that all tracks are in the same mode + cmd[8] = sizeof(track); + cmd[9] = 0; + if ((err=cmd.transport(READ,track,sizeof(track)))) + sperror ("READ TRACK INFORMATION",err), exit(FATAL_START(errno)); + + // WRITE PAGE SETUP // + cmd[0] = 0x5A; // MODE SENSE + cmd[1] = 0x08; // "Disable Block Descriptors" + cmd[2] = 0x05; // "Write Page" + cmd[8] = sizeof(header); // header only to start with + cmd[9] = 0; + if ((err=cmd.transport(READ,header,sizeof(header)))) + sperror ("MODE SENSE",err), exit(FATAL_START(errno)); + + len = (header[0]<<8|header[1])+2; + bdlen = header[6]<<8|header[7]; + + if (bdlen) // should never happen as we set "DBD" above + { if (len <= (8+bdlen+14)) + fprintf (stderr,":-( LUN is impossible to bear with...\n"), + exit(FATAL_START(EINVAL)); + } + else if (len < (8+2+(unsigned int)header[9]))// SANYO does this. + len = 8+2+header[9]; + + page05 = (unsigned char *)malloc(len); + if (page05 == NULL) + fprintf (stderr,":-( memory exhausted\n"), + exit(FATAL_START(ENOMEM)); + + cmd[0] = 0x5A; // MODE SENSE + cmd[1] = 0x08; // "Disable Block Descriptors" + cmd[2] = 0x05; // "Write Page" + cmd[7] = len>>8; + cmd[8] = len; // real length this time + cmd[9] = 0; + if ((err=cmd.transport(READ,page05,len))) + sperror("MODE SENSE",err), exit(FATAL_START(errno)); + + len -= 2; + if (len < ((unsigned int)page05[0]<<8|page05[1])) // paranoia:-) + page05[0] = len>>8, page05[1] = len; + + len = (page05[0]<<8|page05[1])+2; + bdlen = page05[6]<<8|page05[7]; + len -= bdlen; + if (len < (8+14)) + fprintf (stderr,":-( LUN is impossible to bear with...\n"), + exit(FATAL_START(EINVAL)); + + p = page05 + 8 + bdlen; + + memset (p-8,0,8); + p[0] &= 0x7F; + + // copy "Test Write" and "Write Type" from p32 + p[2] &= ~0x1F, p[2] |= p32&0x1F; + p[2] |= 0x40; // insist on BUFE on + + // setup Preferred Link Size +#if !FEATURE21_BROKEN + if (feature21[8+2]&1) + { if (feature21[8+7]) p[2] |= 0x20, p[5] = feature21[8+8]; + else p[2] &= ~0x20, p[5] = 0; + } +#else // At least Pioneer DVR-104 returns some bogus data in + // Preferred Link Size... + if (profile==0x11 || profile==0x14) // Sequential recordings... + p[2] |= 0x20, p[5] = 0x10; +#endif + else + p[2] &= ~0x20, p[5] = 0; + + // copy Track Mode from TRACK INFORMATION + // [some DVD-R units (most notably Panasonic LF-D310), insist + // on Track Mode 5, even though it's effectively ignored] + p[3] &= ~0x0F, p[3] |= profile==0x11?5:(track[5]&0x0F); + + // copy "Multi-session" bits from p32 + p[3] &= ~0xC0, p[3] |= p32&0xC0; + if (profile == 0x13) // DVD-RW Restricted Overwrite + p[3] &= 0x3F; // always Single-session? + + // setup Data Block Type + // Some units [e.g. Toshiba/Samsung TS-H542A] return "unknown Data + // Block Type" in track[6]&0x0F field. Essentially it's a firmware + // glitch, yet it makes certain sense, as track may not be written + // yet... + if ((track[6]&0x0F)==1 || (track[6]&0x0F)==0x0F) + p[4] = 8; + else fprintf (stderr,":-( none Mode 1 track\n"), + exit(FATAL_START(EMEDIUMTYPE)); + + // setup Packet Size + // [some DVD-R units (most notably Panasonic LF-D310), insist + // on fixed Packet Size of 16 blocks, even though it's effectively + // ignored] + p[3] |= 0x20, memset (p+10,0,4), p[13] = 0x10; + if (track[6]&0x10) + memcpy (p+10,track+20,4); // Fixed + else if (profile != 0x11) + p[3] &= ~0x20, p[13] = 0; // Variable + + switch (profile) + { case 0x13: // DVD-RW Restricted Overwrite + if (!(track[6]&0x10)) + fprintf (stderr,":-( track is not formatted for fixed packet size\n"), + exit(FATAL_START(EMEDIUMTYPE)); + break; + case 0x14: // DVD-RW Sequential Recording + case 0x11: // DVD-R Sequential Recording + if (track[6]&0x10) + fprintf (stderr,":-( track is formatted for fixed packet size\n"), + exit(FATAL_START(EMEDIUMTYPE)); + break; + default: +#if 0 + fprintf (stderr,":-( invalid profile %04xh\n",profile); + exit(FATAL_START(EMEDIUMTYPE)); +#endif + break; + } + + p[8] = 0; // "Session Format" should be ignored, but + // I reset it just in case... + + cmd[0] = 0x55; // MODE SELECT + cmd[1] = 0x10; // conformant + cmd[7] = len>>8; + cmd[8] = len; + cmd[9] = 0; + if ((err=cmd.transport(WRITE,p-8,len))) + sperror ("MODE SELECT",err), exit(FATAL_START(errno)); + // END OF WRITE PAGE SETUP // +} +#undef FEATURE21_BROKEN + +#undef ERRCODE +#undef CREAM_ON_ERRNO +#undef CREAM_ON_ERRNO_NAKED diff --git a/extra-sources/dvd+rw-tools-6.1/win32err.h b/extra-sources/dvd+rw-tools-6.1/win32err.h new file mode 100644 index 0000000..b7e7055 --- /dev/null +++ b/extra-sources/dvd+rw-tools-6.1/win32err.h @@ -0,0 +1,57 @@ +# define EINVAL ERROR_BAD_ARGUMENTS +# define ENOMEM ERROR_OUTOFMEMORY +# define EMEDIUMTYPE ERROR_MEDIA_INCOMPATIBLE +# define ENOMEDIUM ERROR_MEDIA_OFFLINE +# define ENODEV ERROR_BAD_COMMAND +# define EAGAIN ERROR_NOT_READY +# define ENOSPC ERROR_DISK_FULL +# define EIO ERROR_NOT_SUPPORTED +# define ENXIO ERROR_GEN_FAILURE +# define EBUSY ERROR_SHARING_VIOLATION +# define ENOENT ERROR_FILE_NOT_FOUND +# define ENOTDIR ERROR_NO_VOLUME_LABEL +# define FATAL_START(e) (0x10000|(e)) +# define FATAL_MASK 0x0FFFF + +#ifdef errno +# undef errno +#endif + +#ifdef __cplusplus +static class __win32_errno__ { + public: + operator int() { return GetLastError(); } + int operator=(int e) { SetLastError(e); return e; } +} win32_errno; +# define errno win32_errno +#else +# define errno (GetLastError()) +#endif + +#define set_errno(e) (SetLastError(e),e) + +#ifdef perror +#undef perror +#endif +#define perror win32_perror +static void win32_perror (const char *str) +{ LPVOID lpMsgBuf; + + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + 0, // Default language + (LPTSTR) &lpMsgBuf, + 0, + NULL + ); + if (str) + fprintf (stderr,"%s: %s",str,(char *)lpMsgBuf); + else + fprintf (stderr,"%s",(char *)lpMsgBuf); + + LocalFree(lpMsgBuf); +} diff --git a/extra-sources/emacs-cvs20070210.tar.bz2 b/extra-sources/emacs-cvs20070210.tar.bz2 new file mode 100644 index 0000000..0db4476 Binary files /dev/null and b/extra-sources/emacs-cvs20070210.tar.bz2 differ diff --git a/extra-sources/enchant-1.3.0.tar.gz b/extra-sources/enchant-1.3.0.tar.gz new file mode 100644 index 0000000..260cd9a Binary files /dev/null and b/extra-sources/enchant-1.3.0.tar.gz differ diff --git a/extra-sources/fox-1.4.34.zip b/extra-sources/fox-1.4.34.zip new file mode 100644 index 0000000..bbb3822 Binary files /dev/null and b/extra-sources/fox-1.4.34.zip differ diff --git a/extra-sources/fribidi-0.10.7.tar.gz b/extra-sources/fribidi-0.10.7.tar.gz new file mode 100644 index 0000000..395d202 Binary files /dev/null and b/extra-sources/fribidi-0.10.7.tar.gz differ diff --git a/extra-sources/gkrellm-2.2.9.tar.bz2 b/extra-sources/gkrellm-2.2.9.tar.bz2 new file mode 100644 index 0000000..c698aad Binary files /dev/null and b/extra-sources/gkrellm-2.2.9.tar.bz2 differ diff --git a/extra-sources/gnome-icon-theme-2.14.2.tar.bz2 b/extra-sources/gnome-icon-theme-2.14.2.tar.bz2 new file mode 100644 index 0000000..53cdb8f Binary files /dev/null and b/extra-sources/gnome-icon-theme-2.14.2.tar.bz2 differ diff --git a/extra-sources/gqview-2.0.1.tar.gz b/extra-sources/gqview-2.0.1.tar.gz new file mode 100644 index 0000000..acd24d4 Binary files /dev/null and b/extra-sources/gqview-2.0.1.tar.gz differ diff --git a/extra-sources/hexedit-1.2.12.src.tgz b/extra-sources/hexedit-1.2.12.src.tgz new file mode 100644 index 0000000..7ef8077 Binary files /dev/null and b/extra-sources/hexedit-1.2.12.src.tgz differ diff --git a/extra-sources/hicolor-icon-theme-0.9.tar.gz b/extra-sources/hicolor-icon-theme-0.9.tar.gz new file mode 100644 index 0000000..cff0cce Binary files /dev/null and b/extra-sources/hicolor-icon-theme-0.9.tar.gz differ diff --git a/extra-sources/intltool-0.35.0.tar.bz2 b/extra-sources/intltool-0.35.0.tar.bz2 new file mode 100644 index 0000000..ef72da3 Binary files /dev/null and b/extra-sources/intltool-0.35.0.tar.bz2 differ diff --git a/extra-sources/jam-2.5.zip b/extra-sources/jam-2.5.zip new file mode 100644 index 0000000..5cc4bda Binary files /dev/null and b/extra-sources/jam-2.5.zip differ diff --git a/extra-sources/kismet-2006-04-R1.tar.gz b/extra-sources/kismet-2006-04-R1.tar.gz new file mode 100644 index 0000000..2dbecf2 Binary files /dev/null and b/extra-sources/kismet-2006-04-R1.tar.gz differ diff --git a/extra-sources/libgnomecanvas-2.14.0.tar.bz2 b/extra-sources/libgnomecanvas-2.14.0.tar.bz2 new file mode 100644 index 0000000..c6d753e Binary files /dev/null and b/extra-sources/libgnomecanvas-2.14.0.tar.bz2 differ diff --git a/extra-sources/libgnomeprint-2.12.1.tar.bz2 b/extra-sources/libgnomeprint-2.12.1.tar.bz2 new file mode 100644 index 0000000..33ab802 Binary files /dev/null and b/extra-sources/libgnomeprint-2.12.1.tar.bz2 differ diff --git a/extra-sources/libgnomeprintui-2.12.1.tar.bz2 b/extra-sources/libgnomeprintui-2.12.1.tar.bz2 new file mode 100644 index 0000000..e799a34 Binary files /dev/null and b/extra-sources/libgnomeprintui-2.12.1.tar.bz2 differ diff --git a/extra-sources/lua-5.1.1.tar.gz b/extra-sources/lua-5.1.1.tar.gz new file mode 100644 index 0000000..82fc5d2 Binary files /dev/null and b/extra-sources/lua-5.1.1.tar.gz differ diff --git a/extra-sources/mhwaveedit-1.4.10.tar.bz2 b/extra-sources/mhwaveedit-1.4.10.tar.bz2 new file mode 100644 index 0000000..5134b59 Binary files /dev/null and b/extra-sources/mhwaveedit-1.4.10.tar.bz2 differ diff --git a/extra-sources/mysql-5.0.21.tar.gz b/extra-sources/mysql-5.0.21.tar.gz new file mode 100644 index 0000000..e676b5e Binary files /dev/null and b/extra-sources/mysql-5.0.21.tar.gz differ diff --git a/extra-sources/p7zip_4.43_src_all.tar.bz2 b/extra-sources/p7zip_4.43_src_all.tar.bz2 new file mode 100644 index 0000000..6af7aac Binary files /dev/null and b/extra-sources/p7zip_4.43_src_all.tar.bz2 differ diff --git a/extra-sources/pcre-6.7.tar.bz2 b/extra-sources/pcre-6.7.tar.bz2 new file mode 100644 index 0000000..6734a83 Binary files /dev/null and b/extra-sources/pcre-6.7.tar.bz2 differ diff --git a/extra-sources/physfs-1.1.0.tar.gz b/extra-sources/physfs-1.1.0.tar.gz new file mode 100644 index 0000000..55ec60e Binary files /dev/null and b/extra-sources/physfs-1.1.0.tar.gz differ diff --git a/extra-sources/popt-1.7.tar.gz b/extra-sources/popt-1.7.tar.gz new file mode 100644 index 0000000..545c6f5 Binary files /dev/null and b/extra-sources/popt-1.7.tar.gz differ diff --git a/extra-sources/pure-ftpd-1.0.21.tar.bz2 b/extra-sources/pure-ftpd-1.0.21.tar.bz2 new file mode 100644 index 0000000..772473b Binary files /dev/null and b/extra-sources/pure-ftpd-1.0.21.tar.bz2 differ diff --git a/extra-sources/pygame-1.7.1release.tar.gz b/extra-sources/pygame-1.7.1release.tar.gz new file mode 100644 index 0000000..d6e63ad Binary files /dev/null and b/extra-sources/pygame-1.7.1release.tar.gz differ diff --git a/extra-sources/python_PIL-1.1.5.tar.bz2 b/extra-sources/python_PIL-1.1.5.tar.bz2 new file mode 100644 index 0000000..523a29b Binary files /dev/null and b/extra-sources/python_PIL-1.1.5.tar.bz2 differ diff --git a/extra-sources/tcl8.4.13-src.tar.gz b/extra-sources/tcl8.4.13-src.tar.gz new file mode 100644 index 0000000..1b86892 Binary files /dev/null and b/extra-sources/tcl8.4.13-src.tar.gz differ diff --git a/extra-sources/thttpd-2.25b.tar.gz b/extra-sources/thttpd-2.25b.tar.gz new file mode 100644 index 0000000..375dad9 Binary files /dev/null and b/extra-sources/thttpd-2.25b.tar.gz differ diff --git a/extra-sources/tk8.4.13-src.tar.gz b/extra-sources/tk8.4.13-src.tar.gz new file mode 100644 index 0000000..458666f Binary files /dev/null and b/extra-sources/tk8.4.13-src.tar.gz differ diff --git a/extra-sources/vte-0.12.2.tar.bz2 b/extra-sources/vte-0.12.2.tar.bz2 new file mode 100644 index 0000000..737a081 Binary files /dev/null and b/extra-sources/vte-0.12.2.tar.bz2 differ diff --git a/extra-sources/which-2.16.tar.gz b/extra-sources/which-2.16.tar.gz new file mode 100644 index 0000000..e4fa7e2 Binary files /dev/null and b/extra-sources/which-2.16.tar.gz differ diff --git a/extra-sources/wine-0.9.19.tar.bz2 b/extra-sources/wine-0.9.19.tar.bz2 new file mode 100644 index 0000000..5104e9f Binary files /dev/null and b/extra-sources/wine-0.9.19.tar.bz2 differ diff --git a/extra-sources/xfe-0.88.tar.gz b/extra-sources/xfe-0.88.tar.gz new file mode 100644 index 0000000..9e6d1b5 Binary files /dev/null and b/extra-sources/xfe-0.88.tar.gz differ diff --git a/install-tier2.sh b/install-tier2.sh new file mode 100644 index 0000000..a679ace --- /dev/null +++ b/install-tier2.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +source /etc/profile +cd /mnt/ + +echo "#############" +echo "## TIER 2 ##" +echo "#############" + +#instalar SHADOW +pkg-manager install lfs-pkgs/shadow-4.0.15.tar.bz2 + +##### Instalar todo BLFS +pkg-manager install blfs-pkgs/* + +##### Instalar todo extra +pkg-manager install extra-pkgs/* + + +# establecer password +echo "######" +echo "PASSWORD de ROOT" +passwd + + + +########################################## +## TODO: + +# Establecer particiones +# Compilar Nucleo +# Establecer GRUB diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..c4f5f66 --- /dev/null +++ b/install.sh @@ -0,0 +1,100 @@ +#!/bin/sh + +DEST=/mnt/dest/ + +####################### +## TIER ONE ########### +####################### + +echo "#############" +echo "## TIER 1 ##" +echo "#############" + + +## PREPARAR +export SYSTEM_ROOT=$DEST +./pkg-manager/pkg-manager prepare + +# PREPARAR FHS +tar xvjfp FHS-lfs-20060531.tar.bz2 -C $DEST + + +# INSTALAR BASE (LFS) +cd lfs-pkgs +../pkg-manager/pkg-manager install \ +linux-libc-headers-2.6.12.0.tar.bz2 \ +man-pages-2.33.tar.bz2 \ +glibc-2.3.6.tar.bz2 \ +binutils-2.17.tar.bz2 \ +gcc-4.0.3.tar.bz2 \ +db-4.4.20.tar.bz2 \ +coreutils-5.96.tar.bz2 \ +iana-etc-2.10.tar.bz2 \ +m4-1.4.4.tar.bz2 \ +bison-2.2.tar.bz2 \ +ncurses-5.5.tar.bz2 \ +procps-3.2.6.tar.bz2 \ +sed-4.1.5.tar.bz2 \ +libtool-1.5.22.tar.bz2 \ +perl-5.8.8.tar.bz2 \ +readline-5.1.tar.bz2 \ +zlib-1.2.3.tar.bz2 \ +autoconf-2.59.tar.bz2 \ +automake-1.9.6.tar.bz2 \ +bash-3.1.tar.bz2 \ +bzip2-1.0.3.tar.bz2 \ +diffutils-2.8.1.tar.bz2 \ +e2fsprogs-1.38.tar.bz2 \ +file-4.17.tar.bz2 \ +findutils-4.2.27.tar.bz2 \ +flex-2.5.33.tar.bz2 \ +grub-0.97.tar.bz2 \ +gawk-3.1.5.tar.bz2 \ +gettext-0.14.5.tar.bz2 \ +grep-2.5.1a.tar.bz2 \ +groff-1.18.1.1.tar.bz2 \ +gzip-1.3.5.tar.bz2 \ +inetutils-1.4.2.tar.bz2 \ +iproute2-2.6.16-060323.tar.bz2 \ +kbd-1.12.tar.bz2 \ +less-394.tar.bz2 \ +make-3.80.tar.bz2 \ +man-db-2.4.3.tar.bz2 \ +mktemp-1.5.tar.bz2 \ +module-init-tools-3.2.2.tar.bz2 \ +patch-2.5.4.tar.bz2 \ +psmisc-22.2.tar.bz2 \ +sysklogd-1.4.1.tar.bz2 \ +sysvinit-2.86.tar.bz2 \ +tar-1.15.1.tar.bz2 \ +texinfo-4.8.tar.bz2 \ +udev-092.tar.bz2 \ +util-linux-2.12r.tar.bz2 \ +vim-7.0.tar.bz2 +cd .. + +# Configuracion BASE +./pkg-manager/pkg-manager install \ +baseconfig-20061012.tar.bz2 \ +bsd-bootscripts-20061012.tar.bz2 + +unset SYSTEM_ROOT + +###################### +## TIER TWO ########## +###################### +## Para realizar acciones dentro del sistema +cp pkg-manager/pkg-manager ${DEST}sbin/pkg-manager +mount . ${DEST}mnt -o bind +chroot $DEST /mnt/install-tier2.sh +umount ${DEST}mnt + + + + +########################################## +## TODO: + +# Establecer particiones +# Compilar Nucleo +# Establecer GRUB diff --git a/lfs-canges.txt b/lfs-canges.txt new file mode 100644 index 0000000..a87a8f4 --- /dev/null +++ b/lfs-canges.txt @@ -0,0 +1,130 @@ +II.5: + +No compilado: +Tcl-8.4.13 +Expect-5.43.0 +DejaGNU-1.4.4 +Perl-5.8.8 + + +III.6.6: +Creacion de ficheros temporales: +/etc/mtab +/etc/passwd +/etc/group +/var/run/utmp +/var/log/{btmp,lastlog,wtmp} +ln -sv bash /bin/sh +echo "127.0.0.1 localhost $(hostname)" > /etc/hosts + + + +ANEXO: Kable: Instalacion utilizando paquetes precompilados +tar xvjfp FHS-lfs-20060531.tar.bz2 -C /mnt/dest/ + +export SYSTEM_ROOT=/mnt/dest/ +pkg-manager prepare +pkg-manager install: +linux-libc-headers-2.6.12.0.tar.bz2 +man-pages-2.33.tar.bz2 +glibc-2.3.6.tar.bz2 +binutils-2.16.1.tar.bz2 +gcc-4.0.3.tar.bz2 +db-4.4.20.tar.bz2 +coreutils-5.96.tar.bz2 +iana-etc-2.10.tar.bz2 +m4-1.4.4.tar.bz2 +bison-2.2.tar.bz2 +ncurses-5.5.tar.bz2 +procps-3.2.6.tar.bz2 +sed-4.1.5.tar.bz2 +libtool-1.5.22.tar.bz2 +perl-5.8.8.tar.bz2 +readline-5.1.tar.bz2 +zlib-1.2.3.tar.bz2 +autoconf-2.59.tar.bz2 +automake-1.9.6.tar.bz2 +bash-3.1.tar.bz2 +bzip2-1.0.3.tar.bz2 +diffutils-2.8.1.tar.bz2 +e2fsprogs-1.38.tar.bz2 +file-4.17.tar.bz2 +findutils-4.2.27.tar.bz2 +flex-2.5.33.tar.bz2 +grub-0.97.tar.bz2 +gawk-3.1.5.tar.bz2 +gettext-0.14.5.tar.bz2 +grep-2.5.1a.tar.bz2 +groff-1.18.1.1.tar.bz2 +gzip-1.3.5.tar.bz2 +inetutils-1.4.2.tar.bz2 +iproute2-2.6.16-060323.tar.bz2 +kbd-1.12.tar.bz2 +less-394.tar.bz2 +make-3.80.tar.bz2 +man-db-2.4.3.tar.bz2 +mktemp-1.5.tar.bz2 +module-init-tools-3.2.2.tar.bz2 +patch-2.5.4.tar.bz2 +psmisc-22.2.tar.bz2 +sysklogd-1.4.1.tar.bz2 +sysvinit-2.86.tar.bz2 +tar-1.15.1.tar.bz2 +texinfo-4.8.tar.bz2 +udev-092.tar.bz2 +util-linux-2.12r.tar.bz2 +vim-7.0.tar.bz2 + + +# Cosas perparadas por mi +baseconfig-20060602.tar.bz2 +bsd-bootscripts-20060602.tar.bz2 + + +# Desde aqui dentro del systema +# por ende copiar pkg-manager dentro del sistema + +shadow-4.0.15.tar.bz2 + + +# Establecer password + /sbin/passwd +# Establecer particiones + /etc/fstab +# Compilar Nucleo + /usr/src +# Establecer GRUB + +/boot/menu.lst: +---8<----8<----- +default 0 +timeout 30 + +title=Linux + root (hd0,1) + kernel /boot/kernel root=/dev/hda2 + +title=Windows + rootnoverify (hd0,0) + makeactive + chainloader +1 +---8<----8<----- +grub: +root (hd0,1) +setup (hd0) +quit + + + + + + + + + + + + + + + diff --git a/lfs-tools-200605031.tar.bz2 b/lfs-tools-200605031.tar.bz2 new file mode 100644 index 0000000..fd7511a Binary files /dev/null and b/lfs-tools-200605031.tar.bz2 differ diff --git a/linux-2.6.18.tar.bz2 b/linux-2.6.18.tar.bz2 new file mode 100644 index 0000000..6eb2fcd Binary files /dev/null and b/linux-2.6.18.tar.bz2 differ diff --git a/pkg-manager/Ficheros.c b/pkg-manager/Ficheros.c new file mode 100644 index 0000000..34e6c64 --- /dev/null +++ b/pkg-manager/Ficheros.c @@ -0,0 +1,117 @@ +// permitir offsets de 64bits (tamaños mayores de 4GB) +#define _FILE_OFFSET_BITS 64 + +#include +#include +#include +#include +#include + +#include "Ficheros.h" + + +// Funcion para recorrer recursivamente un directorio +void Recurse_Dir(char *dir_orig,Recurse_Dir_func func,void *data){ + DIR *directorio; + struct dirent *entidad_dir; + char dir[1024]; + char path[1024]; + char file[255]; + struct stat stat_info; + + // poner la bara final del directorio + strcpy(dir,dir_orig); + if(dir_orig[strlen(dir_orig)-1]!='/'){ + strcat(dir,"/"); + } + directorio=opendir(dir); + if(directorio!=NULL){ + do{ + entidad_dir=readdir(directorio); + if(entidad_dir!=NULL){ + if(strcmp(entidad_dir->d_name,".") && + strcmp(entidad_dir->d_name,"..")){ + // costruir el path y fichero + strcpy(path,dir); + strcat(path,entidad_dir->d_name); + strcpy(file,entidad_dir->d_name); + // llamar a la funcion + func(path,file,data); + // comprobar si es un directorio + lstat(path, &stat_info); + if(S_ISDIR(stat_info.st_mode) && + !(stat_info.st_mode&S_IFLNK)){ + // es un directorio recursivar + Recurse_Dir(path,func,data); + } + } + } + }while(entidad_dir!=NULL); + closedir(directorio); + } +} + +// funcion para recorrer un directorio +// (la recursividad la determina la funcion, si la necesitara) +void Dir_ForEach(char *path,Dir_ForEach_func func,void *data){ + DIR *directorio; + struct dirent *entidad_dir; + char f_path[1024]; + + directorio=opendir(path); + if(directorio!=NULL){ + do{ + entidad_dir=readdir(directorio); + if(entidad_dir!=NULL){ + if(strcmp(entidad_dir->d_name,".") && + strcmp(entidad_dir->d_name,"..")){ + // Apartir de aqui hay un fichero(o directorio) + strcpy(f_path,path); + strcat(f_path,"/"); + strcat(f_path,entidad_dir->d_name); + func(f_path,entidad_dir->d_name,data); + } + } + }while(entidad_dir!=NULL); + closedir(directorio); + } +} + + + +int ExisteFichero(char *string){ + int existe=0; + FILE *fil; + fil=fopen(string,"r"); + if(fil!=NULL){ + fclose(fil); + existe=1; + } + return(existe); +} + +int EsDirectorio(char *string){ + struct stat stat_info; + lstat(string, &stat_info); + if(S_ISDIR(stat_info.st_mode) && + !(stat_info.st_mode&S_IFLNK)){ + return(1); + }else{ + return(0); + } +} + + +void borrado_recursivo_func(char *path,char *name,void *data){ + if(EsDirectorio(path)) + Dir_ForEach(path,borrado_recursivo_func,NULL); + remove(path); +} + +void borrado_recursivo(char *path){ + Dir_ForEach(path,borrado_recursivo_func,NULL); + remove(path); +} + + + diff --git a/pkg-manager/Ficheros.h b/pkg-manager/Ficheros.h new file mode 100644 index 0000000..f8ed140 --- /dev/null +++ b/pkg-manager/Ficheros.h @@ -0,0 +1,21 @@ +#ifndef _FICHEROS_H_ +#define _FICHEROS_H_ + +#include + +// Funcion para recorrer recursivamente un directorio +typedef void (*Recurse_Dir_func)(char *path,char *name,void *data); +void Recurse_Dir(char *dir_orig,Recurse_Dir_func func,void *data); + +// funcion para recorrer un directorio +// (la recursividad la determina la funcion, si la necesitara) +typedef void (*Dir_ForEach_func)(char *path,char *name,void *data); +void Dir_ForEach(char *path,Dir_ForEach_func func,void *data); + + +int ExisteFichero(char *string); + +int EsDirectorio(char *string); + +void borrado_recursivo(char *path); +#endif diff --git a/pkg-manager/Ficheros.o b/pkg-manager/Ficheros.o new file mode 100644 index 0000000..cb235a9 Binary files /dev/null and b/pkg-manager/Ficheros.o differ diff --git a/pkg-manager/Makefile b/pkg-manager/Makefile new file mode 100644 index 0000000..975bdfd --- /dev/null +++ b/pkg-manager/Makefile @@ -0,0 +1,89 @@ +# Makefile Generico Ajustable + +################## +# Definiciones # +################## + + +CFLAGS = -g +LIBS = +CC = gcc +CXX = g++ +DEBUGER = gdb +RM = rm -f +FUENTES = Ficheros.c StringUtil.c pkg-manager.c main.c +CABECERAS = Ficheros.h StringUtil.h pkg-manager.h +OBJS = Ficheros.o StringUtil.o pkg-manager.o main.o +RESULTADO = pkg-manager + +## definiciones para la instalacion +PREFIX=/usr/local +BINDIR = $(PREFIX)/bin +BINFILES = $(RESULTADO) +SHAREDIR = $(PREFIX)/share/$(RESULTADO) +SHAREFILES = +PIXDIR = $(SHAREDIR)/pixmaps +PIXFILES = + + + + +############### +# Objetivos # +############### +all: $(RESULTADO) + # ########################### + # # Compilacion finalizada. # + # ########################### + +$(RESULTADO): $(OBJS) + $(CC) -static $(OBJS) -o $(RESULTADO) $(LIBS) + +clean: + $(RM) $(OBJS) $(RESULTADO) + # ##################################### + # # limpieza terminada correctamente. # + # ##################################### + +.cpp.o: $(CABECERAS) + $(CXX) -c $(CFLAGS) $< + +.c.o: $(CABECERAS) + $(CC) -c $(CFLAGS) $< + +debug: $(RESULTADO) + $(DEBUGER) $(RESULTADO) + +run: $(RESULTADO) + ./$(RESULTADO) + # ####################### + # # Ejecucion correcta. # + # ####################### + +install: instala + +instala: $(RESULTADO) + mkdir -p $(DESTDIR)$(BINDIR) + cp $(BINFILES) $(DESTDIR)$(BINDIR) + if test "$(SHAREFILES)" != ""; then \ + mkdir -p $(DESTDIR)$(SHAREDIR); \ + cp $(SHAREFILES) $(DESTDIR)$(SHAREDIR); \ + fi + if test "$(PIXFILES)" != ""; then \ + mkdir -p $(DESTDIR)$(PIXDIR) ; \ + cp $(PIXFILES) $(DESTDIR)$(PIXDIR) ; \ + fi + # ######################### + # # Instalacion Concluida # + # ######################### + + +help: + # + # "make" para compilar, "make clean" para limpiar + # y "make run" para ejecutar el resultado. + # Aparte de "make debug" para ejecutar con el debuger. + # + + + diff --git a/pkg-manager/StringUtil.c b/pkg-manager/StringUtil.c new file mode 100644 index 0000000..e917558 --- /dev/null +++ b/pkg-manager/StringUtil.c @@ -0,0 +1,76 @@ +#include +#include + + +#include "StringUtil.h" + + + +void basename(char *nombre,char *basename){ + int a,b,c; + int len; + int enc=0; + len=strlen(nombre); + a=len-1; + while(a>-1 && !enc){ + if(nombre[a]!='/') + a--; + else + enc=1; + } + if(enc){ + c=0; + for(b=a+1;b +#include +#include +#include +#include +#include +#include +#include + +#include "StringUtil.h" +#include "Ficheros.h" +#include "pkg-manager.h" + + + +void usage(){ + printf("Metodo de uso:\n"); + printf("pkg-manager install \n"); + printf("pkg-manager remove \n"); + printf("pkg-manager prepare \n"); + pkg_mostrar_entorno(); +} + + +int main(int argc,char *argv[]){ + char fichero[1024]; + char nombre[1024]; + Pkg_File_List *pkg_lista; + Root_File_List *lista; + + // iniciar el sistema de paquetes + pkg_iniciar(); + + + if(argc>1){ + // Instalar uno + if(!strcmp(argv[1],"install") && argc==3){ + + // Comprobar que exista el paquete + strcpy(fichero,argv[2]); + if(!ExisteFichero(fichero)){ + printf("El paquete \"%s\" no existe.\n",fichero); + exit(0); + } + + // cargar lista de ficheros del sistema + lista=lista_sistema_cargar(); + + // determinar el nombre del paquete + basename(fichero,nombre); + + // preparar para la extraccion del fichero + pkg_preparar(nombre); + + // extraer el fichero + printf("*** Extrayendo: \"%s\"\n",nombre); + pkg_extraer(fichero,nombre); + + // combinar en el sistema + printf("*** Combinando \"%s\"\n",nombre); + pkg_merge(lista,nombre); + + // realizar proceso de postinstalacion + printf("*** Configurando \"%s\"\n",nombre); + pkg_postinstall(nombre); + + + // guardar nueva lista + lista_sistema_guardar(lista); + + // liberar lista + lista_sistema_borrar(lista); + + // salir + exit(0); + } + + // Instalar varios + if(!strcmp(argv[1],"install") && argc>3){ + int a; + // cargar lista de ficheros del sistema + lista=lista_sistema_cargar(); + + // Por cada paquete + for(a=2;a +#include +#include +#include +#include +#include +#include + +#include "StringUtil.h" +#include "Ficheros.h" +#include "pkg-manager.h" + + + +static char system_root[255]; +static char pkg_basedir[255]; +static char root_list_file[255]; + + + + +// Estructuras para la lista de ficheros del sistema + +Root_File_List *lista_sistema_cargar(){ + Root_File_List *lista_contenedor; + Root_File_Ent *lista=NULL,*pi=NULL,*aux; + FILE *fichero; + char linea[2048]; + int origen; + + fichero=fopen(root_list_file,"r"); + if(fichero!=NULL){ + while(fgets(linea,2048,fichero)!=NULL){ + aux=(Root_File_Ent *)malloc(sizeof(Root_File_Ent)); + origen=0; + coger_entrecomillado(linea,&origen,aux->nombre); + coger_entrecomillado(linea,&origen,aux->propietario); + + aux->next=NULL; + if(pi==NULL){ + lista=aux; + pi=lista; + }else{ + pi->next=(void *)aux; + pi=aux; + } + } + fclose(fichero); + } + + lista_contenedor=(Root_File_List *)malloc(sizeof(Root_File_List)); + lista_contenedor->lista=lista; + lista_contenedor->tail=aux; + + return(lista_contenedor); +} + +void lista_sistema_borrar(Root_File_List *lista){ + Root_File_Ent *next,*aux; + next=lista->lista; + while(next!=NULL){ + aux=(Root_File_Ent *)next->next; + free(next); + next=aux; + } + free(lista); +} + +Root_File_Ent *lista_sistema_sacar_fichero(Root_File_List *lista,char *fichero){ + Root_File_Ent *aux,*prev=NULL,*pi; + int enc=0; + pi=lista->lista; + + while(pi!=NULL && !enc){ + if(!strcmp(pi->nombre,fichero)){ + aux=pi; + enc=1; + }else{ + prev=pi; + pi=(Root_File_Ent *)pi->next; + } + } + + if(enc){ + if(aux==lista->tail){ + lista->tail=prev; + } + if(prev!=NULL){ + prev->next=aux->next; + }else{ + lista->lista=aux->next; + } + return(aux); + }else{ + return(NULL); + } + +} + +void lista_sistema_apendizar_fichero(Root_File_List *lista,char *fichero,char *propietario){ + Root_File_Ent *aux; + + // anhadir fichero a la lista de ficheros(del sistema) + aux=(Root_File_Ent *)malloc(sizeof(Root_File_Ent)); + strcpy(aux->nombre,fichero); + strcpy(aux->propietario,propietario); + + aux->next=NULL; + if(lista->tail==NULL){ + lista->lista=aux; + lista->tail=aux; + }else{ + lista->tail->next=(void *)aux; + lista->tail=aux; + } + +} + +void lista_sistema_guardar(Root_File_List *lista){ + Root_File_Ent *aux; + FILE *fichero; + aux=lista->lista; + + //fichero=fopen(ROOT_LIST_FILE,"w"); + fichero=fopen(root_list_file,"w"); + if(fichero!=NULL){ + while(aux!=NULL){ + fprintf(fichero,"\"%s\"\t\"%s\"\n",aux->nombre,aux->propietario); + aux=(Root_File_Ent *)aux->next; + } + fclose(fichero); + } +} + + + + +// Estructuras para la lista de ficheros del paquete + +Pkg_File_List *pkg_lista_cargar(char *nombre){ + Pkg_File_List *lista_contenedor; + Pkg_File_Ent *lista=NULL,*pi=NULL,*aux; + FILE *fichero; + char path_fichero[1024]; + char linea[1024]; + int a; + + //sprintf(path_fichero,PKG_BASEDIR"%s/lista\0",nombre); + sprintf(path_fichero,"%s%s/lista\0",pkg_basedir,nombre); + + fichero=fopen(path_fichero,"r"); + if(fichero!=NULL){ + while(fgets(linea,1024,fichero)!=NULL){ + aux=(Pkg_File_Ent *)malloc(sizeof(Root_File_Ent)); + // quitar el salto de linea final + for(a=strlen(linea)-3;anombre,linea); + // avanzar el la lista + aux->next=NULL; + if(pi==NULL){ + lista=aux; + pi=lista; + }else{ + pi->next=(void *)aux; + pi=aux; + } + } + fclose(fichero); + } + + lista_contenedor=(Pkg_File_List *)malloc(sizeof(Pkg_File_List)); + lista_contenedor->lista=lista; + + return(lista_contenedor); +} + + +void pkg_lista_borrar(Pkg_File_List *lista){ + Pkg_File_Ent *next,*aux; + next=lista->lista; + while(next!=NULL){ + aux=(Pkg_File_Ent *)next->next; + free(next); + next=aux; + } + free(lista); +} + + +void pkg_lista_print(Pkg_File_List *lista){ + Pkg_File_Ent *pi; + + pi=lista->lista; + while(pi!=NULL){ + printf("%s\n",pi->nombre); + pi=(Pkg_File_Ent *)pi->next; + } + +} + + + + + + + +// Funcion para preparar la extraccion de un paquete +void pkg_preparar(char *name){ + char path[1024]; + + // crear los directorios + //sprintf(path,PKG_BASEDIR"%s\0",name); + sprintf(path,"%s%s\0",pkg_basedir,name); + mkdir(path,0755); + //sprintf(path,PKG_BASEDIR"%s/ficheros\0",name); + sprintf(path,"%s%s/ficheros\0",pkg_basedir,name); + mkdir(path,0755); +} + +// Funcion para extraer un paquete +void pkg_extraer(char *fichero,char *nombre){ + char comando[1024]; + char destdir[1024]; + char listfile[1024]; + // preparar el comando + sprintf(destdir,"%s%s/ficheros\0",pkg_basedir,nombre); + sprintf(listfile,"%s%s/lista\0",pkg_basedir,nombre); + sprintf(comando,"tar xjvfp %s -C %s --index-file %s &> /dev/null\0",fichero,destdir,listfile); + + + // extarer el paquete utilizando tar+bzip2 + system(comando); + + + + // Recoger scripts de instalacion y desinstalacion + char script_path[1024],script_dest_path[1024]; + sprintf(script_path,"%s%s/ficheros/install.sh\0",pkg_basedir,nombre); + sprintf(script_dest_path,"%s%s/install.sh\0",pkg_basedir,nombre); + if(ExisteFichero(script_path)){ + rename(script_path,script_dest_path); + } + + sprintf(script_path,"%s%s/ficheros/uninstall.sh\0",pkg_basedir,nombre); + sprintf(script_dest_path,"%s%s/uninstall.sh\0",pkg_basedir,nombre); + if(ExisteFichero(script_path)){ + rename(script_path,script_dest_path); + } + +} + + + + + +typedef struct { + Root_File_List *lista_sistema; + char pkg_nombre[1024]; + char path[1024]; + char vpath[1024]; +} pkg_merge_parms ; + + +void pkg_merge_func(char *path,char *name,void *data){ + pkg_merge_parms *parms=(pkg_merge_parms *)data; + char file_dest_path[1024]; + char file_vpath[1024]; + struct stat stat_info; + + // preparar los paths + sprintf(file_dest_path,"%s%s/%s\0",system_root,parms->vpath,name); + strcpy(file_vpath,parms->vpath); + if(strcmp(file_vpath,"")){ + strcat(file_vpath,"/"); + } + strcat(file_vpath,name); + + // obtener stat del fichero + lstat(path, &stat_info); + + + if(EsDirectorio(path)){ + int existe=0; + pkg_merge_parms new_parms; + // es un directorio + if(!ExisteFichero(file_dest_path)){ + // crear el directorio inexistente + mkdir(file_dest_path,0755); + }else{ + existe=1; + } + + // preparar nuevos parametros + strcpy(new_parms.path,path); + strcpy(new_parms.vpath,file_vpath); + strcpy(new_parms.pkg_nombre,parms->pkg_nombre); + new_parms.lista_sistema=parms->lista_sistema; + + // recursivar + Dir_ForEach(path,pkg_merge_func,&new_parms); + + // establecer atributos del directorio origen + if(!existe){ + struct utimbuf tiempos; + chmod(file_dest_path,stat_info.st_mode); + chown(file_dest_path,stat_info.st_uid,stat_info.st_gid); + tiempos.actime=stat_info.st_atime; + tiempos.modtime=stat_info.st_mtime; + utime(file_dest_path,&tiempos); + } + }else{ + struct utimbuf tiempos; + // es un fichero + + // comprobar si el fichero existia previamente + if(ExisteFichero(file_dest_path)){ + // el fichero destino existe + Root_File_Ent *nodo_fichero; + nodo_fichero=lista_sistema_sacar_fichero(parms->lista_sistema,file_vpath); + if(nodo_fichero!=NULL){ + if(strcmp(nodo_fichero->propietario,parms->pkg_nombre)){ + char path_respaldo[1024]; + // el fichero es de un paquete diferente + sprintf(path_respaldo,"%s%s/ficheros/%s\0", + pkg_basedir, + nodo_fichero->propietario, + file_vpath); + rename(file_dest_path,path_respaldo); + } + free(nodo_fichero); + } + } + + // es un fichero (o enlace) + rename(path,file_dest_path); + lista_sistema_apendizar_fichero(parms->lista_sistema,file_vpath,parms->pkg_nombre); + } +} + +// funcion para combinar el paquete con el sistema +void pkg_merge(Root_File_List *lista_sistema,char *nombre){ + char path[1024]; + pkg_merge_parms parms; + + // preparar los parametros + sprintf(path,"%s%s/ficheros\0",pkg_basedir,nombre); + strcpy(parms.vpath,""); + strcpy(parms.path,path); + strcpy(parms.pkg_nombre,nombre); + parms.lista_sistema=lista_sistema; + + // combinar el directorio con el sistema + Dir_ForEach(path,pkg_merge_func,&parms); +} + + +// funcion para descombinar el paquete del sistema +void pkg_unmerge(Root_File_List *lista_sistema,char *nombre){ + Root_File_Ent *pi,*prev; + + prev=NULL; + pi=lista_sistema->lista; + + while(pi!=NULL){ + if(!strcmp(pi->propietario,nombre)){ + char orig_path[1024],dest_path[1024]; + + // preparar paths + sprintf(orig_path,"%s%s\0",system_root,pi->nombre); + sprintf(dest_path,"%s%s/ficheros/%s\0",pkg_basedir,nombre,pi->nombre); + + // mover el fichero + rename(orig_path,dest_path); + + // avanzar + if(prev==NULL){ + lista_sistema->lista=(Root_File_Ent *)pi->next; + }else{ + prev->next=(void *)pi->next; + } + pi=(Root_File_Ent *)pi->next; + }else{ + // siguente + prev=pi; + pi=(Root_File_Ent *)pi->next; + } + } +} + + +// funcion para eliminar el paquete del sistema (solo el dir) +void pkg_eliminar(char *nombre){ + char path[1024]; + + sprintf(path,"%s%s\0",pkg_basedir,nombre); + borrado_recursivo(path); +} + +// realizar las operaciones necesarias en la instalacion +void pkg_postinstall(char *nombre){ + char path[1024],comando[1024]; + + sprintf(path,"%s%s/install.sh\0",pkg_basedir,nombre); + if(ExisteFichero(path)){ + sprintf(comando,"sh %s\0",path); + system(comando); + } +} + +// realizar las operaciones necesarias en la desinstalacion +void pkg_preuninstall(char *nombre){ + char path[1024],comando[1024]; + + sprintf(path,"%s%s/uninstall.sh\0",pkg_basedir,nombre); + if(ExisteFichero(path)){ + sprintf(comando,"sh %s\0",path); + system(comando); + } +} + +// funcion para comprobar el estado del paquete +int pkg_estado(char *nombre){ + char path[1024]; + + sprintf(path,"%s%s\0",pkg_basedir,nombre); + if(ExisteFichero(path)) + if(EsDirectorio(path)) + return(1); + return(0); +} + + + +#define SYSTEM_ROOT "/" +#define PKG_BASEDIR "var/db/pkg/" +#define ROOT_LIST_FILE "lista_ficheros" + +// Funcion para inicializar el sistema de paquetes +void pkg_iniciar(){ + char *env_val; + + ///////////////////////// + // obtener configuracion + ///////////////////////// + + + env_val=getenv("SYSTEM_ROOT"); + if(env_val!=NULL){ + // valor en el entorno + strcpy(system_root,env_val); + }else{ + // valor por defecto + strcpy(system_root,SYSTEM_ROOT); + } + + env_val=getenv("PKG_BASEDIR"); + if(env_val!=NULL){ + // valor de entorno + sprintf(pkg_basedir,"%s%s\0",system_root,env_val); + }else{ + // valor por defecto + sprintf(pkg_basedir,"%s%s\0",system_root,PKG_BASEDIR); + } + + + env_val=getenv("ROOT_LIST_FILE"); + if(env_val!=NULL){ + // valor de entorno + sprintf(root_list_file,"%s%s\0",pkg_basedir,env_val); + }else{ + // valor por defecto + sprintf(root_list_file,"%s%s\0",pkg_basedir,ROOT_LIST_FILE); + } + + + ////////////////////////////////////////////////// + // comprobar directorio del sistema de paquetes + ///////////////////////////////////////////////// + +} + +void pkg_preparar_dir_systema(){ + char comando[255]; + + // Crear los directorios + sprintf(comando,"mkdir -pv %s",pkg_basedir); + system(comando); + + // Crear el fichero de la lista del sistema + sprintf(comando,"touch %s",root_list_file); + system(comando); + + +} + + +// funcion para mostrar el entorno +void pkg_mostrar_entorno(){ + printf("Entorno:\n"); + printf("SYSTEM_ROOT =\"%s\"\n",system_root); + printf("PKG_BASEDIR =\"%s\"\n",pkg_basedir); + printf("ROOT_LIST_FILE =\"%s\"\n",root_list_file); + +} diff --git a/pkg-manager/pkg-manager.c.old b/pkg-manager/pkg-manager.c.old new file mode 100644 index 0000000..c0a1dea --- /dev/null +++ b/pkg-manager/pkg-manager.c.old @@ -0,0 +1,456 @@ +// permitir offsets de 64bits (tamaños mayores de 4GB) +#define _FILE_OFFSET_BITS 64 + +#include +#include +#include +#include +#include + +#include "StringUtil.h" +#include "Ficheros.h" + + + + +#define SYSTEM_ROOT "/home/kable/testsystem/" +#define PKG_BASEDIR SYSTEM_ROOT"var/db/pkg/" +#define ROOT_LIST_FILE PKG_BASEDIR"lista_ficheros" + + + +// Estructuras para la lista de ficheros del sistema + +typedef struct { + char nombre[1024]; + char propietario[255]; + void *next; +} Root_File_Ent; + +typedef struct { + Root_File_Ent *lista; +} Root_File_List; + + +Root_File_List *lista_sistema_cargar(){ + Root_File_List *lista_contenedor; + Root_File_Ent *lista=NULL,*pi=NULL,*aux; + FILE *fichero; + char linea[2048]; + int origen; + + fichero=fopen(ROOT_LIST_FILE,"r"); + if(fichero!=NULL){ + while(fgets(linea,2048,fichero)!=NULL){ + aux=(Root_File_Ent *)malloc(sizeof(Root_File_Ent)); + origen=0; + coger_entrecomillado(linea,&origen,aux->nombre); + coger_entrecomillado(linea,&origen,aux->propietario); + + aux->next=NULL; + if(pi==NULL){ + lista=aux; + pi=lista; + }else{ + pi->next=(void *)aux; + pi=aux; + } + } + fclose(fichero); + } + + lista_contenedor=(Root_File_List *)malloc(sizeof(Root_File_List)); + lista_contenedor->lista=lista; + + return(lista_contenedor); +} + +void lista_sistema_borrar(Root_File_List *lista){ + Root_File_Ent *next,*aux; + next=lista->lista; + while(next!=NULL){ + aux=(Root_File_Ent *)next->next; + free(next); + next=aux; + } + free(lista); +} + +Root_File_Ent *lista_sistema_sacar_fichero(Root_File_List *lista,char *fichero){ + Root_File_Ent *aux,*prev=NULL,*pi; + int enc=0; + pi=lista->lista; + + while(pi!=NULL && !enc){ + if(!strcmp(pi->nombre,fichero)){ + aux=pi; + enc=1; + }else{ + prev=pi; + pi=(Root_File_Ent *)pi->next; + } + } + + if(enc){ + if(prev!=NULL){ + prev->next=aux->next; + }else{ + lista->lista=aux->next; + } + return(aux); + }else{ + return(NULL); + } + +} + + +void lista_sistema_guardar(Root_File_List *lista){ + Root_File_Ent *aux; + FILE *fichero; + aux=lista->lista; + + fichero=fopen(ROOT_LIST_FILE,"w"); + if(fichero!=NULL){ + while(aux!=NULL){ + fprintf(fichero,"\"%s\"\t\"%s\"\n",aux->nombre,aux->propietario); + aux=(Root_File_Ent *)aux->next; + } + fclose(fichero); + } +} + + + + +// Estructuras para la lista de ficheros del paquete + +typedef struct { + char nombre[1024]; + void *next; +} Pkg_File_Ent; + +typedef struct { + Pkg_File_Ent *lista; +} Pkg_File_List; + + + +Pkg_File_List *pkg_lista_cargar(char *nombre){ + Pkg_File_List *lista_contenedor; + Pkg_File_Ent *lista=NULL,*pi=NULL,*aux; + FILE *fichero; + char path_fichero[1024]; + char linea[1024]; + int a; + + sprintf(path_fichero,PKG_BASEDIR"%s/lista\0",nombre); + + fichero=fopen(path_fichero,"r"); + if(fichero!=NULL){ + while(fgets(linea,1024,fichero)!=NULL){ + aux=(Pkg_File_Ent *)malloc(sizeof(Root_File_Ent)); + // quitar el salto de linea final + for(a=strlen(linea)-3;anombre,linea); + // avanzar el la lista + aux->next=NULL; + if(pi==NULL){ + lista=aux; + pi=lista; + }else{ + pi->next=(void *)aux; + pi=aux; + } + } + fclose(fichero); + } + + lista_contenedor=(Pkg_File_List *)malloc(sizeof(Pkg_File_List)); + lista_contenedor->lista=lista; + + return(lista_contenedor); +} + + +void pkg_lista_borrar(Pkg_File_List *lista){ + Pkg_File_Ent *next,*aux; + next=lista->lista; + while(next!=NULL){ + aux=(Pkg_File_Ent *)next->next; + free(next); + next=aux; + } + free(lista); +} + + +void pkg_lista_print(Pkg_File_List *lista){ + Pkg_File_Ent *pi; + + pi=lista->lista; + while(pi!=NULL){ + printf("%s\n",pi->nombre); + pi=(Pkg_File_Ent *)pi->next; + } + +} + + + + + + + +void combinar_listas(Root_File_List *lista,Pkg_File_List *lista_pkg,char *nombre){ + Pkg_File_Ent *pi; + Root_File_Ent *aux,*last; + int enc=0; + + // buscar el ultimo elemento de la lista + last=lista->lista; + while(last!=NULL && !enc){ + if(last->next==NULL){ + enc=1; + }else{ + last=(Root_File_Ent *)last->next; + } + } + + pi=lista_pkg->lista; + while(pi!=NULL){ + if(pi->nombre[strlen(pi->nombre)-1]!='/'){ // solo ficheros + // anhadir fichero(del paquete) a la lista de ficheros(del sistema) + aux=(Root_File_Ent *)malloc(sizeof(Root_File_Ent)); + strcpy(aux->nombre,pi->nombre); + strcpy(aux->propietario,nombre); + + aux->next=NULL; + if(last==NULL){ + lista->lista=aux; + last=aux; + }else{ + last->next=(void *)aux; + last=aux; + } + } + + // siguente fichero de paquete + pi=(Pkg_File_Ent *)pi->next; + } + +} + + + + + + + + + +void pkg_preparar(char *name){ + char path[1024]; + + // crear los directorios + sprintf(path,PKG_BASEDIR"%s\0",name); + mkdir(path,0755); + sprintf(path,PKG_BASEDIR"%s/ficheros\0",name); + mkdir(path,0755); +} + + +void pkg_extraer(char *fichero,char *nombre){ + char comando[1024]; + char destdir[1024]; + char listfile[1024]; + // preparar el comando + sprintf(destdir,PKG_BASEDIR"%s/ficheros\0",nombre); + sprintf(listfile,PKG_BASEDIR"%s/lista\0",nombre); + sprintf(comando,"tar xjvfp %s -C %s --index-file %s &> /dev/null\0",fichero,destdir,listfile); + + + // extarer el paquete utilizando tar+bzip2 + system(comando); + + + + // Recoger scripts de instalacion y desinstalacion + char script_path[1024],script_dest_path[1024]; + sprintf(script_path,PKG_BASEDIR"%s/ficheros/install.sh\0",nombre); + sprintf(script_dest_path,PKG_BASEDIR"%s/install.sh\0",nombre); + if(ExisteFichero(script_path)){ + rename(script_path,script_dest_path); + } + + sprintf(script_path,PKG_BASEDIR"%s/ficheros/uninstall.sh\0",nombre); + sprintf(script_dest_path,PKG_BASEDIR"%s/uninstall.sh\0",nombre); + if(ExisteFichero(script_path)){ + rename(script_path,script_dest_path); + } + +} + + +void pkg_merge_dir(Root_File_List *lista_sistema,char *pkg_nombre,char *path,char *vpath){ + DIR *directorio; + struct dirent *entidad_dir; + char file_path[1024]; + char file_dest_path[1024]; + char file_vpath[1024]; + struct stat stat_info; + + // abrir el directorio + directorio=opendir(path); + if(directorio!=NULL){ + do{ + entidad_dir=readdir(directorio); + if(entidad_dir!=NULL){ + if(strcmp(entidad_dir->d_name,".") && + strcmp(entidad_dir->d_name,"..")){ + // procesar la entidad (fichero o directorio) + strcpy(file_path,path); + strcat(file_path,"/"); + strcat(file_path,entidad_dir->d_name); + strcpy(file_dest_path,SYSTEM_ROOT); + strcat(file_dest_path,vpath); + strcat(file_dest_path,"/"); + strcat(file_dest_path,entidad_dir->d_name); + strcpy(file_vpath,vpath); + if(strcmp(vpath,"")){ + strcat(file_vpath,"/"); + } + strcat(file_vpath,entidad_dir->d_name); + lstat(file_path, &stat_info); + + if( S_ISDIR(stat_info.st_mode) && + !(stat_info.st_mode&S_IFLNK)){ + char new_path[1024]; + char new_vpath[1024]; + int existe=0; + + // es un directorio + strcpy(new_path,file_path); + strcpy(new_vpath,file_vpath); + + // crear el directorio + if(!ExisteFichero(file_dest_path)){ + mkdir(file_dest_path,0755); + }else{ + existe=1; + } + + // recursivar + pkg_merge_dir(lista_sistema,pkg_nombre,new_path,new_vpath); + + // establecer atributos del directorio origen + if(!existe){ + struct utimbuf tiempos; + chmod(file_dest_path,stat_info.st_mode); + chown(file_dest_path,stat_info.st_uid,stat_info.st_gid); + tiempos.actime=stat_info.st_atime; + tiempos.modtime=stat_info.st_mtime; + utime(file_dest_path,&tiempos); + } + + // borrar el directorio movido + //remove(new_path); + }else{ + struct utimbuf tiempos; + + // comprobar si el fichero existia previamente + if(ExisteFichero(file_dest_path)){ + // el fichero destino existe + Root_File_Ent *nodo_fichero; + + nodo_fichero=lista_sistema_sacar_fichero(lista_sistema,file_vpath); + if(nodo_fichero!=NULL){ + if(strcmp(nodo_fichero->propietario,pkg_nombre)){ + char path_respaldo[1024]; + // el fichero es de un paquete diferente + //printf("Colision\n"); + strcpy(path_respaldo,PKG_BASEDIR); + strcat(path_respaldo,nodo_fichero->propietario); + strcat(path_respaldo,"/ficheros/"); + strcat(path_respaldo,file_vpath); + rename(file_dest_path,path_respaldo); + } + free(nodo_fichero); + } + + + } + + // es un fichero (o enlace) + rename(file_path,file_dest_path); + + // establecer los atributos del fichero origen + chmod(file_dest_path,stat_info.st_mode); + chown(file_dest_path,stat_info.st_uid,stat_info.st_gid); + tiempos.actime=stat_info.st_atime; + tiempos.modtime=stat_info.st_mtime; + utime(file_dest_path,&tiempos); + } + } + } + }while(entidad_dir!=NULL); + closedir(directorio); + } +} + + +void pkg_merge(Root_File_List *lista_sistema,char *nombre){ + char path[1024]; + char vpath[1024]; + + // preparar los path + sprintf(path,PKG_BASEDIR"%s/ficheros\0",nombre); + strcpy(vpath,""); + + // combinar el directorio con el sistema + pkg_merge_dir(lista_sistema,nombre,path,vpath); +} + + + + + +int main(int argc,char *argv[]){ + char fichero[1024]; + char nombre[1024]; + Pkg_File_List *pkg_lista; + Root_File_List *lista; + + + if(argc>1){ + // cargar lista de ficheros del sistema + lista=lista_sistema_cargar(); + + + strcpy(fichero,argv[1]); + // determinar el nombre del paquete + basename(fichero,nombre); + // preparar para la extraccion del fichero + pkg_preparar(nombre); + // extraer el fichero + printf("*** Extrayendo: \"%s\"\n",nombre); + pkg_extraer(fichero,nombre); + // comb¡vinar en el sistema + printf("*** Combinando \"%s\"\n",nombre); + pkg_merge(lista,nombre); + // cargar y combinarla con la del sistema + pkg_lista=pkg_lista_cargar(nombre); + combinar_listas(lista,pkg_lista,nombre); + // guardar nueva lista + lista_sistema_guardar(lista); + + // liberar listas + pkg_lista_borrar(pkg_lista); + lista_sistema_borrar(lista); + + } +} diff --git a/pkg-manager/pkg-manager.h b/pkg-manager/pkg-manager.h new file mode 100644 index 0000000..1ca2227 --- /dev/null +++ b/pkg-manager/pkg-manager.h @@ -0,0 +1,71 @@ +#ifndef _PKG_MANAGER_H_ +#define _PKG_MANAGER_H_ + + + + + +// Estructuras para la lista de ficheros del sistema + +typedef struct { + char nombre[1024]; + char propietario[255]; + void *next; +} Root_File_Ent; + +typedef struct { + Root_File_Ent *lista; + Root_File_Ent *tail; +} Root_File_List ; + +Root_File_List *lista_sistema_cargar(); +void lista_sistema_borrar(Root_File_List *lista); +Root_File_Ent *lista_sistema_sacar_fichero(Root_File_List *lista,char *fichero); +void lista_sistema_apendizar_fichero(Root_File_List *lista,char *fichero,char *propietario); +void lista_sistema_guardar(Root_File_List *lista); + + +// Estructuras para la lista de ficheros del paquete + +typedef struct { + char nombre[1024]; + void *next; +} Pkg_File_Ent; + +typedef struct { + Pkg_File_Ent *lista; +} Pkg_File_List; + + +Pkg_File_List *pkg_lista_cargar(char *nombre); +void pkg_lista_borrar(Pkg_File_List *lista); +void pkg_lista_print(Pkg_File_List *lista); + + +// Funcion para preparar la extraccion de un paquete +void pkg_preparar(char *name); +// Funcion para extraer un paquete +void pkg_extraer(char *fichero,char *nombre); +// funcion para combinar el paquete con el sistema +void pkg_merge(Root_File_List *lista_sistema,char *nombre); +// funcion para descombinar el paquete del sistema +void pkg_unmerge(Root_File_List *lista_sistema,char *nombre); +// funcion para eliminar el paquete del sistema (solo el dir) +void pkg_eliminar(char *nombre); +// realizar las operaciones necesarias en la instalacion +void pkg_postinstall(char *nombre); +// realizar las operaciones necesarias en la desinstalacion +void pkg_preuninstall(char *nombre); +// funcion para comprobar el estado del paquete +int pkg_estado(char *nombre); + +// Funcion para inicializar el sistema de paquetes +void pkg_iniciar(); + +// Funcion para preparar el sistema destino +void pkg_preparar_dir_systema(); + +// funcion para mostrar el entorno +void pkg_mostrar_entorno(); + +#endif diff --git a/pkg-manager/pkg-manager.o b/pkg-manager/pkg-manager.o new file mode 100644 index 0000000..5d8dc92 Binary files /dev/null and b/pkg-manager/pkg-manager.o differ diff --git a/pkg-manager/scriptado-1.tar.bz2 b/pkg-manager/scriptado-1.tar.bz2 new file mode 100644 index 0000000..90200b0 Binary files /dev/null and b/pkg-manager/scriptado-1.tar.bz2 differ diff --git a/pkg-manager/shit-finder.sh b/pkg-manager/shit-finder.sh new file mode 100644 index 0000000..33dbe3a --- /dev/null +++ b/pkg-manager/shit-finder.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# + +SYS_LIST="sys_list" +PKG_LIST="pkg_list" + +# Generar lista del sistema +echo "" > $SYS_LIST + diff --git a/recetas/mplayerplug-in/mplayerplug-in-3.31.build.sh b/recetas/mplayerplug-in/mplayerplug-in-3.31.build.sh new file mode 100644 index 0000000..dd7d0a9 --- /dev/null +++ b/recetas/mplayerplug-in/mplayerplug-in-3.31.build.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +## UNPACK +tar xvf mplayerplug-in-3.31.tar.gz +cd mplayerplug-in + +## CONFIG +./configure --prefix=/usr || exit -1 + +## BUILD +make || exit -1 + +## PKG +mkdir dest +make DESTDIR=$(pwd)/dest install +cd dest +tar cjvfp ../../mplayerplug-in-3.31.tar.bz2 * +cd .. + +## CLEANUP +cd .. +rm -rf mplayerplug-in diff --git a/recetas/mplayerplug-in/mplayerplug-in-3.31.tar.bz2 b/recetas/mplayerplug-in/mplayerplug-in-3.31.tar.bz2 new file mode 100644 index 0000000..de0ff57 Binary files /dev/null and b/recetas/mplayerplug-in/mplayerplug-in-3.31.tar.bz2 differ diff --git a/recetas/mplayerplug-in/mplayerplug-in-3.31.tar.gz b/recetas/mplayerplug-in/mplayerplug-in-3.31.tar.gz new file mode 100644 index 0000000..a628e26 Binary files /dev/null and b/recetas/mplayerplug-in/mplayerplug-in-3.31.tar.gz differ diff --git a/recetas/seamonkey/seamonkey-1.1.1-build.sh b/recetas/seamonkey/seamonkey-1.1.1-build.sh new file mode 100644 index 0000000..1b9a07d --- /dev/null +++ b/recetas/seamonkey/seamonkey-1.1.1-build.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +## Untar +tar xvf seamonkey-1.1.1.source.tar.bz2 +mkdir mozilla + +## Config +cat > .mozconfig << "EOF" +mk_add_options MOZ_CO_PROJECT=suite +mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/suite-opt +ac_add_options --enable-application=suite +ac_add_options --enable-debug +ac_add_options --disable-tests +ac_add_options --prefix=/usr +ac_add_options --with-system-zlib +ac_add_options --with-system-png +ac_add_options --with-system-jpeg +ac_add_options --disable-installer +ac_add_options --enable-svg +ac_add_options --disable-mailnews +ac_add_options --disable-ldap + +ac_add_options --enable-default-toolkit=gtk2 +ac_add_options --enable-xft + +EOF + +## BUILD +make -f client.mk build || exit -1 + +## INSTALL +mkdir dest +make DESTDIR=$(pwd)/dest -f client.mk install || exit -1 +install -v -m755 -d dest/usr/include/seamonkey-1.1.1/nss + +## PKG +cd dest +tar cjvfp ../../ +cd cd .. + +## CLEANUP +cd .. +rm -rf mozilla + diff --git a/recetas/seamonkey/seamonkey-1.1.1.source.tar.bz2 b/recetas/seamonkey/seamonkey-1.1.1.source.tar.bz2 new file mode 100644 index 0000000..84be19c Binary files /dev/null and b/recetas/seamonkey/seamonkey-1.1.1.source.tar.bz2 differ diff --git a/recetas/seamonkey/seamonkey-1.1.1.tar.bz2 b/recetas/seamonkey/seamonkey-1.1.1.tar.bz2 new file mode 100644 index 0000000..f2426bb Binary files /dev/null and b/recetas/seamonkey/seamonkey-1.1.1.tar.bz2 differ