1/* 2 * wrapcommon.h 3 */ 4 5/* 6 * Copyright (c) 2000,2002 Japan Network Information Center. 7 * All rights reserved. 8 * 9 * By using this file, you agree to the terms and conditions set forth bellow. 10 * 11 * LICENSE TERMS AND CONDITIONS 12 * 13 * The following License Terms and Conditions apply, unless a different 14 * license is obtained from Japan Network Information Center ("JPNIC"), 15 * a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda, 16 * Chiyoda-ku, Tokyo 101-0047, Japan. 17 * 18 * 1. Use, Modification and Redistribution (including distribution of any 19 * modified or derived work) in source and/or binary forms is permitted 20 * under this License Terms and Conditions. 21 * 22 * 2. Redistribution of source code must retain the copyright notices as they 23 * appear in each source code file, this License Terms and Conditions. 24 * 25 * 3. Redistribution in binary form must reproduce the Copyright Notice, 26 * this License Terms and Conditions, in the documentation and/or other 27 * materials provided with the distribution. For the purposes of binary 28 * distribution the "Copyright Notice" refers to the following language: 29 * "Copyright (c) 2000-2002 Japan Network Information Center. All rights reserved." 30 * 31 * 4. The name of JPNIC may not be used to endorse or promote products 32 * derived from this Software without specific prior written approval of 33 * JPNIC. 34 * 35 * 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC 36 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 37 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 38 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE 39 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 40 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 41 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 42 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 43 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 44 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 45 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 46 */ 47 48#ifndef _WRAPCOMMON_H 49#define _WRAPCOMMON_H 50 51#include <idn/res.h> 52#include <idn/log.h> 53#include <idn/version.h> 54 55#define WRAPPER_EXPORT extern __declspec(dllexport) 56 57extern void idnPrintf(char *fmt, ...); 58extern void idnLogPrintf(int level, char *fmt, ...); 59extern void idnLogInit(const char *title); 60extern void idnLogReset(void); 61extern void idnLogFinish(void); 62 63extern char *dumpAddr(const char FAR *addr, int len, char *buff, size_t size); 64extern char *dumpHost(const struct hostent FAR *hp, char *buff, size_t size); 65extern char *dumpName(const char *name, char *buff, size_t size); 66 67extern int idnEncodeWhere(void); 68 69#define IDN_ENCODE_ALWAYS 0 70#define IDN_ENCODE_CHECK 1 71#define IDN_ENCODE_ONLY11 2 72#define IDN_ENCODE_ONLY20 3 73 74extern BOOL idnGetPrgEncoding(char *enc, size_t len); 75extern BOOL idnGetLogFile(char *file, size_t len); 76 77extern int idnGetLogLevel(void); /* 0 : fatal */ 78 /* 1 : error */ 79 /* 2 : warning */ 80 /* 3 : info */ 81 /* 4 : trace */ 82 /* 5 : dump */ 83extern int idnGetInstallDir(char *dir, size_t len); 84 85extern idn_resconf_t idnConvInit(void); 86extern void idnConvDone(idn_resconf_t ctx); 87 88extern BOOL idnWinsockVersion(const char *version); 89extern HINSTANCE idnWinsockHandle(void); 90extern idn_resconf_t idnGetContext(void); 91 92/* 93 * Converting Request/Response 94 */ 95 96extern BOOL idnConvReq(idn_resconf_t ctx, const char FAR *from, 97 char FAR *to, size_t tolen); 98extern BOOL idnConvRsp(idn_resconf_t ctx, const char FAR *from, 99 char FAR *to, size_t tolen); 100 101/* 102 * Hook for Asynchronouse Query 103 */ 104 105extern void idnHookInit(void); 106extern void idnHookDone(void); 107extern BOOL idnHook(HWND hWnd, u_int wMsg, char FAR *buf, idn_resconf_t ctx); 108 109#endif /* _WRAPCOMMON_H */ 110