curl_multibyte.h
Go to the documentation of this file.
00001 #ifndef HEADER_CURL_MULTIBYTE_H
00002 #define HEADER_CURL_MULTIBYTE_H
00003 /***************************************************************************
00004  *                                  _   _ ____  _
00005  *  Project                     ___| | | |  _ \| |
00006  *                             / __| | | | |_) | |
00007  *                            | (__| |_| |  _ <| |___
00008  *                             \___|\___/|_| \_\_____|
00009  *
00010  * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
00011  *
00012  * This software is licensed as described in the file COPYING, which
00013  * you should have received as part of this distribution. The terms
00014  * are also available at https://curl.haxx.se/docs/copyright.html.
00015  *
00016  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
00017  * copies of the Software, and permit persons to whom the Software is
00018  * furnished to do so, under the terms of the COPYING file.
00019  *
00020  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
00021  * KIND, either express or implied.
00022  *
00023  ***************************************************************************/
00024 #include "curl_setup.h"
00025 
00026 #if defined(USE_WIN32_IDN) || ((defined(USE_WINDOWS_SSPI) || \
00027                                 defined(USE_WIN32_LDAP)) && defined(UNICODE))
00028 
00029  /*
00030   * MultiByte conversions using Windows kernel32 library.
00031   */
00032 
00033 wchar_t *Curl_convert_UTF8_to_wchar(const char *str_utf8);
00034 char *Curl_convert_wchar_to_UTF8(const wchar_t *str_w);
00035 
00036 #endif /* USE_WIN32_IDN || ((USE_WINDOWS_SSPI || USE_WIN32_LDAP) && UNICODE) */
00037 
00038 
00039 #if defined(USE_WIN32_IDN) || defined(USE_WINDOWS_SSPI) || \
00040     defined(USE_WIN32_LDAP)
00041 
00042 /*
00043  * Macros Curl_convert_UTF8_to_tchar(), Curl_convert_tchar_to_UTF8()
00044  * and Curl_unicodefree() main purpose is to minimize the number of
00045  * preprocessor conditional directives needed by code using these
00046  * to differentiate UNICODE from non-UNICODE builds.
00047  *
00048  * When building with UNICODE defined, this two macros
00049  * Curl_convert_UTF8_to_tchar() and Curl_convert_tchar_to_UTF8()
00050  * return a pointer to a newly allocated memory area holding result.
00051  * When the result is no longer needed, allocated memory is intended
00052  * to be free'ed with Curl_unicodefree().
00053  *
00054  * When building without UNICODE defined, this macros
00055  * Curl_convert_UTF8_to_tchar() and Curl_convert_tchar_to_UTF8()
00056  * return the pointer received as argument. Curl_unicodefree() does
00057  * no actual free'ing of this pointer it is simply set to NULL.
00058  */
00059 
00060 #ifdef UNICODE
00061 
00062 #define Curl_convert_UTF8_to_tchar(ptr) Curl_convert_UTF8_to_wchar((ptr))
00063 #define Curl_convert_tchar_to_UTF8(ptr) Curl_convert_wchar_to_UTF8((ptr))
00064 #define Curl_unicodefree(ptr) \
00065   do {if((ptr)) {free((ptr)); (ptr) = NULL;}} WHILE_FALSE
00066 
00067 typedef union {
00068   unsigned short       *tchar_ptr;
00069   const unsigned short *const_tchar_ptr;
00070   unsigned short       *tbyte_ptr;
00071   const unsigned short *const_tbyte_ptr;
00072 } xcharp_u;
00073 
00074 #else
00075 
00076 #define Curl_convert_UTF8_to_tchar(ptr) (ptr)
00077 #define Curl_convert_tchar_to_UTF8(ptr) (ptr)
00078 #define Curl_unicodefree(ptr) \
00079   do {(ptr) = NULL;} WHILE_FALSE
00080 
00081 typedef union {
00082   char                *tchar_ptr;
00083   const char          *const_tchar_ptr;
00084   unsigned char       *tbyte_ptr;
00085   const unsigned char *const_tbyte_ptr;
00086 } xcharp_u;
00087 
00088 #endif /* UNICODE */
00089 
00090 #endif /* USE_WIN32_IDN || USE_WINDOWS_SSPI || USE_WIN32_LDAP */
00091 
00092 #endif /* HEADER_CURL_MULTIBYTE_H */


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:02