mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Update.
1997-12-01 17:27 Ulrich Drepper <drepper@cygnus.com> * Makefile (subdirs): Add iconvdata and localedata. * iconv/gconv.h: Define UNKNOWN_10646_CHAR as error value. * iconv/gconv_conf.c (read_conf_file): Little optimization. * iconvdata/8bit-gap.c: New file. * iconvdata/8bit-generic.c: Renamed from ... * iconvdata/iso8859-generic.c: ...this. * iconvdata/configure: Removed. * iconvdata/Makefile: Add new modules and better rules. * iconvdata/iso6937.c: Minor bug fixes. * iconvdata/iso8859-1.c: Likewise. * iconvdata/t61.c: Likewise. * iconvdata/iso8859-2.c: Change to use 8bit-generic.c. Minor bug fixes. * iconvdata/iso8859-3.c: Likewise. * iconvdata/iso8859-4.c: Likewise. * iconvdata/iso8859-5.c: Likewise. * iconvdata/iso8859-6.c: Likewise. * iconvdata/iso8859-7.c: Likewise. * iconvdata/iso8859-8.c: Likewise. * iconvdata/iso8859-9.c: Likewise. * iconvdata/iso8859-10.c: Likewise. * iconvdata/ebcdic-at-de-a.c: New file. * iconvdata/ebcdic-at-de.c: New file. * iconvdata/ebcdic-ca-fr.c: New file. * iconvdata/hp-roman8.c: New file. * iconvdata/koi-8.c: New file. * iconvdata/koi8-r.c: New file. * iconvdata/koi8-h.c: New file. * iconvdata/latin-greek-1.c: New file. * iconvdata/latin-greek-1.h: New file. * iconvdata/latin-greek.c: New file. * iconvdata/latin-greek.h: New file. * iconvdata/jis0201.c: New file. * iconvdata/jis0201.h: New file. * iconvdata/jis0208.c: New file. * iconvdata/jis0208.h: New file. * iconvdata/jis0212.c: New file. * iconvdata/jis0212.h: New file. * iconvdata/sjis.c: New file. * iconvdata/gap.pl: New file. Script to generate table header. * iconvdata/gaptab.pl: New file. * iconvdata/gconv-modules: Add info about new modules. * locale/programs/charmap.c: Also examine alias names given in charmap files. * localedata/*: Add to here from add-on. We need the information to generate tables for iconv. Update from db-2.3.14. * db2/Makefile: Updated. * db2/config.h: Likewise. * db2/db.h: Likewise. * db2/db_int.h: Likewise. * db2/btree/bt_cursor.c: Likewise. * db2/btree/bt_delete.c: Likewise. * db2/btree/bt_put.c: Likewise. * db2/btree/bt_search.c: Likewise. * db2/btree/bt_split.c: Likewise. * db2/btree/btree_auto.c: Likewise. * db2/common/db_appinit.c: Likewise. * db2/common/db_apprec.c: Likewise. * db2/common/db_err.c: Likewise. * db2/common/db_region.c: Likewise. * db2/db/db_auto.c: Likewise. * db2/db/db_dispatch.c: Likewise. * db2/db/db_ret.c: Likewise. * db2/dbm/dbm.c: Likewise. * db2/hash/hash_auto.c: Likewise. * db2/include/btree_ext.h: Likewise. * db2/include/common_ext.h: Likewise. * db2/include/db.h.src: Likewise. * db2/include/db_cxx.h: Likewise. * db2/include/db_ext.h: Likewise. * db2/include/db_int.h.src: Likewise. * db2/include/lock.h: Likewise. * db2/include/log.h: Likewise. * db2/include/mp.h: Likewise. * db2/include/mp_ext.h: Likewise. * db2/include/os_ext.h: Likewise. * db2/include/os_func.h: Likewise. * db2/lock/lock.c: Likewise. * db2/lock/lock_deadlock.c: Likewise. * db2/log/log.c: Likewise. * db2/log/log_archive.c: Likewise. * db2/log/log_auto.c: Likewise. * db2/log/log_get.c: Likewise. * db2/log/log_put.c: Likewise. * db2/mp/mp_bh.c: Likewise. * db2/mp/mp_fget.c: Likewise. * db2/mp/mp_fopen.c: Likewise. * db2/mp/mp_fput.c: Likewise. * db2/mp/mp_fset.c: Likewise. * db2/mp/mp_open.c: Likewise. * db2/mp/mp_pr.c: Likewise. * db2/mp/mp_region.c: Likewise. * db2/mp/mp_sync.c: Likewise. * db2/mutex/README: Likewise. * db2/mutex/mutex.c: Likewise. * db2/os/os_open.c: Likewise. * db2/os/os_func.c: Removed. * db2/os/os_config.c: New file. * db2/os/os_spin.c: New file. * db2/txn/txn.c: Likewise. * db2/txn/txn_auto.c: Likewise. 1997-11-30 06:01 Ulrich Drepper <drepper@cygnus.com> * posix/sys/wait.h (__WAIT_INT): Don't use complex version with __typeof for C++ since this fails for class members. Reported by Neal Becker <neal@ctd.comsat.com>. 1997-11-28 11:21 Zack Weinberg <zack@rabi.phys.columbia.edu> * configure.in: Check for a working makeinfo (3.11 or better). * config.make.in: Add MAKEINFO to be substituted. * manual/Makefile: Don't update info if makeinfo is too old. 1997-11-30 05:21 Ulrich Drepper <drepper@cygnus.com> * sysdeps/alpha/setjmp.S: Define _ASM and _SETJMP_H to get definitions. * sysdeps/alpha/__longjmp.S: Likewise. * sysdeps/unix/sysv/linux/alpha/kernel_termios.h: Include <termios.h> not <bits/termios.h>. * sysdeps/unix/sysv/linux/alpha/syscalls.list: Define syscall as __llseek and make llseek and lseek64 weak aliases. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise. Patches by a sun <asun@zoology.washington.edu>. 1997-11-29 19:19 Zack Weinberg <zack@rabi.phys.columbia.edu> * misc/sys/syslog.h: Delete KERNEL preprocessor conditional. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise. * misc/sys/syslog.h: Clean up BSD header. 1997-11-29 Andreas Jaeger <aj@arthur.rhein-neckar.de> * sysdeps/unix/sysv/linux/bits/in.h: Add changes from Linux 2.1.67. * sysdeps/libm-ieee754/s_ctan.c (__ctan): Raise invalid exception for ctan(+-inf,x). * sysdeps/libm-ieee754/s_ctanl.c (__ctanl): Likewise. * sysdeps/libm-ieee754/s_ctanf.c (__ctanf): Likewise. * math/libm-test.c (csqrt_test): Add tests for cabs, carg, ctan, csqrt (-1), ctanh(i*pi/4). 1997-11-26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/bits/confname.h: Fix comma in enumerator. 1997-11-28 13:28 Philip Blundell <Philip.Blundell@pobox.com> * sysdeps/unix/sysv/linux/net/if_arp.h: Add more ARPHRD_ constants. 1997-11-26 Andreas Jaeger <aj@arthur.rhein-neckar.de> * wcsmbs/wcrtomb.c (__wcrtomb): Remove unused variable fake. 1997-11-26 21:28 Ulrich Drepper <drepper@cygnus.com> * sysdeps/posix/getcwd.c (GETCWD_STORYGE_CLASS): Remove definition and use. Define GETCWD_RETURN_TYPE instead and use it. * sysdeps/unix/sysv/linux/getcwd.c: Define GETCWD_RETURN_TYPE instead of GETCWD_STORYGE_CLASS and put the return type and the `internal_function' in the right order for gcc 2.7.2. 1997-11-26 Andreas Jaeger <aj@arthur.rhein-neckar.de> * sysdeps/unix/sysv/linux/sys/module.h: Remove file. It's incompatible with Linux 2.1.x. Packages using modules (e.g. modutils) should/do provide their own version. Suggested by Richard Henderson. * sysdeps/unix/sysv/linux/Dist: Remove sys/module.h. * sysdeps/unix/sysv/linux/Makefile (sysdep_headers) [$(subdir)=socket]: Remove sys/module.h. * libio/stdio.h: Correct comment of sys_nerr/sys_errlist.
This commit is contained in:
188
ChangeLog
188
ChangeLog
@ -1,3 +1,189 @@
|
||||
1997-12-01 17:27 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* Makefile (subdirs): Add iconvdata and localedata.
|
||||
|
||||
* iconv/gconv.h: Define UNKNOWN_10646_CHAR as error value.
|
||||
|
||||
* iconv/gconv_conf.c (read_conf_file): Little optimization.
|
||||
|
||||
* iconvdata/8bit-gap.c: New file.
|
||||
* iconvdata/8bit-generic.c: Renamed from ...
|
||||
* iconvdata/iso8859-generic.c: ...this.
|
||||
* iconvdata/configure: Removed.
|
||||
* iconvdata/Makefile: Add new modules and better rules.
|
||||
* iconvdata/iso6937.c: Minor bug fixes.
|
||||
* iconvdata/iso8859-1.c: Likewise.
|
||||
* iconvdata/t61.c: Likewise.
|
||||
* iconvdata/iso8859-2.c: Change to use 8bit-generic.c.
|
||||
Minor bug fixes.
|
||||
* iconvdata/iso8859-3.c: Likewise.
|
||||
* iconvdata/iso8859-4.c: Likewise.
|
||||
* iconvdata/iso8859-5.c: Likewise.
|
||||
* iconvdata/iso8859-6.c: Likewise.
|
||||
* iconvdata/iso8859-7.c: Likewise.
|
||||
* iconvdata/iso8859-8.c: Likewise.
|
||||
* iconvdata/iso8859-9.c: Likewise.
|
||||
* iconvdata/iso8859-10.c: Likewise.
|
||||
* iconvdata/ebcdic-at-de-a.c: New file.
|
||||
* iconvdata/ebcdic-at-de.c: New file.
|
||||
* iconvdata/ebcdic-ca-fr.c: New file.
|
||||
* iconvdata/hp-roman8.c: New file.
|
||||
* iconvdata/koi-8.c: New file.
|
||||
* iconvdata/koi8-r.c: New file.
|
||||
* iconvdata/koi8-h.c: New file.
|
||||
* iconvdata/latin-greek-1.c: New file.
|
||||
* iconvdata/latin-greek-1.h: New file.
|
||||
* iconvdata/latin-greek.c: New file.
|
||||
* iconvdata/latin-greek.h: New file.
|
||||
* iconvdata/jis0201.c: New file.
|
||||
* iconvdata/jis0201.h: New file.
|
||||
* iconvdata/jis0208.c: New file.
|
||||
* iconvdata/jis0208.h: New file.
|
||||
* iconvdata/jis0212.c: New file.
|
||||
* iconvdata/jis0212.h: New file.
|
||||
* iconvdata/sjis.c: New file.
|
||||
* iconvdata/gap.pl: New file. Script to generate table header.
|
||||
* iconvdata/gaptab.pl: New file.
|
||||
* iconvdata/gconv-modules: Add info about new modules.
|
||||
|
||||
* locale/programs/charmap.c: Also examine alias names given in charmap
|
||||
files.
|
||||
|
||||
* localedata/*: Add to here from add-on. We need the information
|
||||
to generate tables for iconv.
|
||||
|
||||
Update from db-2.3.14.
|
||||
* db2/Makefile: Updated.
|
||||
* db2/config.h: Likewise.
|
||||
* db2/db.h: Likewise.
|
||||
* db2/db_int.h: Likewise.
|
||||
* db2/btree/bt_cursor.c: Likewise.
|
||||
* db2/btree/bt_delete.c: Likewise.
|
||||
* db2/btree/bt_put.c: Likewise.
|
||||
* db2/btree/bt_search.c: Likewise.
|
||||
* db2/btree/bt_split.c: Likewise.
|
||||
* db2/btree/btree_auto.c: Likewise.
|
||||
* db2/common/db_appinit.c: Likewise.
|
||||
* db2/common/db_apprec.c: Likewise.
|
||||
* db2/common/db_err.c: Likewise.
|
||||
* db2/common/db_region.c: Likewise.
|
||||
* db2/db/db_auto.c: Likewise.
|
||||
* db2/db/db_dispatch.c: Likewise.
|
||||
* db2/db/db_ret.c: Likewise.
|
||||
* db2/dbm/dbm.c: Likewise.
|
||||
* db2/hash/hash_auto.c: Likewise.
|
||||
* db2/include/btree_ext.h: Likewise.
|
||||
* db2/include/common_ext.h: Likewise.
|
||||
* db2/include/db.h.src: Likewise.
|
||||
* db2/include/db_cxx.h: Likewise.
|
||||
* db2/include/db_ext.h: Likewise.
|
||||
* db2/include/db_int.h.src: Likewise.
|
||||
* db2/include/lock.h: Likewise.
|
||||
* db2/include/log.h: Likewise.
|
||||
* db2/include/mp.h: Likewise.
|
||||
* db2/include/mp_ext.h: Likewise.
|
||||
* db2/include/os_ext.h: Likewise.
|
||||
* db2/include/os_func.h: Likewise.
|
||||
* db2/lock/lock.c: Likewise.
|
||||
* db2/lock/lock_deadlock.c: Likewise.
|
||||
* db2/log/log.c: Likewise.
|
||||
* db2/log/log_archive.c: Likewise.
|
||||
* db2/log/log_auto.c: Likewise.
|
||||
* db2/log/log_get.c: Likewise.
|
||||
* db2/log/log_put.c: Likewise.
|
||||
* db2/mp/mp_bh.c: Likewise.
|
||||
* db2/mp/mp_fget.c: Likewise.
|
||||
* db2/mp/mp_fopen.c: Likewise.
|
||||
* db2/mp/mp_fput.c: Likewise.
|
||||
* db2/mp/mp_fset.c: Likewise.
|
||||
* db2/mp/mp_open.c: Likewise.
|
||||
* db2/mp/mp_pr.c: Likewise.
|
||||
* db2/mp/mp_region.c: Likewise.
|
||||
* db2/mp/mp_sync.c: Likewise.
|
||||
* db2/mutex/README: Likewise.
|
||||
* db2/mutex/mutex.c: Likewise.
|
||||
* db2/os/os_open.c: Likewise.
|
||||
* db2/os/os_func.c: Removed.
|
||||
* db2/os/os_config.c: New file.
|
||||
* db2/os/os_spin.c: New file.
|
||||
* db2/txn/txn.c: Likewise.
|
||||
* db2/txn/txn_auto.c: Likewise.
|
||||
|
||||
1997-11-30 06:01 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* posix/sys/wait.h (__WAIT_INT): Don't use complex version with
|
||||
__typeof for C++ since this fails for class members.
|
||||
Reported by Neal Becker <neal@ctd.comsat.com>.
|
||||
|
||||
1997-11-28 11:21 Zack Weinberg <zack@rabi.phys.columbia.edu>
|
||||
|
||||
* configure.in: Check for a working makeinfo (3.11 or better).
|
||||
* config.make.in: Add MAKEINFO to be substituted.
|
||||
* manual/Makefile: Don't update info if makeinfo is too old.
|
||||
|
||||
1997-11-30 05:21 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* sysdeps/alpha/setjmp.S: Define _ASM and _SETJMP_H to get definitions.
|
||||
* sysdeps/alpha/__longjmp.S: Likewise.
|
||||
* sysdeps/unix/sysv/linux/alpha/kernel_termios.h: Include <termios.h>
|
||||
not <bits/termios.h>.
|
||||
|
||||
* sysdeps/unix/sysv/linux/alpha/syscalls.list: Define syscall as
|
||||
__llseek and make llseek and lseek64 weak aliases.
|
||||
* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise.
|
||||
Patches by a sun <asun@zoology.washington.edu>.
|
||||
|
||||
1997-11-29 19:19 Zack Weinberg <zack@rabi.phys.columbia.edu>
|
||||
|
||||
* misc/sys/syslog.h: Delete KERNEL preprocessor conditional.
|
||||
* sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise.
|
||||
* misc/sys/syslog.h: Clean up BSD header.
|
||||
|
||||
1997-11-29 Andreas Jaeger <aj@arthur.rhein-neckar.de>
|
||||
|
||||
* sysdeps/unix/sysv/linux/bits/in.h: Add changes from Linux 2.1.67.
|
||||
|
||||
* sysdeps/libm-ieee754/s_ctan.c (__ctan): Raise invalid exception
|
||||
for ctan(+-inf,x).
|
||||
* sysdeps/libm-ieee754/s_ctanl.c (__ctanl): Likewise.
|
||||
* sysdeps/libm-ieee754/s_ctanf.c (__ctanf): Likewise.
|
||||
|
||||
* math/libm-test.c (csqrt_test): Add tests for cabs, carg, ctan,
|
||||
csqrt (-1), ctanh(i*pi/4).
|
||||
|
||||
1997-11-26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
* sysdeps/generic/bits/confname.h: Fix comma in enumerator.
|
||||
|
||||
1997-11-28 13:28 Philip Blundell <Philip.Blundell@pobox.com>
|
||||
|
||||
* sysdeps/unix/sysv/linux/net/if_arp.h: Add more ARPHRD_ constants.
|
||||
|
||||
1997-11-26 Andreas Jaeger <aj@arthur.rhein-neckar.de>
|
||||
|
||||
* wcsmbs/wcrtomb.c (__wcrtomb): Remove unused variable fake.
|
||||
|
||||
1997-11-26 21:28 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* sysdeps/posix/getcwd.c (GETCWD_STORYGE_CLASS): Remove definition
|
||||
and use. Define GETCWD_RETURN_TYPE instead and use it.
|
||||
* sysdeps/unix/sysv/linux/getcwd.c: Define GETCWD_RETURN_TYPE instead
|
||||
of GETCWD_STORYGE_CLASS and put the return type and the
|
||||
`internal_function' in the right order for gcc 2.7.2.
|
||||
|
||||
1997-11-26 Andreas Jaeger <aj@arthur.rhein-neckar.de>
|
||||
|
||||
* sysdeps/unix/sysv/linux/sys/module.h: Remove file. It's
|
||||
incompatible with Linux 2.1.x. Packages using modules
|
||||
(e.g. modutils) should/do provide their own version. Suggested by
|
||||
Richard Henderson.
|
||||
|
||||
* sysdeps/unix/sysv/linux/Dist: Remove sys/module.h.
|
||||
|
||||
* sysdeps/unix/sysv/linux/Makefile (sysdep_headers)
|
||||
[$(subdir)=socket]: Remove sys/module.h.
|
||||
|
||||
1997-11-26 04:28 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* eld/dl-profile.c (_dl_start_profile): Avoid FP calculation when
|
||||
@ -225,7 +411,7 @@
|
||||
|
||||
1997-11-25 Andreas Jaeger <aj@arthur.rhein-neckar.de>
|
||||
|
||||
* libio/stdio.h: Correct comment of sys_nerr/sys_errlist
|
||||
* libio/stdio.h: Correct comment of sys_nerr/sys_errlist.
|
||||
|
||||
1997-11-25 Paul Eggert <eggert@shade.twinsun.com>
|
||||
|
||||
|
43
FAQ
43
FAQ
@ -113,6 +113,9 @@ please let me know.
|
||||
[Q31] ``What's the problem with configure --enable-omitfp?''
|
||||
|
||||
[Q32] ``Why don't signals interrupt system calls anymore?''
|
||||
|
||||
[Q33] ``I've got errors compiling code that uses certain string
|
||||
functions. Why?''
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q1] ``What systems does the GNU C Library run on?''
|
||||
@ -812,7 +815,7 @@ happen. So in case of doubt report such a warning message as a problem.
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q31] ``What's the problem with configure --enable-omitfp?''
|
||||
|
||||
{AJ} When configuring with --enable-omitfp the libraries are build
|
||||
[A31] {AJ} When configuring with --enable-omitfp the libraries are build
|
||||
without frame pointers. Some compilers produce in this situation buggy
|
||||
code and therefore we don't advise using it at the moment.
|
||||
|
||||
@ -869,6 +872,44 @@ and return EINTR (for example, to implement a timeout) you can do this with
|
||||
siginterrupt().
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q33] ``I've got errors compiling code that uses certain string
|
||||
functions. Why?''
|
||||
|
||||
[A33] {AJ} glibc 2.1 has the much asked for optimized string
|
||||
functions that are faster than the normal library functions. Some of
|
||||
the functions are implemented as inline functions and others as
|
||||
macros.
|
||||
The optimized string functions are only used when compiling with
|
||||
optimizations (-O1 or higher). The behaviour can be changed with two
|
||||
feature macros:
|
||||
* __NO_STRING_INLINES: Don't use string optimizations.
|
||||
* __USE_STRING_INLINES: Use also assembler inline functions (might
|
||||
increase code use dramatically).
|
||||
|
||||
Since some of these string functions are now additionally defined as
|
||||
macros, code like "char *strncpy();" doesn't work anymore (and is even
|
||||
unneccessary since <string.h> has the necessary declarations). Either
|
||||
change your code or define __NO_STRING_INLINES.
|
||||
|
||||
{UD} Another problem in this area is that the gcc still has problems on
|
||||
machines with very few registers (e.g., ix86). The inline assembler
|
||||
code sometimes requires many/all registers and the register allocator
|
||||
cannot handle these situation in all cases.
|
||||
|
||||
If a function is also defined as a macro in the libc headers one can prevent
|
||||
the use of the macro easily. E.g., instead of
|
||||
|
||||
cp = strcpy (foo, "lkj");
|
||||
|
||||
one can write
|
||||
|
||||
cp = (strcpy) (foo, "lkj");
|
||||
|
||||
Using this method one can avoid using the optimizations for selected
|
||||
function calls.
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
|
||||
Answers were given by:
|
||||
|
4
Makefile
4
Makefile
@ -54,8 +54,8 @@ endif
|
||||
subdirs = csu assert ctype db2 locale intl catgets math setjmp signal stdlib \
|
||||
stdio-common $(stdio) malloc string wcsmbs time dirent grp pwd \
|
||||
posix io termios resource misc socket sysvipc gmon gnulib iconv \
|
||||
wctype manual shadow md5-crypt po argp $(add-ons) nss \
|
||||
$(sysdep-subdirs) $(binfmt-subdir)
|
||||
iconvdata wctype manual shadow md5-crypt po argp $(add-ons) nss \
|
||||
localedata $(sysdep-subdirs) $(binfmt-subdir)
|
||||
export subdirs := $(subdirs) # Benign, useless in GNU make before 3.63.
|
||||
|
||||
# The mach and hurd subdirectories have many generated header files which
|
||||
|
@ -326,11 +326,12 @@ enum
|
||||
/* Values for the NAME argument to `confstr'. */
|
||||
enum
|
||||
{
|
||||
_CS_PATH, /* The default search path. */
|
||||
_CS_PATH /* The default search path. */
|
||||
#define _CS_PATH _CS_PATH
|
||||
|
||||
#if (defined __USE_FILE_OFFSET64 || defined __USE_LARGEFILE64 \
|
||||
|| defined __USE_LARGEFILE)
|
||||
,
|
||||
_CS_LFS_CFLAGS = 1000,
|
||||
# define _CS_LFS_CFLAGS _CS_LFS_CFLAGS
|
||||
_CS_LFS_LDFLAGS,
|
||||
@ -345,11 +346,12 @@ enum
|
||||
# define _CS_LFS64_LDFLAGS _CS_LFS64_LDFLAGS
|
||||
_CS_LFS64_LIBS,
|
||||
# define _CS_LFS64_LIBS _CS_LFS64_LIBS
|
||||
_CS_LFS64_LINTFLAGS,
|
||||
_CS_LFS64_LINTFLAGS
|
||||
# define _CS_LFS64_LINTFLAGS _CS_LFS64_LINTFLAGS
|
||||
#endif
|
||||
|
||||
#ifdef __USE_UNIX98
|
||||
,
|
||||
_CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
|
||||
# define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS
|
||||
_CS_XBS5_ILP32_OFF32_LDFLAGS,
|
||||
@ -380,7 +382,7 @@ enum
|
||||
# define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
|
||||
_CS_XBS5_LPBIG_OFFBIG_LIBS,
|
||||
# define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS
|
||||
_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
|
||||
_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
|
||||
# define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
|
||||
#endif
|
||||
};
|
||||
|
@ -56,6 +56,7 @@ BUILD_CC = @BUILD_CC@
|
||||
CFLAGS = @CFLAGS@
|
||||
AR = @AR@
|
||||
RANLIB = @RANLIB@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
AS = $(CC) -c
|
||||
|
||||
# Installation tools.
|
||||
|
164
configure
vendored
164
configure
vendored
@ -1180,11 +1180,50 @@ test -n "$MSGFMT" && break
|
||||
done
|
||||
test -n "$MSGFMT" || MSGFMT=":"
|
||||
|
||||
# Extract the first word of "makeinfo", so it can be a program name with args.
|
||||
set dummy makeinfo; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1187: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
if test -n "$MAKEINFO"; then
|
||||
ac_cv_prog_MAKEINFO="$MAKEINFO" # Let the user override the test.
|
||||
else
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in $PATH; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/$ac_word; then
|
||||
ac_cv_prog_MAKEINFO="makeinfo"
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
fi
|
||||
fi
|
||||
MAKEINFO="$ac_cv_prog_MAKEINFO"
|
||||
if test -n "$MAKEINFO"; then
|
||||
echo "$ac_t""$MAKEINFO" 1>&6
|
||||
else
|
||||
echo "$ac_t""no" 1>&6
|
||||
fi
|
||||
|
||||
if test "$MAKEINFO"; then
|
||||
if $MAKEINFO --version | grep 'texinfo 3\.[1-9][1-9]' >/dev/null 2>&1
|
||||
then : # Makeinfo 3.11 or greater, works.
|
||||
else
|
||||
echo "configure: warning:
|
||||
*** makeinfo is too old (need version 3.11 or better).
|
||||
*** You should install the needed version and re-configure since otherwise
|
||||
*** you won't get the info pages installed." 1>&2
|
||||
MAKEINFO=
|
||||
fi
|
||||
fi
|
||||
|
||||
# Extract the first word of "gcc", so it can be a program name with args.
|
||||
set dummy gcc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1188: checking for $ac_word" >&5
|
||||
echo "configure:1227: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1213,7 +1252,7 @@ if test -z "$CC"; then
|
||||
# Extract the first word of "cc", so it can be a program name with args.
|
||||
set dummy cc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1217: checking for $ac_word" >&5
|
||||
echo "configure:1256: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1261,7 +1300,7 @@ fi
|
||||
fi
|
||||
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
|
||||
echo "configure:1265: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
|
||||
echo "configure:1304: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
|
||||
|
||||
ac_ext=c
|
||||
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
@ -1271,11 +1310,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1275 "configure"
|
||||
#line 1314 "configure"
|
||||
#include "confdefs.h"
|
||||
main(){return(0);}
|
||||
EOF
|
||||
if { (eval echo configure:1279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:1318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
ac_cv_prog_cc_works=yes
|
||||
# If we can't run a trivial program, we are probably using a cross compiler.
|
||||
if (./conftest; exit) 2>/dev/null; then
|
||||
@ -1298,13 +1337,13 @@ else
|
||||
cross_linkable=yes
|
||||
fi
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
|
||||
echo "configure:1302: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "configure:1341: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
|
||||
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
|
||||
echo "configure:1308: checking whether we are using GNU C" >&5
|
||||
echo "configure:1347: checking whether we are using GNU C" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1313,7 +1352,7 @@ else
|
||||
yes;
|
||||
#endif
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1317: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1356: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
ac_cv_prog_gcc=yes
|
||||
else
|
||||
ac_cv_prog_gcc=no
|
||||
@ -1330,7 +1369,7 @@ if test $ac_cv_prog_gcc = yes; then
|
||||
yes;
|
||||
#endif
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1373: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
if test -z "$CFLAGS"; then
|
||||
CFLAGS="-g -O2"
|
||||
fi
|
||||
@ -1342,7 +1381,7 @@ else
|
||||
fi
|
||||
|
||||
echo $ac_n "checking build system type""... $ac_c" 1>&6
|
||||
echo "configure:1346: checking build system type" >&5
|
||||
echo "configure:1385: checking build system type" >&5
|
||||
|
||||
build_alias=$build
|
||||
case "$build_alias" in
|
||||
@ -1365,7 +1404,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1369: checking for $ac_word" >&5
|
||||
echo "configure:1408: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_BUILD_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1396,7 +1435,7 @@ done
|
||||
fi
|
||||
|
||||
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
|
||||
echo "configure:1400: checking how to run the C preprocessor" >&5
|
||||
echo "configure:1439: checking how to run the C preprocessor" >&5
|
||||
# On Suns, sometimes $CPP names a directory.
|
||||
if test -n "$CPP" && test -d "$CPP"; then
|
||||
CPP=
|
||||
@ -1411,13 +1450,13 @@ else
|
||||
# On the NeXT, cc -E runs the code through the compiler's parser,
|
||||
# not just through cpp.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1415 "configure"
|
||||
#line 1454 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1421: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1460: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@ -1428,13 +1467,13 @@ else
|
||||
rm -rf conftest*
|
||||
CPP="${CC-cc} -E -traditional-cpp"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1432 "configure"
|
||||
#line 1471 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1477: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@ -1467,7 +1506,7 @@ LD=`$CC -print-file-name=ld`
|
||||
|
||||
# Determine whether we are using GNU binutils.
|
||||
echo $ac_n "checking whether $AS is GNU as""... $ac_c" 1>&6
|
||||
echo "configure:1471: checking whether $AS is GNU as" >&5
|
||||
echo "configure:1510: checking whether $AS is GNU as" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_prog_as_gnu'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1485,7 +1524,7 @@ rm -f a.out
|
||||
gnu_as=$libc_cv_prog_as_gnu
|
||||
|
||||
echo $ac_n "checking whether $LD is GNU ld""... $ac_c" 1>&6
|
||||
echo "configure:1489: checking whether $LD is GNU ld" >&5
|
||||
echo "configure:1528: checking whether $LD is GNU ld" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_prog_ld_gnu'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1509,7 +1548,7 @@ fi
|
||||
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}ar; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1513: checking for $ac_word" >&5
|
||||
echo "configure:1552: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1540,7 +1579,7 @@ fi
|
||||
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1544: checking for $ac_word" >&5
|
||||
echo "configure:1583: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1571,7 +1610,7 @@ if test -n "$ac_tool_prefix"; then
|
||||
# Extract the first word of "ranlib", so it can be a program name with args.
|
||||
set dummy ranlib; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1575: checking for $ac_word" >&5
|
||||
echo "configure:1614: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1606,7 +1645,7 @@ fi
|
||||
# Extract the first word of "bash", so it can be a program name with args.
|
||||
set dummy bash; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1610: checking for $ac_word" >&5
|
||||
echo "configure:1649: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_BASH'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1648,7 +1687,7 @@ if test "$BASH" = no; then
|
||||
# Extract the first word of "ksh", so it can be a program name with args.
|
||||
set dummy ksh; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1652: checking for $ac_word" >&5
|
||||
echo "configure:1691: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_KSH'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1694,7 +1733,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1698: checking for $ac_word" >&5
|
||||
echo "configure:1737: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1729,7 +1768,7 @@ test -n "$PERL" || PERL="no"
|
||||
|
||||
|
||||
echo $ac_n "checking for signed size_t type""... $ac_c" 1>&6
|
||||
echo "configure:1733: checking for signed size_t type" >&5
|
||||
echo "configure:1772: checking for signed size_t type" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_signed_size_t'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1753,12 +1792,12 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for libc-friendly stddef.h""... $ac_c" 1>&6
|
||||
echo "configure:1757: checking for libc-friendly stddef.h" >&5
|
||||
echo "configure:1796: checking for libc-friendly stddef.h" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_friendly_stddef'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1762 "configure"
|
||||
#line 1801 "configure"
|
||||
#include "confdefs.h"
|
||||
#define __need_size_t
|
||||
#define __need_wchar_t
|
||||
@ -1773,7 +1812,7 @@ size_t size; wchar_t wchar;
|
||||
if (&size == NULL || &wchar == NULL) abort ();
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
libc_cv_friendly_stddef=yes
|
||||
else
|
||||
@ -1792,7 +1831,7 @@ override stddef.h = # The installed <stddef.h> seems to be libc-friendly."
|
||||
fi
|
||||
|
||||
echo $ac_n "checking whether we need to use -P to assemble .S files""... $ac_c" 1>&6
|
||||
echo "configure:1796: checking whether we need to use -P to assemble .S files" >&5
|
||||
echo "configure:1835: checking whether we need to use -P to assemble .S files" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_need_minus_P'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1823,7 +1862,7 @@ if test $ac_cv_prog_gcc = yes; then
|
||||
# We must check this even if -pipe is not given here, because the user
|
||||
# might do `make CFLAGS=-pipe'.
|
||||
echo $ac_n "checking for gcc 2.7.x -pipe bug""... $ac_c" 1>&6
|
||||
echo "configure:1827: checking for gcc 2.7.x -pipe bug" >&5
|
||||
echo "configure:1866: checking for gcc 2.7.x -pipe bug" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_gcc_pipe_bug'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1852,7 +1891,7 @@ else
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for assembler global-symbol directive""... $ac_c" 1>&6
|
||||
echo "configure:1856: checking for assembler global-symbol directive" >&5
|
||||
echo "configure:1895: checking for assembler global-symbol directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_global_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1882,7 +1921,7 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for .set assembler directive""... $ac_c" 1>&6
|
||||
echo "configure:1886: checking for .set assembler directive" >&5
|
||||
echo "configure:1925: checking for .set assembler directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_set_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1916,7 +1955,7 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for .symver assembler directive""... $ac_c" 1>&6
|
||||
echo "configure:1920: checking for .symver assembler directive" >&5
|
||||
echo "configure:1959: checking for .symver assembler directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_symver_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1935,7 +1974,7 @@ fi
|
||||
|
||||
echo "$ac_t""$libc_cv_asm_symver_directive" 1>&6
|
||||
echo $ac_n "checking for ld --version-script""... $ac_c" 1>&6
|
||||
echo "configure:1939: checking for ld --version-script" >&5
|
||||
echo "configure:1978: checking for ld --version-script" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_ld_version_script_option'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1958,7 +1997,7 @@ EOF
|
||||
if { ac_try='${CC-cc} $CFLAGS -shared -o conftest.so conftest.o
|
||||
-nostartfiles -nostdlib
|
||||
-Wl,--version-script,conftest.map
|
||||
1>&5'; { (eval echo configure:1962: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
|
||||
1>&5'; { (eval echo configure:2001: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
|
||||
then
|
||||
libc_cv_ld_version_script_option=yes
|
||||
else
|
||||
@ -1996,7 +2035,7 @@ if test $VERSIONING = no; then
|
||||
fi
|
||||
if test $elf = yes; then
|
||||
echo $ac_n "checking for .previous assembler directive""... $ac_c" 1>&6
|
||||
echo "configure:2000: checking for .previous assembler directive" >&5
|
||||
echo "configure:2039: checking for .previous assembler directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_previous_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2004,7 +2043,7 @@ else
|
||||
.section foo_section
|
||||
.previous
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2047: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_asm_previous_directive=yes
|
||||
else
|
||||
libc_cv_asm_previous_directive=no
|
||||
@ -2020,7 +2059,7 @@ EOF
|
||||
|
||||
else
|
||||
echo $ac_n "checking for .popsection assembler directive""... $ac_c" 1>&6
|
||||
echo "configure:2024: checking for .popsection assembler directive" >&5
|
||||
echo "configure:2063: checking for .popsection assembler directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_popsection_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2028,7 +2067,7 @@ else
|
||||
.pushsection foo_section
|
||||
.popsection
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2032: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_asm_popsection_directive=yes
|
||||
else
|
||||
libc_cv_asm_popsection_directive=no
|
||||
@ -2048,12 +2087,12 @@ fi
|
||||
|
||||
if test $elf != yes; then
|
||||
echo $ac_n "checking for .init and .fini sections""... $ac_c" 1>&6
|
||||
echo "configure:2052: checking for .init and .fini sections" >&5
|
||||
echo "configure:2091: checking for .init and .fini sections" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_have_initfini'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2057 "configure"
|
||||
#line 2096 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
@ -2062,7 +2101,7 @@ asm (".section .init");
|
||||
asm (".text");
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2066: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:2105: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
libc_cv_have_initfini=yes
|
||||
else
|
||||
@ -2090,19 +2129,19 @@ if test $elf = yes; then
|
||||
else
|
||||
if test $ac_cv_prog_cc_works = yes; then
|
||||
echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
|
||||
echo "configure:2094: checking for _ prefix on C symbol names" >&5
|
||||
echo "configure:2133: checking for _ prefix on C symbol names" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2099 "configure"
|
||||
#line 2138 "configure"
|
||||
#include "confdefs.h"
|
||||
asm ("_glibc_foobar:");
|
||||
int main() {
|
||||
glibc_foobar ();
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:2145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
libc_cv_asm_underscores=yes
|
||||
else
|
||||
@ -2117,17 +2156,17 @@ fi
|
||||
echo "$ac_t""$libc_cv_asm_underscores" 1>&6
|
||||
else
|
||||
echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
|
||||
echo "configure:2121: checking for _ prefix on C symbol names" >&5
|
||||
echo "configure:2160: checking for _ prefix on C symbol names" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2126 "configure"
|
||||
#line 2165 "configure"
|
||||
#include "confdefs.h"
|
||||
void underscore_test(void) {
|
||||
return; }
|
||||
EOF
|
||||
if { (eval echo configure:2131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:2170: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if grep _underscore_test conftest* >/dev/null; then
|
||||
rm -f conftest*
|
||||
libc_cv_asm_underscores=yes
|
||||
@ -2160,7 +2199,7 @@ if test $elf = yes; then
|
||||
libc_cv_asm_weakext_directive=no
|
||||
else
|
||||
echo $ac_n "checking for assembler .weak directive""... $ac_c" 1>&6
|
||||
echo "configure:2164: checking for assembler .weak directive" >&5
|
||||
echo "configure:2203: checking for assembler .weak directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_weak_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2183,7 +2222,7 @@ echo "$ac_t""$libc_cv_asm_weak_directive" 1>&6
|
||||
|
||||
if test $libc_cv_asm_weak_directive = no; then
|
||||
echo $ac_n "checking for assembler .weakext directive""... $ac_c" 1>&6
|
||||
echo "configure:2187: checking for assembler .weakext directive" >&5
|
||||
echo "configure:2226: checking for assembler .weakext directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_weakext_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2220,7 +2259,7 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for ld --no-whole-archive""... $ac_c" 1>&6
|
||||
echo "configure:2224: checking for ld --no-whole-archive" >&5
|
||||
echo "configure:2263: checking for ld --no-whole-archive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_ld_no_whole_archive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2231,7 +2270,7 @@ __throw () {}
|
||||
EOF
|
||||
if { ac_try='${CC-cc} $CFLAGS
|
||||
-nostdlib -nostartfiles -Wl,--no-whole-archive
|
||||
-o conftest conftest.c 1>&5'; { (eval echo configure:2235: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
-o conftest conftest.c 1>&5'; { (eval echo configure:2274: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_ld_no_whole_archive=yes
|
||||
else
|
||||
libc_cv_ld_no_whole_archive=no
|
||||
@ -2242,7 +2281,7 @@ fi
|
||||
echo "$ac_t""$libc_cv_ld_no_whole_archive" 1>&6
|
||||
|
||||
echo $ac_n "checking for gcc -fno-exceptions""... $ac_c" 1>&6
|
||||
echo "configure:2246: checking for gcc -fno-exceptions" >&5
|
||||
echo "configure:2285: checking for gcc -fno-exceptions" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_gcc_no_exceptions'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2253,7 +2292,7 @@ __throw () {}
|
||||
EOF
|
||||
if { ac_try='${CC-cc} $CFLAGS
|
||||
-nostdlib -nostartfiles -fno-exceptions
|
||||
-o conftest conftest.c 1>&5'; { (eval echo configure:2257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
-o conftest conftest.c 1>&5'; { (eval echo configure:2296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_gcc_no_exceptions=yes
|
||||
else
|
||||
libc_cv_gcc_no_exceptions=no
|
||||
@ -2264,12 +2303,12 @@ fi
|
||||
echo "$ac_t""$libc_cv_gcc_no_exceptions" 1>&6
|
||||
|
||||
echo $ac_n "checking for DWARF2 unwind info support""... $ac_c" 1>&6
|
||||
echo "configure:2268: checking for DWARF2 unwind info support" >&5
|
||||
echo "configure:2307: checking for DWARF2 unwind info support" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_gcc_dwarf2_unwind_info'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.c <<EOF
|
||||
#line 2273 "configure"
|
||||
#line 2312 "configure"
|
||||
static char __EH_FRAME_BEGIN__;
|
||||
_start ()
|
||||
{
|
||||
@ -2290,7 +2329,7 @@ __bzero () {}
|
||||
EOF
|
||||
if { ac_try='${CC-cc} $CFLAGS
|
||||
-nostdlib -nostartfiles
|
||||
-o conftest conftest.c -lgcc >&5'; { (eval echo configure:2294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
-o conftest conftest.c -lgcc >&5'; { (eval echo configure:2333: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_gcc_dwarf2_unwind_info=yes
|
||||
else
|
||||
libc_cv_gcc_dwarf2_unwind_info=no
|
||||
@ -2348,7 +2387,7 @@ if test "$uname" = "sysdeps/generic"; then
|
||||
fi
|
||||
|
||||
echo $ac_n "checking OS release for uname""... $ac_c" 1>&6
|
||||
echo "configure:2352: checking OS release for uname" >&5
|
||||
echo "configure:2391: checking OS release for uname" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2370,7 +2409,7 @@ echo "$ac_t""$libc_cv_uname_release" 1>&6
|
||||
uname_release="$libc_cv_uname_release"
|
||||
|
||||
echo $ac_n "checking OS version for uname""... $ac_c" 1>&6
|
||||
echo "configure:2374: checking OS version for uname" >&5
|
||||
echo "configure:2413: checking OS version for uname" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2392,7 +2431,7 @@ else
|
||||
fi
|
||||
|
||||
echo $ac_n "checking stdio selection""... $ac_c" 1>&6
|
||||
echo "configure:2396: checking stdio selection" >&5
|
||||
echo "configure:2435: checking stdio selection" >&5
|
||||
|
||||
case $stdio in
|
||||
libio) cat >> confdefs.h <<\EOF
|
||||
@ -2404,7 +2443,7 @@ esac
|
||||
echo "$ac_t""$stdio" 1>&6
|
||||
|
||||
echo $ac_n "checking ldap selection""... $ac_c" 1>&6
|
||||
echo "configure:2408: checking ldap selection" >&5
|
||||
echo "configure:2447: checking ldap selection" >&5
|
||||
|
||||
case $add_ons in
|
||||
*ldap*)
|
||||
@ -2454,7 +2493,7 @@ if test $shared = default; then
|
||||
fi
|
||||
|
||||
echo $ac_n "checking whether -fPIC is default""... $ac_c" 1>&6
|
||||
echo "configure:2458: checking whether -fPIC is default" >&5
|
||||
echo "configure:2497: checking whether -fPIC is default" >&5
|
||||
if eval "test \"`echo '$''{'pic_default'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2648,6 +2687,7 @@ s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
|
||||
s%@INSTALL_DATA@%$INSTALL_DATA%g
|
||||
s%@LN_S@%$LN_S%g
|
||||
s%@MSGFMT@%$MSGFMT%g
|
||||
s%@MAKEINFO@%$MAKEINFO%g
|
||||
s%@CC@%$CC%g
|
||||
s%@cross_linkable@%$cross_linkable%g
|
||||
s%@build@%$build%g
|
||||
|
14
configure.in
14
configure.in
@ -408,6 +408,20 @@ if test "$INSTALL" = "${srcdir}/install-sh -c"; then
|
||||
fi
|
||||
AC_PROG_LN_S
|
||||
AC_CHECK_PROGS(MSGFMT, msgfmt gmsgfmt, :)
|
||||
AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo)
|
||||
if test "$MAKEINFO"; then
|
||||
changequote(,)dnl Need [] for regexps.
|
||||
if $MAKEINFO --version | grep 'texinfo 3\.[1-9][1-9]' >/dev/null 2>&1
|
||||
changequote([,])dnl
|
||||
then : # Makeinfo 3.11 or greater, works.
|
||||
else
|
||||
AC_MSG_WARN([
|
||||
*** makeinfo is too old (need version 3.11 or better).
|
||||
*** You should install the needed version and re-configure since otherwise
|
||||
*** you won't get the info pages installed.])
|
||||
MAKEINFO=
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_PROG_CC_LOCAL
|
||||
AC_CANONICAL_BUILD
|
||||
|
@ -59,9 +59,9 @@ libdb-routines := bt_close bt_compare bt_conv bt_cursor bt_delete \
|
||||
bt_split bt_stat btree_auto db db_appinit db_apprec \
|
||||
db_auto \
|
||||
db_byteorder db_conv db_dispatch db_dup db_err db_log2 \
|
||||
os_abs os_dir os_fid os_fsync os_func os_map os_oflags \
|
||||
os_abs os_config os_dir os_fid os_fsync os_map os_oflags \
|
||||
os_open os_rpath os_rw os_seek os_sleep os_stat os_unlink \
|
||||
db_overflow db_pr db_rec db_region db_ret db_salloc \
|
||||
os_spin db_overflow db_pr db_rec db_region db_ret db_salloc \
|
||||
db_shash db_thread hash hash_auto hash_conv hash_debug \
|
||||
hash_dup hash_func hash_page hash_rec hash_stat lock \
|
||||
lock_conflict lock_deadlock lock_util log log_archive \
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)bt_cursor.c 10.35 (Sleepycat) 10/25/97";
|
||||
static const char sccsid[] = "@(#)bt_cursor.c 10.37 (Sleepycat) 11/22/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -33,7 +33,7 @@ static int __bam_c_next __P((DB *, CURSOR *, int));
|
||||
static int __bam_c_physdel __P((DB *, CURSOR *, PAGE *));
|
||||
static int __bam_c_prev __P((DB *, CURSOR *));
|
||||
static int __bam_c_put __P((DBC *, DBT *, DBT *, int));
|
||||
static int __bam_c_rget __P((DB *, CURSOR *, DBT *, DBT *, int));
|
||||
static int __bam_c_rget __P((DB *, CURSOR *, DBT *, int));
|
||||
static int __bam_c_search __P((DB *, CURSOR *, const DBT *, u_int, int, int *));
|
||||
|
||||
/* Discard the current page/lock held by a cursor. */
|
||||
@ -229,7 +229,7 @@ __bam_c_del(dbc, flags)
|
||||
B_DSET(GET_BKEYDATA(h, indx + O_INDX)->type);
|
||||
else
|
||||
B_DSET(GET_BKEYDATA(h, indx)->type);
|
||||
(void)__bam_ca_delete(dbp, pgno, indx, NULL);
|
||||
(void)__bam_ca_delete(dbp, pgno, indx, NULL, 0);
|
||||
|
||||
ret = memp_fput(dbp->mpf, h, DB_MPOOL_DIRTY);
|
||||
|
||||
@ -313,7 +313,7 @@ __bam_c_get(dbc, key, data, flags)
|
||||
* been rammed into the interface.
|
||||
*/
|
||||
if (LF_ISSET(DB_GET_RECNO)) {
|
||||
ret = __bam_c_rget(dbp, cp, key, data, flags);
|
||||
ret = __bam_c_rget(dbp, cp, data, flags);
|
||||
PUTHANDLE(dbp);
|
||||
return (ret);
|
||||
}
|
||||
@ -441,10 +441,10 @@ err: if (cp->page != NULL)
|
||||
* Return the record number for a cursor.
|
||||
*/
|
||||
static int
|
||||
__bam_c_rget(dbp, cp, key, data, flags)
|
||||
__bam_c_rget(dbp, cp, data, flags)
|
||||
DB *dbp;
|
||||
CURSOR *cp;
|
||||
DBT *key, *data;
|
||||
DBT *data;
|
||||
int flags;
|
||||
{
|
||||
BTREE *t;
|
||||
@ -1113,18 +1113,18 @@ __bam_cprint(dbp)
|
||||
|
||||
/*
|
||||
* __bam_ca_delete --
|
||||
* Check if any of the cursors refer to the item we are about to delete.
|
||||
* We'll return the number of cursors that refer to the item in question.
|
||||
* If a cursor does refer to the item, then we set its deleted bit.
|
||||
* Check if any of the cursors refer to the item we are about to delete,
|
||||
* returning the number of cursors that refer to the item in question.
|
||||
*
|
||||
* PUBLIC: int __bam_ca_delete __P((DB *, db_pgno_t, u_int32_t, CURSOR *));
|
||||
* PUBLIC: int __bam_ca_delete __P((DB *, db_pgno_t, u_int32_t, CURSOR *, int));
|
||||
*/
|
||||
int
|
||||
__bam_ca_delete(dbp, pgno, indx, curs)
|
||||
__bam_ca_delete(dbp, pgno, indx, curs, key_delete)
|
||||
DB *dbp;
|
||||
db_pgno_t pgno;
|
||||
u_int32_t indx;
|
||||
CURSOR *curs;
|
||||
int key_delete;
|
||||
{
|
||||
DBC *dbc;
|
||||
CURSOR *cp;
|
||||
@ -1140,22 +1140,40 @@ __bam_ca_delete(dbp, pgno, indx, curs)
|
||||
* It's possible for multiple cursors within the thread to have write
|
||||
* locks on the same page, but, cursors within a thread must be single
|
||||
* threaded, so all we're locking here is the cursor linked list.
|
||||
*
|
||||
* indx refers to the first of what might be a duplicate set. The
|
||||
* cursor passed in is the one initiating the delete, so we don't
|
||||
* want to count it.
|
||||
*/
|
||||
DB_THREAD_LOCK(dbp);
|
||||
|
||||
for (count = 0, dbc = TAILQ_FIRST(&dbp->curs_queue);
|
||||
dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) {
|
||||
cp = (CURSOR *)dbc->internal;
|
||||
if ((curs != cp &&
|
||||
cp->pgno == pgno && cp->indx == indx) ||
|
||||
(cp->dpgno == pgno && cp->dindx == indx)) {
|
||||
++count;
|
||||
F_SET(cp, C_DELETED);
|
||||
}
|
||||
|
||||
/*
|
||||
* Optionally, a cursor passed in is the one initiating the
|
||||
* delete, so we don't want to count it or set its deleted
|
||||
* flag. Otherwise, if a cursor refers to the item, then we
|
||||
* set its deleted flag.
|
||||
*/
|
||||
if (curs == cp)
|
||||
continue;
|
||||
|
||||
/*
|
||||
* If we're deleting the key itself and not just one of its
|
||||
* duplicates, repoint the cursor to the main-page key/data
|
||||
* pair, everything else is about to be discarded.
|
||||
*/
|
||||
if (key_delete || cp->dpgno == PGNO_INVALID) {
|
||||
if (cp->pgno == pgno && cp->indx == indx) {
|
||||
cp->dpgno = PGNO_INVALID;
|
||||
++count;
|
||||
F_SET(cp, C_DELETED);
|
||||
}
|
||||
} else
|
||||
if (cp->dpgno == pgno && cp->dindx == indx) {
|
||||
++count;
|
||||
F_SET(cp, C_DELETED);
|
||||
}
|
||||
}
|
||||
|
||||
DB_THREAD_UNLOCK(dbp);
|
||||
return (count);
|
||||
}
|
||||
@ -1440,7 +1458,7 @@ __bam_c_physdel(dbp, cp, h)
|
||||
* If the item is referenced by another cursor, leave it up to that
|
||||
* cursor to do the delete.
|
||||
*/
|
||||
if (__bam_ca_delete(dbp, pgno, indx, cp) != 0)
|
||||
if (__bam_ca_delete(dbp, pgno, indx, cp, 0) != 0)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
|
@ -47,7 +47,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)bt_delete.c 10.22 (Sleepycat) 11/2/97";
|
||||
static const char sccsid[] = "@(#)bt_delete.c 10.23 (Sleepycat) 11/22/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -101,17 +101,20 @@ __bam_delete(argdbp, txn, key, flags)
|
||||
h = t->bt_csp->page;
|
||||
indx = t->bt_csp->indx;
|
||||
|
||||
/* Delete the key/data pair, including any duplicates. */
|
||||
/* Delete the key/data pair, including any on-or-off page duplicates. */
|
||||
for (cnt = 1, i = indx;; ++cnt)
|
||||
if ((i += P_INDX) >= NUM_ENT(h) || h->inp[i] != h->inp[indx])
|
||||
break;
|
||||
for (; cnt > 0; --cnt, ++t->lstat.bt_deleted)
|
||||
if (__bam_ca_delete(dbp, h->pgno, indx, NULL) != 0) {
|
||||
if (__bam_ca_delete(dbp, h->pgno, indx, NULL, 1) == 0) {
|
||||
if ((ret = __bam_ditem(dbp, h, indx)) != 0)
|
||||
goto err;
|
||||
if ((ret = __bam_ditem(dbp, h, indx)) != 0)
|
||||
goto err;
|
||||
} else {
|
||||
B_DSET(GET_BKEYDATA(h, indx + O_INDX)->type);
|
||||
indx += P_INDX;
|
||||
} else if ((ret = __bam_ditem(dbp, h, indx)) != 0 ||
|
||||
(ret = __bam_ditem(dbp, h, indx)) != 0)
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* If we're using record numbers, update internal page record counts. */
|
||||
if (F_ISSET(dbp, DB_BT_RECNUM) && (ret = __bam_adjust(dbp, t, -1)) != 0)
|
||||
|
@ -47,7 +47,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)bt_put.c 10.31 (Sleepycat) 10/26/97";
|
||||
static const char sccsid[] = "@(#)bt_put.c 10.35 (Sleepycat) 11/22/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -64,6 +64,7 @@ static const char sccsid[] = "@(#)bt_put.c 10.31 (Sleepycat) 10/26/97";
|
||||
#include "btree.h"
|
||||
|
||||
static int __bam_fixed __P((BTREE *, DBT *));
|
||||
static int __bam_isdeleted __P((DB *, PAGE *, u_int32_t, int *));
|
||||
static int __bam_lookup __P((DB *, DBT *, int *));
|
||||
static int __bam_ndup __P((DB *, PAGE *, u_int32_t));
|
||||
static int __bam_ovput __P((DB *, PAGE *, u_int32_t, DBT *));
|
||||
@ -89,7 +90,7 @@ __bam_put(argdbp, txn, key, data, flags)
|
||||
DB *dbp;
|
||||
PAGE *h;
|
||||
db_indx_t indx;
|
||||
int exact, iflags, newkey, replace, ret, stack;
|
||||
int exact, iflags, isdeleted, newkey, replace, ret, stack;
|
||||
|
||||
DEBUG_LWRITE(argdbp, txn, "bam_put", key, data, flags);
|
||||
|
||||
@ -114,21 +115,25 @@ retry: /*
|
||||
stack = 1;
|
||||
|
||||
/*
|
||||
* If an identical key is already in the tree, and DB_NOOVERWRITE is
|
||||
* set, an error is returned. If an identical key is already in the
|
||||
* tree and DB_NOOVERWRITE is not set, the key is either added (when
|
||||
* duplicates are permitted) or an error is returned. The exception
|
||||
* is when the item located is referenced by a cursor and marked for
|
||||
* deletion, in which case we permit the overwrite and flag the cursor.
|
||||
* If DB_NOOVERWRITE is set and there's an identical key in the tree,
|
||||
* return an error unless the data item has already been marked for
|
||||
* deletion, or, all the remaining data items have already been marked
|
||||
* for deletion in the case of duplicates. If all the data items have
|
||||
* been marked for deletion, we do a replace, otherwise, it has to be
|
||||
* a set of duplicates, and we simply append a new one to the set.
|
||||
*/
|
||||
replace = 0;
|
||||
if (exact && flags == DB_NOOVERWRITE) {
|
||||
if (!B_DISSET(GET_BKEYDATA(h, indx + O_INDX)->type)) {
|
||||
ret = DB_KEYEXIST;
|
||||
isdeleted = replace = 0;
|
||||
if (exact) {
|
||||
if ((ret = __bam_isdeleted(dbp, h, indx, &isdeleted)) != 0)
|
||||
goto err;
|
||||
}
|
||||
replace = 1;
|
||||
__bam_ca_replace(dbp, h->pgno, indx, REPLACE_SETUP);
|
||||
if (isdeleted) {
|
||||
replace = 1;
|
||||
__bam_ca_replace(dbp, h->pgno, indx, REPLACE_SETUP);
|
||||
} else
|
||||
if (flags == DB_NOOVERWRITE) {
|
||||
ret = DB_KEYEXIST;
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -151,7 +156,7 @@ retry: /*
|
||||
*/
|
||||
newkey = dbp->type == DB_BTREE && !exact;
|
||||
if (exact) {
|
||||
if (F_ISSET(dbp, DB_AM_DUP)) {
|
||||
if (!isdeleted && F_ISSET(dbp, DB_AM_DUP)) {
|
||||
/*
|
||||
* Make sure that we're not looking at a page of
|
||||
* duplicates -- if so, move to the last entry on
|
||||
@ -233,6 +238,88 @@ err: if (stack)
|
||||
return (ret);
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_isdeleted --
|
||||
* Return if the only remaining data item for the element has been
|
||||
* deleted.
|
||||
*/
|
||||
static int
|
||||
__bam_isdeleted(dbp, h, indx, isdeletedp)
|
||||
DB *dbp;
|
||||
PAGE *h;
|
||||
u_int32_t indx;
|
||||
int *isdeletedp;
|
||||
{
|
||||
BKEYDATA *bk;
|
||||
db_pgno_t pgno;
|
||||
int ret;
|
||||
|
||||
*isdeletedp = 1;
|
||||
for (;;) {
|
||||
bk = GET_BKEYDATA(h, indx + O_INDX);
|
||||
switch (B_TYPE(bk->type)) {
|
||||
case B_KEYDATA:
|
||||
case B_OVERFLOW:
|
||||
if (!B_DISSET(bk->type)) {
|
||||
*isdeletedp = 0;
|
||||
return (0);
|
||||
}
|
||||
break;
|
||||
case B_DUPLICATE:
|
||||
/*
|
||||
* If the data item referencing the off-page duplicates
|
||||
* is flagged as deleted, we're done. Else, we have to
|
||||
* walk the chain of duplicate pages.
|
||||
*/
|
||||
if (B_DISSET(bk->type))
|
||||
return (0);
|
||||
goto dupchk;
|
||||
default:
|
||||
return (__db_pgfmt(dbp, h->pgno));
|
||||
}
|
||||
|
||||
/*
|
||||
* If there are no more on-page duplicate items, then every
|
||||
* data item for this key must have been deleted.
|
||||
*/
|
||||
if (indx + P_INDX >= (u_int32_t)NUM_ENT(h))
|
||||
return (0);
|
||||
if (h->inp[indx] != h->inp[indx + P_INDX])
|
||||
return (0);
|
||||
|
||||
/* Check the next item. */
|
||||
indx += P_INDX;
|
||||
}
|
||||
/* NOTREACHED */
|
||||
|
||||
dupchk: /* Check a chain of duplicate pages. */
|
||||
pgno = ((BOVERFLOW *)bk)->pgno;
|
||||
for (;;) {
|
||||
/* Acquire the next page in the duplicate chain. */
|
||||
if ((ret = memp_fget(dbp->mpf, &pgno, 0, &h)) != 0)
|
||||
return (ret);
|
||||
|
||||
/* Check each item for a delete flag. */
|
||||
for (indx = 0; indx < NUM_ENT(h); ++indx)
|
||||
if (!B_DISSET(GET_BKEYDATA(h, indx)->type)) {
|
||||
*isdeletedp = 0;
|
||||
goto done;
|
||||
}
|
||||
/*
|
||||
* If we reach the end of the duplicate pages, then every
|
||||
* item we reviewed must have been deleted.
|
||||
*/
|
||||
if ((pgno = NEXT_PGNO(h)) == PGNO_INVALID)
|
||||
goto done;
|
||||
|
||||
(void)memp_fput(dbp->mpf, h, 0);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
|
||||
done: (void)memp_fput(dbp->mpf, h, 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_lookup --
|
||||
* Find the right location in the tree for the key.
|
||||
@ -425,10 +512,10 @@ __bam_iitem(dbp, hp, indxp, key, data, op, flags)
|
||||
if (op == DB_CURRENT) {
|
||||
bk = GET_BKEYDATA(h,
|
||||
indx + (TYPE(h) == P_LBTREE ? O_INDX : 0));
|
||||
if (B_TYPE(bk->type) == B_OVERFLOW)
|
||||
have_bytes = BOVERFLOW_PSIZE;
|
||||
else
|
||||
if (B_TYPE(bk->type) == B_KEYDATA)
|
||||
have_bytes = BKEYDATA_PSIZE(bk->len);
|
||||
else
|
||||
have_bytes = BOVERFLOW_PSIZE;
|
||||
need_bytes = 0;
|
||||
} else {
|
||||
have_bytes = 0;
|
||||
@ -542,7 +629,7 @@ __bam_iitem(dbp, hp, indxp, key, data, op, flags)
|
||||
* If we're dealing with offpage items, we have to
|
||||
* delete and then re-add the item.
|
||||
*/
|
||||
if (bigdata || B_TYPE(bk->type) == B_OVERFLOW) {
|
||||
if (bigdata || B_TYPE(bk->type) != B_KEYDATA) {
|
||||
if ((ret = __bam_ditem(dbp, h, indx)) != 0)
|
||||
return (ret);
|
||||
break;
|
||||
@ -704,9 +791,9 @@ __bam_ritem(dbp, h, indx, data)
|
||||
{
|
||||
BKEYDATA *bk;
|
||||
DBT orig, repl;
|
||||
db_indx_t lo, ln, min, off, prefix, suffix;
|
||||
db_indx_t cnt, lo, ln, min, off, prefix, suffix;
|
||||
int32_t nbytes;
|
||||
int cnt, ret;
|
||||
int ret;
|
||||
u_int8_t *p, *t;
|
||||
|
||||
/*
|
||||
|
@ -47,7 +47,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)bt_search.c 10.8 (Sleepycat) 10/25/97";
|
||||
static const char sccsid[] = "@(#)bt_search.c 10.9 (Sleepycat) 11/18/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -119,12 +119,20 @@ __bam_search(dbp, key, flags, stop, recnop, exactp)
|
||||
return (ret);
|
||||
}
|
||||
|
||||
/* Decide if we need to save this page; if we do, write lock it. */
|
||||
/*
|
||||
* Decide if we need to save this page; if we do, write lock it.
|
||||
* We deliberately don't lock-couple on this call. If the tree
|
||||
* is tiny, i.e., one page, and two threads are busily updating
|
||||
* the root page, we're almost guaranteed deadlocks galore, as
|
||||
* each one gets a read lock and then blocks the other's attempt
|
||||
* for a write lock.
|
||||
*/
|
||||
if (!stack &&
|
||||
((LF_ISSET(S_PARENT) && (u_int8_t)(stop + 1) >= h->level) ||
|
||||
(LF_ISSET(S_WRITE) && h->level == LEAFLEVEL))) {
|
||||
(void)memp_fput(dbp->mpf, h, 0);
|
||||
if ((ret = __bam_lget(dbp, 1, pg, DB_LOCK_WRITE, &lock)) != 0)
|
||||
(void)__BT_LPUT(dbp, lock);
|
||||
if ((ret = __bam_lget(dbp, 0, pg, DB_LOCK_WRITE, &lock)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __bam_pget(dbp, &h, &pg, 0)) != 0) {
|
||||
(void)__BT_LPUT(dbp, lock);
|
||||
|
@ -44,7 +44,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)bt_split.c 10.17 (Sleepycat) 11/2/97";
|
||||
static const char sccsid[] = "@(#)bt_split.c 10.18 (Sleepycat) 11/23/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -396,14 +396,14 @@ __bam_broot(dbp, rootp, lp, rp)
|
||||
* The btree comparison code guarantees that the left-most key on any
|
||||
* level of the tree is never used, so it doesn't need to be filled in.
|
||||
*/
|
||||
memset(&bi, 0, sizeof(bi));
|
||||
bi.len = 0;
|
||||
B_TSET(bi.type, B_KEYDATA, 0);
|
||||
bi.pgno = lp->pgno;
|
||||
if (F_ISSET(dbp, DB_BT_RECNUM)) {
|
||||
bi.nrecs = __bam_total(lp);
|
||||
RE_NREC_SET(rootp, bi.nrecs);
|
||||
} else
|
||||
bi.nrecs = 0;
|
||||
}
|
||||
hdr.data = &bi;
|
||||
hdr.size = SSZA(BINTERNAL, data);
|
||||
if ((ret =
|
||||
@ -591,6 +591,7 @@ __bam_pinsert(dbp, parent, lchild, rchild)
|
||||
return (DB_NEEDSPLIT);
|
||||
|
||||
/* Add a new record for the right page. */
|
||||
memset(&bi, 0, sizeof(bi));
|
||||
bi.len = child_bi->len;
|
||||
B_TSET(bi.type, child_bi->type, 0);
|
||||
bi.pgno = rchild->pgno;
|
||||
@ -640,6 +641,7 @@ noprefix: nksize = child_bk->len;
|
||||
if (P_FREESPACE(ppage) < nbytes)
|
||||
return (DB_NEEDSPLIT);
|
||||
|
||||
memset(&bi, 0, sizeof(bi));
|
||||
bi.len = nksize;
|
||||
B_TSET(bi.type, child_bk->type, 0);
|
||||
bi.pgno = rchild->pgno;
|
||||
@ -661,6 +663,7 @@ noprefix: nksize = child_bk->len;
|
||||
if (P_FREESPACE(ppage) < nbytes)
|
||||
return (DB_NEEDSPLIT);
|
||||
|
||||
memset(&bi, 0, sizeof(bi));
|
||||
bi.len = BOVERFLOW_SIZE;
|
||||
B_TSET(bi.type, child_bk->type, 0);
|
||||
bi.pgno = rchild->pgno;
|
||||
|
@ -100,7 +100,6 @@ int __bam_pg_alloc_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __bam_pg_alloc_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__bam_pg_alloc_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -265,7 +264,6 @@ int __bam_pg_free_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __bam_pg_free_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__bam_pg_free_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -460,7 +458,6 @@ int __bam_split_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __bam_split_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__bam_split_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -657,7 +654,6 @@ int __bam_rsplit_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __bam_rsplit_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__bam_rsplit_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -836,7 +832,6 @@ int __bam_adj_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __bam_adj_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__bam_adj_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -995,7 +990,6 @@ int __bam_cadjust_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __bam_cadjust_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__bam_cadjust_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -1145,7 +1139,6 @@ int __bam_cdel_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __bam_cdel_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__bam_cdel_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -1329,7 +1322,6 @@ int __bam_repl_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __bam_repl_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__bam_repl_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)db_appinit.c 10.36 (Sleepycat) 10/28/97";
|
||||
static const char sccsid[] = "@(#)db_appinit.c 10.37 (Sleepycat) 11/25/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -108,10 +108,23 @@ db_appinit(db_home, db_config, dbenv, flags)
|
||||
if ((ret = __db_parse(dbenv, *p)) != 0)
|
||||
goto err;
|
||||
|
||||
/* Parse the config file. */
|
||||
/*
|
||||
* Parse the config file.
|
||||
*
|
||||
* XXX
|
||||
* Don't use sprintf(3)/snprintf(3) -- the former is dangerous, and
|
||||
* the latter isn't standard, and we're manipulating strings handed
|
||||
* us by the application.
|
||||
*/
|
||||
if (dbenv->db_home != NULL) {
|
||||
(void)snprintf(buf,
|
||||
sizeof(buf), "%s/DB_CONFIG", dbenv->db_home);
|
||||
#define CONFIG_NAME "/DB_CONFIG"
|
||||
if (strlen(dbenv->db_home) +
|
||||
strlen(CONFIG_NAME) + 1 > sizeof(buf)) {
|
||||
ret = ENAMETOOLONG;
|
||||
goto err;
|
||||
}
|
||||
(void)strcpy(buf, dbenv->db_home);
|
||||
(void)strcat(buf, CONFIG_NAME);
|
||||
if ((fp = fopen(buf, "r")) != NULL) {
|
||||
while (fgets(buf, sizeof(buf), fp) != NULL) {
|
||||
if ((lp = strchr(buf, '\n')) != NULL)
|
||||
|
@ -11,7 +11,7 @@
|
||||
static const char copyright[] =
|
||||
"@(#) Copyright (c) 1997\n\
|
||||
Sleepycat Software Inc. All rights reserved.\n";
|
||||
static const char sccsid[] = "@(#)db_apprec.c 10.18 (Sleepycat) 9/30/97";
|
||||
static const char sccsid[] = "@(#)db_apprec.c 10.19 (Sleepycat) 11/23/97";
|
||||
#endif
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -72,10 +72,8 @@ __db_apprec(dbenv, flags)
|
||||
if (LF_ISSET(DB_RECOVER_FATAL))
|
||||
first_flag = DB_FIRST;
|
||||
else {
|
||||
if ((ret = __log_findckp(lp, &lsn)) == DB_NOTFOUND) {
|
||||
F_SET(lp, is_thread);
|
||||
return (0);
|
||||
}
|
||||
if ((ret = __log_findckp(lp, &lsn)) == DB_NOTFOUND)
|
||||
goto out;
|
||||
first_flag = DB_SET;
|
||||
}
|
||||
|
||||
@ -88,7 +86,7 @@ __db_apprec(dbenv, flags)
|
||||
(u_long)lsn.file, (u_long)lsn.offset);
|
||||
else
|
||||
__db_err(dbenv, "Retrieving first LSN");
|
||||
goto err;
|
||||
goto out;
|
||||
}
|
||||
|
||||
first_lsn = lsn;
|
||||
@ -99,7 +97,7 @@ __db_apprec(dbenv, flags)
|
||||
if ((ret =
|
||||
log_get(dbenv->lg_info, &lsn, &data, DB_NEXT)) != 0) {
|
||||
if (ret != DB_NOTFOUND)
|
||||
goto err;
|
||||
goto out;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -123,7 +121,7 @@ __db_apprec(dbenv, flags)
|
||||
goto msgerr;
|
||||
}
|
||||
if (ret != 0 && ret != DB_NOTFOUND)
|
||||
goto err;
|
||||
goto out;
|
||||
|
||||
for (ret = log_get(lp, &lsn, &data, DB_NEXT);
|
||||
ret == 0; ret = log_get(lp, &lsn, &data, DB_NEXT)) {
|
||||
@ -134,7 +132,7 @@ __db_apprec(dbenv, flags)
|
||||
goto msgerr;
|
||||
}
|
||||
if (ret != DB_NOTFOUND)
|
||||
goto err;
|
||||
goto out;
|
||||
|
||||
/* Now close all the db files that are open. */
|
||||
__log_close_files(lp);
|
||||
@ -148,7 +146,7 @@ __db_apprec(dbenv, flags)
|
||||
dbenv->tx_info->region->last_ckp = ckp_lsn;
|
||||
dbenv->tx_info->region->time_ckp = (u_int32_t)now;
|
||||
if ((ret = txn_checkpoint(dbenv->tx_info, 0, 0)) != 0)
|
||||
goto err;
|
||||
goto out;
|
||||
|
||||
if (dbenv->db_verbose) {
|
||||
__db_err(lp->dbenv, "Recovery complete at %s", ctime(&now));
|
||||
@ -160,12 +158,13 @@ __db_apprec(dbenv, flags)
|
||||
(u_long)dbenv->tx_info->region->last_ckp.offset);
|
||||
}
|
||||
|
||||
F_SET(lp, is_thread);
|
||||
return (0);
|
||||
if (0) {
|
||||
msgerr: __db_err(dbenv, "Recovery function for LSN %lu %lu failed",
|
||||
(u_long)lsn.file, (u_long)lsn.offset);
|
||||
}
|
||||
|
||||
msgerr: __db_err(dbenv, "Recovery function for LSN %lu %lu failed",
|
||||
(u_long)lsn.file, (u_long)lsn.offset);
|
||||
out: F_SET(lp, is_thread);
|
||||
__db_txnlist_end(txninfo);
|
||||
|
||||
err: F_SET(lp, is_thread);
|
||||
return (ret);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)db_err.c 10.18 (Sleepycat) 8/27/97";
|
||||
static const char sccsid[] = "@(#)db_err.c 10.19 (Sleepycat) 11/9/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -302,8 +302,11 @@ __db_cgetchk(dbp, key, data, flags, isvalid)
|
||||
break;
|
||||
case DB_SET:
|
||||
break;
|
||||
case DB_SET_RECNO:
|
||||
case DB_GET_RECNO:
|
||||
if (!F_ISSET(dbp, DB_BT_RECNUM))
|
||||
goto err;
|
||||
break;
|
||||
case DB_SET_RECNO:
|
||||
if (!F_ISSET(dbp, DB_BT_RECNUM))
|
||||
goto err;
|
||||
check_key = 1;
|
||||
@ -313,8 +316,9 @@ err: return (__db_ferr(dbp->dbenv, "c_get", 0));
|
||||
}
|
||||
|
||||
/* Check for invalid key/data flags. */
|
||||
DB_CHECK_FLAGS(dbp->dbenv, "key", key->flags,
|
||||
DB_DBT_MALLOC | DB_DBT_USERMEM | DB_DBT_PARTIAL);
|
||||
if (check_key)
|
||||
DB_CHECK_FLAGS(dbp->dbenv, "key", key->flags,
|
||||
DB_DBT_MALLOC | DB_DBT_USERMEM | DB_DBT_PARTIAL);
|
||||
DB_CHECK_FLAGS(dbp->dbenv, "data", data->flags,
|
||||
DB_DBT_MALLOC | DB_DBT_USERMEM | DB_DBT_PARTIAL);
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)db_region.c 10.15 (Sleepycat) 10/25/97";
|
||||
static const char sccsid[] = "@(#)db_region.c 10.18 (Sleepycat) 11/28/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -80,14 +80,14 @@ static int __db_rmap __P((DB_ENV *, int, size_t, void *));
|
||||
* into memory, NULL on error.
|
||||
*
|
||||
* PUBLIC: int __db_rcreate __P((DB_ENV *, APPNAME,
|
||||
* PUBLIC: const char *, const char *, int, size_t, int *, void *));
|
||||
* PUBLIC: const char *, const char *, int, size_t, int, int *, void *));
|
||||
*/
|
||||
int
|
||||
__db_rcreate(dbenv, appname, path, file, mode, size, fdp, retp)
|
||||
__db_rcreate(dbenv, appname, path, file, mode, size, oflags, fdp, retp)
|
||||
DB_ENV *dbenv;
|
||||
APPNAME appname;
|
||||
const char *path, *file;
|
||||
int mode, *fdp;
|
||||
int mode, oflags, *fdp;
|
||||
size_t size;
|
||||
void *retp;
|
||||
{
|
||||
@ -110,12 +110,13 @@ __db_rcreate(dbenv, appname, path, file, mode, size, fdp, retp)
|
||||
/*
|
||||
* Now open the file. We need to make sure that multiple processes
|
||||
* that attempt to create the region at the same time are properly
|
||||
* ordered, so we open it O_EXCL and O_CREAT so two simultaneous
|
||||
* ordered, so we open it DB_EXCL and DB_CREATE so two simultaneous
|
||||
* attempts to create the region will return failure in one of the
|
||||
* attempts.
|
||||
*/
|
||||
if (fd == -1 && (ret = __db_open(name,
|
||||
DB_CREATE | DB_EXCL, DB_CREATE | DB_EXCL, mode, &fd)) != 0) {
|
||||
oflags |= DB_CREATE | DB_EXCL;
|
||||
if (fd == -1 &&
|
||||
(ret = __db_open(name, oflags, oflags, mode, &fd)) != 0) {
|
||||
if (ret != EEXIST)
|
||||
__db_err(dbenv,
|
||||
"region create: %s: %s", name, strerror(ret));
|
||||
@ -398,7 +399,7 @@ __db_runlink(dbenv, appname, path, file, force)
|
||||
|
||||
/* If the file doesn't exist, we're done. */
|
||||
if (__db_exists(name, NULL))
|
||||
return (0); /* XXX: ENOENT? */
|
||||
goto done;
|
||||
|
||||
/*
|
||||
* If we're called with a force flag, try and unlink the file. This
|
||||
@ -412,8 +413,7 @@ __db_runlink(dbenv, appname, path, file, force)
|
||||
if (force) {
|
||||
if ((ret = __db_unlink(name)) != 0 && ret != ENOENT)
|
||||
goto err1;
|
||||
FREES(name);
|
||||
return (0);
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Open and lock the region. */
|
||||
@ -453,7 +453,7 @@ __db_runlink(dbenv, appname, path, file, force)
|
||||
(void)__db_sleep(0, 250000);
|
||||
}
|
||||
if (ret == 0) {
|
||||
FREES(name);
|
||||
done: FREES(name);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -467,6 +467,7 @@ __db_runlink(dbenv, appname, path, file, force)
|
||||
err2: (void)__db_mutex_unlock(&rp->lock, fd);
|
||||
(void)__db_rclose(dbenv, fd, rp);
|
||||
err1: __db_err(dbenv, "region unlink: %s: %s", name, strerror(ret));
|
||||
|
||||
FREES(name);
|
||||
return (ret);
|
||||
}
|
||||
|
@ -114,6 +114,9 @@
|
||||
/* Define if you have the strsep function. */
|
||||
#define HAVE_STRSEP 1
|
||||
|
||||
/* Define if you have the sysconf function. */
|
||||
#define HAVE_SYSCONF 1
|
||||
|
||||
/* Define if you have the vsnprintf function. */
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
|
54
db2/db.h
54
db2/db.h
@ -4,7 +4,7 @@
|
||||
* Copyright (c) 1996, 1997
|
||||
* Sleepycat Software. All rights reserved.
|
||||
*
|
||||
* @(#)db.h.src 10.91 (Sleepycat) 11/3/97
|
||||
* @(#)db.h.src 10.97 (Sleepycat) 11/28/97
|
||||
*/
|
||||
|
||||
#ifndef _DB_H_
|
||||
@ -73,8 +73,8 @@
|
||||
|
||||
#define DB_VERSION_MAJOR 2
|
||||
#define DB_VERSION_MINOR 3
|
||||
#define DB_VERSION_PATCH 12
|
||||
#define DB_VERSION_STRING "Sleepycat Software: DB 2.3.12: (11/3/97)"
|
||||
#define DB_VERSION_PATCH 14
|
||||
#define DB_VERSION_STRING "Sleepycat Software: DB 2.3.14: (11/28/97)"
|
||||
|
||||
typedef u_int32_t db_pgno_t; /* Page number type. */
|
||||
typedef u_int16_t db_indx_t; /* Page offset type. */
|
||||
@ -129,8 +129,10 @@ struct __db_dbt {
|
||||
};
|
||||
|
||||
/*
|
||||
* DB configuration. There are a set of functions which the application
|
||||
* can replace with its own versions.
|
||||
* DB internal configuration.
|
||||
*
|
||||
* There are a set of functions that the application can replace with its
|
||||
* own versions, and some other knobs which can be turned at run-time.
|
||||
*/
|
||||
#define DB_FUNC_CALLOC 1 /* ANSI C calloc. */
|
||||
#define DB_FUNC_CLOSE 2 /* POSIX 1003.1 close. */
|
||||
@ -147,11 +149,12 @@ struct __db_dbt {
|
||||
#define DB_FUNC_REALLOC 13 /* ANSI C realloc. */
|
||||
#define DB_FUNC_SEEK 14 /* POSIX 1003.1 lseek. */
|
||||
#define DB_FUNC_SLEEP 15 /* DB: sleep secs/usecs. */
|
||||
#define DB_FUNC_STRDUP 16 /* ANSI C strdup. */
|
||||
#define DB_FUNC_STRDUP 16 /* DB: strdup(3). */
|
||||
#define DB_FUNC_UNLINK 17 /* POSIX 1003.1 unlink. */
|
||||
#define DB_FUNC_UNMAP 18 /* DB: unmap shared memory file. */
|
||||
#define DB_FUNC_WRITE 19 /* POSIX 1003.1 write. */
|
||||
#define DB_FUNC_YIELD 20 /* DB: yield thread to scheduler. */
|
||||
#define DB_TSL_SPINS 21 /* DB: initialize spin count. */
|
||||
|
||||
/*
|
||||
* Database configuration and initialization.
|
||||
@ -211,10 +214,10 @@ struct __db_dbt {
|
||||
* locking subsystem.
|
||||
*/
|
||||
#define DB_LOCK_NORUN 0x0
|
||||
#define DB_LOCK_DEFAULT 0x1
|
||||
#define DB_LOCK_OLDEST 0x2
|
||||
#define DB_LOCK_RANDOM 0x3
|
||||
#define DB_LOCK_YOUNGEST 0x4
|
||||
#define DB_LOCK_DEFAULT 0x1 /* Default policy. */
|
||||
#define DB_LOCK_OLDEST 0x2 /* Abort oldest transaction. */
|
||||
#define DB_LOCK_RANDOM 0x3 /* Abort random transaction. */
|
||||
#define DB_LOCK_YOUNGEST 0x4 /* Abort youngest transaction. */
|
||||
|
||||
struct __db_env {
|
||||
int db_lorder; /* Byte order. */
|
||||
@ -265,6 +268,10 @@ struct __db_env {
|
||||
/*******************************************************
|
||||
* Access methods.
|
||||
*******************************************************/
|
||||
/*
|
||||
* XXX
|
||||
* Changes here must be reflected in java/src/com/sleepycat/db/Db.java.
|
||||
*/
|
||||
typedef enum {
|
||||
DB_BTREE=1, /* B+tree. */
|
||||
DB_HASH, /* Extended Linear Hashing. */
|
||||
@ -347,7 +354,13 @@ struct __db_info {
|
||||
#define DB_SET_RANGE 0x020000 /* c_get() */
|
||||
#define DB_SET_RECNO 0x040000 /* c_get() */
|
||||
|
||||
/* DB (user visible) error return codes. */
|
||||
/*
|
||||
* DB (user visible) error return codes.
|
||||
*
|
||||
* XXX
|
||||
* Changes to any of the user visible error return codes must be reflected
|
||||
* in java/src/com/sleepycat/db/Db.java.
|
||||
*/
|
||||
#define DB_INCOMPLETE ( -1) /* Sync didn't finish. */
|
||||
#define DB_KEYEMPTY ( -2) /* The key/data pair was deleted or
|
||||
was never created by the user. */
|
||||
@ -516,6 +529,7 @@ int db_appinit __P((const char *, char * const *, DB_ENV *, int));
|
||||
int db_appexit __P((DB_ENV *));
|
||||
int db_jump_set __P((void *, int));
|
||||
int db_open __P((const char *, DBTYPE, int, int, DB_ENV *, DB_INFO *, DB **));
|
||||
int db_value_set __P((int, int));
|
||||
char *db_version __P((int *, int *, int *));
|
||||
#if defined(__cplusplus)
|
||||
};
|
||||
@ -533,16 +547,26 @@ char *db_version __P((int *, int *, int *));
|
||||
/* Flag values for lock_detect(). */
|
||||
#define DB_LOCK_CONFLICT 0x01 /* Run on any conflict. */
|
||||
|
||||
/* Request types. */
|
||||
/*
|
||||
* Request types.
|
||||
*
|
||||
* XXX
|
||||
* Changes here must be reflected in java/src/com/sleepycat/db/Db.java.
|
||||
*/
|
||||
typedef enum {
|
||||
DB_LOCK_DUMP, /* Display held locks. */
|
||||
DB_LOCK_DUMP=0, /* Display held locks. */
|
||||
DB_LOCK_GET, /* Get the lock. */
|
||||
DB_LOCK_PUT, /* Release the lock. */
|
||||
DB_LOCK_PUT_ALL, /* Release locker's locks. */
|
||||
DB_LOCK_PUT_OBJ /* Release locker's locks on obj. */
|
||||
} db_lockop_t;
|
||||
|
||||
/* Simple R/W lock modes and for multi-granularity intention locking. */
|
||||
/*
|
||||
* Simple R/W lock modes and for multi-granularity intention locking.
|
||||
*
|
||||
* XXX
|
||||
* Changes here must be reflected in java/src/com/sleepycat/db/Db.java.
|
||||
*/
|
||||
typedef enum {
|
||||
DB_LOCK_NG=0, /* Not granted. */
|
||||
DB_LOCK_READ, /* Shared/read. */
|
||||
@ -577,7 +601,7 @@ extern const u_int8_t db_riw_conflicts[];
|
||||
extern "C" {
|
||||
#endif
|
||||
int lock_close __P((DB_LOCKTAB *));
|
||||
int lock_detect __P((DB_LOCKTAB *, int, u_int32_t));
|
||||
int lock_detect __P((DB_LOCKTAB *, int, int));
|
||||
int lock_get __P((DB_LOCKTAB *,
|
||||
u_int32_t, int, const DBT *, db_lockmode_t, DB_LOCK *));
|
||||
int lock_id __P((DB_LOCKTAB *, u_int32_t *));
|
||||
|
@ -122,7 +122,6 @@ int __db_addrem_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __db_addrem_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__db_addrem_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -312,7 +311,6 @@ int __db_split_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __db_split_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__db_split_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -507,7 +505,6 @@ int __db_big_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __db_big_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__db_big_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -678,7 +675,6 @@ int __db_ovref_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __db_ovref_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__db_ovref_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -842,7 +838,6 @@ int __db_relink_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __db_relink_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__db_relink_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -1005,7 +1000,6 @@ int __db_addpage_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __db_addpage_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__db_addpage_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -1180,7 +1174,6 @@ int __db_debug_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __db_debug_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__db_debug_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -1335,7 +1328,6 @@ int __db_noop_log(logp, txnid, ret_lsnp, flags)
|
||||
* PUBLIC: int __db_noop_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__db_noop_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
|
@ -43,7 +43,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)db_dispatch.c 10.6 (Sleepycat) 10/25/97";
|
||||
static const char sccsid[] = "@(#)db_dispatch.c 10.7 (Sleepycat) 11/23/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -236,8 +236,8 @@ __db_txnlist_find(listp, txnid)
|
||||
void *listp;
|
||||
u_int32_t txnid;
|
||||
{
|
||||
__db_txnlist *p;
|
||||
__db_txnhead *hp;
|
||||
__db_txnlist *p;
|
||||
|
||||
if ((hp = (struct __db_txnhead *)listp) == NULL)
|
||||
return (DB_NOTFOUND);
|
||||
@ -255,12 +255,16 @@ __db_txnlist_find(listp, txnid)
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
/*
|
||||
* __db_txnlist_print --
|
||||
* Print out the transaction list.
|
||||
*/
|
||||
void
|
||||
__db_txnlist_print(listp)
|
||||
void *listp;
|
||||
{
|
||||
__db_txnlist *p;
|
||||
__db_txnhead *hp;
|
||||
__db_txnlist *p;
|
||||
|
||||
hp = (struct __db_txnhead *)listp;
|
||||
printf("Maxid: %lu\n", (u_long)hp->maxid);
|
||||
@ -268,3 +272,24 @@ __db_txnlist_print(listp)
|
||||
printf("TXNID: %lu\n", (u_long)p->txnid);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* __db_txnlist_end --
|
||||
* Discard transaction linked list.
|
||||
*
|
||||
* PUBLIC: void __db_txnlist_end __P((void *));
|
||||
*/
|
||||
void
|
||||
__db_txnlist_end(listp)
|
||||
void *listp;
|
||||
{
|
||||
__db_txnhead *hp;
|
||||
__db_txnlist *p;
|
||||
|
||||
hp = (struct __db_txnhead *)listp;
|
||||
while ((p = LIST_FIRST(&hp->head)) != LIST_END(&hp->head)) {
|
||||
LIST_REMOVE(p, links);
|
||||
__db_free(p);
|
||||
}
|
||||
__db_free(listp);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)db_ret.c 10.8 (Sleepycat) 10/25/97";
|
||||
static const char sccsid[] = "@(#)db_ret.c 10.10 (Sleepycat) 11/28/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -116,35 +116,48 @@ __db_retcopy(dbt, data, len, memp, memsize, db_malloc)
|
||||
dbt->size = len;
|
||||
|
||||
/*
|
||||
* Allocate any necessary memory.
|
||||
* Allocate memory to be owned by the application: DB_DBT_MALLOC.
|
||||
*
|
||||
* XXX: Never allocate 0 bytes.
|
||||
* !!!
|
||||
* We always allocate memory, even if we're copying out 0 bytes. This
|
||||
* guarantees consistency, i.e., the application can always free memory
|
||||
* without concern as to how many bytes of the record were requested.
|
||||
*
|
||||
* XXX
|
||||
* Never allocate 0 bytes, it's known to make malloc/realloc unhappy.
|
||||
*
|
||||
* Use the memory specified by the application: DB_DBT_USERMEM.
|
||||
*
|
||||
* !!!
|
||||
* If the length we're going to copy is 0, the application-supplied
|
||||
* memory pointer is allowed to be NULL.
|
||||
*/
|
||||
if (F_ISSET(dbt, DB_DBT_MALLOC)) {
|
||||
dbt->data = db_malloc == NULL ?
|
||||
(void *)__db_malloc(len + 1) :
|
||||
(void *)__db_malloc(len) :
|
||||
(void *)db_malloc(len + 1);
|
||||
if (dbt->data == NULL)
|
||||
return (ENOMEM);
|
||||
} else if (F_ISSET(dbt, DB_DBT_USERMEM)) {
|
||||
if (dbt->ulen < len)
|
||||
if (len != 0 && (dbt->data == NULL || dbt->ulen < len))
|
||||
return (ENOMEM);
|
||||
} else if (memp == NULL || memsize == NULL) {
|
||||
return (EINVAL);
|
||||
} else {
|
||||
if (*memsize == 0 || *memsize < len) {
|
||||
if (len != 0 && (*memsize == 0 || *memsize < len)) {
|
||||
*memp = *memp == NULL ?
|
||||
(void *)__db_malloc(len + 1) :
|
||||
(void *)__db_realloc(*memp, len + 1);
|
||||
(void *)__db_malloc(len) :
|
||||
(void *)__db_realloc(*memp, len);
|
||||
if (*memp == NULL) {
|
||||
*memsize = 0;
|
||||
return (ENOMEM);
|
||||
}
|
||||
*memsize = len + 1;
|
||||
*memsize = len;
|
||||
}
|
||||
dbt->data = *memp;
|
||||
}
|
||||
|
||||
memcpy(dbt->data, data, len);
|
||||
if (len != 0)
|
||||
memcpy(dbt->data, data, len);
|
||||
return (0);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Copyright (c) 1996, 1997
|
||||
* Sleepycat Software. All rights reserved.
|
||||
*
|
||||
* @(#)db_int.h.src 10.36 (Sleepycat) 10/31/97
|
||||
* @(#)db_int.h.src 10.37 (Sleepycat) 11/25/97
|
||||
*/
|
||||
|
||||
#ifndef _DB_INTERNAL_H_
|
||||
@ -168,6 +168,7 @@ typedef struct _db_mutex_t {
|
||||
off_t off; /* Backing file offset. */
|
||||
u_long pid; /* Lock holder: 0 or process pid. */
|
||||
#endif
|
||||
u_int32_t spins; /* Spins before block. */
|
||||
u_int32_t mutex_set_wait; /* Granted after wait. */
|
||||
u_int32_t mutex_set_nowait; /* Granted without waiting. */
|
||||
} db_mutex_t;
|
||||
|
@ -47,7 +47,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)dbm.c 10.6 (Sleepycat) 8/27/97";
|
||||
static const char sccsid[] = "@(#)dbm.c 10.7 (Sleepycat) 11/25/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -198,9 +198,20 @@ dbm_open(file, oflags, mode)
|
||||
dbinfo.h_ffactor = 40;
|
||||
dbinfo.h_nelem = 1;
|
||||
|
||||
(void)snprintf(path, sizeof(path), "%s%s", file, DBM_SUFFIX);
|
||||
if ((__set_errno(db_open(path,
|
||||
DB_HASH, __db_oflags(oflags), mode, NULL, &dbinfo, &dbp))) != 0)
|
||||
/*
|
||||
* XXX
|
||||
* Don't use sprintf(3)/snprintf(3) -- the former is dangerous, and
|
||||
* the latter isn't standard, and we're manipulating strings handed
|
||||
* us by the application.
|
||||
*/
|
||||
if (strlen(file) + strlen(DBM_SUFFIX) + 1 > sizeof(path)) {
|
||||
errno = ENAMETOOLONG;
|
||||
return (NULL);
|
||||
}
|
||||
(void)strcpy(path, file);
|
||||
(void)strcat(path, DBM_SUFFIX);
|
||||
if ((errno = db_open(path,
|
||||
DB_HASH, __db_oflags(oflags), mode, NULL, &dbinfo, &dbp)) != 0)
|
||||
return (NULL);
|
||||
return ((DBM *)dbp);
|
||||
}
|
||||
@ -261,7 +272,7 @@ dbm_firstkey(db)
|
||||
DBC *cp;
|
||||
|
||||
if ((cp = TAILQ_FIRST(&db->curs_queue)) == NULL)
|
||||
if ((__set_errno(db->cursor(db, NULL, &cp))) != 0) {
|
||||
if ((errno = db->cursor(db, NULL, &cp)) != 0) {
|
||||
memset(&key, 0, sizeof(key));
|
||||
return (key);
|
||||
}
|
||||
@ -294,7 +305,7 @@ dbm_nextkey(db)
|
||||
int status;
|
||||
|
||||
if ((cp = TAILQ_FIRST(&db->curs_queue)) == NULL)
|
||||
if ((__set_errno(db->cursor(db, NULL, &cp))) != 0) {
|
||||
if ((errno = db->cursor(db, NULL, &cp)) != 0) {
|
||||
memset(&key, 0, sizeof(key));
|
||||
return (key);
|
||||
}
|
||||
@ -330,9 +341,9 @@ dbm_delete(db, key)
|
||||
_key.size = key.dsize;
|
||||
ret = (((DB *)db)->del)((DB *)db, NULL, &_key, 0);
|
||||
if (ret < 0)
|
||||
__set_errno(ENOENT);
|
||||
errno = ENOENT;
|
||||
else if (ret > 0) {
|
||||
__set_errno(ret);
|
||||
errno = ret;
|
||||
ret = -1;
|
||||
}
|
||||
return (ret);
|
||||
|
@ -119,7 +119,6 @@ int __ham_insdel_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __ham_insdel_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__ham_insdel_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -316,7 +315,6 @@ int __ham_newpage_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __ham_newpage_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__ham_newpage_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -479,7 +477,6 @@ int __ham_splitmeta_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __ham_splitmeta_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__ham_splitmeta_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -640,7 +637,6 @@ int __ham_splitdata_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __ham_splitdata_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__ham_splitdata_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -832,7 +828,6 @@ int __ham_replace_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __ham_replace_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__ham_replace_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -1034,7 +1029,6 @@ int __ham_newpgno_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __ham_newpgno_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__ham_newpgno_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -1203,7 +1197,6 @@ int __ham_ovfl_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __ham_ovfl_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__ham_ovfl_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -1386,7 +1379,6 @@ int __ham_copypage_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __ham_copypage_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__ham_copypage_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
|
@ -11,7 +11,7 @@ int __bam_cursor __P((DB *, DB_TXN *, DBC **));
|
||||
int __bam_c_iclose __P((DB *, DBC *));
|
||||
int __bam_get __P((DB *, DB_TXN *, DBT *, DBT *, int));
|
||||
int __bam_ovfl_chk __P((DB *, CURSOR *, u_int32_t, int));
|
||||
int __bam_ca_delete __P((DB *, db_pgno_t, u_int32_t, CURSOR *));
|
||||
int __bam_ca_delete __P((DB *, db_pgno_t, u_int32_t, CURSOR *, int));
|
||||
void __bam_ca_di __P((DB *, db_pgno_t, u_int32_t, int));
|
||||
void __bam_ca_dup __P((DB *,
|
||||
db_pgno_t, u_int32_t, u_int32_t, db_pgno_t, u_int32_t));
|
||||
|
@ -23,7 +23,7 @@ int __db_syncchk __P((const DB *, int));
|
||||
int __db_ferr __P((const DB_ENV *, const char *, int));
|
||||
u_int32_t __db_log2 __P((u_int32_t));
|
||||
int __db_rcreate __P((DB_ENV *, APPNAME,
|
||||
const char *, const char *, int, size_t, int *, void *));
|
||||
const char *, const char *, int, size_t, int, int *, void *));
|
||||
int __db_rinit __P((DB_ENV *, RLAYOUT *, int, size_t, int));
|
||||
int __db_ropen __P((DB_ENV *,
|
||||
APPNAME, const char *, const char *, int, int *, void *));
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Copyright (c) 1996, 1997
|
||||
* Sleepycat Software. All rights reserved.
|
||||
*
|
||||
* @(#)db.h.src 10.91 (Sleepycat) 11/3/97
|
||||
* @(#)db.h.src 10.97 (Sleepycat) 11/28/97
|
||||
*/
|
||||
|
||||
#ifndef _DB_H_
|
||||
@ -73,8 +73,8 @@
|
||||
|
||||
#define DB_VERSION_MAJOR 2
|
||||
#define DB_VERSION_MINOR 3
|
||||
#define DB_VERSION_PATCH 12
|
||||
#define DB_VERSION_STRING "Sleepycat Software: DB 2.3.12: (11/3/97)"
|
||||
#define DB_VERSION_PATCH 14
|
||||
#define DB_VERSION_STRING "Sleepycat Software: DB 2.3.14: (11/28/97)"
|
||||
|
||||
typedef u_int32_t db_pgno_t; /* Page number type. */
|
||||
typedef u_int16_t db_indx_t; /* Page offset type. */
|
||||
@ -129,8 +129,10 @@ struct __db_dbt {
|
||||
};
|
||||
|
||||
/*
|
||||
* DB configuration. There are a set of functions which the application
|
||||
* can replace with its own versions.
|
||||
* DB internal configuration.
|
||||
*
|
||||
* There are a set of functions that the application can replace with its
|
||||
* own versions, and some other knobs which can be turned at run-time.
|
||||
*/
|
||||
#define DB_FUNC_CALLOC 1 /* ANSI C calloc. */
|
||||
#define DB_FUNC_CLOSE 2 /* POSIX 1003.1 close. */
|
||||
@ -147,11 +149,12 @@ struct __db_dbt {
|
||||
#define DB_FUNC_REALLOC 13 /* ANSI C realloc. */
|
||||
#define DB_FUNC_SEEK 14 /* POSIX 1003.1 lseek. */
|
||||
#define DB_FUNC_SLEEP 15 /* DB: sleep secs/usecs. */
|
||||
#define DB_FUNC_STRDUP 16 /* ANSI C strdup. */
|
||||
#define DB_FUNC_STRDUP 16 /* DB: strdup(3). */
|
||||
#define DB_FUNC_UNLINK 17 /* POSIX 1003.1 unlink. */
|
||||
#define DB_FUNC_UNMAP 18 /* DB: unmap shared memory file. */
|
||||
#define DB_FUNC_WRITE 19 /* POSIX 1003.1 write. */
|
||||
#define DB_FUNC_YIELD 20 /* DB: yield thread to scheduler. */
|
||||
#define DB_TSL_SPINS 21 /* DB: initialize spin count. */
|
||||
|
||||
/*
|
||||
* Database configuration and initialization.
|
||||
@ -211,10 +214,10 @@ struct __db_dbt {
|
||||
* locking subsystem.
|
||||
*/
|
||||
#define DB_LOCK_NORUN 0x0
|
||||
#define DB_LOCK_DEFAULT 0x1
|
||||
#define DB_LOCK_OLDEST 0x2
|
||||
#define DB_LOCK_RANDOM 0x3
|
||||
#define DB_LOCK_YOUNGEST 0x4
|
||||
#define DB_LOCK_DEFAULT 0x1 /* Default policy. */
|
||||
#define DB_LOCK_OLDEST 0x2 /* Abort oldest transaction. */
|
||||
#define DB_LOCK_RANDOM 0x3 /* Abort random transaction. */
|
||||
#define DB_LOCK_YOUNGEST 0x4 /* Abort youngest transaction. */
|
||||
|
||||
struct __db_env {
|
||||
int db_lorder; /* Byte order. */
|
||||
@ -265,6 +268,10 @@ struct __db_env {
|
||||
/*******************************************************
|
||||
* Access methods.
|
||||
*******************************************************/
|
||||
/*
|
||||
* XXX
|
||||
* Changes here must be reflected in java/src/com/sleepycat/db/Db.java.
|
||||
*/
|
||||
typedef enum {
|
||||
DB_BTREE=1, /* B+tree. */
|
||||
DB_HASH, /* Extended Linear Hashing. */
|
||||
@ -347,7 +354,13 @@ struct __db_info {
|
||||
#define DB_SET_RANGE 0x020000 /* c_get() */
|
||||
#define DB_SET_RECNO 0x040000 /* c_get() */
|
||||
|
||||
/* DB (user visible) error return codes. */
|
||||
/*
|
||||
* DB (user visible) error return codes.
|
||||
*
|
||||
* XXX
|
||||
* Changes to any of the user visible error return codes must be reflected
|
||||
* in java/src/com/sleepycat/db/Db.java.
|
||||
*/
|
||||
#define DB_INCOMPLETE ( -1) /* Sync didn't finish. */
|
||||
#define DB_KEYEMPTY ( -2) /* The key/data pair was deleted or
|
||||
was never created by the user. */
|
||||
@ -516,6 +529,7 @@ int db_appinit __P((const char *, char * const *, DB_ENV *, int));
|
||||
int db_appexit __P((DB_ENV *));
|
||||
int db_jump_set __P((void *, int));
|
||||
int db_open __P((const char *, DBTYPE, int, int, DB_ENV *, DB_INFO *, DB **));
|
||||
int db_value_set __P((int, int));
|
||||
char *db_version __P((int *, int *, int *));
|
||||
#if defined(__cplusplus)
|
||||
};
|
||||
@ -533,16 +547,26 @@ char *db_version __P((int *, int *, int *));
|
||||
/* Flag values for lock_detect(). */
|
||||
#define DB_LOCK_CONFLICT 0x01 /* Run on any conflict. */
|
||||
|
||||
/* Request types. */
|
||||
/*
|
||||
* Request types.
|
||||
*
|
||||
* XXX
|
||||
* Changes here must be reflected in java/src/com/sleepycat/db/Db.java.
|
||||
*/
|
||||
typedef enum {
|
||||
DB_LOCK_DUMP, /* Display held locks. */
|
||||
DB_LOCK_DUMP=0, /* Display held locks. */
|
||||
DB_LOCK_GET, /* Get the lock. */
|
||||
DB_LOCK_PUT, /* Release the lock. */
|
||||
DB_LOCK_PUT_ALL, /* Release locker's locks. */
|
||||
DB_LOCK_PUT_OBJ /* Release locker's locks on obj. */
|
||||
} db_lockop_t;
|
||||
|
||||
/* Simple R/W lock modes and for multi-granularity intention locking. */
|
||||
/*
|
||||
* Simple R/W lock modes and for multi-granularity intention locking.
|
||||
*
|
||||
* XXX
|
||||
* Changes here must be reflected in java/src/com/sleepycat/db/Db.java.
|
||||
*/
|
||||
typedef enum {
|
||||
DB_LOCK_NG=0, /* Not granted. */
|
||||
DB_LOCK_READ, /* Shared/read. */
|
||||
@ -577,7 +601,7 @@ extern const u_int8_t db_riw_conflicts[];
|
||||
extern "C" {
|
||||
#endif
|
||||
int lock_close __P((DB_LOCKTAB *));
|
||||
int lock_detect __P((DB_LOCKTAB *, int, u_int32_t));
|
||||
int lock_detect __P((DB_LOCKTAB *, int, int));
|
||||
int lock_get __P((DB_LOCKTAB *,
|
||||
u_int32_t, int, const DBT *, db_lockmode_t, DB_LOCK *));
|
||||
int lock_id __P((DB_LOCKTAB *, u_int32_t *));
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Copyright (c) 1997
|
||||
* Sleepycat Software. All rights reserved.
|
||||
*
|
||||
* @(#)db_cxx.h 10.12 (Sleepycat) 10/25/97
|
||||
* @(#)db_cxx.h 10.13 (Sleepycat) 11/25/97
|
||||
*/
|
||||
|
||||
#ifndef _DB_CXX_H_
|
||||
@ -202,7 +202,7 @@ class _exported DbLockTab
|
||||
friend DbEnv;
|
||||
public:
|
||||
int close();
|
||||
int detect(int atype, u_int32_t flags);
|
||||
int detect(int flags, int atype);
|
||||
int get(u_int32_t locker, int flags, const Dbt *obj,
|
||||
db_lockmode_t lock_mode, DbLock *lock);
|
||||
int id(u_int32_t *idp);
|
||||
|
@ -65,6 +65,7 @@ int __db_add_recovery __P((DB_ENV *,
|
||||
int __db_txnlist_init __P((void *));
|
||||
int __db_txnlist_add __P((void *, u_int32_t));
|
||||
int __db_txnlist_find __P((void *, u_int32_t));
|
||||
void __db_txnlist_end __P((void *));
|
||||
int __db_dput __P((DB *,
|
||||
DBT *, PAGE **, db_indx_t *, int (*)(DB *, u_int32_t, PAGE **)));
|
||||
int __db_drem __P((DB *,
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Copyright (c) 1996, 1997
|
||||
* Sleepycat Software. All rights reserved.
|
||||
*
|
||||
* @(#)db_int.h.src 10.36 (Sleepycat) 10/31/97
|
||||
* @(#)db_int.h.src 10.37 (Sleepycat) 11/25/97
|
||||
*/
|
||||
|
||||
#ifndef _DB_INTERNAL_H_
|
||||
@ -168,6 +168,7 @@ typedef struct _db_mutex_t {
|
||||
off_t off; /* Backing file offset. */
|
||||
u_long pid; /* Lock holder: 0 or process pid. */
|
||||
#endif
|
||||
u_int32_t spins; /* Spins before block. */
|
||||
u_int32_t mutex_set_wait; /* Granted after wait. */
|
||||
u_int32_t mutex_set_nowait; /* Granted without waiting. */
|
||||
} db_mutex_t;
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Copyright (c) 1996, 1997
|
||||
* Sleepycat Software. All rights reserved.
|
||||
*
|
||||
* @(#)lock.h 10.9 (Sleepycat) 10/25/97
|
||||
* @(#)lock.h 10.10 (Sleepycat) 11/13/97
|
||||
*/
|
||||
|
||||
typedef struct __db_lockobj DB_LOCKOBJ;
|
||||
@ -85,10 +85,14 @@ struct __db_lockobj {
|
||||
} dlinks;
|
||||
#define DB_LOCK_OBJTYPE 1
|
||||
#define DB_LOCK_LOCKER 2
|
||||
/* Allocate room in the object to
|
||||
* hold typical DB lock structures
|
||||
* so that we do not have to
|
||||
* allocate them from shalloc. */
|
||||
u_int8_t objdata[sizeof(struct __db_ilock)];
|
||||
u_int8_t type; /* Real object or locker id. */
|
||||
};
|
||||
|
||||
|
||||
#define dd_id wlinks._dd_id
|
||||
#define waiters wlinks._waiters
|
||||
#define holders dlinks._holders
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Copyright (c) 1996, 1997
|
||||
* Sleepycat Software. All rights reserved.
|
||||
*
|
||||
* @(#)log.h 10.15 (Sleepycat) 11/2/97
|
||||
* @(#)log.h 10.16 (Sleepycat) 11/9/97
|
||||
*/
|
||||
|
||||
#ifndef _LOG_H_
|
||||
@ -117,20 +117,35 @@ struct __log {
|
||||
|
||||
SH_TAILQ_HEAD(__fq) fq; /* List of file names. */
|
||||
|
||||
/*
|
||||
* The lsn LSN is the file offset that we're about to write and which
|
||||
* we will return to the user.
|
||||
*/
|
||||
DB_LSN lsn; /* LSN at current file offset. */
|
||||
DB_LSN c_lsn; /* LSN of the last checkpoint. */
|
||||
|
||||
/*
|
||||
* The s_lsn LSN is the last LSN that we know is on disk, not just
|
||||
* written, by synced.
|
||||
*/
|
||||
DB_LSN s_lsn; /* LSN of the last sync. */
|
||||
DB_LSN uw_lsn; /* LSN of 1st rec not fully on disk. */
|
||||
|
||||
u_int32_t len; /* Length of the last record. */
|
||||
|
||||
size_t b_off; /* Current offset in the buffer. */
|
||||
u_int32_t w_off; /* Current write offset in the file. */
|
||||
|
||||
DB_LSN c_lsn; /* LSN of the last checkpoint. */
|
||||
time_t chkpt; /* Time of the last checkpoint. */
|
||||
|
||||
DB_LOG_STAT stat; /* Log statistics. */
|
||||
|
||||
/*
|
||||
* The f_lsn LSN is the LSN (returned to the user) that "owns" the
|
||||
* first byte of the buffer. If the record associated with the LSN
|
||||
* spans buffers, it may not reflect the physical file location of
|
||||
* the first byte of the buffer.
|
||||
*/
|
||||
DB_LSN f_lsn; /* LSN of first byte in the buffer. */
|
||||
size_t b_off; /* Current offset in the buffer. */
|
||||
u_int8_t buf[4 * 1024]; /* Log buffer. */
|
||||
};
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Copyright (c) 1996, 1997
|
||||
* Sleepycat Software. All rights reserved.
|
||||
*
|
||||
* @(#)mp.h 10.19 (Sleepycat) 10/25/97
|
||||
* @(#)mp.h 10.22 (Sleepycat) 11/28/97
|
||||
*/
|
||||
|
||||
struct __bh; typedef struct __bh BH;
|
||||
@ -23,7 +23,6 @@ struct __mpoolfile; typedef struct __mpoolfile MPOOLFILE;
|
||||
#define DB_CACHESIZE_MIN ( 20 * 1024)
|
||||
|
||||
#define INVALID 0 /* Invalid shared memory offset. */
|
||||
#define TEMPORARY "<tmp>" /* Temporary file name. */
|
||||
|
||||
/*
|
||||
* There are three ways we do locking in the mpool code:
|
||||
@ -122,10 +121,10 @@ struct __db_mpool {
|
||||
|
||||
int fd; /* Underlying mmap'd fd. */
|
||||
|
||||
|
||||
#define MP_ISPRIVATE 0x01 /* Private, so local memory. */
|
||||
#define MP_LOCKHANDLE 0x02 /* Threaded, lock handles and region. */
|
||||
#define MP_LOCKREGION 0x04 /* Concurrent access, lock region. */
|
||||
#define MP_MALLOC 0x08 /* If region in allocated memory. */
|
||||
u_int32_t flags;
|
||||
};
|
||||
|
||||
@ -157,7 +156,6 @@ struct __db_mpoolfile {
|
||||
/* These fields are not protected. */
|
||||
TAILQ_ENTRY(__db_mpoolfile) q; /* Linked list of DB_MPOOLFILE's. */
|
||||
|
||||
char *path; /* Initial file path. */
|
||||
DB_MPOOL *dbmp; /* Overlying DB_MPOOL. */
|
||||
MPOOLFILE *mfp; /* Underlying MPOOLFILE. */
|
||||
|
||||
@ -165,11 +163,9 @@ struct __db_mpoolfile {
|
||||
size_t len; /* Length of mmap'd region. */
|
||||
|
||||
/* These fields need to be protected for multi-threaded support. */
|
||||
#define MP_PATH_ALLOC 0x001 /* Path is allocated memory. */
|
||||
#define MP_PATH_TEMP 0x002 /* Backing file is a temporary. */
|
||||
#define MP_READONLY 0x004 /* File is readonly. */
|
||||
#define MP_UPGRADE 0x008 /* File descriptor is readwrite. */
|
||||
#define MP_UPGRADE_FAIL 0x010 /* Upgrade wasn't possible. */
|
||||
#define MP_READONLY 0x01 /* File is readonly. */
|
||||
#define MP_UPGRADE 0x02 /* File descriptor is readwrite. */
|
||||
#define MP_UPGRADE_FAIL 0x04 /* Upgrade wasn't possible. */
|
||||
u_int32_t flags;
|
||||
};
|
||||
|
||||
@ -220,12 +216,9 @@ struct __mpoolfile {
|
||||
u_int32_t ref; /* Reference count. */
|
||||
|
||||
int ftype; /* File type. */
|
||||
int can_mmap; /* If the file can be mmap'd. */
|
||||
|
||||
int lsn_off; /* Page's LSN offset. */
|
||||
|
||||
size_t path_off; /* File name location. */
|
||||
|
||||
size_t fileid_off; /* File identification location. */
|
||||
|
||||
size_t pgcookie_len; /* Pgin/pgout cookie length. */
|
||||
@ -233,6 +226,12 @@ struct __mpoolfile {
|
||||
|
||||
int lsn_cnt; /* Checkpoint buffers left to write. */
|
||||
|
||||
db_pgno_t last_pgno; /* Last page in the file. */
|
||||
|
||||
#define MP_CAN_MMAP 0x01 /* If the file can be mmap'd. */
|
||||
#define MP_TEMP 0x02 /* Backing file is a temporary. */
|
||||
u_int32_t flags;
|
||||
|
||||
DB_MPOOL_FSTAT stat; /* Per-file mpool statistics. */
|
||||
};
|
||||
|
||||
|
@ -5,8 +5,10 @@ int __memp_pgread __P((DB_MPOOLFILE *, BH *, int));
|
||||
int __memp_pgwrite __P((DB_MPOOLFILE *, BH *, int *, int *));
|
||||
int __memp_pg __P((DB_MPOOLFILE *, BH *, int));
|
||||
void __memp_bhfree __P((DB_MPOOL *, MPOOLFILE *, BH *, int));
|
||||
int __memp_fopen __P((DB_MPOOL *, const char *, int, int,
|
||||
int, size_t, int, DBT *, u_int8_t *, int, DB_MPOOLFILE **));
|
||||
int __memp_fopen __P((DB_MPOOL *, MPOOLFILE *, const char *, int,
|
||||
int, int, size_t, int, DBT *, u_int8_t *, int, DB_MPOOLFILE **));
|
||||
char * __memp_fn __P((DB_MPOOLFILE *));
|
||||
char * __memp_fns __P((DB_MPOOL *, MPOOLFILE *));
|
||||
void __memp_debug __P((DB_MPOOL *, FILE *, int));
|
||||
int __memp_ralloc __P((DB_MPOOL *, size_t, size_t *, void *));
|
||||
int __memp_ropen
|
||||
|
@ -1,5 +1,8 @@
|
||||
/* DO NOT EDIT: automatically built by dist/distrib. */
|
||||
int __db_abspath __P((const char *));
|
||||
void *__db_calloc __P((size_t, size_t));
|
||||
void *__db_malloc __P((size_t));
|
||||
void *__db_realloc __P((void *, size_t));
|
||||
int __os_dirlist __P((const char *, char ***, int *));
|
||||
void __os_dirfree __P((char **, int));
|
||||
int __db_fileid __P((DB_ENV *, const char *, int, u_int8_t *));
|
||||
@ -14,6 +17,7 @@ int __db_read __P((int, void *, size_t, ssize_t *));
|
||||
int __db_write __P((int, void *, size_t, ssize_t *));
|
||||
int __os_seek __P((int, size_t, db_pgno_t, u_long, int));
|
||||
int __os_sleep __P((u_long, u_long));
|
||||
int __os_spin __P((void));
|
||||
int __os_exists __P((const char *, int *));
|
||||
int __os_ioinfo __P((const char *, int, off_t *, off_t *));
|
||||
int __db_unlink __P((const char *));
|
||||
|
@ -4,12 +4,11 @@
|
||||
* Copyright (c) 1997
|
||||
* Sleepycat Software. All rights reserved.
|
||||
*
|
||||
* @(#)os_func.h 10.2 (Sleepycat) 10/28/97
|
||||
* @(#)os_func.h 10.4 (Sleepycat) 11/28/97
|
||||
*/
|
||||
|
||||
/* Calls which can be replaced by the application. */
|
||||
struct __db_jumptab {
|
||||
void *(*db_calloc) __P((size_t, size_t)); /* DB_FUNC_CALLOC */
|
||||
int (*db_close) __P((int)); /* DB_FUNC_CLOSE */
|
||||
void (*db_dirfree) __P((char **, int)); /* DB_FUNC_DIRFREE */
|
||||
int (*db_dirlist) /* DB_FUNC_DIRLIST */
|
||||
@ -54,7 +53,6 @@ extern struct __db_jumptab __db_jump;
|
||||
* part of DB is the only code that should use the __os_XXX names, all other
|
||||
* parts of DB should be calling __db_XXX functions.
|
||||
*/
|
||||
#define __db_calloc __db_jump.db_calloc
|
||||
#define __os_close __db_jump.db_close /* __db_close is a wrapper. */
|
||||
#define __db_dirfree __db_jump.db_dirfree
|
||||
#define __db_dirlist __db_jump.db_dirlist
|
||||
@ -62,11 +60,9 @@ extern struct __db_jumptab __db_jump;
|
||||
#define __db_free __db_jump.db_free
|
||||
#define __os_fsync __db_jump.db_fsync /* __db_fsync is a wrapper. */
|
||||
#define __db_ioinfo __db_jump.db_ioinfo
|
||||
#define __db_malloc __db_jump.db_malloc
|
||||
#define __db_map __db_jump.db_map
|
||||
#define __os_open __db_jump.db_open /* __db_open is a wrapper. */
|
||||
#define __os_read __db_jump.db_read /* __db_read is a wrapper. */
|
||||
#define __db_realloc __db_jump.db_realloc
|
||||
#define __db_seek __db_jump.db_seek
|
||||
#define __db_sleep __db_jump.db_sleep
|
||||
#define __db_strdup __db_jump.db_strdup
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)lock.c 10.38 (Sleepycat) 10/25/97";
|
||||
static const char sccsid[] = "@(#)lock.c 10.41 (Sleepycat) 11/28/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -91,7 +91,7 @@ __lock_create(path, mode, dbenv)
|
||||
if ((ret =
|
||||
__db_rcreate(dbenv, DB_APP_NONE, path, DB_DEFAULT_LOCK_FILE, mode,
|
||||
LOCK_REGION_SIZE(lock_modes, maxlocks, __db_tablesize(maxlocks)),
|
||||
&fd, &lrp)) != 0)
|
||||
0, &fd, &lrp)) != 0)
|
||||
return (ret);
|
||||
|
||||
/* Region exists; now initialize it. */
|
||||
@ -600,7 +600,9 @@ __lock_put_internal(lt, lockp, do_all)
|
||||
if (SH_TAILQ_FIRST(&sh_obj->holders, __db_lock) == NULL) {
|
||||
HASHREMOVE_EL(lt->hashtab, __db_lockobj,
|
||||
links, sh_obj, lt->region->table_size, __lock_lhash);
|
||||
__db_shalloc_free(lt->mem, SH_DBT_PTR(&sh_obj->lockobj));
|
||||
if (sh_obj->lockobj.size > sizeof(sh_obj->objdata))
|
||||
__db_shalloc_free(lt->mem,
|
||||
SH_DBT_PTR(&sh_obj->lockobj));
|
||||
SH_TAILQ_INSERT_HEAD(<->region->free_objs, sh_obj, links,
|
||||
__db_lockobj);
|
||||
state_changed = 1;
|
||||
@ -633,7 +635,7 @@ __lock_get_internal(lt, locker, flags, obj, lock_mode, lockp)
|
||||
DB_LOCKOBJ *sh_obj, *sh_locker;
|
||||
DB_LOCKREGION *lrp;
|
||||
size_t newl_off;
|
||||
int ret;
|
||||
int ihold, ret;
|
||||
|
||||
ret = 0;
|
||||
/*
|
||||
@ -680,29 +682,40 @@ __lock_get_internal(lt, locker, flags, obj, lock_mode, lockp)
|
||||
* new lock if it does not conflict with anyone on the holders list
|
||||
* OR anyone on the waiters list. The reason that we don't grant if
|
||||
* there's a conflict is that this can lead to starvation (a writer
|
||||
* waiting on a popularly read item will never ben granted). The
|
||||
* waiting on a popularly read item will never be granted). The
|
||||
* downside of this is that a waiting reader can prevent an upgrade
|
||||
* from reader to writer, which is not uncommon. In case of conflict,
|
||||
* we put the new lock on the end of the waiters list.
|
||||
* from reader to writer, which is not uncommon.
|
||||
*
|
||||
* There is one exception to the no-conflict rule. If a lock is held
|
||||
* by the requesting locker AND the new lock does not conflict with
|
||||
* any other holders, then we grant the lock. The most common place
|
||||
* this happens is when the holder has a WRITE lock and a READ lock
|
||||
* request comes in for the same locker. If we do not grant the read
|
||||
* lock, then we guarantee deadlock.
|
||||
*
|
||||
* In case of conflict, we put the new lock on the end of the waiters
|
||||
* list.
|
||||
*/
|
||||
ihold = 0;
|
||||
for (lp = SH_TAILQ_FIRST(&sh_obj->holders, __db_lock);
|
||||
lp != NULL;
|
||||
lp = SH_TAILQ_NEXT(lp, links, __db_lock)) {
|
||||
if (CONFLICTS(lt, lp->mode, lock_mode) &&
|
||||
locker != lp->holder)
|
||||
if (locker == lp->holder) {
|
||||
if (lp->mode == lock_mode &&
|
||||
lp->status == DB_LSTAT_HELD) {
|
||||
/* Lock is held, just inc the ref count. */
|
||||
lp->refcount++;
|
||||
SH_TAILQ_INSERT_HEAD(&lrp->free_locks,
|
||||
newl, links, __db_lock);
|
||||
*lockp = lp;
|
||||
return (0);
|
||||
} else
|
||||
ihold = 1;
|
||||
} else if (CONFLICTS(lt, lp->mode, lock_mode))
|
||||
break;
|
||||
else if (lp->holder == locker && lp->mode == lock_mode &&
|
||||
lp->status == DB_LSTAT_HELD) {
|
||||
/* Lock is already held, just inc the ref count. */
|
||||
lp->refcount++;
|
||||
SH_TAILQ_INSERT_HEAD(&lrp->free_locks, newl, links,
|
||||
__db_lock);
|
||||
*lockp = lp;
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
if (lp == NULL)
|
||||
if (lp == NULL && !ihold)
|
||||
for (lp = SH_TAILQ_FIRST(&sh_obj->waiters, __db_lock);
|
||||
lp != NULL;
|
||||
lp = SH_TAILQ_NEXT(lp, links, __db_lock)) {
|
||||
@ -1261,25 +1274,37 @@ __lock_getobj(lt, locker, dbt, type, objp)
|
||||
*/
|
||||
if (sh_obj == NULL) {
|
||||
/* Create new object and then insert it into hash table. */
|
||||
if ((sh_obj = SH_TAILQ_FIRST(&lrp->free_objs, __db_lockobj))
|
||||
== NULL) {
|
||||
if ((sh_obj =
|
||||
SH_TAILQ_FIRST(&lrp->free_objs, __db_lockobj)) == NULL) {
|
||||
if ((ret = __lock_grow_region(lt, DB_LOCK_OBJ, 0)) != 0)
|
||||
return (ret);
|
||||
lrp = lt->region;
|
||||
sh_obj = SH_TAILQ_FIRST(&lrp->free_objs, __db_lockobj);
|
||||
}
|
||||
if ((ret = __db_shalloc(lt->mem, obj_size, 0, &p)) != 0) {
|
||||
if ((ret = __lock_grow_region(lt,
|
||||
DB_LOCK_MEM, obj_size)) != 0)
|
||||
return (ret);
|
||||
lrp = lt->region;
|
||||
/* Reacquire the head of the list. */
|
||||
sh_obj = SH_TAILQ_FIRST(&lrp->free_objs, __db_lockobj);
|
||||
(void)__db_shalloc(lt->mem, obj_size, 0, &p);
|
||||
}
|
||||
sh_obj->type = type;
|
||||
|
||||
/*
|
||||
* If we can fit this object in the structure, do so instead
|
||||
* of shalloc-ing space for it.
|
||||
*/
|
||||
if (obj_size <= sizeof(sh_obj->objdata))
|
||||
p = sh_obj->objdata;
|
||||
else
|
||||
if ((ret =
|
||||
__db_shalloc(lt->mem, obj_size, 0, &p)) != 0) {
|
||||
if ((ret = __lock_grow_region(lt,
|
||||
DB_LOCK_MEM, obj_size)) != 0)
|
||||
return (ret);
|
||||
lrp = lt->region;
|
||||
/* Reacquire the head of the list. */
|
||||
sh_obj = SH_TAILQ_FIRST(&lrp->free_objs,
|
||||
__db_lockobj);
|
||||
(void)__db_shalloc(lt->mem, obj_size, 0, &p);
|
||||
}
|
||||
|
||||
src = type == DB_LOCK_OBJTYPE ? dbt->data : (void *)&locker;
|
||||
memcpy(p, src, obj_size);
|
||||
|
||||
sh_obj->type = type;
|
||||
SH_TAILQ_REMOVE(&lrp->free_objs, sh_obj, links, __db_lockobj);
|
||||
|
||||
SH_TAILQ_INIT(&sh_obj->waiters);
|
||||
@ -1329,7 +1354,8 @@ __lock_freeobj(lt, obj)
|
||||
{
|
||||
HASHREMOVE_EL(lt->hashtab,
|
||||
__db_lockobj, links, obj, lt->region->table_size, __lock_lhash);
|
||||
__db_shalloc_free(lt->mem, SH_DBT_PTR(&obj->lockobj));
|
||||
if (obj->lockobj.size > sizeof(obj->objdata))
|
||||
__db_shalloc_free(lt->mem, SH_DBT_PTR(&obj->lockobj));
|
||||
SH_TAILQ_INSERT_HEAD(<->region->free_objs, obj, links, __db_lockobj);
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
static const char copyright[] =
|
||||
"@(#) Copyright (c) 1997\n\
|
||||
Sleepycat Software Inc. All rights reserved.\n";
|
||||
static const char sccsid[] = "@(#)lock_deadlock.c 10.25 (Sleepycat) 11/1/97";
|
||||
static const char sccsid[] = "@(#)lock_deadlock.c 10.26 (Sleepycat) 11/25/97";
|
||||
#endif
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -66,8 +66,7 @@ static void __dd_debug __P((DB_ENV *, locker_info *, u_int32_t *, u_int32_t));
|
||||
int
|
||||
lock_detect(lt, flags, atype)
|
||||
DB_LOCKTAB *lt;
|
||||
int flags;
|
||||
u_int32_t atype;
|
||||
int flags, atype;
|
||||
{
|
||||
DB_ENV *dbenv;
|
||||
locker_info *idmap;
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)log.c 10.33 (Sleepycat) 11/2/97";
|
||||
static const char sccsid[] = "@(#)log.c 10.34 (Sleepycat) 11/28/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -91,7 +91,7 @@ log_open(path, flags, mode, dbenv, lpp)
|
||||
retry_cnt = newregion = 0;
|
||||
retry: if (LF_ISSET(DB_CREATE)) {
|
||||
ret = __db_rcreate(dbenv, DB_APP_LOG, path,
|
||||
DB_DEFAULT_LOG_FILE, mode, len, &fd, &dblp->maddr);
|
||||
DB_DEFAULT_LOG_FILE, mode, len, 0, &fd, &dblp->maddr);
|
||||
if (ret == 0) {
|
||||
/* Put the LOG structure first in the region. */
|
||||
lp = dblp->maddr;
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)log_archive.c 10.28 (Sleepycat) 10/28/97";
|
||||
static const char sccsid[] = "@(#)log_archive.c 10.29 (Sleepycat) 11/12/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -360,9 +360,9 @@ __absname(pref, name, newnamep)
|
||||
* If the user has their own malloc routine, use it.
|
||||
*/
|
||||
static int
|
||||
__usermem(listp, func)
|
||||
__usermem(listp, cmpfunc)
|
||||
char ***listp;
|
||||
void *(*func) __P((size_t));
|
||||
void *(*cmpfunc) __P((size_t));
|
||||
{
|
||||
size_t len;
|
||||
char **array, **arrayp, **orig, *strp;
|
||||
@ -378,10 +378,10 @@ __usermem(listp, func)
|
||||
* XXX
|
||||
* Don't simplify this expression, SunOS compilers don't like it.
|
||||
*/
|
||||
if (func == NULL)
|
||||
if (cmpfunc == NULL)
|
||||
array = (char **)__db_malloc(len);
|
||||
else
|
||||
array = (char **)func(len);
|
||||
array = (char **)cmpfunc(len);
|
||||
if (array == NULL)
|
||||
return (ENOMEM);
|
||||
strp = (char *)(array + (orig - *listp) + 1);
|
||||
|
@ -102,7 +102,6 @@ int __log_register_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __log_register_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__log_register_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -250,7 +249,6 @@ int __log_unregister_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __log_unregister_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__log_unregister_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)log_get.c 10.21 (Sleepycat) 10/25/97";
|
||||
static const char sccsid[] = "@(#)log_get.c 10.22 (Sleepycat) 11/22/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -44,24 +44,21 @@ log_get(dblp, alsn, dbt, flags)
|
||||
/* Validate arguments. */
|
||||
#define OKFLAGS (DB_CHECKPOINT | \
|
||||
DB_CURRENT | DB_FIRST | DB_LAST | DB_NEXT | DB_PREV | DB_SET)
|
||||
if (flags != 0) {
|
||||
if ((ret =
|
||||
__db_fchk(dblp->dbenv, "log_get", flags, OKFLAGS)) != 0)
|
||||
return (ret);
|
||||
switch (flags) {
|
||||
case DB_CHECKPOINT:
|
||||
case DB_CURRENT:
|
||||
case DB_FIRST:
|
||||
case DB_LAST:
|
||||
case DB_NEXT:
|
||||
case DB_PREV:
|
||||
case DB_SET:
|
||||
case 0:
|
||||
break;
|
||||
default:
|
||||
return (__db_ferr(dblp->dbenv, "log_get", 1));
|
||||
}
|
||||
if ((ret = __db_fchk(dblp->dbenv, "log_get", flags, OKFLAGS)) != 0)
|
||||
return (ret);
|
||||
switch (flags) {
|
||||
case DB_CHECKPOINT:
|
||||
case DB_CURRENT:
|
||||
case DB_FIRST:
|
||||
case DB_LAST:
|
||||
case DB_NEXT:
|
||||
case DB_PREV:
|
||||
case DB_SET:
|
||||
break;
|
||||
default:
|
||||
return (__db_ferr(dblp->dbenv, "log_get", 1));
|
||||
}
|
||||
|
||||
if (F_ISSET(dblp, DB_AM_THREAD)) {
|
||||
if (LF_ISSET(DB_NEXT | DB_PREV | DB_CURRENT))
|
||||
return (__db_ferr(dblp->dbenv, "log_get", 1));
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)log_put.c 10.20 (Sleepycat) 11/2/97";
|
||||
static const char sccsid[] = "@(#)log_put.c 10.22 (Sleepycat) 11/12/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -28,10 +28,10 @@ static const char sccsid[] = "@(#)log_put.c 10.20 (Sleepycat) 11/2/97";
|
||||
#include "hash.h"
|
||||
#include "common_ext.h"
|
||||
|
||||
static int __log_fill __P((DB_LOG *, void *, u_int32_t));
|
||||
static int __log_fill __P((DB_LOG *, DB_LSN *, void *, u_int32_t));
|
||||
static int __log_flush __P((DB_LOG *, const DB_LSN *));
|
||||
static int __log_newfd __P((DB_LOG *));
|
||||
static int __log_putr __P((DB_LOG *, const DBT *, u_int32_t));
|
||||
static int __log_putr __P((DB_LOG *, DB_LSN *, const DBT *, u_int32_t));
|
||||
static int __log_write __P((DB_LOG *, void *, u_int32_t));
|
||||
|
||||
/*
|
||||
@ -117,12 +117,13 @@ __log_put(dblp, lsn, dbt, flags)
|
||||
|
||||
/* Reset the file write offset. */
|
||||
lp->w_off = 0;
|
||||
|
||||
/* Reset the first-unwritten LSN for the buffer. */
|
||||
lp->uw_lsn = lp->lsn;
|
||||
} else
|
||||
lastoff = 0;
|
||||
|
||||
/* Initialize the LSN information returned to the user. */
|
||||
lsn->file = lp->lsn.file;
|
||||
lsn->offset = lp->lsn.offset;
|
||||
|
||||
/*
|
||||
* Insert persistent information as the first record in every file.
|
||||
* Note that the previous length is wrong for the very first record
|
||||
@ -131,17 +132,17 @@ __log_put(dblp, lsn, dbt, flags)
|
||||
if (lp->lsn.offset == 0) {
|
||||
t.data = &lp->persist;
|
||||
t.size = sizeof(LOGP);
|
||||
if ((ret = __log_putr(dblp,
|
||||
if ((ret = __log_putr(dblp, lsn,
|
||||
&t, lastoff == 0 ? 0 : lastoff - lp->len)) != 0)
|
||||
return (ret);
|
||||
|
||||
/* Update the LSN information returned to the user. */
|
||||
lsn->file = lp->lsn.file;
|
||||
lsn->offset = lp->lsn.offset;
|
||||
}
|
||||
|
||||
/* Initialize the LSN information returned to the user. */
|
||||
lsn->file = lp->lsn.file;
|
||||
lsn->offset = lp->lsn.offset;
|
||||
|
||||
/* Put out the user's record. */
|
||||
if ((ret = __log_putr(dblp, dbt, lp->lsn.offset - lp->len)) != 0)
|
||||
/* Write the application's log record. */
|
||||
if ((ret = __log_putr(dblp, lsn, dbt, lp->lsn.offset - lp->len)) != 0)
|
||||
return (ret);
|
||||
|
||||
/*
|
||||
@ -184,19 +185,6 @@ __log_put(dblp, lsn, dbt, flags)
|
||||
(void)time(&lp->chkpt);
|
||||
lp->stat.st_wc_bytes = lp->stat.st_wc_mbytes = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* When an application calls the log_flush routine, we need to figure
|
||||
* out if the current buffer needs to be flushed. The problem is that
|
||||
* if a record spans buffers, it's possible for the record continued
|
||||
* in the current buffer to have begun in a previous buffer. Each time
|
||||
* we write a buffer, we update the first-unwritten LSN to point to the
|
||||
* first LSN after that written buffer. If we have a spanning record,
|
||||
* correct that value to be the LSN that started it all, here.
|
||||
*/
|
||||
if (lsn->offset < lp->w_off && lsn->offset + lp->len > lp->w_off)
|
||||
lp->uw_lsn = *lsn;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -205,8 +193,9 @@ __log_put(dblp, lsn, dbt, flags)
|
||||
* Actually put a record into the log.
|
||||
*/
|
||||
static int
|
||||
__log_putr(dblp, dbt, prev)
|
||||
__log_putr(dblp, lsn, dbt, prev)
|
||||
DB_LOG *dblp;
|
||||
DB_LSN *lsn;
|
||||
const DBT *dbt;
|
||||
u_int32_t prev;
|
||||
{
|
||||
@ -225,15 +214,15 @@ __log_putr(dblp, dbt, prev)
|
||||
hdr.len = sizeof(HDR) + dbt->size;
|
||||
hdr.cksum = __ham_func4(dbt->data, dbt->size);
|
||||
|
||||
if ((ret = __log_fill(dblp, &hdr, sizeof(HDR))) != 0)
|
||||
if ((ret = __log_fill(dblp, lsn, &hdr, sizeof(HDR))) != 0)
|
||||
return (ret);
|
||||
lp->len = sizeof(HDR);
|
||||
lp->lsn.offset += sizeof(HDR);
|
||||
|
||||
if ((ret = __log_fill(dblp, dbt->data, dbt->size)) != 0)
|
||||
if ((ret = __log_fill(dblp, lsn, dbt->data, dbt->size)) != 0)
|
||||
return (ret);
|
||||
lp->len += dbt->size;
|
||||
lp->lsn.offset += dbt->size;
|
||||
|
||||
lp->len = sizeof(HDR) + dbt->size;
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -266,7 +255,7 @@ __log_flush(dblp, lsn)
|
||||
{
|
||||
DB_LSN t_lsn;
|
||||
LOG *lp;
|
||||
int ret;
|
||||
int current, ret;
|
||||
|
||||
ret = 0;
|
||||
lp = dblp->lp;
|
||||
@ -292,23 +281,27 @@ __log_flush(dblp, lsn)
|
||||
/*
|
||||
* If the LSN is less than the last-sync'd LSN, we're done. Note,
|
||||
* the last-sync LSN saved in s_lsn is the LSN of the first byte
|
||||
* that has not yet been written to disk, so the test is <, not <=.
|
||||
* we absolutely know has been written to disk, so the test is <=.
|
||||
*/
|
||||
if (lsn->file < lp->s_lsn.file ||
|
||||
(lsn->file == lp->s_lsn.file && lsn->offset < lp->s_lsn.offset))
|
||||
(lsn->file == lp->s_lsn.file && lsn->offset <= lp->s_lsn.offset))
|
||||
return (0);
|
||||
|
||||
/*
|
||||
* We may need to write the current buffer. We have to write the
|
||||
* current buffer if the flush LSN is greater than or equal to the
|
||||
* first-unwritten LSN (uw_lsn). If we write the buffer, then we
|
||||
* update the first-unwritten LSN.
|
||||
* buffer's starting LSN.
|
||||
*/
|
||||
current = 0;
|
||||
if (lp->b_off != 0 &&
|
||||
lsn->file >= lp->uw_lsn.file && lsn->offset >= lp->uw_lsn.offset)
|
||||
lsn->file >= lp->f_lsn.file && lsn->offset >= lp->f_lsn.offset) {
|
||||
if ((ret = __log_write(dblp, lp->buf, lp->b_off)) != 0)
|
||||
return (ret);
|
||||
|
||||
lp->b_off = 0;
|
||||
current = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* It's possible that this thread may never have written to this log
|
||||
* file. Acquire a file descriptor if we don't already have one.
|
||||
@ -323,10 +316,14 @@ __log_flush(dblp, lsn)
|
||||
++lp->stat.st_scount;
|
||||
|
||||
/*
|
||||
* Set the last-synced LSN, the first LSN after the last record
|
||||
* that we know is on disk.
|
||||
* Set the last-synced LSN, using the LSN of the current buffer. If
|
||||
* the current buffer was flushed, we know the LSN of the first byte
|
||||
* of the buffer is on disk, otherwise, we only know that the LSN of
|
||||
* the record before the one beginning the current buffer is on disk.
|
||||
*/
|
||||
lp->s_lsn = lp->uw_lsn;
|
||||
lp->s_lsn = lp->f_lsn;
|
||||
if (!current)
|
||||
--lp->s_lsn.offset;
|
||||
|
||||
return (0);
|
||||
}
|
||||
@ -336,8 +333,9 @@ __log_flush(dblp, lsn)
|
||||
* Write information into the log.
|
||||
*/
|
||||
static int
|
||||
__log_fill(dblp, addr, len)
|
||||
__log_fill(dblp, lsn, addr, len)
|
||||
DB_LOG *dblp;
|
||||
DB_LSN *lsn;
|
||||
void *addr;
|
||||
u_int32_t len;
|
||||
{
|
||||
@ -348,6 +346,15 @@ __log_fill(dblp, addr, len)
|
||||
|
||||
/* Copy out the data. */
|
||||
for (lp = dblp->lp; len > 0;) {
|
||||
/*
|
||||
* If we're beginning a new buffer, note the user LSN to which
|
||||
* the first byte of the buffer belongs. We have to know this
|
||||
* when flushing the buffer so that we know if the in-memory
|
||||
* buffer needs to be flushed.
|
||||
*/
|
||||
if (lp->b_off == 0)
|
||||
lp->f_lsn = *lsn;
|
||||
|
||||
/*
|
||||
* If we're on a buffer boundary and the data is big enough,
|
||||
* copy as many records as we can directly from the data.
|
||||
@ -371,9 +378,12 @@ __log_fill(dblp, addr, len)
|
||||
lp->b_off += nw;
|
||||
|
||||
/* If we fill the buffer, flush it. */
|
||||
if (lp->b_off == sizeof(lp->buf) &&
|
||||
(ret = __log_write(dblp, lp->buf, sizeof(lp->buf))) != 0)
|
||||
return (ret);
|
||||
if (lp->b_off == sizeof(lp->buf)) {
|
||||
if ((ret =
|
||||
__log_write(dblp, lp->buf, sizeof(lp->buf))) != 0)
|
||||
return (ret);
|
||||
lp->b_off = 0;
|
||||
}
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
@ -412,14 +422,8 @@ __log_write(dblp, addr, len)
|
||||
if (nw != (int32_t)len)
|
||||
return (EIO);
|
||||
|
||||
/*
|
||||
* Reset the buffer offset, update the seek offset, and update the
|
||||
* first-unwritten LSN.
|
||||
*/
|
||||
lp->b_off = 0;
|
||||
/* Reset the buffer offset and update the seek offset. */
|
||||
lp->w_off += len;
|
||||
lp->uw_lsn.file = lp->lsn.file;
|
||||
lp->uw_lsn.offset = lp->w_off;
|
||||
|
||||
/* Update written statistics. */
|
||||
if ((lp->stat.st_w_bytes += len) >= MEGABYTE) {
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)mp_bh.c 10.21 (Sleepycat) 10/25/97";
|
||||
static const char sccsid[] = "@(#)mp_bh.c 10.23 (Sleepycat) 11/26/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -40,7 +40,6 @@ __memp_bhwrite(dbmp, mfp, bhp, restartp, wrotep)
|
||||
BH *bhp;
|
||||
int *restartp, *wrotep;
|
||||
{
|
||||
DBT dbt;
|
||||
DB_MPOOLFILE *dbmfp;
|
||||
DB_MPREG *mpreg;
|
||||
|
||||
@ -53,7 +52,7 @@ __memp_bhwrite(dbmp, mfp, bhp, restartp, wrotep)
|
||||
* Walk the process' DB_MPOOLFILE list and find a file descriptor for
|
||||
* the file. We also check that the descriptor is open for writing.
|
||||
* If we find a descriptor on the file that's not open for writing, we
|
||||
* try and upgrade it to make it writeable.
|
||||
* try and upgrade it to make it writeable. If that fails, we're done.
|
||||
*/
|
||||
LOCKHANDLE(dbmp, dbmp->mutexp);
|
||||
for (dbmfp = TAILQ_FIRST(&dbmp->dbmfq);
|
||||
@ -86,18 +85,34 @@ __memp_bhwrite(dbmp, mfp, bhp, restartp, wrotep)
|
||||
}
|
||||
|
||||
/*
|
||||
* Try and open the file; ignore any error, assume it's a permissions
|
||||
* problem.
|
||||
* Try and open the file, attaching to the underlying shared area.
|
||||
*
|
||||
* XXX
|
||||
* There's no negative cache here, so we may repeatedly try and open
|
||||
* files that we have previously tried (and failed) to open.
|
||||
* Don't try to attach to temporary files. There are two problems in
|
||||
* trying to do that. First, if we have different privileges than the
|
||||
* process that "owns" the temporary file, we might create the backing
|
||||
* disk file such that the owning process couldn't read/write its own
|
||||
* buffers, e.g., memp_trickle() running as root creating a file owned
|
||||
* as root, mode 600. Second, if the temporary file has already been
|
||||
* created, we don't have any way of finding out what its real name is,
|
||||
* and, even if we did, it was already unlinked (so that it won't be
|
||||
* left if the process dies horribly). This decision causes a problem,
|
||||
* however: if the temporary file consumes the entire buffer cache,
|
||||
* and the owner doesn't flush the buffers to disk, we could end up
|
||||
* with resource starvation, and the memp_trickle() thread couldn't do
|
||||
* anything about it. That's a pretty unlikely scenario, though.
|
||||
*
|
||||
* XXX
|
||||
* There's no negative cache, so we may repeatedly try and open files
|
||||
* that we have previously tried (and failed) to open.
|
||||
*
|
||||
* Ignore any error, assume it's a permissions problem.
|
||||
*/
|
||||
dbt.size = mfp->pgcookie_len;
|
||||
dbt.data = R_ADDR(dbmp, mfp->pgcookie_off);
|
||||
if (__memp_fopen(dbmp, R_ADDR(dbmp, mfp->path_off),
|
||||
mfp->ftype, 0, 0, mfp->stat.st_pagesize,
|
||||
mfp->lsn_off, &dbt, R_ADDR(dbmp, mfp->fileid_off), 0, &dbmfp) != 0)
|
||||
if (F_ISSET(mfp, MP_TEMP))
|
||||
return (0);
|
||||
|
||||
if (__memp_fopen(dbmp, mfp, R_ADDR(dbmp, mfp->path_off), mfp->ftype,
|
||||
0, 0, mfp->stat.st_pagesize, 0, NULL, NULL, 0, &dbmfp) != 0)
|
||||
return (0);
|
||||
|
||||
found: return (__memp_pgwrite(dbmfp, bhp, restartp, wrotep));
|
||||
@ -144,7 +159,7 @@ __memp_pgread(dbmfp, bhp, can_create)
|
||||
UNLOCKHANDLE(dbmp, dbmfp->mutexp);
|
||||
__db_err(dbmp->dbenv,
|
||||
"%s: page %lu doesn't exist, create flag not set",
|
||||
dbmfp->path, (u_long)bhp->pgno);
|
||||
__memp_fn(dbmfp), (u_long)bhp->pgno);
|
||||
goto err;
|
||||
}
|
||||
UNLOCKHANDLE(dbmp, dbmfp->mutexp);
|
||||
@ -270,12 +285,14 @@ __memp_pgwrite(dbmfp, bhp, restartp, wrotep)
|
||||
|
||||
/* Temporary files may not yet have been created. */
|
||||
LOCKHANDLE(dbmp, dbmfp->mutexp);
|
||||
if (dbmfp->fd == -1 && ((ret = __db_appname(dbenv, DB_APP_TMP,
|
||||
NULL, NULL, &dbmfp->fd, NULL)) != 0 || dbmfp->fd == -1)) {
|
||||
UNLOCKHANDLE(dbmp, dbmfp->mutexp);
|
||||
__db_err(dbenv, "unable to create temporary backing file");
|
||||
goto err;
|
||||
}
|
||||
if (dbmfp->fd == -1)
|
||||
if ((ret = __db_appname(dbenv, DB_APP_TMP,
|
||||
NULL, NULL, &dbmfp->fd, NULL)) != 0 || dbmfp->fd == -1) {
|
||||
UNLOCKHANDLE(dbmp, dbmfp->mutexp);
|
||||
__db_err(dbenv,
|
||||
"unable to create temporary backing file");
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* Write the page out. */
|
||||
if ((ret = __db_seek(dbmfp->fd, pagesize, bhp->pgno, 0, SEEK_SET)) != 0)
|
||||
@ -350,8 +367,8 @@ __memp_pgwrite(dbmfp, bhp, restartp, wrotep)
|
||||
|
||||
return (0);
|
||||
|
||||
syserr: __db_err(dbenv,
|
||||
"%s: %s failed for page %lu", dbmfp->path, fail, (u_long)bhp->pgno);
|
||||
syserr: __db_err(dbenv, "%s: %s failed for page %lu",
|
||||
__memp_fn(dbmfp), fail, (u_long)bhp->pgno);
|
||||
|
||||
err: UNLOCKBUFFER(dbmp, bhp);
|
||||
LOCKREGION(dbmp);
|
||||
@ -416,7 +433,7 @@ __memp_pg(dbmfp, bhp, is_pgin)
|
||||
|
||||
err: UNLOCKHANDLE(dbmp, dbmp->mutexp);
|
||||
__db_err(dbmp->dbenv, "%s: %s failed for page %lu",
|
||||
dbmfp->path, is_pgin ? "pgin" : "pgout", (u_long)bhp->pgno);
|
||||
__memp_fn(dbmfp), is_pgin ? "pgin" : "pgout", (u_long)bhp->pgno);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
@ -462,7 +479,8 @@ __memp_upgrade(dbmp, dbmfp, mfp)
|
||||
DB_MPOOLFILE *dbmfp;
|
||||
MPOOLFILE *mfp;
|
||||
{
|
||||
int fd;
|
||||
int fd, ret;
|
||||
char *rpath;
|
||||
|
||||
/*
|
||||
* !!!
|
||||
@ -477,16 +495,24 @@ __memp_upgrade(dbmp, dbmfp, mfp)
|
||||
if (F_ISSET(dbmfp, MP_UPGRADE_FAIL))
|
||||
return (1);
|
||||
|
||||
/* Try the open. */
|
||||
if (__db_open(R_ADDR(dbmp, mfp->path_off), 0, 0, 0, &fd) != 0) {
|
||||
/*
|
||||
* Calculate the real name for this file and try to open it read/write.
|
||||
* We know we have a valid pathname for the file because it's the only
|
||||
* way we could have gotten a file descriptor of any kind.
|
||||
*/
|
||||
if ((ret = __db_appname(dbmp->dbenv, DB_APP_DATA,
|
||||
NULL, R_ADDR(dbmp, mfp->path_off), NULL, &rpath)) != 0)
|
||||
return (ret);
|
||||
if (__db_open(rpath, 0, 0, 0, &fd) != 0) {
|
||||
F_SET(dbmfp, MP_UPGRADE_FAIL);
|
||||
return (1);
|
||||
ret = 1;
|
||||
} else {
|
||||
/* Swap the descriptors and set the upgrade flag. */
|
||||
(void)__db_close(dbmfp->fd);
|
||||
dbmfp->fd = fd;
|
||||
F_SET(dbmfp, MP_UPGRADE);
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
/* Swap the descriptors and set the upgrade flag. */
|
||||
(void)__db_close(dbmfp->fd);
|
||||
dbmfp->fd = fd;
|
||||
F_SET(dbmfp, MP_UPGRADE);
|
||||
|
||||
return (0);
|
||||
FREES(rpath);
|
||||
return (ret);
|
||||
}
|
||||
|
114
db2/mp/mp_fget.c
114
db2/mp/mp_fget.c
@ -7,7 +7,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)mp_fget.c 10.30 (Sleepycat) 10/25/97";
|
||||
static const char sccsid[] = "@(#)mp_fget.c 10.32 (Sleepycat) 11/26/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -38,13 +38,11 @@ memp_fget(dbmfp, pgnoaddr, flags, addrp)
|
||||
int flags;
|
||||
void *addrp;
|
||||
{
|
||||
BH *bhp, *tbhp;
|
||||
BH *bhp;
|
||||
DB_MPOOL *dbmp;
|
||||
MPOOL *mp;
|
||||
MPOOLFILE *mfp;
|
||||
db_pgno_t lastpgno;
|
||||
size_t bucket, mf_offset;
|
||||
off_t size;
|
||||
u_long cnt;
|
||||
int b_incr, b_inserted, readonly_alloc, ret;
|
||||
void *addr;
|
||||
@ -97,7 +95,7 @@ memp_fget(dbmfp, pgnoaddr, flags, addrp)
|
||||
mf_offset = R_OFFSET(dbmp, mfp);
|
||||
addr = NULL;
|
||||
bhp = NULL;
|
||||
b_incr = b_inserted = readonly_alloc = ret = 0;
|
||||
b_incr = b_inserted = ret = 0;
|
||||
|
||||
LOCKREGION(dbmp);
|
||||
|
||||
@ -114,11 +112,10 @@ memp_fget(dbmfp, pgnoaddr, flags, addrp)
|
||||
* It would be possible to do so by reference counting the open
|
||||
* pages from the mmap, but it's unclear to me that it's worth it.
|
||||
*/
|
||||
if (dbmfp->addr != NULL && dbmfp->mfp->can_mmap) {
|
||||
lastpgno = dbmfp->len == 0 ?
|
||||
0 : (dbmfp->len - 1) / mfp->stat.st_pagesize;
|
||||
if (dbmfp->addr != NULL && F_ISSET(dbmfp->mfp, MP_CAN_MMAP)) {
|
||||
readonly_alloc = 0;
|
||||
if (LF_ISSET(DB_MPOOL_LAST))
|
||||
*pgnoaddr = lastpgno;
|
||||
*pgnoaddr = mfp->last_pgno;
|
||||
else {
|
||||
/*
|
||||
* !!!
|
||||
@ -128,10 +125,10 @@ memp_fget(dbmfp, pgnoaddr, flags, addrp)
|
||||
*/
|
||||
if (LF_ISSET(DB_MPOOL_CREATE | DB_MPOOL_NEW))
|
||||
readonly_alloc = 1;
|
||||
else if (*pgnoaddr > lastpgno) {
|
||||
else if (*pgnoaddr > mfp->last_pgno) {
|
||||
__db_err(dbmp->dbenv,
|
||||
"%s: page %lu doesn't exist",
|
||||
dbmfp->path, (u_long)*pgnoaddr);
|
||||
__memp_fn(dbmfp), (u_long)*pgnoaddr);
|
||||
ret = EINVAL;
|
||||
goto err;
|
||||
}
|
||||
@ -146,79 +143,38 @@ memp_fget(dbmfp, pgnoaddr, flags, addrp)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If requesting the last page or a new page, find the last page. The
|
||||
* tricky thing is that the user may have created a page already that's
|
||||
* after any page that exists in the file.
|
||||
*/
|
||||
if (LF_ISSET(DB_MPOOL_LAST | DB_MPOOL_NEW)) {
|
||||
/*
|
||||
* Temporary files may not yet have been created.
|
||||
*
|
||||
* Don't lock -- there are no atomicity issues for stat(2).
|
||||
*/
|
||||
if (dbmfp->fd == -1)
|
||||
size = 0;
|
||||
else if ((ret =
|
||||
__db_ioinfo(dbmfp->path, dbmfp->fd, &size, NULL)) != 0) {
|
||||
__db_err(dbmp->dbenv,
|
||||
"%s: %s", dbmfp->path, strerror(ret));
|
||||
goto err;
|
||||
}
|
||||
/* Check if requesting the last page or a new page. */
|
||||
if (LF_ISSET(DB_MPOOL_LAST))
|
||||
*pgnoaddr = mfp->last_pgno;
|
||||
|
||||
*pgnoaddr = size == 0 ? 0 : (size - 1) / mfp->stat.st_pagesize;
|
||||
|
||||
/*
|
||||
* Walk the list of BH's, looking for later pages. Save the
|
||||
* pointer if a later page is found so that we don't have to
|
||||
* search the list twice.
|
||||
*
|
||||
* If requesting a new page, return the page one after the last
|
||||
* page -- which we'll have to create.
|
||||
*/
|
||||
for (tbhp = SH_TAILQ_FIRST(&mp->bhq, __bh);
|
||||
tbhp != NULL; tbhp = SH_TAILQ_NEXT(tbhp, q, __bh))
|
||||
if (tbhp->pgno >= *pgnoaddr &&
|
||||
tbhp->mf_offset == mf_offset) {
|
||||
bhp = tbhp;
|
||||
*pgnoaddr = bhp->pgno;
|
||||
}
|
||||
if (LF_ISSET(DB_MPOOL_NEW))
|
||||
++*pgnoaddr;
|
||||
if (LF_ISSET(DB_MPOOL_NEW)) {
|
||||
*pgnoaddr = mfp->last_pgno + 1;
|
||||
goto alloc;
|
||||
}
|
||||
|
||||
/* If we already found the right buffer, return it. */
|
||||
if (LF_ISSET(DB_MPOOL_LAST) && bhp != NULL) {
|
||||
addr = bhp->buf;
|
||||
goto found;
|
||||
}
|
||||
|
||||
/* If we haven't checked the BH hash bucket queue, do the search. */
|
||||
if (!LF_ISSET(DB_MPOOL_LAST | DB_MPOOL_NEW)) {
|
||||
bucket = BUCKET(mp, mf_offset, *pgnoaddr);
|
||||
for (cnt = 0,
|
||||
bhp = SH_TAILQ_FIRST(&dbmp->htab[bucket], __bh);
|
||||
bhp != NULL; bhp = SH_TAILQ_NEXT(bhp, hq, __bh)) {
|
||||
++cnt;
|
||||
if (bhp->pgno == *pgnoaddr &&
|
||||
bhp->mf_offset == mf_offset) {
|
||||
addr = bhp->buf;
|
||||
++mp->stat.st_hash_searches;
|
||||
if (cnt > mp->stat.st_hash_longest)
|
||||
mp->stat.st_hash_longest = cnt;
|
||||
mp->stat.st_hash_examined += cnt;
|
||||
goto found;
|
||||
}
|
||||
}
|
||||
if (cnt != 0) {
|
||||
/* Check the BH hash bucket queue. */
|
||||
bucket = BUCKET(mp, mf_offset, *pgnoaddr);
|
||||
for (cnt = 0,
|
||||
bhp = SH_TAILQ_FIRST(&dbmp->htab[bucket], __bh);
|
||||
bhp != NULL; bhp = SH_TAILQ_NEXT(bhp, hq, __bh)) {
|
||||
++cnt;
|
||||
if (bhp->pgno == *pgnoaddr && bhp->mf_offset == mf_offset) {
|
||||
addr = bhp->buf;
|
||||
++mp->stat.st_hash_searches;
|
||||
if (cnt > mp->stat.st_hash_longest)
|
||||
mp->stat.st_hash_longest = cnt;
|
||||
mp->stat.st_hash_examined += cnt;
|
||||
goto found;
|
||||
}
|
||||
}
|
||||
if (cnt != 0) {
|
||||
++mp->stat.st_hash_searches;
|
||||
if (cnt > mp->stat.st_hash_longest)
|
||||
mp->stat.st_hash_longest = cnt;
|
||||
mp->stat.st_hash_examined += cnt;
|
||||
}
|
||||
|
||||
/*
|
||||
alloc: /*
|
||||
* Allocate a new buffer header and data space, and mark the contents
|
||||
* as useless.
|
||||
*/
|
||||
@ -300,7 +256,7 @@ found: /* Increment the reference count. */
|
||||
if (bhp->ref == UINT16_T_MAX) {
|
||||
__db_err(dbmp->dbenv,
|
||||
"%s: too many references to page %lu",
|
||||
dbmfp->path, bhp->pgno);
|
||||
__memp_fn(dbmfp), bhp->pgno);
|
||||
ret = EINVAL;
|
||||
goto err;
|
||||
}
|
||||
@ -346,6 +302,14 @@ found: /* Increment the reference count. */
|
||||
++mfp->stat.st_cache_hit;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we're returning a page after our current notion of the last-page,
|
||||
* update our information. Note, there's no way to un-instantiate this
|
||||
* page, it's going to exist whether it's returned to us dirty or not.
|
||||
*/
|
||||
if (bhp->pgno > mfp->last_pgno)
|
||||
mfp->last_pgno = bhp->pgno;
|
||||
|
||||
mapret: LOCKHANDLE(dbmp, dbmfp->mutexp);
|
||||
++dbmfp->pinref;
|
||||
UNLOCKHANDLE(dbmp, dbmfp->mutexp);
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)mp_fopen.c 10.30 (Sleepycat) 10/25/97";
|
||||
static const char sccsid[] = "@(#)mp_fopen.c 10.32 (Sleepycat) 11/26/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -28,8 +28,8 @@ static const char sccsid[] = "@(#)mp_fopen.c 10.30 (Sleepycat) 10/25/97";
|
||||
#include "common_ext.h"
|
||||
|
||||
static int __memp_mf_close __P((DB_MPOOL *, DB_MPOOLFILE *));
|
||||
static int __memp_mf_open __P((DB_MPOOL *,
|
||||
DB_MPOOLFILE *, int, size_t, int, DBT *, u_int8_t *, int, MPOOLFILE **));
|
||||
static int __memp_mf_open __P((DB_MPOOL *, DB_MPOOLFILE *,
|
||||
const char *, int, size_t, off_t, int, DBT *, u_int8_t *, MPOOLFILE **));
|
||||
|
||||
/*
|
||||
* memp_fopen --
|
||||
@ -53,7 +53,13 @@ memp_fopen(dbmp, path, ftype,
|
||||
"memp_fopen", flags, DB_CREATE | DB_NOMMAP | DB_RDONLY)) != 0)
|
||||
return (ret);
|
||||
|
||||
return (__memp_fopen(dbmp, path, ftype,
|
||||
/* Require a non-zero pagesize. */
|
||||
if (pagesize == 0) {
|
||||
__db_err(dbmp->dbenv, "memp_fopen: pagesize not specified");
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
return (__memp_fopen(dbmp, NULL, path, ftype,
|
||||
flags, mode, pagesize, lsn_offset, pgcookie, fileid, 1, retp));
|
||||
}
|
||||
|
||||
@ -61,13 +67,14 @@ memp_fopen(dbmp, path, ftype,
|
||||
* __memp_fopen --
|
||||
* Open a backing file for the memory pool; internal version.
|
||||
*
|
||||
* PUBLIC: int __memp_fopen __P((DB_MPOOL *, const char *, int, int,
|
||||
* PUBLIC: int, size_t, int, DBT *, u_int8_t *, int, DB_MPOOLFILE **));
|
||||
* PUBLIC: int __memp_fopen __P((DB_MPOOL *, MPOOLFILE *, const char *, int,
|
||||
* PUBLIC: int, int, size_t, int, DBT *, u_int8_t *, int, DB_MPOOLFILE **));
|
||||
*/
|
||||
int
|
||||
__memp_fopen(dbmp, path,
|
||||
__memp_fopen(dbmp, mfp, path,
|
||||
ftype, flags, mode, pagesize, lsn_offset, pgcookie, fileid, needlock, retp)
|
||||
DB_MPOOL *dbmp;
|
||||
MPOOLFILE *mfp;
|
||||
const char *path;
|
||||
int ftype, flags, mode, lsn_offset, needlock;
|
||||
size_t pagesize;
|
||||
@ -77,24 +84,27 @@ __memp_fopen(dbmp, path,
|
||||
{
|
||||
DB_ENV *dbenv;
|
||||
DB_MPOOLFILE *dbmfp;
|
||||
MPOOLFILE *mfp;
|
||||
off_t size;
|
||||
int ret;
|
||||
u_int8_t idbuf[DB_FILE_ID_LEN];
|
||||
char *rpath;
|
||||
|
||||
/*
|
||||
* XXX
|
||||
* If mfp is provided, the following arguments do NOT need to be
|
||||
* specified:
|
||||
* lsn_offset
|
||||
* pgcookie
|
||||
* fileid
|
||||
*/
|
||||
dbenv = dbmp->dbenv;
|
||||
ret = 0;
|
||||
|
||||
/* Require a non-zero pagesize. */
|
||||
if (pagesize == 0) {
|
||||
__db_err(dbenv, "memp_fopen: pagesize not specified");
|
||||
return (EINVAL);
|
||||
}
|
||||
rpath = NULL;
|
||||
|
||||
/* Allocate and initialize the per-process structure. */
|
||||
if ((dbmfp =
|
||||
(DB_MPOOLFILE *)__db_calloc(1, sizeof(DB_MPOOLFILE))) == NULL) {
|
||||
__db_err(dbenv, "%s: %s",
|
||||
path == NULL ? TEMPORARY : path, strerror(ENOMEM));
|
||||
__db_err(dbenv, "memp_fopen: %s", strerror(ENOMEM));
|
||||
return (ENOMEM);
|
||||
}
|
||||
dbmfp->dbmp = dbmp;
|
||||
@ -109,54 +119,66 @@ __memp_fopen(dbmp, path,
|
||||
ret = EINVAL;
|
||||
goto err;
|
||||
}
|
||||
dbmfp->path = (char *)TEMPORARY;
|
||||
F_SET(dbmfp, MP_PATH_TEMP);
|
||||
size = 0;
|
||||
} else {
|
||||
/* Calculate the real name for this file. */
|
||||
/* Get the real name for this file and open it. */
|
||||
if ((ret = __db_appname(dbenv,
|
||||
DB_APP_DATA, NULL, path, NULL, &dbmfp->path)) != 0)
|
||||
DB_APP_DATA, NULL, path, NULL, &rpath)) != 0)
|
||||
goto err;
|
||||
F_SET(dbmfp, MP_PATH_ALLOC);
|
||||
|
||||
|
||||
/* Open the file. */
|
||||
if ((ret = __db_open(dbmfp->path,
|
||||
if ((ret = __db_open(rpath,
|
||||
LF_ISSET(DB_CREATE | DB_RDONLY), DB_CREATE | DB_RDONLY,
|
||||
mode, &dbmfp->fd)) != 0) {
|
||||
__db_err(dbenv, "%s: %s", dbmfp->path, strerror(ret));
|
||||
__db_err(dbenv, "%s: %s", rpath, strerror(ret));
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* Don't permit files that aren't a multiple of the pagesize. */
|
||||
if ((ret =
|
||||
__db_ioinfo(dbmfp->path, dbmfp->fd, &size, NULL)) != 0) {
|
||||
__db_err(dbenv, "%s: %s", dbmfp->path, strerror(ret));
|
||||
if ((ret = __db_ioinfo(rpath, dbmfp->fd, &size, NULL)) != 0) {
|
||||
__db_err(dbenv, "%s: %s", rpath, strerror(ret));
|
||||
goto err;
|
||||
}
|
||||
if (size % pagesize) {
|
||||
__db_err(dbenv,
|
||||
"%s: file size not a multiple of the pagesize",
|
||||
dbmfp->path);
|
||||
rpath);
|
||||
ret = EINVAL;
|
||||
goto err;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the file id if we weren't given one. Generated file id's
|
||||
* don't use timestamps, otherwise there'd be no chance of any
|
||||
* other process joining the party.
|
||||
*/
|
||||
if (mfp == NULL && fileid == NULL) {
|
||||
if ((ret = __db_fileid(dbenv, rpath, 0, idbuf)) != 0)
|
||||
goto err;
|
||||
fileid = idbuf;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Find/allocate the shared file objects. This includes allocating
|
||||
* space for the per-process thread lock.
|
||||
* If we weren't provided an underlying shared object to join with,
|
||||
* find/allocate the shared file objects. Also allocate space for
|
||||
* for the per-process thread lock.
|
||||
*/
|
||||
if (needlock)
|
||||
LOCKREGION(dbmp);
|
||||
ret = __memp_mf_open(dbmp, dbmfp, ftype, pagesize,
|
||||
lsn_offset, pgcookie, fileid, F_ISSET(dbmfp, MP_PATH_TEMP), &mfp);
|
||||
|
||||
if (mfp == NULL)
|
||||
ret = __memp_mf_open(dbmp, dbmfp, path,
|
||||
ftype, pagesize, size, lsn_offset, pgcookie, fileid, &mfp);
|
||||
else {
|
||||
++mfp->ref;
|
||||
ret = 0;
|
||||
}
|
||||
if (ret == 0 &&
|
||||
F_ISSET(dbmp, MP_LOCKHANDLE) && (ret =
|
||||
__memp_ralloc(dbmp, sizeof(db_mutex_t), NULL, &dbmfp->mutexp)) == 0)
|
||||
LOCKINIT(dbmp, dbmfp->mutexp);
|
||||
|
||||
if (needlock)
|
||||
UNLOCKREGION(dbmp);
|
||||
|
||||
if (ret != 0)
|
||||
goto err;
|
||||
|
||||
@ -184,25 +206,25 @@ __memp_fopen(dbmp, path,
|
||||
* flatly impossible. Hope that mmap fails if the file is too large.
|
||||
*/
|
||||
#define DB_MAXMMAPSIZE (10 * 1024 * 1024) /* 10 Mb. */
|
||||
if (mfp->can_mmap) {
|
||||
if (F_ISSET(mfp, MP_CAN_MMAP)) {
|
||||
if (!F_ISSET(dbmfp, MP_READONLY))
|
||||
mfp->can_mmap = 0;
|
||||
F_CLR(mfp, MP_CAN_MMAP);
|
||||
if (path == NULL)
|
||||
mfp->can_mmap = 0;
|
||||
F_CLR(mfp, MP_CAN_MMAP);
|
||||
if (ftype != 0)
|
||||
mfp->can_mmap = 0;
|
||||
F_CLR(mfp, MP_CAN_MMAP);
|
||||
if (LF_ISSET(DB_NOMMAP))
|
||||
mfp->can_mmap = 0;
|
||||
F_CLR(mfp, MP_CAN_MMAP);
|
||||
if (size > (dbenv == NULL || dbenv->mp_mmapsize == 0 ?
|
||||
DB_MAXMMAPSIZE : (off_t)dbenv->mp_mmapsize))
|
||||
mfp->can_mmap = 0;
|
||||
F_CLR(mfp, MP_CAN_MMAP);
|
||||
}
|
||||
dbmfp->addr = NULL;
|
||||
if (mfp->can_mmap) {
|
||||
if (F_ISSET(mfp, MP_CAN_MMAP)) {
|
||||
dbmfp->len = size;
|
||||
if (__db_map(dbmfp->fd, dbmfp->len, 1, 1, &dbmfp->addr) != 0) {
|
||||
mfp->can_mmap = 0;
|
||||
dbmfp->addr = NULL;
|
||||
F_CLR(mfp, MP_CAN_MMAP);
|
||||
}
|
||||
}
|
||||
|
||||
@ -217,8 +239,8 @@ err: /*
|
||||
* Note that we do not have to free the thread mutex, because we
|
||||
* never get to here after we have successfully allocated it.
|
||||
*/
|
||||
if (F_ISSET(dbmfp, MP_PATH_ALLOC))
|
||||
FREES(dbmfp->path);
|
||||
if (rpath != NULL)
|
||||
FREES(rpath);
|
||||
if (dbmfp->fd != -1)
|
||||
(void)__db_close(dbmfp->fd);
|
||||
if (dbmfp != NULL)
|
||||
@ -231,78 +253,80 @@ err: /*
|
||||
* Open an MPOOLFILE.
|
||||
*/
|
||||
static int
|
||||
__memp_mf_open(dbmp, dbmfp,
|
||||
ftype, pagesize, lsn_offset, pgcookie, fileid, istemp, retp)
|
||||
__memp_mf_open(dbmp, dbmfp, path,
|
||||
ftype, pagesize, size, lsn_offset, pgcookie, fileid, retp)
|
||||
DB_MPOOL *dbmp;
|
||||
DB_MPOOLFILE *dbmfp;
|
||||
int ftype, lsn_offset, istemp;
|
||||
const char *path;
|
||||
int ftype, lsn_offset;
|
||||
size_t pagesize;
|
||||
off_t size;
|
||||
DBT *pgcookie;
|
||||
u_int8_t *fileid;
|
||||
MPOOLFILE **retp;
|
||||
{
|
||||
MPOOLFILE *mfp;
|
||||
int ret;
|
||||
u_int8_t idbuf[DB_FILE_ID_LEN];
|
||||
void *p;
|
||||
|
||||
/* Temporary files can't match previous files. */
|
||||
if (istemp)
|
||||
goto alloc;
|
||||
#define ISTEMPORARY (path == NULL)
|
||||
|
||||
/*
|
||||
* Get the file id if we weren't give one. Generated file id's don't
|
||||
* use timestamps, otherwise there'd be no chance of anyone joining
|
||||
* the party.
|
||||
* Walk the list of MPOOLFILE's, looking for a matching file.
|
||||
* Temporary files can't match previous files.
|
||||
*/
|
||||
if (fileid == NULL) {
|
||||
if ((ret =
|
||||
__db_fileid(dbmp->dbenv, dbmfp->path, 0, idbuf)) != 0)
|
||||
return (ret);
|
||||
fileid = idbuf;
|
||||
}
|
||||
if (!ISTEMPORARY)
|
||||
for (mfp = SH_TAILQ_FIRST(&dbmp->mp->mpfq, __mpoolfile);
|
||||
mfp != NULL; mfp = SH_TAILQ_NEXT(mfp, q, __mpoolfile)) {
|
||||
if (F_ISSET(mfp, MP_TEMP))
|
||||
continue;
|
||||
if (!memcmp(fileid,
|
||||
R_ADDR(dbmp, mfp->fileid_off), DB_FILE_ID_LEN)) {
|
||||
if (ftype != mfp->ftype ||
|
||||
pagesize != mfp->stat.st_pagesize) {
|
||||
__db_err(dbmp->dbenv,
|
||||
"%s: ftype or pagesize changed",
|
||||
path);
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
/* Walk the list of MPOOLFILE's, looking for a matching file. */
|
||||
for (mfp = SH_TAILQ_FIRST(&dbmp->mp->mpfq, __mpoolfile);
|
||||
mfp != NULL; mfp = SH_TAILQ_NEXT(mfp, q, __mpoolfile))
|
||||
if (!memcmp(fileid,
|
||||
R_ADDR(dbmp, mfp->fileid_off), DB_FILE_ID_LEN)) {
|
||||
if (ftype != mfp->ftype ||
|
||||
pagesize != mfp->stat.st_pagesize) {
|
||||
__db_err(dbmp->dbenv,
|
||||
"%s: ftype or pagesize changed",
|
||||
dbmfp->path);
|
||||
ret = EINVAL;
|
||||
mfp = NULL;
|
||||
goto ret1;
|
||||
/* Found it: increment the reference count. */
|
||||
++mfp->ref;
|
||||
*retp = mfp;
|
||||
return (0);
|
||||
}
|
||||
/* Found it: increment the reference count. */
|
||||
++mfp->ref;
|
||||
goto ret1;
|
||||
}
|
||||
|
||||
/* Allocate a new MPOOLFILE. */
|
||||
alloc: if ((ret = __memp_ralloc(dbmp, sizeof(MPOOLFILE), NULL, &mfp)) != 0)
|
||||
goto ret1;
|
||||
if ((ret = __memp_ralloc(dbmp, sizeof(MPOOLFILE), NULL, &mfp)) != 0)
|
||||
return (ret);
|
||||
*retp = mfp;
|
||||
|
||||
/* Initialize the structure. */
|
||||
memset(mfp, 0, sizeof(MPOOLFILE));
|
||||
mfp->ref = 1;
|
||||
mfp->ftype = ftype;
|
||||
mfp->can_mmap = 1;
|
||||
mfp->lsn_off = lsn_offset;
|
||||
|
||||
/*
|
||||
* If the user specifies DB_MPOOL_LAST or DB_MPOOL_NEW on a memp_fget,
|
||||
* we have to know the last page in the file. Figure it out and save
|
||||
* it away.
|
||||
*/
|
||||
mfp->stat.st_pagesize = pagesize;
|
||||
mfp->last_pgno = size == 0 ? 0 : (size - 1) / mfp->stat.st_pagesize;
|
||||
|
||||
/* Copy the file path into shared memory. */
|
||||
if ((ret = __memp_ralloc(dbmp,
|
||||
strlen(dbmfp->path) + 1, &mfp->path_off, &p)) != 0)
|
||||
goto err;
|
||||
memcpy(p, dbmfp->path, strlen(dbmfp->path) + 1);
|
||||
|
||||
/* Copy the file identification string into shared memory. */
|
||||
if (istemp)
|
||||
mfp->fileid_off = 0;
|
||||
F_SET(mfp, MP_CAN_MMAP);
|
||||
if (ISTEMPORARY)
|
||||
F_SET(mfp, MP_TEMP);
|
||||
else {
|
||||
/* Copy the file path into shared memory. */
|
||||
if ((ret = __memp_ralloc(dbmp,
|
||||
strlen(path) + 1, &mfp->path_off, &p)) != 0)
|
||||
goto err;
|
||||
memcpy(p, path, strlen(path) + 1);
|
||||
|
||||
/* Copy the file identification string into shared memory. */
|
||||
if ((ret = __memp_ralloc(dbmp,
|
||||
DB_FILE_ID_LEN, &mfp->fileid_off, &p)) != 0)
|
||||
goto err;
|
||||
@ -328,15 +352,13 @@ alloc: if ((ret = __memp_ralloc(dbmp, sizeof(MPOOLFILE), NULL, &mfp)) != 0)
|
||||
err: if (mfp->path_off != 0)
|
||||
__db_shalloc_free(dbmp->addr,
|
||||
R_ADDR(dbmp, mfp->path_off));
|
||||
if (!istemp)
|
||||
if (mfp->fileid_off != 0)
|
||||
__db_shalloc_free(dbmp->addr,
|
||||
R_ADDR(dbmp, mfp->fileid_off));
|
||||
if (mfp != NULL)
|
||||
__db_shalloc_free(dbmp->addr, mfp);
|
||||
mfp = NULL;
|
||||
}
|
||||
|
||||
ret1: *retp = mfp;
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -357,7 +379,7 @@ memp_fclose(dbmfp)
|
||||
/* Complain if pinned blocks never returned. */
|
||||
if (dbmfp->pinref != 0)
|
||||
__db_err(dbmp->dbenv, "%s: close: %lu blocks left pinned",
|
||||
dbmfp->path, (u_long)dbmfp->pinref);
|
||||
__memp_fn(dbmfp), (u_long)dbmfp->pinref);
|
||||
|
||||
/* Remove the DB_MPOOLFILE structure from the list. */
|
||||
LOCKHANDLE(dbmp, dbmp->mutexp);
|
||||
@ -370,18 +392,18 @@ memp_fclose(dbmfp)
|
||||
/* Discard any mmap information. */
|
||||
if (dbmfp->addr != NULL &&
|
||||
(ret = __db_unmap(dbmfp->addr, dbmfp->len)) != 0)
|
||||
__db_err(dbmp->dbenv, "%s: %s", dbmfp->path, strerror(ret));
|
||||
__db_err(dbmp->dbenv,
|
||||
"%s: %s", __memp_fn(dbmfp), strerror(ret));
|
||||
|
||||
/* Close the file; temporary files may not yet have been created. */
|
||||
if (dbmfp->fd != -1 && (t_ret = __db_close(dbmfp->fd)) != 0) {
|
||||
__db_err(dbmp->dbenv, "%s: %s", dbmfp->path, strerror(t_ret));
|
||||
__db_err(dbmp->dbenv,
|
||||
"%s: %s", __memp_fn(dbmfp), strerror(t_ret));
|
||||
if (ret != 0)
|
||||
t_ret = ret;
|
||||
}
|
||||
|
||||
/* Free memory. */
|
||||
if (F_ISSET(dbmfp, MP_PATH_ALLOC))
|
||||
FREES(dbmfp->path);
|
||||
if (dbmfp->mutexp != NULL) {
|
||||
LOCKREGION(dbmp);
|
||||
__db_shalloc_free(dbmp->addr, dbmfp->mutexp);
|
||||
@ -434,7 +456,8 @@ __memp_mf_close(dbmp, dbmfp)
|
||||
if (F_ISSET(bhp, BH_DIRTY))
|
||||
__db_err(dbmp->dbenv,
|
||||
"%s: close: pgno %lu left dirty; ref %lu",
|
||||
dbmfp->path, (u_long)bhp->pgno, (u_long)bhp->ref);
|
||||
__memp_fn(dbmfp),
|
||||
(u_long)bhp->pgno, (u_long)bhp->ref);
|
||||
#endif
|
||||
|
||||
if (bhp->mf_offset == mf_offset) {
|
||||
@ -452,7 +475,8 @@ __memp_mf_close(dbmp, dbmfp)
|
||||
|
||||
/* Free the space. */
|
||||
__db_shalloc_free(dbmp->addr, mfp);
|
||||
__db_shalloc_free(dbmp->addr, R_ADDR(dbmp, mfp->path_off));
|
||||
if (mfp->path_off != 0)
|
||||
__db_shalloc_free(dbmp->addr, R_ADDR(dbmp, mfp->path_off));
|
||||
if (mfp->fileid_off != 0)
|
||||
__db_shalloc_free(dbmp->addr, R_ADDR(dbmp, mfp->fileid_off));
|
||||
if (mfp->pgcookie_off != 0)
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)mp_fput.c 10.14 (Sleepycat) 10/5/97";
|
||||
static const char sccsid[] = "@(#)mp_fput.c 10.16 (Sleepycat) 11/26/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -54,7 +54,7 @@ memp_fput(dbmfp, pgaddr, flags)
|
||||
if (LF_ISSET(DB_MPOOL_DIRTY) && F_ISSET(dbmfp, MP_READONLY)) {
|
||||
__db_err(dbmp->dbenv,
|
||||
"%s: dirty flag set for readonly file page",
|
||||
dbmfp->path);
|
||||
__memp_fn(dbmfp));
|
||||
return (EACCES);
|
||||
}
|
||||
}
|
||||
@ -64,7 +64,7 @@ memp_fput(dbmfp, pgaddr, flags)
|
||||
if (dbmfp->pinref == 0)
|
||||
__db_err(dbmp->dbenv,
|
||||
"%s: put: more blocks returned than retrieved",
|
||||
dbmfp->path);
|
||||
__memp_fn(dbmfp));
|
||||
else
|
||||
--dbmfp->pinref;
|
||||
UNLOCKHANDLE(dbmp, dbmfp->mutexp);
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)mp_fset.c 10.10 (Sleepycat) 10/5/97";
|
||||
static const char sccsid[] = "@(#)mp_fset.c 10.12 (Sleepycat) 11/26/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -43,20 +43,21 @@ memp_fset(dbmfp, pgaddr, flags)
|
||||
mp = dbmp->mp;
|
||||
|
||||
/* Validate arguments. */
|
||||
if (flags != 0) {
|
||||
if ((ret = __db_fchk(dbmp->dbenv, "memp_fset", flags,
|
||||
DB_MPOOL_DIRTY | DB_MPOOL_CLEAN | DB_MPOOL_DISCARD)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_fcchk(dbmp->dbenv, "memp_fset",
|
||||
flags, DB_MPOOL_CLEAN, DB_MPOOL_DIRTY)) != 0)
|
||||
return (ret);
|
||||
if (flags == 0)
|
||||
return (__db_ferr(dbmp->dbenv, "memp_fset", 1));
|
||||
|
||||
if (LF_ISSET(DB_MPOOL_DIRTY) && F_ISSET(dbmfp, MP_READONLY)) {
|
||||
__db_err(dbmp->dbenv,
|
||||
"%s: dirty flag set for readonly file page",
|
||||
dbmfp->path);
|
||||
return (EACCES);
|
||||
}
|
||||
if ((ret = __db_fchk(dbmp->dbenv, "memp_fset", flags,
|
||||
DB_MPOOL_DIRTY | DB_MPOOL_CLEAN | DB_MPOOL_DISCARD)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_fcchk(dbmp->dbenv, "memp_fset",
|
||||
flags, DB_MPOOL_CLEAN, DB_MPOOL_DIRTY)) != 0)
|
||||
return (ret);
|
||||
|
||||
if (LF_ISSET(DB_MPOOL_DIRTY) && F_ISSET(dbmfp, MP_READONLY)) {
|
||||
__db_err(dbmp->dbenv,
|
||||
"%s: dirty flag set for readonly file page",
|
||||
__memp_fn(dbmfp));
|
||||
return (EACCES);
|
||||
}
|
||||
|
||||
/* Convert the page address to a buffer header. */
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)mp_open.c 10.15 (Sleepycat) 10/25/97";
|
||||
static const char sccsid[] = "@(#)mp_open.c 10.16 (Sleepycat) 11/28/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -65,17 +65,6 @@ memp_open(path, flags, mode, dbenv, retp)
|
||||
if ((dbenv == NULL && path == NULL) || LF_ISSET(DB_MPOOL_PRIVATE))
|
||||
F_SET(dbmp, MP_ISPRIVATE);
|
||||
|
||||
/*
|
||||
* XXX
|
||||
* HP-UX won't permit mutexes to live in anything but shared memory.
|
||||
* So, we have to instantiate the shared mpool region file on that
|
||||
* architecture, regardless. If this turns out to be a performance
|
||||
* problem, we could probably use anonymous memory instead.
|
||||
*/
|
||||
#if defined(__hppa)
|
||||
F_CLR(dbmp, MP_ISPRIVATE);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Map in the region. We do locking regardless, as portions of it are
|
||||
* implemented in common code (if we put the region in a file, that is).
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)mp_pr.c 10.18 (Sleepycat) 11/1/97";
|
||||
static const char sccsid[] = "@(#)mp_pr.c 10.20 (Sleepycat) 11/26/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -100,7 +100,7 @@ memp_stat(dbmp, gspp, fspp, db_malloc)
|
||||
mfp = SH_TAILQ_FIRST(&dbmp->mp->mpfq, __mpoolfile);
|
||||
mfp != NULL;
|
||||
++tfsp, mfp = SH_TAILQ_NEXT(mfp, q, __mpoolfile)) {
|
||||
name = R_ADDR(dbmp, mfp->path_off);
|
||||
name = __memp_fns(dbmp, mfp);
|
||||
nlen = strlen(name);
|
||||
len = sizeof(DB_MPOOL_FSTAT) + nlen + 1;
|
||||
if ((*tfsp = db_malloc == NULL ?
|
||||
@ -119,6 +119,37 @@ memp_stat(dbmp, gspp, fspp, db_malloc)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* __memp_fn --
|
||||
* On errors we print whatever is available as the file name.
|
||||
*
|
||||
* PUBLIC: char * __memp_fn __P((DB_MPOOLFILE *));
|
||||
*/
|
||||
char *
|
||||
__memp_fn(dbmfp)
|
||||
DB_MPOOLFILE *dbmfp;
|
||||
{
|
||||
return (__memp_fns(dbmfp->dbmp, dbmfp->mfp));
|
||||
}
|
||||
|
||||
/*
|
||||
* __memp_fns --
|
||||
* On errors we print whatever is available as the file name.
|
||||
*
|
||||
* PUBLIC: char * __memp_fns __P((DB_MPOOL *, MPOOLFILE *));
|
||||
*
|
||||
*/
|
||||
char *
|
||||
__memp_fns(dbmp, mfp)
|
||||
DB_MPOOL *dbmp;
|
||||
MPOOLFILE *mfp;
|
||||
{
|
||||
if (mfp->path_off == 0)
|
||||
return ((char *)"temporary");
|
||||
|
||||
return ((char *)R_ADDR(dbmp, mfp->path_off));
|
||||
}
|
||||
|
||||
/*
|
||||
* __memp_debug --
|
||||
* Display MPOOL structures.
|
||||
@ -152,7 +183,7 @@ __memp_debug(dbmp, fp, data)
|
||||
(void)fprintf(fp, "%lu process-local files\n", cnt);
|
||||
for (dbmfp = TAILQ_FIRST(&dbmp->dbmfq);
|
||||
dbmfp != NULL; dbmfp = TAILQ_NEXT(dbmfp, q)) {
|
||||
(void)fprintf(fp, "%s\n", dbmfp->path);
|
||||
(void)fprintf(fp, "%s\n", __memp_fn(dbmfp));
|
||||
__memp_pdbmf(fp, dbmfp, data);
|
||||
}
|
||||
|
||||
@ -285,7 +316,7 @@ __memp_pmf(fp, mfp, data)
|
||||
return;
|
||||
|
||||
(void)fprintf(fp, " %d references; %s; pagesize: %lu\n", mfp->ref,
|
||||
mfp->can_mmap ? "mmap" : "read/write",
|
||||
F_ISSET(mfp, MP_CAN_MMAP) ? "mmap" : "read/write",
|
||||
(u_long)mfp->stat.st_pagesize);
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)mp_region.c 10.16 (Sleepycat) 10/25/97";
|
||||
static const char sccsid[] = "@(#)mp_region.c 10.18 (Sleepycat) 11/29/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -224,17 +224,28 @@ retry: if (LF_ISSET(DB_CREATE)) {
|
||||
* the file descriptor for locking. However, it should not
|
||||
* be possible for DB_THREAD to be set if HAVE_SPINLOCKS aren't
|
||||
* defined.
|
||||
*
|
||||
* XXX
|
||||
* HP-UX won't permit mutexes to live in anything but shared
|
||||
* memory. So, instantiate the shared mpool region file on
|
||||
* that architecture, regardless. If this turns out to be a
|
||||
* performance problem, we could use anonymous memory instead.
|
||||
*/
|
||||
if (F_ISSET(dbmp, MP_ISPRIVATE)) {
|
||||
#if !defined(__hppa)
|
||||
if (F_ISSET(dbmp, MP_ISPRIVATE))
|
||||
if ((dbmp->maddr = __db_malloc(rlen)) == NULL)
|
||||
ret = ENOMEM;
|
||||
else
|
||||
else {
|
||||
F_SET(dbmp, MP_MALLOC);
|
||||
ret = __db_rinit(dbmp->dbenv,
|
||||
dbmp->maddr, 0, rlen, 0);
|
||||
} else
|
||||
}
|
||||
else
|
||||
#endif
|
||||
ret = __db_rcreate(dbmp->dbenv, DB_APP_NONE, path,
|
||||
DB_DEFAULT_MPOOL_FILE, mode, rlen, &fd,
|
||||
&dbmp->maddr);
|
||||
DB_DEFAULT_MPOOL_FILE, mode, rlen,
|
||||
F_ISSET(dbmp, MP_ISPRIVATE) ? DB_TEMPORARY : 0,
|
||||
&fd, &dbmp->maddr);
|
||||
if (ret == 0) {
|
||||
/* Put the MPOOL structure first in the region. */
|
||||
mp = dbmp->maddr;
|
||||
@ -315,7 +326,7 @@ retry: if (LF_ISSET(DB_CREATE)) {
|
||||
dbmp->fd = fd;
|
||||
|
||||
/* If we locked the region, release it now. */
|
||||
if (!F_ISSET(dbmp, MP_ISPRIVATE))
|
||||
if (!F_ISSET(dbmp, MP_MALLOC))
|
||||
UNLOCKREGION(dbmp);
|
||||
return (0);
|
||||
|
||||
@ -339,7 +350,7 @@ int
|
||||
__memp_rclose(dbmp)
|
||||
DB_MPOOL *dbmp;
|
||||
{
|
||||
if (F_ISSET(dbmp, MP_ISPRIVATE)) {
|
||||
if (F_ISSET(dbmp, MP_MALLOC)) {
|
||||
__db_free(dbmp->maddr);
|
||||
return (0);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)mp_sync.c 10.15 (Sleepycat) 11/1/97";
|
||||
static const char sccsid[] = "@(#)mp_sync.c 10.17 (Sleepycat) 11/26/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -201,7 +201,7 @@ memp_sync(dbmp, lsnp)
|
||||
*/
|
||||
if (!wrote) {
|
||||
__db_err(dbenv, "%s: unable to flush page: %lu",
|
||||
R_ADDR(dbmp, mfp->path_off),
|
||||
__memp_fns(dbmp, mfp),
|
||||
(u_long)bharray[next]->pgno);
|
||||
ret = EPERM;
|
||||
goto err;
|
||||
@ -244,16 +244,24 @@ memp_fsync(dbmfp)
|
||||
size_t mf_offset;
|
||||
int ar_cnt, cnt, nalloc, next, pincnt, notused, ret, wrote;
|
||||
|
||||
dbmp = dbmfp->dbmp;
|
||||
|
||||
/*
|
||||
* If this handle doesn't have a file descriptor that's open for
|
||||
* writing, or if the file is a temporary, there's no reason to
|
||||
* proceed further.
|
||||
*/
|
||||
if (F_ISSET(dbmfp, MP_READONLY | MP_PATH_TEMP))
|
||||
if (F_ISSET(dbmfp, MP_READONLY))
|
||||
return (0);
|
||||
|
||||
ret = 0;
|
||||
dbmp = dbmfp->dbmp;
|
||||
LOCKREGION(dbmp);
|
||||
if (F_ISSET(dbmfp->mfp, MP_TEMP))
|
||||
ret = 1;
|
||||
UNLOCKREGION(dbmp);
|
||||
if (ret)
|
||||
return (0);
|
||||
|
||||
mf_offset = R_OFFSET(dbmp, dbmfp->mfp);
|
||||
|
||||
/*
|
||||
@ -407,18 +415,26 @@ loop: total = mp->stat.st_page_clean + mp->stat.st_page_dirty;
|
||||
continue;
|
||||
|
||||
mfp = R_ADDR(dbmp, bhp->mf_offset);
|
||||
|
||||
/*
|
||||
* We can't write to temporary files -- see the comment in
|
||||
* mp_bh.c:__memp_bhwrite().
|
||||
*/
|
||||
if (F_ISSET(mfp, MP_TEMP))
|
||||
continue;
|
||||
|
||||
if ((ret =
|
||||
__memp_bhwrite(dbmp, mfp, bhp, ¬used, &wrote)) != 0)
|
||||
goto err;
|
||||
|
||||
/*
|
||||
* Any process syncing the shared memory buffer pool
|
||||
* had better be able to write to any underlying file.
|
||||
* Be understanding, but firm, on this point.
|
||||
* Any process syncing the shared memory buffer pool had better
|
||||
* be able to write to any underlying file. Be understanding,
|
||||
* but firm, on this point.
|
||||
*/
|
||||
if (!wrote) {
|
||||
__db_err(dbmp->dbenv, "%s: unable to flush page: %lu",
|
||||
R_ADDR(dbmp, mfp->path_off), (u_long)bhp->pgno);
|
||||
__memp_fns(dbmp, mfp), (u_long)bhp->pgno);
|
||||
ret = EPERM;
|
||||
goto err;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
# @(#)README 10.1 (Sleepycat) 4/12/97
|
||||
# @(#)README 10.2 (Sleepycat) 11/25/97
|
||||
|
||||
Resource locking routines: lock based on a db_mutex_t. All this gunk
|
||||
(including trying to make assembly code portable), is necessary because
|
||||
@ -11,9 +11,9 @@ information.
|
||||
|
||||
If HAVE_SPINLOCKS is defined (i.e. we know how to do test-and-sets for
|
||||
this compiler/architecture combination), we try and lock the resource tsl
|
||||
TSL_DEFAULT_SPINS times. If we can't acquire the lock that way, we use
|
||||
a system call to sleep for 10ms, 20ms, 40ms, etc. (The time is bounded
|
||||
at 1 second, just in case.) Using the timer backoff means that there are
|
||||
__db_tsl_spins times. If we can't acquire the lock that way, we use a
|
||||
system call to sleep for 10ms, 20ms, 40ms, etc. (The time is bounded at
|
||||
1 second, just in case.) Using the timer backoff means that there are
|
||||
two assumptions: that locks are held for brief periods (never over system
|
||||
calls or I/O) and that locks are not hotly contested.
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)mutex.c 10.28 (Sleepycat) 10/31/97";
|
||||
static const char sccsid[] = "@(#)mutex.c 10.29 (Sleepycat) 11/25/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -101,12 +101,6 @@ static const char sccsid[] = "@(#)mutex.c 10.28 (Sleepycat) 10/31/97";
|
||||
|
||||
#endif /* HAVE_SPINLOCKS */
|
||||
|
||||
#ifdef MORE_THAN_ONE_PROCESSOR
|
||||
#define TSL_DEFAULT_SPINS 5 /* Default spins before block. */
|
||||
#else
|
||||
#define TSL_DEFAULT_SPINS 1 /* Default spins before block. */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* __db_mutex_init --
|
||||
* Initialize a DB mutex structure.
|
||||
@ -130,6 +124,7 @@ __db_mutex_init(mp, off)
|
||||
|
||||
#ifdef HAVE_SPINLOCKS
|
||||
TSL_INIT(&mp->tsl_resource);
|
||||
mp->spins = __os_spin();
|
||||
#else
|
||||
mp->off = off;
|
||||
#endif
|
||||
@ -155,11 +150,8 @@ __db_mutex_lock(mp, fd)
|
||||
int nspins;
|
||||
|
||||
for (usecs = MS(10);;) {
|
||||
/*
|
||||
* Try and acquire the uncontested resource lock for
|
||||
* TSL_DEFAULT_SPINS.
|
||||
*/
|
||||
for (nspins = TSL_DEFAULT_SPINS; nspins > 0; --nspins)
|
||||
/* Try and acquire the uncontested resource lock for N spins. */
|
||||
for (nspins = mp->spins; nspins > 0; --nspins)
|
||||
if (TSL_SET(&mp->tsl_resource)) {
|
||||
#ifdef DEBUG
|
||||
if (mp->pid != 0) {
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)os_func.c 10.4 (Sleepycat) 10/28/97";
|
||||
static const char sccsid[] = "@(#)os_config.c 10.9 (Sleepycat) 11/28/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -31,7 +31,6 @@ static const char sccsid[] = "@(#)os_func.c 10.4 (Sleepycat) 10/28/97";
|
||||
#define imported
|
||||
#endif
|
||||
|
||||
imported extern void *calloc __P((size_t, size_t));
|
||||
imported extern int close __P((int));
|
||||
imported extern void free __P((void *));
|
||||
imported extern int fsync __P((int));
|
||||
@ -42,16 +41,16 @@ imported extern char *strdup __P((const char *));
|
||||
imported extern void *realloc __P((void *, size_t));
|
||||
imported extern int unlink __P((const char *));
|
||||
imported extern ssize_t write __P((int, const void *, size_t));
|
||||
imported extern void *memset __P((void *, int, size_t));
|
||||
|
||||
/*
|
||||
* __db_jump --
|
||||
* This list of interfaces that applications can replace. In some
|
||||
* cases, the user is permitted to replace the standard ANSI C or
|
||||
* POSIX 1003.1 call, e.g., calloc or read. In others, we provide
|
||||
* POSIX 1003.1 call, e.g., malloc or read. In others, we provide
|
||||
* a local interface to the functionality, e.g., __os_map.
|
||||
*/
|
||||
struct __db_jumptab __db_jump = {
|
||||
calloc, /* DB_FUNC_CALLOC */
|
||||
close, /* DB_FUNC_CLOSE */
|
||||
__os_dirfree, /* DB_FUNC_DIRFREE */
|
||||
__os_dirlist, /* DB_FUNC_DIRLIST */
|
||||
@ -73,9 +72,11 @@ struct __db_jumptab __db_jump = {
|
||||
NULL /* DB_FUNC_YIELD */
|
||||
};
|
||||
|
||||
int __db_tsl_spins; /* DB_TSL_SPINS */
|
||||
|
||||
/*
|
||||
* db_jump_set --
|
||||
* Replace an interface.
|
||||
* Replace functions for the DB package.
|
||||
*/
|
||||
int
|
||||
db_jump_set(func, which)
|
||||
@ -84,70 +85,148 @@ db_jump_set(func, which)
|
||||
{
|
||||
switch (which) {
|
||||
case DB_FUNC_CALLOC:
|
||||
__db_calloc = (void *(*) __P((size_t, size_t)))func;
|
||||
break;
|
||||
/*
|
||||
* XXX
|
||||
* Obsolete, calloc is no longer called by DB.
|
||||
*/
|
||||
break;
|
||||
case DB_FUNC_CLOSE:
|
||||
__os_close = (int (*) __P((int)))func;
|
||||
__db_jump.db_close = (int (*) __P((int)))func;
|
||||
break;
|
||||
case DB_FUNC_DIRFREE:
|
||||
__db_dirfree = (void (*) __P((char **, int)))func;
|
||||
__db_jump.db_dirfree = (void (*) __P((char **, int)))func;
|
||||
break;
|
||||
case DB_FUNC_DIRLIST:
|
||||
__db_dirlist =
|
||||
__db_jump.db_dirlist =
|
||||
(int (*) __P((const char *, char ***, int *)))func;
|
||||
break;
|
||||
case DB_FUNC_EXISTS:
|
||||
__db_exists = (int (*) __P((const char *, int *)))func;
|
||||
__db_jump.db_exists = (int (*) __P((const char *, int *)))func;
|
||||
break;
|
||||
case DB_FUNC_FREE:
|
||||
__db_free = (void (*) __P((void *)))func;
|
||||
__db_jump.db_free = (void (*) __P((void *)))func;
|
||||
break;
|
||||
case DB_FUNC_FSYNC:
|
||||
__os_fsync = (int (*) __P((int)))func;
|
||||
__db_jump.db_fsync = (int (*) __P((int)))func;
|
||||
break;
|
||||
case DB_FUNC_IOINFO:
|
||||
__db_ioinfo =
|
||||
__db_jump.db_ioinfo =
|
||||
(int (*) __P((const char *, int, off_t *, off_t *)))func;
|
||||
break;
|
||||
case DB_FUNC_MALLOC:
|
||||
__db_malloc = (void *(*) __P((size_t)))func;
|
||||
__db_jump.db_malloc = (void *(*) __P((size_t)))func;
|
||||
break;
|
||||
case DB_FUNC_MAP:
|
||||
__db_map = (int (*) __P((int, size_t, int, int, void **)))func;
|
||||
__db_jump.db_map =
|
||||
(int (*) __P((int, size_t, int, int, void **)))func;
|
||||
break;
|
||||
case DB_FUNC_OPEN:
|
||||
__os_open = (int (*) __P((const char *, int, ...)))func;
|
||||
__db_jump.db_open = (int (*) __P((const char *, int, ...)))func;
|
||||
break;
|
||||
case DB_FUNC_READ:
|
||||
__os_read = (ssize_t (*) __P((int, void *, size_t)))func;
|
||||
__db_jump.db_read =
|
||||
(ssize_t (*) __P((int, void *, size_t)))func;
|
||||
break;
|
||||
case DB_FUNC_REALLOC:
|
||||
__db_realloc = (void *(*) __P((void *, size_t)))func;
|
||||
__db_jump.db_realloc = (void *(*) __P((void *, size_t)))func;
|
||||
break;
|
||||
case DB_FUNC_SEEK:
|
||||
__db_seek =
|
||||
__db_jump.db_seek =
|
||||
(int (*) __P((int, size_t, db_pgno_t, u_long, int)))func;
|
||||
break;
|
||||
case DB_FUNC_SLEEP:
|
||||
__db_sleep = (int (*) __P((u_long, u_long)))func;
|
||||
__db_jump.db_sleep = (int (*) __P((u_long, u_long)))func;
|
||||
break;
|
||||
case DB_FUNC_STRDUP:
|
||||
__db_strdup = (char *(*) __P((const char *)))func;
|
||||
__db_jump.db_strdup = (char *(*) __P((const char *)))func;
|
||||
break;
|
||||
case DB_FUNC_UNLINK:
|
||||
__os_unlink = (int (*) __P((const char *)))func;
|
||||
__db_jump.db_unlink = (int (*) __P((const char *)))func;
|
||||
break;
|
||||
case DB_FUNC_UNMAP:
|
||||
__db_unmap = (int (*) __P((void *, size_t)))func;
|
||||
__db_jump.db_unmap = (int (*) __P((void *, size_t)))func;
|
||||
break;
|
||||
case DB_FUNC_WRITE:
|
||||
__os_write = (ssize_t (*) __P((int, const void *, size_t)))func;
|
||||
__db_jump.db_write =
|
||||
(ssize_t (*) __P((int, const void *, size_t)))func;
|
||||
break;
|
||||
case DB_FUNC_YIELD:
|
||||
__db_yield = (int (*) __P((void)))func;
|
||||
__db_jump.db_yield = (int (*) __P((void)))func;
|
||||
break;
|
||||
default:
|
||||
return (EINVAL);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* db_value_set --
|
||||
* Replace values for the DB package.
|
||||
*/
|
||||
int
|
||||
db_value_set(value, which)
|
||||
int value, which;
|
||||
{
|
||||
switch (which) {
|
||||
case DB_TSL_SPINS:
|
||||
if (value <= 0)
|
||||
return (EINVAL);
|
||||
__db_tsl_spins = value;
|
||||
break;
|
||||
default:
|
||||
return (EINVAL);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* XXX
|
||||
* Correct for systems that return NULL when you allocate 0 bytes of memory.
|
||||
* There are several places in DB where we allocate the number of bytes held
|
||||
* by the key/data item, and it can be 0. Correct here so that malloc never
|
||||
* returns a NULL for that reason.
|
||||
*/
|
||||
/*
|
||||
* __db_calloc --
|
||||
* The calloc(3) function for DB.
|
||||
*
|
||||
* PUBLIC: void *__db_calloc __P((size_t, size_t));
|
||||
*/
|
||||
void *
|
||||
__db_calloc(num, size)
|
||||
size_t num, size;
|
||||
{
|
||||
void *p;
|
||||
|
||||
size *= num;
|
||||
if ((p = __db_jump.db_malloc(size == 0 ? 1 : size)) != NULL)
|
||||
memset(p, 0, size);
|
||||
return (p);
|
||||
}
|
||||
|
||||
/*
|
||||
* __db_malloc --
|
||||
* The malloc(3) function for DB.
|
||||
*
|
||||
* PUBLIC: void *__db_malloc __P((size_t));
|
||||
*/
|
||||
void *
|
||||
__db_malloc(size)
|
||||
size_t size;
|
||||
{
|
||||
return (__db_jump.db_malloc(size == 0 ? 1 : size));
|
||||
}
|
||||
|
||||
/*
|
||||
* __db_realloc --
|
||||
* The realloc(3) function for DB.
|
||||
*
|
||||
* PUBLIC: void *__db_realloc __P((void *, size_t));
|
||||
*/
|
||||
void *
|
||||
__db_realloc(ptr, size)
|
||||
void *ptr;
|
||||
size_t size;
|
||||
{
|
||||
return (__db_jump.db_realloc(ptr, size == 0 ? 1 : size));
|
||||
}
|
@ -8,7 +8,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)os_open.c 10.19 (Sleepycat) 10/28/97";
|
||||
static const char sccsid[] = "@(#)os_open.c 10.20 (Sleepycat) 11/27/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
@ -38,6 +38,11 @@ __db_open(name, arg_flags, ok_flags, mode, fdp)
|
||||
return (EINVAL);
|
||||
|
||||
flags = 0;
|
||||
|
||||
/*
|
||||
* DB requires the semantic that two files opened at the same time
|
||||
* with O_CREAT and O_EXCL set will return failure in at least one.
|
||||
*/
|
||||
if (arg_flags & DB_CREATE)
|
||||
flags |= O_CREAT;
|
||||
|
||||
|
56
db2/os/os_spin.c
Normal file
56
db2/os/os_spin.c
Normal file
@ -0,0 +1,56 @@
|
||||
/*-
|
||||
* See the file LICENSE for redistribution information.
|
||||
*
|
||||
* Copyright (c) 1997
|
||||
* Sleepycat Software. All rights reserved.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)os_spin.c 10.3 (Sleepycat) 11/25/97";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <limits.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "db_int.h"
|
||||
|
||||
/*
|
||||
* __os_spin --
|
||||
* Return the number of default spins before blocking.
|
||||
*
|
||||
* PUBLIC: int __os_spin __P((void));
|
||||
*/
|
||||
int
|
||||
__os_spin()
|
||||
{
|
||||
extern int __db_tsl_spins;
|
||||
|
||||
/* If the application specified the spins, use its value. */
|
||||
if (__db_tsl_spins != 0)
|
||||
return (__db_tsl_spins);
|
||||
|
||||
/*
|
||||
* XXX
|
||||
* Sysconf: Solaris uses _SC_NPROCESSORS_ONLN to return the number
|
||||
* of online processors. I don't know if this call is portable or
|
||||
* not.
|
||||
*/
|
||||
#if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN)
|
||||
{
|
||||
long sys_val;
|
||||
|
||||
sys_val = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
if (sys_val > 0)
|
||||
return (sys_val * 50);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Default to a single processor. */
|
||||
return (1);
|
||||
}
|
@ -43,7 +43,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)txn.c 10.35 (Sleepycat) 11/2/97";
|
||||
static const char sccsid[] = "@(#)txn.c 10.37 (Sleepycat) 11/28/97";
|
||||
#endif /* not lint */
|
||||
|
||||
|
||||
@ -101,11 +101,9 @@ __txn_create(dbenv, path, mode)
|
||||
maxtxns = dbenv->tx_max != 0 ? dbenv->tx_max : 1000;
|
||||
(void)time(&now);
|
||||
|
||||
ret = __db_rcreate(dbenv, DB_APP_NONE, path,
|
||||
DEFAULT_TXN_FILE, mode, TXN_REGION_SIZE(maxtxns), &fd, &txn_region);
|
||||
|
||||
/* Region may have existed. If it didn't, the open will fail. */
|
||||
if (ret != 0)
|
||||
if ((ret = __db_rcreate(dbenv, DB_APP_NONE, path, DEFAULT_TXN_FILE,
|
||||
mode, TXN_REGION_SIZE(maxtxns), 0, &fd, &txn_region)) != 0)
|
||||
return (ret);
|
||||
|
||||
txn_region->magic = DB_TXNMAGIC;
|
||||
@ -315,7 +313,10 @@ err:
|
||||
return (ret);
|
||||
}
|
||||
|
||||
/* The db_txn(3) man page describes txn_commit. */
|
||||
/*
|
||||
* txn_commit --
|
||||
* Commit a transaction.
|
||||
*/
|
||||
int
|
||||
txn_commit(txnp)
|
||||
DB_TXN *txnp;
|
||||
@ -337,7 +338,10 @@ txn_commit(txnp)
|
||||
return (__txn_end(txnp, 1));
|
||||
}
|
||||
|
||||
/* The db_txn(3) man page describes txn_abort. */
|
||||
/*
|
||||
* txn_abort --
|
||||
* Abort a transcation.
|
||||
*/
|
||||
int
|
||||
txn_abort(txnp)
|
||||
DB_TXN *txnp;
|
||||
@ -395,8 +399,8 @@ txn_id(txnp)
|
||||
}
|
||||
|
||||
/*
|
||||
* The db_txn(3) man page describes txn_close. Currently the caller should
|
||||
* arrange a checkpoint before calling txn_close.
|
||||
* txn_close --
|
||||
* Close the transaction region, does not imply a checkpoint.
|
||||
*/
|
||||
int
|
||||
txn_close(tmgrp)
|
||||
@ -439,8 +443,8 @@ txn_close(tmgrp)
|
||||
}
|
||||
|
||||
/*
|
||||
* The db_txn(3) man page describes txn_unlink. Right now it is up to
|
||||
* txn_close to write the final checkpoint record.
|
||||
* txn_unlink --
|
||||
* Remove the transaction region.
|
||||
*/
|
||||
int
|
||||
txn_unlink(path, force, dbenv)
|
||||
@ -666,12 +670,19 @@ do_ckp:
|
||||
mgr->region->pending_ckp = ckp_lsn;
|
||||
UNLOCK_TXNREGION(mgr);
|
||||
|
||||
ret = memp_sync(mgr->dbenv->mp_info, &ckp_lsn);
|
||||
if (ret > 0) {
|
||||
__db_err(mgr->dbenv,
|
||||
"txn_checkpoint: system failure in memp_sync %s\n",
|
||||
strerror(ret));
|
||||
} else if (ret == 0 && mgr->dbenv->lg_info != NULL) {
|
||||
if (mgr->dbenv->mp_info != NULL &&
|
||||
(ret = memp_sync(mgr->dbenv->mp_info, &ckp_lsn)) != 0) {
|
||||
/*
|
||||
* ret < 0 means that there are still buffers to flush;
|
||||
* the checkpoint is not complete. Back off and try again.
|
||||
*/
|
||||
if (ret > 0)
|
||||
__db_err(mgr->dbenv,
|
||||
"txn_checkpoint: system failure in memp_sync %s\n",
|
||||
strerror(ret));
|
||||
return (ret);
|
||||
}
|
||||
if (mgr->dbenv->lg_info != NULL) {
|
||||
LOCK_TXNREGION(mgr);
|
||||
last_ckp = mgr->region->last_ckp;
|
||||
ZERO_LSN(mgr->region->pending_ckp);
|
||||
@ -691,11 +702,7 @@ do_ckp:
|
||||
(void)time(&mgr->region->time_ckp);
|
||||
UNLOCK_TXNREGION(mgr);
|
||||
}
|
||||
/*
|
||||
* ret < 0 means that there are still buffers to flush; the
|
||||
* checkpoint is not complete. Back off and try again.
|
||||
*/
|
||||
return (ret);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -73,7 +73,6 @@ int __txn_regop_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __txn_regop_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__txn_regop_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
@ -202,7 +201,6 @@ int __txn_ckp_log(logp, txnid, ret_lsnp, flags,
|
||||
* PUBLIC: int __txn_ckp_print
|
||||
* PUBLIC: __P((DB_LOG *, DBT *, DB_LSN *, int, void *));
|
||||
*/
|
||||
|
||||
int
|
||||
__txn_ckp_print(notused1, dbtp, lsnp, notused3, notused4)
|
||||
DB_LOG *notused1;
|
||||
|
@ -26,6 +26,9 @@
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* ISO 10646 value used to signal invalid value. */
|
||||
#define UNKNOWN_10646_CHAR ((wchar_t) 0xfffd)
|
||||
|
||||
/* Error codes for gconv functions. */
|
||||
enum
|
||||
{
|
||||
|
@ -322,11 +322,8 @@ read_conf_file (const char *filename, const char *directory, size_t dir_len,
|
||||
if (endp != NULL)
|
||||
*endp = '\0';
|
||||
else
|
||||
{
|
||||
endp = strchr (rp, '\n');
|
||||
if (endp != NULL)
|
||||
*endp = '\0';
|
||||
}
|
||||
if (rp[n - 1] == '\n')
|
||||
rp[n - 1] = '\0';
|
||||
|
||||
while (isspace (*rp))
|
||||
++rp;
|
||||
|
14
iconvdata/.cvsignore
Normal file
14
iconvdata/.cvsignore
Normal file
@ -0,0 +1,14 @@
|
||||
ebcdic-at-de-a.h
|
||||
ebcdic-at-de.h
|
||||
ebcdic-ca-fr.h
|
||||
hp-roman8.h
|
||||
iso8859-10.h
|
||||
iso8859-2.h
|
||||
iso8859-3.h
|
||||
iso8859-4.h
|
||||
iso8859-5.h
|
||||
iso8859-6.h
|
||||
iso8859-7.h
|
||||
iso8859-8.h
|
||||
iso8859-9.h
|
||||
koi-8.h
|
250
iconvdata/8bit-gap.c
Normal file
250
iconvdata/8bit-gap.c
Normal file
@ -0,0 +1,250 @@
|
||||
/* Generic conversion to and from 8bit charsets,
|
||||
converting from UCS using gaps.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <gconv.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
struct gap
|
||||
{
|
||||
uint16_t start;
|
||||
uint16_t end;
|
||||
int16_t idx;
|
||||
};
|
||||
|
||||
/* Now we can include the tables. */
|
||||
#include TABLES
|
||||
|
||||
/* Direction of the transformation. */
|
||||
enum direction
|
||||
{
|
||||
illegal,
|
||||
to_8bit,
|
||||
from_8bit
|
||||
};
|
||||
|
||||
struct s_8bit_data
|
||||
{
|
||||
enum direction dir;
|
||||
};
|
||||
|
||||
|
||||
int
|
||||
gconv_init (struct gconv_step *step, struct gconv_step_data *data)
|
||||
{
|
||||
/* Determine which direction. */
|
||||
struct s_8bit_data *new_data;
|
||||
enum direction dir;
|
||||
int result;
|
||||
|
||||
if (__strcasestr (step->from_name, NAME) != NULL)
|
||||
dir = from_8bit;
|
||||
else if (__strcasestr (step->to_name, NAME) != NULL)
|
||||
dir = to_8bit;
|
||||
else
|
||||
dir = illegal;
|
||||
|
||||
result = GCONV_NOCONV;
|
||||
if (dir != illegal
|
||||
&& ((new_data
|
||||
= (struct s_8bit_data *) malloc (sizeof (struct s_8bit_data)))
|
||||
!= NULL))
|
||||
{
|
||||
new_data->dir = dir;
|
||||
data->data = new_data;
|
||||
result = GCONV_OK;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gconv_end (struct gconv_step_data *data)
|
||||
{
|
||||
free (data->data);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
gconv (struct gconv_step *step, struct gconv_step_data *data,
|
||||
const char *inbuf, size_t *inbufsize, size_t *written, int do_flush)
|
||||
{
|
||||
struct gconv_step *next_step = step + 1;
|
||||
struct gconv_step_data *next_data = data + 1;
|
||||
gconv_fct fct = next_step->fct;
|
||||
size_t do_write;
|
||||
int result;
|
||||
|
||||
/* If the function is called with no input this means we have to reset
|
||||
to the initial state. The possibly partly converted input is
|
||||
dropped. */
|
||||
if (do_flush)
|
||||
{
|
||||
do_write = 0;
|
||||
|
||||
/* Call the steps down the chain if there are any. */
|
||||
if (data->is_last)
|
||||
result = GCONV_OK;
|
||||
else
|
||||
{
|
||||
struct gconv_step *next_step = step + 1;
|
||||
struct gconv_step_data *next_data = data + 1;
|
||||
|
||||
result = (*fct) (next_step, next_data, NULL, 0, written, 1);
|
||||
|
||||
/* Clear output buffer. */
|
||||
data->outbufavail = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
enum direction dir = ((struct s_8bit_data *) data->data)->dir;
|
||||
|
||||
do_write = 0;
|
||||
|
||||
do
|
||||
{
|
||||
result = GCONV_OK;
|
||||
|
||||
if (dir == from_8bit)
|
||||
{
|
||||
size_t inchars = *inbufsize;
|
||||
size_t outwchars = data->outbufavail;
|
||||
char *outbuf = data->outbuf;
|
||||
size_t cnt = 0;
|
||||
|
||||
while (cnt < inchars
|
||||
&& (outwchars + sizeof (wchar_t) <= data->outbufsize))
|
||||
{
|
||||
wchar_t ch = to_ucs4[(unsigned int) inbuf[cnt]];
|
||||
|
||||
if (ch == L'\0' && inbuf[cnt] != '\0')
|
||||
{
|
||||
/* This is an illegal character. */
|
||||
result = GCONV_ILLEGAL_INPUT;
|
||||
break;
|
||||
}
|
||||
|
||||
*((wchar_t *) (outbuf + outwchars)) = ch;
|
||||
++do_write;
|
||||
outwchars += sizeof (wchar_t);
|
||||
++cnt;
|
||||
}
|
||||
*inbufsize -= cnt;
|
||||
data->outbufavail = outwchars;
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t inwchars = *inbufsize;
|
||||
size_t outchars = data->outbufavail;
|
||||
char *outbuf = data->outbuf;
|
||||
size_t cnt = 0;
|
||||
|
||||
while (inwchars >= cnt + sizeof (wchar_t)
|
||||
&& outchars < data->outbufsize)
|
||||
{
|
||||
const struct gap *rp = from_idx;
|
||||
unsigned int ch = *((wchar_t *) (inbuf + cnt));
|
||||
char res;
|
||||
|
||||
while (ch > rp->end)
|
||||
++rp;
|
||||
if (ch < rp->start)
|
||||
/* No valid character. */
|
||||
break;
|
||||
|
||||
res = from_ucs4[ch + rp->idx];
|
||||
if (res == '\0' && ch != 0)
|
||||
/* No valid character. */
|
||||
break;
|
||||
|
||||
outbuf[outchars] = res;
|
||||
++do_write;
|
||||
++outchars;
|
||||
cnt += sizeof (wchar_t);
|
||||
}
|
||||
*inbufsize -= cnt;
|
||||
data->outbufavail = outchars;
|
||||
|
||||
if (outchars < data->outbufsize)
|
||||
{
|
||||
/* If there is still room in the output buffer something
|
||||
is wrong with the input. */
|
||||
if (inwchars >= cnt + sizeof (wchar_t))
|
||||
{
|
||||
/* An error occurred. */
|
||||
result = GCONV_ILLEGAL_INPUT;
|
||||
break;
|
||||
}
|
||||
if (inwchars != cnt)
|
||||
{
|
||||
/* There are some unprocessed bytes at the end of the
|
||||
input buffer. */
|
||||
result = GCONV_INCOMPLETE_INPUT;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (result != GCONV_OK)
|
||||
break;
|
||||
|
||||
if (data->is_last)
|
||||
{
|
||||
/* This is the last step. */
|
||||
result = (*inbufsize > (dir == from_8bit
|
||||
? 0 : sizeof (wchar_t) - 1)
|
||||
? GCONV_FULL_OUTPUT : GCONV_EMPTY_INPUT);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Status so far. */
|
||||
result = GCONV_EMPTY_INPUT;
|
||||
|
||||
if (data->outbufavail > 0)
|
||||
{
|
||||
/* Call the functions below in the chain. */
|
||||
size_t newavail = data->outbufavail;
|
||||
|
||||
result = (*fct) (next_step, next_data, data->outbuf, &newavail,
|
||||
written, 0);
|
||||
|
||||
/* Correct the output buffer. */
|
||||
if (newavail != data->outbufavail && newavail > 0)
|
||||
{
|
||||
memmove (data->outbuf,
|
||||
&data->outbuf[data->outbufavail - newavail],
|
||||
newavail);
|
||||
data->outbufavail = newavail;
|
||||
}
|
||||
}
|
||||
}
|
||||
while (*inbufsize > 0 && result == GCONV_EMPTY_INPUT);
|
||||
}
|
||||
|
||||
if (written != NULL && data->is_last)
|
||||
*written = do_write;
|
||||
|
||||
return result;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
/* Generic conversion to and from ISO 8859-XXX.
|
||||
/* Generic conversion to and from 8bit charsets.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
@ -26,11 +26,11 @@
|
||||
enum direction
|
||||
{
|
||||
illegal,
|
||||
to_iso8859,
|
||||
from_iso8859
|
||||
to_8bit,
|
||||
from_8bit
|
||||
};
|
||||
|
||||
struct iso8859_data
|
||||
struct s_8bit_data
|
||||
{
|
||||
enum direction dir;
|
||||
};
|
||||
@ -40,21 +40,21 @@ int
|
||||
gconv_init (struct gconv_step *step, struct gconv_step_data *data)
|
||||
{
|
||||
/* Determine which direction. */
|
||||
struct iso8859_data *new_data;
|
||||
struct s_8bit_data *new_data;
|
||||
enum direction dir;
|
||||
int result;
|
||||
|
||||
if (__strcasestr (step->from_name, NAME) != NULL)
|
||||
dir = from_iso8859;
|
||||
dir = from_8bit;
|
||||
else if (__strcasestr (step->to_name, NAME) != NULL)
|
||||
dir = to_iso8859;
|
||||
dir = to_8bit;
|
||||
else
|
||||
dir = illegal;
|
||||
|
||||
result = GCONV_NOCONV;
|
||||
if (dir != illegal
|
||||
&& ((new_data
|
||||
= (struct iso8859_data *) malloc (sizeof (struct iso8859_data)))
|
||||
= (struct s_8bit_data *) malloc (sizeof (struct s_8bit_data)))
|
||||
!= NULL))
|
||||
{
|
||||
new_data->dir = dir;
|
||||
@ -106,7 +106,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data,
|
||||
}
|
||||
else
|
||||
{
|
||||
enum direction dir = ((struct iso8859_data *) data->data)->dir;
|
||||
enum direction dir = ((struct s_8bit_data *) data->data)->dir;
|
||||
|
||||
do_write = 0;
|
||||
|
||||
@ -114,7 +114,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data,
|
||||
{
|
||||
result = GCONV_OK;
|
||||
|
||||
if (dir == from_iso8859)
|
||||
if (dir == from_8bit)
|
||||
{
|
||||
size_t inchars = *inbufsize;
|
||||
size_t outwchars = data->outbufavail;
|
||||
@ -124,7 +124,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data,
|
||||
while (cnt < inchars
|
||||
&& (outwchars + sizeof (wchar_t) <= data->outbufsize))
|
||||
{
|
||||
wchar_t ch = to_ucs4[(int) inbuf[cnt]];
|
||||
wchar_t ch = to_ucs4[(unsigned int) inbuf[cnt]];
|
||||
|
||||
if (ch == L'\0' && inbuf[cnt] != '\0')
|
||||
{
|
||||
@ -191,7 +191,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data,
|
||||
if (data->is_last)
|
||||
{
|
||||
/* This is the last step. */
|
||||
result = (*inbufsize > (dir == from_iso8859
|
||||
result = (*inbufsize > (dir == from_8bit
|
||||
? 0 : sizeof (wchar_t) - 1)
|
||||
? GCONV_FULL_OUTPUT : GCONV_EMPTY_INPUT);
|
||||
break;
|
@ -22,12 +22,15 @@
|
||||
subdir := iconvdata
|
||||
|
||||
# Names of all the shared objects which implement the transformations.
|
||||
modules := ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 \
|
||||
ISO8859-6 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-10 \
|
||||
T.61 ISO_6937
|
||||
modules := ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 \
|
||||
ISO8859-6 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-10 \
|
||||
T.61 ISO_6937 SJIS KOI-8 KOI8-R LATIN-GREEK LATIN-GREEK-1 \
|
||||
HP-ROMAN8 EBCDIC-AT-DE EBCDIC-AT-DE-A EBCDIC-CA-FR
|
||||
modules.so := $(addsuffix .so, $(modules))
|
||||
|
||||
|
||||
include ../Makeconfig
|
||||
|
||||
ISO8859-1-routines := iso8859-1
|
||||
ISO8859-2-routines := iso8859-2
|
||||
ISO8859-3-routines := iso8859-3
|
||||
@ -40,15 +43,29 @@ ISO8859-9-routines := iso8859-9
|
||||
ISO8859-10-routines := iso8859-10
|
||||
T.61-routines := t61
|
||||
ISO_6937-routines := iso6937
|
||||
SJIS-routines := sjis
|
||||
KOI-8-routines := koi-8
|
||||
KOI8-R-routines := koi8-r
|
||||
LATIN-GREEK-routines := latin-greek
|
||||
LATIN-GREEK-1-routines := latin-greek-1
|
||||
HP-ROMAN8-routines := hp-roman8
|
||||
EBCDIC-AT-DE-routines := ebcdic-at-de
|
||||
EBCDIC-AT-DE-A-routines := ebcdic-at-de-a
|
||||
EBCDIC-CA-FR-routines := ebcdic-ca-fr
|
||||
|
||||
distribute := iso8859-generic.c \
|
||||
extra-libs = libJIS
|
||||
extra-libs-others = $(extra-libs)
|
||||
|
||||
libJIS-routines := jis0201 jis0208 jis0212
|
||||
libJIS-inhibit-o := $(filter-out .os,$(object-suffixes))
|
||||
|
||||
distribute := 8bit-generic.c 8bit-gap.c gap.pl gaptab.pl \
|
||||
iso8859-1.c iso8859-2.c iso8859-3.c iso8859-4.c iso8859-5.c \
|
||||
iso8859-6.c iso8859-7.c iso8859-8.c iso8859-9.c iso8859-10.c\
|
||||
iso8859-2.h iso8859-3.h iso8859-4.h iso8859-5.h iso8859-6.h \
|
||||
iso8859-7.h iso8859-8.h iso8859-9.h iso8859-10.h t61.c \
|
||||
iso6937.c
|
||||
|
||||
include ../Makeconfig
|
||||
t61.c iso6937.c sjis.c jis0201.h jis0208.h jis0212.h \
|
||||
koi-8.c koi8-r.c koi8-r.h hp-roman8.c latin-greek.c \
|
||||
latin-greek.h latin-greek-1.c latin-greek-1.h ebcdic-at-de.c\
|
||||
ebcdic-at-de-a.c ebcdic-ca-fr.c
|
||||
|
||||
# We build the transformation modules only when we build shared libs.
|
||||
ifeq (yes,$(build-shared))
|
||||
@ -76,39 +93,83 @@ install-others = $(addprefix $(inst_gconvdir)/, $(modules.so)) \
|
||||
|
||||
# If we have the localedata add-on available we can build the conversion
|
||||
# tables for numerous charsets.
|
||||
ifneq (,$(findstring localedata,$(add-ons)))
|
||||
define generate-8bit-table
|
||||
( echo "static const wchar_t to_ucs4[256] = {"; \
|
||||
sed -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/ [0x\1] = 0x\2,/p' -e d $^ | sort -u; \
|
||||
sed -e '/^[^[:space:]]*[[:space:]]*.x00/d' -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/ [0x\1] = 0x\2,/p' -e d $^ | sort -u; \
|
||||
echo "};"; \
|
||||
echo "static const char from_ucs4[] = {"; \
|
||||
sed -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/ [0x\2] = 0x\1,/p' -e d $^ | sort -u; \
|
||||
sed -e '/^[^[:space:]]*[[:space:]]*.x00/d' -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/ [0x\2] = 0x\1,/p' -e d $^ | sort -u; \
|
||||
echo "};" ) > $@.new && rm -f $@ && mv $@.new $@
|
||||
endef
|
||||
|
||||
iso8859-2.h: ../localedata/charmaps/ISO-8859-2
|
||||
sed-generated-headers := iso8859-2.h iso8859-3.h iso8859-4.h iso8859-5.h \
|
||||
iso8859-6.h iso8859-7.h iso8859-8.h iso8859-9.h \
|
||||
iso8859-10.h koi-8.h hp-roman8.h ebcdic-at-de.h \
|
||||
ebcdic-at-de-a.h ebcdic-ca-fr.h
|
||||
|
||||
define generate-8bit-gap-table
|
||||
( echo "static const wchar_t to_ucs4[256] = {"; \
|
||||
sed -e '/^[^[:space:]]*[[:space:]]*.x00/d' -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/ [0x\1] = 0x\2,/p' -e d $^ | sort -u; \
|
||||
echo "};"; \
|
||||
echo "static struct gap from_idx[] = {"; \
|
||||
sed -e '/^[^[:space:]]*[[:space:]]*.x00/d' -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/0x\2 0x\1/p' -e d $^ | sort -u | $(PERL) gap.pl; \
|
||||
echo " { start: 0xffff, end: 0xffff, idx: 0 }"; \
|
||||
echo "};"; \
|
||||
echo "static const char from_ucs4[] = {"; \
|
||||
sed -e '/^[^[:space:]]*[[:space:]]*.x00/d' -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/0x\2 0x\1/p' -e d $^ | sort -u | $(PERL) gaptab.pl; \
|
||||
echo "};" ) > $@.new && rm -f $@ && mv $@.new $@
|
||||
endef
|
||||
|
||||
perl-generated-headers := koi8-r.h latin-greek.h latin-greek-1.h
|
||||
|
||||
# The headers must be generated before the compilation.
|
||||
before-compile = $(sed-generated-headers) $(perl-generated-headers)
|
||||
|
||||
|
||||
# Rules to generate the headers.
|
||||
iso8859-2.h: ../localedata/charmaps/ISO-8859-2 Makefile
|
||||
$(generate-8bit-table)
|
||||
iso8859-3.h: ../localedata/charmaps/ISO-8859-3
|
||||
iso8859-3.h: ../localedata/charmaps/ISO-8859-3 Makefile
|
||||
$(generate-8bit-table)
|
||||
iso8859-4.h: ../localedata/charmaps/ISO-8859-4
|
||||
iso8859-4.h: ../localedata/charmaps/ISO-8859-4 Makefile
|
||||
$(generate-8bit-table)
|
||||
iso8859-5.h: ../localedata/charmaps/ISO-8859-5
|
||||
iso8859-5.h: ../localedata/charmaps/ISO-8859-5 Makefile
|
||||
$(generate-8bit-table)
|
||||
iso8859-6.h: ../localedata/charmaps/ISO-8859-6
|
||||
iso8859-6.h: ../localedata/charmaps/ISO-8859-6 Makefile
|
||||
$(generate-8bit-table)
|
||||
iso8859-7.h: ../localedata/charmaps/ISO-8859-7
|
||||
iso8859-7.h: ../localedata/charmaps/ISO-8859-7 Makefile
|
||||
$(generate-8bit-table)
|
||||
iso8859-8.h: ../localedata/charmaps/ISO-8859-8
|
||||
iso8859-8.h: ../localedata/charmaps/ISO-8859-8 Makefile
|
||||
$(generate-8bit-table)
|
||||
iso8859-9.h: ../localedata/charmaps/ISO-8859-9
|
||||
iso8859-9.h: ../localedata/charmaps/ISO-8859-9 Makefile
|
||||
$(generate-8bit-table)
|
||||
iso8859-10.h: ../localedata/charmaps/ISO-8859-10
|
||||
iso8859-10.h: ../localedata/charmaps/ISO-8859-10 Makefile
|
||||
$(generate-8bit-table)
|
||||
|
||||
headers: iso8859-2.h iso8859-3.h iso8859-4.h iso8859-5.h iso8859-6.h \
|
||||
iso8859-7.h iso8859-8.h iso8859-9.h iso8859-10.h
|
||||
koi-8.h: ../localedata/charmaps/KOI-8 Makefile
|
||||
$(generate-8bit-table)
|
||||
|
||||
hp-roman8.h: ../localedata/charmaps/HP-ROMAN8 Makefile
|
||||
$(generate-8bit-table)
|
||||
|
||||
ebcdic-at-de.h: ../localedata/charmaps/EBCDIC-AT-DE Makefile
|
||||
$(generate-8bit-table)
|
||||
ebcdic-at-de-a.h: ../localedata/charmaps/EBCDIC-AT-DE-A Makefile
|
||||
$(generate-8bit-table)
|
||||
ebcdic-ca-fr.h: ../localedata/charmaps/EBCDIC-CA-FR Makefile
|
||||
$(generate-8bit-table)
|
||||
|
||||
ifneq ($(PERL),no)
|
||||
koi8-r.h: ../localedata/charmaps/KOI8-R Makefile
|
||||
$(generate-8bit-gap-table)
|
||||
latin-greek.h: ../localedata/charmaps/LATIN-GREEK Makefile
|
||||
$(generate-8bit-gap-table)
|
||||
latin-greek-1.h: ../localedata/charmaps/LATIN-GREEK-1 Makefile
|
||||
$(generate-8bit-gap-table)
|
||||
endif
|
||||
|
||||
headers: $(sed-generated-headers) $(perl-generated-headers)
|
||||
|
||||
|
||||
$(addprefix $(inst_gconvdir)/, $(modules.so)): $(inst_gconvdir)/%: $(objpfx)%
|
||||
$(do-install-program)
|
||||
|
5
iconvdata/configure
vendored
5
iconvdata/configure
vendored
@ -1,5 +0,0 @@
|
||||
# This is only to keep the GNU C library configure mechanism happy.
|
||||
#
|
||||
# Perhaps some day we need a real configuration script for different
|
||||
# kernel versions or so.
|
||||
exit 0
|
24
iconvdata/ebcdic-at-de-a.c
Normal file
24
iconvdata/ebcdic-at-de-a.c
Normal file
@ -0,0 +1,24 @@
|
||||
/* Conversion from and to EBCDIC-AT-DE-A.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <wchar.h>
|
||||
#include <ebcdic-at-de-a.h>
|
||||
#define NAME "EBCDIC-AT-DE-A"
|
||||
#include <8bit-generic.c>
|
24
iconvdata/ebcdic-at-de.c
Normal file
24
iconvdata/ebcdic-at-de.c
Normal file
@ -0,0 +1,24 @@
|
||||
/* Conversion from and to EBCDIC-AT-DE.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <wchar.h>
|
||||
#include <ebcdic-at-de.h>
|
||||
#define NAME "EBCDIC-AT-DE"
|
||||
#include <8bit-generic.c>
|
24
iconvdata/ebcdic-ca-fr.c
Normal file
24
iconvdata/ebcdic-ca-fr.c
Normal file
@ -0,0 +1,24 @@
|
||||
/* Conversion from and to EBCDIC-CA-FR.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <wchar.h>
|
||||
#include <ebcdic-ca-fr.h>
|
||||
#define NAME "EBCDIC-CA-FR"
|
||||
#include <8bit-generic.c>
|
16
iconvdata/gap.pl
Normal file
16
iconvdata/gap.pl
Normal file
@ -0,0 +1,16 @@
|
||||
$first=$last=$idx=0;
|
||||
while (<>) {
|
||||
local($ucs,%rest) = split;
|
||||
local($u)=hex($ucs);
|
||||
if ($u - $last > 6) {
|
||||
if ($last != 0) {
|
||||
printf (" { start: %#06x, end: %#06x, idx: %5d },\n",
|
||||
$first, $last, $idx - $first);
|
||||
$idx += $last - $first + 1;
|
||||
}
|
||||
$first=$u;
|
||||
}
|
||||
$last=$u;
|
||||
}
|
||||
printf (" { start: %#06x, end: %#06x, idx: %5d },\n",
|
||||
$first, $last, $idx - $first);
|
25
iconvdata/gaptab.pl
Normal file
25
iconvdata/gaptab.pl
Normal file
@ -0,0 +1,25 @@
|
||||
$first=$last=$idx=0;
|
||||
sub fmt {
|
||||
printf ("\n ") if (($n % 8) == 0);
|
||||
++$n;
|
||||
my($val) = pop(@_);
|
||||
printf (" '\\x%02x',", $val);
|
||||
}
|
||||
while (<>) {
|
||||
local($ucs,$char,%rest) = split;
|
||||
local($u)=hex($ucs);
|
||||
local($c)=hex($char);
|
||||
if ($u - $last > 6) {
|
||||
if ($last != 0) {
|
||||
$idx += $last - $first + 1;
|
||||
}
|
||||
$first=$u;
|
||||
} else {
|
||||
for ($m = $last + 1; $m < $u; ++$m) {
|
||||
fmt (0);
|
||||
}
|
||||
}
|
||||
fmt ($c);
|
||||
$last=$u;
|
||||
}
|
||||
printf ("\n");
|
@ -143,3 +143,44 @@ alias ISO_6937:1992// ISO_6937//
|
||||
alias ISO6937// ISO_6937//
|
||||
module ISO_6937// ISO-10646/UCS4/ ISO_6937 1
|
||||
module ISO-10646/UCS4/ ISO_6937// ISO_6937 1
|
||||
|
||||
# from to module cost
|
||||
alias SHIFT-JIS// SJIS
|
||||
module SJIS// ISO-10646/UCS4/ SJIS 1
|
||||
module ISO-10646/UCS4/ SJIS SJIS 1
|
||||
|
||||
# from to module cost
|
||||
module KOI-8// ISO-10646/UCS4/ KOI-8 1
|
||||
module ISO-10646/UCS4/ KOI-8// KOI-8 1
|
||||
|
||||
# from to module cost
|
||||
module KOI8-R// ISO-10646/UCS4/ KOI8-R 1
|
||||
module ISO-10646/UCS4/ KOI8-R// KOI8-R 1
|
||||
|
||||
# from to module cost
|
||||
alias ISO-IR-19// LATIN-GREEK//
|
||||
module LATIN-GREEK// ISO-10646/UCS4/ LATIN-GREEK 1
|
||||
module ISO-10646/UCS4/ LATIN-GREEK// LATIN-GREEK 1
|
||||
|
||||
# from to module cost
|
||||
alias ISO-IR-27// LATIN-GREEK//
|
||||
module LATIN-GREEK-1// ISO-10646/UCS4/ LATIN-GREEK-1 1
|
||||
module ISO-10646/UCS4/ LATIN-GREEK-1// LATIN-GREEK-1 1
|
||||
|
||||
# from to module cost
|
||||
alias ROMAN8// HP-ROMAN8//
|
||||
alias R8// HP-ROMAN8//
|
||||
module HP-ROMAN8// ISO-10646/UCS4/ HP-ROMAN8 1
|
||||
module ISO-10646/UCS4/ HP-ROMAN8// HP-ROMAN8 1
|
||||
|
||||
# from to module cost
|
||||
module EBCDIC-AT-DE// ISO-10646/UCS4/ EBCDIC-AT-DE 1
|
||||
module ISO-10646/UCS4/ EBCDIC-AT-DE// EBCDIC-AT-DE 1
|
||||
|
||||
# from to module cost
|
||||
module EBCDIC-AT-DE-A// ISO-10646/UCS4/ EBCDIC-AT-DE-A 1
|
||||
module ISO-10646/UCS4/ EBCDIC-AT-DE-A// EBCDIC-AT-DE-A 1
|
||||
|
||||
# from to module cost
|
||||
module EBCDIC-CA-FR// ISO-10646/UCS4/ EBCDIC-CA-FR 1
|
||||
module ISO-10646/UCS4/ EBCDIC-CA-FR// EBCDIC-CA-FR 1
|
||||
|
24
iconvdata/hp-roman8.c
Normal file
24
iconvdata/hp-roman8.c
Normal file
@ -0,0 +1,24 @@
|
||||
/* Conversion from and to HP-ROMAN8.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <wchar.h>
|
||||
#include <hp-roman8.h>
|
||||
#define NAME "HP-ROMAN8"
|
||||
#include <8bit-generic.c>
|
@ -498,6 +498,10 @@ gconv (struct gconv_step *step, struct gconv_step_data *data,
|
||||
ch = L'\0';
|
||||
else
|
||||
ch = to_ucs4_comb[inchar - 0xc1][inchar2 - 0x20];
|
||||
|
||||
if (ch == L'\0')
|
||||
/* Undo the increment for illegal characters. */
|
||||
--cnt;
|
||||
}
|
||||
else
|
||||
ch = to_ucs4[inchar];
|
||||
|
@ -142,7 +142,8 @@ gconv (struct gconv_step *step, struct gconv_step_data *data,
|
||||
while (inwchars >= cnt + sizeof (wchar_t)
|
||||
&& outchars < data->outbufsize)
|
||||
{
|
||||
if (*((wchar_t *) (inbuf + cnt)) <= L'\377')
|
||||
if (*((wchar_t *) (inbuf + cnt)) >= L'\0'
|
||||
&& *((wchar_t *) (inbuf + cnt)) <= L'\377')
|
||||
outbuf[outchars] = *((wchar_t *) (inbuf + cnt));
|
||||
else
|
||||
/* Here is where the transliteration would enter the
|
||||
|
@ -21,4 +21,4 @@
|
||||
#include <wchar.h>
|
||||
#include <iso8859-10.h>
|
||||
#define NAME "ISO-8859-10"
|
||||
#include <iso8859-generic.c>
|
||||
#include <8bit-generic.c>
|
||||
|
@ -1,516 +0,0 @@
|
||||
static const wchar_t to_ucs4[256] = {
|
||||
[0x00] = 0x0000,
|
||||
[0x01] = 0x0001,
|
||||
[0x02] = 0x0002,
|
||||
[0x03] = 0x0003,
|
||||
[0x04] = 0x0004,
|
||||
[0x05] = 0x0005,
|
||||
[0x06] = 0x0006,
|
||||
[0x07] = 0x0007,
|
||||
[0x08] = 0x0008,
|
||||
[0x09] = 0x0009,
|
||||
[0x0A] = 0x000A,
|
||||
[0x0B] = 0x000B,
|
||||
[0x0C] = 0x000C,
|
||||
[0x0D] = 0x000D,
|
||||
[0x0E] = 0x000E,
|
||||
[0x0F] = 0x000F,
|
||||
[0x10] = 0x0010,
|
||||
[0x11] = 0x0011,
|
||||
[0x12] = 0x0012,
|
||||
[0x13] = 0x0013,
|
||||
[0x14] = 0x0014,
|
||||
[0x15] = 0x0015,
|
||||
[0x16] = 0x0016,
|
||||
[0x17] = 0x0017,
|
||||
[0x18] = 0x0018,
|
||||
[0x19] = 0x0019,
|
||||
[0x1A] = 0x001A,
|
||||
[0x1B] = 0x001B,
|
||||
[0x1C] = 0x001C,
|
||||
[0x1D] = 0x001D,
|
||||
[0x1E] = 0x001E,
|
||||
[0x1F] = 0x001F,
|
||||
[0x20] = 0x0020,
|
||||
[0x21] = 0x0021,
|
||||
[0x22] = 0x0022,
|
||||
[0x23] = 0x0023,
|
||||
[0x24] = 0x0024,
|
||||
[0x25] = 0x0025,
|
||||
[0x26] = 0x0026,
|
||||
[0x27] = 0x0027,
|
||||
[0x28] = 0x0028,
|
||||
[0x29] = 0x0029,
|
||||
[0x2A] = 0x002A,
|
||||
[0x2B] = 0x002B,
|
||||
[0x2C] = 0x002C,
|
||||
[0x2D] = 0x002D,
|
||||
[0x2E] = 0x002E,
|
||||
[0x2F] = 0x002F,
|
||||
[0x30] = 0x0030,
|
||||
[0x31] = 0x0031,
|
||||
[0x32] = 0x0032,
|
||||
[0x33] = 0x0033,
|
||||
[0x34] = 0x0034,
|
||||
[0x35] = 0x0035,
|
||||
[0x36] = 0x0036,
|
||||
[0x37] = 0x0037,
|
||||
[0x38] = 0x0038,
|
||||
[0x39] = 0x0039,
|
||||
[0x3A] = 0x003A,
|
||||
[0x3B] = 0x003B,
|
||||
[0x3C] = 0x003C,
|
||||
[0x3D] = 0x003D,
|
||||
[0x3E] = 0x003E,
|
||||
[0x3F] = 0x003F,
|
||||
[0x40] = 0x0040,
|
||||
[0x41] = 0x0041,
|
||||
[0x42] = 0x0042,
|
||||
[0x43] = 0x0043,
|
||||
[0x44] = 0x0044,
|
||||
[0x45] = 0x0045,
|
||||
[0x46] = 0x0046,
|
||||
[0x47] = 0x0047,
|
||||
[0x48] = 0x0048,
|
||||
[0x49] = 0x0049,
|
||||
[0x4A] = 0x004A,
|
||||
[0x4B] = 0x004B,
|
||||
[0x4C] = 0x004C,
|
||||
[0x4D] = 0x004D,
|
||||
[0x4E] = 0x004E,
|
||||
[0x4F] = 0x004F,
|
||||
[0x50] = 0x0050,
|
||||
[0x51] = 0x0051,
|
||||
[0x52] = 0x0052,
|
||||
[0x53] = 0x0053,
|
||||
[0x54] = 0x0054,
|
||||
[0x55] = 0x0055,
|
||||
[0x56] = 0x0056,
|
||||
[0x57] = 0x0057,
|
||||
[0x58] = 0x0058,
|
||||
[0x59] = 0x0059,
|
||||
[0x5A] = 0x005A,
|
||||
[0x5B] = 0x005B,
|
||||
[0x5C] = 0x005C,
|
||||
[0x5D] = 0x005D,
|
||||
[0x5E] = 0x005E,
|
||||
[0x5F] = 0x005F,
|
||||
[0x60] = 0x0060,
|
||||
[0x61] = 0x0061,
|
||||
[0x62] = 0x0062,
|
||||
[0x63] = 0x0063,
|
||||
[0x64] = 0x0064,
|
||||
[0x65] = 0x0065,
|
||||
[0x66] = 0x0066,
|
||||
[0x67] = 0x0067,
|
||||
[0x68] = 0x0068,
|
||||
[0x69] = 0x0069,
|
||||
[0x6A] = 0x006A,
|
||||
[0x6B] = 0x006B,
|
||||
[0x6C] = 0x006C,
|
||||
[0x6D] = 0x006D,
|
||||
[0x6E] = 0x006E,
|
||||
[0x6F] = 0x006F,
|
||||
[0x70] = 0x0070,
|
||||
[0x71] = 0x0071,
|
||||
[0x72] = 0x0072,
|
||||
[0x73] = 0x0073,
|
||||
[0x74] = 0x0074,
|
||||
[0x75] = 0x0075,
|
||||
[0x76] = 0x0076,
|
||||
[0x77] = 0x0077,
|
||||
[0x78] = 0x0078,
|
||||
[0x79] = 0x0079,
|
||||
[0x7A] = 0x007A,
|
||||
[0x7B] = 0x007B,
|
||||
[0x7C] = 0x007C,
|
||||
[0x7D] = 0x007D,
|
||||
[0x7E] = 0x007E,
|
||||
[0x7F] = 0x007F,
|
||||
[0x80] = 0x0080,
|
||||
[0x81] = 0x0081,
|
||||
[0x82] = 0x0082,
|
||||
[0x83] = 0x0083,
|
||||
[0x84] = 0x0084,
|
||||
[0x85] = 0x0085,
|
||||
[0x86] = 0x0086,
|
||||
[0x87] = 0x0087,
|
||||
[0x88] = 0x0088,
|
||||
[0x89] = 0x0089,
|
||||
[0x8A] = 0x008A,
|
||||
[0x8B] = 0x008B,
|
||||
[0x8C] = 0x008C,
|
||||
[0x8D] = 0x008D,
|
||||
[0x8E] = 0x008E,
|
||||
[0x8F] = 0x008F,
|
||||
[0x90] = 0x0090,
|
||||
[0x91] = 0x0091,
|
||||
[0x92] = 0x0092,
|
||||
[0x93] = 0x0093,
|
||||
[0x94] = 0x0094,
|
||||
[0x95] = 0x0095,
|
||||
[0x96] = 0x0096,
|
||||
[0x97] = 0x0097,
|
||||
[0x98] = 0x0098,
|
||||
[0x99] = 0x0099,
|
||||
[0x9A] = 0x009A,
|
||||
[0x9B] = 0x009B,
|
||||
[0x9C] = 0x009C,
|
||||
[0x9D] = 0x009D,
|
||||
[0x9E] = 0x009E,
|
||||
[0x9F] = 0x009F,
|
||||
[0xA0] = 0x00A0,
|
||||
[0xA1] = 0x0104,
|
||||
[0xA2] = 0x0112,
|
||||
[0xA3] = 0x0122,
|
||||
[0xA4] = 0x012A,
|
||||
[0xA5] = 0x0128,
|
||||
[0xA6] = 0x0136,
|
||||
[0xA7] = 0x00A7,
|
||||
[0xA8] = 0x013B,
|
||||
[0xA9] = 0x0110,
|
||||
[0xAA] = 0x0160,
|
||||
[0xAB] = 0x0166,
|
||||
[0xAC] = 0x017D,
|
||||
[0xAD] = 0x00AD,
|
||||
[0xAE] = 0x016A,
|
||||
[0xAF] = 0x014A,
|
||||
[0xB0] = 0x00B0,
|
||||
[0xB1] = 0x0105,
|
||||
[0xB2] = 0x0113,
|
||||
[0xB3] = 0x0123,
|
||||
[0xB4] = 0x012B,
|
||||
[0xB5] = 0x0129,
|
||||
[0xB6] = 0x0137,
|
||||
[0xB7] = 0x00B7,
|
||||
[0xB8] = 0x013C,
|
||||
[0xB9] = 0x0111,
|
||||
[0xBA] = 0x0161,
|
||||
[0xBB] = 0x0167,
|
||||
[0xBC] = 0x017E,
|
||||
[0xBD] = 0x2014,
|
||||
[0xBE] = 0x016B,
|
||||
[0xBF] = 0x014B,
|
||||
[0xC0] = 0x0100,
|
||||
[0xC1] = 0x00C1,
|
||||
[0xC2] = 0x00C2,
|
||||
[0xC3] = 0x00C3,
|
||||
[0xC4] = 0x00C4,
|
||||
[0xC5] = 0x00C5,
|
||||
[0xC6] = 0x00C6,
|
||||
[0xC7] = 0x012E,
|
||||
[0xC8] = 0x010C,
|
||||
[0xC9] = 0x00C9,
|
||||
[0xCA] = 0x0118,
|
||||
[0xCB] = 0x00CB,
|
||||
[0xCC] = 0x0116,
|
||||
[0xCD] = 0x00CD,
|
||||
[0xCE] = 0x00CE,
|
||||
[0xCF] = 0x00CF,
|
||||
[0xD0] = 0x00D0,
|
||||
[0xD1] = 0x0145,
|
||||
[0xD2] = 0x014C,
|
||||
[0xD3] = 0x00D3,
|
||||
[0xD4] = 0x00D4,
|
||||
[0xD5] = 0x00D5,
|
||||
[0xD6] = 0x00D6,
|
||||
[0xD7] = 0x0168,
|
||||
[0xD8] = 0x00D8,
|
||||
[0xD9] = 0x0172,
|
||||
[0xDA] = 0x00DA,
|
||||
[0xDB] = 0x00DB,
|
||||
[0xDC] = 0x00DC,
|
||||
[0xDD] = 0x00DD,
|
||||
[0xDE] = 0x00DE,
|
||||
[0xDF] = 0x00DF,
|
||||
[0xE0] = 0x0101,
|
||||
[0xE1] = 0x00E1,
|
||||
[0xE2] = 0x00E2,
|
||||
[0xE3] = 0x00E3,
|
||||
[0xE4] = 0x00E4,
|
||||
[0xE5] = 0x00E5,
|
||||
[0xE6] = 0x00E6,
|
||||
[0xE7] = 0x012F,
|
||||
[0xE8] = 0x010D,
|
||||
[0xE9] = 0x00E9,
|
||||
[0xEA] = 0x0119,
|
||||
[0xEB] = 0x00EB,
|
||||
[0xEC] = 0x0117,
|
||||
[0xED] = 0x00ED,
|
||||
[0xEE] = 0x00EE,
|
||||
[0xEF] = 0x00EF,
|
||||
[0xF0] = 0x00F0,
|
||||
[0xF1] = 0x0146,
|
||||
[0xF2] = 0x014D,
|
||||
[0xF3] = 0x00F3,
|
||||
[0xF4] = 0x00F4,
|
||||
[0xF5] = 0x00F5,
|
||||
[0xF6] = 0x00F6,
|
||||
[0xF7] = 0x0169,
|
||||
[0xF8] = 0x00F8,
|
||||
[0xF9] = 0x0173,
|
||||
[0xFA] = 0x00FA,
|
||||
[0xFB] = 0x00FB,
|
||||
[0xFC] = 0x00FC,
|
||||
[0xFD] = 0x00FD,
|
||||
[0xFE] = 0x00FE,
|
||||
[0xFF] = 0x0138,
|
||||
};
|
||||
static const char from_ucs4[] = {
|
||||
[0x0000] = 0x00,
|
||||
[0x0001] = 0x01,
|
||||
[0x0002] = 0x02,
|
||||
[0x0003] = 0x03,
|
||||
[0x0004] = 0x04,
|
||||
[0x0005] = 0x05,
|
||||
[0x0006] = 0x06,
|
||||
[0x0007] = 0x07,
|
||||
[0x0008] = 0x08,
|
||||
[0x0009] = 0x09,
|
||||
[0x000A] = 0x0A,
|
||||
[0x000B] = 0x0B,
|
||||
[0x000C] = 0x0C,
|
||||
[0x000D] = 0x0D,
|
||||
[0x000E] = 0x0E,
|
||||
[0x000F] = 0x0F,
|
||||
[0x0010] = 0x10,
|
||||
[0x0011] = 0x11,
|
||||
[0x0012] = 0x12,
|
||||
[0x0013] = 0x13,
|
||||
[0x0014] = 0x14,
|
||||
[0x0015] = 0x15,
|
||||
[0x0016] = 0x16,
|
||||
[0x0017] = 0x17,
|
||||
[0x0018] = 0x18,
|
||||
[0x0019] = 0x19,
|
||||
[0x001A] = 0x1A,
|
||||
[0x001B] = 0x1B,
|
||||
[0x001C] = 0x1C,
|
||||
[0x001D] = 0x1D,
|
||||
[0x001E] = 0x1E,
|
||||
[0x001F] = 0x1F,
|
||||
[0x0020] = 0x20,
|
||||
[0x0021] = 0x21,
|
||||
[0x0022] = 0x22,
|
||||
[0x0023] = 0x23,
|
||||
[0x0024] = 0x24,
|
||||
[0x0025] = 0x25,
|
||||
[0x0026] = 0x26,
|
||||
[0x0027] = 0x27,
|
||||
[0x0028] = 0x28,
|
||||
[0x0029] = 0x29,
|
||||
[0x002A] = 0x2A,
|
||||
[0x002B] = 0x2B,
|
||||
[0x002C] = 0x2C,
|
||||
[0x002D] = 0x2D,
|
||||
[0x002E] = 0x2E,
|
||||
[0x002F] = 0x2F,
|
||||
[0x0030] = 0x30,
|
||||
[0x0031] = 0x31,
|
||||
[0x0032] = 0x32,
|
||||
[0x0033] = 0x33,
|
||||
[0x0034] = 0x34,
|
||||
[0x0035] = 0x35,
|
||||
[0x0036] = 0x36,
|
||||
[0x0037] = 0x37,
|
||||
[0x0038] = 0x38,
|
||||
[0x0039] = 0x39,
|
||||
[0x003A] = 0x3A,
|
||||
[0x003B] = 0x3B,
|
||||
[0x003C] = 0x3C,
|
||||
[0x003D] = 0x3D,
|
||||
[0x003E] = 0x3E,
|
||||
[0x003F] = 0x3F,
|
||||
[0x0040] = 0x40,
|
||||
[0x0041] = 0x41,
|
||||
[0x0042] = 0x42,
|
||||
[0x0043] = 0x43,
|
||||
[0x0044] = 0x44,
|
||||
[0x0045] = 0x45,
|
||||
[0x0046] = 0x46,
|
||||
[0x0047] = 0x47,
|
||||
[0x0048] = 0x48,
|
||||
[0x0049] = 0x49,
|
||||
[0x004A] = 0x4A,
|
||||
[0x004B] = 0x4B,
|
||||
[0x004C] = 0x4C,
|
||||
[0x004D] = 0x4D,
|
||||
[0x004E] = 0x4E,
|
||||
[0x004F] = 0x4F,
|
||||
[0x0050] = 0x50,
|
||||
[0x0051] = 0x51,
|
||||
[0x0052] = 0x52,
|
||||
[0x0053] = 0x53,
|
||||
[0x0054] = 0x54,
|
||||
[0x0055] = 0x55,
|
||||
[0x0056] = 0x56,
|
||||
[0x0057] = 0x57,
|
||||
[0x0058] = 0x58,
|
||||
[0x0059] = 0x59,
|
||||
[0x005A] = 0x5A,
|
||||
[0x005B] = 0x5B,
|
||||
[0x005C] = 0x5C,
|
||||
[0x005D] = 0x5D,
|
||||
[0x005E] = 0x5E,
|
||||
[0x005F] = 0x5F,
|
||||
[0x0060] = 0x60,
|
||||
[0x0061] = 0x61,
|
||||
[0x0062] = 0x62,
|
||||
[0x0063] = 0x63,
|
||||
[0x0064] = 0x64,
|
||||
[0x0065] = 0x65,
|
||||
[0x0066] = 0x66,
|
||||
[0x0067] = 0x67,
|
||||
[0x0068] = 0x68,
|
||||
[0x0069] = 0x69,
|
||||
[0x006A] = 0x6A,
|
||||
[0x006B] = 0x6B,
|
||||
[0x006C] = 0x6C,
|
||||
[0x006D] = 0x6D,
|
||||
[0x006E] = 0x6E,
|
||||
[0x006F] = 0x6F,
|
||||
[0x0070] = 0x70,
|
||||
[0x0071] = 0x71,
|
||||
[0x0072] = 0x72,
|
||||
[0x0073] = 0x73,
|
||||
[0x0074] = 0x74,
|
||||
[0x0075] = 0x75,
|
||||
[0x0076] = 0x76,
|
||||
[0x0077] = 0x77,
|
||||
[0x0078] = 0x78,
|
||||
[0x0079] = 0x79,
|
||||
[0x007A] = 0x7A,
|
||||
[0x007B] = 0x7B,
|
||||
[0x007C] = 0x7C,
|
||||
[0x007D] = 0x7D,
|
||||
[0x007E] = 0x7E,
|
||||
[0x007F] = 0x7F,
|
||||
[0x0080] = 0x80,
|
||||
[0x0081] = 0x81,
|
||||
[0x0082] = 0x82,
|
||||
[0x0083] = 0x83,
|
||||
[0x0084] = 0x84,
|
||||
[0x0085] = 0x85,
|
||||
[0x0086] = 0x86,
|
||||
[0x0087] = 0x87,
|
||||
[0x0088] = 0x88,
|
||||
[0x0089] = 0x89,
|
||||
[0x008A] = 0x8A,
|
||||
[0x008B] = 0x8B,
|
||||
[0x008C] = 0x8C,
|
||||
[0x008D] = 0x8D,
|
||||
[0x008E] = 0x8E,
|
||||
[0x008F] = 0x8F,
|
||||
[0x0090] = 0x90,
|
||||
[0x0091] = 0x91,
|
||||
[0x0092] = 0x92,
|
||||
[0x0093] = 0x93,
|
||||
[0x0094] = 0x94,
|
||||
[0x0095] = 0x95,
|
||||
[0x0096] = 0x96,
|
||||
[0x0097] = 0x97,
|
||||
[0x0098] = 0x98,
|
||||
[0x0099] = 0x99,
|
||||
[0x009A] = 0x9A,
|
||||
[0x009B] = 0x9B,
|
||||
[0x009C] = 0x9C,
|
||||
[0x009D] = 0x9D,
|
||||
[0x009E] = 0x9E,
|
||||
[0x009F] = 0x9F,
|
||||
[0x00A0] = 0xA0,
|
||||
[0x00A7] = 0xA7,
|
||||
[0x00AD] = 0xAD,
|
||||
[0x00B0] = 0xB0,
|
||||
[0x00B7] = 0xB7,
|
||||
[0x00C1] = 0xC1,
|
||||
[0x00C2] = 0xC2,
|
||||
[0x00C3] = 0xC3,
|
||||
[0x00C4] = 0xC4,
|
||||
[0x00C5] = 0xC5,
|
||||
[0x00C6] = 0xC6,
|
||||
[0x00C9] = 0xC9,
|
||||
[0x00CB] = 0xCB,
|
||||
[0x00CD] = 0xCD,
|
||||
[0x00CE] = 0xCE,
|
||||
[0x00CF] = 0xCF,
|
||||
[0x00D0] = 0xD0,
|
||||
[0x00D3] = 0xD3,
|
||||
[0x00D4] = 0xD4,
|
||||
[0x00D5] = 0xD5,
|
||||
[0x00D6] = 0xD6,
|
||||
[0x00D8] = 0xD8,
|
||||
[0x00DA] = 0xDA,
|
||||
[0x00DB] = 0xDB,
|
||||
[0x00DC] = 0xDC,
|
||||
[0x00DD] = 0xDD,
|
||||
[0x00DE] = 0xDE,
|
||||
[0x00DF] = 0xDF,
|
||||
[0x00E1] = 0xE1,
|
||||
[0x00E2] = 0xE2,
|
||||
[0x00E3] = 0xE3,
|
||||
[0x00E4] = 0xE4,
|
||||
[0x00E5] = 0xE5,
|
||||
[0x00E6] = 0xE6,
|
||||
[0x00E9] = 0xE9,
|
||||
[0x00EB] = 0xEB,
|
||||
[0x00ED] = 0xED,
|
||||
[0x00EE] = 0xEE,
|
||||
[0x00EF] = 0xEF,
|
||||
[0x00F0] = 0xF0,
|
||||
[0x00F3] = 0xF3,
|
||||
[0x00F4] = 0xF4,
|
||||
[0x00F5] = 0xF5,
|
||||
[0x00F6] = 0xF6,
|
||||
[0x00F8] = 0xF8,
|
||||
[0x00FA] = 0xFA,
|
||||
[0x00FB] = 0xFB,
|
||||
[0x00FC] = 0xFC,
|
||||
[0x00FD] = 0xFD,
|
||||
[0x00FE] = 0xFE,
|
||||
[0x0100] = 0xC0,
|
||||
[0x0101] = 0xE0,
|
||||
[0x0104] = 0xA1,
|
||||
[0x0105] = 0xB1,
|
||||
[0x010C] = 0xC8,
|
||||
[0x010D] = 0xE8,
|
||||
[0x0110] = 0xA9,
|
||||
[0x0111] = 0xB9,
|
||||
[0x0112] = 0xA2,
|
||||
[0x0113] = 0xB2,
|
||||
[0x0116] = 0xCC,
|
||||
[0x0117] = 0xEC,
|
||||
[0x0118] = 0xCA,
|
||||
[0x0119] = 0xEA,
|
||||
[0x0122] = 0xA3,
|
||||
[0x0123] = 0xB3,
|
||||
[0x0128] = 0xA5,
|
||||
[0x0129] = 0xB5,
|
||||
[0x012A] = 0xA4,
|
||||
[0x012B] = 0xB4,
|
||||
[0x012E] = 0xC7,
|
||||
[0x012F] = 0xE7,
|
||||
[0x0136] = 0xA6,
|
||||
[0x0137] = 0xB6,
|
||||
[0x0138] = 0xFF,
|
||||
[0x013B] = 0xA8,
|
||||
[0x013C] = 0xB8,
|
||||
[0x0145] = 0xD1,
|
||||
[0x0146] = 0xF1,
|
||||
[0x014A] = 0xAF,
|
||||
[0x014B] = 0xBF,
|
||||
[0x014C] = 0xD2,
|
||||
[0x014D] = 0xF2,
|
||||
[0x0160] = 0xAA,
|
||||
[0x0161] = 0xBA,
|
||||
[0x0166] = 0xAB,
|
||||
[0x0167] = 0xBB,
|
||||
[0x0168] = 0xD7,
|
||||
[0x0169] = 0xF7,
|
||||
[0x016A] = 0xAE,
|
||||
[0x016B] = 0xBE,
|
||||
[0x0172] = 0xD9,
|
||||
[0x0173] = 0xF9,
|
||||
[0x017D] = 0xAC,
|
||||
[0x017E] = 0xBC,
|
||||
[0x2014] = 0xBD,
|
||||
};
|
@ -21,4 +21,4 @@
|
||||
#include <wchar.h>
|
||||
#include <iso8859-2.h>
|
||||
#define NAME "ISO-8859-2"
|
||||
#include <iso8859-generic.c>
|
||||
#include <8bit-generic.c>
|
||||
|
@ -1,516 +0,0 @@
|
||||
static const wchar_t to_ucs4[256] = {
|
||||
[0x00] = 0x0000,
|
||||
[0x01] = 0x0001,
|
||||
[0x02] = 0x0002,
|
||||
[0x03] = 0x0003,
|
||||
[0x04] = 0x0004,
|
||||
[0x05] = 0x0005,
|
||||
[0x06] = 0x0006,
|
||||
[0x07] = 0x0007,
|
||||
[0x08] = 0x0008,
|
||||
[0x09] = 0x0009,
|
||||
[0x0A] = 0x000A,
|
||||
[0x0B] = 0x000B,
|
||||
[0x0C] = 0x000C,
|
||||
[0x0D] = 0x000D,
|
||||
[0x0E] = 0x000E,
|
||||
[0x0F] = 0x000F,
|
||||
[0x10] = 0x0010,
|
||||
[0x11] = 0x0011,
|
||||
[0x12] = 0x0012,
|
||||
[0x13] = 0x0013,
|
||||
[0x14] = 0x0014,
|
||||
[0x15] = 0x0015,
|
||||
[0x16] = 0x0016,
|
||||
[0x17] = 0x0017,
|
||||
[0x18] = 0x0018,
|
||||
[0x19] = 0x0019,
|
||||
[0x1A] = 0x001A,
|
||||
[0x1B] = 0x001B,
|
||||
[0x1C] = 0x001C,
|
||||
[0x1D] = 0x001D,
|
||||
[0x1E] = 0x001E,
|
||||
[0x1F] = 0x001F,
|
||||
[0x20] = 0x0020,
|
||||
[0x21] = 0x0021,
|
||||
[0x22] = 0x0022,
|
||||
[0x23] = 0x0023,
|
||||
[0x24] = 0x0024,
|
||||
[0x25] = 0x0025,
|
||||
[0x26] = 0x0026,
|
||||
[0x27] = 0x0027,
|
||||
[0x28] = 0x0028,
|
||||
[0x29] = 0x0029,
|
||||
[0x2A] = 0x002A,
|
||||
[0x2B] = 0x002B,
|
||||
[0x2C] = 0x002C,
|
||||
[0x2D] = 0x002D,
|
||||
[0x2E] = 0x002E,
|
||||
[0x2F] = 0x002F,
|
||||
[0x30] = 0x0030,
|
||||
[0x31] = 0x0031,
|
||||
[0x32] = 0x0032,
|
||||
[0x33] = 0x0033,
|
||||
[0x34] = 0x0034,
|
||||
[0x35] = 0x0035,
|
||||
[0x36] = 0x0036,
|
||||
[0x37] = 0x0037,
|
||||
[0x38] = 0x0038,
|
||||
[0x39] = 0x0039,
|
||||
[0x3A] = 0x003A,
|
||||
[0x3B] = 0x003B,
|
||||
[0x3C] = 0x003C,
|
||||
[0x3D] = 0x003D,
|
||||
[0x3E] = 0x003E,
|
||||
[0x3F] = 0x003F,
|
||||
[0x40] = 0x0040,
|
||||
[0x41] = 0x0041,
|
||||
[0x42] = 0x0042,
|
||||
[0x43] = 0x0043,
|
||||
[0x44] = 0x0044,
|
||||
[0x45] = 0x0045,
|
||||
[0x46] = 0x0046,
|
||||
[0x47] = 0x0047,
|
||||
[0x48] = 0x0048,
|
||||
[0x49] = 0x0049,
|
||||
[0x4A] = 0x004A,
|
||||
[0x4B] = 0x004B,
|
||||
[0x4C] = 0x004C,
|
||||
[0x4D] = 0x004D,
|
||||
[0x4E] = 0x004E,
|
||||
[0x4F] = 0x004F,
|
||||
[0x50] = 0x0050,
|
||||
[0x51] = 0x0051,
|
||||
[0x52] = 0x0052,
|
||||
[0x53] = 0x0053,
|
||||
[0x54] = 0x0054,
|
||||
[0x55] = 0x0055,
|
||||
[0x56] = 0x0056,
|
||||
[0x57] = 0x0057,
|
||||
[0x58] = 0x0058,
|
||||
[0x59] = 0x0059,
|
||||
[0x5A] = 0x005A,
|
||||
[0x5B] = 0x005B,
|
||||
[0x5C] = 0x005C,
|
||||
[0x5D] = 0x005D,
|
||||
[0x5E] = 0x005E,
|
||||
[0x5F] = 0x005F,
|
||||
[0x60] = 0x0060,
|
||||
[0x61] = 0x0061,
|
||||
[0x62] = 0x0062,
|
||||
[0x63] = 0x0063,
|
||||
[0x64] = 0x0064,
|
||||
[0x65] = 0x0065,
|
||||
[0x66] = 0x0066,
|
||||
[0x67] = 0x0067,
|
||||
[0x68] = 0x0068,
|
||||
[0x69] = 0x0069,
|
||||
[0x6A] = 0x006A,
|
||||
[0x6B] = 0x006B,
|
||||
[0x6C] = 0x006C,
|
||||
[0x6D] = 0x006D,
|
||||
[0x6E] = 0x006E,
|
||||
[0x6F] = 0x006F,
|
||||
[0x70] = 0x0070,
|
||||
[0x71] = 0x0071,
|
||||
[0x72] = 0x0072,
|
||||
[0x73] = 0x0073,
|
||||
[0x74] = 0x0074,
|
||||
[0x75] = 0x0075,
|
||||
[0x76] = 0x0076,
|
||||
[0x77] = 0x0077,
|
||||
[0x78] = 0x0078,
|
||||
[0x79] = 0x0079,
|
||||
[0x7A] = 0x007A,
|
||||
[0x7B] = 0x007B,
|
||||
[0x7C] = 0x007C,
|
||||
[0x7D] = 0x007D,
|
||||
[0x7E] = 0x007E,
|
||||
[0x7F] = 0x007F,
|
||||
[0x80] = 0x0080,
|
||||
[0x81] = 0x0081,
|
||||
[0x82] = 0x0082,
|
||||
[0x83] = 0x0083,
|
||||
[0x84] = 0x0084,
|
||||
[0x85] = 0x0085,
|
||||
[0x86] = 0x0086,
|
||||
[0x87] = 0x0087,
|
||||
[0x88] = 0x0088,
|
||||
[0x89] = 0x0089,
|
||||
[0x8A] = 0x008A,
|
||||
[0x8B] = 0x008B,
|
||||
[0x8C] = 0x008C,
|
||||
[0x8D] = 0x008D,
|
||||
[0x8E] = 0x008E,
|
||||
[0x8F] = 0x008F,
|
||||
[0x90] = 0x0090,
|
||||
[0x91] = 0x0091,
|
||||
[0x92] = 0x0092,
|
||||
[0x93] = 0x0093,
|
||||
[0x94] = 0x0094,
|
||||
[0x95] = 0x0095,
|
||||
[0x96] = 0x0096,
|
||||
[0x97] = 0x0097,
|
||||
[0x98] = 0x0098,
|
||||
[0x99] = 0x0099,
|
||||
[0x9A] = 0x009A,
|
||||
[0x9B] = 0x009B,
|
||||
[0x9C] = 0x009C,
|
||||
[0x9D] = 0x009D,
|
||||
[0x9E] = 0x009E,
|
||||
[0x9F] = 0x009F,
|
||||
[0xA0] = 0x00A0,
|
||||
[0xA1] = 0x0104,
|
||||
[0xA2] = 0x02D8,
|
||||
[0xA3] = 0x0141,
|
||||
[0xA4] = 0x00A4,
|
||||
[0xA5] = 0x013D,
|
||||
[0xA6] = 0x015A,
|
||||
[0xA7] = 0x00A7,
|
||||
[0xA8] = 0x00A8,
|
||||
[0xA9] = 0x0160,
|
||||
[0xAA] = 0x015E,
|
||||
[0xAB] = 0x0164,
|
||||
[0xAC] = 0x0179,
|
||||
[0xAD] = 0x00AD,
|
||||
[0xAE] = 0x017D,
|
||||
[0xAF] = 0x017B,
|
||||
[0xB0] = 0x00B0,
|
||||
[0xB1] = 0x0105,
|
||||
[0xB2] = 0x02DB,
|
||||
[0xB3] = 0x0142,
|
||||
[0xB4] = 0x00B4,
|
||||
[0xB5] = 0x013E,
|
||||
[0xB6] = 0x015B,
|
||||
[0xB7] = 0x02C7,
|
||||
[0xB8] = 0x00B8,
|
||||
[0xB9] = 0x0161,
|
||||
[0xBA] = 0x015F,
|
||||
[0xBB] = 0x0165,
|
||||
[0xBC] = 0x017A,
|
||||
[0xBD] = 0x02DD,
|
||||
[0xBE] = 0x017E,
|
||||
[0xBF] = 0x017C,
|
||||
[0xC0] = 0x0154,
|
||||
[0xC1] = 0x00C1,
|
||||
[0xC2] = 0x00C2,
|
||||
[0xC3] = 0x0102,
|
||||
[0xC4] = 0x00C4,
|
||||
[0xC5] = 0x0139,
|
||||
[0xC6] = 0x0106,
|
||||
[0xC7] = 0x00C7,
|
||||
[0xC8] = 0x010C,
|
||||
[0xC9] = 0x00C9,
|
||||
[0xCA] = 0x0118,
|
||||
[0xCB] = 0x00CB,
|
||||
[0xCC] = 0x011A,
|
||||
[0xCD] = 0x00CD,
|
||||
[0xCE] = 0x00CE,
|
||||
[0xCF] = 0x010E,
|
||||
[0xD0] = 0x0110,
|
||||
[0xD1] = 0x0143,
|
||||
[0xD2] = 0x0147,
|
||||
[0xD3] = 0x00D3,
|
||||
[0xD4] = 0x00D4,
|
||||
[0xD5] = 0x0150,
|
||||
[0xD6] = 0x00D6,
|
||||
[0xD7] = 0x00D7,
|
||||
[0xD8] = 0x0158,
|
||||
[0xD9] = 0x016E,
|
||||
[0xDA] = 0x00DA,
|
||||
[0xDB] = 0x0170,
|
||||
[0xDC] = 0x00DC,
|
||||
[0xDD] = 0x00DD,
|
||||
[0xDE] = 0x0162,
|
||||
[0xDF] = 0x00DF,
|
||||
[0xE0] = 0x0155,
|
||||
[0xE1] = 0x00E1,
|
||||
[0xE2] = 0x00E2,
|
||||
[0xE3] = 0x0103,
|
||||
[0xE4] = 0x00E4,
|
||||
[0xE5] = 0x013A,
|
||||
[0xE6] = 0x0107,
|
||||
[0xE7] = 0x00E7,
|
||||
[0xE8] = 0x010D,
|
||||
[0xE9] = 0x00E9,
|
||||
[0xEA] = 0x0119,
|
||||
[0xEB] = 0x00EB,
|
||||
[0xEC] = 0x011B,
|
||||
[0xED] = 0x00ED,
|
||||
[0xEE] = 0x00EE,
|
||||
[0xEF] = 0x010F,
|
||||
[0xF0] = 0x0111,
|
||||
[0xF1] = 0x0144,
|
||||
[0xF2] = 0x0148,
|
||||
[0xF3] = 0x00F3,
|
||||
[0xF4] = 0x00F4,
|
||||
[0xF5] = 0x0151,
|
||||
[0xF6] = 0x00F6,
|
||||
[0xF7] = 0x00F7,
|
||||
[0xF8] = 0x0159,
|
||||
[0xF9] = 0x016F,
|
||||
[0xFA] = 0x00FA,
|
||||
[0xFB] = 0x0171,
|
||||
[0xFC] = 0x00FC,
|
||||
[0xFD] = 0x00FD,
|
||||
[0xFE] = 0x0163,
|
||||
[0xFF] = 0x02D9,
|
||||
};
|
||||
static const char from_ucs4[] = {
|
||||
[0x0000] = 0x00,
|
||||
[0x0001] = 0x01,
|
||||
[0x0002] = 0x02,
|
||||
[0x0003] = 0x03,
|
||||
[0x0004] = 0x04,
|
||||
[0x0005] = 0x05,
|
||||
[0x0006] = 0x06,
|
||||
[0x0007] = 0x07,
|
||||
[0x0008] = 0x08,
|
||||
[0x0009] = 0x09,
|
||||
[0x000A] = 0x0A,
|
||||
[0x000B] = 0x0B,
|
||||
[0x000C] = 0x0C,
|
||||
[0x000D] = 0x0D,
|
||||
[0x000E] = 0x0E,
|
||||
[0x000F] = 0x0F,
|
||||
[0x0010] = 0x10,
|
||||
[0x0011] = 0x11,
|
||||
[0x0012] = 0x12,
|
||||
[0x0013] = 0x13,
|
||||
[0x0014] = 0x14,
|
||||
[0x0015] = 0x15,
|
||||
[0x0016] = 0x16,
|
||||
[0x0017] = 0x17,
|
||||
[0x0018] = 0x18,
|
||||
[0x0019] = 0x19,
|
||||
[0x001A] = 0x1A,
|
||||
[0x001B] = 0x1B,
|
||||
[0x001C] = 0x1C,
|
||||
[0x001D] = 0x1D,
|
||||
[0x001E] = 0x1E,
|
||||
[0x001F] = 0x1F,
|
||||
[0x0020] = 0x20,
|
||||
[0x0021] = 0x21,
|
||||
[0x0022] = 0x22,
|
||||
[0x0023] = 0x23,
|
||||
[0x0024] = 0x24,
|
||||
[0x0025] = 0x25,
|
||||
[0x0026] = 0x26,
|
||||
[0x0027] = 0x27,
|
||||
[0x0028] = 0x28,
|
||||
[0x0029] = 0x29,
|
||||
[0x002A] = 0x2A,
|
||||
[0x002B] = 0x2B,
|
||||
[0x002C] = 0x2C,
|
||||
[0x002D] = 0x2D,
|
||||
[0x002E] = 0x2E,
|
||||
[0x002F] = 0x2F,
|
||||
[0x0030] = 0x30,
|
||||
[0x0031] = 0x31,
|
||||
[0x0032] = 0x32,
|
||||
[0x0033] = 0x33,
|
||||
[0x0034] = 0x34,
|
||||
[0x0035] = 0x35,
|
||||
[0x0036] = 0x36,
|
||||
[0x0037] = 0x37,
|
||||
[0x0038] = 0x38,
|
||||
[0x0039] = 0x39,
|
||||
[0x003A] = 0x3A,
|
||||
[0x003B] = 0x3B,
|
||||
[0x003C] = 0x3C,
|
||||
[0x003D] = 0x3D,
|
||||
[0x003E] = 0x3E,
|
||||
[0x003F] = 0x3F,
|
||||
[0x0040] = 0x40,
|
||||
[0x0041] = 0x41,
|
||||
[0x0042] = 0x42,
|
||||
[0x0043] = 0x43,
|
||||
[0x0044] = 0x44,
|
||||
[0x0045] = 0x45,
|
||||
[0x0046] = 0x46,
|
||||
[0x0047] = 0x47,
|
||||
[0x0048] = 0x48,
|
||||
[0x0049] = 0x49,
|
||||
[0x004A] = 0x4A,
|
||||
[0x004B] = 0x4B,
|
||||
[0x004C] = 0x4C,
|
||||
[0x004D] = 0x4D,
|
||||
[0x004E] = 0x4E,
|
||||
[0x004F] = 0x4F,
|
||||
[0x0050] = 0x50,
|
||||
[0x0051] = 0x51,
|
||||
[0x0052] = 0x52,
|
||||
[0x0053] = 0x53,
|
||||
[0x0054] = 0x54,
|
||||
[0x0055] = 0x55,
|
||||
[0x0056] = 0x56,
|
||||
[0x0057] = 0x57,
|
||||
[0x0058] = 0x58,
|
||||
[0x0059] = 0x59,
|
||||
[0x005A] = 0x5A,
|
||||
[0x005B] = 0x5B,
|
||||
[0x005C] = 0x5C,
|
||||
[0x005D] = 0x5D,
|
||||
[0x005E] = 0x5E,
|
||||
[0x005F] = 0x5F,
|
||||
[0x0060] = 0x60,
|
||||
[0x0061] = 0x61,
|
||||
[0x0062] = 0x62,
|
||||
[0x0063] = 0x63,
|
||||
[0x0064] = 0x64,
|
||||
[0x0065] = 0x65,
|
||||
[0x0066] = 0x66,
|
||||
[0x0067] = 0x67,
|
||||
[0x0068] = 0x68,
|
||||
[0x0069] = 0x69,
|
||||
[0x006A] = 0x6A,
|
||||
[0x006B] = 0x6B,
|
||||
[0x006C] = 0x6C,
|
||||
[0x006D] = 0x6D,
|
||||
[0x006E] = 0x6E,
|
||||
[0x006F] = 0x6F,
|
||||
[0x0070] = 0x70,
|
||||
[0x0071] = 0x71,
|
||||
[0x0072] = 0x72,
|
||||
[0x0073] = 0x73,
|
||||
[0x0074] = 0x74,
|
||||
[0x0075] = 0x75,
|
||||
[0x0076] = 0x76,
|
||||
[0x0077] = 0x77,
|
||||
[0x0078] = 0x78,
|
||||
[0x0079] = 0x79,
|
||||
[0x007A] = 0x7A,
|
||||
[0x007B] = 0x7B,
|
||||
[0x007C] = 0x7C,
|
||||
[0x007D] = 0x7D,
|
||||
[0x007E] = 0x7E,
|
||||
[0x007F] = 0x7F,
|
||||
[0x0080] = 0x80,
|
||||
[0x0081] = 0x81,
|
||||
[0x0082] = 0x82,
|
||||
[0x0083] = 0x83,
|
||||
[0x0084] = 0x84,
|
||||
[0x0085] = 0x85,
|
||||
[0x0086] = 0x86,
|
||||
[0x0087] = 0x87,
|
||||
[0x0088] = 0x88,
|
||||
[0x0089] = 0x89,
|
||||
[0x008A] = 0x8A,
|
||||
[0x008B] = 0x8B,
|
||||
[0x008C] = 0x8C,
|
||||
[0x008D] = 0x8D,
|
||||
[0x008E] = 0x8E,
|
||||
[0x008F] = 0x8F,
|
||||
[0x0090] = 0x90,
|
||||
[0x0091] = 0x91,
|
||||
[0x0092] = 0x92,
|
||||
[0x0093] = 0x93,
|
||||
[0x0094] = 0x94,
|
||||
[0x0095] = 0x95,
|
||||
[0x0096] = 0x96,
|
||||
[0x0097] = 0x97,
|
||||
[0x0098] = 0x98,
|
||||
[0x0099] = 0x99,
|
||||
[0x009A] = 0x9A,
|
||||
[0x009B] = 0x9B,
|
||||
[0x009C] = 0x9C,
|
||||
[0x009D] = 0x9D,
|
||||
[0x009E] = 0x9E,
|
||||
[0x009F] = 0x9F,
|
||||
[0x00A0] = 0xA0,
|
||||
[0x00A4] = 0xA4,
|
||||
[0x00A7] = 0xA7,
|
||||
[0x00A8] = 0xA8,
|
||||
[0x00AD] = 0xAD,
|
||||
[0x00B0] = 0xB0,
|
||||
[0x00B4] = 0xB4,
|
||||
[0x00B8] = 0xB8,
|
||||
[0x00C1] = 0xC1,
|
||||
[0x00C2] = 0xC2,
|
||||
[0x00C4] = 0xC4,
|
||||
[0x00C7] = 0xC7,
|
||||
[0x00C9] = 0xC9,
|
||||
[0x00CB] = 0xCB,
|
||||
[0x00CD] = 0xCD,
|
||||
[0x00CE] = 0xCE,
|
||||
[0x00D3] = 0xD3,
|
||||
[0x00D4] = 0xD4,
|
||||
[0x00D6] = 0xD6,
|
||||
[0x00D7] = 0xD7,
|
||||
[0x00DA] = 0xDA,
|
||||
[0x00DC] = 0xDC,
|
||||
[0x00DD] = 0xDD,
|
||||
[0x00DF] = 0xDF,
|
||||
[0x00E1] = 0xE1,
|
||||
[0x00E2] = 0xE2,
|
||||
[0x00E4] = 0xE4,
|
||||
[0x00E7] = 0xE7,
|
||||
[0x00E9] = 0xE9,
|
||||
[0x00EB] = 0xEB,
|
||||
[0x00ED] = 0xED,
|
||||
[0x00EE] = 0xEE,
|
||||
[0x00F3] = 0xF3,
|
||||
[0x00F4] = 0xF4,
|
||||
[0x00F6] = 0xF6,
|
||||
[0x00F7] = 0xF7,
|
||||
[0x00FA] = 0xFA,
|
||||
[0x00FC] = 0xFC,
|
||||
[0x00FD] = 0xFD,
|
||||
[0x0102] = 0xC3,
|
||||
[0x0103] = 0xE3,
|
||||
[0x0104] = 0xA1,
|
||||
[0x0105] = 0xB1,
|
||||
[0x0106] = 0xC6,
|
||||
[0x0107] = 0xE6,
|
||||
[0x010C] = 0xC8,
|
||||
[0x010D] = 0xE8,
|
||||
[0x010E] = 0xCF,
|
||||
[0x010F] = 0xEF,
|
||||
[0x0110] = 0xD0,
|
||||
[0x0111] = 0xF0,
|
||||
[0x0118] = 0xCA,
|
||||
[0x0119] = 0xEA,
|
||||
[0x011A] = 0xCC,
|
||||
[0x011B] = 0xEC,
|
||||
[0x0139] = 0xC5,
|
||||
[0x013A] = 0xE5,
|
||||
[0x013D] = 0xA5,
|
||||
[0x013E] = 0xB5,
|
||||
[0x0141] = 0xA3,
|
||||
[0x0142] = 0xB3,
|
||||
[0x0143] = 0xD1,
|
||||
[0x0144] = 0xF1,
|
||||
[0x0147] = 0xD2,
|
||||
[0x0148] = 0xF2,
|
||||
[0x0150] = 0xD5,
|
||||
[0x0151] = 0xF5,
|
||||
[0x0154] = 0xC0,
|
||||
[0x0155] = 0xE0,
|
||||
[0x0158] = 0xD8,
|
||||
[0x0159] = 0xF8,
|
||||
[0x015A] = 0xA6,
|
||||
[0x015B] = 0xB6,
|
||||
[0x015E] = 0xAA,
|
||||
[0x015F] = 0xBA,
|
||||
[0x0160] = 0xA9,
|
||||
[0x0161] = 0xB9,
|
||||
[0x0162] = 0xDE,
|
||||
[0x0163] = 0xFE,
|
||||
[0x0164] = 0xAB,
|
||||
[0x0165] = 0xBB,
|
||||
[0x016E] = 0xD9,
|
||||
[0x016F] = 0xF9,
|
||||
[0x0170] = 0xDB,
|
||||
[0x0171] = 0xFB,
|
||||
[0x0179] = 0xAC,
|
||||
[0x017A] = 0xBC,
|
||||
[0x017B] = 0xAF,
|
||||
[0x017C] = 0xBF,
|
||||
[0x017D] = 0xAE,
|
||||
[0x017E] = 0xBE,
|
||||
[0x02C7] = 0xB7,
|
||||
[0x02D8] = 0xA2,
|
||||
[0x02D9] = 0xFF,
|
||||
[0x02DB] = 0xB2,
|
||||
[0x02DD] = 0xBD,
|
||||
};
|
@ -21,4 +21,4 @@
|
||||
#include <wchar.h>
|
||||
#include <iso8859-3.h>
|
||||
#define NAME "ISO-8859-3"
|
||||
#include <iso8859-generic.c>
|
||||
#include <8bit-generic.c>
|
||||
|
@ -1,502 +0,0 @@
|
||||
static const wchar_t to_ucs4[256] = {
|
||||
[0x00] = 0x0000,
|
||||
[0x01] = 0x0001,
|
||||
[0x02] = 0x0002,
|
||||
[0x03] = 0x0003,
|
||||
[0x04] = 0x0004,
|
||||
[0x05] = 0x0005,
|
||||
[0x06] = 0x0006,
|
||||
[0x07] = 0x0007,
|
||||
[0x08] = 0x0008,
|
||||
[0x09] = 0x0009,
|
||||
[0x0A] = 0x000A,
|
||||
[0x0B] = 0x000B,
|
||||
[0x0C] = 0x000C,
|
||||
[0x0D] = 0x000D,
|
||||
[0x0E] = 0x000E,
|
||||
[0x0F] = 0x000F,
|
||||
[0x10] = 0x0010,
|
||||
[0x11] = 0x0011,
|
||||
[0x12] = 0x0012,
|
||||
[0x13] = 0x0013,
|
||||
[0x14] = 0x0014,
|
||||
[0x15] = 0x0015,
|
||||
[0x16] = 0x0016,
|
||||
[0x17] = 0x0017,
|
||||
[0x18] = 0x0018,
|
||||
[0x19] = 0x0019,
|
||||
[0x1A] = 0x001A,
|
||||
[0x1B] = 0x001B,
|
||||
[0x1C] = 0x001C,
|
||||
[0x1D] = 0x001D,
|
||||
[0x1E] = 0x001E,
|
||||
[0x1F] = 0x001F,
|
||||
[0x20] = 0x0020,
|
||||
[0x21] = 0x0021,
|
||||
[0x22] = 0x0022,
|
||||
[0x23] = 0x0023,
|
||||
[0x24] = 0x0024,
|
||||
[0x25] = 0x0025,
|
||||
[0x26] = 0x0026,
|
||||
[0x27] = 0x0027,
|
||||
[0x28] = 0x0028,
|
||||
[0x29] = 0x0029,
|
||||
[0x2A] = 0x002A,
|
||||
[0x2B] = 0x002B,
|
||||
[0x2C] = 0x002C,
|
||||
[0x2D] = 0x002D,
|
||||
[0x2E] = 0x002E,
|
||||
[0x2F] = 0x002F,
|
||||
[0x30] = 0x0030,
|
||||
[0x31] = 0x0031,
|
||||
[0x32] = 0x0032,
|
||||
[0x33] = 0x0033,
|
||||
[0x34] = 0x0034,
|
||||
[0x35] = 0x0035,
|
||||
[0x36] = 0x0036,
|
||||
[0x37] = 0x0037,
|
||||
[0x38] = 0x0038,
|
||||
[0x39] = 0x0039,
|
||||
[0x3A] = 0x003A,
|
||||
[0x3B] = 0x003B,
|
||||
[0x3C] = 0x003C,
|
||||
[0x3D] = 0x003D,
|
||||
[0x3E] = 0x003E,
|
||||
[0x3F] = 0x003F,
|
||||
[0x40] = 0x0040,
|
||||
[0x41] = 0x0041,
|
||||
[0x42] = 0x0042,
|
||||
[0x43] = 0x0043,
|
||||
[0x44] = 0x0044,
|
||||
[0x45] = 0x0045,
|
||||
[0x46] = 0x0046,
|
||||
[0x47] = 0x0047,
|
||||
[0x48] = 0x0048,
|
||||
[0x49] = 0x0049,
|
||||
[0x4A] = 0x004A,
|
||||
[0x4B] = 0x004B,
|
||||
[0x4C] = 0x004C,
|
||||
[0x4D] = 0x004D,
|
||||
[0x4E] = 0x004E,
|
||||
[0x4F] = 0x004F,
|
||||
[0x50] = 0x0050,
|
||||
[0x51] = 0x0051,
|
||||
[0x52] = 0x0052,
|
||||
[0x53] = 0x0053,
|
||||
[0x54] = 0x0054,
|
||||
[0x55] = 0x0055,
|
||||
[0x56] = 0x0056,
|
||||
[0x57] = 0x0057,
|
||||
[0x58] = 0x0058,
|
||||
[0x59] = 0x0059,
|
||||
[0x5A] = 0x005A,
|
||||
[0x5B] = 0x005B,
|
||||
[0x5C] = 0x005C,
|
||||
[0x5D] = 0x005D,
|
||||
[0x5E] = 0x005E,
|
||||
[0x5F] = 0x005F,
|
||||
[0x60] = 0x0060,
|
||||
[0x61] = 0x0061,
|
||||
[0x62] = 0x0062,
|
||||
[0x63] = 0x0063,
|
||||
[0x64] = 0x0064,
|
||||
[0x65] = 0x0065,
|
||||
[0x66] = 0x0066,
|
||||
[0x67] = 0x0067,
|
||||
[0x68] = 0x0068,
|
||||
[0x69] = 0x0069,
|
||||
[0x6A] = 0x006A,
|
||||
[0x6B] = 0x006B,
|
||||
[0x6C] = 0x006C,
|
||||
[0x6D] = 0x006D,
|
||||
[0x6E] = 0x006E,
|
||||
[0x6F] = 0x006F,
|
||||
[0x70] = 0x0070,
|
||||
[0x71] = 0x0071,
|
||||
[0x72] = 0x0072,
|
||||
[0x73] = 0x0073,
|
||||
[0x74] = 0x0074,
|
||||
[0x75] = 0x0075,
|
||||
[0x76] = 0x0076,
|
||||
[0x77] = 0x0077,
|
||||
[0x78] = 0x0078,
|
||||
[0x79] = 0x0079,
|
||||
[0x7A] = 0x007A,
|
||||
[0x7B] = 0x007B,
|
||||
[0x7C] = 0x007C,
|
||||
[0x7D] = 0x007D,
|
||||
[0x7E] = 0x007E,
|
||||
[0x7F] = 0x007F,
|
||||
[0x80] = 0x0080,
|
||||
[0x81] = 0x0081,
|
||||
[0x82] = 0x0082,
|
||||
[0x83] = 0x0083,
|
||||
[0x84] = 0x0084,
|
||||
[0x85] = 0x0085,
|
||||
[0x86] = 0x0086,
|
||||
[0x87] = 0x0087,
|
||||
[0x88] = 0x0088,
|
||||
[0x89] = 0x0089,
|
||||
[0x8A] = 0x008A,
|
||||
[0x8B] = 0x008B,
|
||||
[0x8C] = 0x008C,
|
||||
[0x8D] = 0x008D,
|
||||
[0x8E] = 0x008E,
|
||||
[0x8F] = 0x008F,
|
||||
[0x90] = 0x0090,
|
||||
[0x91] = 0x0091,
|
||||
[0x92] = 0x0092,
|
||||
[0x93] = 0x0093,
|
||||
[0x94] = 0x0094,
|
||||
[0x95] = 0x0095,
|
||||
[0x96] = 0x0096,
|
||||
[0x97] = 0x0097,
|
||||
[0x98] = 0x0098,
|
||||
[0x99] = 0x0099,
|
||||
[0x9A] = 0x009A,
|
||||
[0x9B] = 0x009B,
|
||||
[0x9C] = 0x009C,
|
||||
[0x9D] = 0x009D,
|
||||
[0x9E] = 0x009E,
|
||||
[0x9F] = 0x009F,
|
||||
[0xA0] = 0x00A0,
|
||||
[0xA1] = 0x0126,
|
||||
[0xA2] = 0x02D8,
|
||||
[0xA3] = 0x00A3,
|
||||
[0xA4] = 0x00A4,
|
||||
[0xA6] = 0x0124,
|
||||
[0xA7] = 0x00A7,
|
||||
[0xA8] = 0x00A8,
|
||||
[0xA9] = 0x0130,
|
||||
[0xAA] = 0x015E,
|
||||
[0xAB] = 0x011E,
|
||||
[0xAC] = 0x0134,
|
||||
[0xAD] = 0x00AD,
|
||||
[0xAF] = 0x017B,
|
||||
[0xB0] = 0x00B0,
|
||||
[0xB1] = 0x0127,
|
||||
[0xB2] = 0x00B2,
|
||||
[0xB3] = 0x00B3,
|
||||
[0xB4] = 0x00B4,
|
||||
[0xB5] = 0x00B5,
|
||||
[0xB6] = 0x0125,
|
||||
[0xB7] = 0x00B7,
|
||||
[0xB8] = 0x00B8,
|
||||
[0xB9] = 0x0131,
|
||||
[0xBA] = 0x015F,
|
||||
[0xBB] = 0x011F,
|
||||
[0xBC] = 0x0135,
|
||||
[0xBD] = 0x00BD,
|
||||
[0xBF] = 0x017C,
|
||||
[0xC0] = 0x00C0,
|
||||
[0xC1] = 0x00C1,
|
||||
[0xC2] = 0x00C2,
|
||||
[0xC4] = 0x00C4,
|
||||
[0xC5] = 0x010A,
|
||||
[0xC6] = 0x0108,
|
||||
[0xC7] = 0x00C7,
|
||||
[0xC8] = 0x00C8,
|
||||
[0xC9] = 0x00C9,
|
||||
[0xCA] = 0x00CA,
|
||||
[0xCB] = 0x00CB,
|
||||
[0xCC] = 0x00CC,
|
||||
[0xCD] = 0x00CD,
|
||||
[0xCE] = 0x00CE,
|
||||
[0xCF] = 0x00CF,
|
||||
[0xD1] = 0x00D1,
|
||||
[0xD2] = 0x00D2,
|
||||
[0xD3] = 0x00D3,
|
||||
[0xD4] = 0x00D4,
|
||||
[0xD5] = 0x0120,
|
||||
[0xD6] = 0x00D6,
|
||||
[0xD7] = 0x00D7,
|
||||
[0xD8] = 0x011C,
|
||||
[0xD9] = 0x00D9,
|
||||
[0xDA] = 0x00DA,
|
||||
[0xDB] = 0x00DB,
|
||||
[0xDC] = 0x00DC,
|
||||
[0xDD] = 0x016C,
|
||||
[0xDE] = 0x015C,
|
||||
[0xDF] = 0x00DF,
|
||||
[0xE0] = 0x00E0,
|
||||
[0xE1] = 0x00E1,
|
||||
[0xE2] = 0x00E2,
|
||||
[0xE4] = 0x00E4,
|
||||
[0xE5] = 0x010B,
|
||||
[0xE6] = 0x0109,
|
||||
[0xE7] = 0x00E7,
|
||||
[0xE8] = 0x00E8,
|
||||
[0xE9] = 0x00E9,
|
||||
[0xEA] = 0x00EA,
|
||||
[0xEB] = 0x00EB,
|
||||
[0xEC] = 0x00EC,
|
||||
[0xED] = 0x00ED,
|
||||
[0xEE] = 0x00EE,
|
||||
[0xEF] = 0x00EF,
|
||||
[0xF1] = 0x00F1,
|
||||
[0xF2] = 0x00F2,
|
||||
[0xF3] = 0x00F3,
|
||||
[0xF4] = 0x00F4,
|
||||
[0xF5] = 0x0121,
|
||||
[0xF6] = 0x00F6,
|
||||
[0xF7] = 0x00F7,
|
||||
[0xF8] = 0x011D,
|
||||
[0xF9] = 0x00F9,
|
||||
[0xFA] = 0x00FA,
|
||||
[0xFB] = 0x00FB,
|
||||
[0xFC] = 0x00FC,
|
||||
[0xFD] = 0x016D,
|
||||
[0xFE] = 0x015D,
|
||||
[0xFF] = 0x02D9,
|
||||
};
|
||||
static const char from_ucs4[] = {
|
||||
[0x0000] = 0x00,
|
||||
[0x0001] = 0x01,
|
||||
[0x0002] = 0x02,
|
||||
[0x0003] = 0x03,
|
||||
[0x0004] = 0x04,
|
||||
[0x0005] = 0x05,
|
||||
[0x0006] = 0x06,
|
||||
[0x0007] = 0x07,
|
||||
[0x0008] = 0x08,
|
||||
[0x0009] = 0x09,
|
||||
[0x000A] = 0x0A,
|
||||
[0x000B] = 0x0B,
|
||||
[0x000C] = 0x0C,
|
||||
[0x000D] = 0x0D,
|
||||
[0x000E] = 0x0E,
|
||||
[0x000F] = 0x0F,
|
||||
[0x0010] = 0x10,
|
||||
[0x0011] = 0x11,
|
||||
[0x0012] = 0x12,
|
||||
[0x0013] = 0x13,
|
||||
[0x0014] = 0x14,
|
||||
[0x0015] = 0x15,
|
||||
[0x0016] = 0x16,
|
||||
[0x0017] = 0x17,
|
||||
[0x0018] = 0x18,
|
||||
[0x0019] = 0x19,
|
||||
[0x001A] = 0x1A,
|
||||
[0x001B] = 0x1B,
|
||||
[0x001C] = 0x1C,
|
||||
[0x001D] = 0x1D,
|
||||
[0x001E] = 0x1E,
|
||||
[0x001F] = 0x1F,
|
||||
[0x0020] = 0x20,
|
||||
[0x0021] = 0x21,
|
||||
[0x0022] = 0x22,
|
||||
[0x0023] = 0x23,
|
||||
[0x0024] = 0x24,
|
||||
[0x0025] = 0x25,
|
||||
[0x0026] = 0x26,
|
||||
[0x0027] = 0x27,
|
||||
[0x0028] = 0x28,
|
||||
[0x0029] = 0x29,
|
||||
[0x002A] = 0x2A,
|
||||
[0x002B] = 0x2B,
|
||||
[0x002C] = 0x2C,
|
||||
[0x002D] = 0x2D,
|
||||
[0x002E] = 0x2E,
|
||||
[0x002F] = 0x2F,
|
||||
[0x0030] = 0x30,
|
||||
[0x0031] = 0x31,
|
||||
[0x0032] = 0x32,
|
||||
[0x0033] = 0x33,
|
||||
[0x0034] = 0x34,
|
||||
[0x0035] = 0x35,
|
||||
[0x0036] = 0x36,
|
||||
[0x0037] = 0x37,
|
||||
[0x0038] = 0x38,
|
||||
[0x0039] = 0x39,
|
||||
[0x003A] = 0x3A,
|
||||
[0x003B] = 0x3B,
|
||||
[0x003C] = 0x3C,
|
||||
[0x003D] = 0x3D,
|
||||
[0x003E] = 0x3E,
|
||||
[0x003F] = 0x3F,
|
||||
[0x0040] = 0x40,
|
||||
[0x0041] = 0x41,
|
||||
[0x0042] = 0x42,
|
||||
[0x0043] = 0x43,
|
||||
[0x0044] = 0x44,
|
||||
[0x0045] = 0x45,
|
||||
[0x0046] = 0x46,
|
||||
[0x0047] = 0x47,
|
||||
[0x0048] = 0x48,
|
||||
[0x0049] = 0x49,
|
||||
[0x004A] = 0x4A,
|
||||
[0x004B] = 0x4B,
|
||||
[0x004C] = 0x4C,
|
||||
[0x004D] = 0x4D,
|
||||
[0x004E] = 0x4E,
|
||||
[0x004F] = 0x4F,
|
||||
[0x0050] = 0x50,
|
||||
[0x0051] = 0x51,
|
||||
[0x0052] = 0x52,
|
||||
[0x0053] = 0x53,
|
||||
[0x0054] = 0x54,
|
||||
[0x0055] = 0x55,
|
||||
[0x0056] = 0x56,
|
||||
[0x0057] = 0x57,
|
||||
[0x0058] = 0x58,
|
||||
[0x0059] = 0x59,
|
||||
[0x005A] = 0x5A,
|
||||
[0x005B] = 0x5B,
|
||||
[0x005C] = 0x5C,
|
||||
[0x005D] = 0x5D,
|
||||
[0x005E] = 0x5E,
|
||||
[0x005F] = 0x5F,
|
||||
[0x0060] = 0x60,
|
||||
[0x0061] = 0x61,
|
||||
[0x0062] = 0x62,
|
||||
[0x0063] = 0x63,
|
||||
[0x0064] = 0x64,
|
||||
[0x0065] = 0x65,
|
||||
[0x0066] = 0x66,
|
||||
[0x0067] = 0x67,
|
||||
[0x0068] = 0x68,
|
||||
[0x0069] = 0x69,
|
||||
[0x006A] = 0x6A,
|
||||
[0x006B] = 0x6B,
|
||||
[0x006C] = 0x6C,
|
||||
[0x006D] = 0x6D,
|
||||
[0x006E] = 0x6E,
|
||||
[0x006F] = 0x6F,
|
||||
[0x0070] = 0x70,
|
||||
[0x0071] = 0x71,
|
||||
[0x0072] = 0x72,
|
||||
[0x0073] = 0x73,
|
||||
[0x0074] = 0x74,
|
||||
[0x0075] = 0x75,
|
||||
[0x0076] = 0x76,
|
||||
[0x0077] = 0x77,
|
||||
[0x0078] = 0x78,
|
||||
[0x0079] = 0x79,
|
||||
[0x007A] = 0x7A,
|
||||
[0x007B] = 0x7B,
|
||||
[0x007C] = 0x7C,
|
||||
[0x007D] = 0x7D,
|
||||
[0x007E] = 0x7E,
|
||||
[0x007F] = 0x7F,
|
||||
[0x0080] = 0x80,
|
||||
[0x0081] = 0x81,
|
||||
[0x0082] = 0x82,
|
||||
[0x0083] = 0x83,
|
||||
[0x0084] = 0x84,
|
||||
[0x0085] = 0x85,
|
||||
[0x0086] = 0x86,
|
||||
[0x0087] = 0x87,
|
||||
[0x0088] = 0x88,
|
||||
[0x0089] = 0x89,
|
||||
[0x008A] = 0x8A,
|
||||
[0x008B] = 0x8B,
|
||||
[0x008C] = 0x8C,
|
||||
[0x008D] = 0x8D,
|
||||
[0x008E] = 0x8E,
|
||||
[0x008F] = 0x8F,
|
||||
[0x0090] = 0x90,
|
||||
[0x0091] = 0x91,
|
||||
[0x0092] = 0x92,
|
||||
[0x0093] = 0x93,
|
||||
[0x0094] = 0x94,
|
||||
[0x0095] = 0x95,
|
||||
[0x0096] = 0x96,
|
||||
[0x0097] = 0x97,
|
||||
[0x0098] = 0x98,
|
||||
[0x0099] = 0x99,
|
||||
[0x009A] = 0x9A,
|
||||
[0x009B] = 0x9B,
|
||||
[0x009C] = 0x9C,
|
||||
[0x009D] = 0x9D,
|
||||
[0x009E] = 0x9E,
|
||||
[0x009F] = 0x9F,
|
||||
[0x00A0] = 0xA0,
|
||||
[0x00A3] = 0xA3,
|
||||
[0x00A4] = 0xA4,
|
||||
[0x00A7] = 0xA7,
|
||||
[0x00A8] = 0xA8,
|
||||
[0x00AD] = 0xAD,
|
||||
[0x00B0] = 0xB0,
|
||||
[0x00B2] = 0xB2,
|
||||
[0x00B3] = 0xB3,
|
||||
[0x00B4] = 0xB4,
|
||||
[0x00B5] = 0xB5,
|
||||
[0x00B7] = 0xB7,
|
||||
[0x00B8] = 0xB8,
|
||||
[0x00BD] = 0xBD,
|
||||
[0x00C0] = 0xC0,
|
||||
[0x00C1] = 0xC1,
|
||||
[0x00C2] = 0xC2,
|
||||
[0x00C4] = 0xC4,
|
||||
[0x00C7] = 0xC7,
|
||||
[0x00C8] = 0xC8,
|
||||
[0x00C9] = 0xC9,
|
||||
[0x00CA] = 0xCA,
|
||||
[0x00CB] = 0xCB,
|
||||
[0x00CC] = 0xCC,
|
||||
[0x00CD] = 0xCD,
|
||||
[0x00CE] = 0xCE,
|
||||
[0x00CF] = 0xCF,
|
||||
[0x00D1] = 0xD1,
|
||||
[0x00D2] = 0xD2,
|
||||
[0x00D3] = 0xD3,
|
||||
[0x00D4] = 0xD4,
|
||||
[0x00D6] = 0xD6,
|
||||
[0x00D7] = 0xD7,
|
||||
[0x00D9] = 0xD9,
|
||||
[0x00DA] = 0xDA,
|
||||
[0x00DB] = 0xDB,
|
||||
[0x00DC] = 0xDC,
|
||||
[0x00DF] = 0xDF,
|
||||
[0x00E0] = 0xE0,
|
||||
[0x00E1] = 0xE1,
|
||||
[0x00E2] = 0xE2,
|
||||
[0x00E4] = 0xE4,
|
||||
[0x00E7] = 0xE7,
|
||||
[0x00E8] = 0xE8,
|
||||
[0x00E9] = 0xE9,
|
||||
[0x00EA] = 0xEA,
|
||||
[0x00EB] = 0xEB,
|
||||
[0x00EC] = 0xEC,
|
||||
[0x00ED] = 0xED,
|
||||
[0x00EE] = 0xEE,
|
||||
[0x00EF] = 0xEF,
|
||||
[0x00F1] = 0xF1,
|
||||
[0x00F2] = 0xF2,
|
||||
[0x00F3] = 0xF3,
|
||||
[0x00F4] = 0xF4,
|
||||
[0x00F6] = 0xF6,
|
||||
[0x00F7] = 0xF7,
|
||||
[0x00F9] = 0xF9,
|
||||
[0x00FA] = 0xFA,
|
||||
[0x00FB] = 0xFB,
|
||||
[0x00FC] = 0xFC,
|
||||
[0x0108] = 0xC6,
|
||||
[0x0109] = 0xE6,
|
||||
[0x010A] = 0xC5,
|
||||
[0x010B] = 0xE5,
|
||||
[0x011C] = 0xD8,
|
||||
[0x011D] = 0xF8,
|
||||
[0x011E] = 0xAB,
|
||||
[0x011F] = 0xBB,
|
||||
[0x0120] = 0xD5,
|
||||
[0x0121] = 0xF5,
|
||||
[0x0124] = 0xA6,
|
||||
[0x0125] = 0xB6,
|
||||
[0x0126] = 0xA1,
|
||||
[0x0127] = 0xB1,
|
||||
[0x0130] = 0xA9,
|
||||
[0x0131] = 0xB9,
|
||||
[0x0134] = 0xAC,
|
||||
[0x0135] = 0xBC,
|
||||
[0x015C] = 0xDE,
|
||||
[0x015D] = 0xFE,
|
||||
[0x015E] = 0xAA,
|
||||
[0x015F] = 0xBA,
|
||||
[0x016C] = 0xDD,
|
||||
[0x016D] = 0xFD,
|
||||
[0x017B] = 0xAF,
|
||||
[0x017C] = 0xBF,
|
||||
[0x02D8] = 0xA2,
|
||||
[0x02D9] = 0xFF,
|
||||
};
|
@ -21,4 +21,4 @@
|
||||
#include <wchar.h>
|
||||
#include <iso8859-4.h>
|
||||
#define NAME "ISO-8859-4"
|
||||
#include <iso8859-generic.c>
|
||||
#include <8bit-generic.c>
|
||||
|
@ -1,516 +0,0 @@
|
||||
static const wchar_t to_ucs4[256] = {
|
||||
[0x00] = 0x0000,
|
||||
[0x01] = 0x0001,
|
||||
[0x02] = 0x0002,
|
||||
[0x03] = 0x0003,
|
||||
[0x04] = 0x0004,
|
||||
[0x05] = 0x0005,
|
||||
[0x06] = 0x0006,
|
||||
[0x07] = 0x0007,
|
||||
[0x08] = 0x0008,
|
||||
[0x09] = 0x0009,
|
||||
[0x0A] = 0x000A,
|
||||
[0x0B] = 0x000B,
|
||||
[0x0C] = 0x000C,
|
||||
[0x0D] = 0x000D,
|
||||
[0x0E] = 0x000E,
|
||||
[0x0F] = 0x000F,
|
||||
[0x10] = 0x0010,
|
||||
[0x11] = 0x0011,
|
||||
[0x12] = 0x0012,
|
||||
[0x13] = 0x0013,
|
||||
[0x14] = 0x0014,
|
||||
[0x15] = 0x0015,
|
||||
[0x16] = 0x0016,
|
||||
[0x17] = 0x0017,
|
||||
[0x18] = 0x0018,
|
||||
[0x19] = 0x0019,
|
||||
[0x1A] = 0x001A,
|
||||
[0x1B] = 0x001B,
|
||||
[0x1C] = 0x001C,
|
||||
[0x1D] = 0x001D,
|
||||
[0x1E] = 0x001E,
|
||||
[0x1F] = 0x001F,
|
||||
[0x20] = 0x0020,
|
||||
[0x21] = 0x0021,
|
||||
[0x22] = 0x0022,
|
||||
[0x23] = 0x0023,
|
||||
[0x24] = 0x0024,
|
||||
[0x25] = 0x0025,
|
||||
[0x26] = 0x0026,
|
||||
[0x27] = 0x0027,
|
||||
[0x28] = 0x0028,
|
||||
[0x29] = 0x0029,
|
||||
[0x2A] = 0x002A,
|
||||
[0x2B] = 0x002B,
|
||||
[0x2C] = 0x002C,
|
||||
[0x2D] = 0x002D,
|
||||
[0x2E] = 0x002E,
|
||||
[0x2F] = 0x002F,
|
||||
[0x30] = 0x0030,
|
||||
[0x31] = 0x0031,
|
||||
[0x32] = 0x0032,
|
||||
[0x33] = 0x0033,
|
||||
[0x34] = 0x0034,
|
||||
[0x35] = 0x0035,
|
||||
[0x36] = 0x0036,
|
||||
[0x37] = 0x0037,
|
||||
[0x38] = 0x0038,
|
||||
[0x39] = 0x0039,
|
||||
[0x3A] = 0x003A,
|
||||
[0x3B] = 0x003B,
|
||||
[0x3C] = 0x003C,
|
||||
[0x3D] = 0x003D,
|
||||
[0x3E] = 0x003E,
|
||||
[0x3F] = 0x003F,
|
||||
[0x40] = 0x0040,
|
||||
[0x41] = 0x0041,
|
||||
[0x42] = 0x0042,
|
||||
[0x43] = 0x0043,
|
||||
[0x44] = 0x0044,
|
||||
[0x45] = 0x0045,
|
||||
[0x46] = 0x0046,
|
||||
[0x47] = 0x0047,
|
||||
[0x48] = 0x0048,
|
||||
[0x49] = 0x0049,
|
||||
[0x4A] = 0x004A,
|
||||
[0x4B] = 0x004B,
|
||||
[0x4C] = 0x004C,
|
||||
[0x4D] = 0x004D,
|
||||
[0x4E] = 0x004E,
|
||||
[0x4F] = 0x004F,
|
||||
[0x50] = 0x0050,
|
||||
[0x51] = 0x0051,
|
||||
[0x52] = 0x0052,
|
||||
[0x53] = 0x0053,
|
||||
[0x54] = 0x0054,
|
||||
[0x55] = 0x0055,
|
||||
[0x56] = 0x0056,
|
||||
[0x57] = 0x0057,
|
||||
[0x58] = 0x0058,
|
||||
[0x59] = 0x0059,
|
||||
[0x5A] = 0x005A,
|
||||
[0x5B] = 0x005B,
|
||||
[0x5C] = 0x005C,
|
||||
[0x5D] = 0x005D,
|
||||
[0x5E] = 0x005E,
|
||||
[0x5F] = 0x005F,
|
||||
[0x60] = 0x0060,
|
||||
[0x61] = 0x0061,
|
||||
[0x62] = 0x0062,
|
||||
[0x63] = 0x0063,
|
||||
[0x64] = 0x0064,
|
||||
[0x65] = 0x0065,
|
||||
[0x66] = 0x0066,
|
||||
[0x67] = 0x0067,
|
||||
[0x68] = 0x0068,
|
||||
[0x69] = 0x0069,
|
||||
[0x6A] = 0x006A,
|
||||
[0x6B] = 0x006B,
|
||||
[0x6C] = 0x006C,
|
||||
[0x6D] = 0x006D,
|
||||
[0x6E] = 0x006E,
|
||||
[0x6F] = 0x006F,
|
||||
[0x70] = 0x0070,
|
||||
[0x71] = 0x0071,
|
||||
[0x72] = 0x0072,
|
||||
[0x73] = 0x0073,
|
||||
[0x74] = 0x0074,
|
||||
[0x75] = 0x0075,
|
||||
[0x76] = 0x0076,
|
||||
[0x77] = 0x0077,
|
||||
[0x78] = 0x0078,
|
||||
[0x79] = 0x0079,
|
||||
[0x7A] = 0x007A,
|
||||
[0x7B] = 0x007B,
|
||||
[0x7C] = 0x007C,
|
||||
[0x7D] = 0x007D,
|
||||
[0x7E] = 0x007E,
|
||||
[0x7F] = 0x007F,
|
||||
[0x80] = 0x0080,
|
||||
[0x81] = 0x0081,
|
||||
[0x82] = 0x0082,
|
||||
[0x83] = 0x0083,
|
||||
[0x84] = 0x0084,
|
||||
[0x85] = 0x0085,
|
||||
[0x86] = 0x0086,
|
||||
[0x87] = 0x0087,
|
||||
[0x88] = 0x0088,
|
||||
[0x89] = 0x0089,
|
||||
[0x8A] = 0x008A,
|
||||
[0x8B] = 0x008B,
|
||||
[0x8C] = 0x008C,
|
||||
[0x8D] = 0x008D,
|
||||
[0x8E] = 0x008E,
|
||||
[0x8F] = 0x008F,
|
||||
[0x90] = 0x0090,
|
||||
[0x91] = 0x0091,
|
||||
[0x92] = 0x0092,
|
||||
[0x93] = 0x0093,
|
||||
[0x94] = 0x0094,
|
||||
[0x95] = 0x0095,
|
||||
[0x96] = 0x0096,
|
||||
[0x97] = 0x0097,
|
||||
[0x98] = 0x0098,
|
||||
[0x99] = 0x0099,
|
||||
[0x9A] = 0x009A,
|
||||
[0x9B] = 0x009B,
|
||||
[0x9C] = 0x009C,
|
||||
[0x9D] = 0x009D,
|
||||
[0x9E] = 0x009E,
|
||||
[0x9F] = 0x009F,
|
||||
[0xA0] = 0x00A0,
|
||||
[0xA1] = 0x0104,
|
||||
[0xA2] = 0x0138,
|
||||
[0xA3] = 0x0156,
|
||||
[0xA4] = 0x00A4,
|
||||
[0xA5] = 0x0128,
|
||||
[0xA6] = 0x013B,
|
||||
[0xA7] = 0x00A7,
|
||||
[0xA8] = 0x00A8,
|
||||
[0xA9] = 0x0160,
|
||||
[0xAA] = 0x0112,
|
||||
[0xAB] = 0x0122,
|
||||
[0xAC] = 0x0166,
|
||||
[0xAD] = 0x00AD,
|
||||
[0xAE] = 0x017D,
|
||||
[0xAF] = 0x00AF,
|
||||
[0xB0] = 0x00B0,
|
||||
[0xB1] = 0x0105,
|
||||
[0xB2] = 0x02DB,
|
||||
[0xB3] = 0x0157,
|
||||
[0xB4] = 0x00B4,
|
||||
[0xB5] = 0x0129,
|
||||
[0xB6] = 0x013C,
|
||||
[0xB7] = 0x02C7,
|
||||
[0xB8] = 0x00B8,
|
||||
[0xB9] = 0x0161,
|
||||
[0xBA] = 0x0113,
|
||||
[0xBB] = 0x0123,
|
||||
[0xBC] = 0x0167,
|
||||
[0xBD] = 0x014A,
|
||||
[0xBE] = 0x017E,
|
||||
[0xBF] = 0x014B,
|
||||
[0xC0] = 0x0100,
|
||||
[0xC1] = 0x00C1,
|
||||
[0xC2] = 0x00C2,
|
||||
[0xC3] = 0x00C3,
|
||||
[0xC4] = 0x00C4,
|
||||
[0xC5] = 0x00C5,
|
||||
[0xC6] = 0x00C6,
|
||||
[0xC7] = 0x012E,
|
||||
[0xC8] = 0x010C,
|
||||
[0xC9] = 0x00C9,
|
||||
[0xCA] = 0x0118,
|
||||
[0xCB] = 0x00CB,
|
||||
[0xCC] = 0x0116,
|
||||
[0xCD] = 0x00CD,
|
||||
[0xCE] = 0x00CE,
|
||||
[0xCF] = 0x012A,
|
||||
[0xD0] = 0x0110,
|
||||
[0xD1] = 0x0145,
|
||||
[0xD2] = 0x014C,
|
||||
[0xD3] = 0x0136,
|
||||
[0xD4] = 0x00D4,
|
||||
[0xD5] = 0x00D5,
|
||||
[0xD6] = 0x00D6,
|
||||
[0xD7] = 0x00D7,
|
||||
[0xD8] = 0x00D8,
|
||||
[0xD9] = 0x0172,
|
||||
[0xDA] = 0x00DA,
|
||||
[0xDB] = 0x00DB,
|
||||
[0xDC] = 0x00DC,
|
||||
[0xDD] = 0x0168,
|
||||
[0xDE] = 0x016A,
|
||||
[0xDF] = 0x00DF,
|
||||
[0xE0] = 0x0101,
|
||||
[0xE1] = 0x00E1,
|
||||
[0xE2] = 0x00E2,
|
||||
[0xE3] = 0x00E3,
|
||||
[0xE4] = 0x00E4,
|
||||
[0xE5] = 0x00E5,
|
||||
[0xE6] = 0x00E6,
|
||||
[0xE7] = 0x012F,
|
||||
[0xE8] = 0x010D,
|
||||
[0xE9] = 0x00E9,
|
||||
[0xEA] = 0x0119,
|
||||
[0xEB] = 0x00EB,
|
||||
[0xEC] = 0x0117,
|
||||
[0xED] = 0x00ED,
|
||||
[0xEE] = 0x00EE,
|
||||
[0xEF] = 0x012B,
|
||||
[0xF0] = 0x0111,
|
||||
[0xF1] = 0x0146,
|
||||
[0xF2] = 0x014D,
|
||||
[0xF3] = 0x0137,
|
||||
[0xF4] = 0x00F4,
|
||||
[0xF5] = 0x00F5,
|
||||
[0xF6] = 0x00F6,
|
||||
[0xF7] = 0x00F7,
|
||||
[0xF8] = 0x00F8,
|
||||
[0xF9] = 0x0173,
|
||||
[0xFA] = 0x00FA,
|
||||
[0xFB] = 0x00FB,
|
||||
[0xFC] = 0x00FC,
|
||||
[0xFD] = 0x0169,
|
||||
[0xFE] = 0x016B,
|
||||
[0xFF] = 0x02D9,
|
||||
};
|
||||
static const char from_ucs4[] = {
|
||||
[0x0000] = 0x00,
|
||||
[0x0001] = 0x01,
|
||||
[0x0002] = 0x02,
|
||||
[0x0003] = 0x03,
|
||||
[0x0004] = 0x04,
|
||||
[0x0005] = 0x05,
|
||||
[0x0006] = 0x06,
|
||||
[0x0007] = 0x07,
|
||||
[0x0008] = 0x08,
|
||||
[0x0009] = 0x09,
|
||||
[0x000A] = 0x0A,
|
||||
[0x000B] = 0x0B,
|
||||
[0x000C] = 0x0C,
|
||||
[0x000D] = 0x0D,
|
||||
[0x000E] = 0x0E,
|
||||
[0x000F] = 0x0F,
|
||||
[0x0010] = 0x10,
|
||||
[0x0011] = 0x11,
|
||||
[0x0012] = 0x12,
|
||||
[0x0013] = 0x13,
|
||||
[0x0014] = 0x14,
|
||||
[0x0015] = 0x15,
|
||||
[0x0016] = 0x16,
|
||||
[0x0017] = 0x17,
|
||||
[0x0018] = 0x18,
|
||||
[0x0019] = 0x19,
|
||||
[0x001A] = 0x1A,
|
||||
[0x001B] = 0x1B,
|
||||
[0x001C] = 0x1C,
|
||||
[0x001D] = 0x1D,
|
||||
[0x001E] = 0x1E,
|
||||
[0x001F] = 0x1F,
|
||||
[0x0020] = 0x20,
|
||||
[0x0021] = 0x21,
|
||||
[0x0022] = 0x22,
|
||||
[0x0023] = 0x23,
|
||||
[0x0024] = 0x24,
|
||||
[0x0025] = 0x25,
|
||||
[0x0026] = 0x26,
|
||||
[0x0027] = 0x27,
|
||||
[0x0028] = 0x28,
|
||||
[0x0029] = 0x29,
|
||||
[0x002A] = 0x2A,
|
||||
[0x002B] = 0x2B,
|
||||
[0x002C] = 0x2C,
|
||||
[0x002D] = 0x2D,
|
||||
[0x002E] = 0x2E,
|
||||
[0x002F] = 0x2F,
|
||||
[0x0030] = 0x30,
|
||||
[0x0031] = 0x31,
|
||||
[0x0032] = 0x32,
|
||||
[0x0033] = 0x33,
|
||||
[0x0034] = 0x34,
|
||||
[0x0035] = 0x35,
|
||||
[0x0036] = 0x36,
|
||||
[0x0037] = 0x37,
|
||||
[0x0038] = 0x38,
|
||||
[0x0039] = 0x39,
|
||||
[0x003A] = 0x3A,
|
||||
[0x003B] = 0x3B,
|
||||
[0x003C] = 0x3C,
|
||||
[0x003D] = 0x3D,
|
||||
[0x003E] = 0x3E,
|
||||
[0x003F] = 0x3F,
|
||||
[0x0040] = 0x40,
|
||||
[0x0041] = 0x41,
|
||||
[0x0042] = 0x42,
|
||||
[0x0043] = 0x43,
|
||||
[0x0044] = 0x44,
|
||||
[0x0045] = 0x45,
|
||||
[0x0046] = 0x46,
|
||||
[0x0047] = 0x47,
|
||||
[0x0048] = 0x48,
|
||||
[0x0049] = 0x49,
|
||||
[0x004A] = 0x4A,
|
||||
[0x004B] = 0x4B,
|
||||
[0x004C] = 0x4C,
|
||||
[0x004D] = 0x4D,
|
||||
[0x004E] = 0x4E,
|
||||
[0x004F] = 0x4F,
|
||||
[0x0050] = 0x50,
|
||||
[0x0051] = 0x51,
|
||||
[0x0052] = 0x52,
|
||||
[0x0053] = 0x53,
|
||||
[0x0054] = 0x54,
|
||||
[0x0055] = 0x55,
|
||||
[0x0056] = 0x56,
|
||||
[0x0057] = 0x57,
|
||||
[0x0058] = 0x58,
|
||||
[0x0059] = 0x59,
|
||||
[0x005A] = 0x5A,
|
||||
[0x005B] = 0x5B,
|
||||
[0x005C] = 0x5C,
|
||||
[0x005D] = 0x5D,
|
||||
[0x005E] = 0x5E,
|
||||
[0x005F] = 0x5F,
|
||||
[0x0060] = 0x60,
|
||||
[0x0061] = 0x61,
|
||||
[0x0062] = 0x62,
|
||||
[0x0063] = 0x63,
|
||||
[0x0064] = 0x64,
|
||||
[0x0065] = 0x65,
|
||||
[0x0066] = 0x66,
|
||||
[0x0067] = 0x67,
|
||||
[0x0068] = 0x68,
|
||||
[0x0069] = 0x69,
|
||||
[0x006A] = 0x6A,
|
||||
[0x006B] = 0x6B,
|
||||
[0x006C] = 0x6C,
|
||||
[0x006D] = 0x6D,
|
||||
[0x006E] = 0x6E,
|
||||
[0x006F] = 0x6F,
|
||||
[0x0070] = 0x70,
|
||||
[0x0071] = 0x71,
|
||||
[0x0072] = 0x72,
|
||||
[0x0073] = 0x73,
|
||||
[0x0074] = 0x74,
|
||||
[0x0075] = 0x75,
|
||||
[0x0076] = 0x76,
|
||||
[0x0077] = 0x77,
|
||||
[0x0078] = 0x78,
|
||||
[0x0079] = 0x79,
|
||||
[0x007A] = 0x7A,
|
||||
[0x007B] = 0x7B,
|
||||
[0x007C] = 0x7C,
|
||||
[0x007D] = 0x7D,
|
||||
[0x007E] = 0x7E,
|
||||
[0x007F] = 0x7F,
|
||||
[0x0080] = 0x80,
|
||||
[0x0081] = 0x81,
|
||||
[0x0082] = 0x82,
|
||||
[0x0083] = 0x83,
|
||||
[0x0084] = 0x84,
|
||||
[0x0085] = 0x85,
|
||||
[0x0086] = 0x86,
|
||||
[0x0087] = 0x87,
|
||||
[0x0088] = 0x88,
|
||||
[0x0089] = 0x89,
|
||||
[0x008A] = 0x8A,
|
||||
[0x008B] = 0x8B,
|
||||
[0x008C] = 0x8C,
|
||||
[0x008D] = 0x8D,
|
||||
[0x008E] = 0x8E,
|
||||
[0x008F] = 0x8F,
|
||||
[0x0090] = 0x90,
|
||||
[0x0091] = 0x91,
|
||||
[0x0092] = 0x92,
|
||||
[0x0093] = 0x93,
|
||||
[0x0094] = 0x94,
|
||||
[0x0095] = 0x95,
|
||||
[0x0096] = 0x96,
|
||||
[0x0097] = 0x97,
|
||||
[0x0098] = 0x98,
|
||||
[0x0099] = 0x99,
|
||||
[0x009A] = 0x9A,
|
||||
[0x009B] = 0x9B,
|
||||
[0x009C] = 0x9C,
|
||||
[0x009D] = 0x9D,
|
||||
[0x009E] = 0x9E,
|
||||
[0x009F] = 0x9F,
|
||||
[0x00A0] = 0xA0,
|
||||
[0x00A4] = 0xA4,
|
||||
[0x00A7] = 0xA7,
|
||||
[0x00A8] = 0xA8,
|
||||
[0x00AD] = 0xAD,
|
||||
[0x00AF] = 0xAF,
|
||||
[0x00B0] = 0xB0,
|
||||
[0x00B4] = 0xB4,
|
||||
[0x00B8] = 0xB8,
|
||||
[0x00C1] = 0xC1,
|
||||
[0x00C2] = 0xC2,
|
||||
[0x00C3] = 0xC3,
|
||||
[0x00C4] = 0xC4,
|
||||
[0x00C5] = 0xC5,
|
||||
[0x00C6] = 0xC6,
|
||||
[0x00C9] = 0xC9,
|
||||
[0x00CB] = 0xCB,
|
||||
[0x00CD] = 0xCD,
|
||||
[0x00CE] = 0xCE,
|
||||
[0x00D4] = 0xD4,
|
||||
[0x00D5] = 0xD5,
|
||||
[0x00D6] = 0xD6,
|
||||
[0x00D7] = 0xD7,
|
||||
[0x00D8] = 0xD8,
|
||||
[0x00DA] = 0xDA,
|
||||
[0x00DB] = 0xDB,
|
||||
[0x00DC] = 0xDC,
|
||||
[0x00DF] = 0xDF,
|
||||
[0x00E1] = 0xE1,
|
||||
[0x00E2] = 0xE2,
|
||||
[0x00E3] = 0xE3,
|
||||
[0x00E4] = 0xE4,
|
||||
[0x00E5] = 0xE5,
|
||||
[0x00E6] = 0xE6,
|
||||
[0x00E9] = 0xE9,
|
||||
[0x00EB] = 0xEB,
|
||||
[0x00ED] = 0xED,
|
||||
[0x00EE] = 0xEE,
|
||||
[0x00F4] = 0xF4,
|
||||
[0x00F5] = 0xF5,
|
||||
[0x00F6] = 0xF6,
|
||||
[0x00F7] = 0xF7,
|
||||
[0x00F8] = 0xF8,
|
||||
[0x00FA] = 0xFA,
|
||||
[0x00FB] = 0xFB,
|
||||
[0x00FC] = 0xFC,
|
||||
[0x0100] = 0xC0,
|
||||
[0x0101] = 0xE0,
|
||||
[0x0104] = 0xA1,
|
||||
[0x0105] = 0xB1,
|
||||
[0x010C] = 0xC8,
|
||||
[0x010D] = 0xE8,
|
||||
[0x0110] = 0xD0,
|
||||
[0x0111] = 0xF0,
|
||||
[0x0112] = 0xAA,
|
||||
[0x0113] = 0xBA,
|
||||
[0x0116] = 0xCC,
|
||||
[0x0117] = 0xEC,
|
||||
[0x0118] = 0xCA,
|
||||
[0x0119] = 0xEA,
|
||||
[0x0122] = 0xAB,
|
||||
[0x0123] = 0xBB,
|
||||
[0x0128] = 0xA5,
|
||||
[0x0129] = 0xB5,
|
||||
[0x012A] = 0xCF,
|
||||
[0x012B] = 0xEF,
|
||||
[0x012E] = 0xC7,
|
||||
[0x012F] = 0xE7,
|
||||
[0x0136] = 0xD3,
|
||||
[0x0137] = 0xF3,
|
||||
[0x0138] = 0xA2,
|
||||
[0x013B] = 0xA6,
|
||||
[0x013C] = 0xB6,
|
||||
[0x0145] = 0xD1,
|
||||
[0x0146] = 0xF1,
|
||||
[0x014A] = 0xBD,
|
||||
[0x014B] = 0xBF,
|
||||
[0x014C] = 0xD2,
|
||||
[0x014D] = 0xF2,
|
||||
[0x0156] = 0xA3,
|
||||
[0x0157] = 0xB3,
|
||||
[0x0160] = 0xA9,
|
||||
[0x0161] = 0xB9,
|
||||
[0x0166] = 0xAC,
|
||||
[0x0167] = 0xBC,
|
||||
[0x0168] = 0xDD,
|
||||
[0x0169] = 0xFD,
|
||||
[0x016A] = 0xDE,
|
||||
[0x016B] = 0xFE,
|
||||
[0x0172] = 0xD9,
|
||||
[0x0173] = 0xF9,
|
||||
[0x017D] = 0xAE,
|
||||
[0x017E] = 0xBE,
|
||||
[0x02C7] = 0xB7,
|
||||
[0x02D9] = 0xFF,
|
||||
[0x02DB] = 0xB2,
|
||||
};
|
@ -21,4 +21,4 @@
|
||||
#include <wchar.h>
|
||||
#include <iso8859-5.h>
|
||||
#define NAME "ISO-8859-5"
|
||||
#include <iso8859-generic.c>
|
||||
#include <8bit-generic.c>
|
||||
|
@ -1,516 +0,0 @@
|
||||
static const wchar_t to_ucs4[256] = {
|
||||
[0x00] = 0x0000,
|
||||
[0x01] = 0x0001,
|
||||
[0x02] = 0x0002,
|
||||
[0x03] = 0x0003,
|
||||
[0x04] = 0x0004,
|
||||
[0x05] = 0x0005,
|
||||
[0x06] = 0x0006,
|
||||
[0x07] = 0x0007,
|
||||
[0x08] = 0x0008,
|
||||
[0x09] = 0x0009,
|
||||
[0x0A] = 0x000A,
|
||||
[0x0B] = 0x000B,
|
||||
[0x0C] = 0x000C,
|
||||
[0x0D] = 0x000D,
|
||||
[0x0E] = 0x000E,
|
||||
[0x0F] = 0x000F,
|
||||
[0x10] = 0x0010,
|
||||
[0x11] = 0x0011,
|
||||
[0x12] = 0x0012,
|
||||
[0x13] = 0x0013,
|
||||
[0x14] = 0x0014,
|
||||
[0x15] = 0x0015,
|
||||
[0x16] = 0x0016,
|
||||
[0x17] = 0x0017,
|
||||
[0x18] = 0x0018,
|
||||
[0x19] = 0x0019,
|
||||
[0x1A] = 0x001A,
|
||||
[0x1B] = 0x001B,
|
||||
[0x1C] = 0x001C,
|
||||
[0x1D] = 0x001D,
|
||||
[0x1E] = 0x001E,
|
||||
[0x1F] = 0x001F,
|
||||
[0x20] = 0x0020,
|
||||
[0x21] = 0x0021,
|
||||
[0x22] = 0x0022,
|
||||
[0x23] = 0x0023,
|
||||
[0x24] = 0x0024,
|
||||
[0x25] = 0x0025,
|
||||
[0x26] = 0x0026,
|
||||
[0x27] = 0x0027,
|
||||
[0x28] = 0x0028,
|
||||
[0x29] = 0x0029,
|
||||
[0x2A] = 0x002A,
|
||||
[0x2B] = 0x002B,
|
||||
[0x2C] = 0x002C,
|
||||
[0x2D] = 0x002D,
|
||||
[0x2E] = 0x002E,
|
||||
[0x2F] = 0x002F,
|
||||
[0x30] = 0x0030,
|
||||
[0x31] = 0x0031,
|
||||
[0x32] = 0x0032,
|
||||
[0x33] = 0x0033,
|
||||
[0x34] = 0x0034,
|
||||
[0x35] = 0x0035,
|
||||
[0x36] = 0x0036,
|
||||
[0x37] = 0x0037,
|
||||
[0x38] = 0x0038,
|
||||
[0x39] = 0x0039,
|
||||
[0x3A] = 0x003A,
|
||||
[0x3B] = 0x003B,
|
||||
[0x3C] = 0x003C,
|
||||
[0x3D] = 0x003D,
|
||||
[0x3E] = 0x003E,
|
||||
[0x3F] = 0x003F,
|
||||
[0x40] = 0x0040,
|
||||
[0x41] = 0x0041,
|
||||
[0x42] = 0x0042,
|
||||
[0x43] = 0x0043,
|
||||
[0x44] = 0x0044,
|
||||
[0x45] = 0x0045,
|
||||
[0x46] = 0x0046,
|
||||
[0x47] = 0x0047,
|
||||
[0x48] = 0x0048,
|
||||
[0x49] = 0x0049,
|
||||
[0x4A] = 0x004A,
|
||||
[0x4B] = 0x004B,
|
||||
[0x4C] = 0x004C,
|
||||
[0x4D] = 0x004D,
|
||||
[0x4E] = 0x004E,
|
||||
[0x4F] = 0x004F,
|
||||
[0x50] = 0x0050,
|
||||
[0x51] = 0x0051,
|
||||
[0x52] = 0x0052,
|
||||
[0x53] = 0x0053,
|
||||
[0x54] = 0x0054,
|
||||
[0x55] = 0x0055,
|
||||
[0x56] = 0x0056,
|
||||
[0x57] = 0x0057,
|
||||
[0x58] = 0x0058,
|
||||
[0x59] = 0x0059,
|
||||
[0x5A] = 0x005A,
|
||||
[0x5B] = 0x005B,
|
||||
[0x5C] = 0x005C,
|
||||
[0x5D] = 0x005D,
|
||||
[0x5E] = 0x005E,
|
||||
[0x5F] = 0x005F,
|
||||
[0x60] = 0x0060,
|
||||
[0x61] = 0x0061,
|
||||
[0x62] = 0x0062,
|
||||
[0x63] = 0x0063,
|
||||
[0x64] = 0x0064,
|
||||
[0x65] = 0x0065,
|
||||
[0x66] = 0x0066,
|
||||
[0x67] = 0x0067,
|
||||
[0x68] = 0x0068,
|
||||
[0x69] = 0x0069,
|
||||
[0x6A] = 0x006A,
|
||||
[0x6B] = 0x006B,
|
||||
[0x6C] = 0x006C,
|
||||
[0x6D] = 0x006D,
|
||||
[0x6E] = 0x006E,
|
||||
[0x6F] = 0x006F,
|
||||
[0x70] = 0x0070,
|
||||
[0x71] = 0x0071,
|
||||
[0x72] = 0x0072,
|
||||
[0x73] = 0x0073,
|
||||
[0x74] = 0x0074,
|
||||
[0x75] = 0x0075,
|
||||
[0x76] = 0x0076,
|
||||
[0x77] = 0x0077,
|
||||
[0x78] = 0x0078,
|
||||
[0x79] = 0x0079,
|
||||
[0x7A] = 0x007A,
|
||||
[0x7B] = 0x007B,
|
||||
[0x7C] = 0x007C,
|
||||
[0x7D] = 0x007D,
|
||||
[0x7E] = 0x007E,
|
||||
[0x7F] = 0x007F,
|
||||
[0x80] = 0x0080,
|
||||
[0x81] = 0x0081,
|
||||
[0x82] = 0x0082,
|
||||
[0x83] = 0x0083,
|
||||
[0x84] = 0x0084,
|
||||
[0x85] = 0x0085,
|
||||
[0x86] = 0x0086,
|
||||
[0x87] = 0x0087,
|
||||
[0x88] = 0x0088,
|
||||
[0x89] = 0x0089,
|
||||
[0x8A] = 0x008A,
|
||||
[0x8B] = 0x008B,
|
||||
[0x8C] = 0x008C,
|
||||
[0x8D] = 0x008D,
|
||||
[0x8E] = 0x008E,
|
||||
[0x8F] = 0x008F,
|
||||
[0x90] = 0x0090,
|
||||
[0x91] = 0x0091,
|
||||
[0x92] = 0x0092,
|
||||
[0x93] = 0x0093,
|
||||
[0x94] = 0x0094,
|
||||
[0x95] = 0x0095,
|
||||
[0x96] = 0x0096,
|
||||
[0x97] = 0x0097,
|
||||
[0x98] = 0x0098,
|
||||
[0x99] = 0x0099,
|
||||
[0x9A] = 0x009A,
|
||||
[0x9B] = 0x009B,
|
||||
[0x9C] = 0x009C,
|
||||
[0x9D] = 0x009D,
|
||||
[0x9E] = 0x009E,
|
||||
[0x9F] = 0x009F,
|
||||
[0xA0] = 0x00A0,
|
||||
[0xA1] = 0x0401,
|
||||
[0xA2] = 0x0402,
|
||||
[0xA3] = 0x0403,
|
||||
[0xA4] = 0x0404,
|
||||
[0xA5] = 0x0405,
|
||||
[0xA6] = 0x0406,
|
||||
[0xA7] = 0x0407,
|
||||
[0xA8] = 0x0408,
|
||||
[0xA9] = 0x0409,
|
||||
[0xAA] = 0x040A,
|
||||
[0xAB] = 0x040B,
|
||||
[0xAC] = 0x040C,
|
||||
[0xAD] = 0x00AD,
|
||||
[0xAE] = 0x040E,
|
||||
[0xAF] = 0x040F,
|
||||
[0xB0] = 0x0410,
|
||||
[0xB1] = 0x0411,
|
||||
[0xB2] = 0x0412,
|
||||
[0xB3] = 0x0413,
|
||||
[0xB4] = 0x0414,
|
||||
[0xB5] = 0x0415,
|
||||
[0xB6] = 0x0416,
|
||||
[0xB7] = 0x0417,
|
||||
[0xB8] = 0x0418,
|
||||
[0xB9] = 0x0419,
|
||||
[0xBA] = 0x041A,
|
||||
[0xBB] = 0x041B,
|
||||
[0xBC] = 0x041C,
|
||||
[0xBD] = 0x041D,
|
||||
[0xBE] = 0x041E,
|
||||
[0xBF] = 0x041F,
|
||||
[0xC0] = 0x0420,
|
||||
[0xC1] = 0x0421,
|
||||
[0xC2] = 0x0422,
|
||||
[0xC3] = 0x0423,
|
||||
[0xC4] = 0x0424,
|
||||
[0xC5] = 0x0425,
|
||||
[0xC6] = 0x0426,
|
||||
[0xC7] = 0x0427,
|
||||
[0xC8] = 0x0428,
|
||||
[0xC9] = 0x0429,
|
||||
[0xCA] = 0x042A,
|
||||
[0xCB] = 0x042B,
|
||||
[0xCC] = 0x042C,
|
||||
[0xCD] = 0x042D,
|
||||
[0xCE] = 0x042E,
|
||||
[0xCF] = 0x042F,
|
||||
[0xD0] = 0x0430,
|
||||
[0xD1] = 0x0431,
|
||||
[0xD2] = 0x0432,
|
||||
[0xD3] = 0x0433,
|
||||
[0xD4] = 0x0434,
|
||||
[0xD5] = 0x0435,
|
||||
[0xD6] = 0x0436,
|
||||
[0xD7] = 0x0437,
|
||||
[0xD8] = 0x0438,
|
||||
[0xD9] = 0x0439,
|
||||
[0xDA] = 0x043A,
|
||||
[0xDB] = 0x043B,
|
||||
[0xDC] = 0x043C,
|
||||
[0xDD] = 0x043D,
|
||||
[0xDE] = 0x043E,
|
||||
[0xDF] = 0x043F,
|
||||
[0xE0] = 0x0440,
|
||||
[0xE1] = 0x0441,
|
||||
[0xE2] = 0x0442,
|
||||
[0xE3] = 0x0443,
|
||||
[0xE4] = 0x0444,
|
||||
[0xE5] = 0x0445,
|
||||
[0xE6] = 0x0446,
|
||||
[0xE7] = 0x0447,
|
||||
[0xE8] = 0x0448,
|
||||
[0xE9] = 0x0449,
|
||||
[0xEA] = 0x044A,
|
||||
[0xEB] = 0x044B,
|
||||
[0xEC] = 0x044C,
|
||||
[0xED] = 0x044D,
|
||||
[0xEE] = 0x044E,
|
||||
[0xEF] = 0x044F,
|
||||
[0xF0] = 0x2116,
|
||||
[0xF1] = 0x0451,
|
||||
[0xF2] = 0x0452,
|
||||
[0xF3] = 0x0453,
|
||||
[0xF4] = 0x0454,
|
||||
[0xF5] = 0x0455,
|
||||
[0xF6] = 0x0456,
|
||||
[0xF7] = 0x0457,
|
||||
[0xF8] = 0x0458,
|
||||
[0xF9] = 0x0459,
|
||||
[0xFA] = 0x045A,
|
||||
[0xFB] = 0x045B,
|
||||
[0xFC] = 0x045C,
|
||||
[0xFD] = 0x00A7,
|
||||
[0xFE] = 0x045E,
|
||||
[0xFF] = 0x045F,
|
||||
};
|
||||
static const char from_ucs4[] = {
|
||||
[0x0000] = 0x00,
|
||||
[0x0001] = 0x01,
|
||||
[0x0002] = 0x02,
|
||||
[0x0003] = 0x03,
|
||||
[0x0004] = 0x04,
|
||||
[0x0005] = 0x05,
|
||||
[0x0006] = 0x06,
|
||||
[0x0007] = 0x07,
|
||||
[0x0008] = 0x08,
|
||||
[0x0009] = 0x09,
|
||||
[0x000A] = 0x0A,
|
||||
[0x000B] = 0x0B,
|
||||
[0x000C] = 0x0C,
|
||||
[0x000D] = 0x0D,
|
||||
[0x000E] = 0x0E,
|
||||
[0x000F] = 0x0F,
|
||||
[0x0010] = 0x10,
|
||||
[0x0011] = 0x11,
|
||||
[0x0012] = 0x12,
|
||||
[0x0013] = 0x13,
|
||||
[0x0014] = 0x14,
|
||||
[0x0015] = 0x15,
|
||||
[0x0016] = 0x16,
|
||||
[0x0017] = 0x17,
|
||||
[0x0018] = 0x18,
|
||||
[0x0019] = 0x19,
|
||||
[0x001A] = 0x1A,
|
||||
[0x001B] = 0x1B,
|
||||
[0x001C] = 0x1C,
|
||||
[0x001D] = 0x1D,
|
||||
[0x001E] = 0x1E,
|
||||
[0x001F] = 0x1F,
|
||||
[0x0020] = 0x20,
|
||||
[0x0021] = 0x21,
|
||||
[0x0022] = 0x22,
|
||||
[0x0023] = 0x23,
|
||||
[0x0024] = 0x24,
|
||||
[0x0025] = 0x25,
|
||||
[0x0026] = 0x26,
|
||||
[0x0027] = 0x27,
|
||||
[0x0028] = 0x28,
|
||||
[0x0029] = 0x29,
|
||||
[0x002A] = 0x2A,
|
||||
[0x002B] = 0x2B,
|
||||
[0x002C] = 0x2C,
|
||||
[0x002D] = 0x2D,
|
||||
[0x002E] = 0x2E,
|
||||
[0x002F] = 0x2F,
|
||||
[0x0030] = 0x30,
|
||||
[0x0031] = 0x31,
|
||||
[0x0032] = 0x32,
|
||||
[0x0033] = 0x33,
|
||||
[0x0034] = 0x34,
|
||||
[0x0035] = 0x35,
|
||||
[0x0036] = 0x36,
|
||||
[0x0037] = 0x37,
|
||||
[0x0038] = 0x38,
|
||||
[0x0039] = 0x39,
|
||||
[0x003A] = 0x3A,
|
||||
[0x003B] = 0x3B,
|
||||
[0x003C] = 0x3C,
|
||||
[0x003D] = 0x3D,
|
||||
[0x003E] = 0x3E,
|
||||
[0x003F] = 0x3F,
|
||||
[0x0040] = 0x40,
|
||||
[0x0041] = 0x41,
|
||||
[0x0042] = 0x42,
|
||||
[0x0043] = 0x43,
|
||||
[0x0044] = 0x44,
|
||||
[0x0045] = 0x45,
|
||||
[0x0046] = 0x46,
|
||||
[0x0047] = 0x47,
|
||||
[0x0048] = 0x48,
|
||||
[0x0049] = 0x49,
|
||||
[0x004A] = 0x4A,
|
||||
[0x004B] = 0x4B,
|
||||
[0x004C] = 0x4C,
|
||||
[0x004D] = 0x4D,
|
||||
[0x004E] = 0x4E,
|
||||
[0x004F] = 0x4F,
|
||||
[0x0050] = 0x50,
|
||||
[0x0051] = 0x51,
|
||||
[0x0052] = 0x52,
|
||||
[0x0053] = 0x53,
|
||||
[0x0054] = 0x54,
|
||||
[0x0055] = 0x55,
|
||||
[0x0056] = 0x56,
|
||||
[0x0057] = 0x57,
|
||||
[0x0058] = 0x58,
|
||||
[0x0059] = 0x59,
|
||||
[0x005A] = 0x5A,
|
||||
[0x005B] = 0x5B,
|
||||
[0x005C] = 0x5C,
|
||||
[0x005D] = 0x5D,
|
||||
[0x005E] = 0x5E,
|
||||
[0x005F] = 0x5F,
|
||||
[0x0060] = 0x60,
|
||||
[0x0061] = 0x61,
|
||||
[0x0062] = 0x62,
|
||||
[0x0063] = 0x63,
|
||||
[0x0064] = 0x64,
|
||||
[0x0065] = 0x65,
|
||||
[0x0066] = 0x66,
|
||||
[0x0067] = 0x67,
|
||||
[0x0068] = 0x68,
|
||||
[0x0069] = 0x69,
|
||||
[0x006A] = 0x6A,
|
||||
[0x006B] = 0x6B,
|
||||
[0x006C] = 0x6C,
|
||||
[0x006D] = 0x6D,
|
||||
[0x006E] = 0x6E,
|
||||
[0x006F] = 0x6F,
|
||||
[0x0070] = 0x70,
|
||||
[0x0071] = 0x71,
|
||||
[0x0072] = 0x72,
|
||||
[0x0073] = 0x73,
|
||||
[0x0074] = 0x74,
|
||||
[0x0075] = 0x75,
|
||||
[0x0076] = 0x76,
|
||||
[0x0077] = 0x77,
|
||||
[0x0078] = 0x78,
|
||||
[0x0079] = 0x79,
|
||||
[0x007A] = 0x7A,
|
||||
[0x007B] = 0x7B,
|
||||
[0x007C] = 0x7C,
|
||||
[0x007D] = 0x7D,
|
||||
[0x007E] = 0x7E,
|
||||
[0x007F] = 0x7F,
|
||||
[0x0080] = 0x80,
|
||||
[0x0081] = 0x81,
|
||||
[0x0082] = 0x82,
|
||||
[0x0083] = 0x83,
|
||||
[0x0084] = 0x84,
|
||||
[0x0085] = 0x85,
|
||||
[0x0086] = 0x86,
|
||||
[0x0087] = 0x87,
|
||||
[0x0088] = 0x88,
|
||||
[0x0089] = 0x89,
|
||||
[0x008A] = 0x8A,
|
||||
[0x008B] = 0x8B,
|
||||
[0x008C] = 0x8C,
|
||||
[0x008D] = 0x8D,
|
||||
[0x008E] = 0x8E,
|
||||
[0x008F] = 0x8F,
|
||||
[0x0090] = 0x90,
|
||||
[0x0091] = 0x91,
|
||||
[0x0092] = 0x92,
|
||||
[0x0093] = 0x93,
|
||||
[0x0094] = 0x94,
|
||||
[0x0095] = 0x95,
|
||||
[0x0096] = 0x96,
|
||||
[0x0097] = 0x97,
|
||||
[0x0098] = 0x98,
|
||||
[0x0099] = 0x99,
|
||||
[0x009A] = 0x9A,
|
||||
[0x009B] = 0x9B,
|
||||
[0x009C] = 0x9C,
|
||||
[0x009D] = 0x9D,
|
||||
[0x009E] = 0x9E,
|
||||
[0x009F] = 0x9F,
|
||||
[0x00A0] = 0xA0,
|
||||
[0x00A7] = 0xFD,
|
||||
[0x00AD] = 0xAD,
|
||||
[0x0401] = 0xA1,
|
||||
[0x0402] = 0xA2,
|
||||
[0x0403] = 0xA3,
|
||||
[0x0404] = 0xA4,
|
||||
[0x0405] = 0xA5,
|
||||
[0x0406] = 0xA6,
|
||||
[0x0407] = 0xA7,
|
||||
[0x0408] = 0xA8,
|
||||
[0x0409] = 0xA9,
|
||||
[0x040A] = 0xAA,
|
||||
[0x040B] = 0xAB,
|
||||
[0x040C] = 0xAC,
|
||||
[0x040E] = 0xAE,
|
||||
[0x040F] = 0xAF,
|
||||
[0x0410] = 0xB0,
|
||||
[0x0411] = 0xB1,
|
||||
[0x0412] = 0xB2,
|
||||
[0x0413] = 0xB3,
|
||||
[0x0414] = 0xB4,
|
||||
[0x0415] = 0xB5,
|
||||
[0x0416] = 0xB6,
|
||||
[0x0417] = 0xB7,
|
||||
[0x0418] = 0xB8,
|
||||
[0x0419] = 0xB9,
|
||||
[0x041A] = 0xBA,
|
||||
[0x041B] = 0xBB,
|
||||
[0x041C] = 0xBC,
|
||||
[0x041D] = 0xBD,
|
||||
[0x041E] = 0xBE,
|
||||
[0x041F] = 0xBF,
|
||||
[0x0420] = 0xC0,
|
||||
[0x0421] = 0xC1,
|
||||
[0x0422] = 0xC2,
|
||||
[0x0423] = 0xC3,
|
||||
[0x0424] = 0xC4,
|
||||
[0x0425] = 0xC5,
|
||||
[0x0426] = 0xC6,
|
||||
[0x0427] = 0xC7,
|
||||
[0x0428] = 0xC8,
|
||||
[0x0429] = 0xC9,
|
||||
[0x042A] = 0xCA,
|
||||
[0x042B] = 0xCB,
|
||||
[0x042C] = 0xCC,
|
||||
[0x042D] = 0xCD,
|
||||
[0x042E] = 0xCE,
|
||||
[0x042F] = 0xCF,
|
||||
[0x0430] = 0xD0,
|
||||
[0x0431] = 0xD1,
|
||||
[0x0432] = 0xD2,
|
||||
[0x0433] = 0xD3,
|
||||
[0x0434] = 0xD4,
|
||||
[0x0435] = 0xD5,
|
||||
[0x0436] = 0xD6,
|
||||
[0x0437] = 0xD7,
|
||||
[0x0438] = 0xD8,
|
||||
[0x0439] = 0xD9,
|
||||
[0x043A] = 0xDA,
|
||||
[0x043B] = 0xDB,
|
||||
[0x043C] = 0xDC,
|
||||
[0x043D] = 0xDD,
|
||||
[0x043E] = 0xDE,
|
||||
[0x043F] = 0xDF,
|
||||
[0x0440] = 0xE0,
|
||||
[0x0441] = 0xE1,
|
||||
[0x0442] = 0xE2,
|
||||
[0x0443] = 0xE3,
|
||||
[0x0444] = 0xE4,
|
||||
[0x0445] = 0xE5,
|
||||
[0x0446] = 0xE6,
|
||||
[0x0447] = 0xE7,
|
||||
[0x0448] = 0xE8,
|
||||
[0x0449] = 0xE9,
|
||||
[0x044A] = 0xEA,
|
||||
[0x044B] = 0xEB,
|
||||
[0x044C] = 0xEC,
|
||||
[0x044D] = 0xED,
|
||||
[0x044E] = 0xEE,
|
||||
[0x044F] = 0xEF,
|
||||
[0x0451] = 0xF1,
|
||||
[0x0452] = 0xF2,
|
||||
[0x0453] = 0xF3,
|
||||
[0x0454] = 0xF4,
|
||||
[0x0455] = 0xF5,
|
||||
[0x0456] = 0xF6,
|
||||
[0x0457] = 0xF7,
|
||||
[0x0458] = 0xF8,
|
||||
[0x0459] = 0xF9,
|
||||
[0x045A] = 0xFA,
|
||||
[0x045B] = 0xFB,
|
||||
[0x045C] = 0xFC,
|
||||
[0x045E] = 0xFE,
|
||||
[0x045F] = 0xFF,
|
||||
[0x2116] = 0xF0,
|
||||
};
|
@ -21,4 +21,4 @@
|
||||
#include <wchar.h>
|
||||
#include <iso8859-6.h>
|
||||
#define NAME "ISO-8859-6"
|
||||
#include <iso8859-generic.c>
|
||||
#include <8bit-generic.c>
|
||||
|
@ -1,426 +0,0 @@
|
||||
static const wchar_t to_ucs4[256] = {
|
||||
[0x00] = 0x0000,
|
||||
[0x01] = 0x0001,
|
||||
[0x02] = 0x0002,
|
||||
[0x03] = 0x0003,
|
||||
[0x04] = 0x0004,
|
||||
[0x05] = 0x0005,
|
||||
[0x06] = 0x0006,
|
||||
[0x07] = 0x0007,
|
||||
[0x08] = 0x0008,
|
||||
[0x09] = 0x0009,
|
||||
[0x0A] = 0x000A,
|
||||
[0x0B] = 0x000B,
|
||||
[0x0C] = 0x000C,
|
||||
[0x0D] = 0x000D,
|
||||
[0x0E] = 0x000E,
|
||||
[0x0F] = 0x000F,
|
||||
[0x10] = 0x0010,
|
||||
[0x11] = 0x0011,
|
||||
[0x12] = 0x0012,
|
||||
[0x13] = 0x0013,
|
||||
[0x14] = 0x0014,
|
||||
[0x15] = 0x0015,
|
||||
[0x16] = 0x0016,
|
||||
[0x17] = 0x0017,
|
||||
[0x18] = 0x0018,
|
||||
[0x19] = 0x0019,
|
||||
[0x1A] = 0x001A,
|
||||
[0x1B] = 0x001B,
|
||||
[0x1C] = 0x001C,
|
||||
[0x1D] = 0x001D,
|
||||
[0x1E] = 0x001E,
|
||||
[0x1F] = 0x001F,
|
||||
[0x20] = 0x0020,
|
||||
[0x21] = 0x0021,
|
||||
[0x22] = 0x0022,
|
||||
[0x23] = 0x0023,
|
||||
[0x24] = 0x0024,
|
||||
[0x25] = 0x0025,
|
||||
[0x26] = 0x0026,
|
||||
[0x27] = 0x0027,
|
||||
[0x28] = 0x0028,
|
||||
[0x29] = 0x0029,
|
||||
[0x2A] = 0x002A,
|
||||
[0x2B] = 0x002B,
|
||||
[0x2C] = 0x002C,
|
||||
[0x2D] = 0x002D,
|
||||
[0x2E] = 0x002E,
|
||||
[0x2F] = 0x002F,
|
||||
[0x30] = 0x0030,
|
||||
[0x31] = 0x0031,
|
||||
[0x32] = 0x0032,
|
||||
[0x33] = 0x0033,
|
||||
[0x34] = 0x0034,
|
||||
[0x35] = 0x0035,
|
||||
[0x36] = 0x0036,
|
||||
[0x37] = 0x0037,
|
||||
[0x38] = 0x0038,
|
||||
[0x39] = 0x0039,
|
||||
[0x3A] = 0x003A,
|
||||
[0x3B] = 0x003B,
|
||||
[0x3C] = 0x003C,
|
||||
[0x3D] = 0x003D,
|
||||
[0x3E] = 0x003E,
|
||||
[0x3F] = 0x003F,
|
||||
[0x40] = 0x0040,
|
||||
[0x41] = 0x0041,
|
||||
[0x42] = 0x0042,
|
||||
[0x43] = 0x0043,
|
||||
[0x44] = 0x0044,
|
||||
[0x45] = 0x0045,
|
||||
[0x46] = 0x0046,
|
||||
[0x47] = 0x0047,
|
||||
[0x48] = 0x0048,
|
||||
[0x49] = 0x0049,
|
||||
[0x4A] = 0x004A,
|
||||
[0x4B] = 0x004B,
|
||||
[0x4C] = 0x004C,
|
||||
[0x4D] = 0x004D,
|
||||
[0x4E] = 0x004E,
|
||||
[0x4F] = 0x004F,
|
||||
[0x50] = 0x0050,
|
||||
[0x51] = 0x0051,
|
||||
[0x52] = 0x0052,
|
||||
[0x53] = 0x0053,
|
||||
[0x54] = 0x0054,
|
||||
[0x55] = 0x0055,
|
||||
[0x56] = 0x0056,
|
||||
[0x57] = 0x0057,
|
||||
[0x58] = 0x0058,
|
||||
[0x59] = 0x0059,
|
||||
[0x5A] = 0x005A,
|
||||
[0x5B] = 0x005B,
|
||||
[0x5C] = 0x005C,
|
||||
[0x5D] = 0x005D,
|
||||
[0x5E] = 0x005E,
|
||||
[0x5F] = 0x005F,
|
||||
[0x60] = 0x0060,
|
||||
[0x61] = 0x0061,
|
||||
[0x62] = 0x0062,
|
||||
[0x63] = 0x0063,
|
||||
[0x64] = 0x0064,
|
||||
[0x65] = 0x0065,
|
||||
[0x66] = 0x0066,
|
||||
[0x67] = 0x0067,
|
||||
[0x68] = 0x0068,
|
||||
[0x69] = 0x0069,
|
||||
[0x6A] = 0x006A,
|
||||
[0x6B] = 0x006B,
|
||||
[0x6C] = 0x006C,
|
||||
[0x6D] = 0x006D,
|
||||
[0x6E] = 0x006E,
|
||||
[0x6F] = 0x006F,
|
||||
[0x70] = 0x0070,
|
||||
[0x71] = 0x0071,
|
||||
[0x72] = 0x0072,
|
||||
[0x73] = 0x0073,
|
||||
[0x74] = 0x0074,
|
||||
[0x75] = 0x0075,
|
||||
[0x76] = 0x0076,
|
||||
[0x77] = 0x0077,
|
||||
[0x78] = 0x0078,
|
||||
[0x79] = 0x0079,
|
||||
[0x7A] = 0x007A,
|
||||
[0x7B] = 0x007B,
|
||||
[0x7C] = 0x007C,
|
||||
[0x7D] = 0x007D,
|
||||
[0x7E] = 0x007E,
|
||||
[0x7F] = 0x007F,
|
||||
[0x80] = 0x0080,
|
||||
[0x81] = 0x0081,
|
||||
[0x82] = 0x0082,
|
||||
[0x83] = 0x0083,
|
||||
[0x84] = 0x0084,
|
||||
[0x85] = 0x0085,
|
||||
[0x86] = 0x0086,
|
||||
[0x87] = 0x0087,
|
||||
[0x88] = 0x0088,
|
||||
[0x89] = 0x0089,
|
||||
[0x8A] = 0x008A,
|
||||
[0x8B] = 0x008B,
|
||||
[0x8C] = 0x008C,
|
||||
[0x8D] = 0x008D,
|
||||
[0x8E] = 0x008E,
|
||||
[0x8F] = 0x008F,
|
||||
[0x90] = 0x0090,
|
||||
[0x91] = 0x0091,
|
||||
[0x92] = 0x0092,
|
||||
[0x93] = 0x0093,
|
||||
[0x94] = 0x0094,
|
||||
[0x95] = 0x0095,
|
||||
[0x96] = 0x0096,
|
||||
[0x97] = 0x0097,
|
||||
[0x98] = 0x0098,
|
||||
[0x99] = 0x0099,
|
||||
[0x9A] = 0x009A,
|
||||
[0x9B] = 0x009B,
|
||||
[0x9C] = 0x009C,
|
||||
[0x9D] = 0x009D,
|
||||
[0x9E] = 0x009E,
|
||||
[0x9F] = 0x009F,
|
||||
[0xA0] = 0x00A0,
|
||||
[0xA4] = 0x00A4,
|
||||
[0xAC] = 0x060C,
|
||||
[0xAD] = 0x00AD,
|
||||
[0xBB] = 0x061B,
|
||||
[0xBF] = 0x061F,
|
||||
[0xC1] = 0x0621,
|
||||
[0xC2] = 0x0622,
|
||||
[0xC3] = 0x0623,
|
||||
[0xC4] = 0x0624,
|
||||
[0xC5] = 0x0625,
|
||||
[0xC6] = 0x0626,
|
||||
[0xC7] = 0x0627,
|
||||
[0xC8] = 0x0628,
|
||||
[0xC9] = 0x0629,
|
||||
[0xCA] = 0x062A,
|
||||
[0xCB] = 0x062B,
|
||||
[0xCC] = 0x062C,
|
||||
[0xCD] = 0x062D,
|
||||
[0xCE] = 0x062E,
|
||||
[0xCF] = 0x062F,
|
||||
[0xD0] = 0x0630,
|
||||
[0xD1] = 0x0631,
|
||||
[0xD2] = 0x0632,
|
||||
[0xD3] = 0x0633,
|
||||
[0xD4] = 0x0634,
|
||||
[0xD5] = 0x0635,
|
||||
[0xD6] = 0x0636,
|
||||
[0xD7] = 0x0637,
|
||||
[0xD8] = 0x0638,
|
||||
[0xD9] = 0x0639,
|
||||
[0xDA] = 0x063A,
|
||||
[0xE0] = 0x0640,
|
||||
[0xE1] = 0x0641,
|
||||
[0xE2] = 0x0642,
|
||||
[0xE3] = 0x0643,
|
||||
[0xE4] = 0x0644,
|
||||
[0xE5] = 0x0645,
|
||||
[0xE6] = 0x0646,
|
||||
[0xE7] = 0x0647,
|
||||
[0xE8] = 0x0648,
|
||||
[0xE9] = 0x0649,
|
||||
[0xEA] = 0x064A,
|
||||
[0xEB] = 0x064B,
|
||||
[0xEC] = 0x064C,
|
||||
[0xED] = 0x064D,
|
||||
[0xEE] = 0x064E,
|
||||
[0xEF] = 0x064F,
|
||||
[0xF0] = 0x0650,
|
||||
[0xF1] = 0x0651,
|
||||
[0xF2] = 0x0652,
|
||||
};
|
||||
static const char from_ucs4[] = {
|
||||
[0x0000] = 0x00,
|
||||
[0x0001] = 0x01,
|
||||
[0x0002] = 0x02,
|
||||
[0x0003] = 0x03,
|
||||
[0x0004] = 0x04,
|
||||
[0x0005] = 0x05,
|
||||
[0x0006] = 0x06,
|
||||
[0x0007] = 0x07,
|
||||
[0x0008] = 0x08,
|
||||
[0x0009] = 0x09,
|
||||
[0x000A] = 0x0A,
|
||||
[0x000B] = 0x0B,
|
||||
[0x000C] = 0x0C,
|
||||
[0x000D] = 0x0D,
|
||||
[0x000E] = 0x0E,
|
||||
[0x000F] = 0x0F,
|
||||
[0x0010] = 0x10,
|
||||
[0x0011] = 0x11,
|
||||
[0x0012] = 0x12,
|
||||
[0x0013] = 0x13,
|
||||
[0x0014] = 0x14,
|
||||
[0x0015] = 0x15,
|
||||
[0x0016] = 0x16,
|
||||
[0x0017] = 0x17,
|
||||
[0x0018] = 0x18,
|
||||
[0x0019] = 0x19,
|
||||
[0x001A] = 0x1A,
|
||||
[0x001B] = 0x1B,
|
||||
[0x001C] = 0x1C,
|
||||
[0x001D] = 0x1D,
|
||||
[0x001E] = 0x1E,
|
||||
[0x001F] = 0x1F,
|
||||
[0x0020] = 0x20,
|
||||
[0x0021] = 0x21,
|
||||
[0x0022] = 0x22,
|
||||
[0x0023] = 0x23,
|
||||
[0x0024] = 0x24,
|
||||
[0x0025] = 0x25,
|
||||
[0x0026] = 0x26,
|
||||
[0x0027] = 0x27,
|
||||
[0x0028] = 0x28,
|
||||
[0x0029] = 0x29,
|
||||
[0x002A] = 0x2A,
|
||||
[0x002B] = 0x2B,
|
||||
[0x002C] = 0x2C,
|
||||
[0x002D] = 0x2D,
|
||||
[0x002E] = 0x2E,
|
||||
[0x002F] = 0x2F,
|
||||
[0x0030] = 0x30,
|
||||
[0x0031] = 0x31,
|
||||
[0x0032] = 0x32,
|
||||
[0x0033] = 0x33,
|
||||
[0x0034] = 0x34,
|
||||
[0x0035] = 0x35,
|
||||
[0x0036] = 0x36,
|
||||
[0x0037] = 0x37,
|
||||
[0x0038] = 0x38,
|
||||
[0x0039] = 0x39,
|
||||
[0x003A] = 0x3A,
|
||||
[0x003B] = 0x3B,
|
||||
[0x003C] = 0x3C,
|
||||
[0x003D] = 0x3D,
|
||||
[0x003E] = 0x3E,
|
||||
[0x003F] = 0x3F,
|
||||
[0x0040] = 0x40,
|
||||
[0x0041] = 0x41,
|
||||
[0x0042] = 0x42,
|
||||
[0x0043] = 0x43,
|
||||
[0x0044] = 0x44,
|
||||
[0x0045] = 0x45,
|
||||
[0x0046] = 0x46,
|
||||
[0x0047] = 0x47,
|
||||
[0x0048] = 0x48,
|
||||
[0x0049] = 0x49,
|
||||
[0x004A] = 0x4A,
|
||||
[0x004B] = 0x4B,
|
||||
[0x004C] = 0x4C,
|
||||
[0x004D] = 0x4D,
|
||||
[0x004E] = 0x4E,
|
||||
[0x004F] = 0x4F,
|
||||
[0x0050] = 0x50,
|
||||
[0x0051] = 0x51,
|
||||
[0x0052] = 0x52,
|
||||
[0x0053] = 0x53,
|
||||
[0x0054] = 0x54,
|
||||
[0x0055] = 0x55,
|
||||
[0x0056] = 0x56,
|
||||
[0x0057] = 0x57,
|
||||
[0x0058] = 0x58,
|
||||
[0x0059] = 0x59,
|
||||
[0x005A] = 0x5A,
|
||||
[0x005B] = 0x5B,
|
||||
[0x005C] = 0x5C,
|
||||
[0x005D] = 0x5D,
|
||||
[0x005E] = 0x5E,
|
||||
[0x005F] = 0x5F,
|
||||
[0x0060] = 0x60,
|
||||
[0x0061] = 0x61,
|
||||
[0x0062] = 0x62,
|
||||
[0x0063] = 0x63,
|
||||
[0x0064] = 0x64,
|
||||
[0x0065] = 0x65,
|
||||
[0x0066] = 0x66,
|
||||
[0x0067] = 0x67,
|
||||
[0x0068] = 0x68,
|
||||
[0x0069] = 0x69,
|
||||
[0x006A] = 0x6A,
|
||||
[0x006B] = 0x6B,
|
||||
[0x006C] = 0x6C,
|
||||
[0x006D] = 0x6D,
|
||||
[0x006E] = 0x6E,
|
||||
[0x006F] = 0x6F,
|
||||
[0x0070] = 0x70,
|
||||
[0x0071] = 0x71,
|
||||
[0x0072] = 0x72,
|
||||
[0x0073] = 0x73,
|
||||
[0x0074] = 0x74,
|
||||
[0x0075] = 0x75,
|
||||
[0x0076] = 0x76,
|
||||
[0x0077] = 0x77,
|
||||
[0x0078] = 0x78,
|
||||
[0x0079] = 0x79,
|
||||
[0x007A] = 0x7A,
|
||||
[0x007B] = 0x7B,
|
||||
[0x007C] = 0x7C,
|
||||
[0x007D] = 0x7D,
|
||||
[0x007E] = 0x7E,
|
||||
[0x007F] = 0x7F,
|
||||
[0x0080] = 0x80,
|
||||
[0x0081] = 0x81,
|
||||
[0x0082] = 0x82,
|
||||
[0x0083] = 0x83,
|
||||
[0x0084] = 0x84,
|
||||
[0x0085] = 0x85,
|
||||
[0x0086] = 0x86,
|
||||
[0x0087] = 0x87,
|
||||
[0x0088] = 0x88,
|
||||
[0x0089] = 0x89,
|
||||
[0x008A] = 0x8A,
|
||||
[0x008B] = 0x8B,
|
||||
[0x008C] = 0x8C,
|
||||
[0x008D] = 0x8D,
|
||||
[0x008E] = 0x8E,
|
||||
[0x008F] = 0x8F,
|
||||
[0x0090] = 0x90,
|
||||
[0x0091] = 0x91,
|
||||
[0x0092] = 0x92,
|
||||
[0x0093] = 0x93,
|
||||
[0x0094] = 0x94,
|
||||
[0x0095] = 0x95,
|
||||
[0x0096] = 0x96,
|
||||
[0x0097] = 0x97,
|
||||
[0x0098] = 0x98,
|
||||
[0x0099] = 0x99,
|
||||
[0x009A] = 0x9A,
|
||||
[0x009B] = 0x9B,
|
||||
[0x009C] = 0x9C,
|
||||
[0x009D] = 0x9D,
|
||||
[0x009E] = 0x9E,
|
||||
[0x009F] = 0x9F,
|
||||
[0x00A0] = 0xA0,
|
||||
[0x00A4] = 0xA4,
|
||||
[0x00AD] = 0xAD,
|
||||
[0x060C] = 0xAC,
|
||||
[0x061B] = 0xBB,
|
||||
[0x061F] = 0xBF,
|
||||
[0x0621] = 0xC1,
|
||||
[0x0622] = 0xC2,
|
||||
[0x0623] = 0xC3,
|
||||
[0x0624] = 0xC4,
|
||||
[0x0625] = 0xC5,
|
||||
[0x0626] = 0xC6,
|
||||
[0x0627] = 0xC7,
|
||||
[0x0628] = 0xC8,
|
||||
[0x0629] = 0xC9,
|
||||
[0x062A] = 0xCA,
|
||||
[0x062B] = 0xCB,
|
||||
[0x062C] = 0xCC,
|
||||
[0x062D] = 0xCD,
|
||||
[0x062E] = 0xCE,
|
||||
[0x062F] = 0xCF,
|
||||
[0x0630] = 0xD0,
|
||||
[0x0631] = 0xD1,
|
||||
[0x0632] = 0xD2,
|
||||
[0x0633] = 0xD3,
|
||||
[0x0634] = 0xD4,
|
||||
[0x0635] = 0xD5,
|
||||
[0x0636] = 0xD6,
|
||||
[0x0637] = 0xD7,
|
||||
[0x0638] = 0xD8,
|
||||
[0x0639] = 0xD9,
|
||||
[0x063A] = 0xDA,
|
||||
[0x0640] = 0xE0,
|
||||
[0x0641] = 0xE1,
|
||||
[0x0642] = 0xE2,
|
||||
[0x0643] = 0xE3,
|
||||
[0x0644] = 0xE4,
|
||||
[0x0645] = 0xE5,
|
||||
[0x0646] = 0xE6,
|
||||
[0x0647] = 0xE7,
|
||||
[0x0648] = 0xE8,
|
||||
[0x0649] = 0xE9,
|
||||
[0x064A] = 0xEA,
|
||||
[0x064B] = 0xEB,
|
||||
[0x064C] = 0xEC,
|
||||
[0x064D] = 0xED,
|
||||
[0x064E] = 0xEE,
|
||||
[0x064F] = 0xEF,
|
||||
[0x0650] = 0xF0,
|
||||
[0x0651] = 0xF1,
|
||||
[0x0652] = 0xF2,
|
||||
};
|
@ -21,4 +21,4 @@
|
||||
#include <wchar.h>
|
||||
#include <iso8859-7.h>
|
||||
#define NAME "ISO-8859-7"
|
||||
#include <iso8859-generic.c>
|
||||
#include <8bit-generic.c>
|
||||
|
@ -1,504 +0,0 @@
|
||||
static const wchar_t to_ucs4[256] = {
|
||||
[0x00] = 0x0000,
|
||||
[0x01] = 0x0001,
|
||||
[0x02] = 0x0002,
|
||||
[0x03] = 0x0003,
|
||||
[0x04] = 0x0004,
|
||||
[0x05] = 0x0005,
|
||||
[0x06] = 0x0006,
|
||||
[0x07] = 0x0007,
|
||||
[0x08] = 0x0008,
|
||||
[0x09] = 0x0009,
|
||||
[0x0A] = 0x000A,
|
||||
[0x0B] = 0x000B,
|
||||
[0x0C] = 0x000C,
|
||||
[0x0D] = 0x000D,
|
||||
[0x0E] = 0x000E,
|
||||
[0x0F] = 0x000F,
|
||||
[0x10] = 0x0010,
|
||||
[0x11] = 0x0011,
|
||||
[0x12] = 0x0012,
|
||||
[0x13] = 0x0013,
|
||||
[0x14] = 0x0014,
|
||||
[0x15] = 0x0015,
|
||||
[0x16] = 0x0016,
|
||||
[0x17] = 0x0017,
|
||||
[0x18] = 0x0018,
|
||||
[0x19] = 0x0019,
|
||||
[0x1A] = 0x001A,
|
||||
[0x1B] = 0x001B,
|
||||
[0x1C] = 0x001C,
|
||||
[0x1D] = 0x001D,
|
||||
[0x1E] = 0x001E,
|
||||
[0x1F] = 0x001F,
|
||||
[0x20] = 0x0020,
|
||||
[0x21] = 0x0021,
|
||||
[0x22] = 0x0022,
|
||||
[0x23] = 0x0023,
|
||||
[0x24] = 0x0024,
|
||||
[0x25] = 0x0025,
|
||||
[0x26] = 0x0026,
|
||||
[0x27] = 0x0027,
|
||||
[0x28] = 0x0028,
|
||||
[0x29] = 0x0029,
|
||||
[0x2A] = 0x002A,
|
||||
[0x2B] = 0x002B,
|
||||
[0x2C] = 0x002C,
|
||||
[0x2D] = 0x002D,
|
||||
[0x2E] = 0x002E,
|
||||
[0x2F] = 0x002F,
|
||||
[0x30] = 0x0030,
|
||||
[0x31] = 0x0031,
|
||||
[0x32] = 0x0032,
|
||||
[0x33] = 0x0033,
|
||||
[0x34] = 0x0034,
|
||||
[0x35] = 0x0035,
|
||||
[0x36] = 0x0036,
|
||||
[0x37] = 0x0037,
|
||||
[0x38] = 0x0038,
|
||||
[0x39] = 0x0039,
|
||||
[0x3A] = 0x003A,
|
||||
[0x3B] = 0x003B,
|
||||
[0x3C] = 0x003C,
|
||||
[0x3D] = 0x003D,
|
||||
[0x3E] = 0x003E,
|
||||
[0x3F] = 0x003F,
|
||||
[0x40] = 0x0040,
|
||||
[0x41] = 0x0041,
|
||||
[0x42] = 0x0042,
|
||||
[0x43] = 0x0043,
|
||||
[0x44] = 0x0044,
|
||||
[0x45] = 0x0045,
|
||||
[0x46] = 0x0046,
|
||||
[0x47] = 0x0047,
|
||||
[0x48] = 0x0048,
|
||||
[0x49] = 0x0049,
|
||||
[0x4A] = 0x004A,
|
||||
[0x4B] = 0x004B,
|
||||
[0x4C] = 0x004C,
|
||||
[0x4D] = 0x004D,
|
||||
[0x4E] = 0x004E,
|
||||
[0x4F] = 0x004F,
|
||||
[0x50] = 0x0050,
|
||||
[0x51] = 0x0051,
|
||||
[0x52] = 0x0052,
|
||||
[0x53] = 0x0053,
|
||||
[0x54] = 0x0054,
|
||||
[0x55] = 0x0055,
|
||||
[0x56] = 0x0056,
|
||||
[0x57] = 0x0057,
|
||||
[0x58] = 0x0058,
|
||||
[0x59] = 0x0059,
|
||||
[0x5A] = 0x005A,
|
||||
[0x5B] = 0x005B,
|
||||
[0x5C] = 0x005C,
|
||||
[0x5D] = 0x005D,
|
||||
[0x5E] = 0x005E,
|
||||
[0x5F] = 0x005F,
|
||||
[0x60] = 0x0060,
|
||||
[0x61] = 0x0061,
|
||||
[0x62] = 0x0062,
|
||||
[0x63] = 0x0063,
|
||||
[0x64] = 0x0064,
|
||||
[0x65] = 0x0065,
|
||||
[0x66] = 0x0066,
|
||||
[0x67] = 0x0067,
|
||||
[0x68] = 0x0068,
|
||||
[0x69] = 0x0069,
|
||||
[0x6A] = 0x006A,
|
||||
[0x6B] = 0x006B,
|
||||
[0x6C] = 0x006C,
|
||||
[0x6D] = 0x006D,
|
||||
[0x6E] = 0x006E,
|
||||
[0x6F] = 0x006F,
|
||||
[0x70] = 0x0070,
|
||||
[0x71] = 0x0071,
|
||||
[0x72] = 0x0072,
|
||||
[0x73] = 0x0073,
|
||||
[0x74] = 0x0074,
|
||||
[0x75] = 0x0075,
|
||||
[0x76] = 0x0076,
|
||||
[0x77] = 0x0077,
|
||||
[0x78] = 0x0078,
|
||||
[0x79] = 0x0079,
|
||||
[0x7A] = 0x007A,
|
||||
[0x7B] = 0x007B,
|
||||
[0x7C] = 0x007C,
|
||||
[0x7D] = 0x007D,
|
||||
[0x7E] = 0x007E,
|
||||
[0x7F] = 0x007F,
|
||||
[0x80] = 0x0080,
|
||||
[0x81] = 0x0081,
|
||||
[0x82] = 0x0082,
|
||||
[0x83] = 0x0083,
|
||||
[0x84] = 0x0084,
|
||||
[0x85] = 0x0085,
|
||||
[0x86] = 0x0086,
|
||||
[0x87] = 0x0087,
|
||||
[0x88] = 0x0088,
|
||||
[0x89] = 0x0089,
|
||||
[0x8A] = 0x008A,
|
||||
[0x8B] = 0x008B,
|
||||
[0x8C] = 0x008C,
|
||||
[0x8D] = 0x008D,
|
||||
[0x8E] = 0x008E,
|
||||
[0x8F] = 0x008F,
|
||||
[0x90] = 0x0090,
|
||||
[0x91] = 0x0091,
|
||||
[0x92] = 0x0092,
|
||||
[0x93] = 0x0093,
|
||||
[0x94] = 0x0094,
|
||||
[0x95] = 0x0095,
|
||||
[0x96] = 0x0096,
|
||||
[0x97] = 0x0097,
|
||||
[0x98] = 0x0098,
|
||||
[0x99] = 0x0099,
|
||||
[0x9A] = 0x009A,
|
||||
[0x9B] = 0x009B,
|
||||
[0x9C] = 0x009C,
|
||||
[0x9D] = 0x009D,
|
||||
[0x9E] = 0x009E,
|
||||
[0x9F] = 0x009F,
|
||||
[0xA0] = 0x00A0,
|
||||
[0xA1] = 0x201B,
|
||||
[0xA2] = 0x2019,
|
||||
[0xA3] = 0x00A3,
|
||||
[0xA6] = 0x00A6,
|
||||
[0xA7] = 0x00A7,
|
||||
[0xA8] = 0x00A8,
|
||||
[0xA9] = 0x00A9,
|
||||
[0xAB] = 0x00AB,
|
||||
[0xAC] = 0x00AC,
|
||||
[0xAD] = 0x00AD,
|
||||
[0xAF] = 0x2014,
|
||||
[0xB0] = 0x00B0,
|
||||
[0xB1] = 0x00B1,
|
||||
[0xB2] = 0x00B2,
|
||||
[0xB3] = 0x00B3,
|
||||
[0xB4] = 0x00B4,
|
||||
[0xB5] = 0x0385,
|
||||
[0xB6] = 0x0386,
|
||||
[0xB7] = 0x00B7,
|
||||
[0xB8] = 0x0388,
|
||||
[0xB9] = 0x0389,
|
||||
[0xBA] = 0x038A,
|
||||
[0xBB] = 0x00BB,
|
||||
[0xBC] = 0x038C,
|
||||
[0xBD] = 0x00BD,
|
||||
[0xBE] = 0x038E,
|
||||
[0xBF] = 0x038F,
|
||||
[0xC0] = 0x0390,
|
||||
[0xC1] = 0x0391,
|
||||
[0xC2] = 0x0392,
|
||||
[0xC3] = 0x0393,
|
||||
[0xC4] = 0x0394,
|
||||
[0xC5] = 0x0395,
|
||||
[0xC6] = 0x0396,
|
||||
[0xC7] = 0x0397,
|
||||
[0xC8] = 0x0398,
|
||||
[0xC9] = 0x0399,
|
||||
[0xCA] = 0x039A,
|
||||
[0xCB] = 0x039B,
|
||||
[0xCC] = 0x039C,
|
||||
[0xCD] = 0x039D,
|
||||
[0xCE] = 0x039E,
|
||||
[0xCF] = 0x039F,
|
||||
[0xD0] = 0x03A0,
|
||||
[0xD1] = 0x03A1,
|
||||
[0xD3] = 0x03A3,
|
||||
[0xD4] = 0x03A4,
|
||||
[0xD5] = 0x03A5,
|
||||
[0xD6] = 0x03A6,
|
||||
[0xD7] = 0x03A7,
|
||||
[0xD8] = 0x03A8,
|
||||
[0xD9] = 0x03A9,
|
||||
[0xDA] = 0x03AA,
|
||||
[0xDB] = 0x03AB,
|
||||
[0xDC] = 0x03AC,
|
||||
[0xDD] = 0x03AD,
|
||||
[0xDE] = 0x03AE,
|
||||
[0xDF] = 0x03AF,
|
||||
[0xE0] = 0x03B0,
|
||||
[0xE1] = 0x03B1,
|
||||
[0xE2] = 0x03B2,
|
||||
[0xE3] = 0x03B3,
|
||||
[0xE4] = 0x03B4,
|
||||
[0xE5] = 0x03B5,
|
||||
[0xE6] = 0x03B6,
|
||||
[0xE7] = 0x03B7,
|
||||
[0xE8] = 0x03B8,
|
||||
[0xE9] = 0x03B9,
|
||||
[0xEA] = 0x03BA,
|
||||
[0xEB] = 0x03BB,
|
||||
[0xEC] = 0x03BC,
|
||||
[0xED] = 0x03BD,
|
||||
[0xEE] = 0x03BE,
|
||||
[0xEF] = 0x03BF,
|
||||
[0xF0] = 0x03C0,
|
||||
[0xF1] = 0x03C1,
|
||||
[0xF2] = 0x03C2,
|
||||
[0xF3] = 0x03C3,
|
||||
[0xF4] = 0x03C4,
|
||||
[0xF5] = 0x03C5,
|
||||
[0xF6] = 0x03C6,
|
||||
[0xF7] = 0x03C7,
|
||||
[0xF8] = 0x03C8,
|
||||
[0xF9] = 0x03C9,
|
||||
[0xFA] = 0x03CA,
|
||||
[0xFB] = 0x03CB,
|
||||
[0xFC] = 0x03CC,
|
||||
[0xFD] = 0x03CD,
|
||||
[0xFE] = 0x03CE,
|
||||
};
|
||||
static const char from_ucs4[] = {
|
||||
[0x0000] = 0x00,
|
||||
[0x0001] = 0x01,
|
||||
[0x0002] = 0x02,
|
||||
[0x0003] = 0x03,
|
||||
[0x0004] = 0x04,
|
||||
[0x0005] = 0x05,
|
||||
[0x0006] = 0x06,
|
||||
[0x0007] = 0x07,
|
||||
[0x0008] = 0x08,
|
||||
[0x0009] = 0x09,
|
||||
[0x000A] = 0x0A,
|
||||
[0x000B] = 0x0B,
|
||||
[0x000C] = 0x0C,
|
||||
[0x000D] = 0x0D,
|
||||
[0x000E] = 0x0E,
|
||||
[0x000F] = 0x0F,
|
||||
[0x0010] = 0x10,
|
||||
[0x0011] = 0x11,
|
||||
[0x0012] = 0x12,
|
||||
[0x0013] = 0x13,
|
||||
[0x0014] = 0x14,
|
||||
[0x0015] = 0x15,
|
||||
[0x0016] = 0x16,
|
||||
[0x0017] = 0x17,
|
||||
[0x0018] = 0x18,
|
||||
[0x0019] = 0x19,
|
||||
[0x001A] = 0x1A,
|
||||
[0x001B] = 0x1B,
|
||||
[0x001C] = 0x1C,
|
||||
[0x001D] = 0x1D,
|
||||
[0x001E] = 0x1E,
|
||||
[0x001F] = 0x1F,
|
||||
[0x0020] = 0x20,
|
||||
[0x0021] = 0x21,
|
||||
[0x0022] = 0x22,
|
||||
[0x0023] = 0x23,
|
||||
[0x0024] = 0x24,
|
||||
[0x0025] = 0x25,
|
||||
[0x0026] = 0x26,
|
||||
[0x0027] = 0x27,
|
||||
[0x0028] = 0x28,
|
||||
[0x0029] = 0x29,
|
||||
[0x002A] = 0x2A,
|
||||
[0x002B] = 0x2B,
|
||||
[0x002C] = 0x2C,
|
||||
[0x002D] = 0x2D,
|
||||
[0x002E] = 0x2E,
|
||||
[0x002F] = 0x2F,
|
||||
[0x0030] = 0x30,
|
||||
[0x0031] = 0x31,
|
||||
[0x0032] = 0x32,
|
||||
[0x0033] = 0x33,
|
||||
[0x0034] = 0x34,
|
||||
[0x0035] = 0x35,
|
||||
[0x0036] = 0x36,
|
||||
[0x0037] = 0x37,
|
||||
[0x0038] = 0x38,
|
||||
[0x0039] = 0x39,
|
||||
[0x003A] = 0x3A,
|
||||
[0x003B] = 0x3B,
|
||||
[0x003C] = 0x3C,
|
||||
[0x003D] = 0x3D,
|
||||
[0x003E] = 0x3E,
|
||||
[0x003F] = 0x3F,
|
||||
[0x0040] = 0x40,
|
||||
[0x0041] = 0x41,
|
||||
[0x0042] = 0x42,
|
||||
[0x0043] = 0x43,
|
||||
[0x0044] = 0x44,
|
||||
[0x0045] = 0x45,
|
||||
[0x0046] = 0x46,
|
||||
[0x0047] = 0x47,
|
||||
[0x0048] = 0x48,
|
||||
[0x0049] = 0x49,
|
||||
[0x004A] = 0x4A,
|
||||
[0x004B] = 0x4B,
|
||||
[0x004C] = 0x4C,
|
||||
[0x004D] = 0x4D,
|
||||
[0x004E] = 0x4E,
|
||||
[0x004F] = 0x4F,
|
||||
[0x0050] = 0x50,
|
||||
[0x0051] = 0x51,
|
||||
[0x0052] = 0x52,
|
||||
[0x0053] = 0x53,
|
||||
[0x0054] = 0x54,
|
||||
[0x0055] = 0x55,
|
||||
[0x0056] = 0x56,
|
||||
[0x0057] = 0x57,
|
||||
[0x0058] = 0x58,
|
||||
[0x0059] = 0x59,
|
||||
[0x005A] = 0x5A,
|
||||
[0x005B] = 0x5B,
|
||||
[0x005C] = 0x5C,
|
||||
[0x005D] = 0x5D,
|
||||
[0x005E] = 0x5E,
|
||||
[0x005F] = 0x5F,
|
||||
[0x0060] = 0x60,
|
||||
[0x0061] = 0x61,
|
||||
[0x0062] = 0x62,
|
||||
[0x0063] = 0x63,
|
||||
[0x0064] = 0x64,
|
||||
[0x0065] = 0x65,
|
||||
[0x0066] = 0x66,
|
||||
[0x0067] = 0x67,
|
||||
[0x0068] = 0x68,
|
||||
[0x0069] = 0x69,
|
||||
[0x006A] = 0x6A,
|
||||
[0x006B] = 0x6B,
|
||||
[0x006C] = 0x6C,
|
||||
[0x006D] = 0x6D,
|
||||
[0x006E] = 0x6E,
|
||||
[0x006F] = 0x6F,
|
||||
[0x0070] = 0x70,
|
||||
[0x0071] = 0x71,
|
||||
[0x0072] = 0x72,
|
||||
[0x0073] = 0x73,
|
||||
[0x0074] = 0x74,
|
||||
[0x0075] = 0x75,
|
||||
[0x0076] = 0x76,
|
||||
[0x0077] = 0x77,
|
||||
[0x0078] = 0x78,
|
||||
[0x0079] = 0x79,
|
||||
[0x007A] = 0x7A,
|
||||
[0x007B] = 0x7B,
|
||||
[0x007C] = 0x7C,
|
||||
[0x007D] = 0x7D,
|
||||
[0x007E] = 0x7E,
|
||||
[0x007F] = 0x7F,
|
||||
[0x0080] = 0x80,
|
||||
[0x0081] = 0x81,
|
||||
[0x0082] = 0x82,
|
||||
[0x0083] = 0x83,
|
||||
[0x0084] = 0x84,
|
||||
[0x0085] = 0x85,
|
||||
[0x0086] = 0x86,
|
||||
[0x0087] = 0x87,
|
||||
[0x0088] = 0x88,
|
||||
[0x0089] = 0x89,
|
||||
[0x008A] = 0x8A,
|
||||
[0x008B] = 0x8B,
|
||||
[0x008C] = 0x8C,
|
||||
[0x008D] = 0x8D,
|
||||
[0x008E] = 0x8E,
|
||||
[0x008F] = 0x8F,
|
||||
[0x0090] = 0x90,
|
||||
[0x0091] = 0x91,
|
||||
[0x0092] = 0x92,
|
||||
[0x0093] = 0x93,
|
||||
[0x0094] = 0x94,
|
||||
[0x0095] = 0x95,
|
||||
[0x0096] = 0x96,
|
||||
[0x0097] = 0x97,
|
||||
[0x0098] = 0x98,
|
||||
[0x0099] = 0x99,
|
||||
[0x009A] = 0x9A,
|
||||
[0x009B] = 0x9B,
|
||||
[0x009C] = 0x9C,
|
||||
[0x009D] = 0x9D,
|
||||
[0x009E] = 0x9E,
|
||||
[0x009F] = 0x9F,
|
||||
[0x00A0] = 0xA0,
|
||||
[0x00A3] = 0xA3,
|
||||
[0x00A6] = 0xA6,
|
||||
[0x00A7] = 0xA7,
|
||||
[0x00A8] = 0xA8,
|
||||
[0x00A9] = 0xA9,
|
||||
[0x00AB] = 0xAB,
|
||||
[0x00AC] = 0xAC,
|
||||
[0x00AD] = 0xAD,
|
||||
[0x00B0] = 0xB0,
|
||||
[0x00B1] = 0xB1,
|
||||
[0x00B2] = 0xB2,
|
||||
[0x00B3] = 0xB3,
|
||||
[0x00B4] = 0xB4,
|
||||
[0x00B7] = 0xB7,
|
||||
[0x00BB] = 0xBB,
|
||||
[0x00BD] = 0xBD,
|
||||
[0x0385] = 0xB5,
|
||||
[0x0386] = 0xB6,
|
||||
[0x0388] = 0xB8,
|
||||
[0x0389] = 0xB9,
|
||||
[0x038A] = 0xBA,
|
||||
[0x038C] = 0xBC,
|
||||
[0x038E] = 0xBE,
|
||||
[0x038F] = 0xBF,
|
||||
[0x0390] = 0xC0,
|
||||
[0x0391] = 0xC1,
|
||||
[0x0392] = 0xC2,
|
||||
[0x0393] = 0xC3,
|
||||
[0x0394] = 0xC4,
|
||||
[0x0395] = 0xC5,
|
||||
[0x0396] = 0xC6,
|
||||
[0x0397] = 0xC7,
|
||||
[0x0398] = 0xC8,
|
||||
[0x0399] = 0xC9,
|
||||
[0x039A] = 0xCA,
|
||||
[0x039B] = 0xCB,
|
||||
[0x039C] = 0xCC,
|
||||
[0x039D] = 0xCD,
|
||||
[0x039E] = 0xCE,
|
||||
[0x039F] = 0xCF,
|
||||
[0x03A0] = 0xD0,
|
||||
[0x03A1] = 0xD1,
|
||||
[0x03A3] = 0xD3,
|
||||
[0x03A4] = 0xD4,
|
||||
[0x03A5] = 0xD5,
|
||||
[0x03A6] = 0xD6,
|
||||
[0x03A7] = 0xD7,
|
||||
[0x03A8] = 0xD8,
|
||||
[0x03A9] = 0xD9,
|
||||
[0x03AA] = 0xDA,
|
||||
[0x03AB] = 0xDB,
|
||||
[0x03AC] = 0xDC,
|
||||
[0x03AD] = 0xDD,
|
||||
[0x03AE] = 0xDE,
|
||||
[0x03AF] = 0xDF,
|
||||
[0x03B0] = 0xE0,
|
||||
[0x03B1] = 0xE1,
|
||||
[0x03B2] = 0xE2,
|
||||
[0x03B3] = 0xE3,
|
||||
[0x03B4] = 0xE4,
|
||||
[0x03B5] = 0xE5,
|
||||
[0x03B6] = 0xE6,
|
||||
[0x03B7] = 0xE7,
|
||||
[0x03B8] = 0xE8,
|
||||
[0x03B9] = 0xE9,
|
||||
[0x03BA] = 0xEA,
|
||||
[0x03BB] = 0xEB,
|
||||
[0x03BC] = 0xEC,
|
||||
[0x03BD] = 0xED,
|
||||
[0x03BE] = 0xEE,
|
||||
[0x03BF] = 0xEF,
|
||||
[0x03C0] = 0xF0,
|
||||
[0x03C1] = 0xF1,
|
||||
[0x03C2] = 0xF2,
|
||||
[0x03C3] = 0xF3,
|
||||
[0x03C4] = 0xF4,
|
||||
[0x03C5] = 0xF5,
|
||||
[0x03C6] = 0xF6,
|
||||
[0x03C7] = 0xF7,
|
||||
[0x03C8] = 0xF8,
|
||||
[0x03C9] = 0xF9,
|
||||
[0x03CA] = 0xFA,
|
||||
[0x03CB] = 0xFB,
|
||||
[0x03CC] = 0xFC,
|
||||
[0x03CD] = 0xFD,
|
||||
[0x03CE] = 0xFE,
|
||||
[0x2014] = 0xAF,
|
||||
[0x2019] = 0xA2,
|
||||
[0x201B] = 0xA1,
|
||||
};
|
@ -21,4 +21,4 @@
|
||||
#include <wchar.h>
|
||||
#include <iso8859-8.h>
|
||||
#define NAME "ISO-8859-8"
|
||||
#include <iso8859-generic.c>
|
||||
#include <8bit-generic.c>
|
||||
|
@ -1,440 +0,0 @@
|
||||
static const wchar_t to_ucs4[256] = {
|
||||
[0x00] = 0x0000,
|
||||
[0x01] = 0x0001,
|
||||
[0x02] = 0x0002,
|
||||
[0x03] = 0x0003,
|
||||
[0x04] = 0x0004,
|
||||
[0x05] = 0x0005,
|
||||
[0x06] = 0x0006,
|
||||
[0x07] = 0x0007,
|
||||
[0x08] = 0x0008,
|
||||
[0x09] = 0x0009,
|
||||
[0x0A] = 0x000A,
|
||||
[0x0B] = 0x000B,
|
||||
[0x0C] = 0x000C,
|
||||
[0x0D] = 0x000D,
|
||||
[0x0E] = 0x000E,
|
||||
[0x0F] = 0x000F,
|
||||
[0x10] = 0x0010,
|
||||
[0x11] = 0x0011,
|
||||
[0x12] = 0x0012,
|
||||
[0x13] = 0x0013,
|
||||
[0x14] = 0x0014,
|
||||
[0x15] = 0x0015,
|
||||
[0x16] = 0x0016,
|
||||
[0x17] = 0x0017,
|
||||
[0x18] = 0x0018,
|
||||
[0x19] = 0x0019,
|
||||
[0x1A] = 0x001A,
|
||||
[0x1B] = 0x001B,
|
||||
[0x1C] = 0x001C,
|
||||
[0x1D] = 0x001D,
|
||||
[0x1E] = 0x001E,
|
||||
[0x1F] = 0x001F,
|
||||
[0x20] = 0x0020,
|
||||
[0x21] = 0x0021,
|
||||
[0x22] = 0x0022,
|
||||
[0x23] = 0x0023,
|
||||
[0x24] = 0x0024,
|
||||
[0x25] = 0x0025,
|
||||
[0x26] = 0x0026,
|
||||
[0x27] = 0x0027,
|
||||
[0x28] = 0x0028,
|
||||
[0x29] = 0x0029,
|
||||
[0x2A] = 0x002A,
|
||||
[0x2B] = 0x002B,
|
||||
[0x2C] = 0x002C,
|
||||
[0x2D] = 0x002D,
|
||||
[0x2E] = 0x002E,
|
||||
[0x2F] = 0x002F,
|
||||
[0x30] = 0x0030,
|
||||
[0x31] = 0x0031,
|
||||
[0x32] = 0x0032,
|
||||
[0x33] = 0x0033,
|
||||
[0x34] = 0x0034,
|
||||
[0x35] = 0x0035,
|
||||
[0x36] = 0x0036,
|
||||
[0x37] = 0x0037,
|
||||
[0x38] = 0x0038,
|
||||
[0x39] = 0x0039,
|
||||
[0x3A] = 0x003A,
|
||||
[0x3B] = 0x003B,
|
||||
[0x3C] = 0x003C,
|
||||
[0x3D] = 0x003D,
|
||||
[0x3E] = 0x003E,
|
||||
[0x3F] = 0x003F,
|
||||
[0x40] = 0x0040,
|
||||
[0x41] = 0x0041,
|
||||
[0x42] = 0x0042,
|
||||
[0x43] = 0x0043,
|
||||
[0x44] = 0x0044,
|
||||
[0x45] = 0x0045,
|
||||
[0x46] = 0x0046,
|
||||
[0x47] = 0x0047,
|
||||
[0x48] = 0x0048,
|
||||
[0x49] = 0x0049,
|
||||
[0x4A] = 0x004A,
|
||||
[0x4B] = 0x004B,
|
||||
[0x4C] = 0x004C,
|
||||
[0x4D] = 0x004D,
|
||||
[0x4E] = 0x004E,
|
||||
[0x4F] = 0x004F,
|
||||
[0x50] = 0x0050,
|
||||
[0x51] = 0x0051,
|
||||
[0x52] = 0x0052,
|
||||
[0x53] = 0x0053,
|
||||
[0x54] = 0x0054,
|
||||
[0x55] = 0x0055,
|
||||
[0x56] = 0x0056,
|
||||
[0x57] = 0x0057,
|
||||
[0x58] = 0x0058,
|
||||
[0x59] = 0x0059,
|
||||
[0x5A] = 0x005A,
|
||||
[0x5B] = 0x005B,
|
||||
[0x5C] = 0x005C,
|
||||
[0x5D] = 0x005D,
|
||||
[0x5E] = 0x005E,
|
||||
[0x5F] = 0x005F,
|
||||
[0x60] = 0x0060,
|
||||
[0x61] = 0x0061,
|
||||
[0x62] = 0x0062,
|
||||
[0x63] = 0x0063,
|
||||
[0x64] = 0x0064,
|
||||
[0x65] = 0x0065,
|
||||
[0x66] = 0x0066,
|
||||
[0x67] = 0x0067,
|
||||
[0x68] = 0x0068,
|
||||
[0x69] = 0x0069,
|
||||
[0x6A] = 0x006A,
|
||||
[0x6B] = 0x006B,
|
||||
[0x6C] = 0x006C,
|
||||
[0x6D] = 0x006D,
|
||||
[0x6E] = 0x006E,
|
||||
[0x6F] = 0x006F,
|
||||
[0x70] = 0x0070,
|
||||
[0x71] = 0x0071,
|
||||
[0x72] = 0x0072,
|
||||
[0x73] = 0x0073,
|
||||
[0x74] = 0x0074,
|
||||
[0x75] = 0x0075,
|
||||
[0x76] = 0x0076,
|
||||
[0x77] = 0x0077,
|
||||
[0x78] = 0x0078,
|
||||
[0x79] = 0x0079,
|
||||
[0x7A] = 0x007A,
|
||||
[0x7B] = 0x007B,
|
||||
[0x7C] = 0x007C,
|
||||
[0x7D] = 0x007D,
|
||||
[0x7E] = 0x007E,
|
||||
[0x7F] = 0x007F,
|
||||
[0x80] = 0x0080,
|
||||
[0x81] = 0x0081,
|
||||
[0x82] = 0x0082,
|
||||
[0x83] = 0x0083,
|
||||
[0x84] = 0x0084,
|
||||
[0x85] = 0x0085,
|
||||
[0x86] = 0x0086,
|
||||
[0x87] = 0x0087,
|
||||
[0x88] = 0x0088,
|
||||
[0x89] = 0x0089,
|
||||
[0x8A] = 0x008A,
|
||||
[0x8B] = 0x008B,
|
||||
[0x8C] = 0x008C,
|
||||
[0x8D] = 0x008D,
|
||||
[0x8E] = 0x008E,
|
||||
[0x8F] = 0x008F,
|
||||
[0x90] = 0x0090,
|
||||
[0x91] = 0x0091,
|
||||
[0x92] = 0x0092,
|
||||
[0x93] = 0x0093,
|
||||
[0x94] = 0x0094,
|
||||
[0x95] = 0x0095,
|
||||
[0x96] = 0x0096,
|
||||
[0x97] = 0x0097,
|
||||
[0x98] = 0x0098,
|
||||
[0x99] = 0x0099,
|
||||
[0x9A] = 0x009A,
|
||||
[0x9B] = 0x009B,
|
||||
[0x9C] = 0x009C,
|
||||
[0x9D] = 0x009D,
|
||||
[0x9E] = 0x009E,
|
||||
[0x9F] = 0x009F,
|
||||
[0xA0] = 0x00A0,
|
||||
[0xA2] = 0x00A2,
|
||||
[0xA3] = 0x00A3,
|
||||
[0xA4] = 0x00A4,
|
||||
[0xA5] = 0x00A5,
|
||||
[0xA6] = 0x00A6,
|
||||
[0xA7] = 0x00A7,
|
||||
[0xA8] = 0x00A8,
|
||||
[0xA9] = 0x00A9,
|
||||
[0xAA] = 0x00D7,
|
||||
[0xAB] = 0x00AB,
|
||||
[0xAC] = 0x00AC,
|
||||
[0xAD] = 0x00AD,
|
||||
[0xAE] = 0x00AE,
|
||||
[0xAF] = 0x203E,
|
||||
[0xB0] = 0x00B0,
|
||||
[0xB1] = 0x00B1,
|
||||
[0xB2] = 0x00B2,
|
||||
[0xB3] = 0x00B3,
|
||||
[0xB4] = 0x00B4,
|
||||
[0xB5] = 0x00B5,
|
||||
[0xB6] = 0x00B6,
|
||||
[0xB7] = 0x00B7,
|
||||
[0xB8] = 0x00B8,
|
||||
[0xB9] = 0x00B9,
|
||||
[0xBA] = 0x00F7,
|
||||
[0xBB] = 0x00BB,
|
||||
[0xBC] = 0x00BC,
|
||||
[0xBD] = 0x00BD,
|
||||
[0xBE] = 0x00BE,
|
||||
[0xDF] = 0x2017,
|
||||
[0xE0] = 0x05D0,
|
||||
[0xE1] = 0x05D1,
|
||||
[0xE2] = 0x05D2,
|
||||
[0xE3] = 0x05D3,
|
||||
[0xE4] = 0x05D4,
|
||||
[0xE5] = 0x05D5,
|
||||
[0xE6] = 0x05D6,
|
||||
[0xE7] = 0x05D7,
|
||||
[0xE8] = 0x05D8,
|
||||
[0xE9] = 0x05D9,
|
||||
[0xEA] = 0x05DA,
|
||||
[0xEB] = 0x05DB,
|
||||
[0xEC] = 0x05DC,
|
||||
[0xED] = 0x05DD,
|
||||
[0xEE] = 0x05DE,
|
||||
[0xEF] = 0x05DF,
|
||||
[0xF0] = 0x05E0,
|
||||
[0xF1] = 0x05E1,
|
||||
[0xF2] = 0x05E2,
|
||||
[0xF3] = 0x05E3,
|
||||
[0xF4] = 0x05E4,
|
||||
[0xF5] = 0x05E5,
|
||||
[0xF6] = 0x05E6,
|
||||
[0xF7] = 0x05E7,
|
||||
[0xF8] = 0x05E8,
|
||||
[0xF9] = 0x05E9,
|
||||
[0xFA] = 0x05EA,
|
||||
};
|
||||
static const char from_ucs4[] = {
|
||||
[0x0000] = 0x00,
|
||||
[0x0001] = 0x01,
|
||||
[0x0002] = 0x02,
|
||||
[0x0003] = 0x03,
|
||||
[0x0004] = 0x04,
|
||||
[0x0005] = 0x05,
|
||||
[0x0006] = 0x06,
|
||||
[0x0007] = 0x07,
|
||||
[0x0008] = 0x08,
|
||||
[0x0009] = 0x09,
|
||||
[0x000A] = 0x0A,
|
||||
[0x000B] = 0x0B,
|
||||
[0x000C] = 0x0C,
|
||||
[0x000D] = 0x0D,
|
||||
[0x000E] = 0x0E,
|
||||
[0x000F] = 0x0F,
|
||||
[0x0010] = 0x10,
|
||||
[0x0011] = 0x11,
|
||||
[0x0012] = 0x12,
|
||||
[0x0013] = 0x13,
|
||||
[0x0014] = 0x14,
|
||||
[0x0015] = 0x15,
|
||||
[0x0016] = 0x16,
|
||||
[0x0017] = 0x17,
|
||||
[0x0018] = 0x18,
|
||||
[0x0019] = 0x19,
|
||||
[0x001A] = 0x1A,
|
||||
[0x001B] = 0x1B,
|
||||
[0x001C] = 0x1C,
|
||||
[0x001D] = 0x1D,
|
||||
[0x001E] = 0x1E,
|
||||
[0x001F] = 0x1F,
|
||||
[0x0020] = 0x20,
|
||||
[0x0021] = 0x21,
|
||||
[0x0022] = 0x22,
|
||||
[0x0023] = 0x23,
|
||||
[0x0024] = 0x24,
|
||||
[0x0025] = 0x25,
|
||||
[0x0026] = 0x26,
|
||||
[0x0027] = 0x27,
|
||||
[0x0028] = 0x28,
|
||||
[0x0029] = 0x29,
|
||||
[0x002A] = 0x2A,
|
||||
[0x002B] = 0x2B,
|
||||
[0x002C] = 0x2C,
|
||||
[0x002D] = 0x2D,
|
||||
[0x002E] = 0x2E,
|
||||
[0x002F] = 0x2F,
|
||||
[0x0030] = 0x30,
|
||||
[0x0031] = 0x31,
|
||||
[0x0032] = 0x32,
|
||||
[0x0033] = 0x33,
|
||||
[0x0034] = 0x34,
|
||||
[0x0035] = 0x35,
|
||||
[0x0036] = 0x36,
|
||||
[0x0037] = 0x37,
|
||||
[0x0038] = 0x38,
|
||||
[0x0039] = 0x39,
|
||||
[0x003A] = 0x3A,
|
||||
[0x003B] = 0x3B,
|
||||
[0x003C] = 0x3C,
|
||||
[0x003D] = 0x3D,
|
||||
[0x003E] = 0x3E,
|
||||
[0x003F] = 0x3F,
|
||||
[0x0040] = 0x40,
|
||||
[0x0041] = 0x41,
|
||||
[0x0042] = 0x42,
|
||||
[0x0043] = 0x43,
|
||||
[0x0044] = 0x44,
|
||||
[0x0045] = 0x45,
|
||||
[0x0046] = 0x46,
|
||||
[0x0047] = 0x47,
|
||||
[0x0048] = 0x48,
|
||||
[0x0049] = 0x49,
|
||||
[0x004A] = 0x4A,
|
||||
[0x004B] = 0x4B,
|
||||
[0x004C] = 0x4C,
|
||||
[0x004D] = 0x4D,
|
||||
[0x004E] = 0x4E,
|
||||
[0x004F] = 0x4F,
|
||||
[0x0050] = 0x50,
|
||||
[0x0051] = 0x51,
|
||||
[0x0052] = 0x52,
|
||||
[0x0053] = 0x53,
|
||||
[0x0054] = 0x54,
|
||||
[0x0055] = 0x55,
|
||||
[0x0056] = 0x56,
|
||||
[0x0057] = 0x57,
|
||||
[0x0058] = 0x58,
|
||||
[0x0059] = 0x59,
|
||||
[0x005A] = 0x5A,
|
||||
[0x005B] = 0x5B,
|
||||
[0x005C] = 0x5C,
|
||||
[0x005D] = 0x5D,
|
||||
[0x005E] = 0x5E,
|
||||
[0x005F] = 0x5F,
|
||||
[0x0060] = 0x60,
|
||||
[0x0061] = 0x61,
|
||||
[0x0062] = 0x62,
|
||||
[0x0063] = 0x63,
|
||||
[0x0064] = 0x64,
|
||||
[0x0065] = 0x65,
|
||||
[0x0066] = 0x66,
|
||||
[0x0067] = 0x67,
|
||||
[0x0068] = 0x68,
|
||||
[0x0069] = 0x69,
|
||||
[0x006A] = 0x6A,
|
||||
[0x006B] = 0x6B,
|
||||
[0x006C] = 0x6C,
|
||||
[0x006D] = 0x6D,
|
||||
[0x006E] = 0x6E,
|
||||
[0x006F] = 0x6F,
|
||||
[0x0070] = 0x70,
|
||||
[0x0071] = 0x71,
|
||||
[0x0072] = 0x72,
|
||||
[0x0073] = 0x73,
|
||||
[0x0074] = 0x74,
|
||||
[0x0075] = 0x75,
|
||||
[0x0076] = 0x76,
|
||||
[0x0077] = 0x77,
|
||||
[0x0078] = 0x78,
|
||||
[0x0079] = 0x79,
|
||||
[0x007A] = 0x7A,
|
||||
[0x007B] = 0x7B,
|
||||
[0x007C] = 0x7C,
|
||||
[0x007D] = 0x7D,
|
||||
[0x007E] = 0x7E,
|
||||
[0x007F] = 0x7F,
|
||||
[0x0080] = 0x80,
|
||||
[0x0081] = 0x81,
|
||||
[0x0082] = 0x82,
|
||||
[0x0083] = 0x83,
|
||||
[0x0084] = 0x84,
|
||||
[0x0085] = 0x85,
|
||||
[0x0086] = 0x86,
|
||||
[0x0087] = 0x87,
|
||||
[0x0088] = 0x88,
|
||||
[0x0089] = 0x89,
|
||||
[0x008A] = 0x8A,
|
||||
[0x008B] = 0x8B,
|
||||
[0x008C] = 0x8C,
|
||||
[0x008D] = 0x8D,
|
||||
[0x008E] = 0x8E,
|
||||
[0x008F] = 0x8F,
|
||||
[0x0090] = 0x90,
|
||||
[0x0091] = 0x91,
|
||||
[0x0092] = 0x92,
|
||||
[0x0093] = 0x93,
|
||||
[0x0094] = 0x94,
|
||||
[0x0095] = 0x95,
|
||||
[0x0096] = 0x96,
|
||||
[0x0097] = 0x97,
|
||||
[0x0098] = 0x98,
|
||||
[0x0099] = 0x99,
|
||||
[0x009A] = 0x9A,
|
||||
[0x009B] = 0x9B,
|
||||
[0x009C] = 0x9C,
|
||||
[0x009D] = 0x9D,
|
||||
[0x009E] = 0x9E,
|
||||
[0x009F] = 0x9F,
|
||||
[0x00A0] = 0xA0,
|
||||
[0x00A2] = 0xA2,
|
||||
[0x00A3] = 0xA3,
|
||||
[0x00A4] = 0xA4,
|
||||
[0x00A5] = 0xA5,
|
||||
[0x00A6] = 0xA6,
|
||||
[0x00A7] = 0xA7,
|
||||
[0x00A8] = 0xA8,
|
||||
[0x00A9] = 0xA9,
|
||||
[0x00AB] = 0xAB,
|
||||
[0x00AC] = 0xAC,
|
||||
[0x00AD] = 0xAD,
|
||||
[0x00AE] = 0xAE,
|
||||
[0x00B0] = 0xB0,
|
||||
[0x00B1] = 0xB1,
|
||||
[0x00B2] = 0xB2,
|
||||
[0x00B3] = 0xB3,
|
||||
[0x00B4] = 0xB4,
|
||||
[0x00B5] = 0xB5,
|
||||
[0x00B6] = 0xB6,
|
||||
[0x00B7] = 0xB7,
|
||||
[0x00B8] = 0xB8,
|
||||
[0x00B9] = 0xB9,
|
||||
[0x00BB] = 0xBB,
|
||||
[0x00BC] = 0xBC,
|
||||
[0x00BD] = 0xBD,
|
||||
[0x00BE] = 0xBE,
|
||||
[0x00D7] = 0xAA,
|
||||
[0x00F7] = 0xBA,
|
||||
[0x05D0] = 0xE0,
|
||||
[0x05D1] = 0xE1,
|
||||
[0x05D2] = 0xE2,
|
||||
[0x05D3] = 0xE3,
|
||||
[0x05D4] = 0xE4,
|
||||
[0x05D5] = 0xE5,
|
||||
[0x05D6] = 0xE6,
|
||||
[0x05D7] = 0xE7,
|
||||
[0x05D8] = 0xE8,
|
||||
[0x05D9] = 0xE9,
|
||||
[0x05DA] = 0xEA,
|
||||
[0x05DB] = 0xEB,
|
||||
[0x05DC] = 0xEC,
|
||||
[0x05DD] = 0xED,
|
||||
[0x05DE] = 0xEE,
|
||||
[0x05DF] = 0xEF,
|
||||
[0x05E0] = 0xF0,
|
||||
[0x05E1] = 0xF1,
|
||||
[0x05E2] = 0xF2,
|
||||
[0x05E3] = 0xF3,
|
||||
[0x05E4] = 0xF4,
|
||||
[0x05E5] = 0xF5,
|
||||
[0x05E6] = 0xF6,
|
||||
[0x05E7] = 0xF7,
|
||||
[0x05E8] = 0xF8,
|
||||
[0x05E9] = 0xF9,
|
||||
[0x05EA] = 0xFA,
|
||||
[0x2017] = 0xDF,
|
||||
[0x203E] = 0xAF,
|
||||
};
|
@ -21,4 +21,4 @@
|
||||
#include <wchar.h>
|
||||
#include <iso8859-9.h>
|
||||
#define NAME "ISO-8859-9"
|
||||
#include <iso8859-generic.c>
|
||||
#include <8bit-generic.c>
|
||||
|
@ -1,516 +0,0 @@
|
||||
static const wchar_t to_ucs4[256] = {
|
||||
[0x00] = 0x0000,
|
||||
[0x01] = 0x0001,
|
||||
[0x02] = 0x0002,
|
||||
[0x03] = 0x0003,
|
||||
[0x04] = 0x0004,
|
||||
[0x05] = 0x0005,
|
||||
[0x06] = 0x0006,
|
||||
[0x07] = 0x0007,
|
||||
[0x08] = 0x0008,
|
||||
[0x09] = 0x0009,
|
||||
[0x0A] = 0x000A,
|
||||
[0x0B] = 0x000B,
|
||||
[0x0C] = 0x000C,
|
||||
[0x0D] = 0x000D,
|
||||
[0x0E] = 0x000E,
|
||||
[0x0F] = 0x000F,
|
||||
[0x10] = 0x0010,
|
||||
[0x11] = 0x0011,
|
||||
[0x12] = 0x0012,
|
||||
[0x13] = 0x0013,
|
||||
[0x14] = 0x0014,
|
||||
[0x15] = 0x0015,
|
||||
[0x16] = 0x0016,
|
||||
[0x17] = 0x0017,
|
||||
[0x18] = 0x0018,
|
||||
[0x19] = 0x0019,
|
||||
[0x1A] = 0x001A,
|
||||
[0x1B] = 0x001B,
|
||||
[0x1C] = 0x001C,
|
||||
[0x1D] = 0x001D,
|
||||
[0x1E] = 0x001E,
|
||||
[0x1F] = 0x001F,
|
||||
[0x20] = 0x0020,
|
||||
[0x21] = 0x0021,
|
||||
[0x22] = 0x0022,
|
||||
[0x23] = 0x0023,
|
||||
[0x24] = 0x0024,
|
||||
[0x25] = 0x0025,
|
||||
[0x26] = 0x0026,
|
||||
[0x27] = 0x0027,
|
||||
[0x28] = 0x0028,
|
||||
[0x29] = 0x0029,
|
||||
[0x2A] = 0x002A,
|
||||
[0x2B] = 0x002B,
|
||||
[0x2C] = 0x002C,
|
||||
[0x2D] = 0x002D,
|
||||
[0x2E] = 0x002E,
|
||||
[0x2F] = 0x002F,
|
||||
[0x30] = 0x0030,
|
||||
[0x31] = 0x0031,
|
||||
[0x32] = 0x0032,
|
||||
[0x33] = 0x0033,
|
||||
[0x34] = 0x0034,
|
||||
[0x35] = 0x0035,
|
||||
[0x36] = 0x0036,
|
||||
[0x37] = 0x0037,
|
||||
[0x38] = 0x0038,
|
||||
[0x39] = 0x0039,
|
||||
[0x3A] = 0x003A,
|
||||
[0x3B] = 0x003B,
|
||||
[0x3C] = 0x003C,
|
||||
[0x3D] = 0x003D,
|
||||
[0x3E] = 0x003E,
|
||||
[0x3F] = 0x003F,
|
||||
[0x40] = 0x0040,
|
||||
[0x41] = 0x0041,
|
||||
[0x42] = 0x0042,
|
||||
[0x43] = 0x0043,
|
||||
[0x44] = 0x0044,
|
||||
[0x45] = 0x0045,
|
||||
[0x46] = 0x0046,
|
||||
[0x47] = 0x0047,
|
||||
[0x48] = 0x0048,
|
||||
[0x49] = 0x0049,
|
||||
[0x4A] = 0x004A,
|
||||
[0x4B] = 0x004B,
|
||||
[0x4C] = 0x004C,
|
||||
[0x4D] = 0x004D,
|
||||
[0x4E] = 0x004E,
|
||||
[0x4F] = 0x004F,
|
||||
[0x50] = 0x0050,
|
||||
[0x51] = 0x0051,
|
||||
[0x52] = 0x0052,
|
||||
[0x53] = 0x0053,
|
||||
[0x54] = 0x0054,
|
||||
[0x55] = 0x0055,
|
||||
[0x56] = 0x0056,
|
||||
[0x57] = 0x0057,
|
||||
[0x58] = 0x0058,
|
||||
[0x59] = 0x0059,
|
||||
[0x5A] = 0x005A,
|
||||
[0x5B] = 0x005B,
|
||||
[0x5C] = 0x005C,
|
||||
[0x5D] = 0x005D,
|
||||
[0x5E] = 0x005E,
|
||||
[0x5F] = 0x005F,
|
||||
[0x60] = 0x0060,
|
||||
[0x61] = 0x0061,
|
||||
[0x62] = 0x0062,
|
||||
[0x63] = 0x0063,
|
||||
[0x64] = 0x0064,
|
||||
[0x65] = 0x0065,
|
||||
[0x66] = 0x0066,
|
||||
[0x67] = 0x0067,
|
||||
[0x68] = 0x0068,
|
||||
[0x69] = 0x0069,
|
||||
[0x6A] = 0x006A,
|
||||
[0x6B] = 0x006B,
|
||||
[0x6C] = 0x006C,
|
||||
[0x6D] = 0x006D,
|
||||
[0x6E] = 0x006E,
|
||||
[0x6F] = 0x006F,
|
||||
[0x70] = 0x0070,
|
||||
[0x71] = 0x0071,
|
||||
[0x72] = 0x0072,
|
||||
[0x73] = 0x0073,
|
||||
[0x74] = 0x0074,
|
||||
[0x75] = 0x0075,
|
||||
[0x76] = 0x0076,
|
||||
[0x77] = 0x0077,
|
||||
[0x78] = 0x0078,
|
||||
[0x79] = 0x0079,
|
||||
[0x7A] = 0x007A,
|
||||
[0x7B] = 0x007B,
|
||||
[0x7C] = 0x007C,
|
||||
[0x7D] = 0x007D,
|
||||
[0x7E] = 0x007E,
|
||||
[0x7F] = 0x007F,
|
||||
[0x80] = 0x0080,
|
||||
[0x81] = 0x0081,
|
||||
[0x82] = 0x0082,
|
||||
[0x83] = 0x0083,
|
||||
[0x84] = 0x0084,
|
||||
[0x85] = 0x0085,
|
||||
[0x86] = 0x0086,
|
||||
[0x87] = 0x0087,
|
||||
[0x88] = 0x0088,
|
||||
[0x89] = 0x0089,
|
||||
[0x8A] = 0x008A,
|
||||
[0x8B] = 0x008B,
|
||||
[0x8C] = 0x008C,
|
||||
[0x8D] = 0x008D,
|
||||
[0x8E] = 0x008E,
|
||||
[0x8F] = 0x008F,
|
||||
[0x90] = 0x0090,
|
||||
[0x91] = 0x0091,
|
||||
[0x92] = 0x0092,
|
||||
[0x93] = 0x0093,
|
||||
[0x94] = 0x0094,
|
||||
[0x95] = 0x0095,
|
||||
[0x96] = 0x0096,
|
||||
[0x97] = 0x0097,
|
||||
[0x98] = 0x0098,
|
||||
[0x99] = 0x0099,
|
||||
[0x9A] = 0x009A,
|
||||
[0x9B] = 0x009B,
|
||||
[0x9C] = 0x009C,
|
||||
[0x9D] = 0x009D,
|
||||
[0x9E] = 0x009E,
|
||||
[0x9F] = 0x009F,
|
||||
[0xA0] = 0x00A0,
|
||||
[0xA1] = 0x00A1,
|
||||
[0xA2] = 0x00A2,
|
||||
[0xA3] = 0x00A3,
|
||||
[0xA4] = 0x00A4,
|
||||
[0xA5] = 0x00A5,
|
||||
[0xA6] = 0x00A6,
|
||||
[0xA7] = 0x00A7,
|
||||
[0xA8] = 0x00A8,
|
||||
[0xA9] = 0x00A9,
|
||||
[0xAA] = 0x00AA,
|
||||
[0xAB] = 0x00AB,
|
||||
[0xAC] = 0x00AC,
|
||||
[0xAD] = 0x00AD,
|
||||
[0xAE] = 0x00AE,
|
||||
[0xAF] = 0x00AF,
|
||||
[0xB0] = 0x00B0,
|
||||
[0xB1] = 0x00B1,
|
||||
[0xB2] = 0x00B2,
|
||||
[0xB3] = 0x00B3,
|
||||
[0xB4] = 0x00B4,
|
||||
[0xB5] = 0x00B5,
|
||||
[0xB6] = 0x00B6,
|
||||
[0xB7] = 0x00B7,
|
||||
[0xB8] = 0x00B8,
|
||||
[0xB9] = 0x00B9,
|
||||
[0xBA] = 0x00BA,
|
||||
[0xBB] = 0x00BB,
|
||||
[0xBC] = 0x00BC,
|
||||
[0xBD] = 0x00BD,
|
||||
[0xBE] = 0x00BE,
|
||||
[0xBF] = 0x00BF,
|
||||
[0xC0] = 0x00C0,
|
||||
[0xC1] = 0x00C1,
|
||||
[0xC2] = 0x00C2,
|
||||
[0xC3] = 0x00C3,
|
||||
[0xC4] = 0x00C4,
|
||||
[0xC5] = 0x00C5,
|
||||
[0xC6] = 0x00C6,
|
||||
[0xC7] = 0x00C7,
|
||||
[0xC8] = 0x00C8,
|
||||
[0xC9] = 0x00C9,
|
||||
[0xCA] = 0x00CA,
|
||||
[0xCB] = 0x00CB,
|
||||
[0xCC] = 0x00CC,
|
||||
[0xCD] = 0x00CD,
|
||||
[0xCE] = 0x00CE,
|
||||
[0xCF] = 0x00CF,
|
||||
[0xD0] = 0x011E,
|
||||
[0xD1] = 0x00D1,
|
||||
[0xD2] = 0x00D2,
|
||||
[0xD3] = 0x00D3,
|
||||
[0xD4] = 0x00D4,
|
||||
[0xD5] = 0x00D5,
|
||||
[0xD6] = 0x00D6,
|
||||
[0xD7] = 0x00D7,
|
||||
[0xD8] = 0x00D8,
|
||||
[0xD9] = 0x00D9,
|
||||
[0xDA] = 0x00DA,
|
||||
[0xDB] = 0x00DB,
|
||||
[0xDC] = 0x00DC,
|
||||
[0xDD] = 0x0130,
|
||||
[0xDE] = 0x015E,
|
||||
[0xDF] = 0x00DF,
|
||||
[0xE0] = 0x00E0,
|
||||
[0xE1] = 0x00E1,
|
||||
[0xE2] = 0x00E2,
|
||||
[0xE3] = 0x00E3,
|
||||
[0xE4] = 0x00E4,
|
||||
[0xE5] = 0x00E5,
|
||||
[0xE6] = 0x00E6,
|
||||
[0xE7] = 0x00E7,
|
||||
[0xE8] = 0x00E8,
|
||||
[0xE9] = 0x00E9,
|
||||
[0xEA] = 0x0119,
|
||||
[0xEB] = 0x00EB,
|
||||
[0xEC] = 0x0117,
|
||||
[0xED] = 0x00ED,
|
||||
[0xEE] = 0x00EE,
|
||||
[0xEF] = 0x012B,
|
||||
[0xF0] = 0x011F,
|
||||
[0xF1] = 0x00F1,
|
||||
[0xF2] = 0x00F2,
|
||||
[0xF3] = 0x00F3,
|
||||
[0xF4] = 0x00F4,
|
||||
[0xF5] = 0x00F5,
|
||||
[0xF6] = 0x00F6,
|
||||
[0xF7] = 0x00F7,
|
||||
[0xF8] = 0x00F8,
|
||||
[0xF9] = 0x00F9,
|
||||
[0xFA] = 0x00FA,
|
||||
[0xFB] = 0x00FB,
|
||||
[0xFC] = 0x00FC,
|
||||
[0xFD] = 0x0131,
|
||||
[0xFE] = 0x015F,
|
||||
[0xFF] = 0x00FF,
|
||||
};
|
||||
static const char from_ucs4[] = {
|
||||
[0x0000] = 0x00,
|
||||
[0x0001] = 0x01,
|
||||
[0x0002] = 0x02,
|
||||
[0x0003] = 0x03,
|
||||
[0x0004] = 0x04,
|
||||
[0x0005] = 0x05,
|
||||
[0x0006] = 0x06,
|
||||
[0x0007] = 0x07,
|
||||
[0x0008] = 0x08,
|
||||
[0x0009] = 0x09,
|
||||
[0x000A] = 0x0A,
|
||||
[0x000B] = 0x0B,
|
||||
[0x000C] = 0x0C,
|
||||
[0x000D] = 0x0D,
|
||||
[0x000E] = 0x0E,
|
||||
[0x000F] = 0x0F,
|
||||
[0x0010] = 0x10,
|
||||
[0x0011] = 0x11,
|
||||
[0x0012] = 0x12,
|
||||
[0x0013] = 0x13,
|
||||
[0x0014] = 0x14,
|
||||
[0x0015] = 0x15,
|
||||
[0x0016] = 0x16,
|
||||
[0x0017] = 0x17,
|
||||
[0x0018] = 0x18,
|
||||
[0x0019] = 0x19,
|
||||
[0x001A] = 0x1A,
|
||||
[0x001B] = 0x1B,
|
||||
[0x001C] = 0x1C,
|
||||
[0x001D] = 0x1D,
|
||||
[0x001E] = 0x1E,
|
||||
[0x001F] = 0x1F,
|
||||
[0x0020] = 0x20,
|
||||
[0x0021] = 0x21,
|
||||
[0x0022] = 0x22,
|
||||
[0x0023] = 0x23,
|
||||
[0x0024] = 0x24,
|
||||
[0x0025] = 0x25,
|
||||
[0x0026] = 0x26,
|
||||
[0x0027] = 0x27,
|
||||
[0x0028] = 0x28,
|
||||
[0x0029] = 0x29,
|
||||
[0x002A] = 0x2A,
|
||||
[0x002B] = 0x2B,
|
||||
[0x002C] = 0x2C,
|
||||
[0x002D] = 0x2D,
|
||||
[0x002E] = 0x2E,
|
||||
[0x002F] = 0x2F,
|
||||
[0x0030] = 0x30,
|
||||
[0x0031] = 0x31,
|
||||
[0x0032] = 0x32,
|
||||
[0x0033] = 0x33,
|
||||
[0x0034] = 0x34,
|
||||
[0x0035] = 0x35,
|
||||
[0x0036] = 0x36,
|
||||
[0x0037] = 0x37,
|
||||
[0x0038] = 0x38,
|
||||
[0x0039] = 0x39,
|
||||
[0x003A] = 0x3A,
|
||||
[0x003B] = 0x3B,
|
||||
[0x003C] = 0x3C,
|
||||
[0x003D] = 0x3D,
|
||||
[0x003E] = 0x3E,
|
||||
[0x003F] = 0x3F,
|
||||
[0x0040] = 0x40,
|
||||
[0x0041] = 0x41,
|
||||
[0x0042] = 0x42,
|
||||
[0x0043] = 0x43,
|
||||
[0x0044] = 0x44,
|
||||
[0x0045] = 0x45,
|
||||
[0x0046] = 0x46,
|
||||
[0x0047] = 0x47,
|
||||
[0x0048] = 0x48,
|
||||
[0x0049] = 0x49,
|
||||
[0x004A] = 0x4A,
|
||||
[0x004B] = 0x4B,
|
||||
[0x004C] = 0x4C,
|
||||
[0x004D] = 0x4D,
|
||||
[0x004E] = 0x4E,
|
||||
[0x004F] = 0x4F,
|
||||
[0x0050] = 0x50,
|
||||
[0x0051] = 0x51,
|
||||
[0x0052] = 0x52,
|
||||
[0x0053] = 0x53,
|
||||
[0x0054] = 0x54,
|
||||
[0x0055] = 0x55,
|
||||
[0x0056] = 0x56,
|
||||
[0x0057] = 0x57,
|
||||
[0x0058] = 0x58,
|
||||
[0x0059] = 0x59,
|
||||
[0x005A] = 0x5A,
|
||||
[0x005B] = 0x5B,
|
||||
[0x005C] = 0x5C,
|
||||
[0x005D] = 0x5D,
|
||||
[0x005E] = 0x5E,
|
||||
[0x005F] = 0x5F,
|
||||
[0x0060] = 0x60,
|
||||
[0x0061] = 0x61,
|
||||
[0x0062] = 0x62,
|
||||
[0x0063] = 0x63,
|
||||
[0x0064] = 0x64,
|
||||
[0x0065] = 0x65,
|
||||
[0x0066] = 0x66,
|
||||
[0x0067] = 0x67,
|
||||
[0x0068] = 0x68,
|
||||
[0x0069] = 0x69,
|
||||
[0x006A] = 0x6A,
|
||||
[0x006B] = 0x6B,
|
||||
[0x006C] = 0x6C,
|
||||
[0x006D] = 0x6D,
|
||||
[0x006E] = 0x6E,
|
||||
[0x006F] = 0x6F,
|
||||
[0x0070] = 0x70,
|
||||
[0x0071] = 0x71,
|
||||
[0x0072] = 0x72,
|
||||
[0x0073] = 0x73,
|
||||
[0x0074] = 0x74,
|
||||
[0x0075] = 0x75,
|
||||
[0x0076] = 0x76,
|
||||
[0x0077] = 0x77,
|
||||
[0x0078] = 0x78,
|
||||
[0x0079] = 0x79,
|
||||
[0x007A] = 0x7A,
|
||||
[0x007B] = 0x7B,
|
||||
[0x007C] = 0x7C,
|
||||
[0x007D] = 0x7D,
|
||||
[0x007E] = 0x7E,
|
||||
[0x007F] = 0x7F,
|
||||
[0x0080] = 0x80,
|
||||
[0x0081] = 0x81,
|
||||
[0x0082] = 0x82,
|
||||
[0x0083] = 0x83,
|
||||
[0x0084] = 0x84,
|
||||
[0x0085] = 0x85,
|
||||
[0x0086] = 0x86,
|
||||
[0x0087] = 0x87,
|
||||
[0x0088] = 0x88,
|
||||
[0x0089] = 0x89,
|
||||
[0x008A] = 0x8A,
|
||||
[0x008B] = 0x8B,
|
||||
[0x008C] = 0x8C,
|
||||
[0x008D] = 0x8D,
|
||||
[0x008E] = 0x8E,
|
||||
[0x008F] = 0x8F,
|
||||
[0x0090] = 0x90,
|
||||
[0x0091] = 0x91,
|
||||
[0x0092] = 0x92,
|
||||
[0x0093] = 0x93,
|
||||
[0x0094] = 0x94,
|
||||
[0x0095] = 0x95,
|
||||
[0x0096] = 0x96,
|
||||
[0x0097] = 0x97,
|
||||
[0x0098] = 0x98,
|
||||
[0x0099] = 0x99,
|
||||
[0x009A] = 0x9A,
|
||||
[0x009B] = 0x9B,
|
||||
[0x009C] = 0x9C,
|
||||
[0x009D] = 0x9D,
|
||||
[0x009E] = 0x9E,
|
||||
[0x009F] = 0x9F,
|
||||
[0x00A0] = 0xA0,
|
||||
[0x00A1] = 0xA1,
|
||||
[0x00A2] = 0xA2,
|
||||
[0x00A3] = 0xA3,
|
||||
[0x00A4] = 0xA4,
|
||||
[0x00A5] = 0xA5,
|
||||
[0x00A6] = 0xA6,
|
||||
[0x00A7] = 0xA7,
|
||||
[0x00A8] = 0xA8,
|
||||
[0x00A9] = 0xA9,
|
||||
[0x00AA] = 0xAA,
|
||||
[0x00AB] = 0xAB,
|
||||
[0x00AC] = 0xAC,
|
||||
[0x00AD] = 0xAD,
|
||||
[0x00AE] = 0xAE,
|
||||
[0x00AF] = 0xAF,
|
||||
[0x00B0] = 0xB0,
|
||||
[0x00B1] = 0xB1,
|
||||
[0x00B2] = 0xB2,
|
||||
[0x00B3] = 0xB3,
|
||||
[0x00B4] = 0xB4,
|
||||
[0x00B5] = 0xB5,
|
||||
[0x00B6] = 0xB6,
|
||||
[0x00B7] = 0xB7,
|
||||
[0x00B8] = 0xB8,
|
||||
[0x00B9] = 0xB9,
|
||||
[0x00BA] = 0xBA,
|
||||
[0x00BB] = 0xBB,
|
||||
[0x00BC] = 0xBC,
|
||||
[0x00BD] = 0xBD,
|
||||
[0x00BE] = 0xBE,
|
||||
[0x00BF] = 0xBF,
|
||||
[0x00C0] = 0xC0,
|
||||
[0x00C1] = 0xC1,
|
||||
[0x00C2] = 0xC2,
|
||||
[0x00C3] = 0xC3,
|
||||
[0x00C4] = 0xC4,
|
||||
[0x00C5] = 0xC5,
|
||||
[0x00C6] = 0xC6,
|
||||
[0x00C7] = 0xC7,
|
||||
[0x00C8] = 0xC8,
|
||||
[0x00C9] = 0xC9,
|
||||
[0x00CA] = 0xCA,
|
||||
[0x00CB] = 0xCB,
|
||||
[0x00CC] = 0xCC,
|
||||
[0x00CD] = 0xCD,
|
||||
[0x00CE] = 0xCE,
|
||||
[0x00CF] = 0xCF,
|
||||
[0x00D1] = 0xD1,
|
||||
[0x00D2] = 0xD2,
|
||||
[0x00D3] = 0xD3,
|
||||
[0x00D4] = 0xD4,
|
||||
[0x00D5] = 0xD5,
|
||||
[0x00D6] = 0xD6,
|
||||
[0x00D7] = 0xD7,
|
||||
[0x00D8] = 0xD8,
|
||||
[0x00D9] = 0xD9,
|
||||
[0x00DA] = 0xDA,
|
||||
[0x00DB] = 0xDB,
|
||||
[0x00DC] = 0xDC,
|
||||
[0x00DF] = 0xDF,
|
||||
[0x00E0] = 0xE0,
|
||||
[0x00E1] = 0xE1,
|
||||
[0x00E2] = 0xE2,
|
||||
[0x00E3] = 0xE3,
|
||||
[0x00E4] = 0xE4,
|
||||
[0x00E5] = 0xE5,
|
||||
[0x00E6] = 0xE6,
|
||||
[0x00E7] = 0xE7,
|
||||
[0x00E8] = 0xE8,
|
||||
[0x00E9] = 0xE9,
|
||||
[0x00EB] = 0xEB,
|
||||
[0x00ED] = 0xED,
|
||||
[0x00EE] = 0xEE,
|
||||
[0x00F1] = 0xF1,
|
||||
[0x00F2] = 0xF2,
|
||||
[0x00F3] = 0xF3,
|
||||
[0x00F4] = 0xF4,
|
||||
[0x00F5] = 0xF5,
|
||||
[0x00F6] = 0xF6,
|
||||
[0x00F7] = 0xF7,
|
||||
[0x00F8] = 0xF8,
|
||||
[0x00F9] = 0xF9,
|
||||
[0x00FA] = 0xFA,
|
||||
[0x00FB] = 0xFB,
|
||||
[0x00FC] = 0xFC,
|
||||
[0x00FF] = 0xFF,
|
||||
[0x0117] = 0xEC,
|
||||
[0x0119] = 0xEA,
|
||||
[0x011E] = 0xD0,
|
||||
[0x011F] = 0xF0,
|
||||
[0x012B] = 0xEF,
|
||||
[0x0130] = 0xDD,
|
||||
[0x0131] = 0xFD,
|
||||
[0x015E] = 0xDE,
|
||||
[0x015F] = 0xFE,
|
||||
};
|
58
iconvdata/jis0201.c
Normal file
58
iconvdata/jis0201.c
Normal file
@ -0,0 +1,58 @@
|
||||
/* Mapping tables for JIS0201 handling.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <wchar.h>
|
||||
|
||||
|
||||
const wchar_t jisx0201_to_ucs4[256] =
|
||||
{
|
||||
0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,
|
||||
0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
|
||||
0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017,
|
||||
0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f,
|
||||
0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
|
||||
0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
|
||||
0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
|
||||
0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
|
||||
0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
|
||||
0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
|
||||
0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
|
||||
0x0058, 0x0059, 0x005a, 0x005b, 0x00a5, 0x005d, 0x005e, 0x005f,
|
||||
0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
|
||||
0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
|
||||
0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
|
||||
0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x203e, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0xff61, 0xff62, 0xff63, 0xff64, 0xff65, 0xff66, 0xff67,
|
||||
0xff68, 0xff69, 0xff6a, 0xff6b, 0xff6c, 0xff6d, 0xff6e, 0xff6f,
|
||||
0xff70, 0xff71, 0xff72, 0xff73, 0xff74, 0xff75, 0xff76, 0xff77,
|
||||
0xff78, 0xff79, 0xff7a, 0xff7b, 0xff7c, 0xff7d, 0xff7e, 0xff7f,
|
||||
0xff80, 0xff81, 0xff82, 0xff83, 0xff84, 0xff85, 0xff86, 0xff87,
|
||||
0xff88, 0xff89, 0xff8a, 0xff8b, 0xff8c, 0xff8d, 0xff8e, 0xff8f,
|
||||
0xff90, 0xff91, 0xff92, 0xff93, 0xff94, 0xff95, 0xff96, 0xff97,
|
||||
0xff98, 0xff99, 0xff9a, 0xff9b, 0xff9c, 0xff9d, 0xff9e, 0xff9f,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
|
||||
};
|
60
iconvdata/jis0201.h
Normal file
60
iconvdata/jis0201.h
Normal file
@ -0,0 +1,60 @@
|
||||
/* Access functions for JISX0201 conversion.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _JIS0201_H
|
||||
#define _JIS0201_H 1
|
||||
|
||||
/* Conversion table. */
|
||||
extern const wchar_t jis0201_to_ucs4[];
|
||||
|
||||
|
||||
static inline wchar_t
|
||||
jisx0201_to_ucs4 (char **s, size_t avail __attribute__ ((unused)))
|
||||
{
|
||||
wchar_t val = jis0201_to_ucs4[*(unsigned char *) (*s)];
|
||||
|
||||
if (val == 0 && **s != '\0')
|
||||
val = UNKNOWN_10646_CHAR;
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
static inline size_t
|
||||
ucs4_to_jisx0201 (wchar_t wch, char **s, size_t avail __attribute__ ((unused)))
|
||||
{
|
||||
char ch;
|
||||
|
||||
if (wch == 0xa5)
|
||||
ch = '\x5c';
|
||||
else if (wch == 0x203e)
|
||||
ch = '\x7e';
|
||||
else if (wch < 0x7e)
|
||||
ch = wch;
|
||||
else if (wch >= 0xff61 && wch <= 0xff9f)
|
||||
ch = wch - 0xfec0;
|
||||
else
|
||||
return 0;
|
||||
|
||||
*(*s)++ = ch;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif /* jis0201.h */
|
5011
iconvdata/jis0208.c
Normal file
5011
iconvdata/jis0208.c
Normal file
File diff suppressed because it is too large
Load Diff
104
iconvdata/jis0208.h
Normal file
104
iconvdata/jis0208.h
Normal file
@ -0,0 +1,104 @@
|
||||
/* Access functions for JISX0208 conversion.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _JIS0208_H
|
||||
#define _JIS0208_H 1
|
||||
|
||||
#include <gconv.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
/* Conversion table. */
|
||||
extern const uint16_t jis0208_to_ucs[];
|
||||
|
||||
extern const char jisx0208_from_ucs4_lat1[256][2];
|
||||
extern const char jisx0208_from_ucs4_greek[0xc1][2];
|
||||
extern const struct jisx0208_ucs_idx jisx0208_from_ucs_idx[];
|
||||
extern const char jisx0208_from_ucs_tab[][2];
|
||||
|
||||
|
||||
/* Struct for table with indeces in UCS mapping table. */
|
||||
struct jisx0208_ucs_idx
|
||||
{
|
||||
uint16_t start;
|
||||
uint16_t end;
|
||||
uint16_t idx;
|
||||
};
|
||||
|
||||
|
||||
static inline wchar_t
|
||||
jisx0208_to_ucs4 (char **s, size_t avail)
|
||||
{
|
||||
unsigned char ch = *(*s);
|
||||
unsigned char ch2;
|
||||
int idx;
|
||||
|
||||
if (ch <= 0x20 || ch > 0xea)
|
||||
return UNKNOWN_10646_CHAR;
|
||||
|
||||
if (avail < 2)
|
||||
return 0;
|
||||
|
||||
ch2 = (*s)[1];
|
||||
if (ch2 <= 0x20 || ch2 >= 0x7f)
|
||||
return UNKNOWN_10646_CHAR;
|
||||
|
||||
idx = (ch - 0x21) * 94 + (ch2 - 0x21);
|
||||
if (idx >= 0x1e80)
|
||||
return UNKNOWN_10646_CHAR;
|
||||
|
||||
(*s) += 2;
|
||||
|
||||
return jis0208_to_ucs[idx] ?: ((*s) -= 2, UNKNOWN_10646_CHAR);
|
||||
}
|
||||
|
||||
|
||||
static inline size_t
|
||||
ucs4_to_jisx0208 (wchar_t wch, char **s, size_t avail)
|
||||
{
|
||||
unsigned int ch = (unsigned int) wch;
|
||||
const char *cp = NULL;
|
||||
|
||||
if (avail < 2)
|
||||
return 0;
|
||||
|
||||
if (ch < 0x100)
|
||||
cp = jisx0208_from_ucs4_lat1[ch];
|
||||
else if (ch >= 0x391 && ch <= 0x451)
|
||||
cp = jisx0208_from_ucs4_greek[ch];
|
||||
else
|
||||
{
|
||||
const struct jisx0208_ucs_idx *rp = jisx0208_from_ucs_idx;
|
||||
|
||||
while (ch > rp->end)
|
||||
++rp;
|
||||
if (ch >= rp->start)
|
||||
cp = jisx0208_from_ucs_tab[rp->idx + ch - rp->start];
|
||||
}
|
||||
|
||||
if (cp == NULL || cp[0] == '\0')
|
||||
return UNKNOWN_10646_CHAR;
|
||||
|
||||
*(*s)++ = cp[0];
|
||||
*(*s)++ = cp[1];
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
#endif /* jis0208.h */
|
3941
iconvdata/jis0212.c
Normal file
3941
iconvdata/jis0212.c
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user