Annotation of parser3/src/lib/punycode/pa_idna.h, revision 1.3
1.1 moko 1: /** @file
2: Parser: IDNA support, modified Libidn Version 1.28.
1.3 ! moko 3: Copyright (c) 2001-2017 Art. Lebedev Studio (http://www.artlebedev.com)
1.1 moko 4: */
5:
6: /* idna.h --- Prototypes for Internationalized Domain Name library.
7: Copyright (C) 2002-2013 Simon Josefsson
8:
9: This file is part of GNU Libidn.
10:
11: GNU Libidn is free software: you can redistribute it and/or
12: modify it under the terms of either:
13:
14: * the GNU Lesser General Public License as published by the Free
15: Software Foundation; either version 3 of the License, or (at
16: your option) any later version.
17:
18: or
19:
20: * the GNU General Public License as published by the Free
21: Software Foundation; either version 2 of the License, or (at
22: your option) any later version.
23:
24: or both in parallel, as here.
25:
26: GNU Libidn is distributed in the hope that it will be useful,
27: but WITHOUT ANY WARRANTY; without even the implied warranty of
28: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29: General Public License for more details.
30:
31: You should have received copies of the GNU General Public License and
32: the GNU Lesser General Public License along with this program. If
33: not, see <http://www.gnu.org/licenses/>. */
34:
35: #ifndef PA_IDNA_H
36: #define PA_IDNA_H
37:
38: #include "pa_config_includes.h"
39:
40: # ifdef __cplusplus
41: extern "C"
42: {
43: # endif
44:
1.2 moko 45: /* Error codes. */
46: typedef enum {
47: IDNA_SUCCESS = 0,
48: IDNA_CONTAINS_NON_LDH = 4,
49: IDNA_CONTAINS_MINUS = 5,
50: IDNA_NO_ACE_PREFIX = 6,
51: IDNA_ROUNDTRIP_VERIFY_ERROR = 7,
52: IDNA_CONTAINS_ACE_PREFIX = 8
53: } Idna_rc;
54:
55: /* IDNA flags */
56: typedef enum {
57: IDNA_ALLOW_UNASSIGNED = 0x0001,
58: IDNA_USE_STD3_ASCII_RULES = 0x0002
59: } Idna_flags;
1.1 moko 60:
61: #ifndef IDNA_ACE_PREFIX
62: #define IDNA_ACE_PREFIX "xn--"
63: #endif
64:
1.2 moko 65: const char *pa_idna_strerror (int rc);
1.1 moko 66:
1.2 moko 67: int pa_idna_to_ascii_4z (const uint32_t *in, char *out, size_t out_len, int flags);
68: int pa_idna_to_unicode_4z (const char *in, uint32_t *out, size_t out_len, int flags);
1.1 moko 69:
70: # ifdef __cplusplus
71: }
72: # endif
73:
74: #endif /* PA_IDNA_H */
E-mail: