1196.   [contrib]       update mdnkit to 2.2.3.
This commit is contained in:
Mark Andrews 2002-02-08 12:16:32 +00:00
parent a51c70decc
commit ee9dbfb7cd
186 changed files with 7094 additions and 12070 deletions

View file

@ -1,3 +1,5 @@
1196. [contrib] update mdnkit to 2.2.3.
1191. [bug] A dynamic update removing the last non-apex name in
a secure zone would fail. [RT #2399]

View file

@ -1,3 +1,421 @@
2001-12-06
* 2.2.3 release.
* lib/uticode.c: fix a bug in mdn__unicode_decompose() that assumes
sizeof(size_t) equals to sizeof(int).
* lib/converter.c: always include <mdn/utf5.h>.
2001-12-03
* DISTFILES: add patch/bind9/bind-9.2.0.patch.
* lib/checker.c, lib/mapper.c, lib/nameprep.c, lib/nameprepdata.c,
lib/normalizer.c: recognize "nameprep-06".
* lib/mdn.conf.sample.in, man/mdn.conf.5.in, tools/mdnconv/mdnconv.1:
add description about "nameprep-06".
2001-11-28
* lib/Makefile.in, tools/runmdn/Makefile.in: Change LIB_REVISION
from 2 to 3.
* include/mdn/version.h: set MDNKIT_VERSION to "2.2.3".
2001-11-21
* tools/runmdn/stub.c: fix type mismatch bug of `fp'.
* lib/converter.c: always include <mdn/debug.h>.
2001-10-31
* 2.2.2 release.
* include/mdn/version.h: set MDNKIT_VERSION to "2.2.3".
* configure.in: on NetBSD, use `:' as a separator of LD_PRELOAD
if /usr/bin/grep is ELF binary, use ` ' otherwise.
* wsock/config/mdnconf.tcl: update version number to 2.2.2.
* README, README.ja: update the list of supported systems.
2001-10-30
* wsock/config/mdnconf.tcl: update version number to 2.2.1.
2001-10-29
* 2.2.1 release.
* include/mdn/version.h: set MDNKIT_VERSION to "2.2.1".
* lib/Makefile.in, tools/runmdn/Makefile.in: Change LIB_REVISION
from 1 to 2.
2001-10-17
* lib/checker.c (mdn_checker_lookup): Fix a serious bug that the
function overlooks a prohibited character.
2001-09-19
* 2.2 release.
2001-09-17
* NEWS: add description about deletion of `allow-utf8' to "Major
changes in version 2.1".
* README, README.ja: add some platforms to the list of supported
systems.
* include/mdn/version.h: set MDNKIT_VERSION to "2.2".
2001-09-14
* lib/amcacez.c, include/mdn/amcacez.h: update draft version.
2001-09-12
* wsock/config/mdnconf.tcl: update version number.
2001-09-11
* INSTALL.ja: The title is fixed.
2001-09-10
* Makefile.in: add dummy target 'force' to work around a problem
in cygwin, where the existance of "INSTALL" file disturbs
"make install".
* lib/make.wnt: add rules for amcace[vwz].o and mace.o.
* util/SparseMap.pm, util/generate_nameprep_data.pl,
util/generate_normalize_data.pl: add 'const' qualification to
the generated (large) constant tables, for better data sharing.
* lib/nameprepdata.c, lib/unicodedata_301.c, lib/unicodedata_310.c:
regenerated using above scripts.
* lib/nameprep.c, lib/nameprep_template.c, lib/unicode.c,
lib/unicode_template.c: accommodate declarations to the above
changes.
2001-08-28
* 2.2rc1 release.
* DISTFILES: delete patch/bind9/bind-9.1.2-patch.
* include/mdn/version.h: set MDNKIT_VERSION to 2.2rc1.
2001-08-27
* include/mdn/amcacez.h, lib/amcacez.c: update to conform to
version 0.3.0 (draft-ietf-idn-amc-ace-z-00.txt).
* configure.in, lib/amcacez.c, INSTALL, INSTALL.ja: define "zq--"
as new default ACE prefix for AMC-ACE-Z.
2001-08-21
* lib/mdn.conf.sample.in, man/mdn.conf.5.in, tools/mdnconv/mdnconv.1:
undocument unicode-form-{c,d,kd}, unicode-{upper,lower,fold}case,
ascii-{upper,lower}case and nameprep-{02,04}.
2001-08-20
* tools/runmdn/runmdn.1: Use the term "codeset" rather than
"encoding".
2001-08-17
* INSTALL: fix typo.
2001-08-15
* README, README.ja: show a list of supported systems as a table.
* tools/runmdn/runmdn.in: parse command line options, and recognize
option `-e' which sets local encoding.
* tools/runmdn/runmdn.1: add description about `-e' option.
* tools/runmdn/Makefile.in: update `runmdn' if it is older than
`runmdn.in'.
* INSTALL and INSTALL.ja: new files.
* README, README.ja: `Compilation and Intallation' section is moved
to INSTALL and INSTALL.ja.
* DISTFILES: add INSTALL and INSTALL.ja.
* lib/converter.c, README, README.ja: unless --enable-extra-ace
option to configure is specified, support only three ACEs:
AMC-ACE-Z, RACE and DUDE.
* lib/namrprep.c, lib/converter.c, lib/checker.c, lib/mapper.c:
delete `nameprep-02' and `nameprep-04' supports.
* lib/mdn.conf.sample.in, man/mdn.conf.5.in, tools/mdnconv/mdnconv.1:
delete description about `nameprep-02', `nameprep-04' and extra ACEs.
2001-08-14
* README, README.ja: update information about compilation problem
of libiconv-1.6.1 on NetBSD.
2001-08-13
* README, README.ja: revise description of compilation and
installation process.
* tools/mdnconv/mdnconv.c: revise error messages displayed
when default input/output codeset is wrong.
2001-08-06
* 2.2beta3 release.
* include/mdn/version.h: set MDNKIT_VERSION to "2.2beta3".
* README, README.ja: describe CPU architure of FreeBSD on which
we have tested.
2001-08-01
* util/generate_nameprep_data.pl: add pragma 'use bytes;' to
avoid outputing incorrect map data when perl 5.6.1 is used.
* lib/nameprepdata.c: add data for nameprep-04 and -05.
* lib/nameprep.c: add support for 'nameprep-04' and 'nameprep-05'.
current version is now nameprep-05.
* lib/checker.c, lib/mapper.c: add 'nameprep-04' and 'nameprep-05'.
* lib/unicodedata.c: removed.
* lib/unicodedata_301.c, lib/unicodedata_310.c: created.
both contains various Unicode table of version 3.0.1 and 3.1.0.
* lib/unicode_template.c: created. contains helper functions for
each Unicode versions.
* include/mdn/unicode.h, lib/unicode.c: add new interface
functions 'mdn__unicode_create' and 'mdn__unicode_destroy'.
now all existing functions take an extra argument which specifies
the version of Unicode standard.
* include/mdn/unicode.h, lib/unicode.c
* include/mdn/unormalize.h, lib/unormalize.c: change interface
so that the version of Unicode standard can be specified.
* lib/normalizer.c: add bunch of normalization schemes,
unicode-from-{c,d,kc,kd}/{3.0.1,3.1.0}, nameprep-{04,05}.
use new unormalize module interface.
* DISTFILES, lib/Makefile.in: add unicode_template.c,
unicodedata_301.c and unicodedata_310.c. remove unicodedata.c.
* util/generate_normalize_data.pl: add -prefix option.
* man/mdn.conf.5.in, tools/mdnconv/mdnconv.1: add description of
newly added schemes.
* lib/mdn.conf.sample.in: likewise.
2001-07-31
* include/mdn/res.h, lib/res.c: add new functions and macros
mdn_res_nameprep() and mdn_res_nameprepcheck().
* include/mdn/api.h: add new macro mdn_nameprepcheck().
2001-07-27
* README, README.ja: describe `--with-utf-6-prefix'.
2001-07-26
* tools/mdnconv/mdnconv.1: add a description on the nameprep check
performed in reverse conversion mode.
* tools/mdnconv/util.c: fix typo in comment.
* tools/mdnconv/mdnconv.c: don't perform selective-decode or
selective-decode if both `-whole' and `-reverse' options are specified.
* tools/mdnconv/mdnconv.c: perform NAMEPREP unassigned check if both
`-reverse' and `-unassigncheck' options are specified
* tools/mdnconv/mdnslookup.in: add missing quotation.
* DISTFILES: add patch/bind9/bind-9.1.3-patch.
2001-07-25
* tools/mdnconv/mdnslookup.in: new file.
* tools/mdnconv/Makefile.in: `all' target also depends on `mdnslookup'.
generate `mdnslookup' from `mdnslookup.in'.
* README, README.ja: add the ``Check your configuration'' section.
* DISTFILES: add tools/mdnconv/mdnslookup.in.
* tools/mdnconv/Makefile.in: honor LDFLAGS.
* lib/amcacez.c: do some optimization.
2001-07-24
* README, README.ja: add TOC, ``Supported systems'' section and
``Other configure options'' subsection.
2001-07-23
* tools/mdnconv/mdnconv.1, tools/runmdn/runmdn.1: add the ``LOCAL
CODESET'' section.
2001-07-18
* 2.2beta2 release.
* README, README.ja: update version number in the title.
2001-07-17
* include/mdn/version.h: set MDNKIT_VERSION to "2.2beta2".
* configure.in: fix result messages of cheking gethostbyaddr()
and getnameinfo() flavors. display "none" if the function is
not found.
2001-07-16
* include/mdn/amcacez.h, lib/amcacez.c: update to conform to
version 0.2.1, which is the version of -00 draft.
2001-07-12
* README, README.ja: explain `--enable-debug' option.
2001-07-11
* configure.in: add `--enable-debug' option.
if this option is specified, add "-DDEBUG" to CFLAGS.
2001-07-10
* configure.in: check flavor of getnameinfo().
* configure.in: test program for checking flavor of gethostbyaddr()
includes <sys/types.h> and <sys/socket.h>, since some system defines
`socklen_t' in either file.
* configure.in: define GNI_SALEN_T, GNI_HOSTLEN_T, GNI_SERVLEN_T
and GNI_FLAGS_T.
* tools/runmdn/resolver.c, tools/runmdn/stub.c, tools/runmdn/stub.h:
use GNI_SALEN_T, GNI_HOSTLEN_T, GNI_SERVLEN_T and GNI_FLAGS_T to
represent types of arguments to getnameinfo().
* include/mdn/logmacro.h: enable trace-level log even if compiled
without DEBUG option.
* lib/log.c: slightly optimize mdn_log_getlevel(), as it is called
number of times from everywhere.
2001-07-09
* lib/res.c: in mdn_res_nameconv(), procedures of insn `!m', `!n'
and `!N' converted an input string into a result of NAMEPREP, but
it must do NAMEPREP check only. fixed.
2001-07-06
* lib/msgtrans.c: perform NAMEPREP check at decoding a name.
* lib/api.c, include/mdn/api.h: mdn_decodename() accepts
MDN_UNASCHECK action.
* mdnsproxy/translate.c: fix typo in a warning message.
* include/mdn/res.h, lib/mdn/res.c: conversion to alternate encoding
is no longer supported.
* include/mdn/resconf.h, lib/resconf.c: no longer support
alternate encoding, though functions related to alternate encoding
such as mdn_resconf_setalternateconverter() are still remained.
ignore `alternate-encoding' entry in a configuration file.
* lib/mdn.conf.sample.in: delete `alternate-encoding' entry.
* man/mdn.conf.5.in: delete "ALTERNATE-ENCODING ENTRY" section.
delete `alternate-encoding' entry in the sample configuration.
* man/libmdn.3.in: delete description about alternate encoding.
* lib/res.c: mdn_res_nameconv() doesn't support insn `a' or `A'
any longer. nameconv_A() and nameconv_a() are removed.
2001-07-05
* include/mdn/version.h: set MDNKIT_VERSION to "2.2snap0705".
2001-07-04
* include/mdn/amcacez.h, lib/amcacez.c: created.
* include/mdn/Makefile.in, lib/Makefile.in, tools/runmdn/Makefile.in:
add above new files.
* DISTFILES: add above new files.
* lib/converter.c: add AMC-ACE-Z.
* configure.in: add prefix configuration option
(--with-amc-ace-z-prefix) for this ACE.
* configure: rebuilt.
* lib/amcacew.c: correct a bug in input range check.
* include/mdn/api.h: add MDN_NAMEPREP to MDN_DECODE_APP.
* lib/mdn/api.c: mdn_decodename() recognizes MDN_NAMEPREP action.
* include/mdn/converter.h: define encoding types: MDN_NONACE,
MDN_ACE_STRICTCASE and MDN_ACE_LOOSECASE.
* include/mdn/converter.h, lib/converter.c: add new function
mdn_converter_encodingtype().
* include/mdn/converter.h, lib/converter.c: 3rd argument of
mdn_converter_register() is now `encoding_type'.
* include/mdn/res.h, lib/mdn/res.c: add new insn `!m', `!n', `!p',
`!N' and `!u' to mdn_res_nameconv().
* include/mdn/res.h, lib/mdn/res.c: mdn_res_dnstoucs(...) is
equivalent to mdn_res_nameconv("i!N", ...).
* lib/checker.c, lib/mapper.c: fix a bug that allocated memory is
not disposed if input name is too long.
* lib/checker.c: mdn_checker_lookup() returns `mdn_success' if
registered character is found in an input string.
2001-07-03
* configure.in: check if the codeset name for UTF-8 encoding (`UTF-8',
which is default, or the one specified with --with-utf8 option) is
valid, and give a warning message if it doesn't seem so.
* configure: rebuilt.
2001-07-02
* configure.in: check if `iconv.h' exists in the directory specified
by --with-iconv-include=DIR, or in the `PREFIX/include' directory
specified by --with-libiconv=PREFIX.
* configure.in: check if C compiler can find `iconv.h'.
2001-06-25
* 2.2beta1 release.
* include/mdn/version.h: set MDNKIT_VERSION to "2.2beta1", and set
MDNKIT_MINOR_VERSION to 2.
* lib/Makefile.in, tools/runmdn/Makefile.in: Set library version
(LIB_CURRENT:LIB_REVISION:LIB_AGE) to 7:1:0.
2001-06-19
* configure.in: add missing double quotation mark (") in
AC_OUTPUT_COMMANDS.
* include/mdn/dude.h, lib/dude.c: update to conform to -02 spec.
* include/mdn/amcacev.h, lib/amcacev.c: created.
* include/mdn/amcacew.h, lib/amcacew.c: created.
* include/mdn/mace.h, lib/mace.c: created.
* include/mdn/Makefile.in, lib/Makefile.in, tools/runmdn/Makefile.in:
add above new files.
* DISTFILES: add above new files.
* lib/converter.c: add AMC-ACE-V, AMC-ACE-W and MACE.
* configure.in: add prefix configuration options (--with-*-prefix)
for these new ACEs.
* configure: rebuilt.
* include/mdn/version.h: set MDNKIT_VERSION to "2.2snap0619".
* configure.in: add `--with-iconv-include' and `--with-libiconv'
options.
* lib/Makefile.in, mdnsproxy/Makefile.in, tools/mdnconv/Makefile.in,
tools/runmnd/Makefile.in: define ICONVINC and append its value to
INCS.
2001-06-18
* mdnsproxy/logging.c: fix a bug that whether libmdn message is
logged or not is determined by `log-level', not `libmdn-log-level'.
* configure.in: also check glib-2.2 flavor of gethostbyaddr().
* configure.in, include/config.h: define GHBA_ADDR_T which is
type of 1st argument to gethostbyaddr() and gethostbyaddr_r().
* configure.in, tools/Makefile.in: if parameter type list of
gethostbyaddr() is unknown, nothing will be built in `tools/runmdn'
directory.
* tools/runmdn/resolver.c, tools/runmdn/stub.c, tools/runmdn/stub.h:
use GHBA_ADD_T as type of 1st parameter to gethostbyaddr() and
gethostbyaddr_r().
* acconfig.h: delete GETHOST_R_GLIBC_FLAVOR and GHBA_ADDRLEN_T.
2001-06-14
* mdnsproxy/logging.c: shorten a program. use vfprintf() rather
than vsprintf()+fputs().
2001-06-12
* lib/converter.c: output warning message if iconv() or iconv_open()
fails.
* lib/api.c, lib/res.c: output 256 characters maximum, when they
output a string to be translated and its result as trace message.
* lib/msgtrans.c: log a string to be translated and its result with
the priority INFO.
* lib/res.c, include/mdn/res.h: use the term `insn' rather than
`action', for the 2nd argument to mdn_res_nameconv().
2001-06-07
* include/mdn/amcacer.h, lib/amcacer.c: update to meet -01 spec.
2001-06-04
* mdnsproxy/mdnsproxy.h: define LOGMODE_STDERR.
* mdnsproxy/logging.c: output messages to standard error if the
configuration entry `log-file' is set to `stderr'.
* mdsproxy/logging.c: merge libmdn_logproc_syslog() and
libmdn_logproc_file() into libmdn_logproc().
* mdsproxy/logging.c: insert date string to log messages if
mdnsproxy logs events to regular file.
* mdnsproxy/logging.c: fix a bug that mdnsproxy doesn't turn over
a log file correctly.
* mdnsproxy/unxmain.c: do not close file descriptor 2.
* lib/resconf.c: 2nd arguemnt to the following functions can be NULL:
mdn_resconf_setalternateconverter(), mdn_resconf_setdelimitermap(),
mdn_resconf_setidnconverter(), mdn_resconf_setlocalconverter(),
mdn_resconf_setlocalmapselector(), mdn_resconf_setmapper(),
mdn_resconf_setnormalizer(), mdn_resconf_setprohibitchecker(),
mdn_resconf_setunassignedchecker().
2001-06-01
* 2.1 release.

View file

@ -1,4 +1,4 @@
# $Id: DISTFILES,v 1.1 2002/02/08 05:38:30 marka Exp $
# $Id: DISTFILES,v 1.1.2.1 2002/02/08 12:12:15 marka Exp $
README
README.ja
INSTALL

View file

@ -245,4 +245,4 @@ see an error message output by `mdnconv', `nslookup' or `mdnslookup'
itself.
; $Id: INSTALL,v 1.1 2002/02/08 05:38:30 marka Exp $
; $Id: INSTALL,v 1.1.2.1 2002/02/08 12:12:17 marka Exp $

View file

