curlx.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #ifndef __CURLX_H
  2. #define __CURLX_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2004, Daniel Stenberg, <[email protected]>, 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 http://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. * $Id$
  24. ***************************************************************************/
  25. /*
  26. * Defines protos and includes all header files that provide the curlx_*
  27. * functions. The curlx_* functions are not part of the libcurl API, but are
  28. * stand-alone functions whose sources can be built and linked by apps if need
  29. * be.
  30. */
  31. #include <curl/mprintf.h>
  32. /* this is still a public header file that provides the curl_mprintf()
  33. functions while they still are offered publicly. They will be made library-
  34. private one day */
  35. #include "strequal.h"
  36. /* "strequal.h" provides the strequal protos */
  37. #include "strtoofft.h"
  38. /* "strtoofft.h" provides this function: curlx_strtoofft(), returns a
  39. curl_off_t number from a given string.
  40. */
  41. #include "timeval.h"
  42. /*
  43. "timeval.h" sets up a 'struct timeval' even for platforms that otherwise
  44. don't have one and has protos for these functions:
  45. curlx_tvnow()
  46. curlx_tvdiff()
  47. curlx_tvdiff_secs()
  48. */
  49. /* Now setup curlx_ * names for the functions that are to become curlx_ and
  50. be removed from a future libcurl official API:
  51. curlx_getenv
  52. curlx_mprintf (and its variations)
  53. curlx_strequal
  54. curlx_strnequal
  55. */
  56. #define curlx_getenv curl_getenv
  57. #define curlx_strequal curl_strequal
  58. #define curlx_strnequal curl_strnequal
  59. #define curlx_mvsnprintf curl_mvsnprintf
  60. #define curlx_msnprintf curl_msnprintf
  61. #define curlx_maprintf curl_maprintf
  62. #define curlx_mvaprintf curl_mvaprintf
  63. #define curlx_msprintf curl_msprintf
  64. #define curlx_mprintf curl_mprintf
  65. #define curlx_mfprintf curl_mfprintf
  66. #define curlx_mvsprintf curl_mvsprintf
  67. #define curlx_mvprintf curl_mvprintf
  68. #define curlx_mvfprintf curl_mvfprintf
  69. #ifdef ENABLE_CURLX_PRINTF
  70. /* If this define is set, we define all "standard" printf() functions to use
  71. the curlx_* version instead. It makes the source code transparant and
  72. easier to understand/patch. */
  73. # define printf curlx_mprintf
  74. # define fprintf curlx_mfprintf
  75. # define sprintf curlx_msprintf
  76. # define snprintf curlx_msnprintf
  77. # define vprintf curlx_mvprintf
  78. # define vfprintf curlx_mvfprintf
  79. # define vsprintf curlx_mvsprintf
  80. # define vsnprintf curlx_mvsnprintf
  81. # define aprintf curlx_maprintf
  82. # define vaprintf curlx_mvaprintf
  83. #endif /* ENABLE_CURLX_PRINTF */
  84. #endif /* __CURLX_H */