resconf.h revision 5c526acb82c882e41b655c31f5fa4425c87b671c
/* $Id: resconf.h,v 1.1 2003/06/04 00:25:41 marka Exp $ */
/*
* Copyright (c) 2000 Japan Network Information Center. All rights reserved.
*
* By using this file, you agree to the terms and conditions set forth bellow.
*
* LICENSE TERMS AND CONDITIONS
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* under this License Terms and Conditions.
*
* 2. Redistribution of source code must retain the copyright notices as they
* appear in each source code file, this License Terms and Conditions.
*
* 3. Redistribution in binary form must reproduce the Copyright Notice,
* materials provided with the distribution. For the purposes of binary
* distribution the "Copyright Notice" refers to the following language:
* "Copyright (c) 2000-2002 Japan Network Information Center. All rights reserved."
*
* 4. The name of JPNIC may not be used to endorse or promote products
* derived from this Software without specific prior written approval of
* JPNIC.
*
* 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef IDN_RESCONF_H
#define IDN_RESCONF_H 1
#ifdef __cplusplus
extern "C" {
#endif
/*
* IDN resolver configuration.
*/
#include <idn/converter.h>
#include <idn/normalizer.h>
#include <idn/mapselector.h>
#include <idn/delimitermap.h>
/*
* Configuration type (opaque).
*/
typedef struct idn_resconf *idn_resconf_t;
/*
* Initialize.
*
* Initialize this module and underlying ones. Must be called before
* any other functions of this module.
*
* Returns:
* idn_success -- ok.
* idn_nomemory -- malloc failed.
*/
idn_resconf_initialize(void);
/*
* Create a configuration context.
*
* Create an empty context and store it in '*ctxp'.
*
* Returns:
* idn_success -- ok.
* idn_nomemory -- malloc failed.
*/
/*
* Destroy the configuration context.
*
* Destroy the configuration context created by 'idn_resconf_create',
* and release memory for it.
*/
IDN_EXPORT void
/*
* Increment reference count of the context created by 'idn_resconf_create'.
*/
IDN_EXPORT void
/*
* Set default configurations to resconf context.
*
* "default configurations" means current nameprep and IDN encoding
* which IDN standard document suggests.
*
* Warning: configurations set previously are removed.
*
* Returns:
* idn_success -- ok.
* idn_invalid_syntax -- syntax error found.
* idn_invalid_name -- invalid encoding/nomalization name is
* specified.
* idn_nomemory -- malloc failed.
*/
/*
* Load configuration file.
*
* Parse a configuration file whose name is specified by 'file',
* store the result in 'ctx'. If 'file' is NULL, the default file is
* loaded.
*
* Returns:
* idn_success -- ok.
* idn_nofile -- couldn't open specified file.
* idn_invalid_syntax -- syntax error found.
* idn_invalid_name -- invalid encoding/nomalization name is
* specified.
* idn_nomemory -- malloc failed.
*/
/*
* Get the pathname of the default configuration file.
*
* Returns:
* the pathname of the default configuration file.
*/
IDN_EXPORT char *
idn_resconf_defaultfile(void);
/*
* Get an object of lower module that `ctx' holds.
*/
/*
* Set an object of lower module to `ctx'.
*/
IDN_EXPORT void
IDN_EXPORT void
IDN_EXPORT void
IDN_EXPORT void
IDN_EXPORT void
IDN_EXPORT void
IDN_EXPORT void
IDN_EXPORT void
IDN_EXPORT void
IDN_EXPORT void
/*
* Set name or add names to an object of lower module that `ctx' holds.
*/
int flags);
int flags);
int flags);
int nnames);
int nnames);
int nnames);
int nnames);
int nnames);
/*
* These macros are provided for backward compatibility to mDNkit 2.1
* and older.
*/
IDN_EXPORT void
int flags);
/*
* These macros are provided for backward compatibility to idnkit 1.x.
*/
#define idn_resconf_localconverter(ctx) \
#define idn_resconf_idnconverter(ctx) \
#define idn_resconf_alternateconverter(ctx) \
#define idn_resconf_normalizer(ctx) \
#define idn_resconf_mapper(ctx) \
#define idn_resconf_delimitermap(ctx) \
#define idn_resconf_localmapselector(ctx) \
#define idn_resconf_prohibitchecker(ctx) \
#define idn_resconf_unassignedchecker(ctx) \
#ifdef __cplusplus
}
#endif
#endif /* IDN_RESCONF_H */