1/* $Id: api.h,v 1.1 2003/06/04 00:25:45 marka Exp $ */ 2/* 3 * Copyright (c) 2001,2002 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 MDN_API_H 46#define MDN_API_H 1 47 48#ifdef __cplusplus 49extern "C" { 50#endif 51 52#include <mdn/result.h> 53#include <mdn/res.h> 54#include <idn/api.h> 55 56#define mdn_enable idn_enable 57 58extern idn_result_t 59mdn_nameinit(void); 60 61extern idn_result_t 62mdn_encodename(int actions, const char *from, char *to, size_t tolen); 63 64extern idn_result_t 65mdn_decodename(int actions, const char *from, char *to, size_t tolen); 66 67#define mdn_localtoutf8(from, to, tolen) \ 68 mdn_encodename(IDN_LOCALCONV, from, to, len) 69#define mdn_delimitermap(from, to, tolen) \ 70 mdn_encodename(IDN_DELIMMAP, from, to, len) 71#define mdn_localmap(from, to, tolen) \ 72 mdn_encodename(IDN_LOCALMAP, from, to, len) 73#define mdn_nameprep(from, to, tolen) \ 74 mdn_encodename(IDN_NAMEPREP, from, to, len) 75#define mdn_utf8toidn(from, to, tolen) \ 76 mdn_encodename(IDN_IDNCONV, from, to, len) 77#define mdn_idntoutf8(from, to, tolen) \ 78 mdn_decodename(IDN_IDNCONV, from, to, tolen) 79#define mdn_utf8tolocal(from, to, tolen) \ 80 mdn_decodename(IDN_LOCALCONV, from, to, tolen) 81 82#define mdn_localtoidn(from, to, tolen) \ 83 mdn_encodename(IDN_ENCODE_APP, from, to, tolen) 84#define mdn_idntolocal(from, to, tolen) \ 85 mdn_decodename(IDN_DECODE_APP, from, to, tolen) 86 87#ifdef __cplusplus 88} 89#endif 90 91#endif /* MDN_API_H */ 92