System.h.in 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*=========================================================================
  2. Program: KWSys - Kitware System Library
  3. Module: $RCSfile$
  4. Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved.
  5. See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even
  7. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  8. PURPOSE. See the above copyright notices for more information.
  9. =========================================================================*/
  10. #ifndef @KWSYS_NAMESPACE@_System_h
  11. #define @KWSYS_NAMESPACE@_System_h
  12. #include <@KWSYS_NAMESPACE@/Configure.h>
  13. /* Redefine all public interface symbol names to be in the proper
  14. namespace. These macros are used internally to kwsys only, and are
  15. not visible to user code. Use kwsysHeaderDump.pl to reproduce
  16. these macros after making changes to the interface. */
  17. #if !defined(KWSYS_NAMESPACE)
  18. # define kwsys_ns(x) @KWSYS_NAMESPACE@##x
  19. # define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
  20. #endif
  21. #define kwsysSystem_Shell_GetArgumentForWindows kwsys_ns(System_Shell_GetArgumentForWindows)
  22. #define kwsysSystem_Shell_GetArgumentForUnix kwsys_ns(System_Shell_GetArgumentForUnix)
  23. #define kwsysSystem_Shell_GetArgumentSizeForWindows kwsys_ns(System_Shell_GetArgumentSizeForWindows)
  24. #define kwsysSystem_Shell_GetArgumentSizeForUnix kwsys_ns(System_Shell_GetArgumentSizeForUnix)
  25. #define kwsysSystem_Shell_Flag_e kwsys_ns(System_Shell_Flag_e)
  26. #define kwsysSystem_Shell_Flag_Make kwsys_ns(System_Shell_Flag_Make)
  27. #define kwsysSystem_Shell_Flag_VSIDE kwsys_ns(System_Shell_Flag_VSIDE)
  28. #define kwsysSystem_Shell_Flag_EchoWindows kwsys_ns(System_Shell_Flag_EchoWindows)
  29. #define kwsysSystem_Shell_Flag_WatcomWMake kwsys_ns(System_Shell_Flag_WatcomWMake)
  30. #define kwsysSystem_Shell_Flag_MinGWMake kwsys_ns(System_Shell_Flag_MinGWMake)
  31. #define kwsysSystem_Shell_Flag_AllowMakeVariables kwsys_ns(System_Shell_Flag_AllowMakeVariables)
  32. #if defined(__cplusplus)
  33. extern "C"
  34. {
  35. #endif
  36. /**
  37. * Transform the given command line argument for use in a Windows or
  38. * Unix shell. Returns a pointer to the end of the command line
  39. * argument in the provided output buffer. Flags may be passed to
  40. * modify the generated quoting and escape sequences to work under
  41. * alternative environments.
  42. */
  43. kwsysEXPORT char* kwsysSystem_Shell_GetArgumentForWindows(const char* in,
  44. char* out,
  45. int flags);
  46. kwsysEXPORT char* kwsysSystem_Shell_GetArgumentForUnix(const char* in,
  47. char* out,
  48. int flags);
  49. /**
  50. * Compute the size of the buffer required to store the output from
  51. * kwsysSystem_Shell_GetArgumentForWindows or
  52. * kwsysSystem_Shell_GetArgumentForUnix. The flags passed must be
  53. * identical between the two calls.
  54. */
  55. kwsysEXPORT int kwsysSystem_Shell_GetArgumentSizeForWindows(const char* in,
  56. int flags);
  57. kwsysEXPORT int kwsysSystem_Shell_GetArgumentSizeForUnix(const char* in,
  58. int flags);
  59. /**
  60. * Flags to pass to kwsysSystem_Shell_GetArgumentForWindows or
  61. * kwsysSystem_Shell_GetArgumentForUnix. These modify the generated
  62. * quoting and escape sequences to work under alternative
  63. * environments.
  64. */
  65. enum kwsysSystem_Shell_Flag_e
  66. {
  67. /** The target shell is in a makefile. */
  68. kwsysSystem_Shell_Flag_Make = (1<<0),
  69. /** The target shell is in a VS project file. Do not use with
  70. Shell_Flag_Make. */
  71. kwsysSystem_Shell_Flag_VSIDE = (1<<1),
  72. /** In a windows shell the argument is being passed to "echo". */
  73. kwsysSystem_Shell_Flag_EchoWindows = (1<<2),
  74. /** The target shell is in a Watcom WMake makefile. */
  75. kwsysSystem_Shell_Flag_WatcomWMake = (1<<3),
  76. /** The target shell is in a MinGW Make makefile. */
  77. kwsysSystem_Shell_Flag_MinGWMake = (1<<4),
  78. /** Make variable reference syntax $(MAKEVAR) should not be escaped
  79. to allow a build tool to replace it. Replacement values
  80. containing spaces, quotes, backslashes, or other
  81. non-alphanumeric characters that have significance to some makes
  82. or shells produce undefined behavior. */
  83. kwsysSystem_Shell_Flag_AllowMakeVariables = (1<<5)
  84. };
  85. #if defined(__cplusplus)
  86. } /* extern "C" */
  87. #endif
  88. /* If we are building a kwsys .c or .cxx file, let it use these macros.
  89. Otherwise, undefine them to keep the namespace clean. */
  90. #if !defined(KWSYS_NAMESPACE)
  91. # undef kwsys_ns
  92. # undef kwsysEXPORT
  93. # undef kwsysSystem_Shell_GetArgumentForWindows
  94. # undef kwsysSystem_Shell_GetArgumentForUnix
  95. # undef kwsysSystem_Shell_GetArgumentSizeForWindows
  96. # undef kwsysSystem_Shell_GetArgumentSizeForUnix
  97. # undef kwsysSystem_Shell_Flag_e
  98. # undef kwsysSystem_Shell_Flag_Make
  99. # undef kwsysSystem_Shell_Flag_VSIDE
  100. # undef kwsysSystem_Shell_Flag_EchoWindows
  101. # undef kwsysSystem_Shell_Flag_WatcomWMake
  102. # undef kwsysSystem_Shell_Flag_MinGWMake
  103. # undef kwsysSystem_Shell_Flag_AllowMakeVariables
  104. #endif
  105. #endif