00001 /*- 00002 * Copyright (c) 1999,2000 00003 * Konstantin Chuguev. All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions 00007 * are met: 00008 * 1. Redistributions of source code must retain the above copyright 00009 * notice, this list of conditions and the following disclaimer. 00010 * 2. Redistributions in binary form must reproduce the above copyright 00011 * notice, this list of conditions and the following disclaimer in the 00012 * documentation and/or other materials provided with the distribution. 00013 * 3. All advertising materials mentioning features or use of this software 00014 * must display the following acknowledgement: 00015 * This product includes software developed by Konstantin Chuguev 00016 * and its contributors. 00017 * 00018 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 00019 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00020 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00021 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 00022 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00023 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00024 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00025 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00026 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00027 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00028 * SUCH DAMAGE. 00029 * 00030 */ 00031 00032 #ifndef APR_ICONV_H 00033 #define APR_ICONV_H 00034 00035 #include "apr.h" 00036 #include "apr_pools.h" 00037 #include <stddef.h> 00038 00039 /** 00040 * API_DECLARE_EXPORT is defined when building the libapriconv dynamic 00041 * library, so that all public symbols are exported. 00042 * 00043 * API_DECLARE_STATIC is defined when including the apriconv public headers, 00044 * to provide static linkage when the dynamic library may be unavailable. 00045 * 00046 * API_DECLARE_STATIC and API_DECLARE_EXPORT are left undefined when 00047 * including the apr-iconv public headers, to import and link the symbols 00048 * from the dynamic libapriconv library and assure appropriate indirection 00049 * and calling conventions at compile time. 00050 */ 00051 00052 #if !defined(WIN32) 00053 /** 00054 * The public apr-iconv functions are declared with API_DECLARE(), so they 00055 * use the most portable calling convention. Public apr-iconv functions 00056 * with variable arguments must use API_DECLARE_NONSTD(). 00057 * 00058 * @deffunc API_DECLARE(rettype) apr_func(args); 00059 */ 00060 #define API_DECLARE(type) type 00061 /** 00062 * The private apr-iconv functions are declared with API_DECLARE_NONSTD(), 00063 * so they use the most optimal C language calling conventions. 00064 * 00065 * @deffunc API_DECLARE(rettype) apr_func(args); 00066 */ 00067 #define API_DECLARE_NONSTD(type) type 00068 /** 00069 * All exported apr-iconv variables are declared with API_DECLARE_DATA 00070 * This assures the appropriate indirection is invoked at compile time. 00071 * 00072 * @deffunc API_DECLARE_DATA type apr_variable; 00073 * @tip extern API_DECLARE_DATA type apr_variable; syntax is required for 00074 * declarations within headers to properly import the variable. 00075 */ 00076 #define API_DECLARE_DATA 00077 #elif defined(API_DECLARE_STATIC) 00078 #define API_DECLARE(type) type __stdcall 00079 #define API_DECLARE_NONSTD(type) type 00080 #define API_DECLARE_DATA 00081 #elif defined(API_DECLARE_EXPORT) 00082 #define API_DECLARE(type) __declspec(dllexport) type __stdcall 00083 #define API_DECLARE_NONSTD(type) __declspec(dllexport) type 00084 #define API_DECLARE_DATA __declspec(dllexport) 00085 #else 00086 #define API_DECLARE(type) __declspec(dllimport) type __stdcall 00087 #define API_DECLARE_NONSTD(type) __declspec(dllimport) type 00088 #define API_DECLARE_DATA __declspec(dllimport) 00089 #endif 00090 00091 /* 00092 * apr_iconv_t: charset conversion descriptor type 00093 */ 00094 typedef void *apr_iconv_t; 00095 00096 /* __BEGIN_DECLS */ 00097 00098 API_DECLARE(apr_status_t) apr_iconv_open(const char *, const char *, apr_pool_t *, apr_iconv_t *); 00099 API_DECLARE(apr_status_t) apr_iconv(apr_iconv_t, const char **, apr_size_t *, char **, apr_size_t *, apr_size_t *); 00100 API_DECLARE(apr_status_t) apr_iconv_close(apr_iconv_t, apr_pool_t *); 00101 00102 /* __END_DECLS */ 00103 00104 #endif /* APR_ICONV_H */