tool_setup.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #ifndef HEADER_CURL_TOOL_SETUP_H
  2. #define HEADER_CURL_TOOL_SETUP_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. #define CURL_NO_OLDIES
  27. /*
  28. * curl_setup.h may define preprocessor macros such as _FILE_OFFSET_BITS and
  29. * _LARGE_FILES in order to support files larger than 2 GB. On platforms
  30. * where this happens it is mandatory that these macros are defined before
  31. * any system header file is included, otherwise file handling function
  32. * prototypes will be misdeclared and curl tool may not build properly;
  33. * therefore we must include curl_setup.h before curl.h when building curl.
  34. */
  35. #include "curl_setup.h" /* from the lib directory */
  36. extern FILE *tool_stderr;
  37. /*
  38. * curl tool certainly uses libcurl's external interface.
  39. */
  40. #include <curl/curl.h> /* external interface */
  41. /*
  42. * Platform specific stuff.
  43. */
  44. #ifdef macintosh
  45. # define main(x,y) curl_main(x,y)
  46. #endif
  47. #ifndef OS
  48. # define OS "unknown"
  49. #endif
  50. #ifndef UNPRINTABLE_CHAR
  51. /* define what to use for unprintable characters */
  52. # define UNPRINTABLE_CHAR '.'
  53. #endif
  54. #ifndef HAVE_STRDUP
  55. # include "tool_strdup.h"
  56. #endif
  57. #if defined(_WIN32)
  58. /* set in win32_init() */
  59. extern LARGE_INTEGER tool_freq;
  60. extern bool tool_isVistaOrGreater;
  61. /* set in init_terminal() */
  62. extern bool tool_term_has_bold;
  63. #endif
  64. #if defined(_WIN32) && !defined(HAVE_FTRUNCATE)
  65. int tool_ftruncate64(int fd, curl_off_t where);
  66. #undef ftruncate
  67. #define ftruncate(fd,where) tool_ftruncate64(fd,where)
  68. #define HAVE_FTRUNCATE 1
  69. #define USE_TOOL_FTRUNCATE 1
  70. #endif /* _WIN32 && ! HAVE_FTRUNCATE */
  71. #endif /* HEADER_CURL_TOOL_SETUP_H */