File indexing completed on 2024-05-19 04:06:42

0001 /* internal.h   Internal header file for libidn.
0002  * Copyright (C) 2002, 2003  Simon Josefsson
0003  *
0004  * This file is part of GNU Libidn.
0005  *
0006  * GNU Libidn is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Lesser General Public
0008  * License as published by the Free Software Foundation; either
0009  * either version 2
0010    of the License, or (at your option) any later version.1 of the License, or (at your option) any later version.
0011  *
0012  * GNU Libidn is distributed in the hope that it will be useful,
0013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015  * Lesser General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU Lesser General Public
0018  * License along with GNU Libidn; if not, write to the Free Software
0019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
0020  *
0021  */
0022 
0023 #ifndef _INTERNAL_H
0024 #define _INTERNAL_H
0025 
0026 #define STDC_HEADERS 1
0027 
0028 #ifdef _LIBC
0029 
0030 # include <stdio.h>
0031 # include <stdlib.h>
0032 # include <string.h>
0033 # include <errno.h>
0034 # include <string.h>
0035 
0036 //# define HAVE_ICONV 1
0037 //# define LOCALE_WORKS 1
0038 //# define ICONV_CONST
0039 
0040 #else /* _LIBC */
0041 
0042 # if HAVE_CONFIG_H
0043 #  include "config.h"
0044 # endif
0045 
0046 # if STDC_HEADERS
0047 #  include <stdio.h>
0048 #  include <stdlib.h>
0049 #  include <stdarg.h>
0050 #  include <ctype.h>
0051 #  include <string.h>
0052 # endif
0053 
0054 # if HAVE_UNISTD_H
0055 #  include <unistd.h>
0056 # endif
0057 
0058 # if HAVE_ERRNO_H
0059 #  include <errno.h>
0060 # endif
0061 
0062 # if defined(WITH_DMALLOC) && WITH_DMALLOC
0063 #  include <dmalloc.h>
0064 # endif
0065 
0066 #endif /* _LIBC */
0067 
0068 #include "libidn/stringprep.h"
0069 #include "libidn/punycode.h"
0070 #include "libidn/idna.h"
0071 
0072 /*! \mainpage GNU Internationalized Domain Name Library
0073  *
0074  * \section intro Introduction
0075  *
0076  * GNU Libidn is an implementation of the Stringprep, Punycode and IDNA
0077  * specifications defined by the IETF Internationalized Domain Names
0078  * (IDN) working group, used for internationalized domain names.  The
0079  * package is available under the GNU Lesser General Public License.
0080  *
0081  * The library contains a generic Stringprep implementation that does
0082  * Unicode 3.2 NFKC normalization, mapping and prohibitation of
0083  * characters, and bidirectional character handling.  Profiles for iSCSI,
0084  * Kerberos 5, Nameprep, SASL and XMPP are included.  Punycode and ASCII
0085  * Compatible Encoding (ACE) via IDNA are supported.
0086  *
0087  * The Stringprep API consists of two main functions, one for converting
0088  * data from the system's native representation into UTF-8, and one
0089  * function to perform the Stringprep processing.  Adding a new
0090  * Stringprep profile for your application within the API is
0091  * straightforward.  The Punycode API consists of one encoding function
0092  * and one decoding function.  The IDNA API consists of the ToASCII and
0093  * ToUnicode functions, as well as an high-level interface for converting
0094  * entire domain names to and from the ACE encoded form.
0095  *
0096  * The library is used by, e.g., GNU SASL and Shishi to process user
0097  * names and passwords.  Libidn can be built into GNU Libc to enable a
0098  * new system-wide getaddrinfo() flag for IDN processing.
0099  *
0100  * Libidn is developed for the GNU/Linux system, but runs on over 20 Unix
0101  * platforms (including Solaris, IRIX, AIX, and Tru64) and Windows.
0102  * Libidn is written in C and (parts of) the API is accessible from C,
0103  * C++, Emacs Lisp, Python and Java.
0104  *
0105  * The project web page:\n
0106  * http://www.gnu.org/software/libidn/
0107  *
0108  * The software archive:\n
0109  * ftp://alpha.gnu.org/pub/gnu/libidn/
0110  *
0111  * For more information see:\n
0112  * http://www.ietf.org/html.charters/idn-charter.html\n
0113  * http://www.ietf.org/rfc/rfc3454.txt (stringprep specification)\n
0114  * http://www.ietf.org/rfc/rfc3490.txt (idna specification)\n
0115  * http://www.ietf.org/rfc/rfc3491.txt (nameprep specification)\n
0116  * http://www.ietf.org/rfc/rfc3492.txt (punycode specification)\n
0117  * http://www.ietf.org/internet-drafts/draft-ietf-ips-iscsi-string-prep-04.txt\n
0118  * http://www.ietf.org/internet-drafts/draft-ietf-krb-wg-utf8-profile-01.txt\n
0119  * http://www.ietf.org/internet-drafts/draft-ietf-sasl-anon-00.txt\n
0120  * http://www.ietf.org/internet-drafts/draft-ietf-sasl-saslprep-00.txt\n
0121  * http://www.ietf.org/internet-drafts/draft-ietf-xmpp-nodeprep-01.txt\n
0122  * http://www.ietf.org/internet-drafts/draft-ietf-xmpp-resourceprep-01.txt\n
0123  *
0124  * Further information and paid contract development:\n
0125  * Simon Josefsson <simon@josefsson.org>
0126  *
0127  * \section examples Examples
0128  *
0129  * \include example.c
0130  * \include example3.c
0131  * \include example4.c
0132  */
0133 
0134 #endif /* _INTERNAL_H */