1 /*=========================================================================
3 Program: KWSys - Kitware System Library
4 Module: $RCSfile: System.h.in,v $
6 Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved.
7 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notices for more information.
13 =========================================================================*/
14 #ifndef @KWSYS_NAMESPACE@_System_h
15 #define @KWSYS_NAMESPACE@_System_h
17 #include <@KWSYS_NAMESPACE@/Configure.h>
19 /* Redefine all public interface symbol names to be in the proper
20 namespace. These macros are used internally to kwsys only, and are
21 not visible to user code. Use kwsysHeaderDump.pl to reproduce
22 these macros after making changes to the interface. */
23 #if !defined(KWSYS_NAMESPACE)
24 # define kwsys_ns(x) @KWSYS_NAMESPACE@##x
25 # define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
27 #if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
28 # define kwsysSystem_Shell_GetArgumentForWindows kwsys_ns(System_Shell_GetArgumentForWindows)
29 # define kwsysSystem_Shell_GetArgumentForUnix kwsys_ns(System_Shell_GetArgumentForUnix)
30 # define kwsysSystem_Shell_GetArgumentSizeForWindows kwsys_ns(System_Shell_GetArgumentSizeForWindows)
31 # define kwsysSystem_Shell_GetArgumentSizeForUnix kwsys_ns(System_Shell_GetArgumentSizeForUnix)
32 # define kwsysSystem_Shell_Flag_e kwsys_ns(System_Shell_Flag_e)
33 # define kwsysSystem_Shell_Flag_Make kwsys_ns(System_Shell_Flag_Make)
34 # define kwsysSystem_Shell_Flag_VSIDE kwsys_ns(System_Shell_Flag_VSIDE)
35 # define kwsysSystem_Shell_Flag_EchoWindows kwsys_ns(System_Shell_Flag_EchoWindows)
36 # define kwsysSystem_Shell_Flag_WatcomWMake kwsys_ns(System_Shell_Flag_WatcomWMake)
37 # define kwsysSystem_Shell_Flag_MinGWMake kwsys_ns(System_Shell_Flag_MinGWMake)
38 # define kwsysSystem_Shell_Flag_NMake kwsys_ns(System_Shell_Flag_NMake)
39 # define kwsysSystem_Shell_Flag_AllowMakeVariables kwsys_ns(System_Shell_Flag_AllowMakeVariables)
43 #define @KWSYS_NAMESPACE@System_Shell_GetArgumentForUnix \
44 @KWSYS_NAMESPACE@System_Shell_UnixGA
45 #define @KWSYS_NAMESPACE@System_Shell_GetArgumentSizeForUnix \
46 @KWSYS_NAMESPACE@System_Shell_UnixGAS
47 #define @KWSYS_NAMESPACE@System_Shell_GetArgumentForWindows \
48 @KWSYS_NAMESPACE@System_Shell_WindowsGA
51 #if defined(__cplusplus)
57 * Transform the given command line argument for use in a Windows or
58 * Unix shell. Returns a pointer to the end of the command line
59 * argument in the provided output buffer. Flags may be passed to
60 * modify the generated quoting and escape sequences to work under
61 * alternative environments.
63 kwsysEXPORT
char* kwsysSystem_Shell_GetArgumentForWindows(const char* in
,
66 kwsysEXPORT
char* kwsysSystem_Shell_GetArgumentForUnix(const char* in
,
71 * Compute the size of the buffer required to store the output from
72 * kwsysSystem_Shell_GetArgumentForWindows or
73 * kwsysSystem_Shell_GetArgumentForUnix. The flags passed must be
74 * identical between the two calls.
76 kwsysEXPORT
int kwsysSystem_Shell_GetArgumentSizeForWindows(const char* in
,
78 kwsysEXPORT
int kwsysSystem_Shell_GetArgumentSizeForUnix(const char* in
,
82 * Flags to pass to kwsysSystem_Shell_GetArgumentForWindows or
83 * kwsysSystem_Shell_GetArgumentForUnix. These modify the generated
84 * quoting and escape sequences to work under alternative
87 enum kwsysSystem_Shell_Flag_e
89 /** The target shell is in a makefile. */
90 kwsysSystem_Shell_Flag_Make
= (1<<0),
92 /** The target shell is in a VS project file. Do not use with
94 kwsysSystem_Shell_Flag_VSIDE
= (1<<1),
96 /** In a windows shell the argument is being passed to "echo". */
97 kwsysSystem_Shell_Flag_EchoWindows
= (1<<2),
99 /** The target shell is in a Watcom WMake makefile. */
100 kwsysSystem_Shell_Flag_WatcomWMake
= (1<<3),
102 /** The target shell is in a MinGW Make makefile. */
103 kwsysSystem_Shell_Flag_MinGWMake
= (1<<4),
105 /** The target shell is in a NMake makefile. */
106 kwsysSystem_Shell_Flag_NMake
= (1<<6),
108 /** Make variable reference syntax $(MAKEVAR) should not be escaped
109 to allow a build tool to replace it. Replacement values
110 containing spaces, quotes, backslashes, or other
111 non-alphanumeric characters that have significance to some makes
112 or shells produce undefined behavior. */
113 kwsysSystem_Shell_Flag_AllowMakeVariables
= (1<<5)
116 #if defined(__cplusplus)
120 /* If we are building a kwsys .c or .cxx file, let it use these macros.
121 Otherwise, undefine them to keep the namespace clean. */
122 #if !defined(KWSYS_NAMESPACE)
125 # if !defined(KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
126 # undef kwsysSystem_Shell_GetArgumentForWindows
127 # undef kwsysSystem_Shell_GetArgumentForUnix
128 # undef kwsysSystem_Shell_GetArgumentSizeForWindows
129 # undef kwsysSystem_Shell_GetArgumentSizeForUnix
130 # undef kwsysSystem_Shell_Flag_e
131 # undef kwsysSystem_Shell_Flag_Make
132 # undef kwsysSystem_Shell_Flag_VSIDE
133 # undef kwsysSystem_Shell_Flag_EchoWindows
134 # undef kwsysSystem_Shell_Flag_WatcomWMake
135 # undef kwsysSystem_Shell_Flag_MinGWMake
136 # undef kwsysSystem_Shell_Flag_NMake
137 # undef kwsysSystem_Shell_Flag_AllowMakeVariables