xref: /curl/lib/curlx.h (revision 9126b141)
1 #ifndef HEADER_CURL_CURLX_H
2 #define HEADER_CURL_CURLX_H
3 /***************************************************************************
4  *                                  _   _ ____  _
5  *  Project                     ___| | | |  _ \| |
6  *                             / __| | | | |_) | |
7  *                            | (__| |_| |  _ <| |___
8  *                             \___|\___/|_| \_\_____|
9  *
10  * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
11  *
12  * This software is licensed as described in the file COPYING, which
13  * you should have received as part of this distribution. The terms
14  * are also available at https://curl.se/docs/copyright.html.
15  *
16  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17  * copies of the Software, and permit persons to whom the Software is
18  * furnished to do so, under the terms of the COPYING file.
19  *
20  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21  * KIND, either express or implied.
22  *
23  * SPDX-License-Identifier: curl
24  *
25  ***************************************************************************/
26 
27 /*
28  * Defines protos and includes all header files that provide the curlx_*
29  * functions. The curlx_* functions are not part of the libcurl API, but are
30  * stand-alone functions whose sources can be built and linked by apps if need
31  * be.
32  */
33 
34 #include <curl/mprintf.h>
35 /* this is still a public header file that provides the curl_mprintf()
36    functions while they still are offered publicly. They will be made library-
37    private one day */
38 
39 #include "strcase.h"
40 /* "strcase.h" provides the strcasecompare protos */
41 
42 #include "strtoofft.h"
43 /* "strtoofft.h" provides this function: curlx_strtoofft(), returns a
44    curl_off_t number from a given string.
45 */
46 
47 #include "nonblock.h"
48 /* "nonblock.h" provides curlx_nonblock() */
49 
50 #include "warnless.h"
51 /* "warnless.h" provides functions:
52 
53   curlx_ultous()
54   curlx_ultouc()
55   curlx_uztosi()
56 */
57 
58 #include "curl_multibyte.h"
59 /* "curl_multibyte.h" provides these functions and macros:
60 
61   curlx_convert_UTF8_to_wchar()
62   curlx_convert_wchar_to_UTF8()
63   curlx_convert_UTF8_to_tchar()
64   curlx_convert_tchar_to_UTF8()
65   curlx_unicodefree()
66 */
67 
68 #include "version_win32.h"
69 /* "version_win32.h" provides curlx_verify_windows_version() */
70 
71 /* Now setup curlx_ * names for the functions that are to become curlx_ and
72    be removed from a future libcurl official API:
73    curlx_getenv
74    curlx_mprintf (and its variations)
75    curlx_strcasecompare
76    curlx_strncasecompare
77 
78 */
79 
80 #define curlx_mvsnprintf curl_mvsnprintf
81 #define curlx_msnprintf curl_msnprintf
82 #define curlx_maprintf curl_maprintf
83 #define curlx_mvaprintf curl_mvaprintf
84 #define curlx_msprintf curl_msprintf
85 #define curlx_mprintf curl_mprintf
86 #define curlx_mfprintf curl_mfprintf
87 #define curlx_mvsprintf curl_mvsprintf
88 #define curlx_mvprintf curl_mvprintf
89 #define curlx_mvfprintf curl_mvfprintf
90 
91 #ifdef ENABLE_CURLX_PRINTF
92 /* If this define is set, we define all "standard" printf() functions to use
93    the curlx_* version instead. It makes the source code transparent and
94    easier to understand/patch. Undefine them first. */
95 # undef printf
96 # undef fprintf
97 # undef sprintf
98 # undef msnprintf
99 # undef vprintf
100 # undef vfprintf
101 # undef vsprintf
102 # undef mvsnprintf
103 # undef aprintf
104 # undef vaprintf
105 
106 # define printf curlx_mprintf
107 # define fprintf curlx_mfprintf
108 # define sprintf curlx_msprintf
109 # define msnprintf curlx_msnprintf
110 # define vprintf curlx_mvprintf
111 # define vfprintf curlx_mvfprintf
112 # define mvsnprintf curlx_mvsnprintf
113 # define aprintf curlx_maprintf
114 # define vaprintf curlx_mvaprintf
115 #endif /* ENABLE_CURLX_PRINTF */
116 
117 #endif /* HEADER_CURL_CURLX_H */
118