curlx.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. * Defines protos and includes all header files that provide the curlx_*
  28. * functions. The curlx_* functions are not part of the libcurl API, but are
  29. * stand-alone functions whose sources can be built and linked by apps if need
  30. * be.
  31. */
  32. #include <curl/mprintf.h>
  33. /* this is still a public header file that provides the curl_mprintf()
  34. functions while they still are offered publicly. They will be made library-
  35. private one day */
  36. #include "strcase.h"
  37. /* "strcase.h" provides the strcasecompare protos */
  38. #include "strtoofft.h"
  39. /* "strtoofft.h" provides this function: curlx_strtoofft(), returns a
  40. curl_off_t number from a given string.
  41. */
  42. #include "nonblock.h"
  43. /* "nonblock.h" provides curlx_nonblock() */
  44. #include "warnless.h"
  45. /* "warnless.h" provides functions:
  46. curlx_ultous()
  47. curlx_ultouc()
  48. curlx_uztosi()
  49. */
  50. #include "curl_multibyte.h"
  51. /* "curl_multibyte.h" provides these functions and macros:
  52. curlx_convert_UTF8_to_wchar()
  53. curlx_convert_wchar_to_UTF8()
  54. curlx_convert_UTF8_to_tchar()
  55. curlx_convert_tchar_to_UTF8()
  56. curlx_unicodefree()
  57. */
  58. #include "version_win32.h"
  59. /* "version_win32.h" provides curlx_verify_windows_version() */
  60. /* Now setup curlx_ * names for the functions that are to become curlx_ and
  61. be removed from a future libcurl official API:
  62. curlx_getenv
  63. curlx_mprintf (and its variations)
  64. curlx_strcasecompare
  65. curlx_strncasecompare
  66. */
  67. #define curlx_mvsnprintf curl_mvsnprintf
  68. #define curlx_msnprintf curl_msnprintf
  69. #define curlx_maprintf curl_maprintf
  70. #define curlx_mvaprintf curl_mvaprintf
  71. #define curlx_msprintf curl_msprintf
  72. #define curlx_mprintf curl_mprintf
  73. #define curlx_mfprintf curl_mfprintf
  74. #define curlx_mvsprintf curl_mvsprintf
  75. #define curlx_mvprintf curl_mvprintf
  76. #define curlx_mvfprintf curl_mvfprintf
  77. #ifdef ENABLE_CURLX_PRINTF
  78. /* If this define is set, we define all "standard" printf() functions to use
  79. the curlx_* version instead. It makes the source code transparent and
  80. easier to understand/patch. Undefine them first. */
  81. # undef printf
  82. # undef fprintf
  83. # undef sprintf
  84. # undef msnprintf
  85. # undef vprintf
  86. # undef vfprintf
  87. # undef vsprintf
  88. # undef mvsnprintf
  89. # undef aprintf
  90. # undef vaprintf
  91. # define printf curlx_mprintf
  92. # define fprintf curlx_mfprintf
  93. # define sprintf curlx_msprintf
  94. # define msnprintf curlx_msnprintf
  95. # define vprintf curlx_mvprintf
  96. # define vfprintf curlx_mvfprintf
  97. # define mvsnprintf curlx_mvsnprintf
  98. # define aprintf curlx_maprintf
  99. # define vaprintf curlx_mvaprintf
  100. #endif /* ENABLE_CURLX_PRINTF */
  101. #endif /* HEADER_CURL_CURLX_H */