5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews/* $Id: resconf.h,v 1.1 2003/06/04 00:25:41 marka Exp $ */
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Copyright (c) 2000 Japan Network Information Center. All rights reserved.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * By using this file, you agree to the terms and conditions set forth bellow.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * LICENSE TERMS AND CONDITIONS
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * The following License Terms and Conditions apply, unless a different
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * license is obtained from Japan Network Information Center ("JPNIC"),
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Chiyoda-ku, Tokyo 101-0047, Japan.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * 1. Use, Modification and Redistribution (including distribution of any
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * modified or derived work) in source and/or binary forms is permitted
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * under this License Terms and Conditions.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * 2. Redistribution of source code must retain the copyright notices as they
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * appear in each source code file, this License Terms and Conditions.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * 3. Redistribution in binary form must reproduce the Copyright Notice,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * this License Terms and Conditions, in the documentation and/or other
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * materials provided with the distribution. For the purposes of binary
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * distribution the "Copyright Notice" refers to the following language:
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * "Copyright (c) 2000-2002 Japan Network Information Center. All rights reserved."
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * 4. The name of JPNIC may not be used to endorse or promote products
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * derived from this Software without specific prior written approval of
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * IDN resolver configuration.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Configuration type (opaque).
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Initialize.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Initialize this module and underlying ones. Must be called before
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * any other functions of this module.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * idn_success -- ok.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * idn_nomemory -- malloc failed.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Create a configuration context.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Create an empty context and store it in '*ctxp'.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * idn_success -- ok.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * idn_nomemory -- malloc failed.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Destroy the configuration context.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Destroy the configuration context created by 'idn_resconf_create',
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * and release memory for it.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Increment reference count of the context created by 'idn_resconf_create'.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Set default configurations to resconf context.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * "default configurations" means current nameprep and IDN encoding
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * which IDN standard document suggests.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Warning: configurations set previously are removed.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * idn_success -- ok.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * idn_invalid_syntax -- syntax error found.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * idn_invalid_name -- invalid encoding/nomalization name is
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * specified.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * idn_nomemory -- malloc failed.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Load configuration file.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Parse a configuration file whose name is specified by 'file',
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * store the result in 'ctx'. If 'file' is NULL, the default file is
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * idn_success -- ok.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * idn_nofile -- couldn't open specified file.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * idn_invalid_syntax -- syntax error found.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * idn_invalid_name -- invalid encoding/nomalization name is
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * specified.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * idn_nomemory -- malloc failed.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_loadfile(idn_resconf_t ctx, const char *file);
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Get the pathname of the default configuration file.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * the pathname of the default configuration file.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Get an object of lower module that `ctx' holds.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_getauxidnconverter(idn_resconf_t ctx);
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_getlocalconverter(idn_resconf_t ctx);
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_getlocalmapselector(idn_resconf_t ctx);
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_getprohibitchecker(idn_resconf_t ctx);
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_getunassignedchecker(idn_resconf_t ctx);
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Set an object of lower module to `ctx'.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_setauxidnconverter(idn_resconf_t ctx,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_setlocalconverter(idn_resconf_t ctx,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_setlocalmapselector(idn_resconf_t ctx,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_setmapper(idn_resconf_t ctx, idn_mapper_t mapper);
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_setnormalizer(idn_resconf_t ctx, idn_normalizer_t normalizer);
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_setprohibitchecker(idn_resconf_t ctx,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_setunassignedchecker(idn_resconf_t ctx,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Set name or add names to an object of lower module that `ctx' holds.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_setidnconvertername(idn_resconf_t ctx, const char *name,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_setauxidnconvertername(idn_resconf_t ctx, const char *name,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_addalldelimitermapucs(idn_resconf_t ctx, unsigned long *v, int nv);
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_setlocalconvertername(idn_resconf_t ctx, const char *name,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_addalllocalmapselectornames(idn_resconf_t ctx, const char *tld,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_addallmappernames(idn_resconf_t ctx, const char **names,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_addallnormalizernames(idn_resconf_t ctx, const char **names,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_addallprohibitcheckernames(idn_resconf_t ctx, const char **names,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_addallunassignedcheckernames(idn_resconf_t ctx, const char **names,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_addallbidicheckernames(idn_resconf_t ctx, const char **names,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_setnameprepversion(idn_resconf_t ctx, const char *version);
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * These macros are provided for backward compatibility to mDNkit 2.1
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * and older.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_setalternateconverter(idn_resconf_t ctx,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_setalternateconvertername(idn_resconf_t ctx, const char *name,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsidn_resconf_getalternateconverter(idn_resconf_t ctx);
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * These macros are provided for backward compatibility to idnkit 1.x.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews#endif /* IDN_RESCONF_H */