ignore some files
[tridge/bind9.git] / contrib / idn / idnkit-1.0-src / tools / idnconv / util.h
1 /* $Id: util.h,v 1.1.1.1 2003/06/04 00:27:09 marka Exp $ */
2 /*
3  * Copyright (c) 2000,2001 Japan Network Information Center.
4  * All rights reserved.
5  *  
6  * By using this file, you agree to the terms and conditions set forth bellow.
7  * 
8  *                      LICENSE TERMS AND CONDITIONS 
9  * 
10  * The following License Terms and Conditions apply, unless a different
11  * license is obtained from Japan Network Information Center ("JPNIC"),
12  * a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
13  * Chiyoda-ku, Tokyo 101-0047, Japan.
14  * 
15  * 1. Use, Modification and Redistribution (including distribution of any
16  *    modified or derived work) in source and/or binary forms is permitted
17  *    under this License Terms and Conditions.
18  * 
19  * 2. Redistribution of source code must retain the copyright notices as they
20  *    appear in each source code file, this License Terms and Conditions.
21  * 
22  * 3. Redistribution in binary form must reproduce the Copyright Notice,
23  *    this License Terms and Conditions, in the documentation and/or other
24  *    materials provided with the distribution.  For the purposes of binary
25  *    distribution the "Copyright Notice" refers to the following language:
26  *    "Copyright (c) 2000-2002 Japan Network Information Center.  All rights reserved."
27  * 
28  * 4. The name of JPNIC may not be used to endorse or promote products
29  *    derived from this Software without specific prior written approval of
30  *    JPNIC.
31  * 
32  * 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
33  *    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34  *    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
35  *    PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL JPNIC BE LIABLE
36  *    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
37  *    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
38  *    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
39  *    BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
40  *    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
41  *    OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
42  *    ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
43  */
44
45 #ifndef IDN_IDNCONV_UTIL_H
46 #define IDN_IDNCONV_UTIL_H 1
47
48 #include <idn/res.h>
49
50 #define IDNCONV_LOCALBUF_SIZE   512
51
52 typedef struct {
53         char    *str;
54         size_t  size;
55         char    local_buf[IDNCONV_LOCALBUF_SIZE];
56 } idnconv_strbuf_t;
57
58 extern idn_result_t     selective_encode(idn_resconf_t conf,
59                                          idn_action_t actions, char *from,
60                                          char *to, int tolen);
61 extern idn_result_t     selective_decode(idn_resconf_t conf,
62                                          idn_action_t actions, char *from,
63                                          char *to, int tolen);
64 extern void             set_defaults(idn_resconf_t conf);
65 extern void             load_conf_file(idn_resconf_t conf, const char *file);
66 extern void             set_encoding_alias(const char *encoding_alias);
67 extern void             set_localcode(idn_resconf_t conf, const char *code);
68 extern void             set_idncode(idn_resconf_t conf, const char *code);
69 extern void             set_delimitermapper(idn_resconf_t conf,
70                                             unsigned long *delimiters,
71                                             int ndelimiters);
72 extern void             set_localmapper(idn_resconf_t conf,
73                                         char **mappers, int nmappers);
74 extern void             set_nameprep(idn_resconf_t conf, char *version);
75 extern void             set_mapper(idn_resconf_t conf,
76                                    char **mappers, int nmappers);
77 extern void             set_normalizer(idn_resconf_t conf,
78                                        char **normalizer, int nnormalizer);
79 extern void             set_prohibit_checkers(idn_resconf_t conf,
80                                               char **prohibits,
81                                               int nprohibits);
82 extern void             set_unassigned_checkers(idn_resconf_t conf,
83                                                 char **unassigns,
84                                                 int nunassigns);
85 extern void             errormsg(const char *fmt, ...);
86 extern void             strbuf_init(idnconv_strbuf_t *buf);
87 extern void             strbuf_reset(idnconv_strbuf_t *buf);
88 extern char             *strbuf_get(idnconv_strbuf_t *buf);
89 extern size_t           strbuf_size(idnconv_strbuf_t *buf);
90 extern char             *strbuf_copy(idnconv_strbuf_t *buf, const char *str);
91 extern char             *strbuf_append(idnconv_strbuf_t *buf, const char *str);
92 extern char             *strbuf_alloc(idnconv_strbuf_t *buf, size_t size);
93 extern char             *strbuf_double(idnconv_strbuf_t *buf);
94 extern char             *strbuf_getline(idnconv_strbuf_t *buf, FILE *fp);
95
96 #endif /* IDN_IDNCONV_UTIL_H */