@ -250,4 +250,4 @@ configure $B%9%/%j%W%H$K(B --with-preference $B%*%W%7%g%s$r;XDj$7$J$+$C$?>l(
$B%a%C%;!<%8$,=PNO$5$l$^$9!#(B
; $Id: INSTALL.ja,v 1.1 2002/02/08 05:38:30 marka Exp $
; $Id: INSTALL.ja,v 1.1.2.1 2002/02/08 12:12:18 marka Exp $

View file

@ -1,4 +1,5 @@
Copyright (c) 2000 Japan Network Information Center. All rights reserved.
Copyright (c) 2000, 2001 Japan Network Information Center.
All rights reserved.
By using this file, you agree to the terms and conditions set forth bellow.
@ -6,8 +7,8 @@ By using this file, you agree to the terms and conditions set forth bellow.
The following License Terms and Conditions apply, unless a different
license is obtained from Japan Network Information Center ("JPNIC"),
a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
Tokyo, Japan.
a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
Chiyoda-ku, Tokyo 101-0047, Japan.
1. Use, Modification and Redistribution (including distribution of any
modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
# $Id: Makefile.in,v 1.44 2001/04/17 03:24:09 m-kasahr Exp $
# $Id: Makefile.in,v 1.1 2002/01/02 02:46:20 marka Exp $
# Copyright (c) 2000 Japan Network Information Center. All rights reserved.
#
# By using this file, you agree to the terms and conditions set forth bellow.
@ -7,8 +7,8 @@
#
# The following License Terms and Conditions apply, unless a different
# license is obtained from Japan Network Information Center ("JPNIC"),
# a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
# Tokyo, Japan.
# a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
# Chiyoda-ku, Tokyo 101-0047, Japan.
#
# 1. Use, Modification and Redistribution (including distribution of any
# modified or derived work) in source and/or binary forms is permitted
@ -67,18 +67,20 @@ SHELL = @SHELL@
SUBDIRS = include lib mdnsproxy man tools map
all:
all: force
for d in $(SUBDIRS); do (cd $$d; $(MAKE) all); done
install:
install: force
for d in $(SUBDIRS); do (cd $$d; $(MAKE) install); done
clean:
clean: force
for d in $(SUBDIRS); do (cd $$d; $(MAKE) clean); done
dist:
dist: force
@v=`sed -ne '/^# *define *MDNKIT_VERSION/s/^.*"\([^"]*\)".*$$/\1/p' \
$(srcdir)/include/mdn/version.h`; \
echo generate mdnkit-$$v-src.tar.gz; \
cd $(srcdir); \
$(PERL) $(MKTARPKG) --gzip=9 mdnkit-$$v-src
force:

View file

@ -1,13 +1,70 @@
; $Id: NEWS,v 1.22 2001/06/01 01:20:39 ishisone Exp $
; $Id: NEWS,v 1.1 2002/01/02 02:46:20 marka Exp $
Major changes in version 2.2.3:
* BIND-9 patch for BIND-9.2.0 is available.
* NAMEPREP draft -06 is supported.
* Problems on Tru64 are fixed.
Major changes in version 2.2.2:
* Now runmdn can work on NetBSD-1.5 or later.
Major changes in version 2.2.1:
* Fix a bug that the MDN library misses prohibited characters.
Major changes in version 2.2:
* Alternate encoding is no longer supported.
mDNkit now follows IDNA-03 which says in the section 2.1.2 that An
IDNA-aware application MUST NOT do any preparation or conversion to
ACE on any non-internationalized name part. `alternate-encoding'
entry in configuration file is simply ignored.
* The MDN library (libmdn) performs NAMEPREP check at decoding an ACE
name. If the name is not NAMEPREPed, libmdn returns a name with ACE
encoding instead of local encoding.
* Supported ACEs are now AMC-ACE-Z, RACE and DUDE only.
Since the IDN working group has chosen AMC-ACE-Z, most of other ACEs
are no longer supported by default. If you wanted to use those
ACEs, specify `--enable-extra-ace' option of configure.
* mdnsproxy can output log messages to standard error.
* mdnsproxy adds date and time string to a message logged to a regular
file.
* `--with-iconv-include', `--with-libiconv' and `--enable-debug'
options are added to `configure'.
* `--with-libiconv' option is also added to `configure' in BIND-9 patch.
* A build problem on Linux with glibc-2.2 is fixed.
* The base version of BIND-9 patch is now 9.1.3.
* Supported NAMEPREP drafts are -03 and -05.
-02 and -04 are not supported.
* `-e' option is added to runmdn to set local encoding.
* `dig', `host' and `nslookup' of BIND-9 with MDN support patch
recognize the MDN_DISABLE environment variable. Those commands turn
off MDN support if the variable is defined.
Major changes in version 2.1:
* BIND-9 patch is back. The patch adds encoding conversion and
NAMEPREP capability to `dig', `host' and `nslookup'.
Since version 2 adopts IDNA, in which all the MDN processing are
performed in the application layer before calling the resolver
layer, patch to the BIND-9's light-weight resolver found in version
1.x are removed.
Since mDNkit version 2 adopts IDNA, in which all the MDN processing
are performed in the application layer before calling the resolver
layer, the patch no longer contains modification of the light-weight
resolver or `allow-utf8' extension of `named' configuration syntax
found in mDNkit version 1.x.
* Runmdn is back. The strategy for making resolver MDN-aware has been
changed from replacing low-level resolver functions to wrapping

View file

@ -1,11 +1,23 @@
mDNkit
-- multilingual domain name toolkit --
version 2.1
version 2.2.3
Japan Network Information Center (JPNIC)
* Overview
Table of contents of this file:
1. Overview
2. Directory structure of this distribution
3. Applying patches
4. Supported systems
5. Contact information
See the file INSTALL for compilation and installation instructions.
See the file NEWS for a list of major changes in the current release.
1. Overview
mDNkit is a toolkit for handling multilingualized/internationalized
domain names. To handle such names, the following features are required:
@ -147,13 +159,16 @@ using above components.
|application| +---------+---------+ +----------+
+-----------+
* Directory structure of this distribution
2. Directory structure of this distribution
Below is a directory structure of this distribution with some
important files and their brief description.
+README this file
+README.ja .. in Japanese
+INSTALL compilation and installation instructions.
+INSTALL.ja .. in Japanese
+DISTFILES list of files in this distribution
+NEWS what's new in this version
+ChangeLog list of changes
@ -176,168 +191,9 @@ important files and their brief description.
+wsock/ source directory for mDN wrapper
* Compilation and installation
3. Applying patches
0. Prerequisite
If your system's library does not have iconv() function, which is a
general codeset conversion utility, install it as an external library.
You also need external library if the system's implementation cannot
handle UTF-8 encoding, or it doesn't support some encodings which your
client applications uses.
You can get a free version of iconv() implementation (under LGPL
license), from:
http://clisp.cons.org/~haible/packages-libiconv.html
*Note*
The current version of the above implementation (libiconv-1.6.1) is
known to have a compilation problem on NetBSD 1.5. There is a patch
file for the bug under patch/libiconv directory. If you are a
NetBSD 1.5 user and found a problem in compiling libiconv, apply the
patch and try again. The patch file contains brief instructions on
how to apply it at the beginning.
1. Running configure script
Run `configure' script in the top directory. This checks various
characteristics of your system and it will create Makefiles and
config.h appropriate for your system.
% ./configure
`configure' accepts many options. Here is a list of some important
options.
--with-iconv=LIB
If your libc doesn't contain iconv(), specify the library
that contains iconv(). For example, if iconv() is libiconv
in /usr/local/lib, you should specify:
--with-iconv="-L/usr/local/lib -liconv"
Note that if the library is a shared one, you might also want to
specify -R option, like:
--with-iconv="-L/usr/local/lib -R/usr/local/lib -liconv"
If the header file "iconv.h" has installed in a non-standard
directory like /usr/local/include, you should specify CFLAGS
environment variable. See below.
--with-iconv-sofile=PATH
``runmdn'' command in this kit needs to know the pathname of
shared library file that contains iconv(), if iconv() is not
part of libc. mDNkit tries to find out the pathname from the
informaiton provided by ``--with-iconv'' option described
above. But when it fails, you have to specify it with this
option, like:
--with-iconv-sofile=/usr/local/lib/libiconv.so.2.0
--with-utf8=NAME
If your iconv() (precisely, iconv_open()) does not accept
"UTF-8" as the name of UTF-8 encoding, specify the name for
it. For example if your iconv() uses "utf8" instead, you
should specify:
--with-utf8=utf8
--with-preference=PREFERENCE
This option sets the preference for the sample mDNkit
configuration file (mdn.conf.sample). Also this option
enables to install default configuration file (mdn.conf)
if the file didn't exist.
The only preference supported by this version is "jp".
--with-race-prefix=PREFIX
--with-brace-suffix=SUFFIX
--with-lace-prefix=PREFIX
--with-dude-prefix=PREFIX
RACE (Row-based ASCII-Compatible Encoding), BRACE (Bi-mode
Row-based ASCII-Compatible Encoding), LACE (Length-based ASCII
Compatible Encoding) and DUDE (Differential Unicode Domain
Encoding) are proposed encodings for multilingual domain name
in DNS protocol data. They uses a fixed prefix (or suffix)
string to distinguish names encoded by them from normal ASCII
domain names. These prefix/suffix are defined by the current
Internet Drafts and mDNkit uses them by default, but later
version of the drafts may change them. In that case you can
specify the prefix/suffix with these options.
--with-altdude-prefix=PREFIX
--with-altdude-suffix=SUFFIX
--with-amc-ace-m-prefix=PREFIX
--with-amc-ace-m-suffix=SUFFIX
--with-amc-ace-o-prefix=PREFIX
--with-amc-ace-o-suffix=SUFFIX
--with-amc-ace-r-prefix=PREFIX
AltDUDE, AMC-ACE-M, AMC-ACE-O and AMC-ACE-R are also proposed
encodings for multilingual domain names. Unlike encodings
mentioned above, the Internet Drafts for these do not define
specific prefixes nor suffixes. mDNkit provides default for
them, but you can override them with these options.
You can specify either prefix or suffix for AltDUDE, AMC-ACE-M
and AMC-ACE-O. In case both are specified, prefix is
preferred.
--sbindir=DIR
Specifies the install directory for mdnsproxy. Default is
/usr/local/sbin.
--bindir=DIR
Specifies the install directory for mdnconv and runmdn.
Default is /usr/local/bin.
--sysconfdir=DIR
Specifies the install directory for sample files of mdnsproxy
configuration and mDNkit's resolver configuration. Default is
/usr/local/etc.
--mandir=DIR
Specifies the base install directory for online manuals.
Default is /usr/local/man.
`configure' has many more options. To see the list of available
options, you should run it with --help option.
% ./configure --help
If you want to specify extra compiler options, like adding non-standard
directory to include file search path, use environment variable CFLAGS.
% CFLAGS="-I/usr/local/include -O2" ./configure ... (for sh)
% setenv CFLAGS "-I/usr/local/include -g"; ./configure ... (for csh)
2. Compiling
Run `make' for compilation.
% make
3. Installation
Run `make install' to install binaries and manuals. Don't forget to
become a super-user before the installation.
% su
# make install
4. Configuration and usage
Please consult online manuals for configuration and usage of `mdnsproxy'
`mdnconv', and `runmdn'. Also for `mdnconv' and `runmdn', please refer
the manual of mDNkit's resolver configuration file `mdn.conf'.
% man mdnsproxy
% man mdnconv
% man mdn.conf
* Applying patches
This distribution also contains patches for BIND 9.1.1, BIND 8.2.3 and
This distribution also contains patches for BIND 9.1.3, BIND 8.2.3 and
Squid 2.4.STABLE1. The top of these patch files describe how to apply
the patch and (re)install.
@ -347,13 +203,60 @@ version of the command (http://www.gnu.org/software/patch/) and use
it.
* Contact information
4. Supported systems
Please see http://www.nic.ad.jp/jp/research/idn/ for the latest news
about this kit.
We've had successful builds on the following systems:
-------------------------------------------------------------------
OS iconv library configure options
===================================================================
FreeBSD 4.4-RELEASE GNU libiconv --with-libiconv
for Intel 1.6.1
-------------------------------------------------------------------
FreeBSD 3.5.1-RELEASE GNU libiconv --with-libiconv
for Intel 1.7
-------------------------------------------------------------------
NetBSD 1.5.2 GNU libiconv --with-libiconv
for Intel 1.7
-------------------------------------------------------------------
Red Hat Linux 7.1 standard library none
for Intel (glibc)
-------------------------------------------------------------------
Red Hat Linux 7.0 standard library none
for Intel (glibc)
-------------------------------------------------------------------
Debian/GNU Linux 2.2r3 standard library none
for Intel (glibc)
-------------------------------------------------------------------
Solaris 2.6 standard library none
for Sparc (libc)
-------------------------------------------------------------------
Windows2000 GNU libiconv --with-libiconv
(cygwin-1.3.2) *1 1.7
-------------------------------------------------------------------
*1: Only mdnconv can work on that system.
The latest information about supported/unsupported systems will be
found at the mDNkit FAQ page linked from:
http://www.nic.ad.jp/jp/research/idn/
5. Contact information
Please see
http://www.nic.ad.jp/jp/research/idn/
for the latest news about this kit.
Bug reports and comments on this kit should be sent to
mdnkit-bugs@nic.ad.jp and idn-cmt@nic.ad.jp, respectively.
mdnkit-bugs@nic.ad.jp
and
idn-cmt@nic.ad.jp
respectively.
; $Id: README,v 1.29 2001/06/01 01:13:46 ishisone Exp $
; $Id: README,v 1.1 2002/01/02 02:46:21 marka Exp $

View file

@ -1,11 +1,24 @@
mDNkit
-- 多言語ドメイン名ツールキット --
バージョン 2.1
バージョン 2.2.3
(社) 日本ネットワークインフォメーションセンター (JPNIC)
* 概要
このファイルの目次:
1. 概要
2. ディレクトリ構成
3. パッチの当て方
4. 本キットが対応しているシステム
5. 本キットに関する最新情報、問い合わせについて
コンパイルおよびインストール方法については、INSTALL.ja というファイルを
ご覧下さい。このバージョンでの主な変更点に付いては、(英文ですが) NEWS
というファイルをご覧下さい。
1. 概要
mDNkit とは多言語ドメイン名を扱うためのツールキットです。多言語ドメイ
ン名を扱うためには、次のような機能が要求されます。
@ -140,12 +153,14 @@ mDNkit
+----------------+ +---------+------------+ +------+
* ディレクトリ構成
2. ディレクトリ構成
配布キットのディレクトリ構成と、主要なファイルを示します。
README 英語版の README
README.ja このファイル
INSTALL 英語版の INSTALL
INSTALL.ja コンパイルとインストール方法
DISTFILES 配布されるファイル一覧
NEWS 主な変更
ChangeLog 変更詳細
@ -168,173 +183,9 @@ mDNkit
wsock/ mDN ラッパーソース
* コンパイルおよびインストール
4. パッチの当て方
0. 前準備
もしあなたの使用しているシステムのライブラリに iconv() がない場合、あ
るいはあっても UTF-8 を扱うことができない場合にはあらかじめ iconv() を
インストールしておいてください。iconv() の実装は、例えば LGPL のものが
http://clisp.cons.org/~haible/packages-libiconv.html
から入手可能です。
*注意*
上記実装の最新版 (libiconv-1.6.1) は NetBSD 1.5 との組合わせで問題が
あり、コンパイル時にエラーが発生します。このバグを修正するためのパッ
チが patch/libiconv ディレクトリの下に用意されていますので、この問題
に遭遇した場合にはパッチを当ててから再インストールしてください。なお、
パッチの当て方はパッチファイルの先頭に書かれています。
1. configure スクリプトの実行
トップディレクトリにある configure スクリプトを実行してください。
% ./configure
configure スクリプトにはいくつかのオプションを指定することができます。
mdn に直接関係するものは次の通りです。
--with-iconv=LIB
libc に iconv が入っていない場合 (上記のパッケージを入れた
場合など) に、iconv のライブラリを指定します。例えば
--with-iconv="-L/usr/local/lib -liconv"
のように指定します。もし iconv が共有ライブラリになっている
場合には、-R オプションも指定して
--with-iconv="-L/usr/local/lib -R/usr/local/lib -liconv"
とする必要があるかもしれません。
--with-iconv-sofile=PATH
mDNkit に含まれている runmdn コマンドは、iconv() が libc の一
部として提供されないときに、iconv() を含む共有ライブラリへのパ
ス名を知る必要があります。mDNkit は、--with-iconv オプションの
記述を基にパス名を検索しますが、これに失敗したときに、以下のよ
うに共有ライブラリを指定することができます。
--with-iconv-sofile=/usr/local/lib/libiconvv.so.2.0
--with-utf8=NAME
iconv に utf-8 エンコーディングを指定する場合、本ライブラリは
デフォルトでは "UTF-8" という名前を指定します。もしあなたの
システムの iconv が "UTF-8" という名前を受け付けない場合には、
代りの名前を指定します。例えば "UTF-8" ではなく "utf8" の
場合には次のように指定します。
--with-utf8=utf8
--with-preference=PREFERENCE
mDNkit のサンプルコンフィギュレーションファイル (mdn.conf.sample)
の設定を PREFERENCE 向けのものにします。またこのオプションを指定
するとデフォルトのコンフィギュレーションファイル (mdn.conf) が
インストールされます。ただしファイルがすでに存在している場合には
インストールしません。
現在のところ、指定できる PREFERENCE は "jp" のみです。
--with-race-prefix=PREFIX
--with-brace-suffix=SUFFIX
--with-lace-prefix=PREFIX
--with-dude-prefix=PREFIX
RACE (Row-based ASCII-Compatible Encoding)、BRACE (Bi-mode
Row-based ASCII-Compatible Encoding)、 LACE (Length-based
ASCII Compatible Encoding) および DUDE (Differential Unicode
Domain Encoding) はいずれも DNS プロトコル上で使用される多言語
ドメイン名に関して提案されているエンコーディング方式です。通常
の ASCII ドメイン名とこれらによってエンコードされたドメイン名
を区別するために、固定の接頭辞 (BRACE の場合には接尾辞) が用い
られます。
mDNkit では現在のインターネットドラフトで定義されている接頭辞
あるいは接尾辞を使用するようになっていますが、今後のドラフトで
変わるかもしれません。そこで、これらのオプションを用いて指定で
きるようになっています。
--with-altdude-prefix=PREFIX
--with-altdude-suffix=SUFFIX
--with-amc-ace-m-prefix=PREFIX
--with-amc-ace-m-suffix=SUFFIX
--with-amc-ace-o-prefix=PREFIX
--with-amc-ace-o-suffix=SUFFIX
--with-amc-ace-r-prefix=PREFIX
AltDUDE、AMC-ACE-M、AMC-ACE-O および AMC-ACE-R も RACE などと
同様に多言語ドメインのエンコーディングとして提案されているもの
です。ただしこれらのエンコーディングは RACE など上にあげたもの
と異なり、インターネットドラフトでは特定の接頭辞、接尾辞が定義
されていません。mDNkit ではデフォルトの接頭辞/接尾辞を設定して
ありますが、ここにあげたオプションを使用すれば別のものに変更す
ることが可能です。
AltDUDE、AMC-ACE-M および AMC-ACE-O については、接頭辞、接尾辞
のどちらを指定することも可能です。もし接頭辞と接尾辞の両方が指
定された場合には、接頭辞の指定が優先されます。
--sbindir=DIR
DNS プロキシサーバをインストールするディレクトリを指定します。
デフォルトでは /usr/local/sbin です。
--bindir=DIR
コードセットコンバータ mdnconv をインストールするディレクトリを
指定します。デフォルトでは /usr/local/bin です。
--sysconfdir=DIR
DNS プロキシサーバの設定ファイルをインストールするディレクトリを
指定します。デフォルトでは /usr/local/etc です。
--mandir=DIR
オンラインマニュアルのインストールディレクトリを指定します。
デフォルトでは /usr/local/man です。
--with-iconv オプションではライブラリだけを指定します。もしインクルー
ドファイル iconv.h がデフォルトのインクルードファイルのパスにインストー
ルされていない場合、あるいは他に C コンパイラへのオプションを指定した
い場合には環境変数 CFLAGS を使用してください。例えば
% CFLAGS=-I/usr/local/include ./configure ...
(sh 系のシェルの場合)
% setenv CFLAGS -I/usr/local/include; ./configure ...
(csh 系のシェルの場合)
とします。
configure には他にも多くのオプションがありますが、残りは一般的なオプショ
ンなので説明は省きます。
% ./configure --help
を実行するとオプションの一覧が表示されます。
2. コンパイル
configure を実行すると Makefile などが生成されますので、続けて makeを
実行してコンパイルします。
% make
3. インストール
スーパユーザになってインストールします。
% su
# make install
4. Configuration and usage
インストールされるツール (mdnsproxy、mdnconv、runmdn) の使い方、設定方
法に関してはオンラインマニュアルをご覧ください。mdnconv と runmdn につ
いては、mDNkit のリゾルバ設定ファイル mdn.conf のマニュアルも参照して
ください。
% man mdnsproxy
% man mdnconv
% man runmdn
% man mdn.conf
* パッチの当て方
この配布キットには、bind-9.1.1、bind-8.2.3 および squid-2.4-STABLE1 に
この配布キットには、bind-9.1.3、bind-8.2.3 および squid-2.4-STABLE1 に
対するパッチが含まれています。パッチの当て方は、パッチファイルの先頭に
書かれていますのでそちらを参照してください。
@ -344,13 +195,60 @@ Solaris
てください。
* 本キットに関する最新情報、問い合わせについて
5. 本キットが対応しているシステム
正常にインストールできることが確認できているのは、次のシステムです。
------------------------------------------------------------------
OS iconv configure のオプション
==================================================================
FreeBSD 4.4-RELEASE GNU libiconv --with-libiconv
Intel 1.6.1
-------------------------------------------------------------------
FreeBSD 3.5.1-RELEASE GNU libiconv --with-libiconv
Intel 1.7
-------------------------------------------------------------------
NetBSD 1.5.2 GNU libiconv --with-libiconv
Intel 1.7
------------------------------------------------------------------
Red Hat Linux 7.1 標準ライブラリ なし
Intel (glibc)
------------------------------------------------------------------
Red Hat Linux 7.0 標準ライブラリ なし
Intel (glibc)
-------------------------------------------------------------------
Debian/GNU Linux 2.2r3 標準ライブラリ なし
Intel (glibc)
------------------------------------------------------------------
Solaris 2.6 標準ライブラリ なし
Sparc (libc)
------------------------------------------------------------------
Windows 2000 GNU libiconv --with-libiconv
(cygwin-1.3.2) *1 1.7
-------------------------------------------------------------------
*1: 動作するのは mdnconv だけです。
本キットが対応している/していないシステムに関する最新の情報は、次のと
ころから辿れる mDNkit FAQ のページに記されています。
http://www.nic.ad.jp/jp/research/idn/
6. 本キットに関する最新情報、問い合わせについて
本キットに関する最新情報については、
http://www.nic.ad.jp/jp/research/idn/ を参照してください
http://www.nic.ad.jp/jp/research/idn/
を参照してください
本キットに関するバグレポートおよびコメントは、それぞれ
mdnkit-bugs@nic.ad.jp および idn-cmt@nic.ad.jp へお願いします。
mdnkit-bugs@nic.ad.jp
および
idn-cmt@nic.ad.jp
へお願いします。
; $Id: README.ja,v 1.29 2001/06/01 01:13:46 ishisone Exp $
; $Id: README.ja,v 1.1 2002/01/02 02:46:21 marka Exp $

View file

@ -1,4 +1,4 @@
/* $Id: acconfig.h,v 1.8 2001/04/18 02:07:32 ishisone Exp $ */
/* $Id: acconfig.h,v 1.1 2002/01/02 02:46:21 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -61,12 +61,6 @@
/* Define as an appropriate type (ex. int) if your system doesn't have. */
#undef BOOL
/* Define if the prototype of gethost*_r is glibc flavor. */
#undef GETHOST_R_GLIBC_FLAVOR
/* Define as the type of the 2nd argument of gethostbyaddr. */
#undef GHBA_ADDRLEN_T
@BOTTOM@
/* Define as the pathname of the shared libc object if your system has one. */
#undef SOPATH_LIBC

View file

@ -1,5 +1,5 @@
##
## $Id: aclocal.m4,v 1.5 2001/04/19 07:20:51 ishisone Exp $
## $Id: aclocal.m4,v 1.1 2002/01/02 02:46:21 marka Exp $
##
dnl
dnl AC_ACE_PREFIX(ace-name, default)

View file

@ -1,8 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
#
timestamp='2001-09-04'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@ -30,40 +32,97 @@
# exits with 0. Otherwise, it exits with 1.
#
# The plan is that this can be called by configure scripts if you
# don't specify an explicit system type (host/target name).
#
# Only a few systems have been added to this list; please add others
# (but try to keep the structure clean).
#
# don't specify an explicit build system type.
# Use $HOST_CC if defined. $CC may point to a cross-compiler
if test x"$CC_FOR_BUILD" = x; then
if test x"$HOST_CC" != x; then
CC_FOR_BUILD="$HOST_CC"
else
if test x"$CC" != x; then
CC_FOR_BUILD="$CC"
else
CC_FOR_BUILD=cc
fi
fi
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;;
--version | -v )
echo "$version" ; exit 0 ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help" >&2
exit 1 ;;
* )
break ;;
esac
done
if test $# != 0; then
echo "$me: too many arguments$help" >&2
exit 1
fi
dummy=dummy-$$
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int dummy(){}" > $dummy.c ;
for c in cc gcc c89 ; do
($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
if test $? = 0 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
rm -f $dummy.c $dummy.o $dummy.rel ;
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ;
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 8/24/94.)
# (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
dummy=dummy-$$
trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@ -77,7 +136,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# object file format.
# Determine the machine/vendor (is the vendor relevant).
case "${UNAME_MACHINE}" in
amiga) machine=m68k-cbm ;;
amiga) machine=m68k-unknown ;;
arm32) machine=arm-unknown ;;
atari*) machine=m68k-atari ;;
sun3*) machine=m68k-sun ;;
@ -87,16 +146,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
ibmrt|romp-ibm) machine=romp-ibm ;;
*) machine=${UNAME_MACHINE}-unknown ;;
esac
# The Operating System including object format.
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep __ELF__ >/dev/null
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
# The Operating System including object format, if it has switched
# to ELF recently, or will in the future.
case "${UNAME_MACHINE}" in
i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep __ELF__ >/dev/null
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
;;
*)
os=netbsd
;;
esac
# The OS release
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
@ -137,6 +205,7 @@ main:
jsr \$26,exit
.end main
EOF
eval $set_cc_for_build
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
case `./$dummy` in
@ -158,6 +227,9 @@ EOF
2-307)
UNAME_MACHINE="alphaev67"
;;
2-1307)
UNAME_MACHINE="alphaev68"
;;
esac
fi
rm -f $dummy.s $dummy
@ -173,7 +245,7 @@ EOF
echo alpha-dec-winnt3.5
exit 0 ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-cbm-sysv4
echo m68k-unknown-sysv4
exit 0;;
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
@ -205,7 +277,7 @@ EOF
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
SR2?01:HI-UX/MPP:*:*)
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
@ -261,6 +333,9 @@ EOF
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;;
sparc*:NetBSD:*)
echo `uname -p`-unknown-netbsd${UNAME_RELEASE}
exit 0 ;;
atari*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
@ -318,6 +393,7 @@ EOF
echo clipper-intergraph-clix${UNAME_RELEASE}
exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
@ -341,10 +417,13 @@ EOF
EOF
$CC_FOR_BUILD $dummy.c -o $dummy \
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& rm $dummy.c $dummy && exit 0
&& rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit 0 ;;
@ -392,11 +471,20 @@ EOF
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i?86:AIX:*:*)
i*86:AIX:*:*)
echo i386-ibm-aix
exit 0 ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <sys/systemcfg.h>
@ -408,7 +496,7 @@ EOF
exit(0);
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
@ -417,9 +505,9 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit 0 ;;
*:AIX:*:4)
*:AIX:*:[45])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
@ -427,7 +515,7 @@ EOF
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=4.${UNAME_RELEASE}
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit 0 ;;
@ -453,10 +541,29 @@ EOF
echo m68k-hp-bsd4.4
exit 0 ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
case "${HPUX_REV}" in
11.[0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
esac ;;
esac
fi ;;
esac
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
@ -490,13 +597,19 @@ EOF
exit (0);
}
EOF
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
rm -f $dummy.c $dummy
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
rm -f $dummy.c $dummy
fi ;;
esac
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <unistd.h>
int
@ -522,7 +635,7 @@ EOF
exit (0);
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
@ -532,7 +645,7 @@ EOF
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
*9??*:MPE/iX:*:*)
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit 0 ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
@ -541,7 +654,7 @@ EOF
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit 0 ;;
i?86:OSF1:*:*)
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
@ -576,37 +689,39 @@ EOF
echo xmp-cray-unicos
exit 0 ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE}
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*T3E:*:*:*)
CRAY*T3D:*:*:*)
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY-2:*:*:*)
echo cray2-cray-unicos
exit 0 ;;
F300:UNIX_System_V:*:*)
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
F301:UNIX_System_V:*:*)
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
sparc*:BSD/OS:*:*)
@ -627,6 +742,9 @@ EOF
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit 0 ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit 0 ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@ -645,187 +763,96 @@ EOF
*:GNU:*:*)
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
*:Linux:*:*)
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit 0 ;;
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux
exit 0 ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
mips:Linux:*:*)
case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
big) echo mips-unknown-linux-gnu && exit 0 ;;
little) echo mipsel-unknown-linux-gnu && exit 0 ;;
esac
;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
exit 0 ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-gnu
exit 0 ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit 0 ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-gnu ;;
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
exit 0 ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu
exit 0 ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit 0 ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit 0 ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
ld_help_string=`cd /; ld --help 2>&1`
ld_supported_emulations=`echo $ld_help_string \
| sed -ne '/supported emulations:/!d
ld_supported_targets=`cd /; ld --help 2>&1 \
| sed -ne '/supported targets:/!d
s/[ ][ ]*/ /g
s/.*supported emulations: *//
s/.*supported targets: *//
s/ .*//
p'`
case "$ld_supported_emulations" in
*ia64)
echo "${UNAME_MACHINE}-unknown-linux"
exit 0
case "$ld_supported_targets" in
elf32-i386)
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
;;
i?86linux)
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit 0
;;
elf_i?86)
echo "${UNAME_MACHINE}-pc-linux"
exit 0
;;
i?86coff)
exit 0 ;;
coff-i386)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0
;;
sparclinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
armlinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
elf32arm*)
echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
exit 0
;;
armelf_linux*)
echo "${UNAME_MACHINE}-unknown-linux-gnu"
exit 0
;;
m68klinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
elf32ppc | elf32ppclinux)
# Determine Lib Version
cat >$dummy.c <<EOF
#include <features.h>
#if defined(__GLIBC__)
extern char __libc_version[];
extern char __libc_release[];
#endif
main(argc, argv)
int argc;
char *argv[];
{
#if defined(__GLIBC__)
printf("%s %s\n", __libc_version, __libc_release);
#else
printf("unkown\n");
#endif
return 0;
}
EOF
LIBC=""
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
if test "$?" = 0 ; then
./$dummy | grep 1\.99 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
rm -f $dummy.c $dummy
echo powerpc-unknown-linux-gnu${LIBC}
exit 0
;;
exit 0 ;;
"")
# Either a pre-BFD a.out linker (linux-gnuoldld) or
# one that does not give us useful --help.
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
exit 0 ;;
esac
if test "${UNAME_MACHINE}" = "alpha" ; then
cat <<EOF >$dummy.s
.data
\$Lformat:
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
.text
.globl main
.align 4
.ent main
main:
.frame \$30,16,\$26,0
ldgp \$29,0(\$27)
.prologue 1
.long 0x47e03d80 # implver \$0
lda \$2,-1
.long 0x47e20c21 # amask \$2,\$1
lda \$16,\$Lformat
mov \$0,\$17
not \$1,\$18
jsr \$26,printf
ldgp \$29,0(\$26)
mov 0,\$16
jsr \$26,exit
.end main
EOF
LIBC=""
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
case `./$dummy` in
0-0)
UNAME_MACHINE="alpha"
;;
1-0)
UNAME_MACHINE="alphaev5"
;;
1-1)
UNAME_MACHINE="alphaev56"
;;
1-101)
UNAME_MACHINE="alphapca56"
;;
2-303)
UNAME_MACHINE="alphaev6"
;;
2-307)
UNAME_MACHINE="alphaev67"
;;
esac
objdump --private-headers $dummy | \
grep ld.so.1 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
elif test "${UNAME_MACHINE}" = "mips" ; then
cat >$dummy.c <<EOF
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#ifdef __MIPSEB__
printf ("%s-unknown-linux-gnu\n", argv[1]);
#endif
#ifdef __MIPSEL__
printf ("%sel-unknown-linux-gnu\n", argv[1]);
#endif
return 0;
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
elif test "${UNAME_MACHINE}" = "s390"; then
echo s390-ibm-linux && exit 0
else
# Either a pre-BFD a.out linker (linux-gnuoldld)
# or one that does not give us useful --help.
# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
# If ld does not provide *any* "supported emulations:"
# that means it is gnuoldld.
echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
case "${UNAME_MACHINE}" in
i?86)
VENDOR=pc;
;;
*)
VENDOR=unknown;
;;
esac
# Determine whether the default compiler is a.out or elf
cat >$dummy.c <<EOF
# Determine whether the default compiler is a.out or elf
eval $set_cc_for_build
cat >$dummy.c <<EOF
#include <features.h>
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
@ -836,28 +863,30 @@ EOF
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
printf ("%s-pc-linux-gnu\n", argv[1]);
# else
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
printf ("%s-pc-linux-gnulibc1\n", argv[1]);
# endif
# else
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
printf ("%s-pc-linux-gnulibc1\n", argv[1]);
# endif
#else
printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
printf ("%s-pc-linux-gnuaout\n", argv[1]);
#endif
return 0;
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
fi ;;
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
# are messed up and put the nodename in both sysname and nodename.
i?86:DYNIX/ptx:4*:*)
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
exit 0 ;;
i?86:UNIX_SV:4.2MP:2.*)
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
@ -865,7 +894,7 @@ EOF
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;;
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
@ -873,16 +902,15 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
exit 0 ;;
i?86:*:5:7*)
# Fixed at (any) Pentium or better
UNAME_MACHINE=i586
if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
fi
i*86:*:5:[78]*)
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
exit 0 ;;
i?86:*:3.2:*)
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
@ -900,7 +928,7 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
i?86:*DOS:*:*)
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit 0 ;;
pc:*:*:*)
@ -928,7 +956,7 @@ EOF
exit 0 ;;
M68*:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@ -939,21 +967,24 @@ EOF
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4 && exit 0 ;;
m68*:LynxOS:2.*:*)
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;;
@ -971,8 +1002,8 @@ EOF
echo ns32k-sni-sysv
fi
exit 0 ;;
PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
exit 0 ;;
*:UNIX_System_V:4*:FTX*)
@ -984,10 +1015,14 @@ EOF
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit 0 ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
exit 0 ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;;
news*:NEWS-OS:*:6*)
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit 0 ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
@ -1030,20 +1065,64 @@ EOF
*:QNX:*:4*)
echo i386-pc-qnx
exit 0 ;;
NSR-W:NONSTOP_KERNEL:*:*)
NSR-[KW]:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
exit 0 ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
exit 0 ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
exit 0 ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
if test "$cputype" = "386"; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit 0 ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit 0 ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit 0 ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
exit 0 ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
exit 0 ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
exit 0 ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
exit 0 ;;
*:ITS:*:*)
echo pdp10-unknown-its
exit 0 ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
exit 0 ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
eval $set_cc_for_build
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
@ -1130,11 +1209,24 @@ main ()
#endif
#if defined (vax)
#if !defined (ultrix)
printf ("vax-dec-bsd\n"); exit (0);
#else
printf ("vax-dec-ultrix\n"); exit (0);
#endif
# if !defined (ultrix)
# include <sys/param.h>
# if defined (BSD)
# if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
# else
# if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# endif
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# else
printf ("vax-dec-ultrix\n"); exit (0);
# endif
#endif
#if defined (alliant) && defined (i860)
@ -1145,7 +1237,7 @@ main ()
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
# Apollos put the system type in the environment.
@ -1178,6 +1270,48 @@ then
esac
fi
#echo '(Unable to guess system type)' 1>&2
cat >&2 <<EOF
$0: unable to guess system type
This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
ftp://ftp.gnu.org/pub/gnu/config/
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
config.guess timestamp = $timestamp
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
hostinfo = `(hostinfo) 2>/dev/null`
/bin/universe = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
UNAME_MACHINE = ${UNAME_MACHINE}
UNAME_RELEASE = ${UNAME_RELEASE}
UNAME_SYSTEM = ${UNAME_SYSTEM}
UNAME_VERSION = ${UNAME_VERSION}
EOF
exit 1
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:

