├── .editorconfig ├── .gitignore ├── GPL.txt ├── Makefile.am ├── Makefile.in ├── README ├── README.md ├── aclocal.m4 ├── build └── README.txt ├── compile ├── config.guess ├── config.sub ├── configure ├── configure.ac ├── debian ├── README.Debian ├── autoreconf ├── changelog ├── compat ├── control ├── copyright ├── dirs ├── docs ├── lv.doc-base ├── patches │ ├── 20050502_~+num-pat-option.diff │ ├── 20050506_%src%file.c_~enable-fastio-use-fread.2.diff │ ├── 20051030_%src%_~use_off_t.diff │ ├── bts.660358.diff │ ├── fix-hyphen-used-as-minus-sign.diff │ ├── misc.diff │ ├── series │ └── sigvec.patch ├── postinst ├── prerm ├── rules ├── source │ └── format └── watch ├── depcomp ├── hello.sample ├── hello.sample.gif ├── index.html ├── install-sh ├── lv.1 ├── lv.hlp ├── missing ├── relnote.html ├── scripts └── package.bat └── src ├── Makefile.am ├── Makefile.dos ├── Makefile.in ├── Makefile.mingw ├── Makefile.msvc ├── ascii.h ├── attr.h ├── begin.h ├── big5.c ├── big5.h ├── big5.map ├── big5.rev ├── big5cns.map ├── big5cns.pl ├── boolean.h ├── command.c ├── command.h ├── conf.c ├── conf.h ├── console.c ├── console.h ├── conv.c ├── conv.h ├── ctable.c ├── ctable.h ├── ctable_e.h ├── ctable_t.h ├── d2u.pl ├── d2uall.sh ├── decode.c ├── decode.h ├── dfa.c ├── dfa.h ├── display.c ├── display.h ├── encode.c ├── encode.h ├── escape.c ├── escape.h ├── eucjapan.c ├── eucjapan.h ├── fetch.c ├── fetch.h ├── file.c ├── file.h ├── find.c ├── find.h ├── gb2312.map ├── gb2312.rev ├── guess.c ├── guess.h ├── guesslocale.c ├── guesslocale.h ├── hz.c ├── hz.h ├── ichar.h ├── import.h ├── iscygpty.c ├── iscygpty.h ├── iso2022.c ├── iso2022.h ├── iso2cn.c ├── iso2cn.h ├── iso2jp.c ├── iso2jp.h ├── iso2kr.c ├── iso2kr.h ├── iso8859.c ├── iso8859.h ├── iso885910.map ├── iso885910.rev ├── iso885911.map ├── iso885911.rev ├── iso885913.map ├── iso885913.rev ├── iso885914.map ├── iso885914.rev ├── iso885915.map ├── iso885915.rev ├── iso885916.map ├── iso885916.rev ├── iso88592.map ├── iso88592.rev ├── iso88593.map ├── iso88593.rev ├── iso88594.map ├── iso88594.rev ├── iso88595.map ├── iso88595.rev ├── iso88596.map ├── iso88596.rev ├── iso88597.map ├── iso88597.rev ├── iso88598.map ├── iso88598.rev ├── iso88599.map ├── iso88599.rev ├── istr.c ├── istr.h ├── itable.c ├── itable.h ├── itable_e.h ├── itable_t.h ├── jis.map ├── jis0208.rev ├── jis0212.rev ├── kana.c ├── kana.h ├── keybind.h ├── ksc5601.map ├── ksc5601.rev ├── lv.c ├── map8859.pl ├── mapbig5.pl ├── mapgb.pl ├── mapjis.pl ├── mapksc.pl ├── nfa.c ├── nfa.h ├── position.h ├── raw.c ├── raw.h ├── re.c ├── re.h ├── rev0208.pl ├── rev0212.pl ├── rev8859.pl ├── revbig5.pl ├── revgb.pl ├── revksc.pl ├── screen.c ├── screen.h ├── shiftjis.c ├── shiftjis.h ├── str.h ├── stream.c ├── stream.h ├── unimap.c ├── unimap.h ├── unirev.c ├── unirev.h ├── utf.c ├── utf.h ├── uty.c ├── uty.h ├── version.c └── version.h /.editorconfig: -------------------------------------------------------------------------------- 1 | ; see: http://editorconfig.org/ 2 | 3 | root = true 4 | 5 | [*] 6 | end_of_line = lf 7 | insert_final_newline = true 8 | trim_trailing_whitespace = true 9 | 10 | [**.[ch]] 11 | indent_style = tab 12 | indent_size = 2 13 | tab_width = 8 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /build/* 2 | !/build/README.txt 3 | 4 | .* 5 | *.bak 6 | *~ 7 | *.swp 8 | *.orig 9 | *.rej 10 | 11 | *.o 12 | *.obj 13 | *.exe 14 | *.pdb 15 | 16 | autom4te.cache 17 | 18 | !.gitignore 19 | !.editorconfig 20 | 21 | TAGS 22 | tags 23 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # Makefile for lv 3 | ######################################################################## 4 | 5 | lvlibdir= $(libdir)/lv 6 | 7 | SUBDIRS = src 8 | 9 | man1_MANS = lv.1 10 | 11 | EXTRA_DIST = .editorconfig .gitignore GPL.txt hello.sample hello.sample.gif \ 12 | index.html lv.1 lv.hlp README.md relnote.html build/README.txt 13 | 14 | EXTRA_DIST += src/Makefile.dos src/Makefile.mingw src/Makefile.msvc 15 | 16 | EXTRA_DIST += \ 17 | src/big5.map \ 18 | src/big5.rev \ 19 | src/big5cns.map \ 20 | src/big5cns.pl \ 21 | src/d2u.pl \ 22 | src/d2uall.sh \ 23 | src/gb2312.map \ 24 | src/gb2312.rev \ 25 | src/iso885910.map \ 26 | src/iso885910.rev \ 27 | src/iso885911.map \ 28 | src/iso885911.rev \ 29 | src/iso885913.map \ 30 | src/iso885913.rev \ 31 | src/iso885914.map \ 32 | src/iso885914.rev \ 33 | src/iso885915.map \ 34 | src/iso885915.rev \ 35 | src/iso885916.map \ 36 | src/iso885916.rev \ 37 | src/iso88592.map \ 38 | src/iso88592.rev \ 39 | src/iso88593.map \ 40 | src/iso88593.rev \ 41 | src/iso88594.map \ 42 | src/iso88594.rev \ 43 | src/iso88595.map \ 44 | src/iso88595.rev \ 45 | src/iso88596.map \ 46 | src/iso88596.rev \ 47 | src/iso88597.map \ 48 | src/iso88597.rev \ 49 | src/iso88598.map \ 50 | src/iso88598.rev \ 51 | src/iso88599.map \ 52 | src/iso88599.rev \ 53 | src/jis.map \ 54 | src/jis0208.rev \ 55 | src/jis0212.rev \ 56 | src/ksc5601.map \ 57 | src/ksc5601.rev \ 58 | src/map8859.pl \ 59 | src/mapbig5.pl \ 60 | src/mapgb.pl \ 61 | src/mapjis.pl \ 62 | src/mapksc.pl \ 63 | src/rev0208.pl \ 64 | src/rev0212.pl \ 65 | src/rev8859.pl \ 66 | src/revbig5.pl \ 67 | src/revgb.pl \ 68 | src/revksc.pl 69 | 70 | $(srcdir)/lv.hlp: $(srcdir)/lv.1 71 | nroff -c -mandoc $< > $@ 72 | 73 | install-exec-hook: 74 | if test -f $(DESTDIR)$(bindir)/lgrep$(EXEEXT); then \ 75 | /bin/rm -f $(DESTDIR)$(bindir)/lgrep$(EXEEXT); \ 76 | fi 77 | (cd $(DESTDIR)$(bindir) && \ 78 | $(LN_S) lv$(EXEEXT) lgrep$(EXEEXT)) 79 | if test ! -d $(DESTDIR)$(lvlibdir); then \ 80 | mkdir -p $(DESTDIR)$(lvlibdir); \ 81 | fi 82 | $(INSTALL) -m 444 $(srcdir)/lv.hlp $(DESTDIR)$(lvlibdir) 83 | 84 | uninstall-hook: 85 | (cd $(DESTDIR)$(bindir) && \ 86 | /bin/rm -f lgrep$(EXEEXT)) 87 | (cd $(DESTDIR)$(lvlibdir) && \ 88 | /bin/rm -f lv.hlp) 89 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | 3 | Documentation of lv is provided on the web. See the following URL: 4 | 5 | http://www.ff.iij4u.or.jp/~nrt/lv/ 6 | 7 | ------------------------------------------------------------------------------ 8 | 9 | All rights reserved. Copyright (C) 1996-2005 by NARITA Tomio. 10 | 11 | This program is free software; you can redistribute it and/or modify 12 | it under the terms of the GNU General Public License as published by 13 | the Free Software Foundation; either version 2 of the License, or 14 | (at your option) any later version. 15 | 16 | This program is distributed in the hope that it will be useful, 17 | but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | GNU General Public License for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with this program; if not, write to the Free Software 23 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | 25 | See also GNU General Public License Version 2, included in this 26 | archive as GPL.txt. 27 | 28 | ------------------------------------------------------------------------------ 29 | 30 | INSTALLATION: 31 | 32 | 0) Expand lv archive, using gunzip/tar. 33 | 1) Change your working directory to ``(extracted sub directory)/build''. 34 | 2) Execute ``../src/configure'' to configure compiler flags. 35 | 3) Launch ``make''. 36 | 4) Then, launch ``make install'' as root. 37 | 38 | ------------------------------------------------------------------------------ 39 | NARITA Tomio 40 | email: nrt@ff.iij4u.or.jp 41 | Homepage: http://www.ff.iij4u.or.jp/~nrt/ 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | lv-mod 2 | ====== 3 | 4 | Modified version of lv v.4.51 5 | 6 | https://github.com/k-takata/lv-mod 7 | -------------------------------------------------------------------------------- /build/README.txt: -------------------------------------------------------------------------------- 1 | INSTALLATION: 2 | 3 | 1. ../configure 4 | 2. make 5 | 3. make install # as root 6 | 7 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | # Process this file with autoconf to produce a configure script. 3 | 4 | AC_PREREQ([2.68]) 5 | 6 | AC_INIT(lv, 4.51) 7 | AC_CONFIG_SRCDIR([src/lv.c]) 8 | 9 | AC_CANONICAL_BUILD 10 | AC_CANONICAL_HOST 11 | 12 | #AX_ENABLE_BUILDDIR 13 | AM_INIT_AUTOMAKE([foreign]) 14 | 15 | # Checks for programs. 16 | AC_PROG_LN_S 17 | AC_PROG_CC 18 | AC_PROG_INSTALL 19 | AC_PROG_CPP 20 | AC_PROG_MAKE_SET 21 | AC_PATH_PROGS(PERL, perl perl4 perl5) 22 | 23 | AC_MSG_CHECKING(if --enable-purify is specified) 24 | AC_SUBST(PURIFY) 25 | PURIFY= 26 | AC_ARG_ENABLE(purify, 27 | [AS_HELP_STRING([--enable-purify], [enables checks by purify])], 28 | [AC_MSG_RESULT(yes) 29 | AC_PATH_PROGS(PURIFY, purify, "") 30 | if test "$PURIFY" != ""; then 31 | PURIFY="$PURIFY purecov" 32 | fi], 33 | [AC_MSG_RESULT(no)]) 34 | 35 | # Checks host type 36 | case "$host" in 37 | i?86-win32* | i?86-*-mingw* | x86_64-*-mingw*) 38 | host_mingw=yes 39 | ;; 40 | *) 41 | AC_DEFINE(UNIX) 42 | AC_DEFINE(TERMCAP) 43 | ;; 44 | esac 45 | 46 | AM_CONDITIONAL([MINGW], [test x$host_mingw = xyes]) 47 | 48 | # Checks for libraries. 49 | AC_CHECK_LIB(terminfo, tgetstr,, [AC_CHECK_LIB(termcap, tgetstr,, [AC_CHECK_LIB(ncurses, tgetstr,, [AC_CHECK_LIB(curses, tgetstr)])])]) 50 | 51 | # Checks for header files. 52 | AC_HEADER_STDC 53 | AC_HEADER_SYS_WAIT 54 | AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h termio.h unistd.h termios.h locale.h) 55 | 56 | # Checks for typedefs, structures, and compiler characteristics. 57 | 58 | # Checks for library functions. 59 | AC_CHECK_FUNCS(sigaction tgetnum setlocale) 60 | AC_FUNC_GETPGRP 61 | AC_PROG_GCC_TRADITIONAL 62 | AC_TYPE_SIGNAL 63 | 64 | # From Bruno Haible. 65 | 66 | AC_DEFUN([AM_LANGINFO_CODESET], 67 | [ 68 | AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, 69 | [AC_TRY_LINK([#include ], 70 | [char* cs = nl_langinfo(CODESET);], 71 | am_cv_langinfo_codeset=yes, 72 | am_cv_langinfo_codeset=no) 73 | ]) 74 | if test $am_cv_langinfo_codeset = yes; then 75 | AC_DEFINE(HAVE_LANGINFO_CODESET, 1, 76 | [Define if you have and nl_langinfo(CODESET).]) 77 | fi 78 | ]) 79 | 80 | AM_LANGINFO_CODESET 81 | 82 | # Checks for largefile support 83 | AC_SYS_LARGEFILE 84 | AC_FUNC_FSEEKO 85 | 86 | AC_MSG_CHECKING(whether fastio is used) 87 | AC_ARG_ENABLE(fastio, 88 | [AS_HELP_STRING([--enable-fastio], [tries to reduce stdio overhead])], 89 | [if ! test "$enableval" = no; then 90 | AC_DEFINE(USE_INTERNAL_IOBUF, 1) 91 | AC_MSG_RESULT(yes) 92 | else 93 | AC_MSG_RESULT(no) 94 | fi], 95 | [AC_MSG_RESULT(no)]) 96 | 97 | AC_CONFIG_FILES([Makefile 98 | src/Makefile]) 99 | AC_OUTPUT 100 | -------------------------------------------------------------------------------- /debian/README.Debian: -------------------------------------------------------------------------------- 1 | lv for Debian 2 | ---------------------- 3 | 4 | 5 | -- GOTO Masanori , Sun, 29 Aug 1999 17:51:13 +0900 6 | -------------------------------------------------------------------------------- /debian/autoreconf: -------------------------------------------------------------------------------- 1 | src 2 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: lv 2 | Section: text 3 | Priority: optional 4 | Maintainer: GOTO Masanori 5 | Build-Depends: debhelper (>= 9), libncurses5-dev, dh-autoreconf 6 | Standards-Version: 3.9.6 7 | Homepage: http://www.ff.iij4u.or.jp/~nrt/lv/ 8 | Vcs-Git: git://anonscm.debian.org/collab-maint/lv.git 9 | Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/lv.git 10 | 11 | Package: lv 12 | Architecture: any 13 | Depends: ${shlibs:Depends}, ${misc:Depends} 14 | Recommends: bzip2, xz-utils 15 | Description: Powerful Multilingual File Viewer 16 | lv is a powerful file viewer like less. 17 | lv can decode and encode multilingual streams through 18 | many coding systems: 19 | ISO-8859, ISO-2022, EUC, SJIS, Big5, HZ, Unicode. 20 | . 21 | It recognizes multi-bytes patterns as regular 22 | expressions, lv also provides multilingual grep. 23 | In addition, lv can recognize ANSI escape sequences 24 | for text decoration. 25 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: lv 3 | Source: http://www.ff.iij4u.or.jp/~nrt/lv/ 4 | 5 | Files: * 6 | Copyright: 1996-2004 by NARITA Tomio. 7 | License: GPL-2 8 | All rights reserved. Copyright (C) 1996-2004 by NARITA Tomio. 9 | . 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation; either version 2 of the License, or 13 | (at your option) any later version. 14 | . 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | . 20 | You should have received a copy of the GNU General Public License 21 | along with this program; if not, write to the Free Software 22 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 23 | . 24 | See also GNU General Public License Version 2, included in this 25 | archive as GPL.txt. 26 | . 27 | On Debian systems, the full text of the GNU General Public License version 2 28 | can be found in the file `/usr/share/common-licenses/GPL-2'. 29 | 30 | Files: debian/* 31 | Copyright: 1999 GOTO Masanori 32 | 2014 HIGUCHI Daisuke (VDR dai) 33 | License: GPL-2 34 | This program is free software; you can redistribute it and/or modify it under 35 | the terms of the GNU General Public License as published by the Free Software 36 | Foundation; either version 2, or (at your option) any later version. 37 | . 38 | This program is distributed in the hope that it will be useful, but WITHOUT 39 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 40 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 41 | . 42 | You should have received a copy of the GNU General Public License along with 43 | this program. If not, see . 44 | . 45 | On Debian systems, the full text of the GNU General Public License version 2 46 | can be found in the file `/usr/share/common-licenses/GPL-2'. 47 | -------------------------------------------------------------------------------- /debian/dirs: -------------------------------------------------------------------------------- 1 | usr/bin 2 | usr/share/lv 3 | usr/share/man/man1 4 | usr/share/doc/lv 5 | -------------------------------------------------------------------------------- /debian/docs: -------------------------------------------------------------------------------- 1 | README 2 | index.html 3 | hello.sample 4 | hello.sample.gif 5 | relnote.html 6 | -------------------------------------------------------------------------------- /debian/lv.doc-base: -------------------------------------------------------------------------------- 1 | Document: lv 2 | Title: Documentation of Powerful Multilingual File Viewer 3 | Author: NARITA Tomio 4 | Section: Viewers 5 | 6 | Format: HTML 7 | Index: /usr/share/doc/lv/index.html 8 | Files: /usr/share/doc/lv/index.html 9 | /usr/share/doc/lv/relnote.html 10 | -------------------------------------------------------------------------------- /debian/patches/bts.660358.diff: -------------------------------------------------------------------------------- 1 | Description: support automatic xz and lzma decompression. 2 | Author: "A. N. Other" 3 | Last-Update: 2012-02-18 4 | 5 | --- a/src/stream.c 6 | +++ b/src/stream.c 7 | @@ -43,6 +43,8 @@ 8 | 9 | private byte *gz_filter = "zcat"; 10 | private byte *bz2_filter = "bzcat"; 11 | +private byte *lzma_filter = "lzcat"; 12 | +private byte *xz_filter = "xzcat"; 13 | 14 | private stream_t *StreamAlloc() 15 | { 16 | @@ -75,10 +77,14 @@ public stream_t *StreamOpen( byte *file ) 17 | filter = gz_filter; 18 | else if( !strcmp( "bz2", exts ) || !strcmp( "BZ2", exts ) ) 19 | filter = bz2_filter; 20 | + else if ( !strcmp( "lzma", exts ) ) 21 | + filter = lzma_filter; 22 | + else if ( !strcmp( "xz", exts ) ) 23 | + filter = xz_filter; 24 | } 25 | if( NULL != filter ){ 26 | /* 27 | - * zcat or bzcat 28 | + * zcat, bzcat etc. 29 | */ 30 | if( NULL == (st->fp = (FILE *)tmpfile()) ) 31 | perror( "temporary file" ), exit( -1 ); 32 | 33 | 34 | -------------------------------------------------------------------------------- /debian/patches/fix-hyphen-used-as-minus-sign.diff: -------------------------------------------------------------------------------- 1 | Description: fix hyphen-used-as-minus-sign 2 | Author: HIGUCHI Daisuke (VDR dai) 3 | Last-Update: 2014-03-20 4 | 5 | --- lv/lv.1.mod 2014-03-20 22:24:41.000000000 +0900 6 | +++ lv/lv.1 2014-03-20 22:25:46.272014803 +0900 7 | @@ -5,21 +5,21 @@ 8 | .B lv, lgrep 9 | .br 10 | .B lv 11 | --h 12 | +\-h 13 | .br 14 | .B lv 15 | --V 16 | +\-V 17 | .br 18 | .B lv 19 | -[-acdfgiklmnqsuvz] [+acdfgiklmnqsuvz] 20 | +[\-acdfgiklmnqsuvz] [+acdfgiklmnqsuvz] 21 | .br 22 | - [-A\fIcoding-system\fP] [-I\fIcoding-system\fP] [-K\fIcoding-system\fP] 23 | + [\-A\fIcoding-system\fP] [\-I\fIcoding-system\fP] [\-K\fIcoding-system\fP] 24 | .br 25 | - [-O\fIcoding-system\fP] [-P\fIcoding-system\fP] [-D\fIcoding-system\fP] 26 | + [\-O\fIcoding-system\fP] [\-P\fIcoding-system\fP] [\-D\fIcoding-system\fP] 27 | .br 28 | - [-Ss\fIseq\fP] [-Sr\fIseq\fP] [-Sb\fIseq\fP] [-Su\fIseq\fP] [-Sh\fIseq\fP] 29 | + [\-Ss\fIseq\fP] [\-Sr\fIseq\fP] [\-Sb\fIseq\fP] [\-Su\fIseq\fP] [\-Sh\fIseq\fP] 30 | .br 31 | - [-T\fInumber\fP] [-W\fIwidth\fP] [-H\fIheight\fP] [-E'\fIeditor'\fP] [-+] 32 | + [\-T\fInumber\fP] [\-W\fIwidth\fP] [\-H\fIheight\fP] [\-E'\fIeditor'\fP] [\-+] 33 | .br 34 | [+\fInumber\fP] [+/\fIgrep-pattern\fP] 35 | .br 36 | @@ -120,15 +120,15 @@ 37 | .br 38 | r: raw mode 39 | .IP "Examples:" 40 | --Il2: input coding system is iso-8859-2 41 | +\-Il2: input coding system is iso-8859-2 42 | .br 43 | --Ks: keyboard coding system is shift-jis 44 | +\-Ks: keyboard coding system is shift-jis 45 | .br 46 | --Oek: output coding system is euc-korea 47 | +\-Oek: output coding system is euc-korea 48 | .br 49 | --Ab: all coding systems are big5 50 | +\-Ab: all coding systems are big5 51 | .IP "Coding-system translations / Code-points conversions:" 52 | -iso-2022-cn, -jp, -kr can be converted into euc-china or -taiwan, 53 | +iso-2022-cn, \-jp, \-kr can be converted into euc-china or \-taiwan, 54 | euc-japan, euc-korea, respectively (and vice versa). 55 | shift-jis uses the same internal code-points 56 | as iso-2022-jp and euc-japan. 57 | @@ -153,7 +153,7 @@ 58 | .IP "-H<\fInumber\fP>" 59 | Screen height 60 | .IP "-E'<\fIeditor\fP>' (default 'vi -c %d')" 61 | -Editor name (default 'vi -c %d') 62 | +Editor name (default 'vi \-c %d') 63 | .br 64 | ``%d'' means the line number of current position in a file. 65 | .IP "-q" 66 | @@ -291,7 +291,7 @@ 67 | .IP "C-t:" 68 | Toggle HZ decoding mode 69 | .IP "v:" 70 | -Launch the editor defined by option -E 71 | +Launch the editor defined by option \-E 72 | .IP "C-g, =:" 73 | Show file information (filename, position, coding system) 74 | .IP "V:" 75 | -------------------------------------------------------------------------------- /debian/patches/series: -------------------------------------------------------------------------------- 1 | 20050502_~+num-pat-option.diff 2 | 20050506_%src%file.c_~enable-fastio-use-fread.2.diff 3 | misc.diff 4 | 20051030_%src%_~use_off_t.diff 5 | bts.660358.diff 6 | fix-hyphen-used-as-minus-sign.diff 7 | sigvec.patch 8 | -------------------------------------------------------------------------------- /debian/patches/sigvec.patch: -------------------------------------------------------------------------------- 1 | Description: replace sigvec usage 2 | Author: Florian Weimer 3 | Bug-Debian: https://bugs.debian.org/769546 4 | Last-Update: 2014-11-14 5 | 6 | There are plans to turn sigvec (an obsolete signal handling interface) 7 | into a compatibility symbol. Existing builds will continue to work, but 8 | new builds will need the attached patch, courtesy of Roland McGrath 9 | . See this discussion for more information: 10 | 11 | 12 | 13 | Could apply this patch to the Debian package to make it more 14 | future-proof, please? 15 | 16 | -- 17 | Florian Weimer / Red Hat Product Security 18 | 19 | --- lv/src/configure.in.~1~ 2004-01-04 22:35:44.000000000 -0800 20 | +++ lv/src/configure.in 2014-10-09 11:14:47.782210631 -0700 21 | @@ -34,7 +34,7 @@ AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys 22 | dnl Checks for typedefs, structures, and compiler characteristics. 23 | 24 | dnl Checks for library functions. 25 | -AC_CHECK_FUNCS(sigvec tgetnum setlocale) 26 | +AC_CHECK_FUNCS(sigaction tgetnum setlocale) 27 | AC_FUNC_GETPGRP 28 | AC_PROG_GCC_TRADITIONAL 29 | AC_TYPE_SIGNAL 30 | --- lv/src/console.c.~1~ 2004-01-04 23:27:46.000000000 -0800 31 | +++ lv/src/console.c 2014-10-09 11:16:59.627943378 -0700 32 | @@ -158,9 +158,9 @@ private RETSIGTYPE InterruptHandler( int 33 | { 34 | kb_interrupted = TRUE; 35 | 36 | -#ifndef HAVE_SIGVEC 37 | +#ifndef HAVE_SIGACTION 38 | signal( SIGINT, InterruptHandler ); 39 | -#endif /* HAVE_SIGVEC */ 40 | +#endif /* HAVE_SIGACTION */ 41 | } 42 | 43 | public void ConsoleEnableInterrupt() 44 | @@ -235,9 +235,9 @@ private RETSIGTYPE WindowChangeHandler( 45 | 46 | ConsoleGetWindowSize(); 47 | 48 | -#ifndef HAVE_SIGVEC 49 | +#ifndef HAVE_SIGACTION 50 | signal( SIGWINCH, WindowChangeHandler ); 51 | -#endif /* HAVE_SIGVEC */ 52 | +#endif /* HAVE_SIGACTION */ 53 | } 54 | #endif /* UNIX */ 55 | 56 | @@ -388,24 +388,24 @@ public void ConsoleSetUp() 57 | signal( SIGINT, InterruptIgnoreHandler ); 58 | #endif /* MSDOS */ 59 | 60 | -#ifdef HAVE_SIGVEC 61 | - struct sigvec sigVec; 62 | +#ifdef HAVE_SIGACTION 63 | + struct sigaction sa; 64 | 65 | - sigVec.sv_handler = WindowChangeHandler; 66 | - sigVec.sv_mask = sigmask( SIGWINCH ); 67 | - sigVec.sv_flags = SV_INTERRUPT; 68 | - sigvec( SIGWINCH, &sigVec, NULL ); 69 | - 70 | - sigVec.sv_handler = InterruptHandler; 71 | - sigVec.sv_mask = sigmask( SIGINT ); 72 | - sigVec.sv_flags = SV_INTERRUPT; 73 | - sigvec( SIGINT, &sigVec, NULL ); 74 | + sa.sa_handler = WindowChangeHandler; 75 | + sigemptyset( &sa.sa_mask ); 76 | + sa.sa_flags = 0; /* No SA_RESTART means interrupt syscalls. */ 77 | + sigaction( SIGWINCH, &sa, NULL ); 78 | + 79 | + sa.sa_handler = InterruptHandler; 80 | + sigemptyset( &sa.sa_mask ); 81 | + sa.sa_flags = 0; /* No SA_RESTART means interrupt syscalls. */ 82 | + sigaction( SIGINT, &sa, NULL ); 83 | #else 84 | # ifdef SIGWINCH 85 | signal( SIGWINCH, WindowChangeHandler ); 86 | # endif 87 | signal( SIGINT, InterruptHandler ); 88 | -#endif /* HAVE_SIGVEC */ 89 | +#endif /* HAVE_SIGACTION */ 90 | 91 | #ifdef UNIX 92 | #ifdef HAVE_TERMIOS_H 93 | -------------------------------------------------------------------------------- /debian/postinst: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # postinst script for lv 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `configure' 10 | # * `abort-upgrade' 11 | # * `abort-remove' `in-favour' 12 | # 13 | # * `abort-deconfigure' `in-favour' 14 | # `removing' 15 | # 16 | # for details, see /usr/doc/packaging-manual/ 17 | # 18 | # quoting from the policy: 19 | # Any necessary prompting should almost always be confined to the 20 | # post-installation script, and should be protected with a conditional 21 | # so that unnecessary prompting doesn't happen if a package's 22 | # installation fails and the `postinst' is called with `abort-upgrade', 23 | # `abort-remove' or `abort-deconfigure'. 24 | 25 | case "$1" in 26 | configure) 27 | update-alternatives --quiet --install /usr/bin/pager pager \ 28 | /usr/bin/lv 80 --slave /usr/share/man/man1/pager.1.gz \ 29 | pager.1.gz /usr/share/man/man1/lv.1.gz 30 | ;; 31 | 32 | abort-upgrade|abort-remove|abort-deconfigure) 33 | 34 | ;; 35 | 36 | *) 37 | echo "postinst called with unknown argument \`$1'" >&2 38 | exit 0 39 | ;; 40 | esac 41 | 42 | # dh_installdeb will replace this with shell code automatically 43 | # generated by other debhelper scripts. 44 | 45 | #DEBHELPER# 46 | 47 | exit 0 48 | 49 | 50 | -------------------------------------------------------------------------------- /debian/prerm: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # prerm script for lv 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `remove' 10 | # * `upgrade' 11 | # * `failed-upgrade' 12 | # * `remove' `in-favour' 13 | # * `deconfigure' `in-favour' 14 | # `removing' 15 | # 16 | # for details, see /usr/doc/packaging-manual/ 17 | 18 | case "$1" in 19 | remove|upgrade|deconfigure) 20 | update-alternatives --quiet --remove pager /usr/bin/lv 21 | ;; 22 | failed-upgrade) 23 | ;; 24 | *) 25 | echo "prerm called with unknown argument \`$1'" >&2 26 | exit 0 27 | ;; 28 | esac 29 | 30 | # dh_installdeb will replace this with shell code automatically 31 | # generated by other debhelper scripts. 32 | 33 | #DEBHELPER# 34 | 35 | exit 0 36 | 37 | 38 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | # Uncomment this to turn on verbose mode. 4 | #export DH_VERBOSE=1 5 | 6 | CFLAGS += $(CPPFLAGS) 7 | 8 | %: 9 | dh $@ --with autoreconf 10 | 11 | override_dh_auto_configure: 12 | src/configure \ 13 | --prefix=/usr --libdir=/usr/share --enable-fastio 14 | 15 | override_dh_auto_install: 16 | install -d -m 755 $(CURDIR)/debian/lv/usr/bin \ 17 | $(CURDIR)/debian/lv/usr/share/lv \ 18 | $(CURDIR)/debian/lv/usr/share/man/man1 \ 19 | $(CURDIR)/debian/lv/usr/share/doc 20 | install -m 755 lv $(CURDIR)/debian/lv/usr/bin/lv 21 | install -m 644 lv.hlp $(CURDIR)/debian/lv/usr/share/lv/lv.hlp 22 | install -m 644 lv.1 $(CURDIR)/debian/lv/usr/share/man/man1 23 | ln -sf lv debian/lv/usr/bin/lgrep 24 | ln -sf lv.1 debian/lv/usr/share/man/man1/lgrep.1 25 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /debian/watch: -------------------------------------------------------------------------------- 1 | version=3 2 | opts=uversionmangle=s/^(\d)(\d\d)$/$1.$2/ \ 3 | http://www.ff.iij4u.or.jp/~nrt/lv/ .*/lv(\d.*)\.(?:tgz|tbz2|txz|tar\.(?:gz|bz2|xz)) 4 | -------------------------------------------------------------------------------- /hello.sample: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-takata/lv-mod/ae96849059bac6351af9d5493ab792af458eeb64/hello.sample -------------------------------------------------------------------------------- /hello.sample.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-takata/lv-mod/ae96849059bac6351af9d5493ab792af458eeb64/hello.sample.gif -------------------------------------------------------------------------------- /scripts/package.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | 4 | cd /d "%~dp0.." 5 | 6 | if exist "C:\Program Files\7-Zip\7z.exe" ( 7 | set "sz=C:\Program Files\7-Zip\7z.exe" 8 | ) else if exist "C:\Program Files (x86)\7-Zip\7z.exe" ( 9 | set "sz=C:\Program Files (x86)\7-Zip\7z.exe" 10 | ) 11 | 12 | for /f %%i in ('git describe') do set tag=%%i 13 | rem Remove dots 14 | set tag=%tag:.=% 15 | 16 | copy /y src\lv.exe . 17 | "%sz%" a "%tag%-win32.zip" GPL.txt hello.sample hello.sample.gif index.html lv.exe lv.hlp README README.md relnote.html 18 | -------------------------------------------------------------------------------- /src/Makefile.dos: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # Makefile for lv executable 3 | # target: all, clean 4 | ######################################################################## 5 | 6 | # MSDOS 7 | CC = lcc 8 | CFLAGS = -I. -DMSDOS -DRETSIGTYPE=void -cu 9 | LIB = -k-s1000 -m 10 | 11 | ######################################################################## 12 | # You don't have to change the following. 13 | ######################################################################## 14 | 15 | all: lv.exe 16 | 17 | OBJS = itable.obj ctable.obj \ 18 | uty.obj istr.obj stream.obj file.obj guess.obj \ 19 | decode.obj encode.obj escape.obj iso2022.obj \ 20 | iso8859.obj iso2cn.obj iso2jp.obj iso2kr.obj kana.obj \ 21 | eucjapan.obj shiftjis.obj big5.obj hz.obj raw.obj \ 22 | fetch.obj screen.obj command.obj display.obj \ 23 | find.obj re.obj nfa.obj dfa.obj \ 24 | conv.obj version.obj conf.obj lv.obj console.obj 25 | 26 | lv.exe: $(OBJS) 27 | $(CC) @${ -o $@ $(OBJS) $(LIB) } 28 | 29 | # 30 | # cleaning 31 | # 32 | 33 | clean: 34 | rm -f lv.exe *.obj 35 | -------------------------------------------------------------------------------- /src/ascii.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ascii.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: ascii.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __ASCII_H__ 9 | #define __ASCII_H__ 10 | 11 | #define NUL 0x00 /* C-@ */ 12 | #define SOH 0x01 /* C-a */ 13 | #define STX 0x02 /* C-b */ 14 | #define ETX 0x03 /* C-c */ 15 | #define EOT 0x04 /* C-d */ 16 | #define ENQ 0x05 /* C-e */ 17 | #define ACK 0x06 /* C-f */ 18 | #define BEL 0x07 /* C-g */ 19 | #define BS 0x08 /* C-h */ 20 | #define HT 0x09 /* C-i */ 21 | #define LF 0x0a /* C-j */ 22 | #define VT 0x0b /* C-k */ 23 | #define FF 0x0c /* C-l */ 24 | #define CR 0x0d /* C-m */ 25 | #define SO 0x0e /* C-n */ 26 | #define SI 0x0f /* C-o */ 27 | #define DLE 0x10 /* C-p */ 28 | #define DC1 0x11 /* C-q */ 29 | #define DC2 0x12 /* C-r */ 30 | #define DC3 0x13 /* C-s */ 31 | #define DC4 0x14 /* C-t */ 32 | #define NAK 0x15 /* C-u */ 33 | #define SYN 0x16 /* C-v */ 34 | #define ETB 0x17 /* C-w */ 35 | #define CAN 0x18 /* C-x */ 36 | #define EM 0x19 /* C-y */ 37 | #define SUB 0x1a /* C-z */ 38 | #define ESC 0x1b /* C-[ */ 39 | #define FS 0x1c /* C-\ */ 40 | #define GS 0x1d /* C-] */ 41 | #define RS 0x1e /* C-^ */ 42 | #define US 0x1f /* C-_ */ 43 | 44 | #define SP 0x20 45 | #define DEL 0x7f 46 | 47 | #define LS0 0x0f 48 | #define LS1 0x0e 49 | 50 | #define SS2 0x8e 51 | #define SS3 0x8f 52 | 53 | #endif /* __ASCII_H__ */ 54 | -------------------------------------------------------------------------------- /src/attr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * attr.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: attr.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __ATTR_H__ 9 | #define __ATTR_H__ 10 | 11 | #define ATTR_NULL 0x00 12 | 13 | #define ATTR_COLOR 0x07 14 | #define ATTR_COLOR_R 0x01 15 | #define ATTR_COLOR_B 0x02 16 | #define ATTR_COLOR_G 0x04 17 | 18 | #define ATTR_HILIGHT 0x08 19 | #define ATTR_UNDERLINE 0x10 20 | #define ATTR_BLINK 0x20 21 | #define ATTR_REVERSE 0x40 22 | 23 | #define ATTR_STANDOUT 0x80 /* INTERNAL USE */ 24 | 25 | #endif /* __ATTR_H__ */ 26 | -------------------------------------------------------------------------------- /src/begin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * begin.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: begin.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __BEGIN_H__ 9 | #define __BEGIN_H__ 10 | 11 | #include 12 | #include 13 | 14 | #ifdef public 15 | #undef public 16 | #endif /* public */ 17 | 18 | #define public 19 | 20 | #endif /* __BEGIN_H__ */ 21 | -------------------------------------------------------------------------------- /src/big5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * big5.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: big5.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __BIG5_H__ 9 | #define __BIG5_H__ 10 | 11 | #include 12 | #include 13 | 14 | public ic_t BIG5toCNS( ic_t big5, byte *cset ); 15 | public ic_t CNStoBIG5( ic_t cns, byte *cset ); 16 | 17 | public void ConvertCNStoBIG5( i_str_t *istr ); 18 | public void ConvertBIG5toCNS( i_str_t *istr ); 19 | 20 | public void DecodeBig5( state_t *state, byte codingSystem ); 21 | 22 | public void EncodeBig5( i_str_t *istr, int head, int tail, 23 | byte codingSystem, boolean_t binary ); 24 | 25 | #endif /* __BIG5_H__ */ 26 | -------------------------------------------------------------------------------- /src/big5cns.map: -------------------------------------------------------------------------------- 1 | private codes_t big5Level1ToCnsPlane1[ 25 ] = { /* range */ 2 | { 0xA140, 0x2121 }, 3 | { 0xA1F6, 0x2258 }, 4 | { 0xA1F7, 0x2257 }, 5 | { 0xA1F8, 0x2259 }, 6 | { 0xA2AF, 0x2421 }, 7 | { 0xA3C0, 0x4221 }, 8 | { 0xa3e1, 0x0000 }, 9 | { 0xA440, 0x4421 }, 10 | { 0xACFE, 0x5753 }, 11 | { 0xacff, 0x0000 }, 12 | { 0xAD40, 0x5323 }, 13 | { 0xAFD0, 0x5754 }, 14 | { 0xBBC8, 0x6B51 }, 15 | { 0xBE52, 0x6B50 }, 16 | { 0xBE53, 0x6F5C }, 17 | { 0xC1AB, 0x7536 }, 18 | { 0xC2CB, 0x7535 }, 19 | { 0xC2CC, 0x7737 }, 20 | { 0xC361, 0x782E }, 21 | { 0xC3B9, 0x7865 }, 22 | { 0xC3BA, 0x7864 }, 23 | { 0xC3BB, 0x7866 }, 24 | { 0xC456, 0x782D }, 25 | { 0xC457, 0x7962 }, 26 | { 0xc67f, 0x0000 } 27 | }; 28 | 29 | private codes_t cnsPlane1ToBig5Level1[ 26 ] = { /* range */ 30 | { 0x2121, 0xA140 }, 31 | { 0x2257, 0xA1F7 }, 32 | { 0x2258, 0xA1F6 }, 33 | { 0x2259, 0xA1F8 }, 34 | { 0x234f, 0x0000 }, 35 | { 0x2421, 0xA2AF }, 36 | { 0x2571, 0x0000 }, 37 | { 0x4221, 0xA3C0 }, 38 | { 0x4242, 0x0000 }, 39 | { 0x4421, 0xA440 }, 40 | { 0x5323, 0xAD40 }, 41 | { 0x5753, 0xACFE }, 42 | { 0x5754, 0xAFD0 }, 43 | { 0x6B50, 0xBE52 }, 44 | { 0x6B51, 0xBBC8 }, 45 | { 0x6F5C, 0xBE53 }, 46 | { 0x7535, 0xC2CB }, 47 | { 0x7536, 0xC1AB }, 48 | { 0x7737, 0xC2CC }, 49 | { 0x782D, 0xC456 }, 50 | { 0x782E, 0xC361 }, 51 | { 0x7864, 0xC3BA }, 52 | { 0x7865, 0xC3B9 }, 53 | { 0x7866, 0xC3BB }, 54 | { 0x7962, 0xC457 }, 55 | { 0x7d4c, 0x0000 } 56 | }; 57 | 58 | private codes_t big5Level2ToCnsPlane2[ 48 ] = { /* range */ 59 | { 0xC940, 0x2121 }, 60 | { 0xc94a, 0x0000 }, 61 | { 0xC94B, 0x212B }, 62 | { 0xC96C, 0x214D }, 63 | { 0xC9BE, 0x214C }, 64 | { 0xC9BF, 0x217D }, 65 | { 0xC9ED, 0x224E }, 66 | { 0xCAF7, 0x224D }, 67 | { 0xCAF8, 0x2439 }, 68 | { 0xD77A, 0x3F6A }, 69 | { 0xD77B, 0x387E }, 70 | { 0xDBA7, 0x3F6B }, 71 | { 0xDDFC, 0x4176 }, 72 | { 0xDDFD, 0x4424 }, 73 | { 0xE8A3, 0x554C }, 74 | { 0xE976, 0x5723 }, 75 | { 0xEB5B, 0x5A29 }, 76 | { 0xEBF1, 0x554B }, 77 | { 0xEBF2, 0x5B3F }, 78 | { 0xECDE, 0x5722 }, 79 | { 0xECDF, 0x5C6A }, 80 | { 0xEDAA, 0x5D75 }, 81 | { 0xEEEB, 0x642F }, 82 | { 0xEEEC, 0x6039 }, 83 | { 0xF056, 0x5D74 }, 84 | { 0xF057, 0x6243 }, 85 | { 0xF0CB, 0x5A28 }, 86 | { 0xF0CC, 0x6337 }, 87 | { 0xF163, 0x6430 }, 88 | { 0xF16B, 0x6761 }, 89 | { 0xF16C, 0x6438 }, 90 | { 0xF268, 0x6934 }, 91 | { 0xF269, 0x6573 }, 92 | { 0xF2C3, 0x664E }, 93 | { 0xF375, 0x6762 }, 94 | { 0xF466, 0x6935 }, 95 | { 0xF4B5, 0x664D }, 96 | { 0xF4B6, 0x6962 }, 97 | { 0xF4FD, 0x6A4C }, 98 | { 0xF663, 0x6A4B }, 99 | { 0xF664, 0x6C52 }, 100 | { 0xF977, 0x7167 }, 101 | { 0xF9C4, 0x7166 }, 102 | { 0xF9C5, 0x7234 }, 103 | { 0xF9C6, 0x7240 }, 104 | { 0xF9C7, 0x7235 }, 105 | { 0xF9D2, 0x7241 }, 106 | { 0xf9d6, 0x0000 } 107 | }; 108 | 109 | private codes_t cnsPlane2ToBig5Level2[ 49 ] = { /* range */ 110 | { 0x2121, 0xC940 }, 111 | { 0x212B, 0xC94B }, 112 | { 0x214C, 0xC9BE }, 113 | { 0x214D, 0xC96C }, 114 | { 0x217D, 0xC9BF }, 115 | { 0x224D, 0xCAF7 }, 116 | { 0x224E, 0xC9ED }, 117 | { 0x2439, 0xCAF8 }, 118 | { 0x387E, 0xD77B }, 119 | { 0x3F6A, 0xD77A }, 120 | { 0x3F6B, 0xDBA7 }, 121 | { 0x4424, 0x0000 }, 122 | { 0x4176, 0xDDFC }, 123 | { 0x4177, 0x0000 }, 124 | { 0x4424, 0xDDFD }, 125 | { 0x554B, 0xEBF1 }, 126 | { 0x554C, 0xE8A3 }, 127 | { 0x5722, 0xECDE }, 128 | { 0x5723, 0xE976 }, 129 | { 0x5A28, 0xF0CB }, 130 | { 0x5A29, 0xEB5B }, 131 | { 0x5B3F, 0xEBF2 }, 132 | { 0x5C6A, 0xECDF }, 133 | { 0x5D74, 0xF056 }, 134 | { 0x5D75, 0xEDAA }, 135 | { 0x6039, 0xEEEC }, 136 | { 0x6243, 0xF057 }, 137 | { 0x6337, 0xF0CC }, 138 | { 0x642F, 0xEEEB }, 139 | { 0x6430, 0xF163 }, 140 | { 0x6438, 0xF16C }, 141 | { 0x6573, 0xF269 }, 142 | { 0x664D, 0xF4B5 }, 143 | { 0x664E, 0xF2C3 }, 144 | { 0x6761, 0xF16B }, 145 | { 0x6762, 0xF375 }, 146 | { 0x6934, 0xF268 }, 147 | { 0x6935, 0xF466 }, 148 | { 0x6962, 0xF4B6 }, 149 | { 0x6A4B, 0xF663 }, 150 | { 0x6A4C, 0xF4FD }, 151 | { 0x6C52, 0xF664 }, 152 | { 0x7166, 0xF9C4 }, 153 | { 0x7167, 0xF977 }, 154 | { 0x7234, 0xF9C5 }, 155 | { 0x7235, 0xF9C7 }, 156 | { 0x7240, 0xF9C6 }, 157 | { 0x7241, 0xF9D2 }, 158 | { 0x7245, 0x0000 } 159 | }; 160 | 161 | -------------------------------------------------------------------------------- /src/boolean.h: -------------------------------------------------------------------------------- 1 | /* 2 | * boolean.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: boolean.h,v 1.4 2004/01/05 07:25:29 nrt Exp $ 6 | */ 7 | 8 | #ifndef __BOOLEAN_H__ 9 | #define __BOOLEAN_H__ 10 | 11 | #ifndef FALSE 12 | #define FALSE 0 13 | #endif 14 | 15 | #ifndef TRUE 16 | #define TRUE 1 17 | #endif 18 | 19 | #ifndef boolean_t 20 | #define boolean_t int 21 | #endif 22 | 23 | #endif /* __BOOLEAN_H__ */ 24 | -------------------------------------------------------------------------------- /src/command.h: -------------------------------------------------------------------------------- 1 | /* 2 | * command.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: command.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __COMMAND_H__ 9 | #define __COMMAND_H__ 10 | 11 | #include 12 | 13 | public boolean_t less_compatible; 14 | 15 | public byte *editor_program; 16 | public byte *filter_program; 17 | 18 | public boolean_t initcmd_mode; 19 | public char *initcmd_str; 20 | public int initcmd_curp; 21 | 22 | #define IsNumber( c ) ( (c) >= '0' && (c) <= '9' ) 23 | 24 | public boolean_t CommandInit(); 25 | public void Command( file_t *file, byte **optional ); 26 | 27 | #endif /* __COMMAND_H__ */ 28 | -------------------------------------------------------------------------------- /src/conf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * conf.h 3 | * 4 | * All rights reserved. Copyright (C) 1998 by NARITA Tomio 5 | * $Id: conf.h,v 1.4 2003/11/13 03:30:49 nrt Exp $ 6 | */ 7 | 8 | #ifndef __CONF_H__ 9 | #define __CONF_H__ 10 | 11 | #include 12 | 13 | typedef struct { 14 | byte **file; 15 | stream_t *st; 16 | int width; 17 | int height; 18 | boolean_t options; 19 | byte inputCodingSystem; 20 | byte outputCodingSystem; 21 | byte keyboardCodingSystem; 22 | byte pathnameCodingSystem; 23 | byte defaultCodingSystem; 24 | boolean_t keyCodingSystemVirgin; 25 | byte *pattern; 26 | } conf_t; 27 | 28 | public void ConfInit( byte **argv ); 29 | public void Conf( conf_t *conf, byte **argv ); 30 | public byte *ConfFilename( conf_t *conf ); 31 | 32 | #endif /* __CONF_H__ */ 33 | -------------------------------------------------------------------------------- /src/console.h: -------------------------------------------------------------------------------- 1 | /* 2 | * console.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: console.h,v 1.4 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __CONSOLE_H__ 9 | #define __CONSOLE_H__ 10 | 11 | #include 12 | #include 13 | 14 | public int WIDTH, HEIGHT; /* one based */ 15 | 16 | public boolean_t allow_ansi_esc; 17 | public boolean_t no_scroll; 18 | 19 | public boolean_t allow_interrupt; 20 | public boolean_t kb_interrupted; 21 | public boolean_t window_changed; 22 | 23 | public byte *ansi_standout; 24 | public byte *ansi_reverse; 25 | public byte *ansi_blink; 26 | public byte *ansi_underline; 27 | public byte *ansi_hilight; 28 | 29 | public byte *cur_left; 30 | public byte *cur_right; 31 | public byte *cur_up; 32 | public byte *cur_down; 33 | public byte *cur_ppage; 34 | public byte *cur_npage; 35 | 36 | public void ConsoleInit(); 37 | public void ConsoleResetAnsiSequence(); 38 | 39 | public void ConsoleTermInit(); 40 | public void ConsoleSetUp(); 41 | public void ConsoleSetDown(); 42 | 43 | public void ConsoleShellEscape(); 44 | public void ConsoleReturnToProgram(); 45 | 46 | public void ConsoleGetWindowSize(); 47 | 48 | public void ConsoleSuspend(); 49 | 50 | public void ConsoleEnableInterrupt(); 51 | public void ConsoleDisableInterrupt(); 52 | 53 | public int ConsolePrint( byte i ); 54 | 55 | public void ConsolePrints( byte *str ); 56 | public void ConsolePrintsStr( str_t *str, int length ); 57 | 58 | public void ConsoleFlush(); 59 | 60 | public int ConsoleGetChar(); 61 | 62 | public void ConsoleSetCur( int x, int y ); /* zero based */ 63 | public void ConsoleOnCur(); 64 | public void ConsoleOffCur(); 65 | public void ConsoleGoAhead(); 66 | public void ConsoleClearScreen(); 67 | public void ConsoleClearRight(); 68 | public void ConsoleScrollUp(); 69 | public void ConsoleScrollDown(); 70 | public void ConsoleSetAttribute( byte attr ); 71 | 72 | #endif /* __CONSOLE_H__ */ 73 | -------------------------------------------------------------------------------- /src/conv.c: -------------------------------------------------------------------------------- 1 | /* 2 | * conv.c 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio. 5 | * $Id: conv.c,v 1.7 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | /* 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | public boolean_t Conv( file_t *f, boolean_t showFileName ) 35 | { 36 | int len; 37 | boolean_t simple; 38 | long lineNumber = 0; 39 | boolean_t flagMatchedResult = FALSE; 40 | boolean_t flagMatched = FALSE; 41 | str_t *encoding_space = NULL; 42 | byte *str; 43 | i_str_t *istr = NULL; 44 | int i, gc_count = 0; 45 | 46 | for( f->eof = FALSE ; FALSE == f->eof ; ){ 47 | str = FileLoadLine( f, &len, &simple ); 48 | if( 0 == len ) 49 | return flagMatchedResult; 50 | 51 | if( NULL != istr ) 52 | IstrFree( istr ); 53 | 54 | if( ++gc_count > 64 ){ 55 | gc_count = 0; 56 | IstrFreeZone( ZONE_PAGE0 ); 57 | } 58 | 59 | if( TRUE == simple ) 60 | istr = DecodeSimple( IstrAlloc( ZONE_PAGE0, len + 1 ), 61 | str, &len ); 62 | else 63 | istr = Decode( IstrAlloc( ZONE_PAGE0, len + 1 ), 64 | f->inputCodingSystem, str, &len ); 65 | 66 | if( TRUE == grep_mode ){ 67 | lineNumber++; 68 | 69 | flagMatched = (*find_only_func)( istr ); 70 | 71 | if( TRUE == flagMatched ){ 72 | if( TRUE == grep_inverted ) 73 | flagMatched = FALSE; 74 | else { 75 | flagMatchedResult = TRUE; 76 | if( TRUE == showFileName ) 77 | printf( "%s:", f->fileName ); 78 | if( TRUE == line_number ) 79 | printf( "%ld:", lineNumber ); 80 | } 81 | } else { 82 | if( TRUE == grep_inverted ){ 83 | flagMatched = TRUE; 84 | flagMatchedResult = TRUE; 85 | if( TRUE == showFileName ) 86 | printf( "%s:", f->fileName ); 87 | if( TRUE == line_number ) 88 | printf( "%ld:", lineNumber ); 89 | } 90 | } 91 | } 92 | 93 | if( TRUE == flagMatched || FALSE == grep_mode ){ 94 | if( TRUE == simple ){ 95 | for( i = 0 ; i < len ; i++ ) 96 | putchar( str[ i ] ); 97 | } else { 98 | if( len > (STR_SIZE >> 2) ){ 99 | encode_length = (len << 2) + CODE_EXTRA_LEN; 100 | encoding_space = (str_t *)Malloc( encode_length * sizeof( str_t ) ); 101 | Encode( istr, 0, len, 102 | f->outputCodingSystem, TRUE, 103 | encoding_space, &encode_length ); 104 | for( len = 0 ; len < encode_length ; len++ ) 105 | putchar( 0xff & encoding_space[ len ] ); 106 | free( encoding_space ); 107 | } else { 108 | encode_length = CODE_SIZE; 109 | Encode( istr, 0, len, 110 | f->outputCodingSystem, TRUE, 111 | encode_str, &encode_length ); 112 | for( len = 0 ; len < encode_length ; len++ ) 113 | putchar( 0xff & encode_str[ len ] ); 114 | } 115 | } 116 | } 117 | } 118 | 119 | return flagMatchedResult; 120 | } 121 | -------------------------------------------------------------------------------- /src/conv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * conv.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: conv.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __CONV_H__ 9 | #define __CONV_H__ 10 | 11 | #include 12 | 13 | public boolean_t grep_mode; 14 | public boolean_t grep_inverted; 15 | public boolean_t line_number; 16 | 17 | public boolean_t Conv( file_t *f, boolean_t showFileName ); 18 | 19 | #endif /* __CONV_H__ */ 20 | -------------------------------------------------------------------------------- /src/ctable.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ctable.c 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio. 5 | * $Id: ctable.c,v 1.5 2004/01/05 07:23:29 nrt Exp $ 6 | */ 7 | /* 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | /* 32 | * coding system table 33 | */ 34 | 35 | public c_table_t cTable[ C_TABLE_SIZE ] = { 36 | /* 37 | * Auto select: decoding on iso-2022-kr and encoding on iso-2022-jp 38 | */ 39 | { AUTOSELECT, FALSE, "AUTO", 40 | {{0, 1}, {ASCII, KSC5601, ASCII, ASCII}, 0, 0 } }, 41 | 42 | /* 43 | * 7bit 44 | */ 45 | { UTF_7, FALSE, "UTF-7", 46 | {{0, 1}, {ASCII, ASCII, ASCII, ASCII}, 0, 0 } }, 47 | { HZ_GB, FALSE, "HZ", 48 | {{0, 1}, {ASCII, GB2312, ASCII, ASCII}, 0, 0 } }, 49 | 50 | /* 51 | * EUC encoding 52 | */ 53 | { EUC_KOREA, FALSE, "EUC-KR", 54 | {{0, 1}, {ASCII, KSC5601, ASCII, ASCII}, 0, 0 } }, 55 | { EUC_JAPAN, FALSE, "EUC-JP", 56 | {{0, 1}, {ASCII, X0208, X0201KANA, X0212}, 0, 0 } }, 57 | { EUC_TAIWAN, FALSE, "EUC-TW", 58 | {{0, 1}, {ASCII, CNS_1, CNS_1, ASCII}, 0, 0 } }, 59 | { EUC_CHINA, FALSE, "EUC-CN", 60 | {{0, 1}, {ASCII, GB2312, ASCII, ASCII}, 0, 0 } }, 61 | 62 | /* 63 | * non iso-2022 encoding 64 | */ 65 | { BIG_FIVE, FALSE, "BIG5", 66 | {{0, 1}, {ASCII, ASCII, ASCII, ASCII}, 0, 0 } }, 67 | { SHIFT_JIS, FALSE, "SHIFT-JIS", 68 | {{0, 1}, {ASCII, X0201KANA, ASCII, ASCII}, 0, 0 } }, 69 | { UTF_8, FALSE, "UTF-8", 70 | {{0, 1}, {ASCII, ASCII, ASCII, ASCII}, 0, 0 } }, 71 | 72 | /* 73 | * ISO 2022 8bit encoding 74 | */ 75 | { ISO_8859_1, TRUE, "ISO-8859-1", 76 | {{0, 1}, {ASCII, ISO8859_1, ASCII, ASCII}, 0, 0 } }, 77 | { ISO_8859_2, TRUE, "ISO-8859-2", 78 | {{0, 1}, {ASCII, ISO8859_2, ASCII, ASCII}, 0, 0 } }, 79 | { ISO_8859_3, TRUE, "ISO-8859-3", 80 | {{0, 1}, {ASCII, ISO8859_3, ASCII, ASCII}, 0, 0 } }, 81 | { ISO_8859_4, TRUE, "ISO-8859-4", 82 | {{0, 1}, {ASCII, ISO8859_4, ASCII, ASCII}, 0, 0 } }, 83 | { ISO_8859_5, TRUE, "ISO-8859-5", 84 | {{0, 1}, {ASCII, ISO8859_5, ASCII, ASCII}, 0, 0 } }, 85 | { ISO_8859_6, TRUE, "ISO-8859-6", 86 | {{0, 1}, {ASCII, ISO8859_6, ASCII, ASCII}, 0, 0 } }, 87 | { ISO_8859_7, TRUE, "ISO-8859-7", 88 | {{0, 1}, {ASCII, ISO8859_7, ASCII, ASCII}, 0, 0 } }, 89 | { ISO_8859_8, TRUE, "ISO-8859-8", 90 | {{0, 1}, {ASCII, ISO8859_8, ASCII, ASCII}, 0, 0 } }, 91 | { ISO_8859_9, TRUE, "ISO-8859-9", 92 | {{0, 1}, {ASCII, ISO8859_9, ASCII, ASCII}, 0, 0 } }, 93 | { ISO_8859_10, TRUE, "ISO-8859-10", 94 | {{0, 1}, {ASCII, ISO8859_10, ASCII, ASCII}, 0, 0 } }, 95 | { ISO_8859_11, TRUE, "ISO-8859-11", 96 | {{0, 1}, {ASCII, ISO8859_11, ASCII, ASCII}, 0, 0 } }, 97 | { ISO_8859_13, TRUE, "ISO-8859-13", 98 | {{0, 1}, {ASCII, ISO8859_13, ASCII, ASCII}, 0, 0 } }, 99 | { ISO_8859_14, TRUE, "ISO-8859-14", 100 | {{0, 1}, {ASCII, ISO8859_14, ASCII, ASCII}, 0, 0 } }, 101 | { ISO_8859_15, TRUE, "ISO-8859-15", 102 | {{0, 1}, {ASCII, ISO8859_15, ASCII, ASCII}, 0, 0 } }, 103 | { ISO_8859_16, TRUE, "ISO-8859-16", 104 | {{0, 1}, {ASCII, ISO8859_16, ASCII, ASCII}, 0, 0 } }, 105 | 106 | /* 107 | * ISO 2022 7bit encoding 108 | */ 109 | { ISO_2022_CN, FALSE, "ISO-2022-CN", 110 | {{0, 1}, {ASCII, GB2312, ASCII, ASCII}, 0, 0 } }, 111 | { ISO_2022_JP, FALSE, "ISO-2022-JP", 112 | {{0, 3}, {ASCII, X0201KANA, X0201KANA, X0208}, 0, 0 } }, 113 | { ISO_2022_KR, FALSE, "ISO-2022-KR", 114 | {{0, 1}, {ASCII, KSC5601, ASCII, ASCII}, 0, 0 } }, 115 | 116 | /* 117 | * Raw encoding 118 | */ 119 | { RAW, FALSE, "RAW", 120 | {{0, 1}, {ASCII, ASCII, ASCII, ASCII}, 0, 0 } }, 121 | 122 | #ifdef USE_UTF16 123 | /* 124 | * UTF-16 125 | */ 126 | { UTF_16, FALSE, "UTF-16", 127 | {{0, 1}, {ASCII, ASCII, ASCII, ASCII}, 0, 0 } }, 128 | { UTF_16LE, FALSE, "UTF-16LE", 129 | {{0, 1}, {ASCII, ASCII, ASCII, ASCII}, 0, 0 } }, 130 | { UTF_16BE, FALSE, "UTF-16BE", 131 | {{0, 1}, {ASCII, ASCII, ASCII, ASCII}, 0, 0 } }, 132 | #endif /* USE_UTF16 */ 133 | }; 134 | 135 | public void CtableInit() 136 | { 137 | int i; 138 | 139 | for( i = 0 ; i < C_TABLE_SIZE ; i++ ) 140 | if( cTable[ i ].codingSystem != i ) 141 | fprintf( stderr, "lv: invalid charset table\n" ), exit( -1 ); 142 | } 143 | -------------------------------------------------------------------------------- /src/ctable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ctable.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: ctable.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __CTABLE_H__ 9 | #define __CTABLE_H__ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #endif /* __CTABLE_H__ */ 16 | -------------------------------------------------------------------------------- /src/ctable_e.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ctable_e.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: ctable_e.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __CTABLE_E_H__ 9 | #define __CTABLE_E_H__ 10 | 11 | extern c_table_t cTable[]; 12 | 13 | #endif /* __CTABLE_E_H__ */ 14 | -------------------------------------------------------------------------------- /src/ctable_t.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ctable_t.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: ctable_t.h,v 1.4 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __CTABLE_T_H__ 9 | #define __CTABLE_T_H__ 10 | 11 | /* coding systems (byte) */ 12 | 13 | #define AUTOSELECT 0 /* pseudo coding system */ 14 | 15 | #define UTF_7 1 /* UTF-7 */ 16 | #define HZ_GB 2 /* HZ enabled euc-china */ 17 | 18 | #define EUC_KOREA 3 /* Extended unix code */ 19 | #define EUC_JAPAN 4 /* Extended unix code */ 20 | #define EUC_TAIWAN 5 /* Extended unix code */ 21 | #define EUC_CHINA 6 /* Extended unix code */ 22 | 23 | #define BIG_FIVE 7 /* big5 encoding */ 24 | #define SHIFT_JIS 8 /* shift-jis encoding */ 25 | 26 | #define UTF_8 9 /* UTF-8 */ 27 | 28 | #define ISO_8859_1 10 /* iso-2022-8bit-ss2 */ 29 | #define ISO_8859_2 11 /* iso-2022-8bit-ss2 */ 30 | #define ISO_8859_3 12 /* iso-2022-8bit-ss2 */ 31 | #define ISO_8859_4 13 /* iso-2022-8bit-ss2 */ 32 | #define ISO_8859_5 14 /* iso-2022-8bit-ss2 */ 33 | #define ISO_8859_6 15 /* iso-2022-8bit-ss2 */ 34 | #define ISO_8859_7 16 /* iso-2022-8bit-ss2 */ 35 | #define ISO_8859_8 17 /* iso-2022-8bit-ss2 */ 36 | #define ISO_8859_9 18 /* iso-2022-8bit-ss2 */ 37 | #define ISO_8859_10 19 /* iso-2022-8bit-ss2 */ 38 | #define ISO_8859_11 20 /* iso-2022-8bit-ss2 */ 39 | #define ISO_8859_13 21 /* iso-2022-8bit-ss2 */ 40 | #define ISO_8859_14 22 /* iso-2022-8bit-ss2 */ 41 | #define ISO_8859_15 23 /* iso-2022-8bit-ss2 */ 42 | #define ISO_8859_16 24 /* iso-2022-8bit-ss2 */ 43 | 44 | #define ISO_2022_CN 25 /* iso-2022-cn */ 45 | #define ISO_2022_JP 26 /* iso-2022-jp */ 46 | #define ISO_2022_KR 27 /* iso-2022-kr */ 47 | 48 | #define RAW 28 /* raw mode */ 49 | 50 | #ifdef USE_UTF16 51 | #define UTF_16 29 /* UTF-16 (LE/BE autodetect) */ 52 | #define UTF_16LE 30 /* UTF-16LE */ 53 | #define UTF_16BE 31 /* UTF-16BE */ 54 | 55 | #define C_TABLE_SIZE 32 /* pseudo coding system */ 56 | #else /* USE_UTF16 */ 57 | #define C_TABLE_SIZE 29 /* pseudo coding system */ 58 | #endif /* USE_UTF16 */ 59 | 60 | #define GL 0 61 | #define GR 1 62 | 63 | #define G0 0 64 | #define G1 1 65 | #define G2 2 66 | #define G3 3 67 | 68 | typedef struct { 69 | byte gset[ 2 ]; 70 | byte cset[ 4 ]; 71 | byte sset; 72 | byte attr; 73 | } state_t; 74 | 75 | typedef struct { 76 | byte codingSystem; 77 | boolean_t bit8; 78 | byte *codingSystemName; 79 | state_t state; 80 | } c_table_t; 81 | 82 | public void CtableInit(); 83 | 84 | #endif /* __CTABLE_T_H__ */ 85 | -------------------------------------------------------------------------------- /src/d2u.pl: -------------------------------------------------------------------------------- 1 | #! /usr/local/bin/perl -p 2 | s/\r\n/\n/g 3 | -------------------------------------------------------------------------------- /src/d2uall.sh: -------------------------------------------------------------------------------- 1 | #! /bin/csh 2 | foreach file ( *.c *.h lv.hlp Makefile* makefile* ) 3 | d2u.pl $file > /tmp/lvtmp 4 | cat /tmp/lvtmp > $file 5 | end 6 | -------------------------------------------------------------------------------- /src/decode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * decode.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: decode.h,v 1.5 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __DECODE_H__ 9 | #define __DECODE_H__ 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | /* 17 | * ISO2022 & ISO2375 style escape sequence 18 | */ 19 | 20 | #define IsIchar( c ) ( (c) >= 0x20 && (c) <= 0x2f ) 21 | #define IsFchar( c ) ( (c) >= 0x30 && (c) <= 0x7e ) 22 | 23 | #define IsKatakana( c ) \ 24 | ( (c) >= 0x21 && (c) <= 0x5f ) 25 | 26 | #define IsKatakanaByte( c ) \ 27 | ( (c) >= 0xa1 && (c) <= 0xdf ) 28 | 29 | #define IsShiftJisByte1( c ) \ 30 | ( ( (c) >= 0x81 && (c) <= 0x9f ) || ( (c) >= 0xe0 && (c) <= 0xfc ) ) 31 | 32 | #define IsShiftJisByte2( c ) \ 33 | ( ( (c) >= 0x40 && (c) <= 0x7e ) || ( (c) >= 0x80 && (c) <= 0xfc ) ) 34 | 35 | #define IsBig5Byte1( c ) \ 36 | ( ( (c) >= 0xa1 && (c) <= 0xfe ) ) 37 | 38 | #define IsBig5Byte2( c ) \ 39 | ( ( (c) >= 0x40 && (c) <= 0x7e ) || ( (c) >= 0xa1 && (c) <= 0xfe ) ) 40 | 41 | #define IsEucByte( c ) \ 42 | ( (c) >= 0xa1 && (c) <= 0xfe ) 43 | 44 | #define IsGLchar( c ) \ 45 | ( (c) >= SP && (c) <= DEL ) 46 | 47 | #define IsGRchar( c ) \ 48 | ( (c) >= 0xa0 && (c) <= 0xff ) 49 | 50 | #define IsGraphicChar94( c ) \ 51 | ( (c) > SP && (c) < DEL ) 52 | 53 | #define IsGraphicChar( cset, c ) \ 54 | ( TRUE == iTable[ (int)(cset) ].set94 ? \ 55 | ( (c) > SP && (c) < DEL ) : ( (c) >= SP && (c) <= DEL ) ) 56 | 57 | public int ISIDX, SIDX, SHIGH; 58 | public i_str_t *ISTR; 59 | public byte *STR; 60 | 61 | #define GetChar( c ) \ 62 | { \ 63 | if( SHIGH == SIDX ){ \ 64 | /* \ 65 | * BREAK for EXTERNAL LOOP \ 66 | */ \ 67 | break; \ 68 | } \ 69 | (c) = STR[ SIDX++ ]; \ 70 | } 71 | 72 | #define GetCharRet( c ) \ 73 | { \ 74 | if( SHIGH == SIDX ) \ 75 | return FALSE; \ 76 | (c) = STR[ SIDX++ ]; \ 77 | } 78 | 79 | #define IncStringIndex() \ 80 | { \ 81 | if( SHIGH != SIDX ){ \ 82 | SIDX++; \ 83 | } \ 84 | } 85 | 86 | #define DecodeAddChar( cset, s, attr ) \ 87 | { \ 88 | if( TRUE == iTable[ (int)(cset) ].multi ) \ 89 | DecodeAddIchar( (cset), MakeIchar( (s)[ 0 ], (s)[ 1 ] ), (attr) ); \ 90 | else \ 91 | DecodeAddIchar( (cset), (ic_t)(s)[ 0 ], (attr) ); \ 92 | } 93 | 94 | #define CSET( region ) (state->cset[ (int)state->gset[ (int)(region) ] ]) 95 | #define SSET (state->cset[ (int)state->sset ]) 96 | 97 | public boolean_t binary_decode; 98 | public boolean_t hz_detection; 99 | public int decoding_penalty; 100 | 101 | public void DecodeAddLineFeed( byte ch ); 102 | public void DecodeAddSpace( byte attr ); 103 | public void DecodeAddTab( byte attr ); 104 | public void DecodeAddControl( byte ch ); 105 | public void DecodeAddBs(); 106 | 107 | public void DecodeAddIchar( byte charset, ic_t ic, byte attr ); 108 | 109 | public boolean_t DecodeAddShifted( state_t *state, byte ch ); 110 | 111 | public i_str_t *DecodeSimple( i_str_t *istr, byte *str, int *shigh ); 112 | public i_str_t *Decode( i_str_t *istr, 113 | byte codingSystem, byte *str, int *shigh ); 114 | 115 | public void DecodeInit(); 116 | 117 | #endif /* __DECODE_H__ */ 118 | -------------------------------------------------------------------------------- /src/dfa.h: -------------------------------------------------------------------------------- 1 | /* 2 | * dfa.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: dfa.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __DFA_H__ 9 | #define __DFA_H__ 10 | 11 | #include 12 | 13 | /*#define REGEXP_TEST*/ 14 | 15 | public boolean_t regexp_short_cut; 16 | public ic_t regexp_first_letter; 17 | 18 | public byte *ReMakeDFA( i_str_t *istr ); 19 | public boolean_t ReFreeDFA(); 20 | 21 | public boolean_t ReRun( i_str_t *istr, int *ptr ); 22 | 23 | public void ReShowNFA(); 24 | public void ReShowDFA(); 25 | 26 | #endif /* __DFA_H__ */ 27 | -------------------------------------------------------------------------------- /src/display.c: -------------------------------------------------------------------------------- 1 | /* 2 | * display.c 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio. 5 | * $Id: display.c,v 1.4 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | /* 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | /* 33 | * $B%Z!<%8FbMF$r%(%s%3!<%I$7$F2hLL$K=PNO$9$k(B. 34 | * 35 | * screen.c $B$G%m!<%I$7$?%Z!<%8FbMF$rI=<($9$k(B. 36 | * ($B$?$@$7(B, display.c $B$+$i$bF0E*$K%Z!<%8$r%a%b%j$K%m!<%I$7$F$$$k(B). 37 | */ 38 | 39 | #define ScreenGetTop( f, seg, blk, off, phy ) \ 40 | PositionGet( (f)->screen.top, (seg), (blk), (off), (phy) ) 41 | 42 | #define ScreenGetBot( f, seg, blk, off, phy ) \ 43 | PositionGet( (f)->screen.bot, (seg), (blk), (off), (phy) ) 44 | 45 | private void LineEncode( file_t *f, int blk, int off, int phy ) 46 | { 47 | line_t *line; 48 | int head, tail; 49 | 50 | line = &f->page[ blk ].line[ off ]; 51 | head = LineHead( line, phy ); 52 | tail = head + LineLength( line, phy ); 53 | 54 | encode_length = CODE_SIZE; 55 | Encode( line->istr, head, tail, 56 | f->outputCodingSystem, FALSE, 57 | encode_str, &encode_length ); 58 | } 59 | 60 | public void DisplayFull( file_t *f ) 61 | { 62 | int i; 63 | int seg, blk, off, phy; 64 | 65 | ConsoleOffCur(); 66 | 67 | ScreenGetTop( f, seg, blk, off, phy ); 68 | 69 | #ifdef _WIN32 70 | /* Clearing screen is very slow on Windows. */ 71 | ConsoleSetCur( 0, 0 ); 72 | ConsoleClearRight(); 73 | #else /* _WIN32 */ 74 | ConsoleClearScreen(); 75 | #endif /* _WIN32 */ 76 | 77 | for( i = 0 ; i < f->screen.lines ; i++ ){ 78 | LineEncode( f, blk, off, phy ); 79 | if( 0 == i || TRUE == carefully_divide || 0 == phy ){ 80 | ConsoleSetCur( 0, i ); 81 | } 82 | ConsolePrintsStr( encode_str, encode_length ); 83 | #ifdef _WIN32 84 | ConsoleClearRight(); 85 | #endif /* _WIN32 */ 86 | PositionInc( f, seg, blk, off, phy ); 87 | } 88 | for( i = f->screen.lines ; i < f->height ; i++ ){ 89 | ConsoleSetCur( 0, i ); 90 | ConsolePrint( '~' ); 91 | #ifdef _WIN32 92 | ConsoleClearRight(); 93 | #endif /* _WIN32 */ 94 | } 95 | 96 | ConsoleOnCur(); 97 | 98 | f->dirty = FALSE; 99 | } 100 | 101 | public void DisplayTop( file_t *f, int arg ) 102 | { 103 | int seg, blk, off, phy; 104 | int i; 105 | 106 | if( TRUE == no_scroll || arg > f->height || f->screen.lines < f->height ){ 107 | DisplayFull( f ); 108 | return; 109 | } 110 | 111 | if( arg == f->height ){ 112 | if( FALSE == smooth_paging ){ 113 | DisplayFull( f ); 114 | return; 115 | } 116 | ScreenGetBot( f, seg, blk, off, phy ); 117 | } else { 118 | ScreenGetTop( f, seg, blk, off, phy ); 119 | for( i = 1 ; i < arg ; i++ ) 120 | PositionInc( f, seg, blk, off, phy ); 121 | } 122 | 123 | ConsoleOffCur(); 124 | 125 | for( i = 0 ; i < arg ; i++ ){ 126 | LineEncode( f, blk, off, phy ); 127 | ConsoleSetCur( 0, HEIGHT - 1 ); 128 | ConsoleClearRight(); 129 | ConsoleSetCur( 0, 0 ); 130 | ConsoleScrollDown(); 131 | ConsolePrintsStr( encode_str, encode_length ); 132 | PositionDec( f, seg, blk, off, phy ); 133 | } 134 | 135 | ConsoleOnCur(); 136 | } 137 | 138 | public void DisplayBot( file_t *f, int arg ) 139 | { 140 | int seg, blk, off, phy; 141 | int i; 142 | 143 | if( TRUE == no_scroll || arg > f->height || f->screen.lines < f->height ){ 144 | DisplayFull( f ); 145 | return; 146 | } 147 | 148 | if( arg == f->height ){ 149 | if( FALSE == smooth_paging ){ 150 | DisplayFull( f ); 151 | return; 152 | } 153 | ScreenGetTop( f, seg, blk, off, phy ); 154 | } else { 155 | ScreenGetBot( f, seg, blk, off, phy ); 156 | for( i = 1 ; i < arg ; i++ ) 157 | PositionDec( f, seg, blk, off, phy ); 158 | } 159 | 160 | ConsoleOffCur(); 161 | 162 | for( i = 0 ; i < arg ; i++ ){ 163 | LineEncode( f, blk, off, phy ); 164 | ConsoleSetCur( 0, 0 ); 165 | ConsoleScrollUp(); 166 | ConsoleSetCur( 0, f->height - 1 ); 167 | ConsoleClearRight(); 168 | ConsolePrintsStr( encode_str, encode_length ); 169 | PositionInc( f, seg, blk, off, phy ); 170 | } 171 | 172 | ConsoleOnCur(); 173 | } 174 | -------------------------------------------------------------------------------- /src/display.h: -------------------------------------------------------------------------------- 1 | /* 2 | * display.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: display.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __DISPLAY_H__ 9 | #define __DISPLAY_H__ 10 | 11 | #include 12 | 13 | public boolean_t smooth_paging; 14 | public boolean_t carefully_divide; 15 | 16 | public void DisplayFull( file_t *f ); 17 | public void DisplayTop( file_t *f, int arg ); 18 | public void DisplayBot( file_t *f, int arg ); 19 | 20 | #endif /* __DISPLAY_H__ */ 21 | -------------------------------------------------------------------------------- /src/encode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * encode.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: encode.h,v 1.5 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __ENCODE_H__ 9 | #define __ENCODE_H__ 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #define CODE_EXTRA_LEN 16 17 | #define CODE_SIZE ( STR_SIZE + CODE_EXTRA_LEN ) 18 | 19 | public int CIDX; 20 | public int CHIGH; 21 | public str_t *CSTR; 22 | 23 | public int encode_length; 24 | public str_t encode_str[ CODE_SIZE ]; 25 | 26 | #define EncodeAddCharAbsolutely( a, c ) \ 27 | { \ 28 | CSTR[ CIDX++ ] = (a) | (c); \ 29 | } 30 | 31 | #define EncodeAddChar( a, c ) \ 32 | { \ 33 | CSTR[ CIDX++ ] = (a) | (c); \ 34 | if( CIDX >= CHIGH ) \ 35 | /* \ 36 | * BREAK for EXTERNAL LOOP \ 37 | */ \ 38 | break; \ 39 | } 40 | 41 | #define EncodeAddCharRet( a, c ) \ 42 | { \ 43 | CSTR[ CIDX++ ] = (a) | (c); \ 44 | if( CIDX >= CHIGH ) \ 45 | return FALSE; \ 46 | } 47 | 48 | public boolean_t EncodeAddPseudo( int attr, ic_t ic, byte cset, 49 | boolean_t binary ); 50 | #ifdef USE_UTF16 51 | public boolean_t EncodeAddPseudo16( int attr, ic_t ic, byte cset, 52 | boolean_t binary, boolean_t le ); 53 | #endif 54 | public boolean_t EncodeAddInvalid( int attr, ic_t ic, byte cset ); 55 | 56 | public void EncodeAddEscapeDollar( int attr ); 57 | public void EncodeAdd7bitSS2( int attr ); 58 | public void EncodeAdd7bitSS3( int attr ); 59 | 60 | public void Encode( i_str_t *istr, int head, int tail, 61 | byte codingSystem, boolean_t binary, 62 | str_t *code, int *length ); 63 | 64 | public byte *EncodeStripAttribute( str_t *str, int length ); 65 | 66 | #endif /* __ENCODE_H__ */ 67 | -------------------------------------------------------------------------------- /src/escape.c: -------------------------------------------------------------------------------- 1 | /* 2 | * escape.c 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio. 5 | * $Id: escape.c,v 1.5 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | /* 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | public boolean_t DecodeEscape( state_t *state ) 30 | { 31 | boolean_t multi; 32 | boolean_t set94 = TRUE; 33 | boolean_t omitted; 34 | boolean_t unknownSequence; 35 | byte charset, ic, ch, attr, color; 36 | int g = 0, index, arg; 37 | 38 | /* 39 | * escape sequence 40 | */ 41 | 42 | multi = FALSE; 43 | omitted = FALSE; 44 | unknownSequence = FALSE; 45 | 46 | GetCharRet( ch ); 47 | 48 | switch( ch ){ 49 | case '[': 50 | if( FALSE == allow_ansi_esc || TRUE == binary_decode ) 51 | break; 52 | 53 | /* 54 | * possibly, ANSI character attribute sequence 55 | */ 56 | 57 | index = SIDX; 58 | 59 | do { 60 | GetCharRet( ch ); 61 | if( !( ( ch >= '0' && ch <= '9' ) || ';' == ch ) ) 62 | break; 63 | } while( 'm' != ch ); 64 | 65 | SIDX = index; 66 | 67 | if( 'm' != ch ){ 68 | /* invalid ANSI sequence */ 69 | ch = '['; 70 | break; 71 | } 72 | 73 | arg = 0; 74 | attr = color = ATTR_NULL; 75 | do { 76 | GetCharRet( ch ); 77 | 78 | if( ch >= '0' && ch <= '9' ){ 79 | arg = 10 * arg + ch - '0'; 80 | } else if( ';' == ch || 'm' == ch ){ 81 | switch( arg ){ 82 | case 0: /* ignore it */ break; 83 | case 1: attr |= ATTR_HILIGHT; break; 84 | case 4: attr |= ATTR_UNDERLINE; break; 85 | case 5: attr |= ATTR_BLINK; break; 86 | case 7: attr |= ATTR_REVERSE; break; 87 | default: 88 | if( arg >= 30 && arg <= 37 ) 89 | color = (byte)( arg - 30 ); 90 | else if( arg >= 40 && arg <= 47 ){ 91 | color = (byte)( arg - 40 ); 92 | attr |= ATTR_REVERSE; 93 | } 94 | } 95 | arg = 0; 96 | } 97 | } while( 'm' != ch ); 98 | 99 | state->attr = attr | color; 100 | 101 | return TRUE; 102 | case ' ': /* announcer */ 103 | GetCharRet( ch ); 104 | /* 105 | * current implementation just ignores it. 106 | */ 107 | return TRUE; 108 | case '&': /* KOUSIN of registered charset */ 109 | GetCharRet( ch ); 110 | /* 111 | * current implementation just ignores it. 112 | */ 113 | return TRUE; 114 | case '~': /* LS1R */ state->gset[ GR ] = G1; return TRUE; 115 | case 'n': /* LS2 */ state->gset[ GL ] = G2; return TRUE; 116 | case '}': /* LS2R */ state->gset[ GR ] = G2; return TRUE; 117 | case 'o': /* LS3 */ state->gset[ GL ] = G3; return TRUE; 118 | case '|': /* LS3R */ state->gset[ GR ] = G3; return TRUE; 119 | case 'N': /* SS2 */ state->sset = G2; return TRUE; 120 | case 'O': /* SS3 */ state->sset = G3; return TRUE; 121 | } 122 | 123 | if( ch < SP || IsFchar( ch ) ){ 124 | /* 125 | * unknown ESC F sequence 126 | */ 127 | DecodeAddControl( ESC ); 128 | DecodeAddControl( ch ); 129 | return TRUE; 130 | } 131 | 132 | if( '$' == ch ){ 133 | multi = TRUE; 134 | GetCharRet( ch ); 135 | } 136 | 137 | ic = ch; 138 | if( ch >= '(' && ch <= '/' ){ 139 | switch( ch ){ 140 | case '(': set94 = TRUE; g = 0; break; 141 | case ')': set94 = TRUE; g = 1; break; 142 | case '*': set94 = TRUE; g = 2; break; 143 | case '+': set94 = TRUE; g = 3; break; 144 | case ',': set94 = FALSE; g = 0; break; /* MULE specific */ 145 | case '-': set94 = FALSE; g = 1; break; 146 | case '.': set94 = FALSE; g = 2; break; 147 | case '/': set94 = FALSE; g = 3; break; 148 | } 149 | } else { 150 | if( '@' == ch || 'A' == ch || 'B' == ch ){ 151 | set94 = TRUE; 152 | g = 0; 153 | omitted = TRUE; 154 | } else { 155 | unknownSequence = TRUE; 156 | } 157 | } 158 | 159 | if( FALSE == unknownSequence && FALSE == omitted ){ 160 | GetCharRet( ch ); 161 | } 162 | 163 | if( TRUE == unknownSequence 164 | || NOSET == (charset = ItableLookup( ch, multi, set94 )) ){ 165 | /* 166 | * unknown ESC I ... F sequence 167 | */ 168 | DecodeAddControl( ESC ); 169 | if( TRUE == multi ){ 170 | DecodeAddControl( '$' ); 171 | } 172 | DecodeAddControl( ic ); 173 | if( FALSE == unknownSequence && FALSE == omitted ){ 174 | DecodeAddControl( ch ); 175 | } else { 176 | ch = ic; 177 | } 178 | while( ! IsFchar( ch ) ){ 179 | GetCharRet( ch ); 180 | DecodeAddControl( ch ); 181 | } 182 | return TRUE; 183 | } 184 | 185 | if( TRUE == allow_unify ){ 186 | if( charset == X0201ROMAN ) 187 | charset = ASCII; 188 | else if( C6226 == charset ) 189 | charset = X0208; 190 | } 191 | 192 | state->cset[ g ] = charset; 193 | 194 | return TRUE; 195 | } 196 | -------------------------------------------------------------------------------- /src/escape.h: -------------------------------------------------------------------------------- 1 | /* 2 | * escape.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: escape.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __ESCAPE_H__ 9 | #define __ESCAPE_H__ 10 | 11 | #include 12 | #include 13 | 14 | public boolean_t DecodeEscape( state_t *state ); 15 | 16 | #endif /* __ESCAPE_H__ */ 17 | -------------------------------------------------------------------------------- /src/eucjapan.c: -------------------------------------------------------------------------------- 1 | /* 2 | * eucjapan.c 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio. 5 | * $Id: eucjapan.c,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | /* 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | public void EncodeEUCjp( i_str_t *istr, int head, int tail, 31 | byte codingSystem, boolean_t binary ) 32 | { 33 | int idx, attr; 34 | ic_t ic; 35 | byte cset, g0, g1, g2, g3; 36 | 37 | g0 = cTable[ (int)codingSystem ].state.cset[ G0 ]; 38 | g1 = cTable[ (int)codingSystem ].state.cset[ G1 ]; 39 | g2 = cTable[ (int)codingSystem ].state.cset[ G2 ]; 40 | g3 = cTable[ (int)codingSystem ].state.cset[ G3 ]; 41 | 42 | for( idx = head ; idx < tail ; idx++ ){ 43 | cset = istr[ idx ].charset; 44 | ic = istr[ idx ].c; 45 | attr = (int)istr[ idx ].attr << 8; 46 | if( BIG5 == cset ) 47 | ic = BIG5toCNS( ic, &cset ); 48 | #ifndef MSDOS /* IF NOT DEFINED */ 49 | else if( UNICODE == cset ){ 50 | switch( codingSystem ){ 51 | case EUC_CHINA: ic = UNItoGB( ic, &cset ); break; 52 | case EUC_JAPAN: ic = UNItoJIS( ic, &cset ); break; 53 | case EUC_KOREA: ic = UNItoKSC( ic, &cset ); break; 54 | case EUC_TAIWAN:ic = UNItoCNS( ic, &cset ); break; 55 | default: ic = UNItoJIS( ic, &cset ); 56 | } 57 | } 58 | #endif /* MSDOS */ 59 | if( cset < PSEUDO ){ 60 | if( g0 == cset ){ 61 | if( TRUE == iTable[ (int)cset ].multi ){ 62 | EncodeAddChar( attr, MakeByte1( ic ) ); 63 | EncodeAddChar( attr, MakeByte2( ic ) ); 64 | } else { 65 | EncodeAddChar( attr, ic ); 66 | } 67 | continue; 68 | } else if( C6226 == cset && EUC_JAPAN == codingSystem ){ 69 | /* Japanese alternative g1 set */ 70 | } else if( g1 == cset ){ 71 | } else if( EUC_TAIWAN == codingSystem 72 | && ( cset >= CNS_2 && cset <= CNS_7 ) ){ 73 | EncodeAddChar( attr, SS2 ); 74 | EncodeAddChar( attr, ( cset - CNS_1 ) + 0xa1 ); 75 | } else if( g2 == cset ){ 76 | EncodeAddChar( attr, SS2 ); 77 | } else if( g3 == cset ){ 78 | EncodeAddChar( attr, SS3 ); 79 | } else { 80 | if( FALSE == EncodeAddInvalid( attr, ic, cset ) ) 81 | break; 82 | else 83 | continue; 84 | } 85 | if( TRUE == iTable[ (int)cset ].multi ){ 86 | EncodeAddChar( attr, 0x80 | MakeByte1( ic ) ); 87 | EncodeAddChar( attr, 0x80 | MakeByte2( ic ) ); 88 | } else { 89 | EncodeAddChar( attr, 0x80 | ic ); 90 | } 91 | } else if( FALSE == EncodeAddPseudo( attr, ic, cset, binary ) ){ 92 | break; 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/eucjapan.h: -------------------------------------------------------------------------------- 1 | /* 2 | * eucjapan.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: eucjapan.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __EUCJAPAN_H__ 9 | #define __EUCJAPAN_H__ 10 | 11 | #include 12 | 13 | public void EncodeEUCjp( i_str_t *istr, int head, int tail, 14 | byte codingSystem, boolean_t binary ); 15 | 16 | #endif /* __EUCJAPAN_H__ */ 17 | -------------------------------------------------------------------------------- /src/fetch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * fetch.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: fetch.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __FETCH_H__ 9 | #define __FETCH_H__ 10 | 11 | #include 12 | 13 | public boolean_t line_truncated; 14 | 15 | #define LineHead( line, index ) \ 16 | ( 0 == (index) ? 0 : (line)->head[ (index)-1 ].ptr ) 17 | 18 | #define LineLength( line, index ) \ 19 | ( LineHead( (line), (index)+1 ) - LineHead( (line), (index) ) ) 20 | 21 | #define LineWidth( line, index ) \ 22 | ( (line)->head[ (index) ].width ) 23 | 24 | public boolean_t FetchLine( file_t *f, unsigned int segment, int offset ); 25 | 26 | #endif /* __FETCH_H__ */ 27 | -------------------------------------------------------------------------------- /src/file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: file.h,v 1.8 2004/01/05 07:30:15 nrt Exp $ 6 | */ 7 | 8 | #ifndef __FILE_H__ 9 | #define __FILE_H__ 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #define LV_PAGE_SIZE 32U /* lines per page */ 20 | 21 | #ifdef MSDOS 22 | #define BLOCK_SIZE 2 /* segments on memory */ 23 | #define SLOT_SIZE 1024U /* file location pointers */ 24 | #define FRAME_SIZE 2U 25 | #else 26 | #define BLOCK_SIZE 4 /* segments on memory */ 27 | #define SLOT_SIZE 16384U /* file location pointers */ 28 | #define FRAME_SIZE 4096U 29 | #endif /* MSDOS */ 30 | 31 | #ifdef USE_INTERNAL_IOBUF 32 | # define IOBUF_DEFAULT_SIZE 256 33 | #endif 34 | 35 | typedef struct { 36 | int ptr; 37 | int width; 38 | boolean_t hit; 39 | } head_t; 40 | 41 | typedef struct { 42 | i_str_t *istr; 43 | int heads; /* physical line number */ 44 | head_t *head; 45 | } line_t; 46 | 47 | typedef struct { 48 | unsigned int segment; 49 | int lines; /* logical line number */ 50 | line_t line[ LV_PAGE_SIZE ]; 51 | } page_t; 52 | 53 | typedef struct { 54 | unsigned int seg; 55 | int blk; 56 | int off; 57 | int phy; 58 | } position_t; 59 | 60 | typedef struct { 61 | position_t top; 62 | position_t bot; 63 | int lines; 64 | } screen_t; 65 | 66 | typedef struct { 67 | position_t pos; 68 | i_str_t *pattern; 69 | boolean_t first; 70 | boolean_t displayed; 71 | boolean_t before_direction; 72 | } find_t; 73 | 74 | typedef struct { 75 | FILE *iop; 76 | #ifdef USE_INTERNAL_IOBUF 77 | byte buf[ IOBUF_DEFAULT_SIZE ]; 78 | size_t cur; 79 | size_t last; 80 | int ungetc; 81 | #endif 82 | } iobuf_t; 83 | 84 | #if defined( __GNUC__ ) || \ 85 | ( defined( __STDC_VERSION__ ) && ( __STDC_VERSION__ >= 199901L ) ) 86 | #define INLINE inline 87 | #elif defined( _MSC_VER ) 88 | #define INLINE __inline 89 | #else 90 | #define INLINE 91 | #endif /* __GNUC__, __STDC_VERSION__ */ 92 | 93 | #if defined( _MSC_VER ) && _MSC_VER >= 1400 94 | #define HAVE_FSEEKO 95 | #define off_t __int64 96 | #define ftello( a ) _ftelli64( a ) 97 | #define fseeko( a, b, c ) _fseeki64( a, b, c ) 98 | #endif /* _MSC_VER */ 99 | 100 | #ifdef HAVE_FSEEKO 101 | typedef off_t offset_t; 102 | #else 103 | typedef long offset_t; 104 | #endif 105 | 106 | typedef struct { 107 | byte *fileName; 108 | i_str_t *fileNameI18N; 109 | int fileNameLength; 110 | iobuf_t fp; 111 | iobuf_t sp; 112 | int pid; 113 | byte inputCodingSystem; 114 | byte outputCodingSystem; 115 | byte keyboardCodingSystem; 116 | byte pathnameCodingSystem; 117 | byte defaultCodingSystem; 118 | byte dummy; 119 | int width; 120 | int height; 121 | unsigned int lastSegment; 122 | unsigned int lastFrame; 123 | unsigned long totalLines; 124 | offset_t lastPtr; 125 | boolean_t done; 126 | boolean_t eof; 127 | boolean_t top; 128 | boolean_t bottom; 129 | boolean_t truncated; 130 | boolean_t dirty; 131 | find_t find; 132 | screen_t screen; 133 | boolean_t used[ BLOCK_SIZE ]; 134 | page_t page[ BLOCK_SIZE ]; 135 | offset_t *slot[ FRAME_SIZE ]; 136 | } file_t; 137 | 138 | #ifdef MSDOS 139 | #define line_t line_t far 140 | #define page_t page_t far 141 | #define file_t file_t far 142 | #else 143 | #ifndef far 144 | #define far 145 | #endif /* far */ 146 | #endif /* MSDOS */ 147 | 148 | #define Segment( line ) ( (line) / LV_PAGE_SIZE ) 149 | #define Offset( line ) ( (line) % LV_PAGE_SIZE ) 150 | #define Block( segment ) ( (segment) % BLOCK_SIZE ) 151 | #define Slot( segment ) ( (segment) % SLOT_SIZE ) 152 | #define Frame( segment ) ( (segment) / SLOT_SIZE ) 153 | 154 | public void FileFreeLine( file_t *f ); 155 | public byte *FileLoadLine( file_t *f, int *length, boolean_t *simple ); 156 | 157 | public file_t *FileAttach( byte *fileName, stream_t *st, 158 | int width, int height, 159 | byte inputCodingSystem, 160 | byte outputCodingSystem, 161 | byte keyboardCodingSystem, 162 | byte pathnameCodingSystem, 163 | byte defaultCodingSystem ); 164 | public void FilePreload( file_t *f ); 165 | 166 | public boolean_t FileFree( file_t *f ); 167 | public boolean_t FileDetach( file_t *f ); 168 | 169 | public boolean_t FileStretch( file_t *f, unsigned int target ); 170 | public boolean_t FileSeek( file_t *f, unsigned int segment ); 171 | 172 | public void FileRefresh( file_t *f ); 173 | public byte *FileStatus( file_t *f ); 174 | public byte *FileName( file_t *f ); 175 | 176 | public void FileInit(); 177 | 178 | #ifndef USE_INTERNAL_IOBUF 179 | # define IobufGetc( a ) getc( (a)->iop ) 180 | # define IobufUngetc( a, b ) ungetc( a, (b)->iop ) 181 | # ifdef HAVE_FSEEKO 182 | # define IobufFtell( a ) ftello( (a)->iop ) 183 | # define IobufFseek( a, b, c ) fseeko( (a)->iop, b, c) 184 | # else 185 | # define IobufFtell( a ) ftell( (a)->iop ) 186 | # define IobufFseek( a, b, c ) fseek( (a)->iop, b, c) 187 | # endif 188 | # define IobufFeof( a ) feof( (a)->iop ) 189 | #else 190 | public INLINE int IobufGetc( iobuf_t *iobuf ); 191 | public INLINE int IobufUngetc( int ch, iobuf_t *iobuf ); 192 | public offset_t IobufFtell( iobuf_t *iobuf ); 193 | public int IobufFseek( iobuf_t *iobuf, offset_t off, int mode ); 194 | public int IobufFeof( iobuf_t *iobuf ); 195 | #endif 196 | #define IobufPutc( a, b ) putc( a, (b)->iop ) 197 | 198 | #endif /* __FILE_H__ */ 199 | -------------------------------------------------------------------------------- /src/find.h: -------------------------------------------------------------------------------- 1 | /* 2 | * find.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: find.h,v 1.4 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __FIND_H__ 9 | #define __FIND_H__ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | typedef ic_t (*tolower_func_t)( byte, ic_t ); 16 | public tolower_func_t to_lower_func; 17 | 18 | typedef boolean_t (*find_func_t)( line_t * ); 19 | public find_func_t find_func; 20 | 21 | typedef boolean_t (*find_continue_func_t)( i_str_t * ); 22 | public find_continue_func_t find_only_func; 23 | 24 | public boolean_t casefold_search; 25 | public boolean_t regexp_search; 26 | 27 | #define ToLower( cset, c ) \ 28 | ( FALSE == casefold_search ? (c) \ 29 | : ( 'Z' < (c) || 'A' > (c) || ASCII != (cset) ) ? (c) \ 30 | : (c) + 0x20 ) 31 | 32 | public void FindSetup(); 33 | 34 | public byte *FindResetPattern( file_t *f, i_str_t *istr ); 35 | public byte *FindSetPattern( file_t *f, i_str_t *istr ); 36 | public boolean_t FindClearPattern( file_t *f ); 37 | 38 | public int FindForward( file_t *f ); 39 | public int FindBackward( file_t *f ); 40 | 41 | #endif /* __FIND_H__ */ 42 | -------------------------------------------------------------------------------- /src/guess.h: -------------------------------------------------------------------------------- 1 | /* 2 | * guess.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: guess.h,v 1.5 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __GUESS_H__ 9 | #define __GUESS_H__ 10 | 11 | #include 12 | 13 | public boolean_t adjust_charset; 14 | 15 | public byte GuessCodingSystem( byte *str, int length, byte defaultEuc ); 16 | public byte GuessHz( byte *str, int length ); 17 | public void AdjustPatternCharset( byte inputCodingSystem, 18 | byte keyboardCodingSystem, 19 | byte defaultCodingSystem, 20 | i_str_t *istr ); 21 | 22 | #endif /* __GUESS_H__ */ 23 | -------------------------------------------------------------------------------- /src/guesslocale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * guesslocale.h 3 | * 4 | * All rights reserved. Copyright (C) 2003 by Tomohiro KUBOTA 5 | * $Id: guesslocale.h,v 1.1 2003/11/06 06:53:52 nrt Exp $ 6 | */ 7 | 8 | #ifndef __GUESSLOCALE_H__ 9 | #define __GUESSLOCALE_H__ 10 | 11 | public byte LocaleCodingSystem( char *language ); 12 | public byte DetermineEUC( char *language, char defaultEuc ); 13 | public byte Determine8bit( char *language ); 14 | 15 | #endif /* __GUESSLOCALE_H__ */ 16 | -------------------------------------------------------------------------------- /src/hz.c: -------------------------------------------------------------------------------- 1 | /* 2 | * hz.c 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio. 5 | * $Id: hz.c,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | /* 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | public void EncodeHz( i_str_t *istr, int head, int tail, 31 | byte codingSystem, boolean_t binary ) 32 | { 33 | int idx, attr; 34 | ic_t ic; 35 | byte cset; 36 | boolean_t asciiMode = TRUE; 37 | 38 | for( idx = head ; idx < tail ; idx++ ){ 39 | cset = istr[ idx ].charset; 40 | ic = istr[ idx ].c; 41 | attr = (int)istr[ idx ].attr << 8; 42 | if( BIG5 == cset ) 43 | ic = BIG5toCNS( ic, &cset ); 44 | #ifndef MSDOS /* IF NOT DEFINED */ 45 | else if( UNICODE == cset ) 46 | ic = UNItoGB( ic, &cset ); 47 | #endif /* MSDOS */ 48 | if( cset < PSEUDO ){ 49 | if( ASCII == cset ){ 50 | if( FALSE == asciiMode ){ 51 | asciiMode = TRUE; 52 | EncodeAddChar( attr, (ic_t)'~' ); 53 | EncodeAddChar( attr, (ic_t)'}' ); 54 | } 55 | EncodeAddChar( attr, ic ); 56 | if( (ic_t)'~' == ic ) 57 | EncodeAddChar( attr, (ic_t)'~' ); 58 | } else if( GB2312 == cset ){ 59 | if( TRUE == asciiMode ){ 60 | asciiMode = FALSE; 61 | EncodeAddChar( attr, '~' ); 62 | EncodeAddChar( attr, '{' ); 63 | } 64 | EncodeAddChar( attr, MakeByte1( ic ) ); 65 | EncodeAddChar( attr, MakeByte2( ic ) ); 66 | } else { 67 | if( FALSE == EncodeAddInvalid( attr, ic, cset ) ) 68 | break; 69 | } 70 | } else if( FALSE == EncodeAddPseudo( attr, ic, cset, binary ) ){ 71 | break; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/hz.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hz.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: hz.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __HZ_H__ 9 | #define __HZ_H__ 10 | 11 | #include 12 | 13 | public void EncodeHz( i_str_t *istr, int head, int tail, 14 | byte codingSystem, boolean_t binary ); 15 | 16 | #endif /* __HZ_H__ */ 17 | -------------------------------------------------------------------------------- /src/ichar.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ichar.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: ichar.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __ICHAR_H__ 9 | #define __ICHAR_H__ 10 | 11 | /* 12 | * international character 13 | */ 14 | 15 | #ifdef MSDOS 16 | typedef unsigned long ic_t; 17 | #else /* MSDOS */ 18 | typedef unsigned int ic_t; 19 | #endif /* MSDOS */ 20 | 21 | #define ICHAR_WIDTH 4 22 | 23 | #define CNTRLWIDTH_SHORTFORM 1 /* 0x00 .. 0x1f */ 24 | #define CNTRLWIDTH_MIDDLEFORM 2 /* 0x20 .. 0x7e */ 25 | #define CNTRLWIDTH_LONGFORM 4 /* 0x7f .. 0xff */ 26 | 27 | #define HTAB_WIDTH 8 28 | #define HTAB_INTERNAL_WIDTH 2 29 | 30 | #define MakeByte1( ic ) ( (byte)( (ic) >> 8 ) ) 31 | #define MakeByte2( ic ) ( (byte)( 0x00ff & (ic) ) ) 32 | #define MakeIchar( c1, c2 ) ( ( (ic_t)(c1) << 8 ) | (ic_t)(c2) ) 33 | 34 | typedef struct { 35 | byte charset; 36 | byte attr; 37 | ic_t c; 38 | } i_str_t; 39 | 40 | #ifdef MSDOS 41 | #define i_str_t i_str_t far 42 | #else 43 | #ifndef far 44 | #define far 45 | #endif /* far */ 46 | #endif /* MSDOS */ 47 | 48 | #endif /* __ICHAR_H__ */ 49 | -------------------------------------------------------------------------------- /src/import.h: -------------------------------------------------------------------------------- 1 | /* 2 | * import.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: import.h,v 1.4 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __IMPORT_H__ 9 | #define __IMPORT_H__ 10 | 11 | #include 12 | 13 | #define public extern 14 | #define private static 15 | 16 | #define byte unsigned char 17 | 18 | #endif /* __IMPORT_H__ */ 19 | -------------------------------------------------------------------------------- /src/iscygpty.h: -------------------------------------------------------------------------------- 1 | /* 2 | * iscygpty.h -- part of ptycheck 3 | * https://github.com/k-takata/ptycheck 4 | * 5 | * Copyright (c) 2015-2017 K.Takata 6 | * 7 | * You can redistribute it and/or modify it under the terms of either 8 | * the MIT license (as described below) or the Vim license. 9 | * 10 | * Permission is hereby granted, free of charge, to any person obtaining 11 | * a copy of this software and associated documentation files (the 12 | * "Software"), to deal in the Software without restriction, including 13 | * without limitation the rights to use, copy, modify, merge, publish, 14 | * distribute, sublicense, and/or sell copies of the Software, and to 15 | * permit persons to whom the Software is furnished to do so, subject to 16 | * the following conditions: 17 | * 18 | * The above copyright notice and this permission notice shall be 19 | * included in all copies or substantial portions of the Software. 20 | * 21 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 25 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | */ 29 | 30 | #ifndef _ISCYGPTY_H 31 | #define _ISCYGPTY_H 32 | 33 | #ifdef _WIN32 34 | int is_cygpty(int fd); 35 | int is_cygpty_used(void); 36 | #else 37 | #define is_cygpty(fd) 0 38 | #define is_cygpty_used() 0 39 | #endif 40 | 41 | #endif /* _ISCYGPTY_H */ 42 | -------------------------------------------------------------------------------- /src/iso2022.c: -------------------------------------------------------------------------------- 1 | /* 2 | * iso2022.c 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio. 5 | * $Id: iso2022.c,v 1.6 2004/01/05 07:23:29 nrt Exp $ 6 | */ 7 | /* 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | public void DecodeISO2022( state_t *state, byte codingSystem ) 32 | { 33 | int region; 34 | byte charset, ch, rch; 35 | byte c[ ICHAR_WIDTH ]; 36 | 37 | for( ; ; ){ 38 | GetChar( ch ); 39 | if( ch < SP ){ 40 | if( ESC == ch ){ 41 | if( FALSE == DecodeEscape( state ) ) 42 | break; 43 | } else if( HT == ch ) 44 | DecodeAddTab( state->attr ); 45 | else if( SO == ch ) /* LS1 for 8bit */ 46 | state->gset[ GL ] = G1; 47 | else if( SI == ch ) /* LS0 for 8bit */ 48 | state->gset[ GL ] = G0; 49 | else if( BS == ch ) 50 | DecodeAddBs(); 51 | else if( EM == ch ) 52 | state->sset = G2; 53 | else 54 | DecodeAddControl( ch ); 55 | } else { 56 | if( '~' == ch && TRUE == hz_detection ){ 57 | switch( STR[ SIDX ] ){ 58 | case '~': 59 | if( ASCII == state->cset[ G0 ] ) 60 | IncStringIndex(); 61 | break; /* break for '~' itself.*/ 62 | case '{': 63 | if( ASCII == state->cset[ G0 ] ){ 64 | IncStringIndex(); 65 | state->cset[ G0 ] = GB2312; 66 | continue; 67 | } 68 | break; 69 | case '}': 70 | if( GB2312 == state->cset[ G0 ] ){ 71 | IncStringIndex(); 72 | state->cset[ G0 ] = ASCII; 73 | continue; 74 | } 75 | break; 76 | } 77 | } 78 | rch = ch; 79 | if( 0 != state->sset ){ 80 | /* 81 | * single shifted character 82 | */ 83 | if( EUC_TAIWAN == codingSystem && G2 == state->sset ){ 84 | charset = CNS_1 + ( ch - 0xa1 ); 85 | if( charset < CNS_1 || charset > CNS_7 ){ 86 | state->sset = 0; 87 | continue; 88 | } 89 | GetChar( ch ); 90 | } else { 91 | charset = SSET; 92 | } 93 | state->sset = 0; 94 | ch &= 0x7f; /* for EUC */ 95 | if( !IsGraphicChar( charset, ch ) ){ 96 | if( SP == ch ){ 97 | DecodeAddSpace( state->attr ); 98 | } else { 99 | DecodeAddControl( rch ); 100 | } 101 | continue; 102 | } 103 | c[ 0 ] = ch; 104 | if( TRUE == iTable[ (int)charset ].multi ){ 105 | GetChar( ch ); 106 | if( !IsGraphicChar( charset, ch & 0x7f ) ){ 107 | DecodeAddControl( rch ); 108 | DecodeAddControl( ch ); 109 | continue; 110 | } 111 | c[ 1 ] = ch & 0x7f; /* for EUC */ 112 | } 113 | } else { 114 | if( 0x80 & ch ){ 115 | if( SS2 == ch ){ 116 | state->sset = G2; 117 | continue; 118 | } else if( SS3 == ch ){ 119 | state->sset = G3; 120 | continue; 121 | } 122 | region = GR; 123 | ch &= 0x7f; 124 | } else { 125 | region = GL; 126 | } 127 | charset = CSET( region ); 128 | if( !IsGraphicChar( charset, ch ) ){ 129 | if( SP == ch ){ 130 | DecodeAddSpace( state->attr ); 131 | } else { 132 | DecodeAddControl( rch ); 133 | } 134 | continue; 135 | } 136 | c[ 0 ] = ch; 137 | if( TRUE == iTable[ (int)charset ].multi ){ 138 | GetChar( ch ); 139 | ch &= 0x7f; 140 | if( !IsGraphicChar( charset, ch ) ) 141 | continue; 142 | c[ 1 ] = ch; 143 | } 144 | } 145 | DecodeAddChar( charset, c, state->attr ); 146 | } 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /src/iso2022.h: -------------------------------------------------------------------------------- 1 | /* 2 | * iso2022.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: iso2022.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __ISO2022_H__ 9 | #define __ISO2022_H__ 10 | 11 | #include 12 | #include 13 | 14 | public void DecodeISO2022( state_t *state, byte codingSystem ); 15 | 16 | #endif /* __ISO2022_H__ */ 17 | -------------------------------------------------------------------------------- /src/iso2cn.c: -------------------------------------------------------------------------------- 1 | /* 2 | * iso2cn.c 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio. 5 | * $Id: iso2cn.c,v 1.4 2004/01/05 07:23:29 nrt Exp $ 6 | */ 7 | /* 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | /* 33 | * iso-2022-cn, iso-2022-cn-ext 34 | * 35 | * G0: ASCII 36 | * G1: GB 2312-80, CNS 11643-1992 Plane 1, and ISO-IR-165 37 | * G2: CNS 11643-1992 Pane 2 38 | * G3: CNS 11643-1992 Pane 3, 4, 5, 6, 7 39 | */ 40 | 41 | public void EncodeISO2022cn( i_str_t *istr, int head, int tail, 42 | byte codingSystem, boolean_t binary ) 43 | { 44 | int idx, attr; 45 | ic_t ic; 46 | byte cset, gl, lastCsetG1, lastCsetG2, lastCsetG3, shiftState; 47 | boolean_t set94; 48 | 49 | attr = 0; 50 | gl = G0; 51 | lastCsetG1 = lastCsetG2 = lastCsetG3 = ASCII; 52 | shiftState = NUL; 53 | 54 | for( idx = head ; idx < tail ; idx++ ){ 55 | cset = istr[ idx ].charset; 56 | ic = istr[ idx ].c; 57 | attr = (int)istr[ idx ].attr << 8; 58 | if( BIG5 == cset ) 59 | ic = BIG5toCNS( ic, &cset ); 60 | #ifndef MSDOS /* IF NOT DEFINED */ 61 | else if( UNICODE == cset ) 62 | ic = UNItoChinese( ic, &cset ); 63 | #endif /* MSDOS */ 64 | set94 = iTable[ (int)cset ].set94; 65 | if( ASCII == cset || cset > PSEUDO ){ 66 | shiftState = NUL; 67 | if( gl != G0 ){ 68 | gl = G0; 69 | EncodeAddCharAbsolutely( attr, SI ); 70 | } 71 | } else if( CNS_1 == cset || GB2312 == cset || ISO_IR_165 == cset ){ 72 | shiftState = NUL; 73 | if( gl != G1 ){ 74 | gl = G1; 75 | EncodeAddCharAbsolutely( attr, SO ); 76 | } 77 | if( lastCsetG1 != cset ){ 78 | EncodeAddEscapeDollar( attr ); 79 | EncodeAddCharAbsolutely( attr, ')' ); 80 | EncodeAddCharAbsolutely( attr, iTable[ (int)cset ].fin ); 81 | } 82 | lastCsetG1 = cset; 83 | } else if( cset >= CNS_3 && cset <= CNS_7 ){ 84 | shiftState = SS3; 85 | if( lastCsetG3 != cset ){ 86 | EncodeAddEscapeDollar( attr ); 87 | EncodeAddCharAbsolutely( attr, '+' ); 88 | EncodeAddCharAbsolutely( attr, iTable[ (int)cset ].fin ); 89 | } 90 | lastCsetG3 = cset; 91 | } else { 92 | /* CNS_2 */ 93 | shiftState = SS2; 94 | if( lastCsetG2 != cset ){ 95 | EncodeAddCharAbsolutely( attr, ESC ); 96 | if( TRUE == iTable[ (int)cset ].multi ){ 97 | EncodeAddCharAbsolutely( attr, '$' ); 98 | } 99 | if( TRUE == set94 ){ 100 | EncodeAddCharAbsolutely( attr, '*' ); /* designate set94 to G2 */ 101 | } else { 102 | EncodeAddCharAbsolutely( attr, '.' ); /* designate set96 to G2 */ 103 | } 104 | EncodeAddCharAbsolutely( attr, iTable[ (int)cset ].fin ); 105 | } 106 | lastCsetG2 = cset; 107 | } 108 | if( cset < PSEUDO ){ 109 | switch( shiftState ){ 110 | case SS2: 111 | EncodeAdd7bitSS2( attr ); 112 | break; 113 | case SS3: 114 | EncodeAdd7bitSS3( attr ); 115 | break; 116 | } 117 | if( TRUE == iTable[ (int)cset ].multi ){ 118 | EncodeAddChar( attr, MakeByte1( ic ) ); 119 | EncodeAddChar( attr, MakeByte2( ic ) ); 120 | } else { 121 | EncodeAddChar( attr, ic ); 122 | } 123 | } else if( FALSE == EncodeAddPseudo( attr, ic, cset, binary ) ){ 124 | break; 125 | } 126 | } 127 | if( gl != G0 ){ 128 | EncodeAddCharAbsolutely( attr, SI ); 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /src/iso2cn.h: -------------------------------------------------------------------------------- 1 | /* 2 | * iso2cn.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: iso2cn.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __ISO2CN_H__ 9 | #define __ISO2CN_H__ 10 | 11 | #include 12 | #include 13 | 14 | public void EncodeISO2022cn( i_str_t *istr, int head, int tail, 15 | byte codingSystem, boolean_t binary ); 16 | 17 | #endif /* __ISO2CN_H__ */ 18 | -------------------------------------------------------------------------------- /src/iso2jp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * iso2jp.c 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio. 5 | * $Id: iso2jp.c,v 1.5 2004/01/05 07:23:29 nrt Exp $ 6 | */ 7 | /* 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | /* 33 | * iso-2022-jp 34 | * 35 | * all 94charsets use G0, and all 96charsets use G2 with single shift. 36 | */ 37 | public void EncodeISO2022jp( i_str_t *istr, int head, int tail, 38 | byte codingSystem, boolean_t binary ) 39 | { 40 | int idx, attr; 41 | ic_t ic; 42 | byte cset, lastCset, lastCsetG0, lastCsetG2; 43 | boolean_t lastSet94, set94, bit8 = FALSE; 44 | 45 | attr = 0; 46 | lastCset = lastCsetG0 = lastCsetG2 = ASCII; 47 | lastSet94 = TRUE; 48 | 49 | for( idx = head ; idx < tail ; idx++ ){ 50 | cset = istr[ idx ].charset; 51 | ic = istr[ idx ].c; 52 | attr = (int)istr[ idx ].attr << 8; 53 | if( BIG5 == cset ) 54 | ic = BIG5toCNS( ic, &cset ); 55 | #ifndef MSDOS /* IF NOT DEFINED */ 56 | else if( UNICODE == cset ) 57 | ic = UNItoJapanese( ic, &cset ); 58 | #endif /* MSDOS */ 59 | set94 = iTable[ (int)cset ].set94; 60 | if( lastSet94 != set94 ){ 61 | if( TRUE == set94 ){ 62 | lastCsetG2 = lastCset; 63 | lastCset = lastCsetG0; 64 | } else { 65 | lastCsetG0 = lastCset; 66 | lastCset = lastCsetG2; 67 | } 68 | } 69 | lastSet94 = set94; 70 | if( lastCset != cset ){ 71 | if( !( ( lastCset == ASCII && cset > PSEUDO ) 72 | || ( lastCset > PSEUDO && ASCII == cset ) 73 | || ( lastCset > PSEUDO && cset > PSEUDO ) ) ){ 74 | EncodeAddCharAbsolutely( attr, ESC ); 75 | if( TRUE == iTable[ (int)cset ].multi ){ 76 | EncodeAddCharAbsolutely( attr, '$' ); 77 | if( !( cset == X0208 || cset == C6226 || cset == GB2312 ) ){ 78 | if( TRUE == set94 ){ 79 | EncodeAddCharAbsolutely( attr, '(' ); 80 | } else { 81 | EncodeAddCharAbsolutely( attr, '.' ); 82 | } 83 | } 84 | } else { 85 | if( TRUE == set94 ){ 86 | EncodeAddCharAbsolutely( attr, '(' ); /* designate set94 to G0 */ 87 | } else { 88 | EncodeAddCharAbsolutely( attr, '.' ); /* designate set96 to G2 */ 89 | } 90 | } 91 | EncodeAddCharAbsolutely( attr, iTable[ (int)cset ].fin ); 92 | } 93 | } 94 | lastCset = cset; 95 | if( cset < PSEUDO ){ 96 | if( FALSE == set94 ){ 97 | if( TRUE == bit8 ){ 98 | EncodeAddChar( attr, SS2 ); 99 | } else { 100 | EncodeAdd7bitSS2( attr ); 101 | } 102 | } 103 | if( TRUE == iTable[ (int)cset ].multi ){ 104 | EncodeAddChar( attr, MakeByte1( ic ) ); 105 | EncodeAddChar( attr, MakeByte2( ic ) ); 106 | } else { 107 | EncodeAddChar( attr, ic ); 108 | } 109 | } else if( FALSE == EncodeAddPseudo( attr, ic, cset, binary ) ){ 110 | break; 111 | } 112 | } 113 | if( TRUE != lastSet94 ) 114 | lastCset = lastCsetG0; 115 | if( ASCII != lastCset && lastCset < PSEUDO ){ 116 | EncodeAddCharAbsolutely( attr, ESC ); 117 | EncodeAddCharAbsolutely( attr, '(' ); 118 | EncodeAddCharAbsolutely( attr, iTable[ ASCII ].fin ); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /src/iso2jp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * iso2jp.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: iso2jp.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __ISO2JP_H__ 9 | #define __ISO2JP_H__ 10 | 11 | #include 12 | #include 13 | 14 | public void EncodeISO2022jp( i_str_t *istr, int head, int tail, 15 | byte codingSystem, boolean_t binary ); 16 | 17 | #endif /* __ISO2JP_H__ */ 18 | -------------------------------------------------------------------------------- /src/iso2kr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * iso2kr.c 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio. 5 | * $Id: iso2kr.c,v 1.4 2004/01/05 07:23:29 nrt Exp $ 6 | */ 7 | /* 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | /* 33 | * iso-2022-kr 34 | * 35 | * All charsets except ASCII use only G1 with locking shift. 36 | */ 37 | public void EncodeISO2022kr( i_str_t *istr, int head, int tail, 38 | byte codingSystem, boolean_t binary ) 39 | { 40 | int idx, attr; 41 | ic_t ic; 42 | byte cset, gl, lastCsetG1; 43 | boolean_t set94; 44 | 45 | attr = 0; 46 | gl = G0; 47 | lastCsetG1 = ASCII; 48 | 49 | for( idx = head ; idx < tail ; idx++ ){ 50 | cset = istr[ idx ].charset; 51 | attr = istr[ idx ].attr << 8; 52 | ic = istr[ idx ].c; 53 | if( BIG5 == cset ) 54 | ic = BIG5toCNS( ic, &cset ); 55 | #ifndef MSDOS /* IF NOT DEFINED */ 56 | else if( UNICODE == cset ) 57 | ic = UNItoKorean( ic, &cset ); 58 | #endif /* MSDOS */ 59 | set94 = iTable[ (int)cset ].set94; 60 | if( ASCII == cset || cset > PSEUDO ){ 61 | if( gl != G0 ){ 62 | gl = G0; 63 | EncodeAddCharAbsolutely( attr, SI ); 64 | } 65 | } else { 66 | if( gl != G1 ){ 67 | gl = G1; 68 | EncodeAddCharAbsolutely( attr, SO ); 69 | } 70 | if( lastCsetG1 != cset ){ 71 | EncodeAddCharAbsolutely( attr, ESC ); 72 | if( TRUE == iTable[ (int)cset ].multi ){ 73 | EncodeAddCharAbsolutely( attr, '$' ); 74 | } 75 | if( TRUE == set94 ){ 76 | EncodeAddCharAbsolutely( attr, ')' ); /* designate set94 to G1 */ 77 | } else { 78 | EncodeAddCharAbsolutely( attr, '-' ); /* designate set96 to G1 */ 79 | } 80 | EncodeAddCharAbsolutely( attr, iTable[ (int)cset ].fin ); 81 | } 82 | lastCsetG1 = cset; 83 | } 84 | if( cset < PSEUDO ){ 85 | if( TRUE == iTable[ (int)cset ].multi ){ 86 | EncodeAddChar( attr, MakeByte1( ic ) ); 87 | EncodeAddChar( attr, MakeByte2( ic ) ); 88 | } else { 89 | EncodeAddChar( attr, ic ); 90 | } 91 | } else if( FALSE == EncodeAddPseudo( attr, ic, cset, binary ) ){ 92 | break; 93 | } 94 | } 95 | if( gl != G0 ){ 96 | EncodeAddCharAbsolutely( attr, SI ); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/iso2kr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * iso2kr.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: iso2kr.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __ISO2KR_H__ 9 | #define __ISO2KR_H__ 10 | 11 | #include 12 | #include 13 | 14 | public void EncodeISO2022kr( i_str_t *istr, int head, int tail, 15 | byte codingSystem, boolean_t binary ); 16 | 17 | #endif /* __ISO2KR_H__ */ 18 | -------------------------------------------------------------------------------- /src/iso8859.c: -------------------------------------------------------------------------------- 1 | /* 2 | * iso8859.c 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio. 5 | * $Id: iso8859.c,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | /* 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | /* 32 | * iso-8859-* 33 | * 34 | * one pre-designated 8bit charset uses G1. 35 | */ 36 | public void EncodeISO8859( i_str_t *istr, int head, int tail, 37 | byte codingSystem, boolean_t binary ) 38 | { 39 | int idx, attr; 40 | ic_t ic; 41 | byte cset, csetG1 = ASCII; 42 | 43 | csetG1 = cTable[ (int)codingSystem ].state.cset[ G1 ]; 44 | 45 | for( idx = head ; idx < tail ; idx++ ){ 46 | cset = istr[ idx ].charset; 47 | ic = istr[ idx ].c; 48 | attr = (int)istr[ idx ].attr << 8; 49 | #ifndef MSDOS /* IF NOT DEFINED */ 50 | if( UNICODE == cset ) 51 | ic = UNItoISO8859( ic, &cset, codingSystem ); 52 | #endif /* MSDOS */ 53 | if( cset < PSEUDO ){ 54 | if( ASCII == cset ){ 55 | EncodeAddChar( attr, ic ); 56 | } else if( csetG1 == cset ){ 57 | EncodeAddChar( attr, 0x80 | ic ); 58 | } else { 59 | if( FALSE == EncodeAddInvalid( attr, ic, cset ) ) 60 | break; 61 | } 62 | } else if( FALSE == EncodeAddPseudo( attr, ic, cset, binary ) ){ 63 | break; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/iso8859.h: -------------------------------------------------------------------------------- 1 | /* 2 | * iso8859.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: iso8859.h,v 1.2 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __ISO8859_H__ 9 | #define __ISO8859_H__ 10 | 11 | #include 12 | #include 13 | 14 | public void EncodeISO8859( i_str_t *istr, int head, int tail, 15 | byte codingSystem, boolean_t binary ); 16 | 17 | #endif /* __ISO8859_H__ */ 18 | -------------------------------------------------------------------------------- /src/iso885910.map: -------------------------------------------------------------------------------- 1 | private codes_t mapISO8859_10[ 96 ] = { 2 | { 0x00A0, 0x20 }, 3 | { 0x00A7, 0x27 }, 4 | { 0x00AD, 0x2d }, 5 | { 0x00B0, 0x30 }, 6 | { 0x00B7, 0x37 }, 7 | { 0x00C1, 0x41 }, 8 | { 0x00C2, 0x42 }, 9 | { 0x00C3, 0x43 }, 10 | { 0x00C4, 0x44 }, 11 | { 0x00C5, 0x45 }, 12 | { 0x00C6, 0x46 }, 13 | { 0x00C9, 0x49 }, 14 | { 0x00CB, 0x4b }, 15 | { 0x00CD, 0x4d }, 16 | { 0x00CE, 0x4e }, 17 | { 0x00CF, 0x4f }, 18 | { 0x00D0, 0x50 }, 19 | { 0x00D3, 0x53 }, 20 | { 0x00D4, 0x54 }, 21 | { 0x00D5, 0x55 }, 22 | { 0x00D6, 0x56 }, 23 | { 0x00D8, 0x58 }, 24 | { 0x00DA, 0x5a }, 25 | { 0x00DB, 0x5b }, 26 | { 0x00DC, 0x5c }, 27 | { 0x00DD, 0x5d }, 28 | { 0x00DE, 0x5e }, 29 | { 0x00DF, 0x5f }, 30 | { 0x00E1, 0x61 }, 31 | { 0x00E2, 0x62 }, 32 | { 0x00E3, 0x63 }, 33 | { 0x00E4, 0x64 }, 34 | { 0x00E5, 0x65 }, 35 | { 0x00E6, 0x66 }, 36 | { 0x00E9, 0x69 }, 37 | { 0x00EB, 0x6b }, 38 | { 0x00ED, 0x6d }, 39 | { 0x00EE, 0x6e }, 40 | { 0x00EF, 0x6f }, 41 | { 0x00F0, 0x70 }, 42 | { 0x00F3, 0x73 }, 43 | { 0x00F4, 0x74 }, 44 | { 0x00F5, 0x75 }, 45 | { 0x00F6, 0x76 }, 46 | { 0x00F8, 0x78 }, 47 | { 0x00FA, 0x7a }, 48 | { 0x00FB, 0x7b }, 49 | { 0x00FC, 0x7c }, 50 | { 0x00FD, 0x7d }, 51 | { 0x00FE, 0x7e }, 52 | { 0x0100, 0x40 }, 53 | { 0x0101, 0x60 }, 54 | { 0x0104, 0x21 }, 55 | { 0x0105, 0x31 }, 56 | { 0x010C, 0x48 }, 57 | { 0x010D, 0x68 }, 58 | { 0x0110, 0x29 }, 59 | { 0x0111, 0x39 }, 60 | { 0x0112, 0x22 }, 61 | { 0x0113, 0x32 }, 62 | { 0x0116, 0x4c }, 63 | { 0x0117, 0x6c }, 64 | { 0x0118, 0x4a }, 65 | { 0x0119, 0x6a }, 66 | { 0x0122, 0x23 }, 67 | { 0x0123, 0x33 }, 68 | { 0x0128, 0x25 }, 69 | { 0x0129, 0x35 }, 70 | { 0x012A, 0x24 }, 71 | { 0x012B, 0x34 }, 72 | { 0x012E, 0x47 }, 73 | { 0x012F, 0x67 }, 74 | { 0x0136, 0x26 }, 75 | { 0x0137, 0x36 }, 76 | { 0x0138, 0x7f }, 77 | { 0x013B, 0x28 }, 78 | { 0x013C, 0x38 }, 79 | { 0x0145, 0x51 }, 80 | { 0x0146, 0x71 }, 81 | { 0x014A, 0x2f }, 82 | { 0x014B, 0x3f }, 83 | { 0x014C, 0x52 }, 84 | { 0x014D, 0x72 }, 85 | { 0x0160, 0x2a }, 86 | { 0x0161, 0x3a }, 87 | { 0x0166, 0x2b }, 88 | { 0x0167, 0x3b }, 89 | { 0x0168, 0x57 }, 90 | { 0x0169, 0x77 }, 91 | { 0x016A, 0x2e }, 92 | { 0x016B, 0x3e }, 93 | { 0x0172, 0x59 }, 94 | { 0x0173, 0x79 }, 95 | { 0x017D, 0x2c }, 96 | { 0x017E, 0x3c }, 97 | { 0x2015, 0x3d } 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso885910.rev: -------------------------------------------------------------------------------- 1 | private ic_t revISO8859_10[ 96 ] = { 2 | 0x00A0, 3 | 0x0104, 4 | 0x0112, 5 | 0x0122, 6 | 0x012A, 7 | 0x0128, 8 | 0x0136, 9 | 0x00A7, 10 | 0x013B, 11 | 0x0110, 12 | 0x0160, 13 | 0x0166, 14 | 0x017D, 15 | 0x00AD, 16 | 0x016A, 17 | 0x014A, 18 | 0x00B0, 19 | 0x0105, 20 | 0x0113, 21 | 0x0123, 22 | 0x012B, 23 | 0x0129, 24 | 0x0137, 25 | 0x00B7, 26 | 0x013C, 27 | 0x0111, 28 | 0x0161, 29 | 0x0167, 30 | 0x017E, 31 | 0x2015, 32 | 0x016B, 33 | 0x014B, 34 | 0x0100, 35 | 0x00C1, 36 | 0x00C2, 37 | 0x00C3, 38 | 0x00C4, 39 | 0x00C5, 40 | 0x00C6, 41 | 0x012E, 42 | 0x010C, 43 | 0x00C9, 44 | 0x0118, 45 | 0x00CB, 46 | 0x0116, 47 | 0x00CD, 48 | 0x00CE, 49 | 0x00CF, 50 | 0x00D0, 51 | 0x0145, 52 | 0x014C, 53 | 0x00D3, 54 | 0x00D4, 55 | 0x00D5, 56 | 0x00D6, 57 | 0x0168, 58 | 0x00D8, 59 | 0x0172, 60 | 0x00DA, 61 | 0x00DB, 62 | 0x00DC, 63 | 0x00DD, 64 | 0x00DE, 65 | 0x00DF, 66 | 0x0101, 67 | 0x00E1, 68 | 0x00E2, 69 | 0x00E3, 70 | 0x00E4, 71 | 0x00E5, 72 | 0x00E6, 73 | 0x012F, 74 | 0x010D, 75 | 0x00E9, 76 | 0x0119, 77 | 0x00EB, 78 | 0x0117, 79 | 0x00ED, 80 | 0x00EE, 81 | 0x00EF, 82 | 0x00F0, 83 | 0x0146, 84 | 0x014D, 85 | 0x00F3, 86 | 0x00F4, 87 | 0x00F5, 88 | 0x00F6, 89 | 0x0169, 90 | 0x00F8, 91 | 0x0173, 92 | 0x00FA, 93 | 0x00FB, 94 | 0x00FC, 95 | 0x00FD, 96 | 0x00FE, 97 | 0x0138 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso885911.map: -------------------------------------------------------------------------------- 1 | private codes_t mapISO8859_11[ 88 ] = { 2 | { 0x00A0, 0x20 }, 3 | { 0x0E01, 0x21 }, 4 | { 0x0E02, 0x22 }, 5 | { 0x0E03, 0x23 }, 6 | { 0x0E04, 0x24 }, 7 | { 0x0E05, 0x25 }, 8 | { 0x0E06, 0x26 }, 9 | { 0x0E07, 0x27 }, 10 | { 0x0E08, 0x28 }, 11 | { 0x0E09, 0x29 }, 12 | { 0x0E0A, 0x2a }, 13 | { 0x0E0B, 0x2b }, 14 | { 0x0E0C, 0x2c }, 15 | { 0x0E0D, 0x2d }, 16 | { 0x0E0E, 0x2e }, 17 | { 0x0E0F, 0x2f }, 18 | { 0x0E10, 0x30 }, 19 | { 0x0E11, 0x31 }, 20 | { 0x0E12, 0x32 }, 21 | { 0x0E13, 0x33 }, 22 | { 0x0E14, 0x34 }, 23 | { 0x0E15, 0x35 }, 24 | { 0x0E16, 0x36 }, 25 | { 0x0E17, 0x37 }, 26 | { 0x0E18, 0x38 }, 27 | { 0x0E19, 0x39 }, 28 | { 0x0E1A, 0x3a }, 29 | { 0x0E1B, 0x3b }, 30 | { 0x0E1C, 0x3c }, 31 | { 0x0E1D, 0x3d }, 32 | { 0x0E1E, 0x3e }, 33 | { 0x0E1F, 0x3f }, 34 | { 0x0E20, 0x40 }, 35 | { 0x0E21, 0x41 }, 36 | { 0x0E22, 0x42 }, 37 | { 0x0E23, 0x43 }, 38 | { 0x0E24, 0x44 }, 39 | { 0x0E25, 0x45 }, 40 | { 0x0E26, 0x46 }, 41 | { 0x0E27, 0x47 }, 42 | { 0x0E28, 0x48 }, 43 | { 0x0E29, 0x49 }, 44 | { 0x0E2A, 0x4a }, 45 | { 0x0E2B, 0x4b }, 46 | { 0x0E2C, 0x4c }, 47 | { 0x0E2D, 0x4d }, 48 | { 0x0E2E, 0x4e }, 49 | { 0x0E2F, 0x4f }, 50 | { 0x0E30, 0x50 }, 51 | { 0x0E31, 0x51 }, 52 | { 0x0E32, 0x52 }, 53 | { 0x0E33, 0x53 }, 54 | { 0x0E34, 0x54 }, 55 | { 0x0E35, 0x55 }, 56 | { 0x0E36, 0x56 }, 57 | { 0x0E37, 0x57 }, 58 | { 0x0E38, 0x58 }, 59 | { 0x0E39, 0x59 }, 60 | { 0x0E3A, 0x5a }, 61 | { 0x0E3F, 0x5f }, 62 | { 0x0E40, 0x60 }, 63 | { 0x0E41, 0x61 }, 64 | { 0x0E42, 0x62 }, 65 | { 0x0E43, 0x63 }, 66 | { 0x0E44, 0x64 }, 67 | { 0x0E45, 0x65 }, 68 | { 0x0E46, 0x66 }, 69 | { 0x0E47, 0x67 }, 70 | { 0x0E48, 0x68 }, 71 | { 0x0E49, 0x69 }, 72 | { 0x0E4A, 0x6a }, 73 | { 0x0E4B, 0x6b }, 74 | { 0x0E4C, 0x6c }, 75 | { 0x0E4D, 0x6d }, 76 | { 0x0E4E, 0x6e }, 77 | { 0x0E4F, 0x6f }, 78 | { 0x0E50, 0x70 }, 79 | { 0x0E51, 0x71 }, 80 | { 0x0E52, 0x72 }, 81 | { 0x0E53, 0x73 }, 82 | { 0x0E54, 0x74 }, 83 | { 0x0E55, 0x75 }, 84 | { 0x0E56, 0x76 }, 85 | { 0x0E57, 0x77 }, 86 | { 0x0E58, 0x78 }, 87 | { 0x0E59, 0x79 }, 88 | { 0x0E5A, 0x7a }, 89 | { 0x0E5B, 0x7b } 90 | }; 91 | -------------------------------------------------------------------------------- /src/iso885911.rev: -------------------------------------------------------------------------------- 1 | private ic_t revISO8859_11[ 96 ] = { 2 | 0x00A0, 3 | 0x0E01, 4 | 0x0E02, 5 | 0x0E03, 6 | 0x0E04, 7 | 0x0E05, 8 | 0x0E06, 9 | 0x0E07, 10 | 0x0E08, 11 | 0x0E09, 12 | 0x0E0A, 13 | 0x0E0B, 14 | 0x0E0C, 15 | 0x0E0D, 16 | 0x0E0E, 17 | 0x0E0F, 18 | 0x0E10, 19 | 0x0E11, 20 | 0x0E12, 21 | 0x0E13, 22 | 0x0E14, 23 | 0x0E15, 24 | 0x0E16, 25 | 0x0E17, 26 | 0x0E18, 27 | 0x0E19, 28 | 0x0E1A, 29 | 0x0E1B, 30 | 0x0E1C, 31 | 0x0E1D, 32 | 0x0E1E, 33 | 0x0E1F, 34 | 0x0E20, 35 | 0x0E21, 36 | 0x0E22, 37 | 0x0E23, 38 | 0x0E24, 39 | 0x0E25, 40 | 0x0E26, 41 | 0x0E27, 42 | 0x0E28, 43 | 0x0E29, 44 | 0x0E2A, 45 | 0x0E2B, 46 | 0x0E2C, 47 | 0x0E2D, 48 | 0x0E2E, 49 | 0x0E2F, 50 | 0x0E30, 51 | 0x0E31, 52 | 0x0E32, 53 | 0x0E33, 54 | 0x0E34, 55 | 0x0E35, 56 | 0x0E36, 57 | 0x0E37, 58 | 0x0E38, 59 | 0x0E39, 60 | 0x0E3A, 61 | 0x0000, 62 | 0x0000, 63 | 0x0000, 64 | 0x0000, 65 | 0x0E3F, 66 | 0x0E40, 67 | 0x0E41, 68 | 0x0E42, 69 | 0x0E43, 70 | 0x0E44, 71 | 0x0E45, 72 | 0x0E46, 73 | 0x0E47, 74 | 0x0E48, 75 | 0x0E49, 76 | 0x0E4A, 77 | 0x0E4B, 78 | 0x0E4C, 79 | 0x0E4D, 80 | 0x0E4E, 81 | 0x0E4F, 82 | 0x0E50, 83 | 0x0E51, 84 | 0x0E52, 85 | 0x0E53, 86 | 0x0E54, 87 | 0x0E55, 88 | 0x0E56, 89 | 0x0E57, 90 | 0x0E58, 91 | 0x0E59, 92 | 0x0E5A, 93 | 0x0E5B, 94 | 0x0000, 95 | 0x0000, 96 | 0x0000, 97 | 0x0000 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso885913.map: -------------------------------------------------------------------------------- 1 | private codes_t mapISO8859_13[ 96 ] = { 2 | { 0x00A0, 0x20 }, 3 | { 0x00A2, 0x22 }, 4 | { 0x00A3, 0x23 }, 5 | { 0x00A4, 0x24 }, 6 | { 0x00A6, 0x26 }, 7 | { 0x00A7, 0x27 }, 8 | { 0x00A9, 0x29 }, 9 | { 0x00AB, 0x2b }, 10 | { 0x00AC, 0x2c }, 11 | { 0x00AD, 0x2d }, 12 | { 0x00AE, 0x2e }, 13 | { 0x00B0, 0x30 }, 14 | { 0x00B1, 0x31 }, 15 | { 0x00B2, 0x32 }, 16 | { 0x00B3, 0x33 }, 17 | { 0x00B5, 0x35 }, 18 | { 0x00B6, 0x36 }, 19 | { 0x00B7, 0x37 }, 20 | { 0x00B9, 0x39 }, 21 | { 0x00BB, 0x3b }, 22 | { 0x00BC, 0x3c }, 23 | { 0x00BD, 0x3d }, 24 | { 0x00BE, 0x3e }, 25 | { 0x00C4, 0x44 }, 26 | { 0x00C5, 0x45 }, 27 | { 0x00C6, 0x2f }, 28 | { 0x00C9, 0x49 }, 29 | { 0x00D3, 0x53 }, 30 | { 0x00D5, 0x55 }, 31 | { 0x00D6, 0x56 }, 32 | { 0x00D7, 0x57 }, 33 | { 0x00D8, 0x28 }, 34 | { 0x00DC, 0x5c }, 35 | { 0x00DF, 0x5f }, 36 | { 0x00E4, 0x64 }, 37 | { 0x00E5, 0x65 }, 38 | { 0x00E6, 0x3f }, 39 | { 0x00E9, 0x69 }, 40 | { 0x00F3, 0x73 }, 41 | { 0x00F5, 0x75 }, 42 | { 0x00F6, 0x76 }, 43 | { 0x00F7, 0x77 }, 44 | { 0x00F8, 0x38 }, 45 | { 0x00FC, 0x7c }, 46 | { 0x0100, 0x42 }, 47 | { 0x0101, 0x62 }, 48 | { 0x0104, 0x40 }, 49 | { 0x0105, 0x60 }, 50 | { 0x0106, 0x43 }, 51 | { 0x0107, 0x63 }, 52 | { 0x010C, 0x48 }, 53 | { 0x010D, 0x68 }, 54 | { 0x0112, 0x47 }, 55 | { 0x0113, 0x67 }, 56 | { 0x0116, 0x4b }, 57 | { 0x0117, 0x6b }, 58 | { 0x0118, 0x46 }, 59 | { 0x0119, 0x66 }, 60 | { 0x0122, 0x4c }, 61 | { 0x0123, 0x6c }, 62 | { 0x012A, 0x4e }, 63 | { 0x012B, 0x6e }, 64 | { 0x012E, 0x41 }, 65 | { 0x012F, 0x61 }, 66 | { 0x0136, 0x4d }, 67 | { 0x0137, 0x6d }, 68 | { 0x013B, 0x4f }, 69 | { 0x013C, 0x6f }, 70 | { 0x0141, 0x59 }, 71 | { 0x0142, 0x79 }, 72 | { 0x0143, 0x51 }, 73 | { 0x0144, 0x71 }, 74 | { 0x0145, 0x52 }, 75 | { 0x0146, 0x72 }, 76 | { 0x014C, 0x54 }, 77 | { 0x014D, 0x74 }, 78 | { 0x0156, 0x2a }, 79 | { 0x0157, 0x3a }, 80 | { 0x015A, 0x5a }, 81 | { 0x015B, 0x7a }, 82 | { 0x0160, 0x50 }, 83 | { 0x0161, 0x70 }, 84 | { 0x016A, 0x5b }, 85 | { 0x016B, 0x7b }, 86 | { 0x0172, 0x58 }, 87 | { 0x0173, 0x78 }, 88 | { 0x0179, 0x4a }, 89 | { 0x017A, 0x6a }, 90 | { 0x017B, 0x5d }, 91 | { 0x017C, 0x7d }, 92 | { 0x017D, 0x5e }, 93 | { 0x017E, 0x7e }, 94 | { 0x2019, 0x7f }, 95 | { 0x201C, 0x34 }, 96 | { 0x201D, 0x21 }, 97 | { 0x201E, 0x25 } 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso885913.rev: -------------------------------------------------------------------------------- 1 | private ic_t revISO8859_13[ 96 ] = { 2 | 0x00A0, 3 | 0x201D, 4 | 0x00A2, 5 | 0x00A3, 6 | 0x00A4, 7 | 0x201E, 8 | 0x00A6, 9 | 0x00A7, 10 | 0x00D8, 11 | 0x00A9, 12 | 0x0156, 13 | 0x00AB, 14 | 0x00AC, 15 | 0x00AD, 16 | 0x00AE, 17 | 0x00C6, 18 | 0x00B0, 19 | 0x00B1, 20 | 0x00B2, 21 | 0x00B3, 22 | 0x201C, 23 | 0x00B5, 24 | 0x00B6, 25 | 0x00B7, 26 | 0x00F8, 27 | 0x00B9, 28 | 0x0157, 29 | 0x00BB, 30 | 0x00BC, 31 | 0x00BD, 32 | 0x00BE, 33 | 0x00E6, 34 | 0x0104, 35 | 0x012E, 36 | 0x0100, 37 | 0x0106, 38 | 0x00C4, 39 | 0x00C5, 40 | 0x0118, 41 | 0x0112, 42 | 0x010C, 43 | 0x00C9, 44 | 0x0179, 45 | 0x0116, 46 | 0x0122, 47 | 0x0136, 48 | 0x012A, 49 | 0x013B, 50 | 0x0160, 51 | 0x0143, 52 | 0x0145, 53 | 0x00D3, 54 | 0x014C, 55 | 0x00D5, 56 | 0x00D6, 57 | 0x00D7, 58 | 0x0172, 59 | 0x0141, 60 | 0x015A, 61 | 0x016A, 62 | 0x00DC, 63 | 0x017B, 64 | 0x017D, 65 | 0x00DF, 66 | 0x0105, 67 | 0x012F, 68 | 0x0101, 69 | 0x0107, 70 | 0x00E4, 71 | 0x00E5, 72 | 0x0119, 73 | 0x0113, 74 | 0x010D, 75 | 0x00E9, 76 | 0x017A, 77 | 0x0117, 78 | 0x0123, 79 | 0x0137, 80 | 0x012B, 81 | 0x013C, 82 | 0x0161, 83 | 0x0144, 84 | 0x0146, 85 | 0x00F3, 86 | 0x014D, 87 | 0x00F5, 88 | 0x00F6, 89 | 0x00F7, 90 | 0x0173, 91 | 0x0142, 92 | 0x015B, 93 | 0x016B, 94 | 0x00FC, 95 | 0x017C, 96 | 0x017E, 97 | 0x2019 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso885914.map: -------------------------------------------------------------------------------- 1 | private codes_t mapISO8859_14[ 96 ] = { 2 | { 0x00A0, 0x20 }, 3 | { 0x00A3, 0x23 }, 4 | { 0x00A7, 0x27 }, 5 | { 0x00A9, 0x29 }, 6 | { 0x00AD, 0x2d }, 7 | { 0x00AE, 0x2e }, 8 | { 0x00B6, 0x36 }, 9 | { 0x00C0, 0x40 }, 10 | { 0x00C1, 0x41 }, 11 | { 0x00C2, 0x42 }, 12 | { 0x00C3, 0x43 }, 13 | { 0x00C4, 0x44 }, 14 | { 0x00C5, 0x45 }, 15 | { 0x00C6, 0x46 }, 16 | { 0x00C7, 0x47 }, 17 | { 0x00C8, 0x48 }, 18 | { 0x00C9, 0x49 }, 19 | { 0x00CA, 0x4a }, 20 | { 0x00CB, 0x4b }, 21 | { 0x00CC, 0x4c }, 22 | { 0x00CD, 0x4d }, 23 | { 0x00CE, 0x4e }, 24 | { 0x00CF, 0x4f }, 25 | { 0x00D1, 0x51 }, 26 | { 0x00D2, 0x52 }, 27 | { 0x00D3, 0x53 }, 28 | { 0x00D4, 0x54 }, 29 | { 0x00D5, 0x55 }, 30 | { 0x00D6, 0x56 }, 31 | { 0x00D8, 0x58 }, 32 | { 0x00D9, 0x59 }, 33 | { 0x00DA, 0x5a }, 34 | { 0x00DB, 0x5b }, 35 | { 0x00DC, 0x5c }, 36 | { 0x00DD, 0x5d }, 37 | { 0x00DF, 0x5f }, 38 | { 0x00E0, 0x60 }, 39 | { 0x00E1, 0x61 }, 40 | { 0x00E2, 0x62 }, 41 | { 0x00E3, 0x63 }, 42 | { 0x00E4, 0x64 }, 43 | { 0x00E5, 0x65 }, 44 | { 0x00E6, 0x66 }, 45 | { 0x00E7, 0x67 }, 46 | { 0x00E8, 0x68 }, 47 | { 0x00E9, 0x69 }, 48 | { 0x00EA, 0x6a }, 49 | { 0x00EB, 0x6b }, 50 | { 0x00EC, 0x6c }, 51 | { 0x00ED, 0x6d }, 52 | { 0x00EE, 0x6e }, 53 | { 0x00EF, 0x6f }, 54 | { 0x00F1, 0x71 }, 55 | { 0x00F2, 0x72 }, 56 | { 0x00F3, 0x73 }, 57 | { 0x00F4, 0x74 }, 58 | { 0x00F5, 0x75 }, 59 | { 0x00F6, 0x76 }, 60 | { 0x00F8, 0x78 }, 61 | { 0x00F9, 0x79 }, 62 | { 0x00FA, 0x7a }, 63 | { 0x00FB, 0x7b }, 64 | { 0x00FC, 0x7c }, 65 | { 0x00FD, 0x7d }, 66 | { 0x00FF, 0x7f }, 67 | { 0x010A, 0x24 }, 68 | { 0x010B, 0x25 }, 69 | { 0x0120, 0x32 }, 70 | { 0x0121, 0x33 }, 71 | { 0x0174, 0x50 }, 72 | { 0x0175, 0x70 }, 73 | { 0x0176, 0x5e }, 74 | { 0x0177, 0x7e }, 75 | { 0x0178, 0x2f }, 76 | { 0x1E02, 0x21 }, 77 | { 0x1E03, 0x22 }, 78 | { 0x1E0A, 0x26 }, 79 | { 0x1E0B, 0x2b }, 80 | { 0x1E1E, 0x30 }, 81 | { 0x1E1F, 0x31 }, 82 | { 0x1E40, 0x34 }, 83 | { 0x1E41, 0x35 }, 84 | { 0x1E56, 0x37 }, 85 | { 0x1E57, 0x39 }, 86 | { 0x1E60, 0x3b }, 87 | { 0x1E61, 0x3f }, 88 | { 0x1E6A, 0x57 }, 89 | { 0x1E6B, 0x77 }, 90 | { 0x1E80, 0x28 }, 91 | { 0x1E81, 0x38 }, 92 | { 0x1E82, 0x2a }, 93 | { 0x1E83, 0x3a }, 94 | { 0x1E84, 0x3d }, 95 | { 0x1E85, 0x3e }, 96 | { 0x1EF2, 0x2c }, 97 | { 0x1EF3, 0x3c } 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso885914.rev: -------------------------------------------------------------------------------- 1 | private ic_t revISO8859_14[ 96 ] = { 2 | 0x00A0, 3 | 0x1E02, 4 | 0x1E03, 5 | 0x00A3, 6 | 0x010A, 7 | 0x010B, 8 | 0x1E0A, 9 | 0x00A7, 10 | 0x1E80, 11 | 0x00A9, 12 | 0x1E82, 13 | 0x1E0B, 14 | 0x1EF2, 15 | 0x00AD, 16 | 0x00AE, 17 | 0x0178, 18 | 0x1E1E, 19 | 0x1E1F, 20 | 0x0120, 21 | 0x0121, 22 | 0x1E40, 23 | 0x1E41, 24 | 0x00B6, 25 | 0x1E56, 26 | 0x1E81, 27 | 0x1E57, 28 | 0x1E83, 29 | 0x1E60, 30 | 0x1EF3, 31 | 0x1E84, 32 | 0x1E85, 33 | 0x1E61, 34 | 0x00C0, 35 | 0x00C1, 36 | 0x00C2, 37 | 0x00C3, 38 | 0x00C4, 39 | 0x00C5, 40 | 0x00C6, 41 | 0x00C7, 42 | 0x00C8, 43 | 0x00C9, 44 | 0x00CA, 45 | 0x00CB, 46 | 0x00CC, 47 | 0x00CD, 48 | 0x00CE, 49 | 0x00CF, 50 | 0x0174, 51 | 0x00D1, 52 | 0x00D2, 53 | 0x00D3, 54 | 0x00D4, 55 | 0x00D5, 56 | 0x00D6, 57 | 0x1E6A, 58 | 0x00D8, 59 | 0x00D9, 60 | 0x00DA, 61 | 0x00DB, 62 | 0x00DC, 63 | 0x00DD, 64 | 0x0176, 65 | 0x00DF, 66 | 0x00E0, 67 | 0x00E1, 68 | 0x00E2, 69 | 0x00E3, 70 | 0x00E4, 71 | 0x00E5, 72 | 0x00E6, 73 | 0x00E7, 74 | 0x00E8, 75 | 0x00E9, 76 | 0x00EA, 77 | 0x00EB, 78 | 0x00EC, 79 | 0x00ED, 80 | 0x00EE, 81 | 0x00EF, 82 | 0x0175, 83 | 0x00F1, 84 | 0x00F2, 85 | 0x00F3, 86 | 0x00F4, 87 | 0x00F5, 88 | 0x00F6, 89 | 0x1E6B, 90 | 0x00F8, 91 | 0x00F9, 92 | 0x00FA, 93 | 0x00FB, 94 | 0x00FC, 95 | 0x00FD, 96 | 0x0177, 97 | 0x00FF 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso885915.map: -------------------------------------------------------------------------------- 1 | private codes_t mapISO8859_15[ 96 ] = { 2 | { 0x00A0, 0x20 }, 3 | { 0x00A1, 0x21 }, 4 | { 0x00A2, 0x22 }, 5 | { 0x00A3, 0x23 }, 6 | { 0x00A5, 0x25 }, 7 | { 0x00A7, 0x27 }, 8 | { 0x00A9, 0x29 }, 9 | { 0x00AA, 0x2a }, 10 | { 0x00AB, 0x2b }, 11 | { 0x00AC, 0x2c }, 12 | { 0x00AD, 0x2d }, 13 | { 0x00AE, 0x2e }, 14 | { 0x00AF, 0x2f }, 15 | { 0x00B0, 0x30 }, 16 | { 0x00B1, 0x31 }, 17 | { 0x00B2, 0x32 }, 18 | { 0x00B3, 0x33 }, 19 | { 0x00B5, 0x35 }, 20 | { 0x00B6, 0x36 }, 21 | { 0x00B7, 0x37 }, 22 | { 0x00B9, 0x39 }, 23 | { 0x00BA, 0x3a }, 24 | { 0x00BB, 0x3b }, 25 | { 0x00BF, 0x3f }, 26 | { 0x00C0, 0x40 }, 27 | { 0x00C1, 0x41 }, 28 | { 0x00C2, 0x42 }, 29 | { 0x00C3, 0x43 }, 30 | { 0x00C4, 0x44 }, 31 | { 0x00C5, 0x45 }, 32 | { 0x00C6, 0x46 }, 33 | { 0x00C7, 0x47 }, 34 | { 0x00C8, 0x48 }, 35 | { 0x00C9, 0x49 }, 36 | { 0x00CA, 0x4a }, 37 | { 0x00CB, 0x4b }, 38 | { 0x00CC, 0x4c }, 39 | { 0x00CD, 0x4d }, 40 | { 0x00CE, 0x4e }, 41 | { 0x00CF, 0x4f }, 42 | { 0x00D0, 0x50 }, 43 | { 0x00D1, 0x51 }, 44 | { 0x00D2, 0x52 }, 45 | { 0x00D3, 0x53 }, 46 | { 0x00D4, 0x54 }, 47 | { 0x00D5, 0x55 }, 48 | { 0x00D6, 0x56 }, 49 | { 0x00D7, 0x57 }, 50 | { 0x00D8, 0x58 }, 51 | { 0x00D9, 0x59 }, 52 | { 0x00DA, 0x5a }, 53 | { 0x00DB, 0x5b }, 54 | { 0x00DC, 0x5c }, 55 | { 0x00DD, 0x5d }, 56 | { 0x00DE, 0x5e }, 57 | { 0x00DF, 0x5f }, 58 | { 0x00E0, 0x60 }, 59 | { 0x00E1, 0x61 }, 60 | { 0x00E2, 0x62 }, 61 | { 0x00E3, 0x63 }, 62 | { 0x00E4, 0x64 }, 63 | { 0x00E5, 0x65 }, 64 | { 0x00E6, 0x66 }, 65 | { 0x00E7, 0x67 }, 66 | { 0x00E8, 0x68 }, 67 | { 0x00E9, 0x69 }, 68 | { 0x00EA, 0x6a }, 69 | { 0x00EB, 0x6b }, 70 | { 0x00EC, 0x6c }, 71 | { 0x00ED, 0x6d }, 72 | { 0x00EE, 0x6e }, 73 | { 0x00EF, 0x6f }, 74 | { 0x00F0, 0x70 }, 75 | { 0x00F1, 0x71 }, 76 | { 0x00F2, 0x72 }, 77 | { 0x00F3, 0x73 }, 78 | { 0x00F4, 0x74 }, 79 | { 0x00F5, 0x75 }, 80 | { 0x00F6, 0x76 }, 81 | { 0x00F7, 0x77 }, 82 | { 0x00F8, 0x78 }, 83 | { 0x00F9, 0x79 }, 84 | { 0x00FA, 0x7a }, 85 | { 0x00FB, 0x7b }, 86 | { 0x00FC, 0x7c }, 87 | { 0x00FD, 0x7d }, 88 | { 0x00FE, 0x7e }, 89 | { 0x00FF, 0x7f }, 90 | { 0x0152, 0x3c }, 91 | { 0x0153, 0x3d }, 92 | { 0x0160, 0x26 }, 93 | { 0x0161, 0x28 }, 94 | { 0x0178, 0x3e }, 95 | { 0x017D, 0x34 }, 96 | { 0x017E, 0x38 }, 97 | { 0x20AC, 0x24 } 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso885915.rev: -------------------------------------------------------------------------------- 1 | private ic_t revISO8859_15[ 96 ] = { 2 | 0x00A0, 3 | 0x00A1, 4 | 0x00A2, 5 | 0x00A3, 6 | 0x20AC, 7 | 0x00A5, 8 | 0x0160, 9 | 0x00A7, 10 | 0x0161, 11 | 0x00A9, 12 | 0x00AA, 13 | 0x00AB, 14 | 0x00AC, 15 | 0x00AD, 16 | 0x00AE, 17 | 0x00AF, 18 | 0x00B0, 19 | 0x00B1, 20 | 0x00B2, 21 | 0x00B3, 22 | 0x017D, 23 | 0x00B5, 24 | 0x00B6, 25 | 0x00B7, 26 | 0x017E, 27 | 0x00B9, 28 | 0x00BA, 29 | 0x00BB, 30 | 0x0152, 31 | 0x0153, 32 | 0x0178, 33 | 0x00BF, 34 | 0x00C0, 35 | 0x00C1, 36 | 0x00C2, 37 | 0x00C3, 38 | 0x00C4, 39 | 0x00C5, 40 | 0x00C6, 41 | 0x00C7, 42 | 0x00C8, 43 | 0x00C9, 44 | 0x00CA, 45 | 0x00CB, 46 | 0x00CC, 47 | 0x00CD, 48 | 0x00CE, 49 | 0x00CF, 50 | 0x00D0, 51 | 0x00D1, 52 | 0x00D2, 53 | 0x00D3, 54 | 0x00D4, 55 | 0x00D5, 56 | 0x00D6, 57 | 0x00D7, 58 | 0x00D8, 59 | 0x00D9, 60 | 0x00DA, 61 | 0x00DB, 62 | 0x00DC, 63 | 0x00DD, 64 | 0x00DE, 65 | 0x00DF, 66 | 0x00E0, 67 | 0x00E1, 68 | 0x00E2, 69 | 0x00E3, 70 | 0x00E4, 71 | 0x00E5, 72 | 0x00E6, 73 | 0x00E7, 74 | 0x00E8, 75 | 0x00E9, 76 | 0x00EA, 77 | 0x00EB, 78 | 0x00EC, 79 | 0x00ED, 80 | 0x00EE, 81 | 0x00EF, 82 | 0x00F0, 83 | 0x00F1, 84 | 0x00F2, 85 | 0x00F3, 86 | 0x00F4, 87 | 0x00F5, 88 | 0x00F6, 89 | 0x00F7, 90 | 0x00F8, 91 | 0x00F9, 92 | 0x00FA, 93 | 0x00FB, 94 | 0x00FC, 95 | 0x00FD, 96 | 0x00FE, 97 | 0x00FF 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso885916.map: -------------------------------------------------------------------------------- 1 | private codes_t mapISO8859_16[ 96 ] = { 2 | { 0x00A0, 0x20 }, 3 | { 0x00A7, 0x27 }, 4 | { 0x00A9, 0x29 }, 5 | { 0x00AB, 0x2b }, 6 | { 0x00AD, 0x2d }, 7 | { 0x00B0, 0x30 }, 8 | { 0x00B1, 0x31 }, 9 | { 0x00B6, 0x36 }, 10 | { 0x00B7, 0x37 }, 11 | { 0x00BB, 0x3b }, 12 | { 0x00C0, 0x40 }, 13 | { 0x00C1, 0x41 }, 14 | { 0x00C2, 0x42 }, 15 | { 0x00C4, 0x44 }, 16 | { 0x00C6, 0x46 }, 17 | { 0x00C7, 0x47 }, 18 | { 0x00C8, 0x48 }, 19 | { 0x00C9, 0x49 }, 20 | { 0x00CA, 0x4a }, 21 | { 0x00CB, 0x4b }, 22 | { 0x00CC, 0x4c }, 23 | { 0x00CD, 0x4d }, 24 | { 0x00CE, 0x4e }, 25 | { 0x00CF, 0x4f }, 26 | { 0x00D2, 0x52 }, 27 | { 0x00D3, 0x53 }, 28 | { 0x00D4, 0x54 }, 29 | { 0x00D6, 0x56 }, 30 | { 0x00D9, 0x59 }, 31 | { 0x00DA, 0x5a }, 32 | { 0x00DB, 0x5b }, 33 | { 0x00DC, 0x5c }, 34 | { 0x00DF, 0x5f }, 35 | { 0x00E0, 0x60 }, 36 | { 0x00E1, 0x61 }, 37 | { 0x00E2, 0x62 }, 38 | { 0x00E4, 0x64 }, 39 | { 0x00E6, 0x66 }, 40 | { 0x00E7, 0x67 }, 41 | { 0x00E8, 0x68 }, 42 | { 0x00E9, 0x69 }, 43 | { 0x00EA, 0x6a }, 44 | { 0x00EB, 0x6b }, 45 | { 0x00EC, 0x6c }, 46 | { 0x00ED, 0x6d }, 47 | { 0x00EE, 0x6e }, 48 | { 0x00EF, 0x6f }, 49 | { 0x00F2, 0x72 }, 50 | { 0x00F3, 0x73 }, 51 | { 0x00F4, 0x74 }, 52 | { 0x00F6, 0x76 }, 53 | { 0x00F9, 0x79 }, 54 | { 0x00FA, 0x7a }, 55 | { 0x00FB, 0x7b }, 56 | { 0x00FC, 0x7c }, 57 | { 0x00FF, 0x7f }, 58 | { 0x0102, 0x43 }, 59 | { 0x0103, 0x63 }, 60 | { 0x0104, 0x21 }, 61 | { 0x0105, 0x22 }, 62 | { 0x0106, 0x45 }, 63 | { 0x0107, 0x65 }, 64 | { 0x010C, 0x32 }, 65 | { 0x010D, 0x39 }, 66 | { 0x0110, 0x50 }, 67 | { 0x0111, 0x70 }, 68 | { 0x0118, 0x5d }, 69 | { 0x0119, 0x7d }, 70 | { 0x0141, 0x23 }, 71 | { 0x0142, 0x33 }, 72 | { 0x0143, 0x51 }, 73 | { 0x0144, 0x71 }, 74 | { 0x0150, 0x55 }, 75 | { 0x0151, 0x75 }, 76 | { 0x0152, 0x3c }, 77 | { 0x0153, 0x3d }, 78 | { 0x015A, 0x57 }, 79 | { 0x015B, 0x77 }, 80 | { 0x0160, 0x26 }, 81 | { 0x0161, 0x28 }, 82 | { 0x0170, 0x58 }, 83 | { 0x0171, 0x78 }, 84 | { 0x0178, 0x3e }, 85 | { 0x0179, 0x2c }, 86 | { 0x017A, 0x2e }, 87 | { 0x017B, 0x2f }, 88 | { 0x017C, 0x3f }, 89 | { 0x017D, 0x34 }, 90 | { 0x017E, 0x38 }, 91 | { 0x0218, 0x2a }, 92 | { 0x0219, 0x3a }, 93 | { 0x021A, 0x5e }, 94 | { 0x021B, 0x7e }, 95 | { 0x201D, 0x35 }, 96 | { 0x201E, 0x25 }, 97 | { 0x20AC, 0x24 } 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso885916.rev: -------------------------------------------------------------------------------- 1 | private ic_t revISO8859_16[ 96 ] = { 2 | 0x00A0, 3 | 0x0104, 4 | 0x0105, 5 | 0x0141, 6 | 0x20AC, 7 | 0x201E, 8 | 0x0160, 9 | 0x00A7, 10 | 0x0161, 11 | 0x00A9, 12 | 0x0218, 13 | 0x00AB, 14 | 0x0179, 15 | 0x00AD, 16 | 0x017A, 17 | 0x017B, 18 | 0x00B0, 19 | 0x00B1, 20 | 0x010C, 21 | 0x0142, 22 | 0x017D, 23 | 0x201D, 24 | 0x00B6, 25 | 0x00B7, 26 | 0x017E, 27 | 0x010D, 28 | 0x0219, 29 | 0x00BB, 30 | 0x0152, 31 | 0x0153, 32 | 0x0178, 33 | 0x017C, 34 | 0x00C0, 35 | 0x00C1, 36 | 0x00C2, 37 | 0x0102, 38 | 0x00C4, 39 | 0x0106, 40 | 0x00C6, 41 | 0x00C7, 42 | 0x00C8, 43 | 0x00C9, 44 | 0x00CA, 45 | 0x00CB, 46 | 0x00CC, 47 | 0x00CD, 48 | 0x00CE, 49 | 0x00CF, 50 | 0x0110, 51 | 0x0143, 52 | 0x00D2, 53 | 0x00D3, 54 | 0x00D4, 55 | 0x0150, 56 | 0x00D6, 57 | 0x015A, 58 | 0x0170, 59 | 0x00D9, 60 | 0x00DA, 61 | 0x00DB, 62 | 0x00DC, 63 | 0x0118, 64 | 0x021A, 65 | 0x00DF, 66 | 0x00E0, 67 | 0x00E1, 68 | 0x00E2, 69 | 0x0103, 70 | 0x00E4, 71 | 0x0107, 72 | 0x00E6, 73 | 0x00E7, 74 | 0x00E8, 75 | 0x00E9, 76 | 0x00EA, 77 | 0x00EB, 78 | 0x00EC, 79 | 0x00ED, 80 | 0x00EE, 81 | 0x00EF, 82 | 0x0111, 83 | 0x0144, 84 | 0x00F2, 85 | 0x00F3, 86 | 0x00F4, 87 | 0x0151, 88 | 0x00F6, 89 | 0x015B, 90 | 0x0171, 91 | 0x00F9, 92 | 0x00FA, 93 | 0x00FB, 94 | 0x00FC, 95 | 0x0119, 96 | 0x021B, 97 | 0x00FF 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso88592.map: -------------------------------------------------------------------------------- 1 | private codes_t mapISO8859_2[ 96 ] = { 2 | { 0x00A0, 0x20 }, 3 | { 0x00A4, 0x24 }, 4 | { 0x00A7, 0x27 }, 5 | { 0x00A8, 0x28 }, 6 | { 0x00AD, 0x2d }, 7 | { 0x00B0, 0x30 }, 8 | { 0x00B4, 0x34 }, 9 | { 0x00B8, 0x38 }, 10 | { 0x00C1, 0x41 }, 11 | { 0x00C2, 0x42 }, 12 | { 0x00C4, 0x44 }, 13 | { 0x00C7, 0x47 }, 14 | { 0x00C9, 0x49 }, 15 | { 0x00CB, 0x4b }, 16 | { 0x00CD, 0x4d }, 17 | { 0x00CE, 0x4e }, 18 | { 0x00D3, 0x53 }, 19 | { 0x00D4, 0x54 }, 20 | { 0x00D6, 0x56 }, 21 | { 0x00D7, 0x57 }, 22 | { 0x00DA, 0x5a }, 23 | { 0x00DC, 0x5c }, 24 | { 0x00DD, 0x5d }, 25 | { 0x00DF, 0x5f }, 26 | { 0x00E1, 0x61 }, 27 | { 0x00E2, 0x62 }, 28 | { 0x00E4, 0x64 }, 29 | { 0x00E7, 0x67 }, 30 | { 0x00E9, 0x69 }, 31 | { 0x00EB, 0x6b }, 32 | { 0x00ED, 0x6d }, 33 | { 0x00EE, 0x6e }, 34 | { 0x00F3, 0x73 }, 35 | { 0x00F4, 0x74 }, 36 | { 0x00F6, 0x76 }, 37 | { 0x00F7, 0x77 }, 38 | { 0x00FA, 0x7a }, 39 | { 0x00FC, 0x7c }, 40 | { 0x00FD, 0x7d }, 41 | { 0x0102, 0x43 }, 42 | { 0x0103, 0x63 }, 43 | { 0x0104, 0x21 }, 44 | { 0x0105, 0x31 }, 45 | { 0x0106, 0x46 }, 46 | { 0x0107, 0x66 }, 47 | { 0x010C, 0x48 }, 48 | { 0x010D, 0x68 }, 49 | { 0x010E, 0x4f }, 50 | { 0x010F, 0x6f }, 51 | { 0x0110, 0x50 }, 52 | { 0x0111, 0x70 }, 53 | { 0x0118, 0x4a }, 54 | { 0x0119, 0x6a }, 55 | { 0x011A, 0x4c }, 56 | { 0x011B, 0x6c }, 57 | { 0x0139, 0x45 }, 58 | { 0x013A, 0x65 }, 59 | { 0x013D, 0x25 }, 60 | { 0x013E, 0x35 }, 61 | { 0x0141, 0x23 }, 62 | { 0x0142, 0x33 }, 63 | { 0x0143, 0x51 }, 64 | { 0x0144, 0x71 }, 65 | { 0x0147, 0x52 }, 66 | { 0x0148, 0x72 }, 67 | { 0x0150, 0x55 }, 68 | { 0x0151, 0x75 }, 69 | { 0x0154, 0x40 }, 70 | { 0x0155, 0x60 }, 71 | { 0x0158, 0x58 }, 72 | { 0x0159, 0x78 }, 73 | { 0x015A, 0x26 }, 74 | { 0x015B, 0x36 }, 75 | { 0x015E, 0x2a }, 76 | { 0x015F, 0x3a }, 77 | { 0x0160, 0x29 }, 78 | { 0x0161, 0x39 }, 79 | { 0x0162, 0x5e }, 80 | { 0x0163, 0x7e }, 81 | { 0x0164, 0x2b }, 82 | { 0x0165, 0x3b }, 83 | { 0x016E, 0x59 }, 84 | { 0x016F, 0x79 }, 85 | { 0x0170, 0x5b }, 86 | { 0x0171, 0x7b }, 87 | { 0x0179, 0x2c }, 88 | { 0x017A, 0x3c }, 89 | { 0x017B, 0x2f }, 90 | { 0x017C, 0x3f }, 91 | { 0x017D, 0x2e }, 92 | { 0x017E, 0x3e }, 93 | { 0x02C7, 0x37 }, 94 | { 0x02D8, 0x22 }, 95 | { 0x02D9, 0x7f }, 96 | { 0x02DB, 0x32 }, 97 | { 0x02DD, 0x3d } 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso88592.rev: -------------------------------------------------------------------------------- 1 | private ic_t revISO8859_2[ 96 ] = { 2 | 0x00A0, 3 | 0x0104, 4 | 0x02D8, 5 | 0x0141, 6 | 0x00A4, 7 | 0x013D, 8 | 0x015A, 9 | 0x00A7, 10 | 0x00A8, 11 | 0x0160, 12 | 0x015E, 13 | 0x0164, 14 | 0x0179, 15 | 0x00AD, 16 | 0x017D, 17 | 0x017B, 18 | 0x00B0, 19 | 0x0105, 20 | 0x02DB, 21 | 0x0142, 22 | 0x00B4, 23 | 0x013E, 24 | 0x015B, 25 | 0x02C7, 26 | 0x00B8, 27 | 0x0161, 28 | 0x015F, 29 | 0x0165, 30 | 0x017A, 31 | 0x02DD, 32 | 0x017E, 33 | 0x017C, 34 | 0x0154, 35 | 0x00C1, 36 | 0x00C2, 37 | 0x0102, 38 | 0x00C4, 39 | 0x0139, 40 | 0x0106, 41 | 0x00C7, 42 | 0x010C, 43 | 0x00C9, 44 | 0x0118, 45 | 0x00CB, 46 | 0x011A, 47 | 0x00CD, 48 | 0x00CE, 49 | 0x010E, 50 | 0x0110, 51 | 0x0143, 52 | 0x0147, 53 | 0x00D3, 54 | 0x00D4, 55 | 0x0150, 56 | 0x00D6, 57 | 0x00D7, 58 | 0x0158, 59 | 0x016E, 60 | 0x00DA, 61 | 0x0170, 62 | 0x00DC, 63 | 0x00DD, 64 | 0x0162, 65 | 0x00DF, 66 | 0x0155, 67 | 0x00E1, 68 | 0x00E2, 69 | 0x0103, 70 | 0x00E4, 71 | 0x013A, 72 | 0x0107, 73 | 0x00E7, 74 | 0x010D, 75 | 0x00E9, 76 | 0x0119, 77 | 0x00EB, 78 | 0x011B, 79 | 0x00ED, 80 | 0x00EE, 81 | 0x010F, 82 | 0x0111, 83 | 0x0144, 84 | 0x0148, 85 | 0x00F3, 86 | 0x00F4, 87 | 0x0151, 88 | 0x00F6, 89 | 0x00F7, 90 | 0x0159, 91 | 0x016F, 92 | 0x00FA, 93 | 0x0171, 94 | 0x00FC, 95 | 0x00FD, 96 | 0x0163, 97 | 0x02D9 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso88593.map: -------------------------------------------------------------------------------- 1 | private codes_t mapISO8859_3[ 89 ] = { 2 | { 0x00A0, 0x20 }, 3 | { 0x00A3, 0x23 }, 4 | { 0x00A4, 0x24 }, 5 | { 0x00A7, 0x27 }, 6 | { 0x00A8, 0x28 }, 7 | { 0x00AD, 0x2d }, 8 | { 0x00B0, 0x30 }, 9 | { 0x00B2, 0x32 }, 10 | { 0x00B3, 0x33 }, 11 | { 0x00B4, 0x34 }, 12 | { 0x00B5, 0x35 }, 13 | { 0x00B7, 0x37 }, 14 | { 0x00B8, 0x38 }, 15 | { 0x00BD, 0x3d }, 16 | { 0x00C0, 0x40 }, 17 | { 0x00C1, 0x41 }, 18 | { 0x00C2, 0x42 }, 19 | { 0x00C4, 0x44 }, 20 | { 0x00C7, 0x47 }, 21 | { 0x00C8, 0x48 }, 22 | { 0x00C9, 0x49 }, 23 | { 0x00CA, 0x4a }, 24 | { 0x00CB, 0x4b }, 25 | { 0x00CC, 0x4c }, 26 | { 0x00CD, 0x4d }, 27 | { 0x00CE, 0x4e }, 28 | { 0x00CF, 0x4f }, 29 | { 0x00D1, 0x51 }, 30 | { 0x00D2, 0x52 }, 31 | { 0x00D3, 0x53 }, 32 | { 0x00D4, 0x54 }, 33 | { 0x00D6, 0x56 }, 34 | { 0x00D7, 0x57 }, 35 | { 0x00D9, 0x59 }, 36 | { 0x00DA, 0x5a }, 37 | { 0x00DB, 0x5b }, 38 | { 0x00DC, 0x5c }, 39 | { 0x00DF, 0x5f }, 40 | { 0x00E0, 0x60 }, 41 | { 0x00E1, 0x61 }, 42 | { 0x00E2, 0x62 }, 43 | { 0x00E4, 0x64 }, 44 | { 0x00E7, 0x67 }, 45 | { 0x00E8, 0x68 }, 46 | { 0x00E9, 0x69 }, 47 | { 0x00EA, 0x6a }, 48 | { 0x00EB, 0x6b }, 49 | { 0x00EC, 0x6c }, 50 | { 0x00ED, 0x6d }, 51 | { 0x00EE, 0x6e }, 52 | { 0x00EF, 0x6f }, 53 | { 0x00F1, 0x71 }, 54 | { 0x00F2, 0x72 }, 55 | { 0x00F3, 0x73 }, 56 | { 0x00F4, 0x74 }, 57 | { 0x00F6, 0x76 }, 58 | { 0x00F7, 0x77 }, 59 | { 0x00F9, 0x79 }, 60 | { 0x00FA, 0x7a }, 61 | { 0x00FB, 0x7b }, 62 | { 0x00FC, 0x7c }, 63 | { 0x0108, 0x46 }, 64 | { 0x0109, 0x66 }, 65 | { 0x010A, 0x45 }, 66 | { 0x010B, 0x65 }, 67 | { 0x011C, 0x58 }, 68 | { 0x011D, 0x78 }, 69 | { 0x011E, 0x2b }, 70 | { 0x011F, 0x3b }, 71 | { 0x0120, 0x55 }, 72 | { 0x0121, 0x75 }, 73 | { 0x0124, 0x26 }, 74 | { 0x0125, 0x36 }, 75 | { 0x0126, 0x21 }, 76 | { 0x0127, 0x31 }, 77 | { 0x0130, 0x29 }, 78 | { 0x0131, 0x39 }, 79 | { 0x0134, 0x2c }, 80 | { 0x0135, 0x3c }, 81 | { 0x015C, 0x5e }, 82 | { 0x015D, 0x7e }, 83 | { 0x015E, 0x2a }, 84 | { 0x015F, 0x3a }, 85 | { 0x016C, 0x5d }, 86 | { 0x016D, 0x7d }, 87 | { 0x017B, 0x2f }, 88 | { 0x017C, 0x3f }, 89 | { 0x02D8, 0x22 }, 90 | { 0x02D9, 0x7f } 91 | }; 92 | -------------------------------------------------------------------------------- /src/iso88593.rev: -------------------------------------------------------------------------------- 1 | private ic_t revISO8859_3[ 96 ] = { 2 | 0x00A0, 3 | 0x0126, 4 | 0x02D8, 5 | 0x00A3, 6 | 0x00A4, 7 | 0x0000, 8 | 0x0124, 9 | 0x00A7, 10 | 0x00A8, 11 | 0x0130, 12 | 0x015E, 13 | 0x011E, 14 | 0x0134, 15 | 0x00AD, 16 | 0x0000, 17 | 0x017B, 18 | 0x00B0, 19 | 0x0127, 20 | 0x00B2, 21 | 0x00B3, 22 | 0x00B4, 23 | 0x00B5, 24 | 0x0125, 25 | 0x00B7, 26 | 0x00B8, 27 | 0x0131, 28 | 0x015F, 29 | 0x011F, 30 | 0x0135, 31 | 0x00BD, 32 | 0x0000, 33 | 0x017C, 34 | 0x00C0, 35 | 0x00C1, 36 | 0x00C2, 37 | 0x0000, 38 | 0x00C4, 39 | 0x010A, 40 | 0x0108, 41 | 0x00C7, 42 | 0x00C8, 43 | 0x00C9, 44 | 0x00CA, 45 | 0x00CB, 46 | 0x00CC, 47 | 0x00CD, 48 | 0x00CE, 49 | 0x00CF, 50 | 0x0000, 51 | 0x00D1, 52 | 0x00D2, 53 | 0x00D3, 54 | 0x00D4, 55 | 0x0120, 56 | 0x00D6, 57 | 0x00D7, 58 | 0x011C, 59 | 0x00D9, 60 | 0x00DA, 61 | 0x00DB, 62 | 0x00DC, 63 | 0x016C, 64 | 0x015C, 65 | 0x00DF, 66 | 0x00E0, 67 | 0x00E1, 68 | 0x00E2, 69 | 0x0000, 70 | 0x00E4, 71 | 0x010B, 72 | 0x0109, 73 | 0x00E7, 74 | 0x00E8, 75 | 0x00E9, 76 | 0x00EA, 77 | 0x00EB, 78 | 0x00EC, 79 | 0x00ED, 80 | 0x00EE, 81 | 0x00EF, 82 | 0x0000, 83 | 0x00F1, 84 | 0x00F2, 85 | 0x00F3, 86 | 0x00F4, 87 | 0x0121, 88 | 0x00F6, 89 | 0x00F7, 90 | 0x011D, 91 | 0x00F9, 92 | 0x00FA, 93 | 0x00FB, 94 | 0x00FC, 95 | 0x016D, 96 | 0x015D, 97 | 0x02D9 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso88594.map: -------------------------------------------------------------------------------- 1 | private codes_t mapISO8859_4[ 96 ] = { 2 | { 0x00A0, 0x20 }, 3 | { 0x00A4, 0x24 }, 4 | { 0x00A7, 0x27 }, 5 | { 0x00A8, 0x28 }, 6 | { 0x00AD, 0x2d }, 7 | { 0x00AF, 0x2f }, 8 | { 0x00B0, 0x30 }, 9 | { 0x00B4, 0x34 }, 10 | { 0x00B8, 0x38 }, 11 | { 0x00C1, 0x41 }, 12 | { 0x00C2, 0x42 }, 13 | { 0x00C3, 0x43 }, 14 | { 0x00C4, 0x44 }, 15 | { 0x00C5, 0x45 }, 16 | { 0x00C6, 0x46 }, 17 | { 0x00C9, 0x49 }, 18 | { 0x00CB, 0x4b }, 19 | { 0x00CD, 0x4d }, 20 | { 0x00CE, 0x4e }, 21 | { 0x00D4, 0x54 }, 22 | { 0x00D5, 0x55 }, 23 | { 0x00D6, 0x56 }, 24 | { 0x00D7, 0x57 }, 25 | { 0x00D8, 0x58 }, 26 | { 0x00DA, 0x5a }, 27 | { 0x00DB, 0x5b }, 28 | { 0x00DC, 0x5c }, 29 | { 0x00DF, 0x5f }, 30 | { 0x00E1, 0x61 }, 31 | { 0x00E2, 0x62 }, 32 | { 0x00E3, 0x63 }, 33 | { 0x00E4, 0x64 }, 34 | { 0x00E5, 0x65 }, 35 | { 0x00E6, 0x66 }, 36 | { 0x00E9, 0x69 }, 37 | { 0x00EB, 0x6b }, 38 | { 0x00ED, 0x6d }, 39 | { 0x00EE, 0x6e }, 40 | { 0x00F4, 0x74 }, 41 | { 0x00F5, 0x75 }, 42 | { 0x00F6, 0x76 }, 43 | { 0x00F7, 0x77 }, 44 | { 0x00F8, 0x78 }, 45 | { 0x00FA, 0x7a }, 46 | { 0x00FB, 0x7b }, 47 | { 0x00FC, 0x7c }, 48 | { 0x0100, 0x40 }, 49 | { 0x0101, 0x60 }, 50 | { 0x0104, 0x21 }, 51 | { 0x0105, 0x31 }, 52 | { 0x010C, 0x48 }, 53 | { 0x010D, 0x68 }, 54 | { 0x0110, 0x50 }, 55 | { 0x0111, 0x70 }, 56 | { 0x0112, 0x2a }, 57 | { 0x0113, 0x3a }, 58 | { 0x0116, 0x4c }, 59 | { 0x0117, 0x6c }, 60 | { 0x0118, 0x4a }, 61 | { 0x0119, 0x6a }, 62 | { 0x0122, 0x2b }, 63 | { 0x0123, 0x3b }, 64 | { 0x0128, 0x25 }, 65 | { 0x0129, 0x35 }, 66 | { 0x012A, 0x4f }, 67 | { 0x012B, 0x6f }, 68 | { 0x012E, 0x47 }, 69 | { 0x012F, 0x67 }, 70 | { 0x0136, 0x53 }, 71 | { 0x0137, 0x73 }, 72 | { 0x0138, 0x22 }, 73 | { 0x013B, 0x26 }, 74 | { 0x013C, 0x36 }, 75 | { 0x0145, 0x51 }, 76 | { 0x0146, 0x71 }, 77 | { 0x014A, 0x3d }, 78 | { 0x014B, 0x3f }, 79 | { 0x014C, 0x52 }, 80 | { 0x014D, 0x72 }, 81 | { 0x0156, 0x23 }, 82 | { 0x0157, 0x33 }, 83 | { 0x0160, 0x29 }, 84 | { 0x0161, 0x39 }, 85 | { 0x0166, 0x2c }, 86 | { 0x0167, 0x3c }, 87 | { 0x0168, 0x5d }, 88 | { 0x0169, 0x7d }, 89 | { 0x016A, 0x5e }, 90 | { 0x016B, 0x7e }, 91 | { 0x0172, 0x59 }, 92 | { 0x0173, 0x79 }, 93 | { 0x017D, 0x2e }, 94 | { 0x017E, 0x3e }, 95 | { 0x02C7, 0x37 }, 96 | { 0x02D9, 0x7f }, 97 | { 0x02DB, 0x32 } 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso88594.rev: -------------------------------------------------------------------------------- 1 | private ic_t revISO8859_4[ 96 ] = { 2 | 0x00A0, 3 | 0x0104, 4 | 0x0138, 5 | 0x0156, 6 | 0x00A4, 7 | 0x0128, 8 | 0x013B, 9 | 0x00A7, 10 | 0x00A8, 11 | 0x0160, 12 | 0x0112, 13 | 0x0122, 14 | 0x0166, 15 | 0x00AD, 16 | 0x017D, 17 | 0x00AF, 18 | 0x00B0, 19 | 0x0105, 20 | 0x02DB, 21 | 0x0157, 22 | 0x00B4, 23 | 0x0129, 24 | 0x013C, 25 | 0x02C7, 26 | 0x00B8, 27 | 0x0161, 28 | 0x0113, 29 | 0x0123, 30 | 0x0167, 31 | 0x014A, 32 | 0x017E, 33 | 0x014B, 34 | 0x0100, 35 | 0x00C1, 36 | 0x00C2, 37 | 0x00C3, 38 | 0x00C4, 39 | 0x00C5, 40 | 0x00C6, 41 | 0x012E, 42 | 0x010C, 43 | 0x00C9, 44 | 0x0118, 45 | 0x00CB, 46 | 0x0116, 47 | 0x00CD, 48 | 0x00CE, 49 | 0x012A, 50 | 0x0110, 51 | 0x0145, 52 | 0x014C, 53 | 0x0136, 54 | 0x00D4, 55 | 0x00D5, 56 | 0x00D6, 57 | 0x00D7, 58 | 0x00D8, 59 | 0x0172, 60 | 0x00DA, 61 | 0x00DB, 62 | 0x00DC, 63 | 0x0168, 64 | 0x016A, 65 | 0x00DF, 66 | 0x0101, 67 | 0x00E1, 68 | 0x00E2, 69 | 0x00E3, 70 | 0x00E4, 71 | 0x00E5, 72 | 0x00E6, 73 | 0x012F, 74 | 0x010D, 75 | 0x00E9, 76 | 0x0119, 77 | 0x00EB, 78 | 0x0117, 79 | 0x00ED, 80 | 0x00EE, 81 | 0x012B, 82 | 0x0111, 83 | 0x0146, 84 | 0x014D, 85 | 0x0137, 86 | 0x00F4, 87 | 0x00F5, 88 | 0x00F6, 89 | 0x00F7, 90 | 0x00F8, 91 | 0x0173, 92 | 0x00FA, 93 | 0x00FB, 94 | 0x00FC, 95 | 0x0169, 96 | 0x016B, 97 | 0x02D9 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso88595.map: -------------------------------------------------------------------------------- 1 | private codes_t mapISO8859_5[ 96 ] = { 2 | { 0x00A0, 0x20 }, 3 | { 0x00A7, 0x7d }, 4 | { 0x00AD, 0x2d }, 5 | { 0x0401, 0x21 }, 6 | { 0x0402, 0x22 }, 7 | { 0x0403, 0x23 }, 8 | { 0x0404, 0x24 }, 9 | { 0x0405, 0x25 }, 10 | { 0x0406, 0x26 }, 11 | { 0x0407, 0x27 }, 12 | { 0x0408, 0x28 }, 13 | { 0x0409, 0x29 }, 14 | { 0x040A, 0x2a }, 15 | { 0x040B, 0x2b }, 16 | { 0x040C, 0x2c }, 17 | { 0x040E, 0x2e }, 18 | { 0x040F, 0x2f }, 19 | { 0x0410, 0x30 }, 20 | { 0x0411, 0x31 }, 21 | { 0x0412, 0x32 }, 22 | { 0x0413, 0x33 }, 23 | { 0x0414, 0x34 }, 24 | { 0x0415, 0x35 }, 25 | { 0x0416, 0x36 }, 26 | { 0x0417, 0x37 }, 27 | { 0x0418, 0x38 }, 28 | { 0x0419, 0x39 }, 29 | { 0x041A, 0x3a }, 30 | { 0x041B, 0x3b }, 31 | { 0x041C, 0x3c }, 32 | { 0x041D, 0x3d }, 33 | { 0x041E, 0x3e }, 34 | { 0x041F, 0x3f }, 35 | { 0x0420, 0x40 }, 36 | { 0x0421, 0x41 }, 37 | { 0x0422, 0x42 }, 38 | { 0x0423, 0x43 }, 39 | { 0x0424, 0x44 }, 40 | { 0x0425, 0x45 }, 41 | { 0x0426, 0x46 }, 42 | { 0x0427, 0x47 }, 43 | { 0x0428, 0x48 }, 44 | { 0x0429, 0x49 }, 45 | { 0x042A, 0x4a }, 46 | { 0x042B, 0x4b }, 47 | { 0x042C, 0x4c }, 48 | { 0x042D, 0x4d }, 49 | { 0x042E, 0x4e }, 50 | { 0x042F, 0x4f }, 51 | { 0x0430, 0x50 }, 52 | { 0x0431, 0x51 }, 53 | { 0x0432, 0x52 }, 54 | { 0x0433, 0x53 }, 55 | { 0x0434, 0x54 }, 56 | { 0x0435, 0x55 }, 57 | { 0x0436, 0x56 }, 58 | { 0x0437, 0x57 }, 59 | { 0x0438, 0x58 }, 60 | { 0x0439, 0x59 }, 61 | { 0x043A, 0x5a }, 62 | { 0x043B, 0x5b }, 63 | { 0x043C, 0x5c }, 64 | { 0x043D, 0x5d }, 65 | { 0x043E, 0x5e }, 66 | { 0x043F, 0x5f }, 67 | { 0x0440, 0x60 }, 68 | { 0x0441, 0x61 }, 69 | { 0x0442, 0x62 }, 70 | { 0x0443, 0x63 }, 71 | { 0x0444, 0x64 }, 72 | { 0x0445, 0x65 }, 73 | { 0x0446, 0x66 }, 74 | { 0x0447, 0x67 }, 75 | { 0x0448, 0x68 }, 76 | { 0x0449, 0x69 }, 77 | { 0x044A, 0x6a }, 78 | { 0x044B, 0x6b }, 79 | { 0x044C, 0x6c }, 80 | { 0x044D, 0x6d }, 81 | { 0x044E, 0x6e }, 82 | { 0x044F, 0x6f }, 83 | { 0x0451, 0x71 }, 84 | { 0x0452, 0x72 }, 85 | { 0x0453, 0x73 }, 86 | { 0x0454, 0x74 }, 87 | { 0x0455, 0x75 }, 88 | { 0x0456, 0x76 }, 89 | { 0x0457, 0x77 }, 90 | { 0x0458, 0x78 }, 91 | { 0x0459, 0x79 }, 92 | { 0x045A, 0x7a }, 93 | { 0x045B, 0x7b }, 94 | { 0x045C, 0x7c }, 95 | { 0x045E, 0x7e }, 96 | { 0x045F, 0x7f }, 97 | { 0x2116, 0x70 } 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso88595.rev: -------------------------------------------------------------------------------- 1 | private ic_t revISO8859_5[ 96 ] = { 2 | 0x00A0, 3 | 0x0401, 4 | 0x0402, 5 | 0x0403, 6 | 0x0404, 7 | 0x0405, 8 | 0x0406, 9 | 0x0407, 10 | 0x0408, 11 | 0x0409, 12 | 0x040A, 13 | 0x040B, 14 | 0x040C, 15 | 0x00AD, 16 | 0x040E, 17 | 0x040F, 18 | 0x0410, 19 | 0x0411, 20 | 0x0412, 21 | 0x0413, 22 | 0x0414, 23 | 0x0415, 24 | 0x0416, 25 | 0x0417, 26 | 0x0418, 27 | 0x0419, 28 | 0x041A, 29 | 0x041B, 30 | 0x041C, 31 | 0x041D, 32 | 0x041E, 33 | 0x041F, 34 | 0x0420, 35 | 0x0421, 36 | 0x0422, 37 | 0x0423, 38 | 0x0424, 39 | 0x0425, 40 | 0x0426, 41 | 0x0427, 42 | 0x0428, 43 | 0x0429, 44 | 0x042A, 45 | 0x042B, 46 | 0x042C, 47 | 0x042D, 48 | 0x042E, 49 | 0x042F, 50 | 0x0430, 51 | 0x0431, 52 | 0x0432, 53 | 0x0433, 54 | 0x0434, 55 | 0x0435, 56 | 0x0436, 57 | 0x0437, 58 | 0x0438, 59 | 0x0439, 60 | 0x043A, 61 | 0x043B, 62 | 0x043C, 63 | 0x043D, 64 | 0x043E, 65 | 0x043F, 66 | 0x0440, 67 | 0x0441, 68 | 0x0442, 69 | 0x0443, 70 | 0x0444, 71 | 0x0445, 72 | 0x0446, 73 | 0x0447, 74 | 0x0448, 75 | 0x0449, 76 | 0x044A, 77 | 0x044B, 78 | 0x044C, 79 | 0x044D, 80 | 0x044E, 81 | 0x044F, 82 | 0x2116, 83 | 0x0451, 84 | 0x0452, 85 | 0x0453, 86 | 0x0454, 87 | 0x0455, 88 | 0x0456, 89 | 0x0457, 90 | 0x0458, 91 | 0x0459, 92 | 0x045A, 93 | 0x045B, 94 | 0x045C, 95 | 0x00A7, 96 | 0x045E, 97 | 0x045F 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso88596.map: -------------------------------------------------------------------------------- 1 | private codes_t mapISO8859_6[ 51 ] = { 2 | { 0x00A0, 0x20 }, 3 | { 0x00A4, 0x24 }, 4 | { 0x00AD, 0x2d }, 5 | { 0x060C, 0x2c }, 6 | { 0x061B, 0x3b }, 7 | { 0x061F, 0x3f }, 8 | { 0x0621, 0x41 }, 9 | { 0x0622, 0x42 }, 10 | { 0x0623, 0x43 }, 11 | { 0x0624, 0x44 }, 12 | { 0x0625, 0x45 }, 13 | { 0x0626, 0x46 }, 14 | { 0x0627, 0x47 }, 15 | { 0x0628, 0x48 }, 16 | { 0x0629, 0x49 }, 17 | { 0x062A, 0x4a }, 18 | { 0x062B, 0x4b }, 19 | { 0x062C, 0x4c }, 20 | { 0x062D, 0x4d }, 21 | { 0x062E, 0x4e }, 22 | { 0x062F, 0x4f }, 23 | { 0x0630, 0x50 }, 24 | { 0x0631, 0x51 }, 25 | { 0x0632, 0x52 }, 26 | { 0x0633, 0x53 }, 27 | { 0x0634, 0x54 }, 28 | { 0x0635, 0x55 }, 29 | { 0x0636, 0x56 }, 30 | { 0x0637, 0x57 }, 31 | { 0x0638, 0x58 }, 32 | { 0x0639, 0x59 }, 33 | { 0x063A, 0x5a }, 34 | { 0x0640, 0x60 }, 35 | { 0x0641, 0x61 }, 36 | { 0x0642, 0x62 }, 37 | { 0x0643, 0x63 }, 38 | { 0x0644, 0x64 }, 39 | { 0x0645, 0x65 }, 40 | { 0x0646, 0x66 }, 41 | { 0x0647, 0x67 }, 42 | { 0x0648, 0x68 }, 43 | { 0x0649, 0x69 }, 44 | { 0x064A, 0x6a }, 45 | { 0x064B, 0x6b }, 46 | { 0x064C, 0x6c }, 47 | { 0x064D, 0x6d }, 48 | { 0x064E, 0x6e }, 49 | { 0x064F, 0x6f }, 50 | { 0x0650, 0x70 }, 51 | { 0x0651, 0x71 }, 52 | { 0x0652, 0x72 } 53 | }; 54 | -------------------------------------------------------------------------------- /src/iso88596.rev: -------------------------------------------------------------------------------- 1 | private ic_t revISO8859_6[ 96 ] = { 2 | 0x00A0, 3 | 0x0000, 4 | 0x0000, 5 | 0x0000, 6 | 0x00A4, 7 | 0x0000, 8 | 0x0000, 9 | 0x0000, 10 | 0x0000, 11 | 0x0000, 12 | 0x0000, 13 | 0x0000, 14 | 0x060C, 15 | 0x00AD, 16 | 0x0000, 17 | 0x0000, 18 | 0x0000, 19 | 0x0000, 20 | 0x0000, 21 | 0x0000, 22 | 0x0000, 23 | 0x0000, 24 | 0x0000, 25 | 0x0000, 26 | 0x0000, 27 | 0x0000, 28 | 0x0000, 29 | 0x061B, 30 | 0x0000, 31 | 0x0000, 32 | 0x0000, 33 | 0x061F, 34 | 0x0000, 35 | 0x0621, 36 | 0x0622, 37 | 0x0623, 38 | 0x0624, 39 | 0x0625, 40 | 0x0626, 41 | 0x0627, 42 | 0x0628, 43 | 0x0629, 44 | 0x062A, 45 | 0x062B, 46 | 0x062C, 47 | 0x062D, 48 | 0x062E, 49 | 0x062F, 50 | 0x0630, 51 | 0x0631, 52 | 0x0632, 53 | 0x0633, 54 | 0x0634, 55 | 0x0635, 56 | 0x0636, 57 | 0x0637, 58 | 0x0638, 59 | 0x0639, 60 | 0x063A, 61 | 0x0000, 62 | 0x0000, 63 | 0x0000, 64 | 0x0000, 65 | 0x0000, 66 | 0x0640, 67 | 0x0641, 68 | 0x0642, 69 | 0x0643, 70 | 0x0644, 71 | 0x0645, 72 | 0x0646, 73 | 0x0647, 74 | 0x0648, 75 | 0x0649, 76 | 0x064A, 77 | 0x064B, 78 | 0x064C, 79 | 0x064D, 80 | 0x064E, 81 | 0x064F, 82 | 0x0650, 83 | 0x0651, 84 | 0x0652, 85 | 0x0000, 86 | 0x0000, 87 | 0x0000, 88 | 0x0000, 89 | 0x0000, 90 | 0x0000, 91 | 0x0000, 92 | 0x0000, 93 | 0x0000, 94 | 0x0000, 95 | 0x0000, 96 | 0x0000, 97 | 0x0000 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso88597.map: -------------------------------------------------------------------------------- 1 | private codes_t mapISO8859_7[ 92 ] = { 2 | { 0x00A0, 0x20 }, 3 | { 0x00A3, 0x23 }, 4 | { 0x00A6, 0x26 }, 5 | { 0x00A7, 0x27 }, 6 | { 0x00A8, 0x28 }, 7 | { 0x00A9, 0x29 }, 8 | { 0x00AB, 0x2b }, 9 | { 0x00AC, 0x2c }, 10 | { 0x00AD, 0x2d }, 11 | { 0x00B0, 0x30 }, 12 | { 0x00B1, 0x31 }, 13 | { 0x00B2, 0x32 }, 14 | { 0x00B3, 0x33 }, 15 | { 0x00B7, 0x37 }, 16 | { 0x00BB, 0x3b }, 17 | { 0x00BD, 0x3d }, 18 | { 0x02BC, 0x22 }, 19 | { 0x02BD, 0x21 }, 20 | { 0x0384, 0x34 }, 21 | { 0x0385, 0x35 }, 22 | { 0x0386, 0x36 }, 23 | { 0x0388, 0x38 }, 24 | { 0x0389, 0x39 }, 25 | { 0x038A, 0x3a }, 26 | { 0x038C, 0x3c }, 27 | { 0x038E, 0x3e }, 28 | { 0x038F, 0x3f }, 29 | { 0x0390, 0x40 }, 30 | { 0x0391, 0x41 }, 31 | { 0x0392, 0x42 }, 32 | { 0x0393, 0x43 }, 33 | { 0x0394, 0x44 }, 34 | { 0x0395, 0x45 }, 35 | { 0x0396, 0x46 }, 36 | { 0x0397, 0x47 }, 37 | { 0x0398, 0x48 }, 38 | { 0x0399, 0x49 }, 39 | { 0x039A, 0x4a }, 40 | { 0x039B, 0x4b }, 41 | { 0x039C, 0x4c }, 42 | { 0x039D, 0x4d }, 43 | { 0x039E, 0x4e }, 44 | { 0x039F, 0x4f }, 45 | { 0x03A0, 0x50 }, 46 | { 0x03A1, 0x51 }, 47 | { 0x03A3, 0x53 }, 48 | { 0x03A4, 0x54 }, 49 | { 0x03A5, 0x55 }, 50 | { 0x03A6, 0x56 }, 51 | { 0x03A7, 0x57 }, 52 | { 0x03A8, 0x58 }, 53 | { 0x03A9, 0x59 }, 54 | { 0x03AA, 0x5a }, 55 | { 0x03AB, 0x5b }, 56 | { 0x03AC, 0x5c }, 57 | { 0x03AD, 0x5d }, 58 | { 0x03AE, 0x5e }, 59 | { 0x03AF, 0x5f }, 60 | { 0x03B0, 0x60 }, 61 | { 0x03B1, 0x61 }, 62 | { 0x03B2, 0x62 }, 63 | { 0x03B3, 0x63 }, 64 | { 0x03B4, 0x64 }, 65 | { 0x03B5, 0x65 }, 66 | { 0x03B6, 0x66 }, 67 | { 0x03B7, 0x67 }, 68 | { 0x03B8, 0x68 }, 69 | { 0x03B9, 0x69 }, 70 | { 0x03BA, 0x6a }, 71 | { 0x03BB, 0x6b }, 72 | { 0x03BC, 0x6c }, 73 | { 0x03BD, 0x6d }, 74 | { 0x03BE, 0x6e }, 75 | { 0x03BF, 0x6f }, 76 | { 0x03C0, 0x70 }, 77 | { 0x03C1, 0x71 }, 78 | { 0x03C2, 0x72 }, 79 | { 0x03C3, 0x73 }, 80 | { 0x03C4, 0x74 }, 81 | { 0x03C5, 0x75 }, 82 | { 0x03C6, 0x76 }, 83 | { 0x03C7, 0x77 }, 84 | { 0x03C8, 0x78 }, 85 | { 0x03C9, 0x79 }, 86 | { 0x03CA, 0x7a }, 87 | { 0x03CB, 0x7b }, 88 | { 0x03CC, 0x7c }, 89 | { 0x03CD, 0x7d }, 90 | { 0x03CE, 0x7e }, 91 | { 0x2015, 0x2f }, 92 | { 0x2018, 0x21 }, 93 | { 0x2019, 0x22 } 94 | }; 95 | -------------------------------------------------------------------------------- /src/iso88597.rev: -------------------------------------------------------------------------------- 1 | private ic_t revISO8859_7[ 96 ] = { 2 | 0x00A0, 3 | 0x2018, 4 | 0x2019, 5 | 0x00A3, 6 | 0x0000, 7 | 0x0000, 8 | 0x00A6, 9 | 0x00A7, 10 | 0x00A8, 11 | 0x00A9, 12 | 0x0000, 13 | 0x00AB, 14 | 0x00AC, 15 | 0x00AD, 16 | 0x0000, 17 | 0x2015, 18 | 0x00B0, 19 | 0x00B1, 20 | 0x00B2, 21 | 0x00B3, 22 | 0x0384, 23 | 0x0385, 24 | 0x0386, 25 | 0x00B7, 26 | 0x0388, 27 | 0x0389, 28 | 0x038A, 29 | 0x00BB, 30 | 0x038C, 31 | 0x00BD, 32 | 0x038E, 33 | 0x038F, 34 | 0x0390, 35 | 0x0391, 36 | 0x0392, 37 | 0x0393, 38 | 0x0394, 39 | 0x0395, 40 | 0x0396, 41 | 0x0397, 42 | 0x0398, 43 | 0x0399, 44 | 0x039A, 45 | 0x039B, 46 | 0x039C, 47 | 0x039D, 48 | 0x039E, 49 | 0x039F, 50 | 0x03A0, 51 | 0x03A1, 52 | 0x0000, 53 | 0x03A3, 54 | 0x03A4, 55 | 0x03A5, 56 | 0x03A6, 57 | 0x03A7, 58 | 0x03A8, 59 | 0x03A9, 60 | 0x03AA, 61 | 0x03AB, 62 | 0x03AC, 63 | 0x03AD, 64 | 0x03AE, 65 | 0x03AF, 66 | 0x03B0, 67 | 0x03B1, 68 | 0x03B2, 69 | 0x03B3, 70 | 0x03B4, 71 | 0x03B5, 72 | 0x03B6, 73 | 0x03B7, 74 | 0x03B8, 75 | 0x03B9, 76 | 0x03BA, 77 | 0x03BB, 78 | 0x03BC, 79 | 0x03BD, 80 | 0x03BE, 81 | 0x03BF, 82 | 0x03C0, 83 | 0x03C1, 84 | 0x03C2, 85 | 0x03C3, 86 | 0x03C4, 87 | 0x03C5, 88 | 0x03C6, 89 | 0x03C7, 90 | 0x03C8, 91 | 0x03C9, 92 | 0x03CA, 93 | 0x03CB, 94 | 0x03CC, 95 | 0x03CD, 96 | 0x03CE, 97 | 0x0000 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso88598.map: -------------------------------------------------------------------------------- 1 | private codes_t mapISO8859_8[ 58 ] = { 2 | { 0x00A0, 0x20 }, 3 | { 0x00A2, 0x22 }, 4 | { 0x00A3, 0x23 }, 5 | { 0x00A4, 0x24 }, 6 | { 0x00A5, 0x25 }, 7 | { 0x00A6, 0x26 }, 8 | { 0x00A7, 0x27 }, 9 | { 0x00A8, 0x28 }, 10 | { 0x00A9, 0x29 }, 11 | { 0x00AB, 0x2b }, 12 | { 0x00AC, 0x2c }, 13 | { 0x00AD, 0x2d }, 14 | { 0x00AE, 0x2e }, 15 | { 0x00B0, 0x30 }, 16 | { 0x00B1, 0x31 }, 17 | { 0x00B2, 0x32 }, 18 | { 0x00B3, 0x33 }, 19 | { 0x00B4, 0x34 }, 20 | { 0x00B5, 0x35 }, 21 | { 0x00B6, 0x36 }, 22 | { 0x00B7, 0x37 }, 23 | { 0x00B8, 0x38 }, 24 | { 0x00B9, 0x39 }, 25 | { 0x00BB, 0x3b }, 26 | { 0x00BC, 0x3c }, 27 | { 0x00BD, 0x3d }, 28 | { 0x00BE, 0x3e }, 29 | { 0x00D7, 0x2a }, 30 | { 0x00F7, 0x3a }, 31 | { 0x05D0, 0x60 }, 32 | { 0x05D1, 0x61 }, 33 | { 0x05D2, 0x62 }, 34 | { 0x05D3, 0x63 }, 35 | { 0x05D4, 0x64 }, 36 | { 0x05D5, 0x65 }, 37 | { 0x05D6, 0x66 }, 38 | { 0x05D7, 0x67 }, 39 | { 0x05D8, 0x68 }, 40 | { 0x05D9, 0x69 }, 41 | { 0x05DA, 0x6a }, 42 | { 0x05DB, 0x6b }, 43 | { 0x05DC, 0x6c }, 44 | { 0x05DD, 0x6d }, 45 | { 0x05DE, 0x6e }, 46 | { 0x05DF, 0x6f }, 47 | { 0x05E0, 0x70 }, 48 | { 0x05E1, 0x71 }, 49 | { 0x05E2, 0x72 }, 50 | { 0x05E3, 0x73 }, 51 | { 0x05E4, 0x74 }, 52 | { 0x05E5, 0x75 }, 53 | { 0x05E6, 0x76 }, 54 | { 0x05E7, 0x77 }, 55 | { 0x05E8, 0x78 }, 56 | { 0x05E9, 0x79 }, 57 | { 0x05EA, 0x7a }, 58 | { 0x2017, 0x5f }, 59 | { 0x203E, 0x2f } 60 | }; 61 | -------------------------------------------------------------------------------- /src/iso88598.rev: -------------------------------------------------------------------------------- 1 | private ic_t revISO8859_8[ 96 ] = { 2 | 0x00A0, 3 | 0x0000, 4 | 0x00A2, 5 | 0x00A3, 6 | 0x00A4, 7 | 0x00A5, 8 | 0x00A6, 9 | 0x00A7, 10 | 0x00A8, 11 | 0x00A9, 12 | 0x00D7, 13 | 0x00AB, 14 | 0x00AC, 15 | 0x00AD, 16 | 0x00AE, 17 | 0x203E, 18 | 0x00B0, 19 | 0x00B1, 20 | 0x00B2, 21 | 0x00B3, 22 | 0x00B4, 23 | 0x00B5, 24 | 0x00B6, 25 | 0x00B7, 26 | 0x00B8, 27 | 0x00B9, 28 | 0x00F7, 29 | 0x00BB, 30 | 0x00BC, 31 | 0x00BD, 32 | 0x00BE, 33 | 0x0000, 34 | 0x0000, 35 | 0x0000, 36 | 0x0000, 37 | 0x0000, 38 | 0x0000, 39 | 0x0000, 40 | 0x0000, 41 | 0x0000, 42 | 0x0000, 43 | 0x0000, 44 | 0x0000, 45 | 0x0000, 46 | 0x0000, 47 | 0x0000, 48 | 0x0000, 49 | 0x0000, 50 | 0x0000, 51 | 0x0000, 52 | 0x0000, 53 | 0x0000, 54 | 0x0000, 55 | 0x0000, 56 | 0x0000, 57 | 0x0000, 58 | 0x0000, 59 | 0x0000, 60 | 0x0000, 61 | 0x0000, 62 | 0x0000, 63 | 0x0000, 64 | 0x0000, 65 | 0x2017, 66 | 0x05D0, 67 | 0x05D1, 68 | 0x05D2, 69 | 0x05D3, 70 | 0x05D4, 71 | 0x05D5, 72 | 0x05D6, 73 | 0x05D7, 74 | 0x05D8, 75 | 0x05D9, 76 | 0x05DA, 77 | 0x05DB, 78 | 0x05DC, 79 | 0x05DD, 80 | 0x05DE, 81 | 0x05DF, 82 | 0x05E0, 83 | 0x05E1, 84 | 0x05E2, 85 | 0x05E3, 86 | 0x05E4, 87 | 0x05E5, 88 | 0x05E6, 89 | 0x05E7, 90 | 0x05E8, 91 | 0x05E9, 92 | 0x05EA, 93 | 0x0000, 94 | 0x0000, 95 | 0x0000, 96 | 0x0000, 97 | 0x0000 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso88599.map: -------------------------------------------------------------------------------- 1 | private codes_t mapISO8859_9[ 96 ] = { 2 | { 0x00A0, 0x20 }, 3 | { 0x00A1, 0x21 }, 4 | { 0x00A2, 0x22 }, 5 | { 0x00A3, 0x23 }, 6 | { 0x00A4, 0x24 }, 7 | { 0x00A5, 0x25 }, 8 | { 0x00A6, 0x26 }, 9 | { 0x00A7, 0x27 }, 10 | { 0x00A8, 0x28 }, 11 | { 0x00A9, 0x29 }, 12 | { 0x00AA, 0x2a }, 13 | { 0x00AB, 0x2b }, 14 | { 0x00AC, 0x2c }, 15 | { 0x00AD, 0x2d }, 16 | { 0x00AE, 0x2e }, 17 | { 0x00AF, 0x2f }, 18 | { 0x00B0, 0x30 }, 19 | { 0x00B1, 0x31 }, 20 | { 0x00B2, 0x32 }, 21 | { 0x00B3, 0x33 }, 22 | { 0x00B4, 0x34 }, 23 | { 0x00B5, 0x35 }, 24 | { 0x00B6, 0x36 }, 25 | { 0x00B7, 0x37 }, 26 | { 0x00B8, 0x38 }, 27 | { 0x00B9, 0x39 }, 28 | { 0x00BA, 0x3a }, 29 | { 0x00BB, 0x3b }, 30 | { 0x00BC, 0x3c }, 31 | { 0x00BD, 0x3d }, 32 | { 0x00BE, 0x3e }, 33 | { 0x00BF, 0x3f }, 34 | { 0x00C0, 0x40 }, 35 | { 0x00C1, 0x41 }, 36 | { 0x00C2, 0x42 }, 37 | { 0x00C3, 0x43 }, 38 | { 0x00C4, 0x44 }, 39 | { 0x00C5, 0x45 }, 40 | { 0x00C6, 0x46 }, 41 | { 0x00C7, 0x47 }, 42 | { 0x00C8, 0x48 }, 43 | { 0x00C9, 0x49 }, 44 | { 0x00CA, 0x4a }, 45 | { 0x00CB, 0x4b }, 46 | { 0x00CC, 0x4c }, 47 | { 0x00CD, 0x4d }, 48 | { 0x00CE, 0x4e }, 49 | { 0x00CF, 0x4f }, 50 | { 0x00D1, 0x51 }, 51 | { 0x00D2, 0x52 }, 52 | { 0x00D3, 0x53 }, 53 | { 0x00D4, 0x54 }, 54 | { 0x00D5, 0x55 }, 55 | { 0x00D6, 0x56 }, 56 | { 0x00D7, 0x57 }, 57 | { 0x00D8, 0x58 }, 58 | { 0x00D9, 0x59 }, 59 | { 0x00DA, 0x5a }, 60 | { 0x00DB, 0x5b }, 61 | { 0x00DC, 0x5c }, 62 | { 0x00DF, 0x5f }, 63 | { 0x00E0, 0x60 }, 64 | { 0x00E1, 0x61 }, 65 | { 0x00E2, 0x62 }, 66 | { 0x00E3, 0x63 }, 67 | { 0x00E4, 0x64 }, 68 | { 0x00E5, 0x65 }, 69 | { 0x00E6, 0x66 }, 70 | { 0x00E7, 0x67 }, 71 | { 0x00E8, 0x68 }, 72 | { 0x00E9, 0x69 }, 73 | { 0x00EA, 0x6a }, 74 | { 0x00EB, 0x6b }, 75 | { 0x00EC, 0x6c }, 76 | { 0x00ED, 0x6d }, 77 | { 0x00EE, 0x6e }, 78 | { 0x00EF, 0x6f }, 79 | { 0x00F1, 0x71 }, 80 | { 0x00F2, 0x72 }, 81 | { 0x00F3, 0x73 }, 82 | { 0x00F4, 0x74 }, 83 | { 0x00F5, 0x75 }, 84 | { 0x00F6, 0x76 }, 85 | { 0x00F7, 0x77 }, 86 | { 0x00F8, 0x78 }, 87 | { 0x00F9, 0x79 }, 88 | { 0x00FA, 0x7a }, 89 | { 0x00FB, 0x7b }, 90 | { 0x00FC, 0x7c }, 91 | { 0x00FF, 0x7f }, 92 | { 0x011E, 0x50 }, 93 | { 0x011F, 0x70 }, 94 | { 0x0130, 0x5d }, 95 | { 0x0131, 0x7d }, 96 | { 0x015E, 0x5e }, 97 | { 0x015F, 0x7e } 98 | }; 99 | -------------------------------------------------------------------------------- /src/iso88599.rev: -------------------------------------------------------------------------------- 1 | private ic_t revISO8859_9[ 96 ] = { 2 | 0x00A0, 3 | 0x00A1, 4 | 0x00A2, 5 | 0x00A3, 6 | 0x00A4, 7 | 0x00A5, 8 | 0x00A6, 9 | 0x00A7, 10 | 0x00A8, 11 | 0x00A9, 12 | 0x00AA, 13 | 0x00AB, 14 | 0x00AC, 15 | 0x00AD, 16 | 0x00AE, 17 | 0x00AF, 18 | 0x00B0, 19 | 0x00B1, 20 | 0x00B2, 21 | 0x00B3, 22 | 0x00B4, 23 | 0x00B5, 24 | 0x00B6, 25 | 0x00B7, 26 | 0x00B8, 27 | 0x00B9, 28 | 0x00BA, 29 | 0x00BB, 30 | 0x00BC, 31 | 0x00BD, 32 | 0x00BE, 33 | 0x00BF, 34 | 0x00C0, 35 | 0x00C1, 36 | 0x00C2, 37 | 0x00C3, 38 | 0x00C4, 39 | 0x00C5, 40 | 0x00C6, 41 | 0x00C7, 42 | 0x00C8, 43 | 0x00C9, 44 | 0x00CA, 45 | 0x00CB, 46 | 0x00CC, 47 | 0x00CD, 48 | 0x00CE, 49 | 0x00CF, 50 | 0x011E, 51 | 0x00D1, 52 | 0x00D2, 53 | 0x00D3, 54 | 0x00D4, 55 | 0x00D5, 56 | 0x00D6, 57 | 0x00D7, 58 | 0x00D8, 59 | 0x00D9, 60 | 0x00DA, 61 | 0x00DB, 62 | 0x00DC, 63 | 0x0130, 64 | 0x015E, 65 | 0x00DF, 66 | 0x00E0, 67 | 0x00E1, 68 | 0x00E2, 69 | 0x00E3, 70 | 0x00E4, 71 | 0x00E5, 72 | 0x00E6, 73 | 0x00E7, 74 | 0x00E8, 75 | 0x00E9, 76 | 0x00EA, 77 | 0x00EB, 78 | 0x00EC, 79 | 0x00ED, 80 | 0x00EE, 81 | 0x00EF, 82 | 0x011F, 83 | 0x00F1, 84 | 0x00F2, 85 | 0x00F3, 86 | 0x00F4, 87 | 0x00F5, 88 | 0x00F6, 89 | 0x00F7, 90 | 0x00F8, 91 | 0x00F9, 92 | 0x00FA, 93 | 0x00FB, 94 | 0x00FC, 95 | 0x0131, 96 | 0x015F, 97 | 0x00FF 98 | }; 99 | -------------------------------------------------------------------------------- /src/istr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * istr.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: istr.h,v 1.4 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __ISTR_H__ 9 | #define __ISTR_H__ 10 | 11 | #include 12 | 13 | #define ZONE_PAGE0 0 14 | #define ZONE_PAGE1 1 15 | 16 | #ifndef MSDOS /* if NOT defined */ 17 | #define ZONE_PAGE2 2 18 | #define ZONE_PAGE3 3 19 | #define ZONE_FREE 4 20 | #else 21 | #define ZONE_FREE 2 22 | #endif /* MSDOS */ 23 | 24 | #define ZONE_SIZE ( ZONE_FREE + 1 ) 25 | 26 | public int IstrWidth( i_str_t *istr ); 27 | 28 | public void IstrInit(); 29 | 30 | public i_str_t *IstrAlloc( int zone, int istrLength ); 31 | public void IstrFree( i_str_t *istr ); 32 | public void IstrFreeZone( int zone ); 33 | public void IstrFreeAll(); 34 | 35 | #endif /* __ISTR_H__ */ 36 | -------------------------------------------------------------------------------- /src/itable.c: -------------------------------------------------------------------------------- 1 | /* 2 | * itable.c 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio. 5 | * $Id: itable.c,v 1.6 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | /* 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | /* 31 | * international character set table 32 | */ 33 | 34 | public i_table_t iTable[ I_TABLE_SIZE ] = { 35 | { ISO646_US, 'B', FALSE, SET94, 1, 1 }, 36 | { X0201ROMAN, 'J', FALSE, SET94, 1, 1 }, 37 | 38 | { X0201KANA, 'I', FALSE, SET94, 1, 1 }, 39 | 40 | { ISO8859_1, 'A', FALSE, SET96, 1, 1 }, 41 | { ISO8859_2, 'B', FALSE, SET96, 1, 1 }, 42 | { ISO8859_3, 'C', FALSE, SET96, 1, 1 }, 43 | { ISO8859_4, 'D', FALSE, SET96, 1, 1 }, 44 | { ISO8859_5, 'L', FALSE, SET96, 1, 1 }, 45 | { ISO8859_6, 'G', FALSE, SET96, 1, 1 }, 46 | { ISO8859_7, 'F', FALSE, SET96, 1, 1 }, 47 | { ISO8859_8, 'H', FALSE, SET96, 1, 1 }, 48 | { ISO8859_9, 'M', FALSE, SET96, 1, 1 }, 49 | { ISO8859_10, 'V', FALSE, SET96, 1, 1 }, 50 | { ISO8859_11, 'T', FALSE, SET96, 1, 1 }, 51 | { ISO8859_13, 'Y', FALSE, SET96, 1, 1 }, 52 | { ISO8859_14, '_', FALSE, SET96, 1, 1 }, 53 | { ISO8859_15, 'b', FALSE, SET96, 1, 1 }, 54 | { ISO8859_16, 'f', FALSE, SET96, 1, 1 }, 55 | 56 | { C6226, '@', TRUE, SET94, 2, 2 }, 57 | { GB2312, 'A', TRUE, SET94, 2, 2 }, 58 | { X0208, 'B', TRUE, SET94, 2, 2 }, 59 | { KSC5601, 'C', TRUE, SET94, 2, 2 }, 60 | { X0212, 'D', TRUE, SET94, 2, 2 }, 61 | { ISO_IR_165, 'E', TRUE, SET94, 2, 2 }, 62 | { CNS_1, 'G', TRUE, SET94, 2, 2 }, 63 | { CNS_2, 'H', TRUE, SET94, 2, 2 }, 64 | { CNS_3, 'I', TRUE, SET94, 2, 2 }, 65 | { CNS_4, 'J', TRUE, SET94, 2, 2 }, 66 | { CNS_5, 'K', TRUE, SET94, 2, 2 }, 67 | { CNS_6, 'L', TRUE, SET94, 2, 2 }, 68 | { CNS_7, 'M', TRUE, SET94, 2, 2 }, 69 | 70 | { X0213_1, 'O', TRUE, SET94, 2, 2 }, 71 | { X0213_2, 'P', TRUE, SET94, 2, 2 }, 72 | 73 | { BIG5, '0', TRUE, SET94, 2, 2 }, /* non-registered final char */ 74 | 75 | { UNICODE, '2', TRUE, SET94, 2, 2 }, 76 | 77 | { PSEUDO, 0, FALSE, SET94, 0, 0 }, /* pseudo-charset */ 78 | 79 | { SPACE, 'B', FALSE, SET94, 1, 1 }, 80 | { HTAB, 'B', FALSE, SET94, 1, 0 }, 81 | { CNTRL, 'B', FALSE, SET94, 1, 0 }, 82 | { LINE_FEED, 'B', FALSE, SET94, 1, 0 } 83 | }; 84 | 85 | #define I_TABLE_CACHE_SIZE 4 86 | 87 | private int iTableCacheIndex = 0; 88 | private boolean_t iTableCacheUsed[ I_TABLE_CACHE_SIZE ]; 89 | private i_table_t iTableCache[ I_TABLE_CACHE_SIZE ]; 90 | 91 | public void ItableInit() 92 | { 93 | int i; 94 | 95 | for( i = 0 ; i < I_TABLE_SIZE ; i++ ) 96 | if( iTable[ i ].charset != i ) 97 | fprintf( stderr, "lv: invalid ichar table\n" ), exit( -1 ); 98 | 99 | for( i = 0 ; i < I_TABLE_CACHE_SIZE ; i++ ) 100 | iTableCacheUsed[ i ] = FALSE; 101 | } 102 | 103 | public byte ItableLookup( byte fin, boolean_t multi, boolean_t set94 ) 104 | { 105 | int i; 106 | 107 | for( i = iTableCacheIndex ; i >= 0 ; i-- ){ 108 | if( TRUE == iTableCacheUsed[ i ] 109 | && multi == iTableCache[ i ].multi 110 | && set94 == iTableCache[ i ].set94 111 | && fin == iTableCache[ i ].fin ) 112 | return iTableCache[ i ].charset; 113 | } 114 | for( i = I_TABLE_CACHE_SIZE - 1 ; i > iTableCacheIndex ; i-- ){ 115 | if( TRUE == iTableCacheUsed[ i ] 116 | && multi == iTableCache[ i ].multi 117 | && set94 == iTableCache[ i ].set94 118 | && fin == iTableCache[ i ].fin ) 119 | return iTableCache[ i ].charset; 120 | } 121 | for( i = 0 ; i < PSEUDO ; i++ ){ 122 | if( multi == iTable[ i ].multi 123 | && set94 == iTable[ i ].set94 124 | && fin == iTable[ i ].fin ){ 125 | iTableCacheIndex++; 126 | if( iTableCacheIndex >= I_TABLE_CACHE_SIZE ) 127 | iTableCacheIndex = 0; 128 | iTableCache[ iTableCacheIndex ] = iTable[ i ]; 129 | iTableCacheUsed[ iTableCacheIndex ] = TRUE; 130 | 131 | return i; 132 | } 133 | } 134 | if( TRUE == allow_unify ){ 135 | if( FALSE == multi && TRUE == set94 ) 136 | return ASCII; 137 | } 138 | return NOSET; 139 | } 140 | 141 | public int IcharWidth( byte charset, ic_t c ) 142 | { 143 | if( charset < PSEUDO ){ 144 | switch( charset ){ 145 | case UNICODE: 146 | if( c < unicode_width_threshold ) 147 | return 1; 148 | else 149 | return 2; 150 | } 151 | } else { 152 | switch( charset ){ 153 | case HTAB: 154 | case CNTRL: 155 | return MakeByte1( c ); 156 | } 157 | } 158 | return iTable[ (int)charset ].width; 159 | } 160 | 161 | public int IstrWidth( i_str_t *istr ) 162 | { 163 | int i, w; 164 | 165 | w = 0; 166 | for( i = 0 ; NOSET != istr[ i ].charset ; i++ ) 167 | w += IcharWidth( istr[ i ].charset, istr[ i ].c ); 168 | 169 | return w; 170 | } 171 | -------------------------------------------------------------------------------- /src/itable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * itable.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: itable.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __ITABLE_H__ 9 | #define __ITABLE_H__ 10 | 11 | #include 12 | #include 13 | 14 | #endif /* __ITABLE_H__ */ 15 | -------------------------------------------------------------------------------- /src/itable_e.h: -------------------------------------------------------------------------------- 1 | /* 2 | * itable_e.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: itable_e.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __ITABLE_E_H__ 9 | #define __ITABLE_E_H__ 10 | 11 | extern i_table_t iTable[]; 12 | 13 | #endif /* __ITABLE_E_H__ */ 14 | -------------------------------------------------------------------------------- /src/itable_t.h: -------------------------------------------------------------------------------- 1 | /* 2 | * itable_t.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: itable_t.h,v 1.6 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __ITABLE_T_H__ 9 | #define __ITABLE_T_H__ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | /* 16 | * character sets's name space (byte) 17 | */ 18 | 19 | #define ISO646_US 0 /* ISO 646 United states (ANSI X3.4-1968) */ 20 | #define X0201ROMAN 1 /* JIS X0201-1976 Japanese Roman */ 21 | 22 | #define X0201KANA 2 /* JIS X0201-1976 Japanese Katakana */ 23 | 24 | #define ISO8859_1 3 /* ISO 8859/1 Latin1 alphabet */ 25 | #define ISO8859_2 4 /* ISO 8859/2 Latin2 alphabet */ 26 | #define ISO8859_3 5 /* ISO 8859/3 Latin3 alphabet */ 27 | #define ISO8859_4 6 /* ISO 8859/4 Latin4 alphabet */ 28 | #define ISO8859_5 7 /* ISO 8859/5 Cyrillic alphabet */ 29 | #define ISO8859_6 8 /* ISO 8859/6 Arabic alphabet */ 30 | #define ISO8859_7 9 /* ISO 8859/7 Greek alphabet */ 31 | #define ISO8859_8 10 /* ISO 8859/8 Hebrew alphabet */ 32 | #define ISO8859_9 11 /* ISO 8859/9 Latin5 alphabet */ 33 | #define ISO8859_10 12 /* ISO 8859/10 Latin6 alphabet */ 34 | #define ISO8859_11 13 /* ISO 8859/13 Thai alphabet */ 35 | #define ISO8859_13 14 /* ISO 8859/13 Latin7 alphabet */ 36 | #define ISO8859_14 15 /* ISO 8859/14 Latin8 alphabet */ 37 | #define ISO8859_15 16 /* ISO 8859/15 Latin9 alphabet */ 38 | #define ISO8859_16 17 /* ISO 8859/16 Latin10 alphabet */ 39 | 40 | #define C6226 18 /* JIS C 6226-1978 Japanese kanji */ 41 | #define GB2312 19 /* GB 2312-80 Chinese kanji */ 42 | #define X0208 20 /* JIS X 0208-1983 Japanese kanji */ 43 | #define KSC5601 21 /* KS C 5601-1987 Korean graphic charset */ 44 | #define X0212 22 /* JIS X 0212-1990 Supplementary charset */ 45 | #define ISO_IR_165 23 /* ISO-IR-165 */ 46 | #define CNS_1 24 /* CNS 11643-1992 Plane 1 */ 47 | #define CNS_2 25 /* CNS 11643-1992 Plane 2 */ 48 | #define CNS_3 26 /* CNS 11643-1992 Plane 3 */ 49 | #define CNS_4 27 /* CNS 11643-1992 Plane 4 */ 50 | #define CNS_5 28 /* CNS 11643-1992 Plane 5 */ 51 | #define CNS_6 29 /* CNS 11643-1992 Plane 6 */ 52 | #define CNS_7 30 /* CNS 11643-1992 Plane 7 */ 53 | 54 | #define X0213_1 31 /* JIS X 0213-2000 Plane 1 */ 55 | #define X0213_2 32 /* JIS X 0213-2000 Plane 2 */ 56 | 57 | #define BIG5 33 /* Big5 Traditional Chinese */ 58 | 59 | #define UNICODE 34 /* Unicode */ 60 | 61 | #define PSEUDO 35 62 | 63 | #define SPACE 36 64 | #define HTAB 37 65 | #define CNTRL 38 66 | 67 | #define LINE_FEED 39 68 | 69 | #define I_TABLE_SIZE 40 70 | 71 | #define NOSET I_TABLE_SIZE 72 | 73 | #define ASCII ISO646_US 74 | 75 | /* 76 | * international charset table 77 | */ 78 | 79 | typedef struct { 80 | byte charset; 81 | byte fin; /* final character */ 82 | boolean_t multi; /* is multi bytes charset */ 83 | boolean_t set94; /* is 94 chars charset */ 84 | int length; /* code length for the charset */ 85 | int width; /* graphical width of each char */ 86 | } i_table_t; 87 | 88 | #define SET94 TRUE 89 | #define SET96 FALSE 90 | 91 | public boolean_t allow_unify; 92 | public ic_t unicode_width_threshold; 93 | 94 | public void ItableInit(); 95 | public byte ItableLookup( byte fin, boolean_t multi, boolean_t set94 ); 96 | 97 | public int IcharWidth( byte charset, ic_t c ); 98 | public int IstrWidth( i_str_t *istr ); 99 | 100 | #endif /* __ITABLE_T_H__ */ 101 | -------------------------------------------------------------------------------- /src/kana.c: -------------------------------------------------------------------------------- 1 | /* 2 | * kana.c 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio. 5 | * $Id: kana.c,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | /* 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | private ic_t X0201toX0208[ 61 ] = { 29 | 0x2123, /* 0x21 */ 30 | 0x2156, 31 | 0x2157, 32 | 0x2122, 33 | 0x2126, 34 | 0x2572, 35 | 0x2521, 36 | 0x2523, 37 | 0x2525, 38 | 0x2527, 39 | 0x2529, 40 | 0x2563, 41 | 0x2565, 42 | 0x2567, 43 | 0x2543, 44 | 0x213c, /* 0x30 */ 45 | 0x2522, 46 | 0x2524, 47 | 0x2526, 48 | 0x2528, 49 | 0x252a, 50 | 0x252b, 51 | 0x252d, 52 | 0x252f, 53 | 0x2531, 54 | 0x2533, 55 | 0x2535, 56 | 0x2537, 57 | 0x2539, 58 | 0x253b, 59 | 0x253d, 60 | 0x253f, /* 0x40 */ 61 | 0x2541, 62 | 0x2544, 63 | 0x2546, 64 | 0x2548, 65 | 0x254a, 66 | 0x254b, 67 | 0x254c, 68 | 0x254d, 69 | 0x254e, 70 | 0x254f, 71 | 0x2552, 72 | 0x2555, 73 | 0x2558, 74 | 0x255b, 75 | 0x255e, 76 | 0x255f, /* 0x50 */ 77 | 0x2560, 78 | 0x2561, 79 | 0x2562, 80 | 0x2564, 81 | 0x2566, 82 | 0x2568, 83 | 0x2569, 84 | 0x256a, 85 | 0x256b, 86 | 0x256c, 87 | 0x256d, 88 | 0x256f, 89 | 0x2573 /* 0x5d */ 90 | }; 91 | 92 | #define IsU( c ) ( 0x2526U == (c) ) 93 | 94 | private boolean_t IsKaToHo( ic_t c ) 95 | { 96 | if( 0x255bU < c ){ /* higher than `HO' */ 97 | return FALSE; 98 | } else if( c <= 0x2541U ){ /* lower than `CHI' */ 99 | if( 0x252bU <= c ){ /* between `KA' and `CHI' */ 100 | c -= 0x252bU; 101 | if( 0 == c % 2 ) 102 | return TRUE; 103 | } 104 | } else { /* between `DI' and `HO' */ 105 | if( 0x254fU <= c ){ /* between `HA' and `HO' */ 106 | c -= 0x254fU; 107 | if( 0 == c % 3 ) 108 | return TRUE; 109 | } else if( 0x2544U <= c && c <= 0x2548U ){ /* between `TSU' and `TO' */ 110 | c -= 0x2544U; 111 | if( 0 == c % 2 ) 112 | return TRUE; 113 | } 114 | } 115 | 116 | return FALSE; 117 | } 118 | 119 | private boolean_t IsHaToHo( ic_t c ) 120 | { 121 | if( 0x255bU < c ){ /* higher than `HO' */ 122 | return FALSE; 123 | } else if( 0x254fU <= c ){ /* between `HA' and `HO' */ 124 | c -= 0x254fU; 125 | if( 0 == c % 3 ) 126 | return TRUE; 127 | } 128 | 129 | return FALSE; 130 | } 131 | 132 | public void KanaX0201toX0208() 133 | { 134 | int index; 135 | ic_t x0201; 136 | 137 | /* 138 | * Remember this function is called only when: 139 | * ISIDX > 0 and X0201KANA == ISTR[ ISIDX - 1 ].charset 140 | */ 141 | 142 | index = ISIDX - 1; 143 | x0201 = ISTR[ index ].c; 144 | 145 | if( x0201 >= 0x21 && x0201 <= 0x5d ){ 146 | ISTR[ index ].charset = X0208; 147 | ISTR[ index ].c = X0201toX0208[ x0201 - 0x21 ]; 148 | } else if( x0201 == 0x5e ){ 149 | /* katakana voiced sound mark */ 150 | if( ISIDX > 1 && X0208 == ISTR[ ISIDX - 2 ].charset ){ 151 | index--; 152 | if( IsU( ISTR[ index ].c ) ){ 153 | ISTR[ index ].c = 0x2574U; 154 | ISIDX--; 155 | return; 156 | } else if( IsKaToHo( ISTR[ index ].c ) ){ 157 | ISTR[ index ].c++; 158 | ISIDX--; 159 | return; 160 | } 161 | index++; 162 | } 163 | ISTR[ index ].charset = X0208; 164 | ISTR[ index ].c = 0x212bU; 165 | } else if( x0201 == 0x5f ){ 166 | /* katakana semi-voiced sound mark */ 167 | if( ISIDX > 1 && X0208 == ISTR[ ISIDX - 2 ].charset ){ 168 | index--; 169 | if( IsHaToHo( ISTR[ index ].c ) ){ 170 | ISTR[ index ].c += 2; 171 | ISIDX--; 172 | return; 173 | } 174 | index++; 175 | } 176 | ISTR[ index ].charset = X0208; 177 | ISTR[ index ].c = 0x212cU; 178 | } else { 179 | /* undefined region */ 180 | ISTR[ index ].charset = ASCII; 181 | ISTR[ index ].c = (ic_t)'?'; 182 | } 183 | } 184 | -------------------------------------------------------------------------------- /src/kana.h: -------------------------------------------------------------------------------- 1 | /* 2 | * kana.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: kana.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __KANA_H__ 9 | #define __KANA_H__ 10 | 11 | #include 12 | 13 | public boolean_t kana_conv; 14 | 15 | public void KanaX0201toX0208(); 16 | 17 | #endif /* __KANA_H__ */ 18 | -------------------------------------------------------------------------------- /src/keybind.h: -------------------------------------------------------------------------------- 1 | /* 2 | * keybind.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: keybind.h,v 1.6 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __KEYBIND_H__ 9 | #define __KEYBIND_H__ 10 | 11 | typedef void (*key_table_t)( unsigned int ); 12 | 13 | private key_table_t keyTable[ 128 ] = { 14 | CommandNull, /* C-@ */ /* 0/0 */ 15 | CommandNull, /* C-a */ 16 | CommandPrevPage, /* C-b */ 17 | CommandNull, /* C-c */ 18 | CommandNextHalf, /* C-d */ 19 | CommandNextLine, /* C-e */ 20 | CommandNextPage, /* C-f */ 21 | CommandFileStatus, /* C-g */ 22 | CommandPrevLine, /* C-h */ 23 | CommandNull, /* C-i */ 24 | CommandNextLine, /* C-j */ 25 | CommandPrevLine, /* C-k */ 26 | CommandRedisplay, /* C-l */ 27 | CommandNextLine, /* C-m */ 28 | CommandNextLine, /* C-n */ 29 | CommandNull, /* C-o */ 30 | CommandPrevLine, /* C-p */ /* 1/0 */ 31 | CommandNull, /* C-q */ 32 | CommandRefresh, /* C-r */ 33 | CommandNull, /* C-s */ 34 | CommandToggleHz, /* C-t */ 35 | CommandPrevHalf, /* C-u */ 36 | CommandNextPage, /* C-v */ 37 | CommandNull, /* C-w */ 38 | CommandNull, /* C-x */ 39 | CommandPrevLine, /* C-y */ 40 | CommandShellEscape, /* C-z */ 41 | CommandCursor, /* C-[ */ 42 | CommandNull, /* C-\ */ 43 | CommandNull, /* C-] */ 44 | CommandNull, /* C-^ */ 45 | CommandNull, /* C-_ */ 46 | CommandNextPage, /* ' ' */ /* 2/0 */ 47 | CommandNull, /* '!' */ 48 | CommandNull, /* '"' */ 49 | CommandNull, /* '#' */ 50 | CommandNull, /* '$' */ 51 | CommandNull, /* '%' */ 52 | CommandNull, /* '&' */ 53 | CommandNull, /* ''' */ 54 | CommandNull, /* '(' */ 55 | CommandNull, /* ')' */ 56 | CommandNull, /* '*' */ 57 | CommandNull, /* '+' */ 58 | CommandNull, /* ',' */ 59 | CommandNull, /* '-' */ 60 | CommandNull, /* '.' */ 61 | CommandFindForward, /* '/' */ 62 | CommandNull, /* '0' */ /* 3/0 */ 63 | CommandNull, /* '1' */ 64 | CommandNull, /* '2' */ 65 | CommandNull, /* '3' */ 66 | CommandNull, /* '4' */ 67 | CommandNull, /* '5' */ 68 | CommandNull, /* '6' */ 69 | CommandNull, /* '7' */ 70 | CommandNull, /* '8' */ 71 | CommandNull, /* '9' */ 72 | CommandColon, /* ':' */ 73 | CommandNull, /* ';' */ 74 | CommandTopOfFile, /* '<' */ 75 | CommandFileStatus, /* '=' */ 76 | CommandBottomOfFile, /* '>' */ 77 | CommandFindBackward, /* '?' */ 78 | CommandNull, /* '@' */ /* 4/0 */ 79 | CommandNull, /* 'A' */ 80 | CommandNull, /* 'B' */ 81 | CommandNull, /* 'C' */ 82 | CommandNull, /* 'D' */ 83 | CommandNull, /* 'E' */ 84 | CommandPoll, /* 'F' */ 85 | CommandBottomOfFile, /* 'G' */ 86 | CommandPrevLine, /* 'H' */ 87 | CommandNull, /* 'I' */ 88 | CommandNull, /* 'J' */ 89 | CommandPrevPage, /* 'K' */ 90 | CommandNull, /* 'L' */ 91 | CommandNextPage, /* 'M' */ 92 | CommandRepeatBackward,/* 'N' */ 93 | CommandNull, /* 'O' */ 94 | CommandNextLine, /* 'P' */ /* 5/0 */ 95 | CommandQuit, /* 'Q' */ 96 | CommandReload, /* 'R' */ 97 | CommandNull, /* 'S' */ 98 | CommandReverseCset, /* 'T' */ 99 | CommandNull, /* 'U' */ 100 | CommandVersion, /* 'V' */ 101 | CommandNull, /* 'W' */ 102 | CommandNull, /* 'X' */ 103 | CommandNull, /* 'Y' */ 104 | CommandNull, /* 'Z' */ 105 | CommandNull, /* '[' */ 106 | CommandNull, /* '\' */ 107 | CommandNull, /* ']' */ 108 | CommandNull, /* '^' */ 109 | CommandNull, /* '_' */ 110 | CommandNull, /* '`' */ /* 6/0 */ 111 | CommandNull, /* 'a' */ 112 | CommandPrevPage, /* 'b' */ 113 | CommandNull, /* 'c' */ 114 | CommandNextHalf, /* 'd' */ 115 | CommandNextLine, /* 'e' */ 116 | CommandNextPage, /* 'f' */ 117 | CommandTopOfFile, /* 'g' */ 118 | CommandNull, /* 'h' */ 119 | CommandNull, /* 'i' */ 120 | CommandNextLine, /* 'j' */ 121 | CommandPrevLine, /* 'k' */ 122 | CommandNull, /* 'l' */ 123 | CommandNull, /* 'm' */ 124 | CommandRepeatForward, /* 'n' */ 125 | CommandNull, /* 'o' */ 126 | CommandPercent, /* 'p' */ /* 7/0 */ 127 | CommandQuit, /* 'q' */ 128 | CommandRefresh, /* 'r' */ 129 | #ifdef REGEXP_TEST 130 | CommandRegexpNFA, /* 's' */ 131 | CommandRegexpDFA, /* 't' */ 132 | #else 133 | CommandNull, /* 's' */ 134 | CommandToggleCset, /* 't' */ 135 | #endif /* REGEXP_TEST */ 136 | CommandPrevHalf, /* 'u' */ 137 | CommandEdit, /* 'v' */ 138 | CommandPrevLine, /* 'w' */ 139 | CommandNull, /* 'x' */ 140 | CommandPrevLine, /* 'y' */ 141 | CommandNull, /* 'z' */ 142 | CommandNull, /* '{' */ 143 | CommandNull, /* '|' */ 144 | CommandNull, /* '}' */ 145 | CommandNull, /* '~' */ 146 | CommandNull /* 7/15 */ 147 | }; 148 | 149 | #endif /* __KEYBIND_H__ */ 150 | -------------------------------------------------------------------------------- /src/map8859.pl: -------------------------------------------------------------------------------- 1 | #! /usr/local/bin/perl 2 | 3 | # All rights reserved. Copyright (C) 1999 by NARITA Tomio. 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | 10 | # 8859-2 11 | 12 | $file = "zcat 8859-2.TXT.gz |"; 13 | $set = "2"; 14 | 15 | for $i ( 0 .. $#ARGV ){ 16 | if( $ARGV[ $i ] eq "-i" ){ 17 | $file = $ARGV[ ++$i ]; 18 | } elsif( $ARGV[ $i ] eq "-s" ){ 19 | $set = $ARGV[ ++$i ]; 20 | } 21 | } 22 | 23 | open( FILE, $file ) || die( "cannot open $file" ); 24 | 25 | while( ){ 26 | chop; 27 | if( /^#/ ){ 28 | next; 29 | } 30 | ( $code, $uni, $rest ) = split; 31 | if( hex( $code ) >= 0x80 ){ 32 | $count++; 33 | $array{ $uni } = sprintf( "0x%02x", hex( $code ) & 0x7f ); 34 | } 35 | } 36 | 37 | close( FILE ); 38 | 39 | # output 40 | 41 | print "private codes_t mapISO8859_${set}[ $count ] = {\n"; 42 | 43 | for $index ( sort keys( %array ) ){ 44 | $code = $array{ $index }; 45 | $count--; 46 | if( $count == 0 ){ 47 | print " { $index, $code }\n"; 48 | } else { 49 | print " { $index, $code },\n"; 50 | } 51 | } 52 | 53 | print "};\n"; 54 | -------------------------------------------------------------------------------- /src/mapbig5.pl: -------------------------------------------------------------------------------- 1 | #! /usr/local/bin/perl 2 | 3 | # All rights reserved. Copyright (C) 1999 by NARITA Tomio. 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | 10 | # Unicode to Big five 11 | 12 | $file = "zcat BIG5.TXT.gz |"; 13 | 14 | for $i ( 0 .. $#ARGV ){ 15 | if( $ARGV[ $i ] eq "-i" ){ 16 | $file = $ARGV[ ++$i ]; 17 | } 18 | } 19 | 20 | open( FILE, $file ) || die( "cannot open $file" ); 21 | 22 | while( ){ 23 | chop; 24 | if( /^#/ ){ 25 | next; 26 | } 27 | ( $big5, $uni, $rest ) = split; 28 | if( $uni ne "0xFFFD" ){ 29 | if( $array{ $uni } ne "" ){ 30 | print STDERR "Warning: duplicate unicode: $uni\n"; 31 | next; 32 | } 33 | 34 | $count++; 35 | $array{ $uni } = $big5; 36 | } 37 | } 38 | 39 | print "private codes_t mapBIG5[ $count ] = {\n"; 40 | 41 | for $index ( sort keys( %array ) ){ 42 | $code = $array{ $index }; 43 | $count--; 44 | if( $count == 0 ){ 45 | print " { $index, $code }\n"; 46 | } else { 47 | print " { $index, $code },\n"; 48 | } 49 | } 50 | 51 | print "};\n"; 52 | -------------------------------------------------------------------------------- /src/mapgb.pl: -------------------------------------------------------------------------------- 1 | #! /usr/local/bin/perl 2 | 3 | # All rights reserved. Copyright (C) 1999 by NARITA Tomio. 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | 10 | # Unicode to GB2312 11 | 12 | $file = "zcat GB2312.TXT.gz |"; 13 | 14 | for $i ( 0 .. $#ARGV ){ 15 | if( $ARGV[ $i ] eq "-i" ){ 16 | $file = $ARGV[ ++$i ]; 17 | } 18 | } 19 | 20 | open( FILE, $file ) || die( "cannot open $file" ); 21 | 22 | while( ){ 23 | chop; 24 | if( /^#/ ){ 25 | next; 26 | } 27 | ( $gb, $uni, $rest ) = split; 28 | 29 | if( $array{ $uni } ne "" ){ 30 | print STDERR "Warning: duplicate character, uni:$uni\n"; 31 | next; 32 | } 33 | 34 | $count++; 35 | $array{ $uni } = $gb; 36 | } 37 | 38 | print "private codes_t mapGB2312[ $count ] = {\n"; 39 | 40 | for $index ( sort keys( %array ) ){ 41 | $code = $array{ $index }; 42 | $count--; 43 | if( $count == 0 ){ 44 | print " { $index, $code }\n"; 45 | } else { 46 | print " { $index, $code },\n"; 47 | } 48 | } 49 | 50 | print "};\n"; 51 | -------------------------------------------------------------------------------- /src/mapjis.pl: -------------------------------------------------------------------------------- 1 | #! /usr/local/bin/perl 2 | 3 | # All rights reserved. Copyright (C) 1999 by NARITA Tomio. 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | 10 | # Unicode to JIS X 0208 11 | 12 | $file = "zcat JIS0208.TXT.gz |"; 13 | 14 | open( FILE, $file ) || die( "cannot open $file" ); 15 | 16 | while( ){ 17 | chop; 18 | if( /^#/ ){ 19 | next; 20 | } 21 | ( $sjis, $jis, $uni, $rest ) = split; 22 | 23 | $count++; 24 | $array{ $uni } = pack( "A6A7", $jis, ", X0208" ); 25 | } 26 | 27 | close( FILE ); 28 | 29 | # JIS X 0212 30 | 31 | $file = "zcat JIS0212.TXT.gz |"; 32 | 33 | open( FILE, $file ) || die( "cannot open $file" ); 34 | 35 | while( ){ 36 | chop; 37 | if( /^#/ ){ 38 | next; 39 | } 40 | ( $jis, $uni, $rest ) = split; 41 | 42 | if( $array{ $uni } ne "" ){ 43 | print STDERR "Warning: duplicate character, uni:$uni, 0212:$jis\n"; 44 | next; 45 | } 46 | 47 | $count++; 48 | $array{ $uni } = pack( "A6A7", $jis, ", X0212" ); 49 | } 50 | 51 | close( FILE ); 52 | 53 | # Output 54 | 55 | print "private codes_cset_t mapJIS[ $count ] = {\n"; 56 | 57 | for $index ( sort keys( %array ) ){ 58 | $code = $array{ $index }; 59 | $count--; 60 | if( $count == 0 ){ 61 | print " { $index, $code }\n"; 62 | } else { 63 | print " { $index, $code },\n"; 64 | } 65 | } 66 | 67 | print "};\n"; 68 | -------------------------------------------------------------------------------- /src/mapksc.pl: -------------------------------------------------------------------------------- 1 | #! /usr/local/bin/perl 2 | 3 | # All rights reserved. Copyright (C) 1999 by NARITA Tomio. 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | 10 | # Unicode to KSC 5601-1987 11 | 12 | $file = "zcat KSX1001.TXT.gz |"; 13 | 14 | for $i ( 0 .. $#ARGV ){ 15 | if( $ARGV[ $i ] eq "-i" ){ 16 | $file = $ARGV[ ++$i ]; 17 | } 18 | } 19 | 20 | open( FILE, $file ) || die( "cannot open $file" ); 21 | 22 | while( ){ 23 | chop; 24 | if( /^#/ ){ 25 | next; 26 | } 27 | ( $ksc, $uni, $rest ) = split; 28 | $count++; 29 | $array{ $uni } = $ksc; 30 | } 31 | 32 | print "private codes_t mapKSC5601[ $count ] = {\n"; 33 | 34 | for $index ( sort keys( %array ) ){ 35 | $code = $array{ $index }; 36 | $count--; 37 | if( $count == 0 ){ 38 | print " { $index, $code }\n"; 39 | } else { 40 | print " { $index, $code },\n"; 41 | } 42 | } 43 | 44 | print "};\n"; 45 | -------------------------------------------------------------------------------- /src/nfa.c: -------------------------------------------------------------------------------- 1 | /* 2 | * nfa.c 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio. 5 | * $Id: nfa.c,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | /* 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | private set_t *SetAlloc( re_t *re ) 34 | { 35 | set_t *set; 36 | 37 | set = (set_t *)Malloc( sizeof( set_t ) ); 38 | 39 | set->re = re; 40 | set->next = NULL; 41 | 42 | return set; 43 | } 44 | 45 | public void ReInclude( set_t **root, re_t *target ) 46 | { 47 | set_t *new, *ptr, *last, *res; 48 | 49 | if( NULL == target ) 50 | return; 51 | 52 | res = NULL; 53 | for( last = NULL, ptr = *root ; ptr ; last = ptr, ptr = ptr->next ){ 54 | if( ptr->re == target ){ 55 | res = ptr; 56 | break; 57 | } 58 | if( ptr->re->op < target->op ) 59 | break; 60 | } 61 | 62 | if( NULL == res ){ 63 | /* 64 | * insert new into root in descendent order 65 | */ 66 | new = SetAlloc( target ); 67 | 68 | if( NULL == last ){ 69 | new->next = *root; 70 | *root = new; 71 | } else { 72 | new->next = last->next; 73 | last->next = new; 74 | } 75 | } 76 | } 77 | 78 | public void SetInclude( set_t **root, set_t *target ) 79 | { 80 | set_t *set; 81 | 82 | for( set = target ; set ; set = set->next ) 83 | ReInclude( root, set->re ); 84 | } 85 | 86 | private int ReNullable( re_t *re ) 87 | { 88 | if( NULL == re ) 89 | return FALSE; 90 | 91 | if( OP_OR == re->op ) 92 | return ReNullable( re->left ) || ReNullable( re->right ); 93 | else if( OP_CAT == re->op ) 94 | return ReNullable( re->left ) && ReNullable( re->right ); 95 | else if( OP_CLOSURE == re->op || OP_QUESTION == re->op ) 96 | return TRUE; 97 | else 98 | return FALSE; 99 | } 100 | 101 | public set_t *ReFirstpos( re_t *re ) 102 | { 103 | set_t *set = NULL; 104 | 105 | if( NULL == re ) 106 | return NULL; 107 | 108 | if( NULL != re->firstpos ) 109 | return (set_t *)re->firstpos; 110 | 111 | if( OP_OR == re->op ){ 112 | SetInclude( (set_t **)&set, ReFirstpos( re->left ) ); 113 | SetInclude( (set_t **)&set, ReFirstpos( re->right ) ); 114 | } else if( OP_CAT == re->op ){ 115 | if( ReNullable( re->left ) ){ 116 | SetInclude( (set_t **)&set, ReFirstpos( re->left ) ); 117 | SetInclude( (set_t **)&set, ReFirstpos( re->right ) ); 118 | } else { 119 | SetInclude( (set_t **)&set, ReFirstpos( re->left ) ); 120 | } 121 | } else if( OP_CLOSURE == re->op || OP_QUESTION == re->op ){ 122 | SetInclude( (set_t **)&set, ReFirstpos( re->left ) ); 123 | } else 124 | set = SetAlloc( re ); 125 | 126 | re->firstpos = (void *)set; 127 | 128 | return set; 129 | } 130 | 131 | public set_t *ReLastpos( re_t *re ) 132 | { 133 | set_t *set = NULL; 134 | 135 | if( NULL == re ) 136 | return NULL; 137 | 138 | if( NULL != re->lastpos ) 139 | return (set_t *)re->lastpos; 140 | 141 | if( OP_OR == re->op ){ 142 | SetInclude( (set_t **)&set, ReLastpos( re->right ) ); 143 | SetInclude( (set_t **)&set, ReLastpos( re->left ) ); 144 | } else if( OP_CAT == re->op ){ 145 | if( ReNullable( re->right ) ){ 146 | SetInclude( (set_t **)&set, ReLastpos( re->right ) ); 147 | SetInclude( (set_t **)&set, ReLastpos( re->left ) ); 148 | } else { 149 | SetInclude( (set_t **)&set, ReLastpos( re->right ) ); 150 | } 151 | } else if( OP_CLOSURE == re->op || OP_QUESTION == re->op ){ 152 | SetInclude( (set_t **)&set, ReLastpos( re->left ) ); 153 | } else 154 | set = SetAlloc( re ); 155 | 156 | re->lastpos = (void *)set; 157 | 158 | return set; 159 | } 160 | 161 | public void ReFollowpos( re_t *re ) 162 | { 163 | set_t *set; 164 | 165 | if( NULL == re ) 166 | return; 167 | 168 | if( NULL != re->followpos ) 169 | return; 170 | 171 | if( OP_CAT == re->op ){ 172 | for( set = ReLastpos( re->left ) ; set ; set = set->next ) 173 | SetInclude( (set_t **)&set->re->followpos, ReFirstpos( re->right ) ); 174 | } else if( OP_CLOSURE == re->op ){ 175 | for( set = ReLastpos( re ) ; set ; set = set->next ) 176 | SetInclude( (set_t **)&set->re->followpos, ReFirstpos( re ) ); 177 | } else if( OP_QUESTION == re->op ){ 178 | /* nothing follows */ 179 | } 180 | } 181 | 182 | public void ReMakeFollowpos( re_t *re ) 183 | { 184 | if( NULL == re ) 185 | return; 186 | 187 | ReFirstpos( re->left ); 188 | ReFirstpos( re->right ); 189 | ReFirstpos( re ); 190 | 191 | ReLastpos( re->left ); 192 | ReLastpos( re->right ); 193 | ReLastpos( re ); 194 | 195 | ReMakeFollowpos( re->left ); 196 | ReMakeFollowpos( re->right ); 197 | ReFollowpos( re ); 198 | } 199 | -------------------------------------------------------------------------------- /src/nfa.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nfa.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: nfa.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __NFA_H__ 9 | #define __NFA_H__ 10 | 11 | #include 12 | 13 | public void ReInclude( set_t **root, re_t *target ); 14 | public void SetInclude( set_t **root, set_t *target ); 15 | public void ReMakeFollowpos( re_t *re ); 16 | 17 | public set_t *ReFirstpos( re_t *re ); 18 | public set_t *ReLastpos( re_t *re ); 19 | public void ReFollowpos( re_t *re ); 20 | 21 | #endif /* __NFA_H__ */ 22 | -------------------------------------------------------------------------------- /src/position.h: -------------------------------------------------------------------------------- 1 | /* 2 | * position.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: position.h,v 1.5 2004/01/05 07:30:15 nrt Exp $ 6 | */ 7 | 8 | #ifndef __POSITION_H__ 9 | #define __POSITION_H__ 10 | 11 | #include 12 | #include 13 | 14 | #define PositionGet( pos, s, b, o, p ) \ 15 | { \ 16 | (s) = (pos).seg; \ 17 | (b) = (pos).blk; \ 18 | (o) = (pos).off; \ 19 | (p) = (pos).phy; \ 20 | } 21 | 22 | #define PositionSet( pos, s, b, o, p ) \ 23 | { \ 24 | (pos).seg = (s); \ 25 | (pos).blk = (b); \ 26 | (pos).off = (o); \ 27 | (pos).phy = (p); \ 28 | } 29 | 30 | #define PositionAssign( toPos, fromPos ) \ 31 | { \ 32 | (toPos).seg = (fromPos).seg; \ 33 | (toPos).blk = (fromPos).blk; \ 34 | (toPos).off = (fromPos).off; \ 35 | (toPos).phy = (fromPos).phy; \ 36 | } 37 | 38 | #define PositionDec( f, seg, blk, off, phy ) \ 39 | { \ 40 | if( --(phy) < 0 ){ \ 41 | if( --(off) < 0 ){ \ 42 | if( (seg) == 0 ){ /* top of file */ \ 43 | (phy)++; \ 44 | (off)++; \ 45 | /* \ 46 | * BREAK for EXTERNAL FOR-LOOP \ 47 | */ \ 48 | break; \ 49 | } else { \ 50 | if( FALSE == FetchLine( (f), (seg) - 1, LV_PAGE_SIZE - 1 ) ){ \ 51 | /* \ 52 | * memory shortage? \ 53 | */ \ 54 | fprintf( stderr, "memory shortage?\n" ); \ 55 | FatalErrorOccurred(); \ 56 | } else { /* successfully loaded */ \ 57 | (seg)--; \ 58 | (blk) = Block( (seg) ); \ 59 | (off) = (f)->page[ (blk) ].lines - 1; \ 60 | } \ 61 | } \ 62 | } \ 63 | (phy) = (f)->page[ (blk) ].line[ (off) ].heads - 1; \ 64 | } \ 65 | } 66 | 67 | #define PositionInc( f, seg, blk, off, phy ) \ 68 | { \ 69 | if( ++(phy) >= (f)->page[ (blk) ].line[ (off) ].heads ){ \ 70 | if( ++(off) >= (f)->page[ (blk) ].lines ){ \ 71 | if( FALSE == FetchLine( (f), (seg) + 1, 0 ) ){ \ 72 | /* end of file */ \ 73 | (phy)--; \ 74 | (off)--; \ 75 | /* \ 76 | * BREAK for EXTERNAL FOR-LOOP \ 77 | */ \ 78 | break; \ 79 | } else { /* successfully loaded */ \ 80 | (seg)++; \ 81 | (blk) = Block( (seg) ); \ 82 | (off) = 0; \ 83 | } \ 84 | } \ 85 | (phy) = 0; \ 86 | } \ 87 | } 88 | 89 | #endif /* __POSITION_H__ */ 90 | -------------------------------------------------------------------------------- /src/raw.c: -------------------------------------------------------------------------------- 1 | /* 2 | * raw.c 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio. 5 | * $Id: raw.c,v 1.6 2004/01/05 07:23:29 nrt Exp $ 6 | */ 7 | /* 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | public void DecodeRaw( state_t *state, byte codingSystem ) 32 | { 33 | byte ch, c[ ICHAR_WIDTH ]; 34 | 35 | for( ; ; ){ 36 | GetChar( ch ); 37 | if( SP == ch ){ 38 | DecodeAddSpace( 0 ); 39 | } else if( HT == ch ){ 40 | DecodeAddTab( 0 ); 41 | } else if( ch < SP || ch >= DEL ){ 42 | DecodeAddControl( ch ); 43 | } else { 44 | c[ 0 ] = ch; 45 | DecodeAddChar( ASCII, c, 0 ); 46 | } 47 | } 48 | } 49 | 50 | public void EncodeRaw( i_str_t *istr, int head, int tail, 51 | byte codingSystem, boolean_t binary ) 52 | { 53 | int idx, attr; 54 | ic_t ic; 55 | byte cset; 56 | 57 | for( idx = head ; idx < tail ; idx++ ){ 58 | cset = istr[ idx ].charset; 59 | ic = istr[ idx ].c; 60 | attr = (int)istr[ idx ].attr << 8; 61 | if( cset < PSEUDO ){ 62 | if( TRUE == iTable[ (int)cset ].multi ){ 63 | EncodeAddChar( attr, MakeByte1( ic ) ); 64 | if( 2 == IcharWidth( cset, ic ) ) 65 | EncodeAddChar( attr, MakeByte2( ic ) ); 66 | } else { 67 | EncodeAddChar( attr, ic ); 68 | } 69 | } else if( FALSE == EncodeAddPseudo( attr, ic, cset, binary ) ){ 70 | break; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/raw.h: -------------------------------------------------------------------------------- 1 | /* 2 | * raw.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: raw.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __RAW_H__ 9 | #define __RAW_H__ 10 | 11 | #include 12 | 13 | public void DecodeRaw( state_t *state, byte codingSystem ); 14 | 15 | public void EncodeRaw( i_str_t *istr, int head, int tail, 16 | byte codingSystem, boolean_t binary ); 17 | 18 | #endif /* __RAW_H__ */ 19 | -------------------------------------------------------------------------------- /src/re.h: -------------------------------------------------------------------------------- 1 | /* 2 | * re.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: re.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __RE_H__ 9 | #define __RE_H__ 10 | 11 | #include 12 | 13 | /* 14 | * regular expression 15 | * 16 | * regexp = [ '^' ] [ '$' ] 17 | * exp = { '\|' } 18 | * exp1 = { } 19 | * exp2 = [ '*' | '?' | '+' ] 20 | * term = | '.' | '\1' | '\2' 21 | * | '\(' '\)' 22 | * | '[' [ '^' ] ']' 23 | * char = | '\' 24 | * charset = { } 25 | * charset1 = [ '-' ] 26 | */ 27 | 28 | #define OP_LEAF 0 29 | #define OP_SIMPLE_LEAF 1 30 | #define OP_HAT 2 31 | #define OP_DOLLAR 3 32 | #define OP_RANGE 4 33 | #define OP_COMPLEMENT 5 34 | #define OP_COMPRANGE 6 35 | #define OP_CATEGORY1 7 36 | #define OP_CATEGORY2 8 37 | #define OP_CATEGORY3 9 38 | #define OP_PERIOD 10 39 | #define OP_IGETA 11 40 | 41 | #define OP_LEAF_MAX 12 42 | 43 | #define OP_OR 12 44 | #define OP_CLOSURE 13 45 | #define OP_QUESTION 14 46 | #define OP_CAT 15 47 | 48 | /* 49 | * ic list 50 | */ 51 | 52 | typedef struct RE_T { 53 | int op; 54 | #ifdef MSDOS 55 | #undef i_str_t 56 | #endif /* MSDOS */ 57 | i_str_t *ic; 58 | #ifdef MSDOS 59 | #define i_str_t i_str_t far 60 | #endif /* MSDOS */ 61 | struct RE_T *left, *right; 62 | void *firstpos, *lastpos, *followpos; 63 | } re_t; 64 | 65 | typedef struct SET_T { 66 | re_t *re; 67 | struct SET_T *next; 68 | } set_t; 69 | 70 | public byte *reMessage; 71 | 72 | public void SetFreeAll( set_t *set ); 73 | public void ReFreeAll( re_t *re ); 74 | public re_t *ReMakeTree( i_str_t *istr ); 75 | 76 | #endif /* __RE_H__ */ 77 | -------------------------------------------------------------------------------- /src/rev0208.pl: -------------------------------------------------------------------------------- 1 | #! /usr/local/bin/perl 2 | 3 | # All rights reserved. Copyright (C) 1999 by NARITA Tomio. 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | 10 | # Unicode to JIS X 0208 11 | 12 | $file = "zcat JIS0208.TXT.gz |"; 13 | 14 | for $i ( 0 .. $#ARGV ){ 15 | if( $ARGV[ $i ] eq "-i" ){ 16 | $file = $ARGV[ ++$i ]; 17 | } 18 | } 19 | 20 | open( FILE, $file ) || die( "cannot open $file" ); 21 | 22 | while( ){ 23 | chop; 24 | if( /^#/ ){ 25 | next; 26 | } 27 | ( $sjis, $jis, $uni, $rest ) = split; 28 | 29 | $count++; 30 | $array{ $jis } = $uni; 31 | } 32 | 33 | close( FILE ); 34 | 35 | # Output 36 | 37 | print "private codes_t revJIS0208[ $count ] = {\n"; 38 | 39 | for $index ( sort keys( %array ) ){ 40 | $code = $array{ $index }; 41 | $count--; 42 | if( $count == 0 ){ 43 | print " { $index, $code }\n"; 44 | } else { 45 | print " { $index, $code },\n"; 46 | } 47 | } 48 | 49 | print "};\n"; 50 | -------------------------------------------------------------------------------- /src/rev0212.pl: -------------------------------------------------------------------------------- 1 | #! /usr/local/bin/perl 2 | 3 | # All rights reserved. Copyright (C) 1999 by NARITA Tomio. 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | 10 | # JIS X 0212 to Unicode 11 | 12 | $file = "zcat JIS0212.TXT.gz |"; 13 | 14 | for $i ( 0 .. $#ARGV ){ 15 | if( $ARGV[ $i ] eq "-i" ){ 16 | $file = $ARGV[ ++$i ]; 17 | } 18 | } 19 | 20 | open( FILE, $file ) || die( "cannot open $file" ); 21 | 22 | while( ){ 23 | chop; 24 | if( /^#/ ){ 25 | next; 26 | } 27 | ( $jis, $uni, $rest ) = split; 28 | 29 | $count++; 30 | $array{ $jis } = $uni; 31 | } 32 | 33 | close( FILE ); 34 | 35 | # Output 36 | 37 | print "private codes_t revJIS0212[ $count ] = {\n"; 38 | 39 | for $index ( sort keys( %array ) ){ 40 | $code = $array{ $index }; 41 | $count--; 42 | if( $count == 0 ){ 43 | print " { $index, $code }\n"; 44 | } else { 45 | print " { $index, $code },\n"; 46 | } 47 | } 48 | 49 | print "};\n"; 50 | -------------------------------------------------------------------------------- /src/rev8859.pl: -------------------------------------------------------------------------------- 1 | #! /usr/local/bin/perl 2 | 3 | # All rights reserved. Copyright (C) 1999 by NARITA Tomio. 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | 10 | # ISO 8859-* to Unicode 11 | 12 | $file = "zcat 8859-2.TXT.gz |"; 13 | $set = "2"; 14 | 15 | for $i ( 0 .. $#ARGV ){ 16 | if( $ARGV[ $i ] eq "-i" ){ 17 | $file = $ARGV[ ++$i ]; 18 | } elsif( $ARGV[ $i ] eq "-s" ){ 19 | $set = $ARGV[ ++$i ]; 20 | } 21 | } 22 | 23 | open( FILE, $file ) || die( "cannot open $file" ); 24 | 25 | for( $index = 0x20 ; $index < 0x80 ; $index++ ){ 26 | $array{$index} = "0x0000"; 27 | } 28 | 29 | while( ){ 30 | chop; 31 | if( /^#/ ){ 32 | next; 33 | } 34 | ( $code, $uni, $rest ) = split; 35 | if( hex( $code ) >= 0x80 ){ 36 | $count++; 37 | # $array{ sprintf( "0x%02x", hex( $code ) & 0x7f ) } = $uni; 38 | $array{ hex( $code ) & 0x7f } = $uni; 39 | } 40 | } 41 | 42 | close( FILE ); 43 | 44 | #print "private codes_t revISO8859_${set}[ $count ] = {\n"; 45 | print "private ic_t revISO8859_${set}[ 96 ] = {\n"; 46 | 47 | for( $index = 0x20 ; $index < 0x80 ; $index++ ){ 48 | if( 0x7f == $index ){ 49 | print " $array{$index}\n"; 50 | } else { 51 | print " $array{$index},\n"; 52 | } 53 | } 54 | 55 | #for $index ( sort keys( %array ) ){ 56 | # $code = $array{ $index }; 57 | # $count--; 58 | # if( $count == 0 ){ 59 | # print " { $index, $code }\n"; 60 | # } else { 61 | # print " { $index, $code },\n"; 62 | # } 63 | #} 64 | 65 | print "};\n"; 66 | -------------------------------------------------------------------------------- /src/revbig5.pl: -------------------------------------------------------------------------------- 1 | #! /usr/local/bin/perl 2 | 3 | # All rights reserved. Copyright (C) 1999 by NARITA Tomio. 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | 10 | # Big five to Unicode 11 | 12 | $file = "zcat BIG5.TXT.gz |"; 13 | 14 | for $i ( 0 .. $#ARGV ){ 15 | if( $ARGV[ $i ] eq "-i" ){ 16 | $file = $ARGV[ ++$i ]; 17 | } 18 | } 19 | 20 | open( FILE, $file ) || die( "cannot open $file" ); 21 | 22 | while( ){ 23 | chop; 24 | if( /^#/ ){ 25 | next; 26 | } 27 | ( $big5, $uni, $rest ) = split; 28 | if( $uni ne "0xFFFD" ){ 29 | $count++; 30 | $array{ $big5 } = $uni; 31 | } 32 | } 33 | 34 | print "private codes_t revBIG5[ $count ] = {\n"; 35 | 36 | for $index ( sort keys( %array ) ){ 37 | $code = $array{ $index }; 38 | $count--; 39 | if( $count == 0 ){ 40 | print " { $index, $code }\n"; 41 | } else { 42 | print " { $index, $code },\n"; 43 | } 44 | } 45 | 46 | print "};\n"; 47 | -------------------------------------------------------------------------------- /src/revgb.pl: -------------------------------------------------------------------------------- 1 | #! /usr/local/bin/perl 2 | 3 | # All rights reserved. Copyright (C) 1999 by NARITA Tomio. 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | 10 | # Unicode to GB2312 11 | 12 | $file = "zcat GB2312.TXT.gz |"; 13 | 14 | for $i ( 0 .. $#ARGV ){ 15 | if( $ARGV[ $i ] eq "-i" ){ 16 | $file = $ARGV[ ++$i ]; 17 | } 18 | } 19 | 20 | open( FILE, $file ) || die( "cannot open $file" ); 21 | 22 | while( ){ 23 | chop; 24 | if( /^#/ ){ 25 | next; 26 | } 27 | ( $gb, $uni, $rest ) = split; 28 | 29 | if( $array{ $gb } ne "" ){ 30 | print STDERR "Warning: duplicate character, gb:$gb\n"; 31 | next; 32 | } 33 | 34 | $count++; 35 | $array{ $gb } = $uni; 36 | } 37 | 38 | print "private codes_t revGB2312[ $count ] = {\n"; 39 | 40 | for $index ( sort keys( %array ) ){ 41 | $code = $array{ $index }; 42 | $count--; 43 | if( $count == 0 ){ 44 | print " { $index, $code }\n"; 45 | } else { 46 | print " { $index, $code },\n"; 47 | } 48 | } 49 | 50 | print "};\n"; 51 | -------------------------------------------------------------------------------- /src/revksc.pl: -------------------------------------------------------------------------------- 1 | #! /usr/local/bin/perl 2 | 3 | # All rights reserved. Copyright (C) 1999 by NARITA Tomio. 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | 10 | # Unicode to KSC 5601-1987 11 | 12 | $file = "zcat KSX1001.TXT.gz |"; 13 | 14 | for $i ( 0 .. $#ARGV ){ 15 | if( $ARGV[ $i ] eq "-i" ){ 16 | $file = $ARGV[ ++$i ]; 17 | } 18 | } 19 | 20 | open( FILE, $file ) || die( "cannot open $file" ); 21 | 22 | while( ){ 23 | chop; 24 | if( /^#/ ){ 25 | next; 26 | } 27 | ( $ksc, $uni, $rest ) = split; 28 | $count++; 29 | $array{ $ksc } = $uni; 30 | } 31 | 32 | print "private codes_t revKSC5601[ $count ] = {\n"; 33 | 34 | for $index ( sort keys( %array ) ){ 35 | $code = $array{ $index }; 36 | $count--; 37 | if( $count == 0 ){ 38 | print " { $index, $code }\n"; 39 | } else { 40 | print " { $index, $code },\n"; 41 | } 42 | } 43 | 44 | print "};\n"; 45 | -------------------------------------------------------------------------------- /src/screen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * screen.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: screen.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __SCREEN_H__ 9 | #define __SCREEN_H__ 10 | 11 | #include 12 | 13 | public boolean_t ScreenTop( file_t *f, unsigned int logical ); 14 | public boolean_t ScreenTopPhysical( file_t *f, position_t *pos ); 15 | public boolean_t ScreenBot( file_t *f ); 16 | 17 | public unsigned int ScreenPrev( file_t *f, int physical ); 18 | public unsigned int ScreenNext( file_t *f, int physical ); 19 | 20 | public void ScreenRefresh( file_t *f ); 21 | 22 | #endif /* __SCREEN_H__ */ 23 | -------------------------------------------------------------------------------- /src/shiftjis.c: -------------------------------------------------------------------------------- 1 | /* 2 | * shiftjis.c 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio. 5 | * $Id: shiftjis.c,v 1.7 2004/01/05 07:23:29 nrt Exp $ 6 | */ 7 | /* 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | private void msk2jis( byte *c ) 35 | { 36 | int c1, c2; 37 | 38 | c1 = (int)c[ 0 ]; 39 | c2 = (int)c[ 1 ]; 40 | 41 | if( 0x00e0 <= c1 ) 42 | c1 = ( c1 << 1 ) - 0x0160; /* 63-94 ku */ 43 | else 44 | c1 = ( c1 << 1 ) - 0x00e0; /* 01-62 ku */ 45 | 46 | if( 0x009f <= c2 ) 47 | c2 -= 0x007e; /* even ku */ 48 | else { 49 | c1--; /* odd ku */ 50 | if( c2 >= (int)DEL ) 51 | c2 -= 0x0020; 52 | else 53 | c2 -= 0x001f; 54 | } 55 | 56 | c[ 0 ] = (byte)c1; 57 | c[ 1 ] = (byte)c2; 58 | } 59 | 60 | public void DecodeShiftJis( state_t *state, byte codingSystem ) 61 | { 62 | byte charset, ch; 63 | byte c[ ICHAR_WIDTH ]; 64 | 65 | for( ; ; ){ 66 | GetChar( ch ); 67 | if( ch < SP ){ 68 | if( ESC == ch ){ 69 | if( FALSE == DecodeEscape( state ) ) 70 | break; 71 | } else if( HT == ch ) 72 | DecodeAddTab( state->attr ); 73 | else if( SO == ch ) /* LS1 for 8bit */ 74 | state->gset[ GL ] = G1; 75 | else if( SI == ch ) /* LS0 for 8bit */ 76 | state->gset[ GL ] = G0; 77 | else if( BS == ch ) 78 | DecodeAddBs(); 79 | else 80 | DecodeAddControl( ch ); 81 | } else { 82 | if( 0 != state->sset ){ 83 | if( FALSE == DecodeAddShifted( state, ch ) ) 84 | break; 85 | else 86 | continue; 87 | } else if( 0x80 & ch ){ 88 | if( IsShiftJisByte1( ch ) ){ 89 | charset = X0208; 90 | c[ 0 ] = ch; 91 | GetChar( ch ); 92 | c[ 1 ] = ch; 93 | msk2jis( c ); 94 | if( !IsGraphicChar94( c[ 0 ] ) || !IsGraphicChar94( c[ 1 ] ) ){ 95 | DecodeAddControl( ch ); 96 | continue; 97 | } 98 | } else if( IsKatakana( 0x7f & ch ) ){ 99 | charset = X0201KANA; 100 | c[ 0 ] = 0x7f & ch; 101 | } else { 102 | DecodeAddControl( ch ); 103 | continue; 104 | } 105 | } else { 106 | /* 107 | * iso-2022 108 | */ 109 | charset = CSET( G0 ); 110 | if( !IsGraphicChar( charset, ch ) ){ 111 | if( SP == ch ){ 112 | DecodeAddSpace( state->attr ); 113 | } else { 114 | DecodeAddControl( ch ); 115 | } 116 | continue; 117 | } else if( X0201KANA == charset && !IsKatakana( ch ) ){ 118 | DecodeAddControl( ch ); 119 | continue; 120 | } 121 | c[ 0 ] = ch; 122 | if( TRUE == iTable[ (int)charset ].multi ){ 123 | GetChar( ch ); 124 | ch &= 0x7f; 125 | if( !IsGraphicChar( charset, ch ) ) 126 | continue; 127 | c[ 1 ] = ch; 128 | } 129 | } 130 | DecodeAddChar( charset, c, state->attr ); 131 | } 132 | } 133 | } 134 | 135 | private void jis2msk( byte *c ) 136 | { 137 | int c1, c2; 138 | 139 | c1 = (int)c[ 0 ]; 140 | c2 = (int)c[ 1 ]; 141 | 142 | if( 0 == ( c1 & 0x0001 ) ) 143 | c2 += 0x007e; /* even ku */ 144 | else { 145 | if( c2 >= 0x0060 ) /* odd ku */ 146 | c2 += 0x0020; 147 | else 148 | c2 += 0x001f; 149 | } 150 | 151 | if( 0x005f <= c1 ) 152 | c1 = ( ( c1 - 0x005f ) >> 1 ) + 0x00e0; /* 63-94 ku */ 153 | else 154 | c1 = ( ( c1 - 0x0021 ) >> 1 ) + 0x0081; /* 01-62 ku */ 155 | 156 | c[ 0 ] = (byte)c1; 157 | c[ 1 ] = (byte)c2; 158 | } 159 | 160 | public void EncodeShiftJis( i_str_t *istr, int head, int tail, 161 | byte codingSystem, boolean_t binary ) 162 | { 163 | int idx, attr; 164 | ic_t ic; 165 | byte cset, sj[ 2 ]; 166 | 167 | for( idx = head ; idx < tail ; idx++ ){ 168 | cset = istr[ idx ].charset; 169 | ic = istr[ idx ].c; 170 | attr = (int)istr[ idx ].attr << 8; 171 | #ifndef MSDOS /* IF NOT DEFINED */ 172 | if( UNICODE == cset ) 173 | ic = UNItoJIS( ic, &cset ); 174 | #endif /* MSDOS */ 175 | if( cset < PSEUDO ){ 176 | if( ASCII == cset ){ 177 | EncodeAddChar( attr, ic ); 178 | } else if( X0208 == cset || C6226 == cset ){ 179 | sj[ 0 ] = MakeByte1( ic ); 180 | sj[ 1 ] = MakeByte2( ic ); 181 | jis2msk( sj ); 182 | EncodeAddChar( attr, sj[ 0 ] ); 183 | EncodeAddChar( attr, sj[ 1 ] ); 184 | } else if( X0201KANA == cset ){ 185 | EncodeAddChar( attr, 0x80 | ic ); 186 | } else { 187 | if( FALSE == EncodeAddInvalid( attr, ic, cset ) ) 188 | break; 189 | } 190 | } else if( FALSE == EncodeAddPseudo( attr, ic, cset, binary ) ){ 191 | break; 192 | } 193 | } 194 | } 195 | -------------------------------------------------------------------------------- /src/shiftjis.h: -------------------------------------------------------------------------------- 1 | /* 2 | * shiftjis.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: shiftjis.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __SHIFTJIS_H__ 9 | #define __SHIFTJIS_H__ 10 | 11 | #include 12 | #include 13 | 14 | public void DecodeShiftJis( state_t *state, byte codingSystem ); 15 | 16 | public void EncodeShiftJis( i_str_t *istr, int head, int tail, 17 | byte codingSystem, boolean_t binary ); 18 | 19 | #endif /* __SHIFTJIS_H__ */ 20 | -------------------------------------------------------------------------------- /src/str.h: -------------------------------------------------------------------------------- 1 | /* 2 | * str.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: str.h,v 1.5 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __STR_H__ 9 | #define __STR_H__ 10 | 11 | #define STR_SIZE 1024 /* string logical maximum length */ 12 | 13 | typedef unsigned short str_t; 14 | 15 | #endif /* __STR_H__ */ 16 | -------------------------------------------------------------------------------- /src/stream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * stream.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: stream.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __STREAM_H__ 9 | #define __STREAM_H__ 10 | 11 | #include 12 | 13 | typedef struct { 14 | FILE *fp; 15 | FILE *sp; 16 | int pid; 17 | } stream_t; 18 | 19 | public stream_t *StreamOpen( byte *file ); 20 | public boolean_t StreamClose( stream_t *st ); 21 | public stream_t *StreamReconnectStdin(); 22 | 23 | #endif /* __STREAM_H__ */ 24 | -------------------------------------------------------------------------------- /src/unimap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * unimap.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: unimap.h,v 1.4 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __UNIMAP_H__ 9 | #define __UNIMAP_H__ 10 | 11 | #include 12 | 13 | public boolean_t unimap_iso8859; 14 | 15 | public ic_t UNItoISO8859( ic_t ic, byte *cset, byte codingSystem ); 16 | 17 | public ic_t UNItoBIG5( ic_t ic, byte *cset ); 18 | public ic_t UNItoCNS( ic_t ic, byte *cset ); 19 | public ic_t UNItoGB( ic_t ic, byte *cset ); 20 | public ic_t UNItoJIS( ic_t ic, byte *cset ); 21 | public ic_t UNItoKSC( ic_t ic, byte *cset ); 22 | 23 | public ic_t UNItoChinese( ic_t ic, byte *cset ); 24 | public ic_t UNItoJapanese( ic_t ic, byte *cset ); 25 | public ic_t UNItoKorean( ic_t ic, byte *cset ); 26 | 27 | public void ConvertFromUNI( i_str_t *istr, byte codingSystem ); 28 | 29 | #endif /* __UNIMAP_H__ */ 30 | -------------------------------------------------------------------------------- /src/unirev.h: -------------------------------------------------------------------------------- 1 | /* 2 | * unirev.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: unirev.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __UNIREV_H__ 9 | #define __UNIREV_H__ 10 | 11 | #include 12 | 13 | public ic_t RevUNI( ic_t ic, byte *cset ); 14 | public void ConvertToUNI( i_str_t *istr ); 15 | 16 | #endif /* __UNIREV_H__ */ 17 | -------------------------------------------------------------------------------- /src/utf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * utf.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: utf.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __UTF_H__ 9 | #define __UTF_H__ 10 | 11 | #include 12 | #include 13 | 14 | #define IsUtfEncoding( cset ) ( UTF_7 == (cset) || UTF_8 == (cset) ) 15 | 16 | public void DecodeUTF( state_t *state, byte codingSystem ); 17 | 18 | public void EncodeUTF7( i_str_t *istr, int head, int tail, 19 | byte codingSystem, boolean_t binary ); 20 | 21 | public void EncodeUTF8( i_str_t *istr, int head, int tail, 22 | byte codingSystem, boolean_t binary ); 23 | 24 | #ifdef USE_UTF16 25 | #define IsUtf16Encoding( cset ) ( UTF_16 == (cset) || UTF_16LE == (cset) || UTF_16BE == (cset) ) 26 | 27 | public void DecodeUTF16( state_t *state, byte codingSystem ); 28 | 29 | public void EncodeUTF16( i_str_t *istr, int head, int tail, 30 | byte codingSystem, boolean_t binary ); 31 | #define UNICODE_BOM ( (ic_t)0xfeff ) 32 | #endif /* USE_UTF16 */ 33 | 34 | #endif /* __UTF_H__ */ 35 | -------------------------------------------------------------------------------- /src/uty.h: -------------------------------------------------------------------------------- 1 | /* 2 | * uty.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: uty.h,v 1.3 2003/11/13 03:08:19 nrt Exp $ 6 | */ 7 | 8 | #ifndef __UTY_H__ 9 | #define __UTY_H__ 10 | 11 | #include 12 | 13 | typedef struct { 14 | ic_t code, peer; 15 | } codes_t; 16 | 17 | typedef struct { 18 | ic_t code, peer; 19 | byte cset; 20 | } codes_cset_t; 21 | 22 | public ic_t BinarySearch( codes_t *array, int high, ic_t code ); 23 | public ic_t BinarySearchCset( codes_cset_t *array, int high, ic_t code, 24 | byte *cset ); 25 | 26 | public void NotEnoughMemory(); 27 | public void FatalErrorOccurred(); 28 | 29 | public void *Malloc( unsigned int size ); 30 | public void *Realloc( void *ptr, unsigned int size ); 31 | public byte *TokenAlloc( byte *s ); 32 | public byte *Strdup( byte *s ); 33 | 34 | #ifdef MSDOS 35 | public void far *FarMalloc( unsigned int size ); 36 | public void FarFree( void far *ptr ); 37 | #endif /* MSDOS */ 38 | 39 | public boolean_t IsAtty( int fd ); 40 | public byte *Exts( byte *s ); 41 | 42 | #endif /* __UTY_H__ */ 43 | -------------------------------------------------------------------------------- /src/version.c: -------------------------------------------------------------------------------- 1 | /* 2 | * version.c 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio. 5 | * $Id: version.c,v 1.6 2004/01/05 07:21:26 nrt Exp $ 6 | */ 7 | /* 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | public void Banner() 30 | { 31 | fprintf( stderr, 32 | "# lv " VERSION "\n" 33 | "# All rights reserved. Copyright (C) 1996-2005 by NARITA Tomio\n" 34 | "# ABSOLUTELY NO WARRANTY; for details type `lv -h'\n" 35 | ); 36 | } 37 | -------------------------------------------------------------------------------- /src/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * version.h 3 | * 4 | * All rights reserved. Copyright (C) 1996 by NARITA Tomio 5 | * $Id: version.h,v 1.24 2004/01/16 12:25:57 nrt Exp $ 6 | */ 7 | 8 | #ifndef __VERSION_H__ 9 | #define __VERSION_H__ 10 | 11 | #undef VERSION 12 | #define VERSION "v.4.51.d (Feb. 22nd, 2018)" 13 | 14 | public void Banner(); 15 | 16 | #endif /* __VERSION_H__ */ 17 | --------------------------------------------------------------------------------