2 * Copyright (c) 2000-2002 Japan Network Information Center. All rights reserved.
4 * By using this file, you agree to the terms and conditions set forth bellow.
6 * LICENSE TERMS AND CONDITIONS
8 * The following License Terms and Conditions apply, unless a different
9 * license is obtained from Japan Network Information Center ("JPNIC"),
10 * a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
11 * Chiyoda-ku, Tokyo 101-0047, Japan.
13 * 1. Use, Modification and Redistribution (including distribution of any
14 * modified or derived work) in source and/or binary forms is permitted
15 * under this License Terms and Conditions.
17 * 2. Redistribution of source code must retain the copyright notices as they
18 * appear in each source code file, this License Terms and Conditions.
20 * 3. Redistribution in binary form must reproduce the Copyright Notice,
21 * this License Terms and Conditions, in the documentation and/or other
22 * materials provided with the distribution. For the purposes of binary
23 * distribution the "Copyright Notice" refers to the following language:
24 * "Copyright (c) 2000-2002 Japan Network Information Center. All rights reserved."
26 * 4. The name of JPNIC may not be used to endorse or promote products
27 * derived from this Software without specific prior written approval of
30 * 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
31 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
33 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE
34 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
35 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
36 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
37 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
38 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
39 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
40 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
43 #ifndef nsIDNKitWrapper_h__
44 #define nsIDNKitWrapper_h__
48 #endif /* __cplusplus */
53 * libidnkit result code.
63 idn_invalid_codepoint
,
72 idn_failure
/* !!This must be the last one!! */
85 * A Handle for nameprep operations.
87 typedef struct idn_nameprep
*idn_nameprep_t
;
91 * The latest version of nameprep.
93 #define IDN_NAMEPREP_CURRENT "nameprep-11"
101 idn_result_t
race_decode_decompress(const char *from
,
104 idn_result_t
race_compress_encode(const PRUint16
*p
,
106 char *to
, size_t tolen
);
107 int get_compress_mode(PRUint16
*p
);
113 * Create a handle for nameprep operations.
114 * The handle is stored in '*handlep', which is used other functions
116 * The version of the NAMEPREP specification can be specified with
117 * 'version' parameter. If 'version' is NULL, the latest version
122 * idn_notfound -- specified version not found.
125 idn_nameprep_create(const char *version
, idn_nameprep_t
*handlep
);
128 * Close a handle, which was created by 'idn_nameprep_create'.
131 idn_nameprep_destroy(idn_nameprep_t handle
);
134 * Perform character mapping on an UCS4 string specified by 'from', and
135 * store the result into 'to', whose length is specified by 'tolen'.
139 * idn_buffer_overflow -- result buffer is too small.
142 idn_nameprep_map(idn_nameprep_t handle
, const PRUint32
*from
,
143 PRUint32
*to
, size_t tolen
);
146 * Check if an UCS4 string 'str' contains any prohibited characters specified
147 * by the draft. If found, the pointer to the first such character is stored
148 * into '*found'. Otherwise '*found' will be NULL.
151 * idn_success -- check has been done properly. (But this
152 * does not mean that no prohibited character
153 * was found. Check '*found' to see the
157 idn_nameprep_isprohibited(idn_nameprep_t handle
, const PRUint32
*str
,
158 const PRUint32
**found
);
161 * Check if an UCS4 string 'str' contains any unassigned characters specified
162 * by the draft. If found, the pointer to the first such character is stored
163 * into '*found'. Otherwise '*found' will be NULL.
166 * idn_success -- check has been done properly. (But this
167 * does not mean that no unassinged character
168 * was found. Check '*found' to see the
172 idn_nameprep_isunassigned(idn_nameprep_t handle
, const PRUint32
*str
,
173 const PRUint32
**found
);
176 * Check if an UCS4 string 'str' is valid string specified by ``bidi check''
177 * of the draft. If it is not valid, the pointer to the first invalid
178 * character is stored into '*found'. Otherwise '*found' will be NULL.
181 * idn_success -- check has been done properly. (But this
182 * does not mean that the string was valid.
183 * Check '*found' to see the result.)
186 idn_nameprep_isvalidbidi(idn_nameprep_t handle
, const PRUint32
*str
,
187 const PRUint32
**found
);
193 #endif /* __cplusplus */
195 #endif /* nsIDNKitWrapper_h__ */