View file

@ -1,8 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script, version 1.1.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
#
timestamp='2001-09-07'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
@ -27,7 +29,6 @@
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Written by Per Bothner <bothner@cygnus.com>.
# Please send patches to <config-patches@gnu.org>.
#
# Configuration subroutine to validate and canonicalize a configuration type.
@ -50,30 +51,73 @@
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
if [ x$1 = x ]
then
echo Configuration name missing. 1>&2
echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
echo "or $0 ALIAS" 1>&2
echo where ALIAS is a recognized configuration type. 1>&2
exit 1
fi
me=`echo "$0" | sed -e 's,.*/,,'`
# First pass through any local machine types.
case $1 in
*local*)
echo $1
exit 0
;;
*)
;;
usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS
$0 [OPTION] ALIAS
Canonicalize a configuration name.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;;
--version | -v )
echo "$version" ; exit 0 ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help"
exit 1 ;;
*local*)
# First pass through any local machine types.
echo $1
exit 0;;
* )
break ;;
esac
done
case $# in
0) echo "$me: missing argument$help" >&2
exit 1;;
1) ;;
*) echo "$me: too many arguments$help" >&2
exit 1;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu*)
nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@ -99,7 +143,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple)
-apple | -axis)
os=
basic_machine=$1
;;
@ -113,6 +157,14 @@ case $os in
os=-vxworks
basic_machine=$1
;;
-chorusos*)
os=-chorusos
basic_machine=$1
;;
-chorusrdb)
os=-chorusrdb
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
@ -171,30 +223,50 @@ esac
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
| 580 | i960 | h8300 \
| x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
| hppa64 \
| alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
| alphaev6[78] \
| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
| 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
| mips64vr5000 | miprs64vr5000el | mcore \
| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
| thumb | d10v | fr30 | avr)
1750a | 580 \
| a29k \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
| c4x | clipper \
| d10v | d30v | dsp16xx \
| fr30 \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| m32r | m68000 | m68k | m88k | mcore \
| mips16 | mips64 | mips64el | mips64orion | mips64orionel \
| mips64vr4100 | mips64vr4100el | mips64vr4300 \
| mips64vr4300el | mips64vr5000 | mips64vr5000el \
| mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
| mipsisa32 \
| mn10200 | mn10300 \
| ns16k | ns32k \
| openrisc \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| s390 | s390x \
| sh | sh[34] | sh[34]eb | shbe | shle \
| sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \
| stormy16 | strongarm \
| tahoe | thumb | tic80 | tron \
| v850 \
| we32k \
| x86 | xscale \
| z8k)
basic_machine=$basic_machine-unknown
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl)
m6811 | m68hc11 | m6812 | m68hc12)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
os=-none
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i[34567]86)
i*86 | x86_64)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
@ -203,28 +275,43 @@ case $basic_machine in
exit 1
;;
# Recognize the basic CPU types with company name.
# FIXME: clean up the formatting here.
vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
| xmp-* | ymp-* \
| x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
| hppa2.0n-* | hppa64-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
| alphaev6[78]-* \
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
| clipper-* | orion-* \
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
| sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
| mipstx39-* | mipstx39el-* | mcore-* \
| f301-* | armv*-* | s390-* | sv1-* | t3e-* \
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
| thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \
| bs2000-*)
580-* \
| a29k-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alphapca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armv*-* \
| bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c54x-* \
| clipper-* | cray2-* | cydra-* \
| d10v-* | d30v-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| m32r-* \
| m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | mcore-* \
| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
| mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
| s390-* | s390x-* \
| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \
| sparc-* | sparc64-* | sparc86x-* | sparclite-* \
| sparcv9-* | sparcv9b-* | stormy16-* | strongarm-* | sv1-* \
| t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
| v850-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \
| ymp-* \
| z8k-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
@ -261,14 +348,14 @@ case $basic_machine in
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-cbm
basic_machine=m68k-unknown
;;
amigaos | amigados)
basic_machine=m68k-cbm
basic_machine=m68k-unknown
os=-amigaos
;;
amigaunix | amix)
basic_machine=m68k-cbm
basic_machine=m68k-unknown
os=-sysv4
;;
apollo68)
@ -315,13 +402,16 @@ case $basic_machine in
basic_machine=cray2-cray
os=-unicos
;;
[ctj]90-cray)
basic_machine=c90-cray
[cjt]90)
basic_machine=${basic_machine}-cray
os=-unicos
;;
crds | unos)
basic_machine=m68k-crds
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
@ -369,6 +459,10 @@ case $basic_machine in
basic_machine=tron-gmicro
os=-sysv
;;
go32)
basic_machine=i386-pc
os=-go32
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
@ -444,19 +538,19 @@ case $basic_machine in
basic_machine=i370-ibm
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i[34567]86v32)
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
i[34567]86v4*)
i*86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
i[34567]86v)
i*86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
i[34567]86sol2)
i*86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
@ -468,14 +562,6 @@ case $basic_machine in
basic_machine=i386-unknown
os=-vsta
;;
i386-go32 | go32)
basic_machine=i386-unknown
os=-go32
;;
i386-mingw32 | mingw32)
basic_machine=i386-unknown
os=-mingw32
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
@ -501,6 +587,10 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
mingw32)
basic_machine=i386-pc
os=-mingw32
;;
miniframe)
basic_machine=m68000-convergent
;;
@ -531,7 +621,7 @@ case $basic_machine in
os=-coff
;;
msdos)
basic_machine=i386-unknown
basic_machine=i386-pc
os=-msdos
;;
mvs)
@ -595,6 +685,10 @@ case $basic_machine in
basic_machine=i960-intel
os=-mon960
;;
nonstopux)
basic_machine=mips-compaq
os=-nonstopux
;;
np1)
basic_machine=np1-gould
;;
@ -630,28 +724,28 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5 | k5 | k6 | nexen)
pentium | p5 | k5 | k6 | nexgen)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86)
pentiumpro | p6 | 6x86 | athlon)
basic_machine=i686-pc
;;
pentiumii | pentium2)
basic_machine=i786-pc
basic_machine=i686-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexen-*)
pentium-* | p5-* | k5-* | k6-* | nexgen-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-*)
pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=rs6000-ibm
power) basic_machine=power-ibm
;;
ppc) basic_machine=powerpc-unknown
;;
@ -663,9 +757,23 @@ case $basic_machine in
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64) basic_machine=powerpc64-unknown
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
;;
pw32)
basic_machine=i586-unknown
os=-pw32
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
@ -757,6 +865,10 @@ case $basic_machine in
basic_machine=t3e-cray
os=-unicos
;;
tic54x | c54x*)
basic_machine=tic54x-unknown
os=-coff
;;
tx39)
basic_machine=mipstx39-unknown
;;
@ -809,6 +921,10 @@ case $basic_machine in
basic_machine=hppa1.1-winbond
os=-proelf
;;
windows32)
basic_machine=i386-pc
os=-windows32-msvcrt
;;
xmp)
basic_machine=xmp-cray
os=-unicos
@ -852,13 +968,20 @@ case $basic_machine in
vax)
basic_machine=vax-dec
;;
pdp10)
# there are many clones, so DEC is not a safe bet
basic_machine=pdp10-unknown
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sparc | sparcv9)
sh3 | sh4 | sh3eb | sh4eb)
basic_machine=sh-unknown
;;
sparc | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
cydra)
@ -880,6 +1003,9 @@ case $basic_machine in
basic_machine=c4x-none
os=-coff
;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
@ -936,15 +1062,18 @@ case $os in
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit*)
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
case $basic_machine in
x86-* | i[34567]86-*)
x86-* | i*86-*)
;;
*)
os=-nto$os
@ -1000,7 +1129,7 @@ case $os in
-ns2 )
os=-nextstep2
;;
-nsk)
-nsk*)
os=-nsk
;;
# Preserve the version number of sinix5.
@ -1037,7 +1166,7 @@ case $os in
-xenix)
os=-xenix
;;
-*mint | -*MiNT)
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
-none)
@ -1071,6 +1200,9 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
pdp10-*)
os=-tops20
;;
pdp11-*)
os=-none
;;
@ -1179,7 +1311,7 @@ case $basic_machine in
*-masscomp)
os=-rtu
;;
f301-fujitsu)
f30[01]-fujitsu | f700-fujitsu)
os=-uxpv
;;
*-rom68k)
@ -1257,12 +1389,23 @@ case $basic_machine in
-mpw* | -macos*)
vendor=apple
;;
-*mint | -*MiNT)
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari
;;
-vos*)
vendor=stratus
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
dnl $Id: configure.in,v 1.47 2001/05/18 04:02:29 ishisone Exp $
dnl $Id: configure.in,v 1.1 2002/01/02 02:46:23 marka Exp $
dnl Process this file with autoconf to produce a configure script.
dnl
dnl Copyright (c) 2000 Japan Network Information Center. All rights reserved.
@ -9,8 +9,8 @@ dnl LICENSE TERMS AND CONDITIONS
dnl
dnl The following License Terms and Conditions apply, unless a different
dnl license is obtained from Japan Network Information Center ("JPNIC"),
dnl a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
dnl Tokyo, Japan.
dnl a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
dnl Chiyoda-ku, Tokyo 101-0047, Japan.
dnl
dnl 1. Use, Modification and Redistribution (including distribution of any
dnl modified or derived work) in source and/or binary forms is permitted
@ -61,6 +61,16 @@ AC_INIT(include/mdn/converter.h)
AC_CANONICAL_HOST
debug=no
AC_ARG_ENABLE(debug,
[ --enable-debug enable debug codes [default=no]],
debug=$enableval)
case "$enableval" in
yes)
CFLAGS="$CFLAGS -DDEBUG"
;;
esac
logdir=no
AC_ARG_WITH(logdir,
[ --with-logdir=DIR mdnsproxy's log files are in DIR.
@ -98,6 +108,7 @@ AC_ARG_WITH(utf8,
utf8name=$withval)
case "$utf8name" in
no)
utf8name=UTF-8
;;
yes)
AC_MSG_ERROR([You must specify NAME to --with-utf8 option.])
@ -117,12 +128,76 @@ AC_ACE_SIGNATURE(AltDUDE, [a---], [])
AC_ACE_SIGNATURE(AMC-ACE-M, [], [-amc1])
AC_ACE_SIGNATURE(AMC-ACE-O, [], [-amc2])
AC_ACE_PREFIX(AMC-ACE-R, [amc3-])
AC_ACE_PREFIX(AMC-ACE-V, [amc4-])
AC_ACE_PREFIX(AMC-ACE-W, [amc5-])
AC_ACE_PREFIX(AMC-ACE-Z, [zq--])
AC_ACE_PREFIX(MACE, [mq--])
iconv=no
ICONVINC=
ICONVLIB=
libiconv=unspec
AC_ARG_WITH(libiconv,
[ --with-libiconv=IPREFIX GNU libiconv are installed in IPREFIX [PREFIX]],
libiconv=$withval)
case "$libiconv" in
unspec)
;;
no)
ICONVINC=
ICONVLIB=
;;
yes)
if test X$prefix = XNONE ; then
libiconv=$ac_default_prefix
else
libiconv=$prefix
fi
ICONVINC="-I$libiconv/include"
ICONVLIB="-L$libiconv/lib -R$libiconv/lib -liconv"
;;
*)
ICONVINC="-I$libiconv/include"
ICONVLIB="-L$libiconv/lib -R$libiconv/lib -liconv"
;;
esac
iconv_include=unspec
AC_ARG_WITH(iconv-include,
[ --with-iconv-include=DIR iconv include files are in DIR []],
iconv_include=$withval)
case "$iconv_include" in
unspec)
;;
no)
ICONVINC=
;;
yes)
AC_MSG_WARN([You must supply DIR to --with-iconv-include option.
Ignored.])
ICONVINC=
;;
*)
ICONVINC="-I$iconv_include"
;;
esac
if test "X$ICONVINC" != X ; then
iconv_include="`echo X$ICONVINC | sed -e 's/^X-I//'`"
if test ! -f "$iconv_include/iconv.h" ; then
AC_MSG_ERROR([iconv.h doesn't exist in $iconv_include])
fi
fi
AC_SUBST(ICONVINC)
iconv=unspec
AC_ARG_WITH(iconv,
[ --with-iconv=LIB special library for iconv []],
iconv=$withval)
case "$iconv" in
unspec)
;;
no)
ICONVLIB=
;;
@ -138,7 +213,7 @@ esac
AC_SUBST(ICONVLIB)
AC_ARG_WITH(iconv-sofile,
[ --with-iconv-sofile=PATH shared library file for libiconv []],
[ --with-iconv-sofile=PATH shared library file for libiconv []],
iconv_file=$withval, iconv_file=guess)
ICONVSOFILE=
case "$iconv_file" in
@ -242,7 +317,17 @@ case "$host" in
PRELOAD_VAR="_RLD_LIST"
PRELOAD_LAST=":DEFAULT"
;;
*-netbsd*)
if test -x /usr/bin/file -a -x /usr/bin/grep ; then
case "`/usr/bin/file /usr/bin/grep`" in
*ELF*)
PRELOAD_SEP=" "
;;
esac
fi
;;
esac
AC_SUBST(PRELOAD_VAR)
AC_SUBST(PRELOAD_SEP)
AC_SUBST(PRELOAD_LAST)
@ -257,6 +342,11 @@ AC_CHECK_HEADERS(unistd.h locale.h langinfo.h resolv.h)
AC_CHECK_HEADERS(sys/select.h arpa/nameser.h)
AC_CHECK_HEADERS(dlfcn.h)
saved_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $ICONVINC"
AC_CHECK_HEADER(iconv.h, , [AC_MSG_ERROR([iconv.h doesn't exist])])
CPPFLAGS=$saved_CPPFLAGS
dnl Checks for data types.
AC_TYPE_UID_T
dnl for dnsproxy.
@ -268,7 +358,7 @@ AC_CHECK_LIB(nsl, inet_addr)
AC_CHECK_LIB(dl, dlopen, [
LIBS="-ldl $LIBS"
LIBDL="-ldl"
AC_DEFINE(HAVE_LIBDL, 1)
AC_DEFINE(HAVE_LIBDL, 1, [Define if you have the dl library (-ldl).])
AC_SUBST(LIBDL)
])
@ -282,9 +372,27 @@ AC_CHECK_FUNCS(dlopen dlsym)
dnl Checks the flavor of gethostbyaddr* functions.
AC_CACHE_CHECK(flavor of gethostbyaddr, ac_cv_flavor_gethostbyaddr,
[AC_TRY_RUN(
[ac_cv_flavor_gethostbyaddr=unknown
AC_TRY_RUN(
[
#include <stddef.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type) {
return NULL;
}
int main() {
(void)gethostbyaddr(NULL, 0, 0);
return 0;
}
], ac_cv_flavor_gethostbyaddr=glibc2_2,,
ac_cv_flavor_gethostbyaddr=unknown)
AC_TRY_RUN(
[
#include <stddef.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
struct hostent *gethostbyaddr(const char *addr, size_t len, int type) {
return NULL;
@ -293,15 +401,169 @@ int main() {
(void)gethostbyaddr(NULL, 0, 0);
return 0;
}
],
ac_cv_flavor_gethostbyaddr=standard,
ac_cv_flavor_gethostbyaddr=traditional,
ac_cv_flavor_gethostbyaddr=traditional)])
if test "$ac_cv_flavor_gethostbyaddr" = "standard"; then
AC_DEFINE(GHBA_ADDRLEN_T, size_t)
else
AC_DEFINE(GHBA_ADDRLEN_T, int)
], ac_cv_flavor_gethostbyaddr=glibc,,
ac_cv_flavor_gethostbyaddr=unknown)
AC_TRY_RUN(
[
#include <stddef.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
struct hostent *gethostbyaddr(const char *addr, int len, int type) {
return NULL;
}
int main() {
(void)gethostbyaddr(NULL, 0, 0);
return 0;
}
], ac_cv_flavor_gethostbyaddr=traditional,,
ac_cv_flavor_gethostbyaddr=unknown)
if test "$ac_cv_func_gethostbyaddr" = no ; then
ac_cv_flavor_gethostbyaddr=none
fi])
case "$ac_cv_flavor_gethostbyaddr" in
glibc2_2)
ac_cv_type_ghba_addr_t='const void *'
ac_cv_type_ghba_addrlen_t='socklen_t'
;;
glibc)
ac_cv_type_ghba_addr_t='const char *'
ac_cv_type_ghba_addrlen_t='size_t'
;;
traditional | none)
ac_cv_type_ghba_addr_t='const char *'
ac_cv_type_ghba_addrlen_t='int'
;;
*)
AC_MSG_WARN([runmdn command will not be built.])
;;
esac
AC_DEFINE_UNQUOTED(GHBA_ADDR_T, $ac_cv_type_ghba_addr_t,
[Define as the type of the 1st argument of gethostbyaddr.])
AC_DEFINE_UNQUOTED(GHBA_ADDRLEN_T, $ac_cv_type_ghba_addrlen_t,
[Define as the type of the 2nd argument of gethostbyaddr.])
dnl Checks the flavor of getnameinfo functions.
AC_CACHE_CHECK(flavor of getnameinfo, ac_cv_flavor_getnameinfo,
[ac_cv_flavor_getnameinfo=unknown
AC_TRY_RUN(
[
#include <stddef.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
int getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host,
socklen_t hostlen, char *serv, socklen_t servlen,
unsigned int flags) {
return NULL;
}
int main() {
(void)getnameinfo(NULL, 0, NULL, 0, NULL, 0, 0);
return 0;
}
], ac_cv_flavor_getnameinfo=glibc2_2_2,,
ac_cv_flavor_getnameinfo=unknown)
AC_TRY_RUN(
[
#include <stddef.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
int getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host,
socklen_t hostlen, char *serv, socklen_t servlen, int flags) {
return NULL;
}
int main() {
(void)getnameinfo(NULL, 0, NULL, 0, NULL, 0, 0);
return 0;
}
], ac_cv_flavor_getnameinfo=rfc2553bis_03,,
ac_cv_flavor_getnameinfo=unknown)
AC_TRY_RUN(
[
#include <stddef.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
int getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host,
size_t hostlen, char *serv, size_t servlen, int flags) {
return NULL;
}
int main() {
(void)getnameinfo(NULL, 0, NULL, 0, NULL, 0, 0);
return 0;
}
], ac_cv_flavor_getnameinfo=rfc2553,,
ac_cv_flavor_getnameinfo=unknown)
AC_TRY_RUN(
[
#include <stddef.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
int getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
size_t hostlen, char *serv, size_t servlen, int flags) {
return NULL;
}
int main() {
(void)getnameinfo(NULL, 0, NULL, 0, NULL, 0, 0);
return 0;
}
], ac_cv_flavor_getnameinfo=rfc2133,,
ac_cv_flavor_getnameinfo=unknown)
if test "$ac_cv_func_getnameinfo" = no ; then
ac_cv_flavor_getnameinfo=none
fi])
case "$ac_cv_flavor_getnameinfo" in
glibc2_2_2)
ac_cv_type_gni_salen_t='socklen_t'
ac_cv_type_gni_hostlen_t='socklen_t'
ac_cv_type_gni_servlen_t='socklen_t'
ac_cv_type_gni_flags_t='unsigned int'
;;
rfc2553bis_03)
ac_cv_type_gni_salen_t='socklen_t'
ac_cv_type_gni_hostlen_t='socklen_t'
ac_cv_type_gni_servlen_t='socklen_t'
ac_cv_type_gni_flags_t='int'
;;
rfc2553)
ac_cv_type_gni_salen_t='socklen_t'
ac_cv_type_gni_hostlen_t='size_t'
ac_cv_type_gni_servlen_t='size_t'
ac_cv_type_gni_flags_t='int'
;;
rfc2133 | none)
ac_cv_type_gni_salen_t='size_t'
ac_cv_type_gni_hostlen_t='size_t'
ac_cv_type_gni_servlen_t='size_t'
ac_cv_type_gni_flags_t='int'
;;
*)
AC_MSG_WARN([runmdn command will not be built.])
;;
esac
AC_SUBST(RUNMDN_SUBDIR)
AC_DEFINE_UNQUOTED(GNI_SALEN_T, $ac_cv_type_gni_salen_t,
[Define as the type of the 2nd argument of getnameinfo.])
AC_DEFINE_UNQUOTED(GNI_HOSTLEN_T, $ac_cv_type_gni_hostlen_t,
[Define as the type of the 4th argument of getnameinfo.])
AC_DEFINE_UNQUOTED(GNI_SERVLEN_T, $ac_cv_type_gni_servlen_t,
[Define as the type of the 6th argument of getnameinfo.])
AC_DEFINE_UNQUOTED(GNI_FLAGS_T, $ac_cv_type_gni_flags_t,
[Define as the type of the 7th argument of getnameinfo.])
dnl Check whether building runmdn or not.
RUNMDN_SUBDIR=runmdn
if test "$ac_cv_flavor_gethostbyaddr" = unknown ; then
RUNMDN_SUBDIR=
fi
if test "$ac_cv_flavor_getnameinfo" = unknown ; then
RUNMDN_SUBDIR=
fi
AC_SUBST(RUNMDN_SUBDIR)
dnl Checks the flavor of gethost*_r functions.
if test "$find_gethost_r" = yes; then
@ -309,8 +571,11 @@ if test "$find_gethost_r" = yes; then
[AC_TRY_RUN(
changequote(<<, >>)dnl
<<
#include <stdio.h>
#include <stddef.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>
int main()
{
int err = 0;
@ -329,7 +594,8 @@ changequote([, ])dnl
ac_cv_flavor_gethost_r=sun,
ac_cv_flavor_gethost_r=sun)])
if test "$ac_cv_flavor_gethost_r" = "glibc"; then
AC_DEFINE(GETHOST_R_GLIBC_FLAVOR)
AC_DEFINE(GETHOST_R_GLIBC_FLAVOR, 1,
[Define if the prototype of gethost*_r is glibc flavor.])
fi
fi
@ -339,7 +605,9 @@ AC_FIND_SYSTEM_SHOBJ(libnsl)
dnl Checks for iconv library.
AC_MSG_CHECKING(for iconv)
saved_CPPFLAGS=$CPPFLAGS
saved_LIBS=$LIBS
CPPFLAGS="$CPPFLAGS $ICONVINC"
LIBS="$LIBS $ICONVLIB"
AC_TRY_LINK([
#include <iconv.h>
@ -348,11 +616,47 @@ AC_TRY_LINK([
i = iconv_open("ISO-8859-1", "UTF-8");
], [iconv_try_link=yes], [iconv_try_link=no])
LIBS=$saved_LIBS
CPPFLAGS=$saved_CPPFLAGS
AC_MSG_RESULT($iconv_try_link)
if test "$iconv_try_link" = no ; then
AC_MSG_ERROR(iconv function not available)
fi
dnl Check for codeset name for UTF-8.
AC_MSG_CHECKING([for codeset name $utf8name])
saved_CPPFLAGS=$CPPFLAGS
saved_LIBS=$LIBS
CPPFLAGS="$CPPFLAGS $ICONVINC"
LIBS="$LIBS $ICONVLIB"
AC_TRY_RUN([
#include <stddef.h>
#include <stdlib.h>
#include <iconv.h>
#define UTF8_NAME "$utf8name"
#define ICONV_FAIL ((iconv_t)(-1))
/* Check if the codeset name UTF8_NAME is valid by performing iconv_open(). */
int main() {
int i;
/* list of codeset names likely to exist */
static char *codeset[] = {
"ASCII", "ISO-8859-1", "ISO8859-1", "iso8859_1", "8859-1",
"Shift_JIS", "SJIS", "sjis", NULL,
};
/* First try null conversion. */
if (iconv_open(UTF8_NAME, UTF8_NAME) != ICONV_FAIL) return 0;
/* Unfortunately, above check fails on certain systems, such as Solaris. */
for (i = 0; codeset[i] != NULL; i++) {
if (iconv_open(UTF8_NAME, codeset[i]) != ICONV_FAIL) return 0;
}
return 1;
}
], utf8_name_valid=yes, utf8_name_valid=no, utf8_name_valid=unknown)
LIBS=$saved_LIBS
CPPFLAGS=$saved_CPPFLAGS
AC_MSG_RESULT($utf8_name_valid)
dnl Output.
AC_CONFIG_HEADER(include/config.h)
AC_OUTPUT(
@ -368,3 +672,21 @@ AC_OUTPUT(
tools/runmdn/runmdn
map/Makefile
)
AC_OUTPUT_COMMANDS([
if test "$ac_cv_flavor_gethostbyaddr" = unknown ; then
echo
echo "NOTICE: runmdn command will not be built, since parameter type"
echo " list of gethostbyaddr() is unknown to configure."
fi
if test "$ac_cv_flavor_getnameinfo" = unknown ; then
echo
echo "NOTICE: runmdn command will not be built, since parameter type"
echo " list of getnameinfo() is unknown to configure."
fi
if test "$utf8_name_valid" = no ; then
echo
echo "WARNING: It seems that iconv does not accept codeset name $utf8name,"
echo " which is supposed to refer to UTF-8 encoding."
echo " Please make sure it is indeed correct."
fi
])

View file

@ -1,4 +1,4 @@
# $Id: Makefile.in,v 1.2 2001/03/28 02:12:35 m-kasahr Exp $
# $Id: Makefile.in,v 1.1 2002/01/02 02:46:25 marka Exp $
# Copyright (c) 2000 Japan Network Information Center. All rights reserved.
#
# By using this file, you agree to the terms and conditions set forth bellow.
@ -7,8 +7,8 @@
#
# The following License Terms and Conditions apply, unless a different
# license is obtained from Japan Network Information Center ("JPNIC"),
# a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
# Tokyo, Japan.
# a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
# Chiyoda-ku, Tokyo 101-0047, Japan.
#
# 1. Use, Modification and Redistribution (including distribution of any
# modified or derived work) in source and/or binary forms is permitted

View file

@ -1,5 +1,5 @@
/* include/config.h.in. Generated automatically from configure.in by autoheader. */
/* $Id: config.h.in,v 1.30 2001/04/25 06:26:18 m-kasahr Exp $ */
/* $Id: config.h.in,v 1.1 2002/01/02 02:46:25 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -9,8 +9,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -70,12 +70,6 @@
/* Define as an appropriate type (ex. int) if your system doesn't have. */
#undef BOOL
/* Define if the prototype of gethost*_r is glibc flavor. */
#undef GETHOST_R_GLIBC_FLAVOR
/* Define as the type of the 2nd argument of gethostbyaddr. */
#undef GHBA_ADDRLEN_T
/* Define if you have the bcopy function. */
#undef HAVE_BCOPY
@ -160,9 +154,6 @@
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you have the dl library (-ldl). */
#undef HAVE_LIBDL
/* Define if you have the nsl library (-lnsl). */
#undef HAVE_LIBNSL
@ -211,6 +202,42 @@
/* Define if the prefix of AMC-ACE-R encoding differs from 'amc3-'. */
#undef MDN_AMCACER_PREFIX
/* Define if the prefix of AMC-ACE-V encoding differs from 'amc4-'. */
#undef MDN_AMCACEV_PREFIX
/* Define if the prefix of AMC-ACE-W encoding differs from 'amc5-'. */
#undef MDN_AMCACEW_PREFIX
/* Define if the prefix of AMC-ACE-Z encoding differs from 'zq--'. */
#undef MDN_AMCACEZ_PREFIX
/* Define if the prefix of MACE encoding differs from 'mq--'. */
#undef MDN_MACE_PREFIX
/* Define if you have the dl library (-ldl). */
#undef HAVE_LIBDL
/* Define as the type of the 1st argument of gethostbyaddr. */
#undef GHBA_ADDR_T
/* Define as the type of the 2nd argument of gethostbyaddr. */
#undef GHBA_ADDRLEN_T
/* Define as the type of the 2nd argument of getnameinfo. */
#undef GNI_SALEN_T
/* Define as the type of the 4th argument of getnameinfo. */
#undef GNI_HOSTLEN_T
/* Define as the type of the 6th argument of getnameinfo. */
#undef GNI_SERVLEN_T
/* Define as the type of the 7th argument of getnameinfo. */
#undef GNI_FLAGS_T
/* Define if the prototype of gethost*_r is glibc flavor. */
#undef GETHOST_R_GLIBC_FLAVOR
/* Define as the pathname of the shared libc object if your system has one. */
#undef SOPATH_LIBC

View file

@ -1,4 +1,4 @@
/* $Id: config.h.win,v 1.3 2000/08/07 08:20:40 ishisone Exp $ */
/* $Id: config.h.win,v 1.1 2002/01/02 02:46:26 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
# $Id: Makefile.in,v 1.21 2001/04/16 06:20:25 m-kasahr Exp $
# $Id: Makefile.in,v 1.1 2002/01/02 02:46:26 marka Exp $
# Copyright (c) 2000 Japan Network Information Center. All rights reserved.
#
# By using this file, you agree to the terms and conditions set forth bellow.
@ -7,8 +7,8 @@
#
# The following License Terms and Conditions apply, unless a different
# license is obtained from Japan Network Information Center ("JPNIC"),
# a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
# Tokyo, Japan.
# a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
# Chiyoda-ku, Tokyo 101-0047, Japan.
#
# 1. Use, Modification and Redistribution (including distribution of any
# modified or derived work) in source and/or binary forms is permitted
@ -76,6 +76,9 @@ HDRS = \
amcacem.h \
amcaceo.h \
amcacer.h \
amcacev.h \
amcacew.h \
amcacez.h \
api.h \
assert.h \
brace.h \
@ -91,6 +94,7 @@ HDRS = \
localencoding.h \
log.h \
logmacro.h \
mace.h \
mapper.h \
mapselector.h \
msgheader.h \

View file

@ -1,4 +1,4 @@
/* $Id: ace.h,v 1.1 2001/06/09 00:29:55 tale Exp $ */
/* $Id: ace.h,v 1.1.2.1 2002/02/08 12:12:41 marka Exp $ */
/*
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: altdude.h,v 1.1 2001/06/09 00:29:55 tale Exp $ */
/* $Id: altdude.h,v 1.1.2.1 2002/02/08 12:12:42 marka Exp $ */
/*
* Copyright (c) 2000,2001 Japan Network Information Center.
* All rights reserved.
@ -9,8 +9,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: amcacem.h,v 1.1 2001/06/09 00:29:55 tale Exp $ */
/* $Id: amcacem.h,v 1.1.2.1 2002/02/08 12:12:43 marka Exp $ */
/*
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: amcaceo.h,v 1.1 2001/06/09 00:29:55 tale Exp $ */
/* $Id: amcaceo.h,v 1.1.2.1 2002/02/08 12:12:44 marka Exp $ */
/*
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: amcacer.h,v 1.1 2001/06/09 00:29:55 tale Exp $ */
/* $Id: amcacer.h,v 1.1.2.1 2002/02/08 12:12:46 marka Exp $ */
/*
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -63,8 +63,8 @@
/*
* AMC-ACE-R Converter.
*
* See Internet Draft draft-ietf-idn-amc-ace-r-00.txt (but not yet
* published at the time of this writing) for details.
* See Internet Draft draft-ietf-idn-amc-ace-r-01.txt for details.
* Note that -01 has some imcompatible changes over -00 spec.
*/
#include <mdn/result.h>

View file

@ -1,4 +1,4 @@
/* $Id: amcacev.h,v 1.1 2002/02/08 05:38:59 marka Exp $ */
/* $Id: amcacev.h,v 1.1.2.1 2002/02/08 12:12:47 marka Exp $ */
/*
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
*

View file

@ -1,4 +1,4 @@
/* $Id: amcacew.h,v 1.1 2002/02/08 05:39:00 marka Exp $ */
/* $Id: amcacew.h,v 1.1.2.1 2002/02/08 12:12:48 marka Exp $ */
/*
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
*

View file

@ -1,4 +1,4 @@
/* $Id: amcacez.h,v 1.1 2002/02/08 05:39:00 marka Exp $ */
/* $Id: amcacez.h,v 1.1.2.1 2002/02/08 12:12:49 marka Exp $ */
/*
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
*

View file

@ -1,4 +1,4 @@
/* $Id: api.h,v 1.1 2001/06/09 00:29:55 tale Exp $ */
/* $Id: api.h,v 1.1.2.1 2002/02/08 12:12:51 marka Exp $ */
/*
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -83,7 +83,7 @@
*/
#define MDN_ENCODE_APP \
(MDN_LOCALCONV|MDN_DELIMMAP|MDN_LOCALMAP|MDN_NAMEPREP|MDN_IDNCONV)
#define MDN_DECODE_APP (MDN_IDNCONV|MDN_LOCALCONV)
#define MDN_DECODE_APP (MDN_IDNCONV|MDN_NAMEPREP|MDN_LOCALCONV)
/*
* Initialize the whole library, and load configuration from the default
@ -175,7 +175,10 @@ mdn_encodename(int actions, const char *from, char *to, size_t tolen);
* a bitwise-or of the following flags:
*
* MDN_IDNCONV -- perform IDN encoding to UTF-8 conversion (step 1)
* MDN_LOCALCONV -- perform UTF-8 to local encoding conversion (step 2)
* MDN_NAMEPREP -- perform NAMEPREP for verification (step 2)
* MDN_UNASCHECK -- perform optional unassigned codepoint check for
* verification (also step 2)
* MDN_LOCALCONV -- perform UTF-8 to local encoding conversion (step 3)
*
* Note that if no flags are specified, 'mdn_decodename' does nothing
* but copying the given name verbatim.
@ -215,6 +218,8 @@ mdn_decodename(int actions, const char *from, char *to, size_t tolen);
mdn_decodename(MDN_IDNCONV, from, to, tolen)
#define mdn_utf8tolocal(from, to, tolen) \
mdn_decodename(MDN_LOCALCONV, from, to, tolen)
#define mdn_nameprepcheck(from, to, tolen) \
mdn_decodename(MDN_NAMEPREP, from, to, tolen)
#define mdn_localtoidn(from, to, tolen) \
mdn_encodename(MDN_ENCODE_APP, from, to, tolen)

View file

@ -1,4 +1,4 @@
/* $Id: assert.h,v 1.5 2000/07/04 03:52:31 ishisone Exp $ */
/* $Id: assert.h,v 1.1 2002/01/02 02:46:29 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: brace.h,v 1.2 2001/02/26 09:32:25 m-kasahr Exp $ */
/* $Id: brace.h,v 1.1 2002/01/02 02:46:29 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: checker.h,v 1.1 2001/06/09 00:29:56 tale Exp $ */
/* $Id: checker.h,v 1.1.2.1 2002/02/08 12:12:54 marka Exp $ */
/*
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: converter.h,v 1.15 2001/02/26 09:32:25 m-kasahr Exp $ */
/* $Id: converter.h,v 1.1 2002/01/02 02:46:30 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -88,6 +88,13 @@ typedef enum {
#define MDN_CONVERTER_DELAYEDOPEN 1
#define MDN_CONVERTER_RTCHECK 2
/*
* Encoding types.
*/
#define MDN_NONACE 0
#define MDN_ACE_STRICTCASE 1
#define MDN_ACE_LOOSECASE 2
/*
* Initialize module. Must be called before any other calls of
* the functions of this module.
@ -167,13 +174,23 @@ extern char *
mdn_converter_localencoding(mdn_converter_t ctx);
/*
* Return if this local encoding is a special one that a string in this
* encoding just looks like an ordinary ASCII string.
* A few types of encoding designed specially for domain name conversion
* (such as UTF-5) fall into this category.
* Return the encoding type of this local encoding.
*
* Returns:
* 1 -- yes, it is special.
* MDN_NOACE -- encoding is not ACE.
* MDN_ACE_STRICTCASE -- encoding is ACE.
* decoder of this ACE preserve letter case.
* MDN_ACE_LOOSECASE -- encoding type is ACE.
* decoder cannot preserve letter case.
*/
extern int
mdn_converter_encodingtype(mdn_converter_t ctx);
/*
* Return if this local encoding is ACE (Ascii Compatible Encoding).
*
* Returns:
* 1 -- yes, it is ACE.
* 0 -- no.
*/
extern int
@ -229,8 +246,7 @@ typedef mdn_result_t (*mdn_converter_convertproc_t)(mdn_converter_t ctx,
/*
* Register a new converter.
* 'ascii_compatible' is a boolean flag indicating this encoding is
* an `ascii-compatible encoding'.
* 'encoding_type' is a value which mdn_converter_encodingtype() returns.
*
* Returns:
* mdn_success -- ok.
@ -241,6 +257,6 @@ mdn_converter_register(const char *name,
mdn_converter_openproc_t open,
mdn_converter_closeproc_t close,
mdn_converter_convertproc_t convert,
int ascii_compatible);
int encoding_type);
#endif /* MDN_CONVERTER_H */

View file

@ -1,4 +1,4 @@
/* $Id: debug.h,v 1.7 2000/07/04 03:52:32 ishisone Exp $ */
/* $Id: debug.h,v 1.1 2002/01/02 02:46:30 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: delimitermap.h,v 1.1 2001/06/09 00:29:58 tale Exp $ */
/* $Id: delimitermap.h,v 1.1.2.1 2002/02/08 12:12:58 marka Exp $ */
/*
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: dn.h,v 1.7 2000/08/02 02:06:40 ishisone Exp $ */
/* $Id: dn.h,v 1.1 2002/01/02 02:46:30 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: dude.h,v 1.1 2001/06/09 00:29:58 tale Exp $ */
/* $Id: dude.h,v 1.1.2.1 2002/02/08 12:13:00 marka Exp $ */
/*
* Copyright (c) 2000,2001 Japan Network Information Center.
* All rights reserved.
@ -9,8 +9,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -64,9 +64,9 @@
/*
* DUDE Converter.
*
* See Internet Draft draft-ietf-idn-dude-01.txt for details. Note
* See Internet Draft draft-ietf-idn-dude-02.txt for details. Note
* that this implementation does not support the optional feature of
* DUDE, which is "case preservation". Implementing this feature
* DUDE, which is "Mixed-case annotation". Implementing this feature
* requires reimplementation of NAMEPREP process of libmdn.
*/

View file

@ -1,4 +1,4 @@
/* $Id: filechecker.h,v 1.1 2001/06/09 00:29:58 tale Exp $ */
/* $Id: filechecker.h,v 1.1.2.1 2002/02/08 12:13:01 marka Exp $ */
/*
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: filemapper.h,v 1.1 2001/06/09 00:29:58 tale Exp $ */
/* $Id: filemapper.h,v 1.1.2.1 2002/02/08 12:13:02 marka Exp $ */
/*
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: lace.h,v 1.2 2001/02/26 09:32:25 m-kasahr Exp $ */
/* $Id: lace.h,v 1.1 2002/01/02 02:46:31 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: localencoding.h,v 1.7 2000/08/02 02:06:40 ishisone Exp $ */
/* $Id: localencoding.h,v 1.1 2002/01/02 02:46:31 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: log.h,v 1.9 2000/10/16 05:00:17 ishisone Exp $ */
/* $Id: log.h,v 1.1 2002/01/02 02:46:31 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: logmacro.h,v 1.9 2000/09/20 02:47:29 ishisone Exp $ */
/* $Id: logmacro.h,v 1.1 2002/01/02 02:46:32 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -65,16 +65,16 @@
#define FATAL(x) mdn_log_fatal x
#define ERROR(x) mdn_log_error x
#define WARNING(x) mdn_log_warning x
#define INFO(x) mdn_log_info x
#define INFO(x) LOG_AT_LEVEL(mdn_log_level_info, mdn_log_info, x)
#define TRACE(x) LOG_AT_LEVEL(mdn_log_level_trace, mdn_log_trace, x)
#ifdef DEBUG
#define TRACE(x) mdn_log_trace x
#define DUMP(x) mdn_log_dump x
#define DUMP(x) LOG_AT_LEVEL(mdn_log_level_dump, mdn_log_dump, x)
#else
#define TRACE(x)
#define DUMP(x)
#endif /* DEBUG */
#define LOG_AT_LEVEL(lv, fun, x) do {if (LOGLEVEL >= (lv)) fun x; } while (0)
#define LOGLEVEL mdn_log_getlevel()
#endif /* MDN_LOGMACRO_H */

View file

@ -1,4 +1,4 @@
/* $Id: mace.h,v 1.1 2002/02/08 05:39:19 marka Exp $ */
/* $Id: mace.h,v 1.1.2.1 2002/02/08 12:13:09 marka Exp $ */
/*
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
*

View file

@ -1,4 +1,4 @@
/* $Id: mapper.h,v 1.1 2001/06/09 00:29:59 tale Exp $ */
/* $Id: mapper.h,v 1.1.2.1 2002/02/08 12:13:10 marka Exp $ */
/*
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: mapselector.h,v 1.1 2001/06/09 00:29:59 tale Exp $ */
/* $Id: mapselector.h,v 1.1.2.1 2002/02/08 12:13:11 marka Exp $ */
/*
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: msgheader.h,v 1.7 2000/08/02 02:06:40 ishisone Exp $ */
/* $Id: msgheader.h,v 1.1 2002/01/02 02:46:33 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: msgtrans.h,v 1.12 2001/02/15 01:15:25 ishisone Exp $ */
/* $Id: msgtrans.h,v 1.1 2002/01/02 02:46:33 marka Exp $ */
/*
* Copyright (c) 2000,2001 Japan Network Information Center.
* All rights reserved.
@ -9,8 +9,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: nameprep.h,v 1.1 2001/06/09 00:30:00 tale Exp $ */
/* $Id: nameprep.h,v 1.1.2.1 2002/02/08 12:13:15 marka Exp $ */
/*
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: normalizer.h,v 1.13 2001/02/23 10:36:51 m-kasahr Exp $ */
/* $Id: normalizer.h,v 1.1 2002/01/02 02:46:33 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: race.h,v 1.9 2001/02/26 09:32:25 m-kasahr Exp $ */
/* $Id: race.h,v 1.1 2002/01/02 02:46:33 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: res.h,v 1.7 2001/04/11 08:16:07 m-kasahr Exp $ */
/* $Id: res.h,v 1.1 2002/01/02 02:46:34 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -80,9 +80,9 @@
* Convert and check the string.
*
* This function converts the string `from' to `to', checks `from' or
* combination of them, using `actions'.
* combination of them, using `insn'.
*
* `actions' is a sequence of characters as follows:
* `insn' is a sequence of characters as follows:
*
* l convert the local codeset string to UTF-8.
* L convert the UTF-8 string to the local codeset.
@ -97,28 +97,33 @@
* codepoint.
* I convert the UTF-8 string to ACE.
* i convert the ACE string to UTF-8.
* a convert the alternative encoded ACE sting to UTF-8.
* A convert the UTF-8 string to alternative ACE encoding.
* !m inspect if nameprep mapping has been performed to the
* string. If hasn't, convert the string to ACE.
* !n inspect if nameprep normalizaion has been performed
* to the string. If hasn't, convert the string to ACE.
* !p search the string for nameprep prohibited character.
* If found, convert the string to ACE.
* !N equivalent to "!m!n!p".
* !u search the string for nameprep unassigned codepoint.
* If found, convert the string to ACE.
*
* Returns:
* mdn_success -- ok.
* mdn_buffer_overflow -- output buffer is too small.
* mdn_invalid_encoding -- input string has invalid byte sequence.
* mdn_invalid_name -- local encoding (codeset) name is invalid.
* mdn_invalid_action -- `actions' contains invalid action.
* mdn_invalid_action -- `insn' contains invalid action.
* mdn_invalid_nomemory -- out of memory.
* mdn_invalid_nomapping -- no mapping to output codeset.
* mdn_prohibited -- input string has a prohibited character.
* mdn_failuer -- other failure.
* mdn_failure -- other failure.
*/
extern mdn_result_t
mdn_res_nameconv(mdn_resconf_t ctx, const char *actions, const char *from,
mdn_res_nameconv(mdn_resconf_t ctx, const char *insn, const char *from,
char *to, size_t tolen);
/*
* Convert the local codeset string to UTF-8.
* equivalent to:
* mdn_res_nameconv(ctx, "l", from, to, tolen);
*/
extern mdn_result_t
mdn_res_localtoucs(mdn_resconf_t ctx, const char *from, char *to,
@ -129,8 +134,6 @@ mdn_res_localtoucs(mdn_resconf_t ctx, const char *from, char *to,
/*
* Convert the UTF-8 string to the local codeset.
* equivalent to:
* mdn_res_nameconv(ctx, "L", from, to, tolen);
*/
extern mdn_result_t
mdn_res_ucstolocal(mdn_resconf_t ctx, const char *from, char *to,
@ -141,8 +144,6 @@ mdn_res_ucstolocal(mdn_resconf_t ctx, const char *from, char *to,
/*
* Perform the nameprep mapping.
* equivalent to:
* mdn_res_nameconv(ctx, "m", from, to, tolen);
*/
extern mdn_result_t
mdn_res_map(mdn_resconf_t ctx, const char *from, char *to, size_t tolen);
@ -152,8 +153,6 @@ mdn_res_map(mdn_resconf_t ctx, const char *from, char *to, size_t tolen);
/*
* Perform nameprep normalization.
* equivalent to:
* mdn_res_nameconv(ctx, "n", from, to, tolen);
*/
extern mdn_result_t
mdn_res_normalize(mdn_resconf_t ctx, const char *from, char *to, size_t tolen);
@ -163,8 +162,6 @@ mdn_res_normalize(mdn_resconf_t ctx, const char *from, char *to, size_t tolen);
/*
* Check whether the string contains nameprep prohibited character.
* equivalent to:
* mdn_res_nameconv(ctx, "p", from, to, tolen);
*/
extern mdn_result_t
mdn_res_prohibitcheck(mdn_resconf_t ctx, const char *from, char *to,
@ -173,10 +170,28 @@ mdn_res_prohibitcheck(mdn_resconf_t ctx, const char *from, char *to,
#define mdn_res_prohibitcheck(ctx, from, to, tolen) \
mdn_res_nameconv(ctx, "p", from, to, tolen)
/*
* NAMEPREP.
*/
extern mdn_result_t
mdn_res_nameprep(mdn_resconf_t ctx, const char *from, char *to,
size_t tolen);
#define mdn_res_nameprep(ctx, from, to, tolen) \
mdn_res_nameconv(ctx, "N", from, to, tolen)
/*
* NAMEPREP check.
*/
extern mdn_result_t
mdn_res_nameprepcheck(mdn_resconf_t ctx, const char *from, char *to,
size_t tolen);
#define mdn_res_nameprepcheck(ctx, from, to, tolen) \
mdn_res_nameconv(ctx, "!N", from, to, tolen)
/*
* Check whether the string contains nameprep unassigned character.
* equivalent to:
* mdn_res_nameconv(ctx, "u", from, to, tolen);
*/
extern mdn_result_t
mdn_res_unassignedcheck(mdn_resconf_t ctx, const char *from, char *to,
@ -187,8 +202,6 @@ mdn_res_unassignedcheck(mdn_resconf_t ctx, const char *from, char *to,
/*
* Perform local delimiter mapping.
* equivalent to:
* mdn_res_nameconv(ctx, "d", from, to, tolen);
*/
extern mdn_result_t
mdn_res_delimitermap(mdn_resconf_t ctx, const char *from, char *to,
@ -199,8 +212,6 @@ mdn_res_delimitermap(mdn_resconf_t ctx, const char *from, char *to,
/*
* Perfrom TLD based local mapping.
* equivalent to:
* mdn_res_nameconv(ctx, "M", from, to, tolen);
*/
extern mdn_result_t
mdn_res_localmap(mdn_resconf_t ctx, const char *from, char *to, size_t tolen);
@ -210,8 +221,6 @@ mdn_res_localmap(mdn_resconf_t ctx, const char *from, char *to, size_t tolen);
/*
* Convert the UTF-8 string to ACE.
* equivalent to:
* mdn_res_nameconv(ctx, "I", from, to, tolen);
*/
extern mdn_result_t
mdn_res_ucstodns(mdn_resconf_t ctx, const char *from, char *to, size_t tolen);
@ -221,8 +230,6 @@ mdn_res_ucstodns(mdn_resconf_t ctx, const char *from, char *to, size_t tolen);
/*
* Convert the ACE string to UTF-8.
* equivalent to:
* mdn_res_nameconv(ctx, "i", from, to, tolen);
*/
extern mdn_result_t
mdn_res_dnstoucs(mdn_resconf_t ctx, const char *from, char *to, size_t tolen);

View file

@ -1,4 +1,4 @@
/* $Id: resconf.h,v 1.12 2001/04/16 02:25:17 m-kasahr Exp $ */
/* $Id: resconf.h,v 1.1 2002/01/02 02:46:34 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -145,88 +145,57 @@ extern char *
mdn_resconf_defaultfile(void);
/*
* Get/Set codeset converters.
*
* + for local encoding,
* + for IDN encoding,
* + for alternate encoding (which is used when the string to be converterd
* to the local encoding has some characters having no mapping to the
* local encoding)
* In case of error, NULL will be returned.
* Get an object of lower module that `ctx' holds.
*/
extern mdn_converter_t
mdn_resconf_getlocalconverter(mdn_resconf_t ctx);
extern mdn_delimitermap_t
mdn_resconf_getdelimitermap(mdn_resconf_t ctx);
extern mdn_converter_t
mdn_resconf_getidnconverter(mdn_resconf_t ctx);
extern mdn_converter_t
mdn_resconf_getalternateconverter(mdn_resconf_t ctx);
extern void
mdn_resconf_setlocalconverter(mdn_resconf_t ctx,
mdn_converter_t local_converter);
extern void
mdn_resconf_setidnconverter(mdn_resconf_t ctx,
mdn_converter_t idn_coverter);
extern void
mdn_resconf_setalternateconverter(mdn_resconf_t ctx,
mdn_converter_t alternate_converter);
/*
* Get/Set domain name normalizer.
*
* In case of error, NULL will be returned.
*/
extern mdn_normalizer_t
mdn_resconf_getnormalizer(mdn_resconf_t ctx);
extern void
mdn_resconf_setnormalizer(mdn_resconf_t ctx, mdn_normalizer_t normalizer);
/*
* Get/Set domain name mapper.
*
* + for nameprep mapping.
* + for TLD based local mapping.
* + for local delimiter mapping.
* In case of error, NULL will be returned.
*/
extern mdn_mapper_t
mdn_resconf_getmapper(mdn_resconf_t ctx);
extern mdn_delimitermap_t
mdn_resconf_getdelimitermap(mdn_resconf_t ctx);
mdn_resconf_getlocalconverter(mdn_resconf_t ctx);
extern mdn_mapselector_t
mdn_resconf_getlocalmapselector(mdn_resconf_t ctx);
extern void
mdn_resconf_setmapper(mdn_resconf_t ctx, mdn_mapper_t mapper);
extern mdn_mapper_t
mdn_resconf_getmapper(mdn_resconf_t ctx);
extern void
mdn_resconf_setdelimitermap(mdn_resconf_t ctx,
mdn_delimitermap_t delimiter_mapper);
extern mdn_normalizer_t
mdn_resconf_getnormalizer(mdn_resconf_t ctx);
extern void
mdn_resconf_setlocalmapselector(mdn_resconf_t ctx,
mdn_mapselector_t map_selector);
/*
* Get domain name checker.
*
* + for prohibited character checking.
* + for unassigned character checking.
* In case of error, NULL will be returned.
*/
extern mdn_checker_t
mdn_resconf_getprohibitchecker(mdn_resconf_t ctx);
extern mdn_checker_t
mdn_resconf_getunassignedchecker(mdn_resconf_t ctx);
/*
* Set an object of lower module to `ctx'.
*/
extern void
mdn_resconf_setdelimitermap(mdn_resconf_t ctx,
mdn_delimitermap_t delimiter_mapper);
extern void
mdn_resconf_setidnconverter(mdn_resconf_t ctx,
mdn_converter_t idn_coverter);
extern void
mdn_resconf_setlocalconverter(mdn_resconf_t ctx,
mdn_converter_t local_converter);
extern void
mdn_resconf_setlocalmapselector(mdn_resconf_t ctx,
mdn_mapselector_t map_selector);
extern void
mdn_resconf_setmapper(mdn_resconf_t ctx, mdn_mapper_t mapper);
extern void
mdn_resconf_setnormalizer(mdn_resconf_t ctx, mdn_normalizer_t normalizer);
extern void
mdn_resconf_setprohibitchecker(mdn_resconf_t ctx,
mdn_checker_t prohibit_checker);
@ -236,27 +205,18 @@ mdn_resconf_setunassignedchecker(mdn_resconf_t ctx,
mdn_checker_t unassigned_checker);
/*
* Set mapper, normalizer, prohibit checker and unassigned checker in
* the resconf context to the specified NAMEPREP version.
*/
extern mdn_result_t
mdn_resconf_setalternateconvertername(mdn_resconf_t ctx, const char *name,
int flags);
/*
* Set converter, delimitermap, mapper, mapselector, normalizer, checker
* by name.
* Set name or add names to an object of lower module that `ctx' holds.
*/
extern mdn_result_t
mdn_resconf_setidnconvertername(mdn_resconf_t ctx, const char *name,
int flags);
extern mdn_result_t
mdn_resconf_setlocalconvertername(mdn_resconf_t ctx, const char *name,
int flags);
mdn_resconf_addalldelimitermapucs(mdn_resconf_t ctx, unsigned long *v, int nv);
extern mdn_result_t
mdn_resconf_addalldelimitermapucs(mdn_resconf_t ctx, unsigned long *v, int nv);
mdn_resconf_setlocalconvertername(mdn_resconf_t ctx, const char *name,
int flags);
extern mdn_result_t
mdn_resconf_addalllocalmapselectornames(mdn_resconf_t ctx, const char *tld,
@ -281,6 +241,22 @@ mdn_resconf_addallunassignedcheckernames(mdn_resconf_t ctx, const char **names,
extern mdn_result_t
mdn_resconf_setnameprepversion(mdn_resconf_t ctx, const char *version);
/*
* These macros are provided for backward compatibility to mDNkit 2.1
* and older.
*/
extern void
mdn_resconf_setalternateconverter(mdn_resconf_t ctx,
mdn_converter_t alternate_converter);
extern mdn_result_t
mdn_resconf_setalternateconvertername(mdn_resconf_t ctx, const char *name,
int flags);
extern mdn_converter_t
mdn_resconf_getalternateconverter(mdn_resconf_t ctx);
/*
* These macros are provided for backward compatibility to mDNkit 1.x.
*/

View file

@ -1,4 +1,4 @@
/* $Id: result.h,v 1.11 2001/02/05 09:10:56 ishisone Exp $ */
/* $Id: result.h,v 1.1 2002/01/02 02:46:34 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: selectiveencode.h,v 1.8 2000/08/02 02:06:40 ishisone Exp $ */
/* $Id: selectiveencode.h,v 1.1 2002/01/02 02:46:35 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: strhash.h,v 1.9 2000/08/02 02:06:40 ishisone Exp $ */
/* $Id: strhash.h,v 1.1 2002/01/02 02:46:35 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: ucsmap.h,v 1.1 2001/06/09 00:30:06 tale Exp $ */
/* $Id: ucsmap.h,v 1.1.2.1 2002/02/08 12:13:24 marka Exp $ */
/*
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: ucsset.h,v 1.1 2001/06/09 00:30:06 tale Exp $ */
/* $Id: ucsset.h,v 1.1.2.1 2002/02/08 12:13:26 marka Exp $ */
/*
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,6 +1,7 @@
/* $Id: unicode.h,v 1.10 2001/02/13 08:26:22 ishisone Exp $ */
/* $Id: unicode.h,v 1.1 2002/01/02 02:46:35 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
* Copyright (c) 2000,2001 Japan Network Information Center.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set forth bellow.
*
@ -8,8 +9,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -72,6 +73,11 @@
#include <mdn/result.h>
/*
* A Handle for Unicode versions.
*/
typedef struct mdn__unicode_ops *mdn__unicode_version_t;
/*
* Context information for case conversion.
*/
@ -81,6 +87,26 @@ typedef enum {
mdn__unicode_context_nonfinal
} mdn__unicode_context_t;
/*
* Create a handle for a specific Unicode version.
* The version number (such as "3.0.1") is specified by 'version' parameter.
* If it is NULL, the latest version is used.
* The handle is stored in '*versionp', which is used various functions
* in this and unormalize modules.
*
* Returns:
* mdn_success -- ok.
* mdn_notfound -- specified version not found.
*/
extern mdn_result_t
mdn__unicode_create(const char *version, mdn__unicode_version_t *versionp);
/*
* Close a handle which was created by 'mdn__unicode_create'.
*/
extern void
mdn__unicode_destroy(mdn__unicode_version_t version);
/*
* Get canonical class.
*
@ -88,7 +114,7 @@ typedef enum {
* be returned.
*/
extern int
mdn__unicode_canonicalclass(unsigned long c);
mdn__unicode_canonicalclass(mdn__unicode_version_t version, unsigned long c);
/*
* Decompose a character.
@ -109,7 +135,8 @@ mdn__unicode_canonicalclass(unsigned long c);
* mdn_buffer_overflow -- 'vlen' is too small.
*/
extern mdn_result_t
mdn__unicode_decompose(int compat, unsigned long *v, size_t vlen,
mdn__unicode_decompose(mdn__unicode_version_t version,
int compat, unsigned long *v, size_t vlen,
unsigned long c, int *decomp_lenp);
/*
@ -126,7 +153,8 @@ mdn__unicode_decompose(int compat, unsigned long *v, size_t vlen,
* mdn_notfound -- no composition possible.
*/
extern mdn_result_t
mdn__unicode_compose(unsigned long c1, unsigned long c2, unsigned long *compp);
mdn__unicode_compose(mdn__unicode_version_t version,
unsigned long c1, unsigned long c2, unsigned long *compp);
/*
* Returns if there may be a canonical composition sequence which starts
@ -138,7 +166,8 @@ mdn__unicode_compose(unsigned long c1, unsigned long c2, unsigned long *compp);
* 0 -- no, there is definitely no such sequences.
*/
extern int
mdn__unicode_iscompositecandidate(unsigned long c);
mdn__unicode_iscompositecandidate(mdn__unicode_version_t version,
unsigned long c);
/*
* Translate lowercase character to uppercase, and vice versa, according
@ -166,10 +195,12 @@ mdn__unicode_iscompositecandidate(unsigned long c);
* mdn_buffer_overflow -- 'vlen' is too small.
*/
extern mdn_result_t
mdn__unicode_toupper(unsigned long c, mdn__unicode_context_t ctx,
mdn__unicode_toupper(mdn__unicode_version_t version,
unsigned long c, mdn__unicode_context_t ctx,
unsigned long *v, size_t vlen, int *convlenp);
extern mdn_result_t
mdn__unicode_tolower(unsigned long c, mdn__unicode_context_t ctx,
mdn__unicode_tolower(mdn__unicode_version_t version,
unsigned long c, mdn__unicode_context_t ctx,
unsigned long *v, size_t vlen, int *convlenp);
/*
@ -188,7 +219,7 @@ mdn__unicode_tolower(unsigned long c, mdn__unicode_context_t ctx,
* try the next character.
*/
extern mdn__unicode_context_t
mdn__unicode_getcontext(unsigned long c);
mdn__unicode_getcontext(mdn__unicode_version_t version, unsigned long c);
/*
* Perform case-folding for caseless matching, defined by Unicode
@ -205,7 +236,8 @@ mdn__unicode_getcontext(unsigned long c);
* mdn_buffer_overflow -- 'vlen' is too small.
*/
extern mdn_result_t
mdn__unicode_casefold(unsigned long c, unsigned long *v, size_t vlen,
mdn__unicode_casefold(mdn__unicode_version_t version,
unsigned long c, unsigned long *v, size_t vlen,
int *foldlenp);
#endif /* MDN_UNICODE_H */

View file

@ -1,6 +1,7 @@
/* $Id: unormalize.h,v 1.9 2000/08/02 02:06:41 ishisone Exp $ */
/* $Id: unormalize.h,v 1.1 2002/01/02 02:46:36 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
* Copyright (c) 2000,2001 Japan Network Information Center.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set forth bellow.
*
@ -8,8 +9,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -70,14 +71,15 @@
*/
#include <mdn/result.h>
#include <mdn/unicode.h>
/*
* Perform Unicode Normalication Form C, D, KC and KD.
*
* They take NUL-terminated UTF-8 encoded string 'from', perform
* the normalization, put the result (also a NUL-terminated UTF-8
* encoded string) to 'to', which must be able to hold at least
* 'tolen' bytes.
* the normalization specified by 'version', put the result
* (also a NUL-terminated UTF-8 encoded string) to 'to', which must be
* able to hold at least 'tolen' bytes.
*
* Returns:
* mdn_success -- ok.
@ -86,15 +88,19 @@
* mdn_buffer_overflow -- 'tolen' is too small.
*/
extern mdn_result_t
mdn__unormalize_formc(const char *from, char *to, size_t tolen);
mdn__unormalize_formc(mdn__unicode_version_t version,
const char *from, char *to, size_t tolen);
extern mdn_result_t
mdn__unormalize_formd(const char *from, char *to, size_t tolen);
mdn__unormalize_formd(mdn__unicode_version_t version,
const char *from, char *to, size_t tolen);
extern mdn_result_t
mdn__unormalize_formkc(const char *from, char *to, size_t tolen);
mdn__unormalize_formkc(mdn__unicode_version_t version,
const char *from, char *to, size_t tolen);
extern mdn_result_t
mdn__unormalize_formkd(const char *from, char *to, size_t tolen);
mdn__unormalize_formkd(mdn__unicode_version_t version,
const char *from, char *to, size_t tolen);
#endif /* MDN_UNORMALIZE_H */

View file

@ -1,4 +1,4 @@
/* $Id: utf5.h,v 1.7 2000/07/04 03:52:33 ishisone Exp $ */
/* $Id: utf5.h,v 1.1 2002/01/02 02:46:36 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: utf6.h,v 1.1 2001/06/09 00:30:08 tale Exp $ */
/* $Id: utf6.h,v 1.1.2.1 2002/02/08 12:13:30 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: utf8.h,v 1.8 2000/08/14 07:26:59 ishisone Exp $ */
/* $Id: utf8.h,v 1.1 2002/01/02 02:46:36 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: util.h,v 1.5 2001/04/20 00:45:06 ishisone Exp $ */
/* $Id: util.h,v 1.1 2002/01/02 02:46:37 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
/* $Id: version.h,v 1.1 2001/06/09 00:30:09 tale Exp $ */
/* $Id: version.h,v 1.1.2.1 2002/02/08 12:13:34 marka Exp $ */
/*
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
*
@ -8,8 +8,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -63,9 +63,9 @@
/*
* Version number of this package.
*/
#define MDNKIT_VERSION "2.1"
#define MDNKIT_VERSION "2.2.3"
#define MDNKIT_MAJOR_VERSION 2
#define MDNKIT_MINOR_VERSION 1
#define MDNKIT_MINOR_VERSION 2
/*
* Get the version of the library (libmdn).

View file

@ -1,4 +1,4 @@
# $Id: Makefile.in,v 1.48 2001/05/22 03:00:23 m-kasahr Exp $
# $Id: Makefile.in,v 1.1 2002/01/02 02:46:37 marka Exp $
# Copyright (c) 2000 Japan Network Information Center. All rights reserved.
#
# By using this file, you agree to the terms and conditions set forth bellow.
@ -7,8 +7,8 @@
#
# The following License Terms and Conditions apply, unless a different
# license is obtained from Japan Network Information Center ("JPNIC"),
# a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
# Tokyo, Japan.
# a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
# Chiyoda-ku, Tokyo 101-0047, Japan.
#
# 1. Use, Modification and Redistribution (including distribution of any
# modified or derived work) in source and/or binary forms is permitted
@ -56,7 +56,7 @@
# jurisdiction and venue of Tokyo District Court of Japan.
LIB_CURRENT = 7
LIB_REVISION = 0
LIB_REVISION = 3
LIB_AGE = 0
.SUFFIXES: .lo
@ -85,21 +85,25 @@ MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
SHELL = @SHELL@
LIBTOOL = @LIBTOOL@
ICONVINC = @ICONVINC@
ICONVLIB = @ICONVLIB@
OPTS =
INCS = -I$(srcdir)/../include -I../include
INCS = -I$(srcdir)/../include -I../include $(ICONVINC)
DEFS = -DMDN_RESCONF_DIR="\"$(sysconfdir)\""
CFLAGS = $(OPTS) $(INCS) $(DEFS) @CFLAGS@
LDFLAGS = @LDFLAGS@
ICONVLIB = @ICONVLIB@
SRCS = \
ace.c \
altdude.c \
amcacem.c \
amcaceo.c \
amcacer.c \
amcacev.c \
amcacew.c \
amcacez.c \
api.c \
brace.c \
checker.c \
@ -113,6 +117,7 @@ SRCS = \
lace.c \
localencoding.c \
log.c \
mace.c \
mapper.c \
mapselector.c \
msgheader.c \
@ -130,7 +135,9 @@ SRCS = \
ucsmap.c \
ucsset.c \
unicode.c \
unicodedata.c \
unicode_template.c \
unicodedata_301.c \
unicodedata_310.c \
unormalize.c \
utf5.c \
utf6.c \
@ -144,6 +151,9 @@ OBJS = \
amcacem.lo \
amcaceo.lo \
amcacer.lo \
amcacev.lo \
amcacew.lo \
amcacez.lo \
api.lo \
brace.lo \
checker.lo \
@ -157,6 +167,7 @@ OBJS = \
lace.lo \
localencoding.lo \
log.lo \
mace.lo \
mapper.lo \
mapselector.lo \
msgheader.lo \

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: ace.c,v 1.1 2001/06/09 00:30:12 tale Exp $";
static char *rcsid = "$Id: ace.c,v 1.1.2.1 2002/02/08 12:13:36 marka Exp $";
#endif
/*
@ -12,8 +12,8 @@ static char *rcsid = "$Id: ace.c,v 1.1 2001/06/09 00:30:12 tale Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: altdude.c,v 1.1 2001/06/09 00:30:12 tale Exp $";
static char *rcsid = "$Id: altdude.c,v 1.1.2.1 2002/02/08 12:13:38 marka Exp $";
#endif
/*
@ -12,8 +12,8 @@ static char *rcsid = "$Id: altdude.c,v 1.1 2001/06/09 00:30:12 tale Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: amcacem.c,v 1.1 2001/06/09 00:30:12 tale Exp $";
static char *rcsid = "$Id: amcacem.c,v 1.1.2.1 2002/02/08 12:13:39 marka Exp $";
#endif
/*
@ -12,8 +12,8 @@ static char *rcsid = "$Id: amcacem.c,v 1.1 2001/06/09 00:30:12 tale Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: amcaceo.c,v 1.1 2001/06/09 00:30:12 tale Exp $";
static char *rcsid = "$Id: amcaceo.c,v 1.1.2.1 2002/02/08 12:13:40 marka Exp $";
#endif
/*
@ -12,8 +12,8 @@ static char *rcsid = "$Id: amcaceo.c,v 1.1 2001/06/09 00:30:12 tale Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: amcacer.c,v 1.1 2001/06/09 00:30:12 tale Exp $";
static char *rcsid = "$Id: amcacer.c,v 1.1.2.1 2002/02/08 12:13:41 marka Exp $";
#endif
/*
@ -12,8 +12,8 @@ static char *rcsid = "$Id: amcacer.c,v 1.1 2001/06/09 00:30:12 tale Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -78,7 +78,7 @@ static char *rcsid = "$Id: amcacer.c,v 1.1 2001/06/09 00:30:12 tale Exp $";
#include <mdn/util.h>
/*
* Although draft-ietf-idn-amc-ace-r-00.txt doesn't specify the ACE
* Although draft-ietf-idn-amc-ace-r-01.txt doesn't specify the ACE
* signature, we have to choose one. In order to prevent the converted
* name from beginning with a hyphen, we should choose a prefix rather
* than a suffix.
@ -87,14 +87,16 @@ static char *rcsid = "$Id: amcacer.c,v 1.1 2001/06/09 00:30:12 tale Exp $";
#define MDN_AMCACER_PREFIX "amc3-"
#endif
#define UCSBUF_LOCAL_SIZE 40
#define MAX_UCS 0x10FFFF
#define AMCACER_BUFSIZE 64
typedef struct ucsbuf {
unsigned long *ucs;
size_t size;
size_t len;
unsigned long local[UCSBUF_LOCAL_SIZE];
} ucsbuf_t;
typedef struct {
unsigned long *history;
unsigned long local_buf[AMCACER_BUFSIZE];
int history_len;
unsigned long refpoint[6];
int updated;
} amcacer_encode_ctx;
static const char *base32encode = "abcdefghijkmnpqrstuvwxyz23456789";
static const int base32decode_ascii[26] = {
@ -109,21 +111,14 @@ static mdn_result_t amcacer_decode(const char *from, size_t fromlen,
char *to, size_t tolen);
static mdn_result_t amcacer_encode(const char *from, size_t fromlen,
char *to, size_t tolen);
static void amcacer_update_refpoints(unsigned long *refpoint,
unsigned long *history,
int n);
static mdn_result_t amcacer_init_ctx(amcacer_encode_ctx *ctx, size_t len);
static void amcacer_free_ctx(amcacer_encode_ctx *ctx);
static void amcacer_update_refpoints(amcacer_encode_ctx *ctx,
unsigned long c);
static int amcacer_getwc(const char *s, size_t len,
unsigned long *vp);
static int amcacer_putwc(char *s, size_t len,
unsigned long v, int w);
static mdn_result_t utf8_to_ucs4(const char *utf8, size_t fromlen,
ucsbuf_t *b);
static mdn_result_t ucs4_to_utf8(ucsbuf_t *b, char *utf8, size_t ulen);
static void ucsbuf_init(ucsbuf_t *b);
static mdn_result_t ucsbuf_grow(ucsbuf_t *b);
static mdn_result_t ucsbuf_append(ucsbuf_t *b, unsigned long v);
static void ucsbuf_free(ucsbuf_t *b);
static int is_ldh(unsigned long v);
static mdn__ace_t amcacer_ctx = {
@ -139,7 +134,7 @@ static mdn__ace_t amcacer_ctx = {
};
static const unsigned long amcacer_refpoint_initial[6] = {
0, 0x60, 0, 0, 0, 0x10000,
0, 0xe0, 0xa0, 0, 0, 0x10000,
};
@ -184,17 +179,18 @@ mdn__amcacer_convert(mdn_converter_t ctx, void *privdata,
static mdn_result_t
amcacer_decode(const char *from, size_t fromlen, char *to, size_t tolen) {
size_t len;
unsigned long refpoint[6], v;
ucsbuf_t ucsb;
int literal_mode = 0;
amcacer_encode_ctx ctx;
mdn_result_t r;
(void)memcpy(refpoint, amcacer_refpoint_initial, sizeof(refpoint));
ucsbuf_init(&ucsb);
/* Initialize context. */
if ((r = amcacer_init_ctx(&ctx, fromlen)) != mdn_success)
return (r);
while (fromlen > 0) {
size_t len;
unsigned long v;
if (from[0] == '-') {
if (fromlen > 1 && from[1] == '-') {
v = '-';
@ -218,58 +214,66 @@ amcacer_decode(const char *from, size_t fromlen, char *to, size_t tolen) {
}
from += len;
fromlen -= len;
v = refpoint[len] + v;
v = ctx.refpoint[len] + v;
amcacer_update_refpoints(&ctx, v);
}
if ((r = ucsbuf_append(&ucsb, v)) != mdn_success)
goto finish;
amcacer_update_refpoints(refpoint, ucsb.ucs, ucsb.len - 1);
len = mdn_utf8_putwc(to, tolen, v);
if (len == 0)
goto overflow;
to += len;
tolen -= len;
}
r = ucs4_to_utf8(&ucsb, to, tolen);
finish:
ucsbuf_free(&ucsb);
/*
* Terminate with NUL.
*/
if (tolen <= 0)
goto overflow;
*to = '\0';
finish:
amcacer_free_ctx(&ctx);
return (r);
overflow:
r = mdn_buffer_overflow;
goto finish;
}
static mdn_result_t
amcacer_encode(const char *from, size_t fromlen, char *to, size_t tolen) {
ucsbuf_t ucsb;
unsigned long *buf;
size_t len;
int literal_mode = 0;
unsigned long refpoint[6];
amcacer_encode_ctx ctx;
mdn_result_t r;
int i;
/* Initialize refpoints. */
(void)memcpy(refpoint, amcacer_refpoint_initial, sizeof(refpoint));
/*
* Convert input string to UCS-4.
*/
ucsbuf_init(&ucsb);
if ((r = utf8_to_ucs4(from, fromlen, &ucsb)) != mdn_success)
/* Initialize context. */
if ((r = amcacer_init_ctx(&ctx, fromlen)) != mdn_success)
return (r);
buf = ucsb.ucs;
len = ucsb.len;
while (fromlen > 0) {
unsigned long c;
size_t len;
/*
* Now 'buf' contains UCS-4 string consisting of 'len' characters.
*/
len = mdn_utf8_getwc(from, fromlen, &c);
from += len;
fromlen -= len;
for (i = 0; i < len; i++) {
if (buf[i] == '-') {
if (len == 0 || c >= MAX_UCS) {
/*
* Invalid Unicode code point.
*/
r = mdn_invalid_encoding;
goto ret;
} else if (c == '-') {
/*
* Convert "-" to "--".
*/
if (tolen < 2)
return (mdn_buffer_overflow);
goto overflow;
to[0] = to[1] = '-';
to += 2;
tolen -= 2;
} else if (is_ldh(buf[i])) {
} else if (is_ldh(c)) {
/*
* LDH characters.
*/
@ -285,12 +289,13 @@ amcacer_encode(const char *from, size_t fromlen, char *to, size_t tolen) {
}
if (tolen < 1)
goto overflow;
*to++ = buf[i];
*to++ = c;
tolen--;
} else {
/*
* Non-LDH characters.
*/
unsigned long *refpoint = ctx.refpoint;
int k;
if (literal_mode != 0) {
@ -304,17 +309,16 @@ amcacer_encode(const char *from, size_t fromlen, char *to, size_t tolen) {
literal_mode = 0;
}
for (k = 1; k < 6; k++) {
if (buf[i] >= refpoint[k] &&
buf[i] - refpoint[k] < (1 << (4 * k)))
if (c >= refpoint[k] &&
c - refpoint[k] < (1 << (4 * k)))
break;
}
k = amcacer_putwc(to, tolen, buf[i] - refpoint[k],
k);
k = amcacer_putwc(to, tolen, c - refpoint[k], k);
if (k == 0)
goto overflow;
to += k;
tolen -= k;
amcacer_update_refpoints(refpoint, buf, i);
amcacer_update_refpoints(&ctx, c);
}
}
@ -322,30 +326,56 @@ amcacer_encode(const char *from, size_t fromlen, char *to, size_t tolen) {
* Terminate with NUL.
*/
if (tolen <= 0)
return (mdn_buffer_overflow);
goto overflow;
*to = '\0';
ucsbuf_free(&ucsb);
return (mdn_success);
r = mdn_success;
ret:
amcacer_free_ctx(&ctx);
return (r);
overflow:
ucsbuf_free(&ucsb);
return (mdn_buffer_overflow);
r = mdn_buffer_overflow;
goto ret;
}
static mdn_result_t
amcacer_init_ctx(amcacer_encode_ctx *ctx, size_t len) {
if (len > AMCACER_BUFSIZE) {
ctx->history = malloc(sizeof(ctx->history[0]) * len);
if (ctx->history == NULL)
return (mdn_nomemory);
} else {
ctx->history = ctx->local_buf;
}
ctx->history_len = 0;
(void)memcpy(ctx->refpoint, amcacer_refpoint_initial,
sizeof(ctx->refpoint));
ctx->updated = 0;
return (mdn_success);
}
static void
amcacer_update_refpoints(unsigned long *refpoint,
unsigned long *history, int n)
{
amcacer_free_ctx(amcacer_encode_ctx *ctx) {
if (ctx->history != ctx->local_buf)
free(ctx->history);
ctx->history = NULL;
}
static void
amcacer_update_refpoints(amcacer_encode_ctx *ctx, unsigned long c) {
unsigned long *refpoint = ctx->refpoint;
unsigned long *history = ctx->history;
int k;
unsigned long lastchar = history[n];
history[ctx->history_len++] = c;
#define MAX_K(k) (1 << (4 * (k)))
#define ROUND_K(v, k) (((v) >> (4 * (k))) << (4 * (k)))
if (n == 0) {
if (!ctx->updated) {
for (k = 1; k < 4; k++)
refpoint[k] = ROUND_K(lastchar, k);
refpoint[k] = ROUND_K(c, k);
ctx->updated = 1;
return;
}
@ -353,13 +383,11 @@ amcacer_update_refpoints(unsigned long *refpoint,
unsigned long max = MAX_K(k);
int i;
for (i = n - 1; i >= 0; i--) {
if (is_ldh(history[i]))
continue;
for (i = ctx->history_len - 2; i >= 0; i--) {
if ((refpoint[k] ^ history[i]) < max)
break;
if ((lastchar ^ history[i]) < max) {
refpoint[k] = ROUND_K(lastchar, k);
if ((c ^ history[i]) < max) {
refpoint[k] = ROUND_K(c, k);
return;
}
}
@ -411,88 +439,6 @@ amcacer_putwc(char *s, size_t len, unsigned long v, int w) {
return (w);
}
/*
* Common Utility Functions.
*/
static mdn_result_t
utf8_to_ucs4(const char *utf8, size_t fromlen, ucsbuf_t *b) {
mdn_result_t r;
while (fromlen > 0) {
unsigned long c;
int w;
if ((w = mdn_utf8_getwc(utf8, fromlen, &c)) == 0)
return (mdn_invalid_encoding);
utf8 += w;
fromlen -= w;
if ((r = ucsbuf_append(b, c)) != mdn_success)
return (r);
}
return (mdn_success);
}
static mdn_result_t
ucs4_to_utf8(ucsbuf_t *b, char *utf8, size_t ulen) {
unsigned long *s = b->ucs;
size_t len = b->len;
int i;
for (i = 0; i < len; i++) {
int w = mdn_utf8_putwc(utf8, ulen, s[i]);
if (w == 0)
return (mdn_buffer_overflow);
utf8 += w;
ulen -= w;
}
if (ulen < 1)
return (mdn_buffer_overflow);
*utf8 = '\0';
return (mdn_success);
}
static void
ucsbuf_init(ucsbuf_t *b) {
b->ucs = b->local;
b->size = UCSBUF_LOCAL_SIZE;
b->len = 0;
}
static mdn_result_t
ucsbuf_grow(ucsbuf_t *b) {
if (b->ucs == b->local)
b->ucs = NULL;
b->size *= 2;
b->ucs = realloc(b->ucs, sizeof(unsigned long) * b->size);
if (b->ucs == NULL)
return (mdn_nomemory);
return (mdn_success);
}
static mdn_result_t
ucsbuf_append(ucsbuf_t *b, unsigned long v) {
mdn_result_t r;
if (b->len + 1 > b->size) {
r = ucsbuf_grow(b);
if (r != mdn_success)
return (r);
}
b->ucs[b->len++] = v;
return (mdn_success);
}
static void
ucsbuf_free(ucsbuf_t *b) {
if (b->ucs != b->local) {
free(b->ucs);
b->ucs = b->local;
}
}
static int
is_ldh(unsigned long v) {
if (('a' <= v && v <= 'z') || ('A' <= v && v <= 'Z') ||

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: amcacev.c,v 1.1 2002/02/08 05:39:56 marka Exp $";
static char *rcsid = "$Id: amcacev.c,v 1.1.2.1 2002/02/08 12:13:42 marka Exp $";
#endif
/*

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: amcacew.c,v 1.1 2002/02/08 05:39:57 marka Exp $";
static char *rcsid = "$Id: amcacew.c,v 1.1.2.1 2002/02/08 12:13:44 marka Exp $";
#endif
/*

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: amcacez.c,v 1.1 2002/02/08 05:39:57 marka Exp $";
static char *rcsid = "$Id: amcacez.c,v 1.1.2.1 2002/02/08 12:13:45 marka Exp $";
#endif
/*

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: api.c,v 1.1 2001/06/09 00:30:12 tale Exp $";
static char *rcsid = "$Id: api.c,v 1.1.2.1 2002/02/08 12:13:46 marka Exp $";
#endif
/*
@ -11,8 +11,8 @@ static char *rcsid = "$Id: api.c,v 1.1 2001/06/09 00:30:12 tale Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -89,7 +89,7 @@ static struct actiondesc {
#define ENCODE_MASK \
(MDN_LOCALCONV|MDN_IDNCONV|MDN_NAMEPREP|MDN_UNASCHECK|\
MDN_DELIMMAP|MDN_LOCALMAP)
#define DECODE_MASK (MDN_LOCALCONV|MDN_IDNCONV)
#define DECODE_MASK (MDN_LOCALCONV|MDN_NAMEPREP|MDN_UNASCHECK|MDN_IDNCONV)
static int initialized;
static mdn_resconf_t default_conf;
@ -128,7 +128,7 @@ mdn_encodename(int actions, const char *from, char *to, size_t tolen) {
TRACE(("mdn_encodename(actions=%s, from=\"%s\")\n",
actions_to_string(actions),
mdn_debug_xstring(from, 30)));
mdn_debug_xstring(from, 256)));
if (actions & ~ENCODE_MASK) {
WARNING(("mdn_encodename: invalid actions 0x%x\n", actions));
@ -169,7 +169,7 @@ mdn_decodename(int actions, const char *from, char *to, size_t tolen) {
TRACE(("mdn_decodename(actions=%s, from=\"%s\")\n",
actions_to_string(actions),
mdn_debug_xstring(from, 30)));
mdn_debug_xstring(from, 256)));
if (actions & ~DECODE_MASK) {
WARNING(("mdn_decodename: invalid actions 0x%x\n", actions));
@ -181,6 +181,14 @@ mdn_decodename(int actions, const char *from, char *to, size_t tolen) {
if (actions & MDN_IDNCONV)
*p++ = 'i';
if (actions & MDN_NAMEPREP) {
*p++ = '!';
*p++ = 'N';
}
if (actions & MDN_UNASCHECK) {
*p++ = '!';
*p++ = 'u';
}
if (actions & MDN_LOCALCONV)
*p++ = 'L';
*p = '\0';

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: brace.c,v 1.16 2001/03/07 00:58:51 ishisone Exp $";
static char *rcsid = "$Id: brace.c,v 1.1 2002/01/02 02:46:40 marka Exp $";
#endif
/*
@ -11,8 +11,8 @@ static char *rcsid = "$Id: brace.c,v 1.16 2001/03/07 00:58:51 ishisone Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: checker.c,v 1.1 2001/06/09 00:30:14 tale Exp $";
static char *rcsid = "$Id: checker.c,v 1.1.2.1 2002/02/08 12:13:48 marka Exp $";
#endif
/*
@ -11,8 +11,8 @@ static char *rcsid = "$Id: checker.c,v 1.1 2001/06/09 00:30:14 tale Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -88,24 +88,6 @@ typedef struct {
/*
* Standard checking schemes.
*/
static const check_scheme_t nameprep_02_prohibit_scheme = {
"prohibit#nameprep-02",
"nameprep-02",
mdn__nameprep_createproc,
mdn__nameprep_destroyproc,
mdn__nameprep_prohibitproc,
NULL,
};
static const check_scheme_t nameprep_02_unasigned_scheme = {
"unassigned#nameprep-02",
"nameprep-02",
mdn__nameprep_createproc,
mdn__nameprep_destroyproc,
mdn__nameprep_unassignedproc,
NULL,
};
static const check_scheme_t nameprep_03_prohibit_scheme = {
"prohibit#nameprep-03",
"nameprep-03",
@ -124,6 +106,42 @@ static const check_scheme_t nameprep_03_unasigned_scheme = {
NULL,
};
static const check_scheme_t nameprep_05_prohibit_scheme = {
"prohibit#nameprep-05",
"nameprep-05",
mdn__nameprep_createproc,
mdn__nameprep_destroyproc,
mdn__nameprep_prohibitproc,
NULL,
};
static const check_scheme_t nameprep_05_unasigned_scheme = {
"unassigned#nameprep-05",
"nameprep-05",
mdn__nameprep_createproc,
mdn__nameprep_destroyproc,
mdn__nameprep_unassignedproc,
NULL,
};
static const check_scheme_t nameprep_06_prohibit_scheme = {
"prohibit#nameprep-06",
"nameprep-06",
mdn__nameprep_createproc,
mdn__nameprep_destroyproc,
mdn__nameprep_prohibitproc,
NULL,
};
static const check_scheme_t nameprep_06_unasigned_scheme = {
"unassigned#nameprep-06",
"nameprep-06",
mdn__nameprep_createproc,
mdn__nameprep_destroyproc,
mdn__nameprep_unassignedproc,
NULL,
};
static const check_scheme_t filecheck_prohibit_scheme = {
"prohibit#fileset",
NULL,
@ -143,10 +161,12 @@ static const check_scheme_t filecheck_unassigned_scheme = {
};
static const check_scheme_t *standard_check_schemes[] = {
&nameprep_02_unasigned_scheme,
&nameprep_02_prohibit_scheme,
&nameprep_03_unasigned_scheme,
&nameprep_03_prohibit_scheme,
&nameprep_05_unasigned_scheme,
&nameprep_05_prohibit_scheme,
&nameprep_06_unasigned_scheme,
&nameprep_06_prohibit_scheme,
&filecheck_prohibit_scheme,
&filecheck_unassigned_scheme,
NULL,
@ -357,6 +377,9 @@ mdn_checker_add(mdn_checker_t ctx, const char *scheme_name) {
ctx->schemes[ctx->nschemes].context = scheme_context;
ctx->nschemes++;
if (buffer != static_buffer)
free(buffer);
return (mdn_success);
failure:
@ -390,6 +413,7 @@ mdn_checker_addall(mdn_checker_t ctx, const char **scheme_names,
mdn_result_t
mdn_checker_lookup(mdn_checker_t ctx, const char *utf8, const char **found) {
mdn_result_t r;
const char *p;
int i;
assert(scheme_hash != NULL);
@ -402,15 +426,16 @@ mdn_checker_lookup(mdn_checker_t ctx, const char *utf8, const char **found) {
* Lookup.
*/
for (i = 0; i < ctx->nschemes; i++) {
r = (ctx->schemes[i].lookup)(ctx->schemes[i].context, utf8,
found);
if (r != mdn_success)
return (r);
else if (*found == NULL)
return (mdn_success);
else if (**found != '.')
return (mdn_prohibited);
utf8 = *found + 1;
for (p = utf8; *p != '\0'; p = *found + 1) {
r = (ctx->schemes[i].lookup)(ctx->schemes[i].context,
p, found);
if (r != mdn_success)
return (r);
else if (*found == NULL)
break;
else if (**found != '.')
return (mdn_success);
}
}
*found = NULL;

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: converter.c,v 1.35 2001/04/17 01:35:42 ishisone Exp $";
static char *rcsid = "$Id: converter.c,v 1.1 2002/01/02 02:46:40 marka Exp $";
#endif
/*
@ -11,8 +11,8 @@ static char *rcsid = "$Id: converter.c,v 1.35 2001/04/17 01:35:42 ishisone Exp $
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -75,18 +75,24 @@ static char *rcsid = "$Id: converter.c,v 1.35 2001/04/17 01:35:42 ishisone Exp $
#include <mdn/logmacro.h>
#include <mdn/converter.h>
#include <mdn/strhash.h>
#include <mdn/utf8.h>
#include <mdn/utf6.h>
#include <mdn/utf5.h>
#include <mdn/debug.h>
#include <mdn/utf8.h>
#include <mdn/amcacez.h>
#include <mdn/race.h>
#include <mdn/dude.h>
#ifdef MDN_EXTRA_ACE
#include <mdn/utf5.h>
#include <mdn/utf6.h>
#include <mdn/brace.h>
#include <mdn/lace.h>
#include <mdn/dude.h>
#include <mdn/altdude.h>
#include <mdn/amcacem.h>
#include <mdn/amcaceo.h>
#include <mdn/amcacer.h>
#include <mdn/amcacev.h>
#include <mdn/amcacew.h>
#include <mdn/mace.h>
#endif /* MDN_EXTRA_ACE */
#ifndef MDN_UTF8_ENCODING_NAME
#define MDN_UTF8_ENCODING_NAME "UTF-8" /* by IANA */
@ -121,6 +127,18 @@ static char *rcsid = "$Id: converter.c,v 1.35 2001/04/17 01:35:42 ishisone Exp $
#ifndef MDN_AMCACER_ENCODING_NAME
#define MDN_AMCACER_ENCODING_NAME "AMC-ACE-R"
#endif
#ifndef MDN_AMCACEV_ENCODING_NAME
#define MDN_AMCACEV_ENCODING_NAME "AMC-ACE-V"
#endif
#ifndef MDN_AMCACEW_ENCODING_NAME
#define MDN_AMCACEW_ENCODING_NAME "AMC-ACE-W"
#endif
#ifndef MDN_AMCACEZ_ENCODING_NAME
#define MDN_AMCACEZ_ENCODING_NAME "AMC-ACE-Z"
#endif
#ifndef MDN_MACE_ENCODING_NAME
#define MDN_MACE_ENCODING_NAME "MACE"
#endif
#define MAX_RECURSE 20
@ -128,7 +146,7 @@ typedef struct {
mdn_converter_openproc_t open;
mdn_converter_closeproc_t close;
mdn_converter_convertproc_t convert;
int ascii_compatible;
int encoding_type;
} converter_ops_t;
struct mdn_converter {
@ -176,6 +194,7 @@ static mdn_result_t converter_iconv_convert(mdn_converter_t ctx,
mdn_converter_dir_t dir,
const char *from,
char *to, size_t tolen);
#ifdef MDN_EXTRA_ACE
static mdn_result_t converter_utf5_open(mdn_converter_t ctx,
mdn_converter_dir_t dir,
void **privdata);
@ -187,6 +206,8 @@ static mdn_result_t converter_utf5_convert(mdn_converter_t ctx,
mdn_converter_dir_t dir,
const char *from,
char *to, size_t tolen);
#endif
#ifdef DEBUG
static mdn_result_t converter_uescape_open(mdn_converter_t ctx,
mdn_converter_dir_t dir,
@ -205,14 +226,14 @@ static converter_ops_t none_converter_ops = {
converter_none_open,
converter_none_close,
converter_none_convert,
0,
MDN_NONACE,
};
static converter_ops_t iconv_converter_ops = {
converter_iconv_open,
converter_iconv_close,
converter_iconv_convert,
0,
MDN_NONACE,
};
/*
@ -371,11 +392,18 @@ mdn_converter_localencoding(mdn_converter_t ctx) {
return (ctx->local_encoding_name);
}
int
mdn_converter_encodingtype(mdn_converter_t ctx) {
assert(ctx != NULL);
TRACE(("mdn_converter_encodingtype()\n"));
return (ctx->ops->encoding_type);
}
int
mdn_converter_isasciicompatible(mdn_converter_t ctx) {
assert(ctx != NULL);
TRACE(("mdn_converter_isasciicompatible()\n"));
return (ctx->ops->ascii_compatible);
return (ctx->ops->encoding_type != MDN_NONACE);
}
mdn_result_t
@ -422,7 +450,7 @@ mdn_converter_register(const char *name,
mdn_converter_openproc_t open,
mdn_converter_closeproc_t close,
mdn_converter_convertproc_t convert,
int ascii_compatible) {
int encoding_type) {
converter_ops_t *ops;
mdn_result_t r;
@ -438,7 +466,7 @@ mdn_converter_register(const char *name,
ops->open = open;
ops->close = close;
ops->convert = convert;
ops->ascii_compatible = ascii_compatible;
ops->encoding_type = encoding_type;
r = mdn_strhash_put(encoding_name_hash, name, ops);
if (r != mdn_success)
@ -451,11 +479,11 @@ static mdn_result_t
register_standard_encoding(void) {
mdn_result_t r;
r = mdn_converter_register(MDN_UTF5_ENCODING_NAME,
converter_utf5_open,
converter_utf5_close,
converter_utf5_convert,
1);
r = mdn_converter_register(MDN_AMCACEZ_ENCODING_NAME,
mdn__amcacez_open,
mdn__amcacez_close,
mdn__amcacez_convert,
MDN_ACE_STRICTCASE);
if (r != mdn_success)
return (r);
@ -463,23 +491,7 @@ register_standard_encoding(void) {
mdn__race_open,
mdn__race_close,
mdn__race_convert,
1);
if (r != mdn_success)
return (r);
r = mdn_converter_register(MDN_BRACE_ENCODING_NAME,
mdn__brace_open,
mdn__brace_close,
mdn__brace_convert,
1);
if (r != mdn_success)
return (r);
r = mdn_converter_register(MDN_LACE_ENCODING_NAME,
mdn__lace_open,
mdn__lace_close,
mdn__lace_convert,
1);
MDN_ACE_LOOSECASE);
if (r != mdn_success)
return (r);
@ -487,7 +499,32 @@ register_standard_encoding(void) {
mdn__dude_open,
mdn__dude_close,
mdn__dude_convert,
1);
MDN_ACE_LOOSECASE);
if (r != mdn_success)
return (r);
#ifdef MDN_EXTRA_ACE
r = mdn_converter_register(MDN_UTF5_ENCODING_NAME,
converter_utf5_open,
converter_utf5_close,
converter_utf5_convert,
MDN_ACE_LOOSECASE);
if (r != mdn_success)
return (r);
r = mdn_converter_register(MDN_BRACE_ENCODING_NAME,
mdn__brace_open,
mdn__brace_close,
mdn__brace_convert,
MDN_ACE_STRICTCASE);
if (r != mdn_success)
return (r);
r = mdn_converter_register(MDN_LACE_ENCODING_NAME,
mdn__lace_open,
mdn__lace_close,
mdn__lace_convert,
MDN_ACE_LOOSECASE);
if (r != mdn_success)
return (r);
@ -495,7 +532,7 @@ register_standard_encoding(void) {
mdn__utf6_open,
mdn__utf6_close,
mdn__utf6_convert,
1);
MDN_ACE_LOOSECASE);
if (r != mdn_success)
return (r);
@ -503,7 +540,7 @@ register_standard_encoding(void) {
mdn__altdude_open,
mdn__altdude_close,
mdn__altdude_convert,
1);
MDN_ACE_LOOSECASE);
if (r != mdn_success)
return (r);
@ -511,7 +548,7 @@ register_standard_encoding(void) {
mdn__amcacem_open,
mdn__amcacem_close,
mdn__amcacem_convert,
1);
MDN_ACE_STRICTCASE);
if (r != mdn_success)
return (r);
@ -519,7 +556,7 @@ register_standard_encoding(void) {
mdn__amcaceo_open,
mdn__amcaceo_close,
mdn__amcaceo_convert,
1);
MDN_ACE_STRICTCASE);
if (r != mdn_success)
return (r);
@ -527,17 +564,42 @@ register_standard_encoding(void) {
mdn__amcacer_open,
mdn__amcacer_close,
mdn__amcacer_convert,
1);
MDN_ACE_STRICTCASE);
if (r != mdn_success)
return (r);
r = mdn_converter_register(MDN_AMCACEV_ENCODING_NAME,
mdn__amcacev_open,
mdn__amcacev_close,
mdn__amcacev_convert,
MDN_ACE_STRICTCASE);
if (r != mdn_success)
return (r);
r = mdn_converter_register(MDN_AMCACEW_ENCODING_NAME,
mdn__amcacew_open,
mdn__amcacew_close,
mdn__amcacew_convert,
MDN_ACE_STRICTCASE);
if (r != mdn_success)
return (r);
r = mdn_converter_register(MDN_MACE_ENCODING_NAME,
mdn__mace_open,
mdn__mace_close,
mdn__mace_convert,
MDN_ACE_STRICTCASE);
if (r != mdn_success)
return (r);
#endif /* MDN_EXTRA_ACE */
#ifdef DEBUG
/* This is convenient for debug. Not useful for other purposes. */
r = mdn_converter_register("U-escape",
converter_uescape_open,
converter_uescape_close,
converter_uescape_convert,
0);
MDN_NONACE);
if (r != mdn_success)
return (r);
#endif /* DEBUG */
@ -561,8 +623,11 @@ mdn_converter_addalias(const char *alias_name, const char *real_name) {
if (strcmp(alias_name, real_name) == 0)
return (mdn_success);
if (encoding_alias_hash == NULL)
if (encoding_alias_hash == NULL) {
WARNING(("mdn_converter_addalias: the module is not \n"
"initialized"));
return (mdn_failure);
}
if ((rn_copy = malloc(strlen(real_name) + 1)) == NULL) {
WARNING(("mdn_converter_addalias: malloc failed\n"));
@ -905,6 +970,7 @@ converter_iconv_convert(mdn_converter_t ctx, void *privdata,
case E2BIG:
return (mdn_buffer_overflow);
default:
WARNING(("iconv failed with errno %d\n", errno));
return (mdn_failure);
}
}
@ -935,6 +1001,8 @@ converter_iconv_convert(mdn_converter_t ctx, void *privdata,
case E2BIG:
return (mdn_buffer_overflow);
default:
WARNING(("iconv failed with errno %d\n",
errno));
return (mdn_failure);
}
}
@ -948,6 +1016,8 @@ converter_iconv_convert(mdn_converter_t ctx, void *privdata,
* Conversion to/from UTF-5.
*/
#ifdef MDN_EXTRA_ACE
/* ARGSUSED */
static mdn_result_t
converter_utf5_open(mdn_converter_t ctx, mdn_converter_dir_t dir,
@ -1020,6 +1090,8 @@ overflow:
return (mdn_buffer_overflow);
}
#endif
#ifdef DEBUG
/*
* Conversion to/from unicode escape string.

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: debug.c,v 1.6 2000/07/04 03:52:36 ishisone Exp $";
static char *rcsid = "$Id: debug.c,v 1.1 2002/01/02 02:46:40 marka Exp $";
#endif
/*
@ -11,8 +11,8 @@ static char *rcsid = "$Id: debug.c,v 1.6 2000/07/04 03:52:36 ishisone Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: delimitermap.c,v 1.1 2001/06/09 00:30:15 tale Exp $";
static char *rcsid = "$Id: delimitermap.c,v 1.1.2.1 2002/02/08 12:13:52 marka Exp $";
#endif
/*
@ -11,8 +11,8 @@ static char *rcsid = "$Id: delimitermap.c,v 1.1 2001/06/09 00:30:15 tale Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: dn.c,v 1.8 2000/09/20 02:47:31 ishisone Exp $";
static char *rcsid = "$Id: dn.c,v 1.1 2002/01/02 02:46:41 marka Exp $";
#endif
/*
@ -11,8 +11,8 @@ static char *rcsid = "$Id: dn.c,v 1.8 2000/09/20 02:47:31 ishisone Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: dude.c,v 1.1 2001/06/09 00:30:15 tale Exp $";
static char *rcsid = "$Id: dude.c,v 1.1.2.1 2002/02/08 12:13:55 marka Exp $";
#endif
/*
@ -12,8 +12,8 @@ static char *rcsid = "$Id: dude.c,v 1.1 2001/06/09 00:30:15 tale Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -77,17 +77,20 @@ static char *rcsid = "$Id: dude.c,v 1.1 2001/06/09 00:30:15 tale Exp $";
#include <mdn/ace.h>
#include <mdn/util.h>
#ifndef MDN_DUDE_PREFIX
/*
* The following prefix is recommended by IETF IDN wg for test purposes.
*/
#if !defined(MDN_DUDE_PREFIX) && !defined(MDN_DUDE_SUFFIX)
#define MDN_DUDE_PREFIX "dq--"
#endif
static unsigned long nibble_mask[] = {
0, /* dummy: this element is never referenced. */
0xf,
0xff,
0xfff,
0xffff,
0xfffff,
static const char *base32encode = "abcdefghijkmnpqrstuvwxyz23456789";
static const int base32decode_ascii[26] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -1, 11, 12, -1, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23,
};
static const int base32decode_digit[10] = {
-1, -1, 24, 25, 26, 27, 28, 29, 30, 31,
};
static mdn_result_t dude_decode(const char *from, size_t fromlen,
@ -97,31 +100,40 @@ static mdn_result_t dude_encode(const char *from, size_t fromlen,
static int get_nibblelength(unsigned long v);
static int dude_getwc(const char *s, size_t len,
unsigned long *vp);
static int dude_putwc(char *s, size_t len, unsigned long v,
int w);
static int dude_putwc(char *s, size_t len, unsigned long v);
static mdn__ace_t dude_ctx = {
#ifdef MDN_DUDE_PREFIX
mdn__ace_prefix,
MDN_DUDE_PREFIX,
#else
mdn__ace_suffix,
MDN_DUDE_SUFFIX,
#endif
dude_encode,
dude_decode,
};
/* ARGSUSED */
mdn_result_t
mdn__dude_open(mdn_converter_t ctx, mdn_converter_dir_t dir, void **privdata) {
mdn__dude_open(mdn_converter_t ctx, mdn_converter_dir_t dir,
void **privdata)
{
return (mdn_success);
}
/* ARGSUSED */
mdn_result_t
mdn__dude_close(mdn_converter_t ctx, void *privdata, mdn_converter_dir_t dir) {
mdn__dude_close(mdn_converter_t ctx, void *privdata,
mdn_converter_dir_t dir)
{
return (mdn_success);
}
mdn_result_t
mdn__dude_convert(mdn_converter_t ctx, void *privdata, mdn_converter_dir_t dir,
const char *from, char *to, size_t tolen)
mdn__dude_convert(mdn_converter_t ctx, void *privdata,
mdn_converter_dir_t dir,
const char *from, char *to, size_t tolen)
{
mdn_result_t r;
@ -144,9 +156,9 @@ mdn__dude_convert(mdn_converter_t ctx, void *privdata, mdn_converter_dir_t dir,
static mdn_result_t
dude_decode(const char *from, size_t fromlen, char *to, size_t tolen) {
size_t len;
unsigned long prev, v, mask;
unsigned long prev, v;
prev = 0;
prev = 96;
while (fromlen > 0) {
if (from[0] == '-') {
v = '-';
@ -158,14 +170,16 @@ dude_decode(const char *from, size_t fromlen, char *to, size_t tolen) {
return (mdn_invalid_encoding);
from += len;
fromlen -= len;
mask = nibble_mask[len];
v = (prev & ~mask) | v;
v = prev ^ v;
/*
* Perform extra sanity checks.
* Since round-trip check is performed later
* by mdn__ace_convert(), we don't need the
* following sanity checking.
*
* if (v == '-' || get_nibblelength(v) != len)
* return (mdn_invalid_encoding);
*/
if (v == '-' || get_nibblelength(prev ^ v) != len)
return (mdn_invalid_encoding);
prev = v;
}
@ -189,14 +203,14 @@ dude_decode(const char *from, size_t fromlen, char *to, size_t tolen) {
static mdn_result_t
dude_encode(const char *from, size_t fromlen, char *to, size_t tolen) {
size_t len;
unsigned long prev, c, v, mask;
unsigned long prev, c;
prev = 0;
prev = 96;
while (fromlen > 0) {
len = mdn_utf8_getwc(from, fromlen, &c);
from += len;
fromlen -= len;
if (len == 0 || c >= 0x100000)
if (len == 0)
return (mdn_invalid_encoding);
if (c == '-') {
/*
@ -207,13 +221,10 @@ dude_encode(const char *from, size_t fromlen, char *to, size_t tolen) {
*to++ = '-';
tolen--;
} else {
int nlen = get_nibblelength(prev ^ c);
mask = nibble_mask[nlen];
v = c & mask;
prev = c;
len = dude_putwc(to, tolen, v, nlen);
len = dude_putwc(to, tolen, prev ^ c);
if (len == 0)
return (mdn_buffer_overflow);
prev = c;
to += len;
tolen -= len;
}
@ -232,82 +243,63 @@ dude_encode(const char *from, size_t fromlen, char *to, size_t tolen) {
static int
get_nibblelength(unsigned long v) {
assert(v < 0x100000);
assert(v <= 0x7fffffff);
if (v <= 0xf)
return 1;
else if (v <= 0xff)
return 2;
else if (v <= 0xfff)
return 3;
else if (v <= 0xffff)
return 4;
else
return 5;
if (v < (1<<16)) { /* v <= 16bit */
if (v < (1<<8)) /* v <= 8bit */
return ((v < (1<<4)) ? 1 : 2);
else /* 8bit < v <= 16bit */
return ((v < (1<<12)) ? 3 : 4);
} else { /* 16bit < c */
if (v < (1<<24)) /* 16bit < c <= 24bit */
return ((v < (1<<20)) ? 5 : 6);
else /* 24bit < c <= 31bit */
return ((v < (1<<28)) ? 7 : 8);
}
}
static int
dude_getwc(const char *s, size_t len, unsigned long *vp) {
size_t orglen = len;
unsigned long v = 0;
int c;
if (len < 1)
return (0);
c = *s++;
len--;
if ('G' <= c && c <= 'V')
v = c - 'G';
else if ('g' <= c && c <= 'v')
v = c - 'g';
else /* invalid character */
return (0);
while (len > 0) {
c = *s++;
if ('0' <= c && c <= '9')
c = c - '0';
else if ('A' <= c && c <= 'F')
c = c - 'A' + 10;
else if ('a' <= c && c <= 'f')
c = c - 'a' + 10;
int c = *s++;
if ('a' <= c && c <= 'z')
c = base32decode_ascii[c - 'a'];
else if ('A' <= c && c <= 'Z')
c = base32decode_ascii[c - 'A'];
else if ('0' <= c && c <= '9')
c = base32decode_digit[c - '0'];
else
break;
v = (v << 4) + c;
c = -1;
if (c < 0)
return (0); /* invalid character */
v = (v << 4) + (c & 0xf);
len--;
if ((c & 0x10) == 0) {
*vp = v;
return (orglen - len);
}
}
len = orglen - len;
if (len > 5)
return (0);
*vp = v;
return (len);
return (0); /* final character missing */
}
static int
dude_putwc(char *s, size_t len, unsigned long v, int w) {
int i;
dude_putwc(char *s, size_t len, unsigned long v) {
int i, w, shift;
assert(v < 0x100000);
assert(w > 0 && w < 6 && v <= nibble_mask[w]);
if (len < w)
if ((w = get_nibblelength(v)) > len)
return (0);
for (i = w - 1; i >= 0; i--) {
int x = v & 0xf;
if (i == 0)
s[i] = 'g' + x;
else if (x < 10)
s[i] = '0' + x;
else
s[i] = 'a' + x - 10;
for (shift = 0, i = w - 1; i >= 0; i--) {
s[i] = base32encode[(v & 0xf) + shift];
v >>= 4;
shift = 16;
}
return (w);
}

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: filechecker.c,v 1.1 2001/06/09 00:30:15 tale Exp $";
static char *rcsid = "$Id: filechecker.c,v 1.1.2.1 2002/02/08 12:13:56 marka Exp $";
#endif
/*
@ -11,8 +11,8 @@ static char *rcsid = "$Id: filechecker.c,v 1.1 2001/06/09 00:30:15 tale Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: filemapper.c,v 1.1 2001/06/09 00:30:15 tale Exp $";
static char *rcsid = "$Id: filemapper.c,v 1.1.2.1 2002/02/08 12:13:57 marka Exp $";
#endif
/*
@ -11,8 +11,8 @@ static char *rcsid = "$Id: filemapper.c,v 1.1 2001/06/09 00:30:15 tale Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: lace.c,v 1.11 2001/03/28 06:37:24 m-kasahr Exp $";
static char *rcsid = "$Id: lace.c,v 1.1 2002/01/02 02:46:42 marka Exp $";
#endif
/*
@ -11,8 +11,8 @@ static char *rcsid = "$Id: lace.c,v 1.11 2001/03/28 06:37:24 m-kasahr Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: localencoding.c,v 1.8 2000/09/20 02:47:31 ishisone Exp $";
static char *rcsid = "$Id: localencoding.c,v 1.1 2002/01/02 02:46:42 marka Exp $";
#endif
/*
@ -11,8 +11,8 @@ static char *rcsid = "$Id: localencoding.c,v 1.8 2000/09/20 02:47:31 ishisone Ex
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: log.c,v 1.12 2000/10/16 05:00:18 ishisone Exp $";
static char *rcsid = "$Id: log.c,v 1.1 2002/01/02 02:46:43 marka Exp $";
#endif
/*
@ -11,8 +11,8 @@ static char *rcsid = "$Id: log.c,v 1.12 2000/10/16 05:00:18 ishisone Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -149,7 +149,8 @@ mdn_log_setlevel(int level) {
int
mdn_log_getlevel(void) {
initialize();
if (log_level < 0)
initialize();
return log_level;
}

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: mace.c,v 1.1 2002/02/08 05:40:14 marka Exp $";
static char *rcsid = "$Id: mace.c,v 1.1.2.1 2002/02/08 12:14:01 marka Exp $";
#endif
/*

View file

@ -1,4 +1,4 @@
# $Id: make.wnt,v 1.3 2001/06/09 00:30:16 tale Exp $
# $Id: make.wnt,v 1.3.2.1 2002/02/08 12:14:03 marka Exp $
# Makefile for MDN library, manually configured for WIN-NT (VC5.0)
#
# Copyright (c) 2000 Japan Network Information Center. All rights reserved.
@ -9,8 +9,8 @@
#
# The following License Terms and Conditions apply, unless a different
# license is obtained from Japan Network Information Center ("JPNIC"),
# a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
# Tokyo, Japan.
# a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
# Chiyoda-ku, Tokyo 101-0047, Japan.
#
# 1. Use, Modification and Redistribution (including distribution of any
# modified or derived work) in source and/or binary forms is permitted
@ -75,6 +75,9 @@ HDRS = $(ICONVDIR)\iconv.h \
$(INCDIR)\mdn\amcacem.h \
$(INCDIR)\mdn\amcaceo.h \
$(INCDIR)\mdn\amcacer.h \
$(INCDIR)\mdn\amcacev.h \
$(INCDIR)\mdn\amcacew.h \
$(INCDIR)\mdn\amcacez.h \
$(INCDIR)\mdn\api.h \
$(INCDIR)\mdn\assert.h \
$(INCDIR)\mdn\brace.h \
@ -90,6 +93,7 @@ HDRS = $(ICONVDIR)\iconv.h \
$(INCDIR)\mdn\localencoding.h \
$(INCDIR)\mdn\log.h \
$(INCDIR)\mdn\logmacro.h \
$(INCDIR)\mdn\mace.h \
$(INCDIR)\mdn\mapper.h \
$(INCDIR)\mdn\mapselector.h \
$(INCDIR)\mdn\msgheader.h \
@ -112,24 +116,27 @@ HDRS = $(ICONVDIR)\iconv.h \
$(INCDIR)\mdn\util.h \
$(INCDIR)\mdn\version.h
SRCS = ace.c altdude.c amcacem.c amcaceo.c amcacer.c api.c \
SRCS = ace.c altdude.c amcacem.c amcaceo.c amcacer.c \
amcacev.c amcacew.c amcacez.c api.c \
brace.c checker.c converter.c \
debug.c delimitermap.c dn.c dude.c \
filechecker.c filemapper.c \
lace.c localencoding.c log.c \
mapper.c mapselector.c msgheader.c msgtrans.c \
nameprep.c normalizer.c \
mace.c mapper.c mapselector.c msgheader.c msgtrans.c \
nameprep.c nameprep_template.c nameprepdata.c normalizer.c \
race.c res.c resconf.c result.c \
selectiveencode.c strhash.c \
ucsmap.c ucsset.c unicode.c unormalize.c \
ucsmap.c ucsset.c unicode.c unicode_template.c \
unicodedata_301.c unicodedata_310.c unormalize.c \
utf5.c utf6.c utf8.c util.c version.c
OBJS = ace.obj altdude.obj amcacem.obj amcaceo.obj amcacer.obj api.obj \
OBJS = ace.obj altdude.obj amcacem.obj amcaceo.obj amcacer.obj \
amcacev.obj amcacew.obj amcacez.obj api.obj \
brace.obj checker.obj converter.obj \
debug.obj delimitermap.obj dn.obj dude.obj \
filechecker.obj filemapper.obj \
lace.obj localencoding.obj log.obj \
mapper.obj mapselector.obj msgheader.obj msgtrans.obj \
mace.obj mapper.obj mapselector.obj msgheader.obj msgtrans.obj \
nameprep.obj normalizer.obj \
race.obj res.obj resconf.obj result.obj \
selectiveencode.obj strhash.obj \
@ -157,16 +164,25 @@ libmdn.lib: $(OBJS)
ace.obj: ace.c $(HDRS)
$(cc) $(cflags) $(cvarsdll) -I$(INCDIR) -I$(ICONVDIR) $(DBG) $*.c
altdude.obj: ace.c $(HDRS)
altdude.obj: altdude.c $(HDRS)
$(cc) $(cflags) $(cvarsdll) -I$(INCDIR) -I$(ICONVDIR) $(DBG) $*.c
amcacem.obj: ace.c $(HDRS)
amcacem.obj: amcacem.c $(HDRS)
$(cc) $(cflags) $(cvarsdll) -I$(INCDIR) -I$(ICONVDIR) $(DBG) $*.c
amcaceo.obj: ace.c $(HDRS)
amcaceo.obj: amcaceo.c $(HDRS)
$(cc) $(cflags) $(cvarsdll) -I$(INCDIR) -I$(ICONVDIR) $(DBG) $*.c
amcacer.obj: ace.c $(HDRS)
amcacer.obj: amcacer.c $(HDRS)
$(cc) $(cflags) $(cvarsdll) -I$(INCDIR) -I$(ICONVDIR) $(DBG) $*.c
amcacev.obj: amcacev.c $(HDRS)
$(cc) $(cflags) $(cvarsdll) -I$(INCDIR) -I$(ICONVDIR) $(DBG) $*.c
amcacew.obj: amcacew.c $(HDRS)
$(cc) $(cflags) $(cvarsdll) -I$(INCDIR) -I$(ICONVDIR) $(DBG) $*.c
amcacez.obj: amcacez.c $(HDRS)
$(cc) $(cflags) $(cvarsdll) -I$(INCDIR) -I$(ICONVDIR) $(DBG) $*.c
api.obj: api.c $(HDRS)
@ -208,6 +224,9 @@ localencoding.obj: localencoding.c $(HDRS)
log.obj: log.c $(HDRS)
$(cc) $(cflags) $(cvarsdll) -I$(INCDIR) -I$(ICONVDIR) $(DBG) $*.c
mace.obj: mace.c $(HDRS)
$(cc) $(cflags) $(cvarsdll) -I$(INCDIR) -I$(ICONVDIR) $(DBG) $*.c
mapper.obj: mapper.c $(HDRS)
$(cc) $(cflags) $(cvarsdll) -I$(INCDIR) -I$(ICONVDIR) $(DBG) $*.c
@ -250,7 +269,7 @@ ucsmap.obj: ucsmap.c $(HDRS)
ucsset.obj: ucsset.c $(HDRS)
$(cc) $(cflags) $(cvarsdll) -I$(INCDIR) -I$(ICONVDIR) $(DBG) $*.c
unicode.obj: unicode.c unicodedata.c $(HDRS)
unicode.obj: unicode.c unicode_template.c unicodedata_301.c unicodedata_310.c $(HDRS)
$(cc) $(cflags) $(cvarsdll) -I$(INCDIR) -I$(ICONVDIR) $(DBG) $*.c
unormalize.obj: unormalize.c $(HDRS)

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: mapper.c,v 1.1 2001/06/09 00:30:17 tale Exp $";
static char *rcsid = "$Id: mapper.c,v 1.1.2.1 2002/02/08 12:14:04 marka Exp $";
#endif
/*
@ -11,8 +11,8 @@ static char *rcsid = "$Id: mapper.c,v 1.1 2001/06/09 00:30:17 tale Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -88,18 +88,27 @@ typedef struct {
/*
* Standard mapping schemes.
*/
static const map_scheme_t nameprep_02_scheme = {
"nameprep-02",
"nameprep-02",
static const map_scheme_t nameprep_03_scheme = {
"nameprep-03",
"nameprep-03",
mdn__nameprep_createproc,
mdn__nameprep_destroyproc,
mdn__nameprep_mapproc,
NULL,
};
static const map_scheme_t nameprep_03_scheme = {
"nameprep-03",
"nameprep-03",
static const map_scheme_t nameprep_05_scheme = {
"nameprep-05",
"nameprep-05",
mdn__nameprep_createproc,
mdn__nameprep_destroyproc,
mdn__nameprep_mapproc,
NULL,
};
static const map_scheme_t nameprep_06_scheme = {
"nameprep-06",
"nameprep-06",
mdn__nameprep_createproc,
mdn__nameprep_destroyproc,
mdn__nameprep_mapproc,
@ -116,8 +125,9 @@ static const map_scheme_t filemap_scheme = {
};
static const map_scheme_t *standard_map_schemes[] = {
&nameprep_02_scheme,
&nameprep_03_scheme,
&nameprep_05_scheme,
&nameprep_06_scheme,
&filemap_scheme,
NULL,
};
@ -327,6 +337,9 @@ mdn_mapper_add(mdn_mapper_t ctx, const char *scheme_name) {
ctx->schemes[ctx->nschemes].context = scheme_context;
ctx->nschemes++;
if (buffer != static_buffer)
free(buffer);
return (mdn_success);
failure:
@ -465,6 +478,8 @@ mdn_mapper_map(mdn_mapper_t ctx, const char *from, char *to, size_t tolen) {
i++;
}
free(dynamic_buffers[0]);
free(dynamic_buffers[1]);
return (mdn_success);
failure:

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: mapselector.c,v 1.1 2001/06/09 00:30:17 tale Exp $";
static char *rcsid = "$Id: mapselector.c,v 1.1.2.1 2002/02/08 12:14:05 marka Exp $";
#endif
/*
@ -11,8 +11,8 @@ static char *rcsid = "$Id: mapselector.c,v 1.1 2001/06/09 00:30:17 tale Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,4 +1,4 @@
# $Id: mdn.conf.sample.in,v 1.1 2001/06/09 00:30:17 tale Exp $
# $Id: mdn.conf.sample.in,v 1.1.2.1 2002/02/08 12:14:06 marka Exp $
#
# Sample file for mDNkit version 2 resolver configuration file (mdn.conf).
#
@ -10,16 +10,10 @@
# of multilingualized names by resolvers and DNS servers. Currently, the
# following encodings are available:
#
# RACE
# BRACE
# LACE
# AMC-ACE-Z
# DUDE
# UTF-6
# RACE
# UTF-8
# AltDUDE
# AMC-ACE-M
# AMC-ACE-O
# AMC-ACE-R
# <codeset names your iconv_open() accepts>
#
# syntax)
@ -33,8 +27,10 @@ idn-encoding RACE
#
# nameprep-03 -- name preparation scheme described in the
# IETF draft `idn-nameprep-03'
# nameprep-02 -- name preparation scheme described in the
# IETF draft `idn-nameprep-02'
# nameprep-05 -- name preparation scheme described in the
# IETF draft `idn-nameprep-05'
# nameprep-06 -- name preparation scheme described in the
# IETF draft `idn-nameprep-06'
#
# syntax)
# nameprep <nameprep version>
@ -49,7 +45,7 @@ idn-encoding RACE
# If both `nameprep' and more-specific entries (i.e. `nameprep-*' entries)
# are specified, more-specific ones take precedence.
#
nameprep nameprep-03
nameprep nameprep-06
#
# `nameprep-map' entry specifies the mapping scheme of NAMEPREP process.
@ -63,27 +59,26 @@ nameprep nameprep-03
#
# If multiple schemes are specified, they are applied in turn.
#
#nameprep-map nameprep-03
#nameprep-map nameprep-06
#
# `nameprep-normalize' entry specifies the normalization scheme of NAMEPREP
# process. Avaialable normalization schemes are:
#
# <nameprep version> -- nameprep version
# ascii-lowercase -- ASCII uppercase letters to lowercase
# ascii-uppercase -- ASCII lowercase letters to uppercase
# unicode-lowercase -- Unicode uppercase letters to lowercase
# unicode-uppercase -- Unicode lowercase letters to uppercase
# unicode-foldcase -- Unicode case-folding.
# unicode-form-c -- Unicode normalization form C
# unicode-form-kc -- Unicode normalization form KC
# defined by the latest standard.
# unicode-form-kc/3.0.1 -- Unicode normalization form KC
# defined by Unicode 3.0.1.
# unicode-form-kc/3.1.0 -- Unicode normalization form KC
# defined by Unicode 3.1.
#
# syntax)
# nameprep-normalize <scheme> ...
#
# If multiple schemes are specified, they are applied in turn.
#
#nameprep-normalize nameprep-03
#nameprep-normalize nameprep-06
#
# `nameprep-prohibit' entry specifies the prohibited characters in the
@ -97,7 +92,7 @@ nameprep nameprep-03
#
# If multiple sets are specified, they are applied in turn.
#
#nameprep-prohibit nameprep-03
#nameprep-prohibit nameprep-06
#
# `nameprep-unassigned' entry specifies the unassigned characters in the
@ -111,19 +106,7 @@ nameprep nameprep-03
#
# If multiple sets are specified, they are applied in turn.
#
#nameprep-unassigned nameprep-03
#
# `alternate-encoding' entry specifies the alternative encoding to use in
# case of the conversion from IDN encoding to the application's local
# encoding fails due to the lack of certain character in the character set
# of the local encoding. The alternative encoding must be ASCII compatible
# encoding (ACE).
#
# syntax)
# alternate-encoding <encoding>
#
alternate-encoding RACE
#nameprep-unassigned nameprep-06
#
# `encoding-alias-file' specifies the file which defines encoding name

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: msgheader.c,v 1.7 2000/09/20 02:47:31 ishisone Exp $";
static char *rcsid = "$Id: msgheader.c,v 1.1 2002/01/02 02:46:44 marka Exp $";
#endif
/*
@ -11,8 +11,8 @@ static char *rcsid = "$Id: msgheader.c,v 1.7 2000/09/20 02:47:31 ishisone Exp $"
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: msgtrans.c,v 1.24 2001/02/21 05:54:17 m-kasahr Exp $";
static char *rcsid = "$Id: msgtrans.c,v 1.1 2002/01/02 02:46:45 marka Exp $";
#endif
/*
@ -12,8 +12,8 @@ static char *rcsid = "$Id: msgtrans.c,v 1.24 2001/02/21 05:54:17 m-kasahr Exp $"
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -92,29 +92,18 @@ static char *rcsid = "$Id: msgtrans.c,v 1.24 2001/02/21 05:54:17 m-kasahr Exp $"
#include <mdn/dn.h>
#include <mdn/debug.h>
/*
* Name translation instructions.
*
* For query, perform
* 1. local encoding to UTF-8 conversion
* 2. delimiter mapping
* 3. local mapping
* 4. nameprep
* 5. UTF-8 to IDN encoding conversion
*
* For reply,
* 1. IDN encoding to UTF-8 conversion
* 2. UTF-8 to local encoding conversion
*
* See mdn/res.h for the mnemonic.
*/
#define INSN_QUERY "ldMNI"
#define INSN_REPLY "iL"
#define DNS_HEADER_SIZE 12
#define DNAME_SIZE 512
#define RRFORMAT_HASH_SIZE 47
/*
* Translation directions.
*/
enum {
transdir_query = 0,
transdir_reply = 1
};
/*
* DNS opcodes.
*/
@ -165,7 +154,7 @@ enum {
};
typedef struct msgtrans_ctx {
char *insn; /* name translation instruction */
int transdir; /* direction of translation */
const char *in; /* input message */
size_t in_len; /* length of it */
const char *in_ptr; /* current pointer */
@ -209,6 +198,35 @@ static struct rrformat {
};
static struct rrformat *rrformathash[RRFORMAT_HASH_SIZE];
/*
* Name translation instructions.
*
* For query, perform
* 1. local encoding to UTF-8 conversion
* 2. delimiter mapping
* 3. local mapping
* 4. nameprep
* 5. UTF-8 to IDN encoding conversion
*
* For reply,
* 1. IDN encoding to UTF-8 conversion
* 2. UTF-8 to local encoding conversion
*
* See mdn/res.h for the mnemonic.
*/
static const char *trans_insn[] = {
"ldMNI", /* insn for QUERY (transdir_query) */
"i!NL", /* insn for REPLY (transdir_reply) */
};
/*
* Labels of translation directions, used for log messages.
*/
static const char *trans_labels[] = {
"QUERY", /* QUERY (transdir_query) */
"REPLY", /* REPLY (transdir_reply) */
};
static mdn_result_t copy_header(msgtrans_ctx_t *ctx);
static mdn_result_t translate_question(msgtrans_ctx_t *ctx);
static mdn_result_t translate_rr(msgtrans_ctx_t *ctx);
@ -348,17 +366,33 @@ translate_question(msgtrans_ctx_t *ctx) {
if ((r = get_domainname(ctx, qname, sizeof(qname))) != mdn_success)
return (r);
INFO(("request of QNAME %s translation: name=\"%s\"\n",
trans_labels[ctx->transdir], mdn_debug_xstring(qname, 256)));
/* Translate QNAME. */
r = mdn_res_nameconv(ctx->conf, ctx->insn, qname,
r = mdn_res_nameconv(ctx->conf, trans_insn[ctx->transdir], qname,
qname_translated, sizeof(qname_translated));
if (r != mdn_success)
return (r);
if ((r = put_domainname(ctx, qname_translated)) != mdn_success)
return (r);
goto failure;
r = put_domainname(ctx, qname_translated);
if (r != mdn_success)
goto failure;
/* Copy QTYPE and QCLASS */
return (copy_message(ctx, 4));
r = copy_message(ctx, 4);
if (r != mdn_success)
goto failure;
INFO(("result of QNAME %s translation: name=\"%s\"\n",
trans_labels[ctx->transdir],
mdn_debug_xstring(qname_translated, 256)));
return (mdn_success);
failure:
INFO(("QNAME %s translation failed, %s\n",
trans_labels[ctx->transdir], mdn_result_tostring(r)));
return (r);
}
static mdn_result_t
@ -373,18 +407,23 @@ translate_rr(msgtrans_ctx_t *ctx) {
if ((r = get_domainname(ctx, dname, sizeof(dname))) != mdn_success)
return (r);
INFO(("request of RR NAME %s translation: name=\"%s\"\n",
trans_labels[ctx->transdir], mdn_debug_xstring(dname, 256)));
/* Translate NAME. */
r = mdn_res_nameconv(ctx->conf, ctx->insn, dname,
r = mdn_res_nameconv(ctx->conf, trans_insn[ctx->transdir], dname,
dname_translated, sizeof(dname_translated));
if (r != mdn_success)
return (r);
if ((r = put_domainname(ctx, dname_translated)) != mdn_success)
return (r);
goto failure;
r = put_domainname(ctx, dname_translated);
if (r != mdn_success)
goto failure;
/* Get TYPE and CLASS */
if (ctx->in_remain < 10)
return (mdn_invalid_message);
if (ctx->in_remain < 10) {
r = mdn_invalid_message;
goto failure;
}
p = (unsigned char *)ctx->in_ptr;
#define GET16(off) ((p[off]<<8)+p[(off)+1])
rr_type = GET16(0);
@ -393,23 +432,33 @@ translate_rr(msgtrans_ctx_t *ctx) {
#undef GET16
/* Copy TYPE, CLASS, TTL and RDLENGTH. */
if ((r = copy_message(ctx, 10)) != mdn_success)
return (r);
r = copy_message(ctx, 10);
if (r != mdn_success)
goto failure;
/* Remember the current output length. */
length_before = output_length(ctx);
/* Translate RDATA. */
r = translate_rdata(ctx, rr_type, rr_class, rr_length);
if (r != mdn_success)
goto failure;
if (r == mdn_success) {
/* Reset RDLENGTH */
rr_length = output_length(ctx) - length_before;
ctx->out[length_before - 2] = (rr_length >> 8) & 0xff;
ctx->out[length_before - 1] = rr_length & 0xff;
}
/* Reset RDLENGTH */
rr_length = output_length(ctx) - length_before;
ctx->out[length_before - 2] = (rr_length >> 8) & 0xff;
ctx->out[length_before - 1] = rr_length & 0xff;
INFO(("result of RR NAME %s translation: name=\"%s\"\n",
trans_labels[ctx->transdir],
mdn_debug_xstring(dname_translated, 256)));
return (r);
failure:
INFO(("RR NAME %s translation failed, %s\n",
trans_labels[ctx->transdir], mdn_result_tostring(r)));
return (r);
}
static mdn_result_t
@ -510,16 +559,27 @@ translate_domain(msgtrans_ctx_t *ctx) {
if ((r = get_domainname(ctx, dname, sizeof(dname))) != mdn_success)
return (r);
INFO(("request of RDATA %s translation: name=\"%s\"\n",
trans_labels[ctx->transdir], mdn_debug_xstring(dname, 256)));
/* Translate NAME. */
r = mdn_res_nameconv(ctx->conf, ctx->insn, dname,
r = mdn_res_nameconv(ctx->conf, trans_insn[ctx->transdir], dname,
dname_translated, sizeof(dname_translated));
if (r != mdn_success)
return (r);
goto failure;
if ((r = put_domainname(ctx, dname_translated)) != mdn_success)
return (r);
goto failure;
INFO(("result of RDATA %s translation: name=\"%s\"\n",
trans_labels[ctx->transdir],
mdn_debug_xstring(dname_translated, 256)));
return (mdn_success);
failure:
INFO(("RDATA %s translation failed, %s\n",
trans_labels[ctx->transdir], mdn_result_tostring(r)));
return (r);
}
static mdn_result_t
@ -554,7 +614,7 @@ static void
ctx_init(msgtrans_ctx_t *ctx, mdn_resconf_t conf, mdn_msgheader_t *header,
const char *msg, size_t msglen, char *outbuf, size_t outbufsize)
{
ctx->insn = (header->qr == 0) ? INSN_QUERY : INSN_REPLY;
ctx->transdir = (header->qr == 0) ? transdir_query : transdir_reply;
ctx->in = ctx->in_ptr = msg;
ctx->in_len = ctx->in_remain = msglen;
ctx->out = ctx->out_ptr = outbuf;

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: nameprep.c,v 1.1 2001/06/09 00:30:19 tale Exp $";
static char *rcsid = "$Id: nameprep.c,v 1.1.2.1 2002/02/08 12:14:10 marka Exp $";
#endif
/*
@ -11,8 +11,8 @@ static char *rcsid = "$Id: nameprep.c,v 1.1 2001/06/09 00:30:19 tale Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -79,7 +79,7 @@ static char *rcsid = "$Id: nameprep.c,v 1.1 2001/06/09 00:30:19 tale Exp $";
/*
* The latest version.
*/
#define NAMEPREP_CURRENT "nameprep-03"
#define NAMEPREP_CURRENT "nameprep-05"
/*
* Load NAMEPREP compiled tables.
@ -90,16 +90,20 @@ static char *rcsid = "$Id: nameprep.c,v 1.1 2001/06/09 00:30:19 tale Exp $";
* Define mapping/checking functions for each version of the draft.
*/
#define VERSION id02
#include "nameprep_template.c"
#undef VERSION
#define VERSION id03
#include "nameprep_template.c"
#undef VERSION
typedef char *(*nameprep_mapproc)(unsigned long v);
typedef int (*nameprep_checkproc)(unsigned long v);
#define VERSION id05
#include "nameprep_template.c"
#undef VERSION
#define VERSION id06
#include "nameprep_template.c"
#undef VERSION
typedef const char *(*nameprep_mapproc)(unsigned long v);
typedef int (*nameprep_checkproc)(unsigned long v);
static struct mdn_nameprep {
char *version;
@ -112,8 +116,9 @@ static struct mdn_nameprep {
compose_sym2(nameprep_map_, id), \
compose_sym2(nameprep_prohibited_, id), \
compose_sym2(nameprep_unassigned_, id) }
MAKE_NAMEPREP_HANDLE("nameprep-02", id02),
MAKE_NAMEPREP_HANDLE("nameprep-03", id03),
MAKE_NAMEPREP_HANDLE("nameprep-05", id05),
MAKE_NAMEPREP_HANDLE("nameprep-06", id06),
{ NULL, NULL, NULL },
};
@ -170,7 +175,7 @@ mdn_nameprep_map(mdn_nameprep_t handle, const char *from,
while (fromlen > 0) {
unsigned long v;
int w;
char *mapped;
const char *mapped;
if ((w = mdn_utf8_getwc(from, fromlen, &v)) == 0)
return (mdn_invalid_encoding);

View file

@ -1,4 +1,4 @@
/* $Id: nameprep_template.c,v 1.1 2001/06/09 00:30:19 tale Exp $ */
/* $Id: nameprep_template.c,v 1.1.2.1 2002/02/08 12:14:11 marka Exp $ */
/*
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
@ -9,8 +9,8 @@
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -86,7 +86,7 @@
#endif /* NAMEPREP_TEMPLATE_INIT */
static char *
static const char *
compose_sym2(nameprep_map_, VERSION) (unsigned long v) {
int idx0 = IDX0(MAP, v);
int idx1 = IDX1(MAP, v);
@ -99,7 +99,7 @@ compose_sym2(nameprep_map_, VERSION) (unsigned long v) {
offset = TABLE[IMAP[IMAP[idx0] + idx1]].tbl[idx2];
if (offset == 0)
return (NULL); /* no mapping */
return (char *)(DATA + offset);
return (const char *)(DATA + offset);
#undef IMAP
#undef TABLE
#undef DATA
@ -110,7 +110,7 @@ compose_sym2(nameprep_prohibited_, VERSION) (unsigned long v) {
int idx0 = IDX0(PROH, v);
int idx1 = IDX1(PROH, v);
int idx2 = IDX2(PROH, v);
unsigned char *bm;
const unsigned char *bm;
#define IMAP compose_sym3(nameprep_, VERSION, _prohibited_imap)
#define BITMAP compose_sym3(nameprep_, VERSION, _prohibited_bitmap)
@ -125,7 +125,7 @@ compose_sym2(nameprep_unassigned_, VERSION) (unsigned long v) {
int idx0 = IDX0(UNAS, v);
int idx1 = IDX1(UNAS, v);
int idx2 = IDX2(UNAS, v);
unsigned char *bm;
const unsigned char *bm;
#define IMAP compose_sym3(nameprep_, VERSION, _unassigned_imap)
#define BITMAP compose_sym3(nameprep_, VERSION, _unassigned_bitmap)

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: normalizer.c,v 1.25 2001/05/31 05:21:37 ishisone Exp $";
static char *rcsid = "$Id: normalizer.c,v 1.1 2002/01/02 02:46:46 marka Exp $";
#endif
/*
@ -11,8 +11,8 @@ static char *rcsid = "$Id: normalizer.c,v 1.25 2001/05/31 05:21:37 ishisone Exp
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -86,7 +86,8 @@ typedef struct {
mdn_normalizer_proc_t proc;
} normalize_scheme_t;
typedef mdn_result_t (*caseconv_proc_t)(unsigned long, mdn__unicode_context_t,
typedef mdn_result_t (*caseconv_proc_t)(mdn__unicode_version_t,
unsigned long, mdn__unicode_context_t,
unsigned long *, size_t, int *);
struct mdn_normalizer {
@ -99,6 +100,16 @@ struct mdn_normalizer {
static mdn_strhash_t scheme_hash;
static mdn__unicode_version_t vcur = NULL;
static mdn__unicode_version_t v301 = NULL;
static mdn__unicode_version_t v310 = NULL;
#define INIT_VERSION(version, var) \
if (var == NULL) { \
mdn_result_t r = mdn__unicode_create(version, &var); \
if (r != mdn_success) \
return (r); \
}
static mdn_result_t expand_schemes(mdn_normalizer_t ctx);
static mdn_result_t register_standard_normalizers(void);
static mdn_result_t normalizer_ascii_lowercase(const char *from,
@ -112,10 +123,35 @@ static mdn_result_t normalizer_unicode_uppercase(const char *from,
static mdn_result_t normalizer_unicode_caseconv(caseconv_proc_t caseconv,
const char *from,
char *to, size_t tolen);
static mdn__unicode_context_t get_casemap_context(const char *from,
static mdn__unicode_context_t get_casemap_context(mdn__unicode_version_t ver,
const char *from,
size_t fromlen);
static mdn_result_t normalizer_unicode_casefold(const char *from,
char *to, size_t tolen);
static mdn_result_t normalizer_formc(const char *from,
char *to, size_t tolen);
static mdn_result_t normalizer_formd(const char *from,
char *to, size_t tolen);
static mdn_result_t normalizer_formkc(const char *from,
char *to, size_t tolen);
static mdn_result_t normalizer_formkd(const char *from,
char *to, size_t tolen);
static mdn_result_t normalizer_formc_v301(const char *from,
char *to, size_t tolen);
static mdn_result_t normalizer_formd_v301(const char *from,
char *to, size_t tolen);
static mdn_result_t normalizer_formkc_v301(const char *from,
char *to, size_t tolen);
static mdn_result_t normalizer_formkd_v301(const char *from,
char *to, size_t tolen);
static mdn_result_t normalizer_formc_v310(const char *from,
char *to, size_t tolen);
static mdn_result_t normalizer_formd_v310(const char *from,
char *to, size_t tolen);
static mdn_result_t normalizer_formkc_v310(const char *from,
char *to, size_t tolen);
static mdn_result_t normalizer_formkd_v310(const char *from,
char *to, size_t tolen);
static struct standard_normalizer {
char *name;
@ -126,12 +162,21 @@ static struct standard_normalizer {
{ "unicode-lowercase", normalizer_unicode_lowercase },
{ "unicode-uppercase", normalizer_unicode_uppercase },
{ "unicode-foldcase", normalizer_unicode_casefold },
{ "unicode-form-c", mdn__unormalize_formc },
{ "unicode-form-d", mdn__unormalize_formd },
{ "unicode-form-kc", mdn__unormalize_formkc },
{ "unicode-form-kd", mdn__unormalize_formkd },
{ "nameprep-02", mdn__unormalize_formkc },
{ "nameprep-03", mdn__unormalize_formkc },
{ "unicode-form-c", normalizer_formc },
{ "unicode-form-d", normalizer_formd },
{ "unicode-form-kc", normalizer_formkc },
{ "unicode-form-kd", normalizer_formkd },
{ "unicode-form-c/3.0.1", normalizer_formc_v301 },
{ "unicode-form-d/3.0.1", normalizer_formd_v301 },
{ "unicode-form-kc/3.0.1", normalizer_formkc_v301 },
{ "unicode-form-kd/3.0.1", normalizer_formkd_v301 },
{ "unicode-form-c/3.1.0", normalizer_formc_v310 },
{ "unicode-form-d/3.1.0", normalizer_formd_v310 },
{ "unicode-form-kc/3.1.0", normalizer_formkc_v310 },
{ "unicode-form-kd/3.1.0", normalizer_formkd_v310 },
{ "nameprep-03", normalizer_formkc_v301 },
{ "nameprep-05", normalizer_formkc_v310 },
{ "nameprep-06", normalizer_formkc_v310 },
{ NULL, NULL },
};
@ -525,6 +570,8 @@ normalizer_unicode_caseconv(caseconv_proc_t caseconv,
{
size_t fromlen = strlen(from);
INIT_VERSION(NULL, vcur);
while (fromlen > 0 && tolen > 0) {
#define CASEMAPBUFSZ 4
unsigned long c;
@ -541,12 +588,12 @@ normalizer_unicode_caseconv(caseconv_proc_t caseconv,
fromlen -= w;
redo:
r = (*caseconv)(c, ctx, v, CASEMAPBUFSZ, &vlen);
r = (*caseconv)(vcur, c, ctx, v, CASEMAPBUFSZ, &vlen);
switch (r) {
case mdn_success:
break;
case mdn_context_required:
ctx = get_casemap_context(from, fromlen);
ctx = get_casemap_context(vcur, from, fromlen);
goto redo;
case mdn_buffer_overflow:
FATAL(("mdn_normalizer_normalize: "
@ -571,7 +618,8 @@ normalizer_unicode_caseconv(caseconv_proc_t caseconv,
}
static mdn__unicode_context_t
get_casemap_context(const char *from, size_t fromlen) {
get_casemap_context(mdn__unicode_version_t ver,
const char *from, size_t fromlen) {
while (fromlen > 0) {
unsigned long v;
mdn__unicode_context_t ctx;
@ -581,7 +629,7 @@ get_casemap_context(const char *from, size_t fromlen) {
return (mdn_invalid_encoding);
from += w;
fromlen -= w;
ctx = mdn__unicode_getcontext(v);
ctx = mdn__unicode_getcontext(ver, v);
if (ctx == mdn__unicode_context_nonfinal ||
ctx == mdn__unicode_context_final)
return (ctx);
@ -593,6 +641,8 @@ static mdn_result_t
normalizer_unicode_casefold(const char *from, char *to, size_t tolen) {
size_t fromlen = strlen(from);
INIT_VERSION(NULL, vcur);
while (fromlen > 0 && tolen > 0) {
#define CASEFOLDBUFSZ 4
unsigned long c;
@ -607,7 +657,7 @@ normalizer_unicode_casefold(const char *from, char *to, size_t tolen) {
from += w;
fromlen -= w;
r = mdn__unicode_casefold(c, v, CASEFOLDBUFSZ, &vlen);
r = mdn__unicode_casefold(vcur, c, v, CASEFOLDBUFSZ, &vlen);
switch (r) {
case mdn_success:
break;
@ -633,3 +683,87 @@ normalizer_unicode_casefold(const char *from, char *to, size_t tolen) {
return (mdn_success);
}
/*
* Unicode Normalization Forms -- latest version
*/
static mdn_result_t
normalizer_formc(const char *from, char *to, size_t tolen) {
INIT_VERSION(NULL, vcur);
return (mdn__unormalize_formc(vcur, from, to, tolen));
}
static mdn_result_t
normalizer_formd(const char *from, char *to, size_t tolen) {
INIT_VERSION(NULL, vcur);
return (mdn__unormalize_formd(vcur, from, to, tolen));
}
static mdn_result_t
normalizer_formkc(const char *from, char *to, size_t tolen) {
INIT_VERSION(NULL, vcur);
return (mdn__unormalize_formkc(vcur, from, to, tolen));
}
static mdn_result_t
normalizer_formkd(const char *from, char *to, size_t tolen) {
INIT_VERSION(NULL, vcur);
return (mdn__unormalize_formkd(vcur, from, to, tolen));
}
/*
* Unicode Normalization Forms -- version 3.0.1
*/
static mdn_result_t
normalizer_formc_v301(const char *from, char *to, size_t tolen) {
INIT_VERSION("3.0.1", v301);
return (mdn__unormalize_formc(v301, from, to, tolen));
}
static mdn_result_t
normalizer_formd_v301(const char *from, char *to, size_t tolen) {
INIT_VERSION("3.0.1", v301);
return (mdn__unormalize_formd(v301, from, to, tolen));
}
static mdn_result_t
normalizer_formkc_v301(const char *from, char *to, size_t tolen) {
INIT_VERSION("3.0.1", v301);
return (mdn__unormalize_formkc(v301, from, to, tolen));
}
static mdn_result_t
normalizer_formkd_v301(const char *from, char *to, size_t tolen) {
INIT_VERSION("3.0.1", v301);
return (mdn__unormalize_formkd(v301, from, to, tolen));
}
/*
* Unicode Normalization Forms -- version 3.1.0
*/
static mdn_result_t
normalizer_formc_v310(const char *from, char *to, size_t tolen) {
INIT_VERSION("3.1.0", v310);
return (mdn__unormalize_formc(v310, from, to, tolen));
}
static mdn_result_t
normalizer_formd_v310(const char *from, char *to, size_t tolen) {
INIT_VERSION("3.1.0", v310);
return (mdn__unormalize_formd(v310, from, to, tolen));
}
static mdn_result_t
normalizer_formkc_v310(const char *from, char *to, size_t tolen) {
INIT_VERSION("3.1.0", v310);
return (mdn__unormalize_formkc(v310, from, to, tolen));
}
static mdn_result_t
normalizer_formkd_v310(const char *from, char *to, size_t tolen) {
INIT_VERSION("3.1.0", v310);
return (mdn__unormalize_formkd(v310, from, to, tolen));
}

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: race.c,v 1.23 2001/03/07 00:58:52 ishisone Exp $";
static char *rcsid = "$Id: race.c,v 1.1 2002/01/02 02:46:46 marka Exp $";
#endif
/*
@ -11,8 +11,8 @@ static char *rcsid = "$Id: race.c,v 1.23 2001/03/07 00:58:52 ishisone Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted

View file

@ -1,5 +1,5 @@
#ifndef lint
static char *rcsid = "$Id: res.c,v 1.17 2001/05/15 05:04:00 ishisone Exp $";
static char *rcsid = "$Id: res.c,v 1.1 2002/01/02 02:46:46 marka Exp $";
#endif
/*
@ -11,8 +11,8 @@ static char *rcsid = "$Id: res.c,v 1.17 2001/05/15 05:04:00 ishisone Exp $";
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
* Tokyo, Japan.
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* modified or derived work) in source and/or binary forms is permitted
@ -96,45 +96,42 @@ static mdn_result_t nameconv_p(mdn_resconf_t ctx, const char *from,
char *to, size_t tolen);
static mdn_result_t nameconv_u(mdn_resconf_t ctx, const char *from,
char *to, size_t tolen);
static mdn_result_t nameconv_N(mdn_resconf_t ctx, const char *from,
char *to, size_t tolen);
static mdn_result_t nameconv_I(mdn_resconf_t ctx, const char *from,
char *to, size_t tolen);
static mdn_result_t nameconv_i(mdn_resconf_t ctx, const char *from,
char *to, size_t tolen);
static mdn_result_t nameconv_a(mdn_resconf_t ctx, const char *from,
char *to, size_t tolen);
static mdn_result_t nameconv_A(mdn_resconf_t ctx, const char *from,
char *to, size_t tolen);
static mdn_result_t nameconv_xm(mdn_resconf_t ctx, const char *from,
char *to, size_t tolen);
static mdn_result_t nameconv_xn(mdn_resconf_t ctx, const char *from,
char *to, size_t tolen);
static mdn_result_t nameconv_xp(mdn_resconf_t ctx, const char *from,
char *to, size_t tolen);
static mdn_result_t nameconv_xu(mdn_resconf_t ctx, const char *from,
char *to, size_t tolen);
static mdn_result_t nameconv_xN(mdn_resconf_t ctx, const char *from,
char *to, size_t tolen);
static mdn_result_t copy_verbatim(const char *from, char *to,
size_t tolen);
mdn_result_t
mdn_res_nameconv(mdn_resconf_t ctx, const char *actions, const char *from,
mdn_res_nameconv(mdn_resconf_t ctx, const char *insn, const char *from,
char *to, size_t tolen)
{
mdn_result_t r;
size_t fromlen;
char *src, *dst;
char static_buffers[2][1024]; /* large enough */
char *dynamic_buffers[2];
size_t dynamic_buflen[2];
char actions_buffer[64]; /* large enough */
char *ap;
const char *ap;
size_t dstlen;
int idx;
int dstidx;
assert(ctx != NULL && from != NULL && to != NULL);
TRACE(("mdn_res_nameconv(from=\"%s\")\n",
mdn_debug_xstring(from, 20)));
/*
* Copy `actions' to `actions_buffer' + 2.
* We make two characters space to extend the action `N'.
*/
if (strlen(actions) + 1 > sizeof(actions_buffer) - 2)
return (mdn_invalid_action);
strcpy(actions_buffer + 2, actions);
ap = actions_buffer + 2;
TRACE(("mdn_res_nameconv(insn=%s, from=\"%s\", tolen=%d)\n",
insn, mdn_debug_xstring(from, 256), tolen));
/*
* Initialize the buffers to use the local
@ -145,13 +142,12 @@ mdn_res_nameconv(mdn_resconf_t ctx, const char *actions, const char *from,
dynamic_buflen[0] = 0;
dynamic_buflen[1] = 0;
fromlen = strlen(from);
/*
* Convert.
*/
src = (void *)from;
dstlen = fromlen + 1;
dstlen = sizeof(static_buffers[0]) + 1;
ap = insn;
while (*ap != '\0') {
if (*ap == ' ' || *ap == '\t') {
@ -162,56 +158,31 @@ mdn_res_nameconv(mdn_resconf_t ctx, const char *actions, const char *from,
/*
* Choose destination area to restore the result of a mapping.
*/
if (*ap == 'p' || *ap == 'u') {
dst = src;
} else if (dstlen <= sizeof(static_buffers[0])) {
if (dstlen <= sizeof(static_buffers[0])) {
if (src == static_buffers[0])
idx = 1;
dstidx = 1;
else
idx = 0;
dst = static_buffers[idx];
dstlen = sizeof(static_buffers[0]);
dstidx = 0;
dst = static_buffers[dstidx];
} else {
void *newbuf;
if (src == dynamic_buffers[0])
idx = 1;
dstidx = 1;
else
idx = 0;
dstidx = 0;
if (dynamic_buflen[idx] == 0) {
dynamic_buffers[idx] = (char *) malloc(dstlen);
if (dynamic_buffers[idx] == NULL) {
r = mdn_nomemory;
goto failure;
}
dynamic_buflen[idx] = dstlen;
} else if (dynamic_buflen[idx] < dstlen) {
char *newbuf;
newbuf = realloc(dynamic_buffers[idx], dstlen);
if (newbuf == NULL) {
r = mdn_nomemory;
goto failure;
}
dynamic_buffers[idx] = newbuf;
dynamic_buflen[idx] = dstlen;
newbuf = (char *)realloc(dynamic_buffers[dstidx],
dstlen);
if (newbuf == NULL) {
r = mdn_nomemory;
goto failure;
}
dynamic_buffers[dstidx] = newbuf;
dynamic_buflen[dstidx] = dstlen;
dst = dynamic_buffers[idx];
dstlen = dynamic_buflen[idx];
}
/*
* Determine an action character.
* If the current action is `N', we resolve it into "mnp".
*/
if (*ap == 'N') {
*(ap - 2) = 'm';
*(ap - 1) = 'n';
*ap = 'p';
ap -= 2;
dst = dynamic_buffers[dstidx];
}
/*
@ -243,17 +214,37 @@ mdn_res_nameconv(mdn_resconf_t ctx, const char *actions, const char *from,
case 'u':
r = nameconv_u(ctx, src, dst, dstlen);
break;
case 'N':
r = nameconv_N(ctx, src, dst, dstlen);
break;
case 'I':
r = nameconv_I(ctx, src, dst, dstlen);
break;
case 'i':
r = nameconv_i(ctx, src, dst, dstlen);
break;
case 'a':
r = nameconv_a(ctx, src, dst, dstlen);
break;
case 'A':
r = nameconv_A(ctx, src, dst, dstlen);
case '!':
ap++;
switch (*ap) {
case 'm':
r = nameconv_xm(ctx, src, dst, dstlen);
break;
case 'n':
r = nameconv_xn(ctx, src, dst, dstlen);
break;
case 'p':
r = nameconv_xp(ctx, src, dst, dstlen);
break;
case 'u':
r = nameconv_xu(ctx, src, dst, dstlen);
break;
case 'N':
r = nameconv_xN(ctx, src, dst, dstlen);
break;
default:
r = mdn_invalid_action;
break;
}
break;
default:
r = mdn_invalid_action;
@ -274,9 +265,15 @@ mdn_res_nameconv(mdn_resconf_t ctx, const char *actions, const char *from,
if (r != mdn_success)
goto failure;
TRACE(("mdn_res_nameconv: to=\"%s\"\n",
mdn_debug_xstring(to, 256)));
free(dynamic_buffers[0]);
free(dynamic_buffers[1]);
return (mdn_success);
failure:
TRACE(("mdn_res_nameconv() failed, %s\n", mdn_result_tostring(r)));
free(dynamic_buffers[0]);
free(dynamic_buffers[1]);
return (r);
@ -287,16 +284,7 @@ nameconv_l(mdn_resconf_t ctx, const char *from, char *to, size_t tolen)
{
mdn_result_t r;
mdn_converter_t local_converter;
mdn_converter_t alternate_converter;
alternate_converter = mdn_resconf_getalternateconverter(ctx);
if (alternate_converter != NULL) {
r = mdn_converter_localtoutf8(alternate_converter, from, to,
tolen);
mdn_converter_destroy(alternate_converter);
if (r == mdn_success && strcmp(from, to) != 0)
return (r);
}
local_converter = mdn_resconf_getlocalconverter(ctx);
if (local_converter != NULL) {
r = mdn_converter_localtoutf8(local_converter, from, to,
@ -314,7 +302,6 @@ nameconv_L(mdn_resconf_t ctx, const char *from, char *to, size_t tolen)
{
mdn_result_t r;
mdn_converter_t local_converter;
mdn_converter_t alternate_converter;
local_converter = mdn_resconf_getlocalconverter(ctx);
if (local_converter != NULL) {
@ -324,15 +311,8 @@ nameconv_L(mdn_resconf_t ctx, const char *from, char *to, size_t tolen)
} else {
r = copy_verbatim(from, to, tolen);
}
if (r != mdn_nomapping)
return (r);
alternate_converter = mdn_resconf_getalternateconverter(ctx);
if (alternate_converter != NULL) {
r = mdn_converter_utf8tolocal(alternate_converter, from, to,
tolen);
mdn_converter_destroy(alternate_converter);
}
if (r == mdn_nomapping)
r = nameconv_I(ctx, from, to, tolen);
return (r);
}
@ -371,46 +351,6 @@ nameconv_M(mdn_resconf_t ctx, const char *from, char *to, size_t tolen)
return (r);
}
static mdn_result_t
nameconv_p(mdn_resconf_t ctx, const char *from, char *to, size_t tolen)
{
mdn_result_t r;
const char *found;
mdn_checker_t prohibit_checker;
prohibit_checker = mdn_resconf_getprohibitchecker(ctx);
if (prohibit_checker != NULL) {
r = mdn_checker_lookup(prohibit_checker, from, &found);
if (found != NULL)
r = mdn_prohibited;
mdn_checker_destroy(prohibit_checker);
} else {
r = mdn_success;
}
return (r);
}
static mdn_result_t
nameconv_u(mdn_resconf_t ctx, const char *from, char *to, size_t tolen)
{
mdn_result_t r;
mdn_checker_t unassigned_checker;
const char *found;
unassigned_checker = mdn_resconf_getunassignedchecker(ctx);
if (unassigned_checker != NULL) {
r = mdn_checker_lookup(unassigned_checker, from, &found);
if (found != NULL)
r = mdn_prohibited;
mdn_checker_destroy(unassigned_checker);
} else {
r = mdn_success;
}
return (r);
}
static mdn_result_t
nameconv_m(mdn_resconf_t ctx, const char *from, char *to, size_t tolen)
{
@ -576,6 +516,96 @@ failure:
return (r);
}
static mdn_result_t
nameconv_p(mdn_resconf_t ctx, const char *from, char *to, size_t tolen)
{
mdn_result_t r;
const char *found;
mdn_checker_t prohibit_checker;
prohibit_checker = mdn_resconf_getprohibitchecker(ctx);
if (prohibit_checker != NULL) {
r = mdn_checker_lookup(prohibit_checker, from, &found);
mdn_checker_destroy(prohibit_checker);
if (r == mdn_success && found != NULL)
r = mdn_prohibited;
if (r != mdn_success)
return (r);
}
r = copy_verbatim(from, to, tolen);
return (r);
}
static mdn_result_t
nameconv_u(mdn_resconf_t ctx, const char *from, char *to, size_t tolen)
{
mdn_result_t r;
mdn_checker_t unassigned_checker;
const char *found;
unassigned_checker = mdn_resconf_getunassignedchecker(ctx);
if (unassigned_checker != NULL) {
r = mdn_checker_lookup(unassigned_checker, from, &found);
mdn_checker_destroy(unassigned_checker);
if (r == mdn_success && found != NULL)
r = mdn_prohibited;
if (r != mdn_success)
return (r);
}
r = copy_verbatim(from, to, tolen);
return (r);
}
static mdn_result_t
nameconv_N(mdn_resconf_t ctx, const char *from, char *to, size_t tolen)
{
mdn_result_t r;
char static_buffer1[1024]; /* large enough */
char static_buffer2[1024]; /* large enough */
char *dynamic_buffer1 = NULL;
char *dynamic_buffer2 = NULL;
char *work1, *work2;
if (tolen <= sizeof(static_buffer1)) {
work1 = static_buffer1;
work2 = static_buffer2;
} else {
dynamic_buffer1 = (char *)malloc(tolen);
dynamic_buffer2 = (char *)malloc(tolen);
if (dynamic_buffer1 == NULL || dynamic_buffer2 == NULL) {
r = mdn_nomemory;
goto failure;
}
work1 = dynamic_buffer1;
work2 = dynamic_buffer2;
}
r = nameconv_m(ctx, from, work1, tolen);
if (r != mdn_success)
goto failure;
r = nameconv_n(ctx, work1, work2, tolen);
if (r != mdn_success)
goto failure;
r = nameconv_p(ctx, work2, to, tolen);
if (r != mdn_success)
goto failure;
free(dynamic_buffer1);
free(dynamic_buffer2);
return (r);
failure:
free(dynamic_buffer1);
free(dynamic_buffer2);
return (r);
}
static mdn_result_t
nameconv_I(mdn_resconf_t ctx, const char *from, char *to, size_t tolen)
{
@ -611,38 +641,156 @@ nameconv_i(mdn_resconf_t ctx, const char *from, char *to, size_t tolen)
}
static mdn_result_t
nameconv_a(mdn_resconf_t ctx, const char *from, char *to, size_t tolen)
nameconv_xm(mdn_resconf_t ctx, const char *from, char *to, size_t tolen)
{
mdn_result_t r;
mdn_converter_t alternate_converter;
mdn_converter_t idn_converter;
int encoding_type;
int isvalid;
alternate_converter = mdn_resconf_getalternateconverter(ctx);
if (alternate_converter != NULL) {
r = mdn_converter_localtoutf8(alternate_converter, from, to,
tolen);
mdn_converter_destroy(alternate_converter);
idn_converter = mdn_resconf_getidnconverter(ctx);
if (idn_converter != NULL) {
encoding_type = mdn_converter_encodingtype(idn_converter);
mdn_converter_destroy(idn_converter);
} else {
encoding_type = MDN_NONACE;
}
r = nameconv_m(ctx, from, to, tolen);
if (r != mdn_success)
return (r);
if (encoding_type == MDN_ACE_STRICTCASE)
isvalid = mdn_util_casematch(from, to, tolen);
else
isvalid = (strcmp(from, to) == 0);
if (isvalid || encoding_type == MDN_NONACE)
r = copy_verbatim(from, to, tolen);
else
r = nameconv_I(ctx, from, to, tolen);
return (r);
}
static mdn_result_t
nameconv_xn(mdn_resconf_t ctx, const char *from, char *to, size_t tolen)
{
mdn_result_t r;
mdn_converter_t idn_converter;
int encoding_type;
int isvalid;
idn_converter = mdn_resconf_getidnconverter(ctx);
if (idn_converter != NULL) {
encoding_type = mdn_converter_encodingtype(idn_converter);
mdn_converter_destroy(idn_converter);
} else {
encoding_type = MDN_NONACE;
}
r = nameconv_n(ctx, from, to, tolen);
if (r != mdn_success)
return (r);
if (encoding_type == MDN_ACE_STRICTCASE)
isvalid = mdn_util_casematch(from, to, tolen);
else
isvalid = (strcmp(from, to) == 0);
if (isvalid || encoding_type == MDN_NONACE)
r = copy_verbatim(from, to, tolen);
else
r = nameconv_I(ctx, from, to, tolen);
return (r);
}
static mdn_result_t
nameconv_xp(mdn_resconf_t ctx, const char *from, char *to, size_t tolen)
{
mdn_result_t r;
mdn_converter_t idn_converter;
int encoding_type;
idn_converter = mdn_resconf_getidnconverter(ctx);
if (idn_converter != NULL) {
encoding_type = mdn_converter_encodingtype(idn_converter);
mdn_converter_destroy(idn_converter);
} else {
encoding_type = MDN_NONACE;
}
r = nameconv_p(ctx, from, to, tolen);
if (r == mdn_prohibited) {
if (encoding_type == MDN_NONACE)
r = copy_verbatim(from, to, tolen);
else
r = nameconv_I(ctx, from, to, tolen);
}
return (r);
}
static mdn_result_t
nameconv_A(mdn_resconf_t ctx, const char *from, char *to, size_t tolen)
nameconv_xu(mdn_resconf_t ctx, const char *from, char *to, size_t tolen)
{
mdn_result_t r;
mdn_converter_t alternate_converter;
mdn_converter_t idn_converter;
int encoding_type;
alternate_converter = mdn_resconf_getalternateconverter(ctx);
if (alternate_converter != NULL) {
r = mdn_converter_utf8tolocal(alternate_converter, from, to,
tolen);
mdn_converter_destroy(alternate_converter);
idn_converter = mdn_resconf_getidnconverter(ctx);
if (idn_converter != NULL) {
encoding_type = mdn_converter_encodingtype(idn_converter);
mdn_converter_destroy(idn_converter);
} else {
r = copy_verbatim(from, to, tolen);
encoding_type = MDN_NONACE;
}
r = nameconv_u(ctx, from, to, tolen);
if (r == mdn_prohibited) {
if (encoding_type == MDN_NONACE)
r = copy_verbatim(from, to, tolen);
else
r = nameconv_I(ctx, from, to, tolen);
}
return (mdn_success);
}
static mdn_result_t
nameconv_xN(mdn_resconf_t ctx, const char *from, char *to, size_t tolen)
{
mdn_result_t r;
mdn_converter_t idn_converter;
int encoding_type;
int isvalid;
idn_converter = mdn_resconf_getidnconverter(ctx);
if (idn_converter != NULL) {
encoding_type = mdn_converter_encodingtype(idn_converter);
mdn_converter_destroy(idn_converter);
} else {
encoding_type = MDN_NONACE;
}
r = nameconv_N(ctx, from, to, tolen);
if (r == mdn_success) {
if (encoding_type == MDN_ACE_STRICTCASE)
isvalid = mdn_util_casematch(from, to, tolen);
else
isvalid = (strcmp(from, to) == 0);
} else if (r == mdn_prohibited) {
isvalid = 0;
} else {
return (r);
}
if (isvalid || encoding_type == MDN_NONACE)
r = copy_verbatim(from, to, tolen);
else
r = nameconv_I(ctx, from, to, tolen);
return (r);
}
@ -661,6 +809,8 @@ copy_verbatim(const char *from, char *to, size_t tolen) {
#undef mdn_res_map
#undef mdn_res_normalize
#undef mdn_res_prohibitcheck
#undef mdn_res_nameprep
#undef mdn_res_nameprepcheck
#undef mdn_res_unassignedcheck
#undef mdn_res_delimitermap
#undef mdn_res_localmap
@ -697,6 +847,18 @@ mdn_res_prohibitcheck(mdn_resconf_t ctx, const char *from, char *to,
return mdn_res_nameconv(ctx, "p", from, to, tolen);
}
mdn_result_t
mdn_res_nameprep(mdn_resconf_t ctx, const char *from, char *to,
size_t tolen) {
return mdn_res_nameconv(ctx, "N", from, to, tolen);
}
mdn_result_t
mdn_res_nameprepcheck(mdn_resconf_t ctx, const char *from, char *to,
size_t tolen) {
return mdn_res_nameconv(ctx, "!N", from, to, tolen);
}
mdn_result_t
mdn_res_unassignedcheck(mdn_resconf_t ctx, const char *from, char *to,
size_t tolen) {

Some files were not shown because too many files have changed in this diff Show more