--- kcc-2.3.orig/Makefile +++ kcc-2.3/Makefile @@ -16,6 +16,8 @@ CP = cp MAKE = make INSTALL = install + INSTALL_PROGRAM = $(INSTALL) -s + INSTALL_FILE = $(INSTALL) -m 644 CMDS = kcc SRCS = kcc.c @@ -34,10 +36,10 @@ $(BINPATH)/kcc: kcc.c $(MAKE) kcc - $(INSTALL) -s kcc $(BINPATH) + $(INSTALL_PROGRAM) kcc $(BINPATH) $(MANPATH)/$(JMANDIR)/man1/kcc.1: kcc.jman - $(INSTALL) -m 644 kcc.jman $@ + $(INSTALL_FILE) kcc.jman $@ clean: rm -f $(CMDS) $(OBJS) mon.out gmon.out make.log --- kcc-2.3.orig/debian/README.Debian +++ kcc-2.3/debian/README.Debian @@ -0,0 +1,7 @@ +kcc for Debian +---------------------- + +kanji code echanger with code auto recognition + + Araki Yasuhiro , Fri, 13 Nov 1998 16:36:06 +0900 + -- Fumitoshi UKAI , Mon, 23 Aug 1999 01:21:19 +0900 --- kcc-2.3.orig/debian/TODO +++ kcc-2.3/debian/TODO @@ -0,0 +1 @@ +English manpages --- kcc-2.3.orig/debian/changelog +++ kcc-2.3/debian/changelog @@ -0,0 +1,92 @@ +kcc (2.3-12.1) unstable; urgency=medium + + * Non-maintainer upload. + * Update DH level to 9 to avoid a FTBFS. (Closes: #800251) + * debian/compat: created. + * debian/control: + - Added the ${misc:Depends} to variable to provide the + right install dependencies. + - Bumped Standards-Version to 3.9.6. + * debian/rules: + - Changed the install to put the final files in right + place. + - Disable the dh_suidregister line. Thanks to Niels + Thykier (Closes: #785389) + + -- Raphael Mota Ramos Wed, 30 Dec 2015 20:46:10 -0200 + +kcc (2.3-12) unstable; urgency=low + + * kcc.1: fix typo in manual page. (Thanks Rodrigo F. Baroni) + + -- ARAKI Yasuhiro Mon, 29 Nov 2004 12:21:18 +0900 + +kcc (2.3-11) unstable; urgency=low + + * kcc.c: fix for vargsgs.h to stdarg.h. Thanks to Matt Kraai . (Closes: #194937) + + -- ARAKI Yasuhiro Mon, 16 Jun 2003 13:53:40 +0900 + +kcc (2.3-10) unstable; urgency=low + + * upgrade policy -> 3.5.4 + + -- Fumitoshi UKAI Mon, 7 May 2001 23:10:38 +0900 + +kcc (2.3-9) unstable; urgency=low + + * add english manual + + -- Fumitoshi UKAI Sat, 16 Oct 1999 03:09:12 +0900 + +kcc (2.3-8) unstable; urgency=low + + * fix lintian error and warnings: /usr/doc -> /usr/share/doc + + -- Fumitoshi UKAI Wed, 13 Oct 1999 02:44:57 +0000 + +kcc (2.3-7) unstable; urgency=low + + * Initial Debian Release (from JP archives) + + -- Fumitoshi UKAI Mon, 23 Aug 1999 01:47:58 +0900 + +kcc (2.3-6) unstable frozen; urgency=low + + * fsf address fix + * fix lintian + + -- Araki Yasuhiro Fri, 13 Nov 1998 16:37:20 +0900 + +kcc (2.3-5) unstable; urgency=low + + * fix maintainer name in debian/control + + -- Araki Yasuhiro Sat, 31 Oct 1998 21:43:31 +0900 + +kcc (2.3-4) unstable; urgency=low + + * fix japanese manual install directory + + -- Araki Yasuhiro Wed, 23 Sep 1998 23:06:55 +0900 + +kcc (2.3-3) unstable; urgency=low + + * libc6 release + * maintainer change to yasu@debian.or.jp + + -- Araki Yasuhiro Mon, 1 Jun 1998 17:38:00 +0900 + +kcc (2.3-2) unstable; urgency=low + + * ja_JP.EUC/man1/kcc.1 -> ja_JP.ujis/man1/kcc.1 + + -- takeshi Thu, 24 Jul 1997 20:32:14 +0900 + +kcc (2.3-1) unstable; urgency=low + + * Initial Release. + + -- takeshi Tue, 29 Apr 1997 23:07:34 +0900 + + --- kcc-2.3.orig/debian/compat +++ kcc-2.3/debian/compat @@ -0,0 +1 @@ +9 --- kcc-2.3.orig/debian/control +++ kcc-2.3/debian/control @@ -0,0 +1,17 @@ +Source: kcc +Section: text +Priority: extra +Maintainer: Araki Yasuhiro +Standards-Version: 3.9.6 +Build-Depends: debhelper (>= 9) + +Package: kcc +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Kanji code filter + kcc can converts various Japanese encodings such as EUC-JP, + 7bitJIS, 8bitJIS and ShiftJIS with Half-width Kana supports. + kcc can detect these encoding automatically as much as possible. + . + Sponsored by Fumitoshi UKAI + --- kcc-2.3.orig/debian/copyright +++ kcc-2.3/debian/copyright @@ -0,0 +1,23 @@ +This package was debianized by Fumitoshi UKAI on +Mon, 23 Aug 1999 01:21:19 +0900. + +Upstream Author: Yasuhiro Tonooka (tonooka@msi.co.jp) + +Copyright: + + This package 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; version 2 dated June, 1991. + + This package 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 package; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. --- kcc-2.3.orig/debian/dirs +++ kcc-2.3/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/share/man/ja/man1 --- kcc-2.3.orig/debian/docs +++ kcc-2.3/debian/docs @@ -0,0 +1 @@ +README --- kcc-2.3.orig/debian/kcc.1 +++ kcc-2.3/debian/kcc.1 @@ -0,0 +1,335 @@ +.\"-- << kanji code converter >> ---- +.\" +.\" kcc.jman +.\" Aug 24 1992 +.\" mod: Nov 19 1992 +.\" translated: Oct 15 1999 +.\"------------------------------------------------ tonooka ------------ +.\" @(#)kcc.jman 2.1 (Y.Tonooka) 9/6/93 +.TH KCC L "November 19, 1992" "Y. Tonooka" +.SH NAME +kcc \- Kanji code coverter with encoding auto detection +.SH SYNOPSIS +.B kcc +[ +.BI \- IO chnvxz +] [ +.BI \-b " bufsize" +] +.RI [ " file " "] .\|.\|." +.SH DESCRIPTION +.B kcc +is a filter that reads +.I file +sequencially, converts kanji encodings and output to stdout. +If no file is specified, or specified +.B \- +as filename, it read from stdin. +You can specify kanji encodings for input/output. However, +.B kcc +detect input encodig automatically, if you don't specify input encoding. +.LP +Available kanji encodings are +.SM JIS (7 bit and/or 8 bit), Shift +.SM JIS\s0\s-1EUC\s0\s-1DEC\s0. +For input encoding, you can mix when these are pair of one of \s-1EUC\s0 +\s-1DEC\s0 or Shift +.SM JIS +and 7 bit +.SM JIS. +.BR \s-1SI\s0 / \s-1SO\s0 \s-1ESC\s0(I +are recognized as halfwidth of \s-1JIS\s0. +.SH OPTIONS +.TP +.BI \- O +.PD 0 +.TP +.BI \- IO +.IR I " for input kanji encodingĄ¤" O +for output kanji encoding. When no input encoding specified, +it will be detected automatically, and if both of input/output +aren't specified, output encoding is 7 bit +.SM JIS. +.PD +.IP +You can specify one of the followings for the input encoding option, +.I I. +.LP +.RS 10 +.PD 0 +.TP +.B e +.SM EUC\s0(available with 7 bit +.SM JIS +) +.TP +.B d +.SM DEC\s0(available with 7 bit +.SM JIS +) +.TP +.B s +Shift +.SM JIS\s0(available with 7 bit +.SM JIS +) +.TP +.BR j 7 " or " k +7 bit +.SM JIS +.TP +.B 8 +8 bit +.SM JIS +.PD +.RE +.IP +You can specify one of the followings for output encoding option, +.I O. +.LP +.RS 10 +.PD 0 +.TP +.B e +.SM EUC +.TP +.B d +.SM DEC +.TP +.B s +Shift +.SM JIS +.TP +.BR j\fIXY " or " 7\fIXY +7 bit +.RB \s-1JIS\s0(using \s-1SI\s0 / \s-1SO\s0 +for +.SM JIS +kana designation) +.TP +.BI k XY +7 bit +.RB \s-1JIS\s0(using \s-1ESC\s0(I +for +.SM JIS +kana designation) +.TP +.BI 8 XY +8 bit +.SM JIS +.PD +.RE +.IP +By +.I XY +in +.I O +option, +You can specify which escape sequence used in \s-1JIS\s0 encoding. +.B BJ +is default. Supplimental kanji designation is fixed to +.B \s-1ESC\s0$(D +.LP +.RS 10 +.PD 0 +.TP +.I X +Kanji is designated by: +.RS 5 +.TP +.B B +.BR \s-1ESC\s0$B "(JIS X0208-1983) +.TP +.B @ +.BR \s-1ESC\s0$@ "(JIS X0208-1978) +.TP +.B + +.BR \s-1ESC\s0&@\s-1ESC\s0$B "(JIS X0212-1990) +.RE +.TP +.I Y +Alpha Numerical is designated by: +.RS 5 +.TP +.B B +.BR \s-1ESC\s0(B "(ASCII) +.TP +.B J +.BR \s-1ESC\s0(J "(JIS Roman; JIS X0201) +.TP +.B H +.BR \s-1ESC\s0(H "(Swedish; strongly deprecated) +.PD +.RE +.RE +.TP +.B \-v +outputs result of input encoding detection to stderr. +.TP +.B \-x +Extension mode. By auto detection of input encodings, recognize +user-defined characters and extended character region ( +out of range of \s-1EUC\s0, undefined halfwidth kana, control character, +.SM C1 +area and/or extended character region Shift +.SM C1 +.SM JIS +). Distinguish between \s-1DEC\s0 and +.SM EUC +is done in this mode. +.TP +.B \-z +Shrink mode. Don't recognize halfwidth kana (except 7 bit +.SM JIS +) with input encoding detection. +With this option, accuracy of auto detection of input encodings becomes +much better for file without halfwidth kana. +.TP +.B \-h +Normally, When converted halfwidth kana to +.SM DEC +, it becomes fullwidth Katakana. With this option, it becomes Hiragana. +.TP +.B \-n +user-defined characters, extended characters and supplimental kanji +characters areconverted to fullwidth white box, and undefined region of +halfwidth kana are converted to halfwidth centered dot. +.TP +.BI \-b " bufsize" +specify buffer size. 8kbytes is default. +.TP +.B \-c +don't convert but check input encoding and print result to stdout. +Different with normal auto-detection, whole contents of file is checked. +However, when inconsistency of encodings is found, abort reading and print +"data". Options except \fB\-x\fRĄ¤\fB\-z\fR are ignored. +.SH EXAMPLES +.IP "\fB% kcc \-e \fIfile" +Input encoding are detect automatically, and output is in +.SM EUC +encoding. +.IP "\fB% kcc \-sj \fIfile1 file2" +Two files in Shift +.SM JIS +concatinated with converting to +.SM JIS. +.IP "\fB% \fIcommand\fB | kcc \-k+J" +output of +.I command are converted to +.SM JIS\s0(\s-1JIS\s0 JIS X0208 +\s-1JIS\s0 JIS RomanĄ¤\fB\s-1ESC\s0(I\fR Halfwidth Kana +.SM JIS +) +.IP "\fB% kcc \-c \fIfile" +Encoding of contents of +.I file +is detected(no conversion) +.SH BUG +Auto detection of input encoding is well done for normal case, however, +it has the following problems. +.LP +7 bit +.SM JIS +is recognized by escape sequence in certain. +\s-1EUC\s0 and +.SM DEC +are the same (refered as +.SM EUC +series). Halfwidth kana of 8 bit +.SM JIS +is the same as halfwidth kana of Shift +.SM JIS +(refered as Shift +.SM JIS +series). However, +.SM EUC +series and +.SM JIS +, which are both 8 bit encoding, are sharing the same regions widely. +So, the problem in auto detection is detection of these 2 encodings. +.LP +Detection of +.SM EUC +series/Shift +.SM JIS +series is done in line by line, When it is found that it's not Shift +.SM JIS +series, or it's not \s-1EUC\s0 series, encoding is determined. +When inconsistensy found, it will be treated as "data" and +contents of output is not guaranteed. +.LP +While determined between +.SM EUC +series/Shift +.SM JIS +series after 8bit code found, conversions are pending and put input +data in buffer, however, buffer is fulled, it assumes it's +.SM EUC +series and forces to start conversion. Rationale. Usually, we can +assume that documents with kanji include +.SM JIS +non-kanji or +.SM JIS +first standard, it can be detected in certain if it is Shift +.SM JIS +, which does not share region with +.SM EUC. +So if it can't be determined, it's very likely to be +.SM EUC. +.LP +8 bit +.SM JIS +and it has always even number of halfwidth kana sequences, then +it will be wrongly detected as \s-1EUC\s0 kanji. Be ceraful. +.LP +If input encoding doesn't have halfwidth kana, use +.B \-z +and accuracy of detection become much better. +This is because shared region are restricted to area of +.SM JIS +second standards. +.LP +Extended region of +Shift +.SM JIS +user-defined area of \s-1EUC\s0, control characters +.SM C1 +of \s-1EUC\s0, undefined region of halfwidth kana of \s-1EUC\s0 +are out of range of auto detection, so it will fails to detect +encodings if input has these characters. Use +.B \-x +option to specify extended mode, or specify input code. +.SH "SEE ALSO" +.BR cat (1) +.SH NOTES +Usually, user-defined characters, extended characters, supplimental kanji +characters are mapped respectively. However characters that is +out of range of extended characters become FCFC in hexadecimal when +converted to Shift +.SM JIS. +Although control character region +.SM C1 +of +\s-1EUC\s0 and +.SM DEC +remains when converted to +.SM JIS +, these will be deleted when converted to Shift +.SM JIS +Undefined area of halfwidth kana become halfwidth centered dot +when convered to Shift +.SM JIS +Halfwidth kana become fullwidth kana when converted to +.SM DEC. +.LP +When output is +.SM JIS +encoding, control characters such as newline, TAB, DEL and white space +(halfwidth) will be output in ASCII mode. +.LP +When encoding of input is detected wrongly, or input undefined +character for expected character sets, output is indefined. +.LP +This manual are translated by Fumitoshi UKAI +for Debian system, but you can use it for any purpose. + --- kcc-2.3.orig/debian/rules +++ kcc-2.3/debian/rules @@ -0,0 +1,94 @@ +#!/usr/bin/make -f +#-*- makefile -*- +# Made with the aid of dh_make, by Craig Small +# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. +# Some lines taken from debmake, by Christoph Lameter. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +CFLAGS = -O2 -Wall +INSTALL = install +INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644 +INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755 +INSTALL_SCRIPT = $(INSTALL) -p -o root -g root -m 755 +INSTALL_DIR = $(INSTALL) -p -d -o root -g root -m 755 + +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) +CFLAGS += -g +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) +INSTALL_PROGRAM += -s +endif + +build: build-stamp +build-stamp: + dh_testdir + + # Add here commands to compile the package. + $(MAKE) CFLAGS="$(CFLAGS)" + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp install-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) clean + + dh_clean + +install: install-stamp +install-stamp: build-stamp + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/tmp. + $(MAKE) install BINPATH=`pwd`/debian/kcc/usr/bin \ + INSTALL="$(INSTALL)" INSTALL_PROGRAM="$(INSTALL_PROGRAM)" + $(MAKE) install.man MANPATH=`pwd`/debian/kcc/usr/share/man \ + JMANDIR=ja \ + INSTALL="$(INSTALL)" INSTALL_FILE="$(INSTALL_FILE)" + touch install-stamp + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install +# dh_testversion + dh_testdir + dh_testroot + dh_installdocs + dh_installexamples + dh_installmenu +# dh_installemacsen +# dh_installinit + dh_installcron + dh_installman debian/kcc.1 +# dh_undocumented + dh_installchangelogs + dh_link + dh_strip + dh_compress + dh_fixperms + # You may want to make some executables suid here +# dh_suidregister +# dh_makeshlibs + dh_installdeb +# dh_perl + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary --- kcc-2.3.orig/kcc.c +++ kcc-2.3/kcc.c @@ -134,7 +134,7 @@ extern unsigned short hiragana[]; unsigned short *kanatbl = katakana; -void error(); +void error(char *fmt, ...); /********************************************************************** * * @@ -364,16 +364,15 @@ NAME error - print formatted error message on stderr and die ---------------------------------------------------------------------*/ -#include +#include -void error(va_alist) - va_dcl +void error(char *fmt, ...) { va_list args; - va_start(args); + va_start(args, fmt); fprintf(stderr, "%s: ", progname); - vfprintf(stderr, va_arg(args, char *), args); + vfprintf(stderr, fmt, args); putc('\n', stderr); va_end(args); exit(1);