curlx.h 3.5 KB

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