Version 0.1.14.
[libidn.git] / internal.h
blob18c897591587fcb020729c86c5431cdd89ad1cd0
1 /* internal.h Internal header file for libidn.
2 * Copyright (C) 2002, 2003 Simon Josefsson
4 * This file is part of GNU Libidn.
6 * GNU Libidn is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * GNU Libidn is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with GNU Libidn; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef _INTERNAL_H
23 #define _INTERNAL_H
25 #ifdef _LIBC
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <string.h>
30 #include <errno.h>
32 #define HAVE_ICONV 1
33 #define LOCALE_WORKS 1
35 #else /* _LIBC */
37 #if HAVE_CONFIG_H
38 #include "config.h"
39 #endif
41 #ifdef STDC_HEADERS
42 #include <stdio.h>
43 #include <stdlib.h>
44 #include <stdarg.h>
45 #include <ctype.h>
46 #endif
48 #if HAVE_UNISTD_H
49 #include <unistd.h>
50 #endif
52 #ifdef HAVE_SYS_TYPES_H
53 #include <sys/types.h>
54 #endif
56 #ifdef HAVE_ERRNO_H
57 #include <errno.h>
58 #endif
60 #if HAVE_INTTYPES_H
61 # include <inttypes.h>
62 #else
63 # if HAVE_STDINT_H
64 # include <stdint.h>
65 # endif
66 #endif
68 #if HAVE_STRING_H
69 # if !STDC_HEADERS && HAVE_MEMORY_H
70 # include <memory.h>
71 # endif
72 # include <string.h>
73 #endif
74 #if HAVE_STRINGS_H
75 # include <strings.h>
76 #endif
78 #if defined(WITH_DMALLOC) && WITH_DMALLOC
79 #include <dmalloc.h>
80 #endif
82 #endif /* _LIBC */
84 #include "stringprep.h"
85 #include "punycode.h"
86 #include "idna.h"
88 /*! \mainpage GNU Internationalized Domain Name Library
90 * \section intro Introduction
92 * GNU Libidn is an implementation of the Stringprep, Punycode and IDNA
93 * specifications defined by the IETF Internationalized Domain Names
94 * (IDN) working group, used for internationalized domain names. The
95 * package is available under the GNU Lesser General Public License.
97 * The library contains a generic Stringprep implementation that does
98 * Unicode 3.2 NFKC normalization, mapping and prohibitation of
99 * characters, and bidirectional character handling. Profiles for iSCSI,
100 * Kerberos 5, Nameprep, SASL and XMPP are included. Punycode and ASCII
101 * Compatible Encoding (ACE) via IDNA are supported.
103 * The Stringprep API consists of two main functions, one for converting
104 * data from the system's native representation into UTF-8, and one
105 * function to perform the Stringprep processing. Adding a new
106 * Stringprep profile for your application within the API is
107 * straightforward. The Punycode API consists of one encoding function
108 * and one decoding function. The IDNA API consists of the ToASCII and
109 * ToUnicode functions, as well as an high-level interface for converting
110 * entire domain names to and from the ACE encoded form.
112 * The library is used by, e.g., GNU SASL and Shishi to process user
113 * names and passwords. Libidn can be built into GNU Libc to enable a
114 * new system-wide getaddrinfo() flag for IDN processing.
116 * Libidn is developed for the GNU/Linux system, but runs on over 20 Unix
117 * platforms (including Solaris, IRIX, AIX, and Tru64) and Windows.
118 * Libidn is written in C and (parts of) the API is accessible from C,
119 * C++, Emacs Lisp, Python and Java.
121 * The project web page:\n
122 * http://www.gnu.org/software/libidn/
124 * The software archive:\n
125 * ftp://alpha.gnu.org/pub/gnu/libidn/
127 * For more information see:\n
128 * http://www.ietf.org/html.charters/idn-charter.html\n
129 * http://www.ietf.org/rfc/rfc3454.txt (stringprep specification)\n
130 * http://www.ietf.org/rfc/rfc3490.txt (idna specification)\n
131 * http://www.ietf.org/rfc/rfc3491.txt (nameprep specification)\n
132 * http://www.ietf.org/rfc/rfc3492.txt (punycode specification)\n
133 * http://www.ietf.org/internet-drafts/draft-ietf-ips-iscsi-string-prep-04.txt\n
134 * http://www.ietf.org/internet-drafts/draft-ietf-krb-wg-utf8-profile-01.txt\n
135 * http://www.ietf.org/internet-drafts/draft-ietf-sasl-anon-00.txt\n
136 * http://www.ietf.org/internet-drafts/draft-ietf-sasl-saslprep-00.txt\n
137 * http://www.ietf.org/internet-drafts/draft-ietf-xmpp-nodeprep-01.txt\n
138 * http://www.ietf.org/internet-drafts/draft-ietf-xmpp-resourceprep-01.txt\n
140 * Further information and paid contract development:\n
141 * Simon Josefsson <simon@josefsson.org>
143 * \section examples Examples
145 * \include example.c
146 * \include example3.c
147 * \include example4.c
150 #endif /* _INTERNAL_H */