System.h.in 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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_AllowMakeVariables kwsys_ns(System_Shell_Flag_AllowMakeVariables)
  31. #if defined(__cplusplus)
  32. extern "C"
  33. {
  34. #endif
  35. /**
  36. * Transform the given command line argument for use in a Windows or
  37. * Unix shell. Returns a pointer to the end of the command line
  38. * argument in the provided output buffer. Flags may be passed to
  39. * modify the generated quoting and escape sequences to work under
  40. * alternative environments.
  41. */
  42. kwsysEXPORT char* kwsysSystem_Shell_GetArgumentForWindows(const char* in,
  43. char* out,
  44. int flags);
  45. kwsysEXPORT char* kwsysSystem_Shell_GetArgumentForUnix(const char* in,
  46. char* out,
  47. int flags);
  48. /**
  49. * Compute the size of the buffer required to store the output from
  50. * kwsysSystem_Shell_GetArgumentForWindows or
  51. * kwsysSystem_Shell_GetArgumentForUnix. The flags passed must be
  52. * identical between the two calls.
  53. */
  54. kwsysEXPORT int kwsysSystem_Shell_GetArgumentSizeForWindows(const char* in,
  55. int flags);
  56. kwsysEXPORT int kwsysSystem_Shell_GetArgumentSizeForUnix(const char* in,
  57. int flags);
  58. /**
  59. * Flags to pass to kwsysSystem_Shell_GetArgumentForWindows or
  60. * kwsysSystem_Shell_GetArgumentForUnix. These modify the generated
  61. * quoting and escape sequences to work under alternative
  62. * environments.
  63. */
  64. enum kwsysSystem_Shell_Flag_e
  65. {
  66. /** The target shell is in a makefile. */
  67. kwsysSystem_Shell_Flag_Make = (1<<0),
  68. /** The target shell is in a VS project file. Do not use with
  69. Shell_Flag_Make. */
  70. kwsysSystem_Shell_Flag_VSIDE = (1<<1),
  71. /** In a windows shell the argument is being passed to "echo". */
  72. kwsysSystem_Shell_Flag_EchoWindows = (1<<2),
  73. /** The target shell is in a Watcom WMake makefile. */
  74. kwsysSystem_Shell_Flag_WatcomWMake = (1<<3),
  75. /** Make variable reference syntax $(MAKEVAR) should not be escaped
  76. to allow a build tool to replace it. Replacement values
  77. containing spaces, quotes, backslashes, or other
  78. non-alphanumeric characters that have significance to some makes
  79. or shells produce undefined behavior. */
  80. kwsysSystem_Shell_Flag_AllowMakeVariables = (1<<4)
  81. };
  82. #if defined(__cplusplus)
  83. } /* extern "C" */
  84. #endif
  85. /* If we are building a kwsys .c or .cxx file, let it use these macros.
  86. Otherwise, undefine them to keep the namespace clean. */
  87. #if !defined(KWSYS_NAMESPACE)
  88. # undef kwsys_ns
  89. # undef kwsysEXPORT
  90. # undef kwsysSystem_Shell_GetArgumentForWindows
  91. # undef kwsysSystem_Shell_GetArgumentForUnix
  92. # undef kwsysSystem_Shell_GetArgumentSizeForWindows
  93. # undef kwsysSystem_Shell_GetArgumentSizeForUnix
  94. # undef kwsysSystem_Shell_Flag_e
  95. # undef kwsysSystem_Shell_Flag_Make
  96. # undef kwsysSystem_Shell_Flag_VSIDE
  97. # undef kwsysSystem_Shell_Flag_EchoWindows
  98. # undef kwsysSystem_Shell_Flag_WatcomWMake
  99. # undef kwsysSystem_Shell_Flag_AllowMakeVariables
  100. #endif
  101. #endif